@cognigy/webchat 3.43.0 → 3.44.0
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/OSS_LICENSES.txt +2 -2
- package/dist/webchat.esm.js +92 -26
- package/dist/webchat.js +5 -5
- package/package.json +1 -1
package/dist/webchat.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* webchat.js v3.
|
|
3
|
-
* https://github.com/Cognigy/Webchat/tree/v3.
|
|
4
|
-
* https://github.com/Cognigy/Webchat/tree/v3.
|
|
2
|
+
* webchat.js v3.44.0
|
|
3
|
+
* https://github.com/Cognigy/Webchat/tree/v3.44.0
|
|
4
|
+
* https://github.com/Cognigy/Webchat/tree/v3.44.0/OSS_LICENSES.txt
|
|
5
5
|
*/(()=>{var e,t,n={1510(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldForceWebsockets=void 0;const r=(0,n(8809).detect)();t.shouldForceWebsockets=()=>{if(!r)return!0;switch(r.name){case"ie":case"ios":case"ios-webview":case"crios":case"safari":case"chrome":case"chromium-webview":case"node":return console.log('[SocketClient] Enabling "forceWebsockets" by default for compatibility with this environment.'),!0;default:return!0}}},2166(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.SocketClient=void 0;const i=n(8657),o=n(5325),a=n(4845),s=n(1510);class l extends i.EventEmitter{static createDefaultSocketOptions(){return{channel:"socket-client",userId:`user-${(0,a.v4)()}`,sessionId:`session-${(0,a.v4)()}`,testMode:!1,emitWithAck:!0,expiresIn:null,forceWebsockets:!1,disableWebsockets:!1,interval:1e4,passthroughIP:null,reconnection:!0,reconnectionLimit:5,enableInnerSocketHandshake:!1,resetFlow:!1}}static completeSocketOptions(e={}){const t=Object.assign(Object.assign({},l.createDefaultSocketOptions()),e);return e.forceWebsockets||e.disableWebsockets||(t.forceWebsockets=(0,s.shouldForceWebsockets)()),t}constructor(e,t,n){super(),this.messageBuffer=[],this._isEndpointReady=!1,this.socketUrl=e,this.socketURLToken=t,this.socketOptions=l.completeSocketOptions(n),this.reconnectCounter=0,this.updateLastUsed()}resetReconnectionCounter(){this.reconnectCounter=0}registerReconnectionAttempt(){this.reconnectCounter++,console.log("[SocketClient] Trying to reconnect"),this.shouldStopReconnecting()&&(console.log("[SocketClient] Reconnection attempts limit reached. Giving up."),this.emit("socket/error",{type:"RECONNECTION_LIMIT"}))}shouldStopReconnecting(){const{reconnectionLimit:e}=this.socketOptions;return 0!==e&&e<=this.reconnectCounter}flushMessageBuffer(){if(this.messageBuffer.length>0)if(this.connected&&this.isEndpointReady){console.log("[SocketClient] Starting to send your buffered messages...");for(let e of this.messageBuffer)this.sendMessage(e.text,e.data);console.log(`[SocketClient] Finished sending ${this.messageBuffer.length} buffered messages.`),this.messageBuffer=[]}else console.log("[SocketClient] Could not send your buffered messages because we are not connected or the Endpoint is not yet ready")}setupReconnectInterval(){this.socketReconnectInterval||(this.socketReconnectInterval=setInterval(()=>r(this,void 0,void 0,function*(){if(!this.connected&&!this.shouldStopReconnecting()){this.registerReconnectionAttempt();try{const e=!0;yield this.connect(e),console.log("[SocketClient] Successfully reconnected.")}catch(e){console.error(`[SocketClient] Failed to reconnect, error was: ${JSON.stringify(e)}`)}}}),this.socketOptions.interval))}updateLastUsed(){this.lastUsed=Date.now()}get isEndpointReady(){return this._isEndpointReady}get connected(){return!!this.socket&&this.socket.connected}get expired(){return null!==this.socketOptions.expiresIn&&Date.now()-this.lastUsed>this.socketOptions.expiresIn}connect(e=!1){return r(this,void 0,void 0,function*(){const e=new URL(this.socketUrl),t={path:e.pathname&&"/"!==e.pathname?e.pathname+"/socket.io":null,reconnection:!1,upgrade:!0,transports:["polling","websocket"],autoConnect:!1};this.socketOptions.forceWebsockets?t.transports=["websocket"]:this.socketOptions.disableWebsockets&&(t.transports=["polling"],t.upgrade=!1),this.socketOptions.enableInnerSocketHandshake?t.query={handshake:"true"}:t.query={sessionId:encodeURIComponent(this.socketOptions.sessionId),urlToken:encodeURIComponent(this.socketURLToken),userId:encodeURIComponent(this.socketOptions.userId),testMode:encodeURIComponent(this.socketOptions.testMode?"true":"false"),emitWithAck:encodeURIComponent(this.socketOptions.emitWithAck?"true":"false")};const n=(0,o.io)(e.origin,t);return["connect","connect_error","connect_timeout","error","disconnect","reconnect","reconnect_attempt","reconnecting","reconnect_error","reconnect_failed","ping","pong"].forEach(e=>{n.on(e,t=>{this.emit(`socket/${e}`,t)})}),n.on("exception",e=>this.emit("exception",e)),n.on("typingStatus",e=>this.emit("typingStatus",e)),n.on("finalPing",(e,t)=>{t&&"function"==typeof t&&t(),this.emit("finalPing",e)}),n.on("output",(e,t)=>{if(t&&"function"==typeof t&&t(),e&&"error"===e.type)return this.emit("error",e.data.error);if(e&&"output"===e.type){let t=e.data;this.emit("output",t)}e&&"finalPing"===e.type&&this.emit("finalPing",e.data)}),yield new Promise((e,t)=>{n.on("connect_error",()=>t(new Error("[SocketClient] Error connecting"))),n.on("connect_timeout",()=>t(new Error("[SocketClient] Error connecting"))),this.socketOptions.enableInnerSocketHandshake&&n.on("handshake",t=>{const{userId:n,sessionId:r,testMode:i,emitWithAck:o}=this.socketOptions,a={userId:n,sessionId:r,urlToken:this.socketURLToken,testMode:i,emitWithAck:o};console.log("[SocketClient] completing session handshake"),t(a),e()}),n.on("connect",()=>{this._isEndpointReady=!1,this.socket=n,this.socketOptions.reconnection&&this.setupReconnectInterval()}),n.once("endpoint-ready",()=>{this._isEndpointReady=!0,this.flushMessageBuffer(),e()}),n.connect()}),this})}switchSession(e){return r(this,void 0,void 0,function*(){return this.disconnect(),this.socketOptions.sessionId=e||`session-${(0,a.v4)()}`,this.reconnectCounter=0,this.updateLastUsed(),yield this.connect(),console.log("[SocketClient] switched session"),this})}disconnect(){return clearInterval(this.socketReconnectInterval),this.socketReconnectInterval=null,this.socket&&(this.socket.disconnect(),this.socket=null),this}sendMessage(e,t){return this.connected&&this.isEndpointReady?(this.resetReconnectionCounter(),this.updateLastUsed(),this.socket.emit("processInput",{URLToken:this.socketURLToken,userId:this.socketOptions.userId,sessionId:this.socketOptions.sessionId,channel:this.socketOptions.channel,source:"device",passthroughIP:this.socketOptions.passthroughIP,resetFlow:!!this.socketOptions.resetFlow,text:e,data:t})):(this.messageBuffer.push({text:e,data:t}),console.log("[SocketClient] Unable to directly send your message since we are not connected or the Endpoint is not yet ready to accept messages. Your message will be buffered and sent later on.")),this}sendTypingStatus(e){return this.connected&&this.isEndpointReady&&this.socket.emit("typingStatus",{status:e}),this}}t.SocketClient=l},7028(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&a[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),i&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=i):u[4]="".concat(i)),t.push(u))}},t}},3051(e){"use strict";e.exports=function(e){return e[1]}},1636(e,t){
|
|
6
6
|
/*!
|
|
7
7
|
* Converts CSS stylesheets between left-to-right and right-to-left.
|
|
@@ -477,7 +477,7 @@ var t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.l
|
|
|
477
477
|
* @license MIT license
|
|
478
478
|
* @link http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136
|
|
479
479
|
**/
|
|
480
|
-
var s=function(){function e(){}return e.generate=function(){var t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return e.lut[255&t]+e.lut[t>>8&255]+e.lut[t>>16&255]+e.lut[t>>24&255]+"-"+e.lut[255&n]+e.lut[n>>8&255]+"-"+e.lut[n>>16&15|64]+e.lut[n>>24&255]+"-"+e.lut[63&r|128]+e.lut[r>>8&255]+"-"+e.lut[r>>16&255]+e.lut[r>>24&255]+e.lut[255&i]+e.lut[i>>8&255]+e.lut[i>>16&255]+e.lut[i>>24&255]},e.initialize=function(){for(var t=0;t<256;t++)e.lut[t]=(t<16?"0":"")+t.toString(16)},e.lut=[],e}();e.UUID=s,s.initialize()}(Sw)),Sw}var xw,Iw={};function Lw(){if(xw)return Iw;var e;xw=1,Object.defineProperty(Iw,"__esModule",{value:!0}),Iw.clearElementChildren=Iw.getScrollY=Iw.getScrollX=Iw.getFitStatus=Iw.truncate=Iw.truncateText=Iw.stringToCssColor=Iw.parseEnum=Iw.getEnumValueByName=Iw.parseBool=Iw.parseNumber=Iw.parseString=Iw.appendChild=Iw.generateUniqueId=Iw.isMobileOS=Iw.isInternetExplorer=void 0;var t=Mw(),n=Dw();function r(e,t){for(var n in e){var r=parseInt(n,10);if(r>=0){var i=e[n];if(i&&"string"==typeof i&&i.toLowerCase()===t.toLowerCase())return r}}}function i(e,t,n,r,i){var o=function(){return t-e.scrollHeight>=-1};if(!o()){for(var s=function(e){var t=[],n=a(e,-1);for(;n<e.length;)" "===e[n]&&t.push(n),n=a(e,n);return t}(n),l=0,c=s.length,u=0;l<c;){var d=Math.floor((l+c)/2);r(n,s[d]),o()?(u=s[d],l=d+1):c=d}if(r(n,u),i&&t-e.scrollHeight>=i-1){for(var p=a(n,u);p<n.length&&(r(n,p),o());)u=p,p=a(n,p);r(n,u)}}}Iw.isInternetExplorer=function(){return void 0!==window.document.documentMode},Iw.isMobileOS=function(){var e=window.navigator.userAgent;return!!e.match(/Android/i)||!!e.match(/iPad/i)||!!e.match(/iPhone/i)},Iw.generateUniqueId=function(){return"__ac-"+n.UUID.generate()},Iw.appendChild=function(e,t){t&&e.appendChild(t)},Iw.parseString=function(e,t){return"string"==typeof e?e:t},Iw.parseNumber=function(e,t){return"number"==typeof e?e:t},Iw.parseBool=function(e,t){if("boolean"==typeof e)return e;if("string"==typeof e)switch(e.toLowerCase()){case"true":return!0;case"false":return!1;default:return t}return t},Iw.getEnumValueByName=r,Iw.parseEnum=function(e,t,n){if(!t)return n;var i=r(e,t);return void 0!==i?i:n},Iw.stringToCssColor=function(e){if(e){var t=/#([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})?/gi.exec(e);if(t&&t[4]){var n=parseInt(t[1],16)/255;return"rgba("+parseInt(t[2],16)+","+parseInt(t[3],16)+","+parseInt(t[4],16)+","+n+")"}}return e},Iw.truncateText=function(e,t,n){i(e,t,e.innerText,function(t,n){e.innerText=t.substring(0,n)+"..."},n)};var o="undefined"==typeof window||null===(e=window.trustedTypes)||void 0===e?void 0:e.createPolicy("adaptivecards#deprecatedExportedFunctionPolicy",{createHTML:function(e){return e}});function a(e,t){for(t+=1;t<e.length&&"<"===e[t];)for(;t<e.length&&">"!==e[t++];);return t}return Iw.truncate=function(e,t,n){i(e,t,e.innerHTML,function(t,n){var r,i=t.substring(0,n)+"...",a=null!==(r=null==o?void 0:o.createHTML(i))&&void 0!==r?r:i;e.innerHTML=a},n)},Iw.getFitStatus=function(e,n){var r=e.offsetTop;return r+e.clientHeight<=n?t.ContainerFitStatus.FullyInContainer:r<n?t.ContainerFitStatus.Overflowing:t.ContainerFitStatus.FullyOutOfContainer},Iw.getScrollX=function(){return window.pageXOffset},Iw.getScrollY=function(){return window.pageYOffset},Iw.clearElementChildren=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},Iw}var Pw,Ow={};function Rw(){if(Pw)return Ow;Pw=1;var e=Ow&&Ow.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Ow,"__esModule",{value:!0}),Ow.SerializableObject=Ow.property=Ow.SerializableObjectSchema=Ow.CustomProperty=Ow.SerializableObjectCollectionProperty=Ow.SerializableObjectProperty=Ow.EnumProperty=Ow.ValueSetProperty=Ow.StringArrayProperty=Ow.PixelSizeProperty=Ow.NumProperty=Ow.BoolProperty=Ow.StringProperty=Ow.PropertyDefinition=Ow.BaseSerializationContext=Ow.isVersionLessOrEqual=Ow.Versions=Ow.Version=void 0;var t=Dw(),n=Lw(),r=Mw(),i=kw(),o=function(){function e(e,t,n){void 0===e&&(e=1),void 0===t&&(t=1),this._isValid=!0,this._major=e,this._minor=t,this._label=n}return e.parse=function(t,n){if(t){var o=new e;o._versionString=t;var a=/(\d+).(\d+)/gi.exec(t);return null!=a&&3===a.length?(o._major=parseInt(a[1]),o._minor=parseInt(a[2])):o._isValid=!1,o._isValid||n.logParseEvent(void 0,r.ValidationEvent.InvalidPropertyValue,i.Strings.errors.invalidVersionString(o._versionString)),o}},e.prototype.toString=function(){return this._isValid?this._major+"."+this._minor:this._versionString},e.prototype.toJSON=function(){return this.toString()},e.prototype.compareTo=function(e){if(!this.isValid||!e.isValid)throw new Error("Cannot compare invalid version.");return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:0},Object.defineProperty(e.prototype,"label",{get:function(){return this._label?this._label:this.toString()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"major",{get:function(){return this._major},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minor",{get:function(){return this._minor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isValid",{get:function(){return this._isValid},enumerable:!1,configurable:!0}),e}();Ow.Version=o;var a=function(){function e(){}return e.getAllDeclaredVersions=function(){var t=e,n=[];for(var r in t)if(r.match(/^v[0-9_]*$/))try{var i=t[r];i instanceof o&&n.push(i)}catch(e){}return n.sort(function(e,t){return e.compareTo(t)})},e.v1_0=new o(1,0),e.v1_1=new o(1,1),e.v1_2=new o(1,2),e.v1_3=new o(1,3),e.v1_4=new o(1,4),e.v1_5=new o(1,5),e.v1_6=new o(1,6,"1.6 Preview"),e.latest=e.v1_5,e}();Ow.Versions=a,Ow.isVersionLessOrEqual=function(e,t){return!(e instanceof o)||(!(t instanceof o)||t.compareTo(e)>=0)};var s=function(){function e(e){void 0===e&&(e=a.latest),this._validationEvents=[],this.targetVersion=e}return e.prototype.serializeValue=function(e,n,r,i,o){void 0===i&&(i=void 0),void 0===o&&(o=!1),null==r||r===i?t.GlobalSettings.enableFullJsonRoundTrip&&!o||delete e[n]:r===i?delete e[n]:e[n]=r},e.prototype.serializeString=function(e,n,r,i){null==r||r===i?t.GlobalSettings.enableFullJsonRoundTrip||delete e[n]:e[n]=r},e.prototype.serializeBool=function(e,n,r,i){null==r||r===i?t.GlobalSettings.enableFullJsonRoundTrip||delete e[n]:e[n]=r},e.prototype.serializeNumber=function(e,n,r,i){null==r||r===i||isNaN(r)?t.GlobalSettings.enableFullJsonRoundTrip||delete e[n]:e[n]=r},e.prototype.serializeEnum=function(e,n,r,i,o){void 0===o&&(o=void 0),null==i||i===o?t.GlobalSettings.enableFullJsonRoundTrip||delete n[r]:n[r]=e[i]},e.prototype.serializeArray=function(e,t,n){var r=[];if(n)for(var i=0,o=n;i<o.length;i++){var a=o[i],s=void 0;void 0!==(s=a instanceof w?a.toJSON(this):a.toJSON?a.toJSON():a)&&r.push(s)}0===r.length?e.hasOwnProperty(t)&&Array.isArray(e[t])&&delete e[t]:this.serializeValue(e,t,r)},e.prototype.clearEvents=function(){this._validationEvents=[]},e.prototype.logEvent=function(e,t,n,r){this._validationEvents.push({source:e,phase:t,event:n,message:r})},e.prototype.logParseEvent=function(e,t,n){this.logEvent(e,r.ValidationPhase.Parse,t,n)},e.prototype.getEventAt=function(e){return this._validationEvents[e]},Object.defineProperty(e.prototype,"eventCount",{get:function(){return this._validationEvents.length},enumerable:!1,configurable:!0}),e}();Ow.BaseSerializationContext=s;var l=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n}(s),c=function(){function e(t,n,r,i){this.targetVersion=t,this.name=n,this.defaultValue=r,this.onGetInitialValue=i,this.isSerializationEnabled=!0,this.sequentialNumber=e._sequentialNumber,e._sequentialNumber++}return e.prototype.getInternalName=function(){return this.name},e.prototype.parse=function(e,t,n){return t[this.name]},e.prototype.toJSON=function(e,t,n,r){r.serializeValue(t,this.name,n,this.defaultValue)},e._sequentialNumber=0,e}();Ow.PropertyDefinition=c;var u=function(t){function o(e,n,r,i,o,a){void 0===r&&(r=!0);var s=t.call(this,e,n,o,a)||this;return s.targetVersion=e,s.name=n,s.treatEmptyAsUndefined=r,s.regEx=i,s.defaultValue=o,s.onGetInitialValue=a,s}return e(o,t),o.prototype.parse=function(e,t,o){var a=n.parseString(t[this.name],this.defaultValue);if(!(void 0===a||""===a&&this.treatEmptyAsUndefined)&&void 0!==this.regEx&&!this.regEx.exec(a))return void o.logParseEvent(e,r.ValidationEvent.InvalidPropertyValue,i.Strings.errors.invalidPropertyValue(a,this.name));return a},o.prototype.toJSON=function(e,t,n,r){r.serializeString(t,this.name,""===n&&this.treatEmptyAsUndefined?void 0:n,this.defaultValue)},o}(c);Ow.StringProperty=u;var d=function(t){function r(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.targetVersion=e,o.name=n,o.defaultValue=r,o.onGetInitialValue=i,o}return e(r,t),r.prototype.parse=function(e,t,r){return n.parseBool(t[this.name],this.defaultValue)},r.prototype.toJSON=function(e,t,n,r){r.serializeBool(t,this.name,n,this.defaultValue)},r}(c);Ow.BoolProperty=d;var p=function(t){function r(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.targetVersion=e,o.name=n,o.defaultValue=r,o.onGetInitialValue=i,o}return e(r,t),r.prototype.parse=function(e,t,r){return n.parseNumber(t[this.name],this.defaultValue)},r.prototype.toJSON=function(e,t,n,r){r.serializeNumber(t,this.name,n,this.defaultValue)},r}(c);Ow.NumProperty=p;var h=function(n){function o(){return null!==n&&n.apply(this,arguments)||this}return e(o,n),o.prototype.parse=function(e,n,o){var a=void 0,s=n[this.name];if("string"==typeof s){var l=!1;try{var c=t.SizeAndUnit.parse(s,!0);c.unit===r.SizeUnit.Pixel&&(a=c.physicalSize,l=!0)}catch(e){}l||o.logParseEvent(e,r.ValidationEvent.InvalidPropertyValue,i.Strings.errors.invalidPropertyValue(n[this.name],"minHeight"))}return a},o.prototype.toJSON=function(e,t,n,r){r.serializeValue(t,this.name,"number"!=typeof n||isNaN(n)?void 0:n+"px")},o}(c);Ow.PixelSizeProperty=h;var f=function(t){function n(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.targetVersion=e,o.name=n,o.defaultValue=r,o.onGetInitialValue=i,o}return e(n,t),n.prototype.parse=function(e,t,n){var i=t[this.name];if(void 0===i||!Array.isArray(i))return this.defaultValue;for(var o=[],a=0,s=i;a<s.length;a++){var l=s[a];"string"==typeof l?o.push(l):n.logParseEvent(e,r.ValidationEvent.InvalidPropertyValue,'Invalid array value "'.concat(JSON.stringify(l),'" of type "').concat(typeof l,'" ignored for "').concat(this.name,'".'))}return o},n.prototype.toJSON=function(e,t,n,r){r.serializeArray(t,this.name,n)},n}(c);Ow.StringArrayProperty=f;var m=function(t){function n(e,n,r,i,o){var a=t.call(this,e,n,i,o)||this;return a.targetVersion=e,a.name=n,a.values=r,a.defaultValue=i,a.onGetInitialValue=o,a}return e(n,t),n.prototype.isValidValue=function(e,t){for(var n=0,r=this.values;n<r.length;n++){var i=r[n];if(e.toLowerCase()===i.value.toLowerCase())return(i.targetVersion?i.targetVersion:this.targetVersion).compareTo(t.targetVersion)<=0}return!1},n.prototype.parse=function(e,t,n){var o=t[this.name];if(void 0===o)return this.defaultValue;if("string"==typeof o)for(var a=0,s=this.values;a<s.length;a++){var l=s[a];if(o.toLowerCase()===l.value.toLowerCase()){var c=l.targetVersion?l.targetVersion:this.targetVersion;return c.compareTo(n.targetVersion)<=0?l.value:(n.logParseEvent(e,r.ValidationEvent.InvalidPropertyValue,i.Strings.errors.propertyValueNotSupported(o,this.name,c.toString(),n.targetVersion.toString())),this.defaultValue)}}return n.logParseEvent(e,r.ValidationEvent.InvalidPropertyValue,i.Strings.errors.invalidPropertyValue(o,this.name)),this.defaultValue},n.prototype.toJSON=function(e,t,n,o){var a=!1;if(void 0!==n){a=!0;for(var s=0,l=this.values;s<l.length;s++){var c=l[s];if(c.value===n){var u=c.targetVersion?c.targetVersion:this.targetVersion;if(u.compareTo(o.targetVersion)<=0){a=!1;break}o.logEvent(e,r.ValidationPhase.ToJSON,r.ValidationEvent.InvalidPropertyValue,i.Strings.errors.propertyValueNotSupported(n,this.name,u.toString(),o.targetVersion.toString()))}}}a||o.serializeValue(t,this.name,n,this.defaultValue,!0)},n}(c);Ow.ValueSetProperty=m;var g=function(t){function o(e,n,r,i,o,a){var s=t.call(this,e,n,i,a)||this;if(s.targetVersion=e,s.name=n,s.enumType=r,s.defaultValue=i,s.onGetInitialValue=a,s._values=[],o)s._values=o;else for(var l in r){var c=parseInt(l,10);c>=0&&s._values.push({value:c})}return s}return e(o,t),o.prototype.parse=function(e,t,o){var a=t[this.name];if("string"!=typeof a)return this.defaultValue;var s=n.getEnumValueByName(this.enumType,a);if(void 0!==s)for(var l=0,c=this.values;l<c.length;l++){var u=c[l];if(u.value===s){var d=u.targetVersion?u.targetVersion:this.targetVersion;return d.compareTo(o.targetVersion)<=0?s:(o.logParseEvent(e,r.ValidationEvent.InvalidPropertyValue,i.Strings.errors.propertyValueNotSupported(a,this.name,d.toString(),o.targetVersion.toString())),this.defaultValue)}}return o.logParseEvent(e,r.ValidationEvent.InvalidPropertyValue,i.Strings.errors.invalidPropertyValue(a,this.name)),this.defaultValue},o.prototype.toJSON=function(e,t,n,o){var a=!1;if(void 0!==n){a=!0;for(var s=0,l=this.values;s<l.length;s++){var c=l[s];if(c.value===n){if((c.targetVersion?c.targetVersion:this.targetVersion).compareTo(o.targetVersion)<=0){a=!1;break}o.logEvent(e,r.ValidationPhase.ToJSON,r.ValidationEvent.InvalidPropertyValue,i.Strings.errors.invalidPropertyValue(n,this.name))}}}a||o.serializeEnum(this.enumType,t,this.name,n,this.defaultValue)},Object.defineProperty(o.prototype,"values",{get:function(){return this._values},enumerable:!1,configurable:!0}),o}(c);Ow.EnumProperty=g;var y=function(t){function n(e,n,r,i,o){void 0===i&&(i=!1);var a=t.call(this,e,n,o,function(e){return a.nullable?void 0:new a.objectType})||this;return a.targetVersion=e,a.name=n,a.objectType=r,a.nullable=i,a}return e(n,t),n.prototype.parse=function(e,t,n){var r=t[this.name];if(void 0===r)return this.onGetInitialValue?this.onGetInitialValue(e):this.defaultValue;var i=new this.objectType;return i.parse(r,n),i},n.prototype.toJSON=function(e,t,n,r){var i=void 0;void 0===n||n.hasAllDefaultValues()||(i=n.toJSON(r)),"object"==typeof i&&0===Object.keys(i).length&&(i=void 0),r.serializeValue(t,this.name,i,this.defaultValue,!0)},n}(c);Ow.SerializableObjectProperty=y;var A=function(t){function n(e,n,r,i){var o=t.call(this,e,n,void 0,function(e){return[]})||this;return o.targetVersion=e,o.name=n,o.objectType=r,o.onItemAdded=i,o}return e(n,t),n.prototype.parse=function(e,t,n){var r=[],i=t[this.name];if(Array.isArray(i))for(var o=0,a=i;o<a.length;o++){var s=a[o],l=new this.objectType;l.parse(s,n),r.push(l),this.onItemAdded&&this.onItemAdded(e,l)}return r.length>0?r:this.onGetInitialValue?this.onGetInitialValue(e):void 0},n.prototype.toJSON=function(e,t,n,r){r.serializeArray(t,this.name,n)},n}(c);Ow.SerializableObjectCollectionProperty=A;var v=function(t){function n(e,n,r,i,o,a){var s=t.call(this,e,n,o,a)||this;if(s.targetVersion=e,s.name=n,s.onParse=r,s.onToJSON=i,s.defaultValue=o,s.onGetInitialValue=a,!s.onParse)throw new Error("CustomPropertyDefinition instances must have an onParse handler.");if(!s.onToJSON)throw new Error("CustomPropertyDefinition instances must have an onToJSON handler.");return s}return e(n,t),n.prototype.parse=function(e,t,n){return this.onParse(e,this,t,n)},n.prototype.toJSON=function(e,t,n,r){this.onToJSON(e,this,t,n,r)},n}(c);Ow.CustomProperty=v;var b=function(){function e(){this._properties=[]}return e.prototype.indexOf=function(e){for(var t=0;t<this._properties.length;t++)if(this._properties[t]===e)return t;return-1},e.prototype.add=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,r=e;n<r.length;n++){var i=r[n];-1===this.indexOf(i)&&this._properties.push(i)}},e.prototype.remove=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,r=e;n<r.length;n++)for(var i=r[n];;){var o=this.indexOf(i);if(!(o>=0))break;this._properties.splice(o,1)}},e.prototype.getItemAt=function(e){return this._properties[e]},e.prototype.getCount=function(){return this._properties.length},e}();Ow.SerializableObjectSchema=b,Ow.property=function(e){return function(t,n){var r=Object.getOwnPropertyDescriptor(t,n)||{};r.get||r.set||(r.get=function(){return this.getValue(e)},r.set=function(t){this.setValue(e,t)},Object.defineProperty(t,n,r))}};var w=function(){function e(){this._propertyBag={},this._rawProperties={},this.maxVersion=e.defaultMaxVersion;for(var t=this.getSchema(),n=0;n<t.getCount();n++){var r=t.getItemAt(n);r.onGetInitialValue&&this.setValue(r,r.onGetInitialValue(this))}}return e.prototype.getDefaultSerializationContext=function(){return new l},e.prototype.populateSchema=function(t){var n=this.constructor,r=[];for(var i in n)try{var o=n[i];o instanceof c&&r.push(o)}catch(e){}if(r.length>0){var a=r.sort(function(e,t){return e.sequentialNumber>t.sequentialNumber?1:e.sequentialNumber<t.sequentialNumber?-1:0});t.add.apply(t,a)}e.onRegisterCustomProperties&&e.onRegisterCustomProperties(this,t)},e.prototype.getValue=function(e){return this._propertyBag.hasOwnProperty(e.getInternalName())?this._propertyBag[e.getInternalName()]:e.defaultValue},e.prototype.setValue=function(e,t){null==t?delete this._propertyBag[e.getInternalName()]:this._propertyBag[e.getInternalName()]=t},e.prototype.internalParse=function(e,n){if(this._propertyBag={},this._rawProperties=t.GlobalSettings.enableFullJsonRoundTrip&&e||{},e)for(var o=this.getSchema(),a=0;a<o.getCount();a++){var s=o.getItemAt(a);if(s.isSerializationEnabled){var l=s.onGetInitialValue?s.onGetInitialValue(this):void 0;e.hasOwnProperty(s.name)&&(s.targetVersion.compareTo(n.targetVersion)<=0?l=s.parse(this,e,n):n.logParseEvent(this,r.ValidationEvent.UnsupportedProperty,i.Strings.errors.propertyNotSupported(s.name,s.targetVersion.toString(),n.targetVersion.toString()))),this.setValue(s,l)}}else this.resetDefaultValues()},e.prototype.internalToJSON=function(e,t){for(var n=this.getSchema(),r=[],i=0;i<n.getCount();i++){var o=n.getItemAt(i);o.isSerializationEnabled&&o.targetVersion.compareTo(t.targetVersion)<=0&&-1===r.indexOf(o.name)&&(o.toJSON(this,e,this.getValue(o),t),r.push(o.name))}},e.prototype.shouldSerialize=function(e){return!0},e.prototype.parse=function(e,t){this.internalParse(e,t||new l)},e.prototype.toJSON=function(e){var n;if(e&&e instanceof s?n=e:(n=this.getDefaultSerializationContext()).toJSONOriginalParam=e,this.shouldSerialize(n)){var r=void 0;return r=t.GlobalSettings.enableFullJsonRoundTrip&&this._rawProperties&&"object"==typeof this._rawProperties?this._rawProperties:{},this.internalToJSON(r,n),r}},e.prototype.hasDefaultValue=function(e){return this.getValue(e)===e.defaultValue},e.prototype.hasAllDefaultValues=function(){for(var e=this.getSchema(),t=0;t<e.getCount();t++){var n=e.getItemAt(t);if(!this.hasDefaultValue(n))return!1}return!0},e.prototype.resetDefaultValues=function(){for(var e=this.getSchema(),t=0;t<e.getCount();t++){var n=e.getItemAt(t);this.setValue(n,n.defaultValue)}},e.prototype.setCustomProperty=function(e,t){"string"==typeof t&&!t||null==t?delete this._rawProperties[e]:this._rawProperties[e]=t},e.prototype.getCustomProperty=function(e){return this._rawProperties[e]},e.prototype.getSchema=function(){var t=e._schemaCache[this.getSchemaKey()];return t||(t=new b,this.populateSchema(t),e._schemaCache[this.getSchemaKey()]=t),t},e.defaultMaxVersion=a.latest,e._schemaCache={},e}();return Ow.SerializableObject=w,Ow}var Bw,Yw={};function Nw(){if(Bw)return Yw;Bw=1;var e=Yw&&Yw.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Yw,"__esModule",{value:!0}),Yw.HostCapabilities=void 0;var t=Rw(),n=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e._capabilities={},e}return e(r,n),r.prototype.getSchemaKey=function(){return"HostCapabilities"},r.prototype.internalParse=function(e,r){if(n.prototype.internalParse.call(this,e,r),e)for(var i in e){var o=e[i];if("string"==typeof o)if("*"===o)this.addCapability(i,"*");else{var a=t.Version.parse(o,r);(null==a?void 0:a.isValid)&&this.addCapability(i,a)}}},r.prototype.internalToJSON=function(e,t){for(var r in n.prototype.internalToJSON.call(this,e,t),this._capabilities)e[r]=this._capabilities[r]},r.prototype.addCapability=function(e,t){this._capabilities[e]=t},r.prototype.removeCapability=function(e){delete this._capabilities[e]},r.prototype.clear=function(){this._capabilities={}},r.prototype.hasCapability=function(e,t){return!!this._capabilities.hasOwnProperty(e)&&("*"===t||"*"===this._capabilities[e]||t.compareTo(this._capabilities[e])<=0)},r.prototype.areAllMet=function(e){for(var t in this._capabilities)if(!e.hasCapability(t,this._capabilities[t]))return!1;return!0},r}(t.SerializableObject);return Yw.HostCapabilities=n,Yw}var Vw,Fw={};function jw(){if(Vw)return Fw;Vw=1;var e=Fw&&Fw.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Fw,"__esModule",{value:!0}),Fw.defaultHostConfig=Fw.HostConfig=Fw.FontTypeSet=Fw.FontTypeDefinition=Fw.ContainerStyleSet=Fw.ContainerStyleDefinition=Fw.ColorSetDefinition=Fw.ActionsConfig=Fw.ShowCardActionConfig=Fw.FactSetConfig=Fw.FactTitleDefinition=Fw.FactTextDefinition=Fw.InputConfig=Fw.InputLabelConfig=Fw.RequiredInputLabelTextDefinition=Fw.TextBlockConfig=Fw.TextStyleSet=Fw.TextStyleDefinition=Fw.BaseTextDefinition=Fw.TableConfig=Fw.MediaConfig=Fw.ImageSetConfig=Fw.AdaptiveCardConfig=Fw.TextColorDefinition=Fw.ColorDefinition=void 0;var t=Mw(),n=Lw(),r=Dw(),i=Nw();function o(e,t,r){if("string"==typeof t){var i=n.parseEnum(e,t,r);return void 0!==i?i:r}return"number"==typeof t?t:r}var a=function(){function e(e,t){this.default="#000000",this.subtle="#666666",e&&(this.default=e),t&&(this.subtle=t)}return e.prototype.parse=function(e){e&&(this.default=e.default||this.default,this.subtle=e.subtle||this.subtle)},e}();Fw.ColorDefinition=a;var s=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.highlightColors=new a("#22000000","#11000000"),e}return e(n,t),n.prototype.parse=function(e){t.prototype.parse.call(this,e),e&&this.highlightColors.parse(e.highlightColors)},n}(a);Fw.TextColorDefinition=s;var l=function(){return function(e){this.allowCustomStyle=!1,e&&(this.allowCustomStyle=e.allowCustomStyle||this.allowCustomStyle)}}();Fw.AdaptiveCardConfig=l;var c=function(){function e(e){this.imageSize=t.Size.Medium,this.maxImageHeight=100,e&&(this.imageSize=null!=e.imageSize?e.imageSize:this.imageSize,this.maxImageHeight=n.parseNumber(e.maxImageHeight,100))}return e.prototype.toJSON=function(){return{imageSize:t.Size[this.imageSize],maxImageHeight:this.maxImageHeight}},e}();Fw.ImageSetConfig=c;var u=function(){function e(e){this.allowInlinePlayback=!0,e&&(this.defaultPoster=e.defaultPoster,this.allowInlinePlayback=e.allowInlinePlayback||this.allowInlinePlayback)}return e.prototype.toJSON=function(){return{defaultPoster:this.defaultPoster,allowInlinePlayback:this.allowInlinePlayback}},e}();Fw.MediaConfig=u;var d=function(){function e(e){this.cellSpacing=8,e&&(this.cellSpacing=e.cellSpacing&&"number"==typeof e.cellSpacing?e.cellSpacing:this.cellSpacing)}return e.prototype.toJSON=function(){return{cellSpacing:this.cellSpacing}},e}();Fw.TableConfig=d;var p=function(){function e(e){this.size=t.TextSize.Default,this.color=t.TextColor.Default,this.isSubtle=!1,this.weight=t.TextWeight.Default,this.parse(e)}return e.prototype.parse=function(e){e&&(this.size=o(t.TextSize,e.size,this.size),this.color=o(t.TextColor,e.color,this.color),this.isSubtle=void 0!==e.isSubtle&&"boolean"==typeof e.isSubtle?e.isSubtle:this.isSubtle,this.weight=o(t.TextWeight,e.weight,this.getDefaultWeight()))},e.prototype.getDefaultWeight=function(){return t.TextWeight.Default},e.prototype.toJSON=function(){return{size:t.TextSize[this.size],color:t.TextColor[this.color],isSubtle:this.isSubtle,weight:t.TextWeight[this.weight]}},e}();Fw.BaseTextDefinition=p;var h=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.fontType=t.FontType.Default,e}return e(r,n),r.prototype.parse=function(e){n.prototype.parse.call(this,e),e&&(this.fontType=o(t.FontType,e.fontType,this.fontType))},r}(p);Fw.TextStyleDefinition=h;var f=function(){function e(e){this.default=new h,this.heading=new h({size:"Large",weight:"Bolder"}),this.columnHeader=new h({weight:"Bolder"}),e&&(this.heading.parse(e.heading),this.columnHeader.parse(e.columnHeader))}return e.prototype.getStyleByName=function(e){switch(e.toLowerCase()){case"heading":return this.heading;case"columnHeader":return this.columnHeader;default:return this.default}},e}();Fw.TextStyleSet=f;var m=function(){return function(e){e&&(this.headingLevel=n.parseNumber(e.headingLevel))}}();Fw.TextBlockConfig=m;var g=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.suffix=" *",e.suffixColor=t.TextColor.Attention,e}return e(r,n),r.prototype.parse=function(e){n.prototype.parse.call(this,e),e&&(this.suffix=e.suffix||this.suffix,this.suffixColor=o(t.TextColor,e.suffixColor,this.suffixColor))},r.prototype.toJSON=function(){var e=n.prototype.toJSON.call(this);return e.suffix=this.suffix,e.suffixColor=t.TextColor[this.suffixColor],e},r}(p);Fw.RequiredInputLabelTextDefinition=g;var y=function(){return function(e){this.inputSpacing=t.Spacing.Small,this.requiredInputs=new g,this.optionalInputs=new p,e&&(this.inputSpacing=o(t.Spacing,e.inputSpacing,this.inputSpacing),this.requiredInputs=new g(e.requiredInputs),this.optionalInputs=new p(e.optionalInputs))}}();Fw.InputLabelConfig=y;var A=function(){return function(e){this.label=new y,this.errorMessage=new p({color:t.TextColor.Attention}),e&&(this.label=new y(e.label),this.errorMessage=new p(e.errorMessage))}}();Fw.InputConfig=A;var v=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.wrap=!0,e}return e(n,t),n.prototype.parse=function(e){t.prototype.parse.call(this,e),e&&(this.wrap=null!=e.wrap?e.wrap:this.wrap)},n.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.wrap=this.wrap,e},n}(p);Fw.FactTextDefinition=v;var b=function(n){function r(e){var r=n.call(this,e)||this;return r.maxWidth=150,r.weight=t.TextWeight.Bolder,e&&(r.maxWidth=null!=e.maxWidth?e.maxWidth:r.maxWidth,r.weight=o(t.TextWeight,e.weight,t.TextWeight.Bolder)),r}return e(r,n),r.prototype.getDefaultWeight=function(){return t.TextWeight.Bolder},r}(v);Fw.FactTitleDefinition=b;var w=function(){return function(e){this.title=new b,this.value=new v,this.spacing=10,e&&(this.title=new b(e.title),this.value=new v(e.value),this.spacing=e.spacing&&null!=e.spacing?e.spacing&&e.spacing:this.spacing)}}();Fw.FactSetConfig=w;var E=function(){function e(e){this.actionMode=t.ShowCardActionMode.Inline,this.inlineTopMargin=16,this.style=t.ContainerStyle.Emphasis,e&&(this.actionMode=o(t.ShowCardActionMode,e.actionMode,t.ShowCardActionMode.Inline),this.inlineTopMargin=null!=e.inlineTopMargin?e.inlineTopMargin:this.inlineTopMargin,this.style=e.style&&"string"==typeof e.style?e.style:t.ContainerStyle.Emphasis)}return e.prototype.toJSON=function(){return{actionMode:t.ShowCardActionMode[this.actionMode],inlineTopMargin:this.inlineTopMargin,style:this.style}},e}();Fw.ShowCardActionConfig=E;var k=function(){function e(e){if(this.maxActions=5,this.spacing=t.Spacing.Default,this.buttonSpacing=20,this.showCard=new E,this.preExpandSingleShowCardAction=!1,this.actionsOrientation=t.Orientation.Horizontal,this.actionAlignment=t.ActionAlignment.Left,this.iconPlacement=t.ActionIconPlacement.LeftOfTitle,this.allowTitleToWrap=!1,this.iconSize=16,e){this.maxActions=null!=e.maxActions?e.maxActions:this.maxActions,this.spacing=o(t.Spacing,e.spacing&&e.spacing,t.Spacing.Default),this.buttonSpacing=null!=e.buttonSpacing?e.buttonSpacing:this.buttonSpacing,this.showCard=new E(e.showCard),this.preExpandSingleShowCardAction=n.parseBool(e.preExpandSingleShowCardAction,!1),this.actionsOrientation=o(t.Orientation,e.actionsOrientation,t.Orientation.Horizontal),this.actionAlignment=o(t.ActionAlignment,e.actionAlignment,t.ActionAlignment.Left),this.iconPlacement=o(t.ActionIconPlacement,e.iconPlacement,t.ActionIconPlacement.LeftOfTitle),this.allowTitleToWrap=null!=e.allowTitleToWrap?e.allowTitleToWrap:this.allowTitleToWrap;try{var i=r.SizeAndUnit.parse(e.iconSize);i.unit===t.SizeUnit.Pixel&&(this.iconSize=i.physicalSize)}catch(e){}}}return e.prototype.toJSON=function(){return{maxActions:this.maxActions,spacing:t.Spacing[this.spacing],buttonSpacing:this.buttonSpacing,showCard:this.showCard,preExpandSingleShowCardAction:this.preExpandSingleShowCardAction,actionsOrientation:t.Orientation[this.actionsOrientation],actionAlignment:t.ActionAlignment[this.actionAlignment]}},e}();Fw.ActionsConfig=k;var C=function(){function e(e){this.default=new s,this.dark=new s,this.light=new s,this.accent=new s,this.good=new s,this.warning=new s,this.attention=new s,this.parse(e)}return e.prototype.parseSingleColor=function(e,t){e&&this[t].parse(e[t])},e.prototype.parse=function(e){e&&(this.parseSingleColor(e,"default"),this.parseSingleColor(e,"dark"),this.parseSingleColor(e,"light"),this.parseSingleColor(e,"accent"),this.parseSingleColor(e,"good"),this.parseSingleColor(e,"warning"),this.parseSingleColor(e,"attention"))},e}();Fw.ColorSetDefinition=C;var _=function(){function e(e){this.foregroundColors=new C({default:{default:"#333333",subtle:"#EE333333"},dark:{default:"#000000",subtle:"#66000000"},light:{default:"#FFFFFF",subtle:"#33000000"},accent:{default:"#2E89FC",subtle:"#882E89FC"},good:{default:"#028A02",subtle:"#DD027502"},warning:{default:"#E69500",subtle:"#DDE69500"},attention:{default:"#CC3300",subtle:"#DDCC3300"}}),this.parse(e)}return e.prototype.parse=function(e){e&&(this.backgroundColor=e.backgroundColor,this.foregroundColors.parse(e.foregroundColors),this.highlightBackgroundColor=e.highlightBackgroundColor,this.highlightForegroundColor=e.highlightForegroundColor,this.borderColor=e.borderColor)},Object.defineProperty(e.prototype,"isBuiltIn",{get:function(){return!1},enumerable:!1,configurable:!0}),e}();Fw.ContainerStyleDefinition=_;var M=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),Object.defineProperty(n.prototype,"isBuiltIn",{get:function(){return!0},enumerable:!1,configurable:!0}),n}(_),T=function(){function e(e){if(this._allStyles={},this._allStyles[t.ContainerStyle.Default]=new M,this._allStyles[t.ContainerStyle.Emphasis]=new M,this._allStyles[t.ContainerStyle.Accent]=new M,this._allStyles[t.ContainerStyle.Good]=new M,this._allStyles[t.ContainerStyle.Attention]=new M,this._allStyles[t.ContainerStyle.Warning]=new M,e){this._allStyles[t.ContainerStyle.Default].parse(e[t.ContainerStyle.Default]),this._allStyles[t.ContainerStyle.Emphasis].parse(e[t.ContainerStyle.Emphasis]),this._allStyles[t.ContainerStyle.Accent].parse(e[t.ContainerStyle.Accent]),this._allStyles[t.ContainerStyle.Good].parse(e[t.ContainerStyle.Good]),this._allStyles[t.ContainerStyle.Attention].parse(e[t.ContainerStyle.Attention]),this._allStyles[t.ContainerStyle.Warning].parse(e[t.ContainerStyle.Warning]);var n=e.customStyles;if(n&&Array.isArray(n))for(var r=0,i=n;r<i.length;r++){var o=i[r];if(o){var a=o.name;a&&"string"==typeof a&&(this._allStyles.hasOwnProperty(a)?this._allStyles[a].parse(o.style):this._allStyles[a]=new _(o.style))}}}}return e.prototype.toJSON=function(){var e=this,t=[];Object.keys(this._allStyles).forEach(function(n){e._allStyles[n].isBuiltIn||t.push({name:n,style:e._allStyles[n]})});var n={default:this.default,emphasis:this.emphasis};return t.length>0&&(n.customStyles=t),n},e.prototype.getStyleByName=function(e,n){return e&&this._allStyles.hasOwnProperty(e)?this._allStyles[e]:n||this._allStyles[t.ContainerStyle.Default]},Object.defineProperty(e.prototype,"default",{get:function(){return this._allStyles[t.ContainerStyle.Default]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emphasis",{get:function(){return this._allStyles[t.ContainerStyle.Emphasis]},enumerable:!1,configurable:!0}),e}();Fw.ContainerStyleSet=T;var S=function(){function e(e){this.fontFamily="Segoe UI,Segoe,Segoe WP,Helvetica Neue,Helvetica,sans-serif",this.fontSizes={small:12,default:14,medium:17,large:21,extraLarge:26},this.fontWeights={lighter:200,default:400,bolder:600},e&&(this.fontFamily=e)}return e.prototype.parse=function(e){this.fontFamily=e.fontFamily||this.fontFamily,this.fontSizes={small:e.fontSizes&&e.fontSizes.small||this.fontSizes.small,default:e.fontSizes&&e.fontSizes.default||this.fontSizes.default,medium:e.fontSizes&&e.fontSizes.medium||this.fontSizes.medium,large:e.fontSizes&&e.fontSizes.large||this.fontSizes.large,extraLarge:e.fontSizes&&e.fontSizes.extraLarge||this.fontSizes.extraLarge},this.fontWeights={lighter:e.fontWeights&&e.fontWeights.lighter||this.fontWeights.lighter,default:e.fontWeights&&e.fontWeights.default||this.fontWeights.default,bolder:e.fontWeights&&e.fontWeights.bolder||this.fontWeights.bolder}},e.monospace=new e("'Courier New', Courier, monospace"),e}();Fw.FontTypeDefinition=S;var D=function(){function e(e){this.default=new S,this.monospace=new S("'Courier New', Courier, monospace"),e&&(this.default.parse(e.default),this.monospace.parse(e.monospace))}return e.prototype.getStyleDefinition=function(e){switch(e){case t.FontType.Monospace:return this.monospace;case t.FontType.Default:default:return this.default}},e}();Fw.FontTypeSet=D;var x=function(){function e(e){this.hostCapabilities=new i.HostCapabilities,this.choiceSetInputValueSeparator=",",this.supportsInteractivity=!0,this.spacing={small:3,default:8,medium:20,large:30,extraLarge:40,padding:15},this.separator={lineThickness:1,lineColor:"#EEEEEE"},this.imageSizes={small:40,medium:80,large:160},this.containerStyles=new T,this.inputs=new A,this.actions=new k,this.adaptiveCard=new l,this.imageSet=new c,this.media=new u,this.factSet=new w,this.table=new d,this.textStyles=new f,this.textBlock=new m,this.alwaysAllowBleed=!1,e&&(("string"==typeof e||e instanceof String)&&(e=JSON.parse(e)),this.choiceSetInputValueSeparator=e&&"string"==typeof e.choiceSetInputValueSeparator?e.choiceSetInputValueSeparator:this.choiceSetInputValueSeparator,this.supportsInteractivity=e&&"boolean"==typeof e.supportsInteractivity?e.supportsInteractivity:this.supportsInteractivity,this._legacyFontType=new S,this._legacyFontType.parse(e),e.fontTypes&&(this.fontTypes=new D(e.fontTypes)),e.lineHeights&&(this.lineHeights={small:e.lineHeights.small,default:e.lineHeights.default,medium:e.lineHeights.medium,large:e.lineHeights.large,extraLarge:e.lineHeights.extraLarge}),this.imageSizes={small:e.imageSizes&&e.imageSizes.small||this.imageSizes.small,medium:e.imageSizes&&e.imageSizes.medium||this.imageSizes.medium,large:e.imageSizes&&e.imageSizes.large||this.imageSizes.large},this.containerStyles=new T(e.containerStyles),this.spacing={small:e.spacing&&e.spacing.small||this.spacing.small,default:e.spacing&&e.spacing.default||this.spacing.default,medium:e.spacing&&e.spacing.medium||this.spacing.medium,large:e.spacing&&e.spacing.large||this.spacing.large,extraLarge:e.spacing&&e.spacing.extraLarge||this.spacing.extraLarge,padding:e.spacing&&e.spacing.padding||this.spacing.padding},this.separator={lineThickness:e.separator&&e.separator.lineThickness||this.separator.lineThickness,lineColor:e.separator&&e.separator.lineColor||this.separator.lineColor},this.inputs=new A(e.inputs||this.inputs),this.actions=new k(e.actions||this.actions),this.adaptiveCard=new l(e.adaptiveCard||this.adaptiveCard),this.imageSet=new c(e.imageSet),this.factSet=new w(e.factSet),this.textStyles=new f(e.textStyles),this.textBlock=new m(e.textBlock))}return e.prototype.getFontTypeDefinition=function(e){return this.fontTypes?this.fontTypes.getStyleDefinition(e):e===t.FontType.Monospace?S.monospace:this._legacyFontType},e.prototype.getEffectiveSpacing=function(e){switch(e){case t.Spacing.Small:return this.spacing.small;case t.Spacing.Default:return this.spacing.default;case t.Spacing.Medium:return this.spacing.medium;case t.Spacing.Large:return this.spacing.large;case t.Spacing.ExtraLarge:return this.spacing.extraLarge;case t.Spacing.Padding:return this.spacing.padding;default:return 0}},e.prototype.paddingDefinitionToSpacingDefinition=function(e){return new r.SpacingDefinition(this.getEffectiveSpacing(e.top),this.getEffectiveSpacing(e.right),this.getEffectiveSpacing(e.bottom),this.getEffectiveSpacing(e.left))},e.prototype.makeCssClassNames=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=[],r=0,i=e;r<i.length;r++){var o=i[r];n.push((this.cssClassNamePrefix?this.cssClassNamePrefix+"-":"")+o)}return n},e.prototype.makeCssClassName=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.makeCssClassNames.apply(this,e).join(" ");return n||""},Object.defineProperty(e.prototype,"fontFamily",{get:function(){return this._legacyFontType.fontFamily},set:function(e){this._legacyFontType.fontFamily=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontSizes",{get:function(){return this._legacyFontType.fontSizes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontWeights",{get:function(){return this._legacyFontType.fontWeights},enumerable:!1,configurable:!0}),e}();return Fw.HostConfig=x,Fw.defaultHostConfig=new x({supportsInteractivity:!0,spacing:{small:10,default:20,medium:30,large:40,extraLarge:50,padding:20},separator:{lineThickness:1,lineColor:"#EEEEEE"},fontTypes:{default:{fontFamily:"'Segoe UI', Tahoma, Geneva, Verdana, sans-serif",fontSizes:{small:12,default:14,medium:17,large:21,extraLarge:26},fontWeights:{lighter:200,default:400,bolder:600}},monospace:{fontFamily:"'Courier New', Courier, monospace",fontSizes:{small:12,default:14,medium:17,large:21,extraLarge:26},fontWeights:{lighter:200,default:400,bolder:600}}},imageSizes:{small:40,medium:80,large:160},containerStyles:{default:{backgroundColor:"#FFFFFF",foregroundColors:{default:{default:"#333333",subtle:"#EE333333"},dark:{default:"#000000",subtle:"#66000000"},light:{default:"#FFFFFF",subtle:"#33000000"},accent:{default:"#2E89FC",subtle:"#882E89FC"},attention:{default:"#cc3300",subtle:"#DDcc3300"},good:{default:"#028A02",subtle:"#DD027502"},warning:{default:"#e69500",subtle:"#DDe69500"}}},emphasis:{backgroundColor:"#08000000",foregroundColors:{default:{default:"#333333",subtle:"#EE333333"},dark:{default:"#000000",subtle:"#66000000"},light:{default:"#FFFFFF",subtle:"#33000000"},accent:{default:"#2E89FC",subtle:"#882E89FC"},attention:{default:"#cc3300",subtle:"#DDcc3300"},good:{default:"#028A02",subtle:"#DD027502"},warning:{default:"#e69500",subtle:"#DDe69500"}}},accent:{backgroundColor:"#C7DEF9",foregroundColors:{default:{default:"#333333",subtle:"#EE333333"},dark:{default:"#000000",subtle:"#66000000"},light:{default:"#FFFFFF",subtle:"#33000000"},accent:{default:"#2E89FC",subtle:"#882E89FC"},attention:{default:"#cc3300",subtle:"#DDcc3300"},good:{default:"#028A02",subtle:"#DD027502"},warning:{default:"#e69500",subtle:"#DDe69500"}}},good:{backgroundColor:"#CCFFCC",foregroundColors:{default:{default:"#333333",subtle:"#EE333333"},dark:{default:"#000000",subtle:"#66000000"},light:{default:"#FFFFFF",subtle:"#33000000"},accent:{default:"#2E89FC",subtle:"#882E89FC"},attention:{default:"#cc3300",subtle:"#DDcc3300"},good:{default:"#028A02",subtle:"#DD027502"},warning:{default:"#e69500",subtle:"#DDe69500"}}},attention:{backgroundColor:"#FFC5B2",foregroundColors:{default:{default:"#333333",subtle:"#EE333333"},dark:{default:"#000000",subtle:"#66000000"},light:{default:"#FFFFFF",subtle:"#33000000"},accent:{default:"#2E89FC",subtle:"#882E89FC"},attention:{default:"#cc3300",subtle:"#DDcc3300"},good:{default:"#028A02",subtle:"#DD027502"},warning:{default:"#e69500",subtle:"#DDe69500"}}},warning:{backgroundColor:"#FFE2B2",foregroundColors:{default:{default:"#333333",subtle:"#EE333333"},dark:{default:"#000000",subtle:"#66000000"},light:{default:"#FFFFFF",subtle:"#33000000"},accent:{default:"#2E89FC",subtle:"#882E89FC"},attention:{default:"#cc3300",subtle:"#DDcc3300"},good:{default:"#028A02",subtle:"#DD027502"},warning:{default:"#e69500",subtle:"#DDe69500"}}}},inputs:{label:{requiredInputs:{weight:t.TextWeight.Bolder,suffix:" *",suffixColor:t.TextColor.Attention},optionalInputs:{weight:t.TextWeight.Bolder}},errorMessage:{color:t.TextColor.Attention,weight:t.TextWeight.Bolder}},actions:{maxActions:5,spacing:t.Spacing.Default,buttonSpacing:10,showCard:{actionMode:t.ShowCardActionMode.Inline,inlineTopMargin:16},actionsOrientation:t.Orientation.Horizontal,actionAlignment:t.ActionAlignment.Left},adaptiveCard:{allowCustomStyle:!1},imageSet:{imageSize:t.Size.Medium,maxImageHeight:100},factSet:{title:{color:t.TextColor.Default,size:t.TextSize.Default,isSubtle:!1,weight:t.TextWeight.Bolder,wrap:!0,maxWidth:150},value:{color:t.TextColor.Default,size:t.TextSize.Default,isSubtle:!1,weight:t.TextWeight.Default,wrap:!0},spacing:10}}),Fw}var Hw,qw={};function Gw(){return Hw||(Hw=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalRegistry=e.CardObjectRegistry=e.ElementSingletonBehavior=void 0;var t,n,r=Rw();(n=t=e.ElementSingletonBehavior||(e.ElementSingletonBehavior={}))[n.Only=0]="Only",n[n.Allowed=1]="Allowed",n[n.NotAllowed=2]="NotAllowed";var i=function(){function e(){this._items={}}return e.prototype.findByName=function(e){return this._items.hasOwnProperty(e)?this._items[e]:void 0},e.prototype.clear=function(){this._items={}},e.prototype.copyTo=function(e){for(var t=0,n=Object.keys(this._items);t<n.length;t++){var r=n[t],i=this._items[r];e.register(i.typeName,i.objectType,i.schemaVersion,i.singletonBehavior)}},e.prototype.register=function(e,n,i,o){void 0===i&&(i=r.Versions.v1_0),void 0===o&&(o=t.NotAllowed);var a=this.findByName(e);void 0!==a?a.objectType=n:a={typeName:e,objectType:n,schemaVersion:i,singletonBehavior:o},this._items[e]=a},e.prototype.unregister=function(e){delete this._items[e]},e.prototype.createInstance=function(e,t){var n=this.findByName(e);return n&&n.schemaVersion.compareTo(t)<=0?new n.objectType:void 0},e.prototype.getItemCount=function(){return Object.keys(this._items).length},e.prototype.getItemAt=function(e){var t=this;return Object.keys(this._items).map(function(e){return t._items[e]})[e]},e}();e.CardObjectRegistry=i;var o=function(){function e(){}return e.populateWithDefaultElements=function(t){t.clear(),e.defaultElements.copyTo(t)},e.populateWithDefaultActions=function(t){t.clear(),e.defaultActions.copyTo(t)},Object.defineProperty(e,"elements",{get:function(){return e._elements||(e._elements=new i,e.populateWithDefaultElements(e._elements)),e._elements},enumerable:!1,configurable:!0}),Object.defineProperty(e,"actions",{get:function(){return e._actions||(e._actions=new i,e.populateWithDefaultActions(e._actions)),e._actions},enumerable:!1,configurable:!0}),e.reset=function(){e._elements=void 0,e._actions=void 0},e.defaultElements=new i,e.defaultActions=new i,e}();e.GlobalRegistry=o}(qw)),qw}var zw,Uw={};function Ww(){if(zw)return Uw;zw=1;var e=Uw&&Uw.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),t=Uw&&Uw.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};Object.defineProperty(Uw,"__esModule",{value:!0}),Uw.CardObject=Uw.ValidationResults=void 0;var n=Mw(),r=kw(),i=Dw(),o=Nw(),a=Rw(),s=function(){function e(){this.allIds={},this.validationEvents=[]}return e.prototype.addFailure=function(e,t,r){this.validationEvents.push({phase:n.ValidationPhase.Validation,source:e,event:t,message:r})},e}();Uw.ValidationResults=s;var l=function(l){function c(){var e=null!==l&&l.apply(this,arguments)||this;return e._shouldFallback=!1,e}return e(c,l),c.prototype.getSchemaKey=function(){return this.getJsonTypeName()},Object.defineProperty(c.prototype,"requires",{get:function(){return this.getValue(c.requiresProperty)},enumerable:!1,configurable:!0}),c.prototype.contains=function(e){return!!this._renderedElement&&this._renderedElement.contains(e)},c.prototype.preProcessPropertyValue=function(e,t){var n=void 0===t?this.getValue(e):t;if(i.GlobalSettings.allowPreProcessingPropertyValues){for(var r=this;r&&!r.onPreProcessPropertyValue;)r=r.parent;if(r&&r.onPreProcessPropertyValue)return r.onPreProcessPropertyValue(this,e,n)}return n},c.prototype.setParent=function(e){this._parent=e},c.prototype.setShouldFallback=function(e){this._shouldFallback=e},c.prototype.shouldFallback=function(){return this._shouldFallback||!this.requires.areAllMet(this.hostConfig.hostCapabilities)},c.prototype.getRootObject=function(){for(var e=this;e.parent;)e=e.parent;return e},c.prototype.internalValidateProperties=function(e){this.id&&(e.allIds.hasOwnProperty(this.id)?(1===e.allIds[this.id]&&e.addFailure(this,n.ValidationEvent.DuplicateId,r.Strings.errors.duplicateId(this.id)),e.allIds[this.id]+=1):e.allIds[this.id]=1)},c.prototype.validateProperties=function(){var e=new s;return this.internalValidateProperties(e),e},c.prototype.findDOMNodeOwner=function(e){return this.contains(e)?this:void 0},c.prototype.releaseDOMResources=function(){},Object.defineProperty(c.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"renderedElement",{get:function(){return this._renderedElement},enumerable:!1,configurable:!0}),c.typeNameProperty=new a.StringProperty(a.Versions.v1_0,"type",void 0,void 0,void 0,function(e){return e.getJsonTypeName()}),c.idProperty=new a.StringProperty(a.Versions.v1_0,"id"),c.requiresProperty=new a.SerializableObjectProperty(a.Versions.v1_2,"requires",o.HostCapabilities,!1,new o.HostCapabilities),t([(0,a.property)(c.idProperty)],c.prototype,"id",void 0),t([(0,a.property)(c.requiresProperty)],c.prototype,"requires",null),c}(a.SerializableObject);return Uw.CardObject=l,Uw}var Qw,Zw={},Jw={};var Kw,Xw,$w={},eE={},tE={};function nE(){if(Kw)return tE;Kw=1,Object.defineProperty(tE,"__esModule",{value:!0}),tE.Constants=void 0;var e=function(){function e(){}return e.keys={tab:"Tab",enter:"Enter",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",delete:"Delete"},e}();return tE.Constants=e,tE}var rE,iE={},oE={};var aE,sE,lE,cE,uE={};function dE(){if(sE)return iE;sE=1;var e=iE&&iE.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(iE,"__esModule",{value:!0}),iE.PopupMenu=void 0;var t=nE(),n=function(){if(rE)return oE;rE=1,Object.defineProperty(oE,"__esModule",{value:!0}),oE.Collection=void 0;var e=function(){function e(){this._items=[]}return e.prototype.get=function(e){return this._items[e]},e.prototype.add=function(e){this._items.push(e),this.onItemAdded&&this.onItemAdded(e)},e.prototype.remove=function(e){var t=this._items.indexOf(e);t>=0&&(this._items=this._items.splice(t,1),this.onItemRemoved&&this.onItemRemoved(e))},e.prototype.indexOf=function(e){return this._items.indexOf(e)},Object.defineProperty(e.prototype,"length",{get:function(){return this._items.length},enumerable:!1,configurable:!0}),e}();return oE.Collection=e,oE}(),r=function(){if(aE)return uE;aE=1,Object.defineProperty(uE,"__esModule",{value:!0}),uE.PopupControl=void 0;var e=nE(),t=Lw(),n=jw(),r=function(){function r(){this._isOpen=!1}return r.prototype.keyDown=function(t){t.key===e.Constants.keys.escape&&this.closePopup(!0)},r.prototype.render=function(e){var t=this,n=document.createElement("div");return n.tabIndex=0,n.className=this.hostConfig.makeCssClassName("ac-ctrl","ac-ctrl-popup-container"),n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true"),n.onkeydown=function(e){return t.keyDown(e),!e.cancelBubble},n.appendChild(this.renderContent()),n},r.prototype.focus=function(){this._popupElement&&this._popupElement.firstElementChild.focus()},r.prototype.popup=function(e){var n,r,i,o,a,s=this;if(!this._isOpen){this._overlayElement=document.createElement("div"),this._overlayElement.className=this.hostConfig.makeCssClassName("ac-ctrl-overlay"),this._overlayElement.tabIndex=0,this._overlayElement.style.width=document.documentElement.scrollWidth+"px",this._overlayElement.style.height=document.documentElement.scrollHeight+"px",this._overlayElement.onfocus=function(e){s.closePopup(!0)},document.body.appendChild(this._overlayElement);var l=e.getBoundingClientRect();this._popupElement=this.render(l),(n=this._popupElement.classList).remove.apply(n,this.hostConfig.makeCssClassNames("ac-ctrl-slide","ac-ctrl-slideLeftToRight","ac-ctrl-slideRightToLeft","ac-ctrl-slideTopToBottom","ac-ctrl-slideRightToLeft")),window.addEventListener("resize",function(e){s.closePopup(!0)});var c=e.getAttribute("aria-label");c&&this._popupElement.setAttribute("aria-label",c),this._overlayElement.appendChild(this._popupElement);var u,d=this._popupElement.getBoundingClientRect(),p=window.innerHeight-l.bottom,h=l.top,f=window.innerWidth-l.right,m=l.left,g=l.left+t.getScrollX();if(h<d.height&&p<d.height){var y=Math.min(d.height,window.innerHeight);if(this._popupElement.style.maxHeight=y+"px",u=y<d.height?t.getScrollY():t.getScrollY()+l.top+(l.height-y)/2,m<d.width&&f<d.width){var A=Math.min(d.width,window.innerWidth);this._popupElement.style.maxWidth=A+"px",g=A<d.width?t.getScrollX():t.getScrollX()+l.left+(l.width-A)/2}else f>=d.width?(g=t.getScrollX()+l.right,(r=this._popupElement.classList).add.apply(r,this.hostConfig.makeCssClassNames("ac-ctrl-slide","ac-ctrl-slideLeftToRight"))):(g=t.getScrollX()+l.left-d.width,(i=this._popupElement.classList).add.apply(i,this.hostConfig.makeCssClassNames("ac-ctrl-slide","ac-ctrl-slideRightToLeft")))}else p>=d.height?(u=t.getScrollY()+l.bottom,(o=this._popupElement.classList).add.apply(o,this.hostConfig.makeCssClassNames("ac-ctrl-slide","ac-ctrl-slideTopToBottom"))):(u=t.getScrollY()+l.top-d.height,(a=this._popupElement.classList).add.apply(a,this.hostConfig.makeCssClassNames("ac-ctrl-slide","ac-ctrl-slideBottomToTop"))),f<d.width&&(g=t.getScrollX()+l.right-d.width);this._popupElement.style.left=g+"px",this._popupElement.style.top=u+"px",this._popupElement.focus(),this._isOpen=!0}},r.prototype.closePopup=function(e){this._isOpen&&(document.body.removeChild(this._overlayElement),this._isOpen=!1,this.onClose&&this.onClose(this,e))},Object.defineProperty(r.prototype,"hostConfig",{get:function(){return this._hostConfig?this._hostConfig:n.defaultHostConfig},set:function(e){this._hostConfig=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),r}();return uE.PopupControl=r,uE}(),i=function(r){function i(){var e=null!==r&&r.apply(this,arguments)||this;return e._items=new n.Collection,e._renderedItems=[],e._selectedIndex=-1,e}return e(i,r),i.prototype.renderContent=function(){var e=document.createElement("div");e.className=this.hostConfig.makeCssClassName("ac-ctrl ac-popup"),e.setAttribute("role","listbox");for(var t=0;t<this._items.length;t++){var n=this._items.get(t).render(this.hostConfig);n.tabIndex=0,e.appendChild(n),t===this.selectedIndex&&n.focus(),this._renderedItems.push(n)}return e},i.prototype.keyDown=function(e){r.prototype.keyDown.call(this,e);var n=this._selectedIndex;switch(e.key){case t.Constants.keys.tab:this.closePopup(!0);break;case t.Constants.keys.up:(n<=0||--n<0)&&(n=this._renderedItems.length-1),this.selectedIndex=n,e.cancelBubble=!0;break;case t.Constants.keys.down:(n<0||++n>=this._renderedItems.length)&&(n=0),this.selectedIndex=n,e.cancelBubble=!0}},Object.defineProperty(i.prototype,"items",{get:function(){return this._items},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(e){e>=0&&e<this._renderedItems.length&&(this._renderedItems[e].focus(),this._selectedIndex=e)},enumerable:!1,configurable:!0}),i}(r.PopupControl);return iE.PopupMenu=i,iE}function pE(){return lE||(lE=1,function(e){var t=$w&&$w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=$w&&$w.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(function(){if(Xw)return eE;Xw=1,Object.defineProperty(eE,"__esModule",{value:!0}),eE.MenuItem=void 0;var e=jw(),t=nE(),n=function(){function n(e,t){this._isEnabled=!0,this.key=e,this._value=t}return n.prototype.click=function(){this.isEnabled&&this.onClick&&this.onClick(this)},n.prototype.updateCssClasses=function(){if(this._element){var t=this._hostConfig?this._hostConfig:e.defaultHostConfig;this._element.className=t.makeCssClassName("ac-ctrl"),this._element.classList.add(t.makeCssClassName(this.isEnabled?"ac-ctrl-dropdown-item":"ac-ctrl-dropdown-item-disabled")),this.isEnabled||this._element.classList.add(t.makeCssClassName("ac-disabled"))}},n.prototype.toString=function(){return this.value},n.prototype.render=function(e){var n=this;return this._hostConfig=e,this._element||(this._element=document.createElement("span"),this._element.innerText=this.value,this._element.setAttribute("role","menuitem"),this.isEnabled||this._element.setAttribute("aria-disabled","true"),this._element.setAttribute("aria-current","false"),this._element.onmouseup=function(e){n.click()},this._element.onkeydown=function(e){e.key===t.Constants.keys.enter&&(e.cancelBubble=!0,n.click())},this.updateCssClasses()),this._element},Object.defineProperty(n.prototype,"value",{get:function(){return this._value},set:function(e){this._value=e,this._element&&(this._element.innerText=e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this._isEnabled!==e&&(this._isEnabled=e,this.updateCssClasses())},enumerable:!1,configurable:!0}),n}();return eE.MenuItem=n,eE}(),e),n(dE(),e)}($w)),$w}function hE(){if(cE)return Zw;cE=1;var e=Zw&&Zw.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),t=Zw&&Zw.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},n=Zw&&Zw.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})},r=Zw&&Zw.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(Zw,"__esModule",{value:!0}),Zw.ContainerWithActions=Zw.ColumnSet=Zw.Column=Zw.Container=Zw.BackgroundImage=Zw.ContainerBase=Zw.StylableCardElementContainer=Zw.ContainerStyleProperty=Zw.ActionSet=Zw.ShowCardAction=Zw.HttpAction=Zw.HttpHeader=Zw.ToggleVisibilityAction=Zw.OpenUrlAction=Zw.ExecuteAction=Zw.SubmitAction=Zw.SubmitActionBase=Zw.Action=Zw.TimeInput=Zw.TimeProperty=Zw.DateInput=Zw.NumberInput=Zw.ChoiceSetInput=Zw.Choice=Zw.ToggleInput=Zw.TextInput=Zw.Input=Zw.Media=Zw.YouTubePlayer=Zw.DailymotionPlayer=Zw.VimeoPlayer=Zw.IFrameMediaMediaPlayer=Zw.CustomMediaPlayer=Zw.HTML5MediaPlayer=Zw.MediaPlayer=Zw.MediaSource=Zw.CaptionSource=Zw.ContentSource=Zw.ImageSet=Zw.CardElementContainer=Zw.Image=Zw.FactSet=Zw.Fact=Zw.RichTextBlock=Zw.TextRun=Zw.TextBlock=Zw.BaseTextBlock=Zw.ActionProperty=Zw.CardElement=Zw.renderSeparation=void 0,Zw.SerializationContext=Zw.AdaptiveCard=Zw.Authentication=Zw.TokenExchangeResource=Zw.AuthCardButton=Zw.RefreshDefinition=Zw.RefreshActionProperty=void 0;var i=Mw(),o=Dw(),a=Lw(),s=jw(),l=function(){if(Qw)return Jw;Qw=1;var e=Jw&&Jw.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Jw,"__esModule",{value:!0}),Jw.formatText=void 0;var t=function(){function e(e){this._regularExpression=e}return e.prototype.format=function(e,t){var n;if(t){for(var r=t;null!=(n=this._regularExpression.exec(t));)r=r.replace(n[0],this.internalFormat(e,n));return r}return t},e}(),n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.internalFormat=function(e,t){var n=new Date(Date.parse(t[1])),r=void 0!==t[2]?t[2].toLowerCase():"compact";return"compact"!==r?n.toLocaleDateString(e,{day:"numeric",weekday:r,month:r,year:"numeric"}):n.toLocaleDateString()},n}(t),r=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.internalFormat=function(e,t){return new Date(Date.parse(t[1])).toLocaleTimeString(e,{hour:"numeric",minute:"2-digit"})},n}(t);return Jw.formatText=function(e,t){for(var i=t,o=0,a=[new n(/\{{2}DATE\((\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:Z|(?:(?:-|\+)\d{2}:\d{2})))(?:, ?(COMPACT|LONG|SHORT))?\)\}{2}/g),new r(/\{{2}TIME\((\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:Z|(?:(?:-|\+)\d{2}:\d{2})))\)\}{2}/g)];o<a.length;o++)i=a[o].format(e,i);return i},Jw}(),c=Ww(),u=Rw(),d=Gw(),p=kw(),h=pE();function f(e){var t,n,r="undefined"==typeof window?"":null!==(n=null===(t=window.trustedTypes)||void 0===t?void 0:t.emptyHTML)&&void 0!==n?n:"";e.innerHTML=r}function m(e,t,n){if(t.spacing>0||t.lineThickness&&t.lineThickness>0){var r=document.createElement("div");r.className=e.makeCssClassName("ac-"+(n===i.Orientation.Horizontal?"horizontal":"vertical")+"-separator"),r.setAttribute("aria-hidden","true");var o=t.lineColor?a.stringToCssColor(t.lineColor):"";return n===i.Orientation.Horizontal?t.lineThickness?(r.style.paddingTop=t.spacing/2+"px",r.style.marginBottom=t.spacing/2+"px",r.style.borderBottom=t.lineThickness+"px solid "+o):r.style.height=t.spacing+"px":t.lineThickness?(r.style.paddingLeft=t.spacing/2+"px",r.style.marginRight=t.spacing/2+"px",r.style.borderRight=t.lineThickness+"px solid "+o):r.style.width=t.spacing+"px",r.style.overflow="hidden",r.style.flex="0 0 auto",r}}Zw.renderSeparation=m;var g=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e._truncatedDueToOverflow=!1,e}return e(r,n),Object.defineProperty(r.prototype,"lang",{get:function(){var e=this.getValue(r.langProperty);return e||(this.parent?this.parent.lang:void 0)},set:function(e){this.setValue(r.langProperty,e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isVisible",{get:function(){return this.getValue(r.isVisibleProperty)},set:function(e){o.GlobalSettings.useAdvancedCardBottomTruncation&&!e&&this.undoOverflowTruncation(),this.isVisible!==e&&(this.setValue(r.isVisibleProperty,e),this.updateRenderedElementVisibility(),this._renderedElement&&ye(this)),this._renderedElement&&this._renderedElement.setAttribute("aria-expanded",e.toString())},enumerable:!1,configurable:!0}),r.prototype.internalRenderSeparator=function(){var e=m(this.hostConfig,{spacing:this.hostConfig.getEffectiveSpacing(this.spacing),lineThickness:this.separator?this.hostConfig.separator.lineThickness:void 0,lineColor:this.separator?this.hostConfig.separator.lineColor:void 0},this.separatorOrientation);if(o.GlobalSettings.alwaysBleedSeparators&&e&&this.separatorOrientation===i.Orientation.Horizontal){var t=this.getParentContainer();if(t&&t.getEffectivePadding()){var n=this.hostConfig.paddingDefinitionToSpacingDefinition(t.getEffectivePadding());e.style.marginLeft="-"+n.left+"px",e.style.marginRight="-"+n.right+"px"}}return e},r.prototype.updateRenderedElementVisibility=function(){var e=this.isDesignMode()||this.isVisible?this._defaultRenderedElementDisplayMode:"none";this._renderedElement&&(e?this._renderedElement.style.display=e:this._renderedElement.style.removeProperty("display")),this._separatorElement&&(this.parent&&this.parent.isFirstElement(this)?this._separatorElement.style.display="none":e?this._separatorElement.style.display=e:this._separatorElement.style.removeProperty("display"))},r.prototype.hideElementDueToOverflow=function(){this._renderedElement&&this.isVisible&&(this._renderedElement.style.visibility="hidden",this.isVisible=!1,ye(this,!1))},r.prototype.showElementHiddenDueToOverflow=function(){this._renderedElement&&!this.isVisible&&(this._renderedElement.style.removeProperty("visibility"),this.isVisible=!0,ye(this,!1))},r.prototype.handleOverflow=function(e){if(this.isVisible||this.isHiddenDueToOverflow()){var t=this.truncateOverflow(e);this._truncatedDueToOverflow=t||this._truncatedDueToOverflow,t?t&&!this.isVisible&&this.showElementHiddenDueToOverflow():this.hideElementDueToOverflow()}},r.prototype.resetOverflow=function(){var e=!1;return this._truncatedDueToOverflow&&(this.undoOverflowTruncation(),this._truncatedDueToOverflow=!1,e=!0),this.isHiddenDueToOverflow()&&this.showElementHiddenDueToOverflow(),e},r.prototype.getDefaultSerializationContext=function(){return new Me},r.prototype.createPlaceholderElement=function(){var e=this.getEffectiveStyleDefinition(),t=a.stringToCssColor(e.foregroundColors.default.subtle),n=document.createElement("div");return n.style.border="1px dashed "+t,n.style.padding="4px",n.style.minHeight="32px",n.style.fontSize="10px",t&&(n.style.color=t),n.innerText="Empty "+this.getJsonTypeName(),n},r.prototype.adjustRenderedElementSize=function(e){"auto"===this.height?e.style.flex="0 0 auto":e.style.flex="1 1 auto"},r.prototype.isDisplayed=function(){return void 0!==this._renderedElement&&this.isVisible&&this._renderedElement.offsetHeight>0},r.prototype.overrideInternalRender=function(){return this.internalRender()},r.prototype.applyPadding=function(){if(this.separatorElement&&this.separatorOrientation===i.Orientation.Horizontal)if(o.GlobalSettings.alwaysBleedSeparators&&!this.isBleeding()){var e=new o.PaddingDefinition;this.getImmediateSurroundingPadding(e);var t=this.hostConfig.paddingDefinitionToSpacingDefinition(e);this.separatorElement.style.marginLeft="-"+t.left+"px",this.separatorElement.style.marginRight="-"+t.right+"px"}else this.separatorElement.style.marginRight="0",this.separatorElement.style.marginLeft="0"},r.prototype.truncateOverflow=function(e){return!1},r.prototype.undoOverflowTruncation=function(){},r.prototype.getDefaultPadding=function(){return new o.PaddingDefinition},r.prototype.getHasBackground=function(e){return!1},r.prototype.getHasBorder=function(){return!1},r.prototype.getPadding=function(){return this._padding},r.prototype.setPadding=function(e){this._padding=e},r.prototype.shouldSerialize=function(e){return void 0!==e.elementRegistry.findByName(this.getJsonTypeName())},Object.defineProperty(r.prototype,"useDefaultSizing",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"separatorOrientation",{get:function(){return i.Orientation.Horizontal},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"defaultStyle",{get:function(){return i.ContainerStyle.Default},enumerable:!1,configurable:!0}),r.prototype.parse=function(e,t){n.prototype.parse.call(this,e,t||new Me)},r.prototype.asString=function(){return""},r.prototype.isBleeding=function(){return!1},r.prototype.getEffectiveStyle=function(){return this.parent?this.parent.getEffectiveStyle():this.defaultStyle},r.prototype.getEffectiveStyleDefinition=function(){return this.hostConfig.containerStyles.getStyleByName(this.getEffectiveStyle())},r.prototype.getEffectiveTextStyleDefinition=function(){return this.parent?this.parent.getEffectiveTextStyleDefinition():this.hostConfig.textStyles.default},r.prototype.getForbiddenActionTypes=function(){return[]},r.prototype.getImmediateSurroundingPadding=function(e,t,n,r,o){if(void 0===t&&(t=!0),void 0===n&&(n=!0),void 0===r&&(r=!0),void 0===o&&(o=!0),this.parent){var a=t&&this.parent.isTopElement(this),s=n&&this.parent.isRightMostElement(this),l=r&&this.parent.isBottomElement(this),c=o&&this.parent.isLeftMostElement(this),u=this.parent.getEffectivePadding();u&&(a&&u.top!==i.Spacing.None&&(e.top=u.top,a=!1),s&&u.right!==i.Spacing.None&&(e.right=u.right,s=!1),l&&u.bottom!==i.Spacing.None&&(e.bottom=u.bottom,l=!1),c&&u.left!==i.Spacing.None&&(e.left=u.left,c=!1)),(a||s||l||c)&&this.parent.getImmediateSurroundingPadding(e,a,s,l,c)}},r.prototype.getActionCount=function(){return 0},r.prototype.getActionAt=function(e){throw new Error(p.Strings.errors.indexOutOfRange(e))},r.prototype.indexOfAction=function(e){for(var t=0;t<this.getActionCount();t++)if(this.getActionAt(t)===e)return t;return-1},r.prototype.remove=function(){return!!(this.parent&&this.parent instanceof M)&&this.parent.removeItem(this)},r.prototype.render=function(){return this._renderedElement=this.overrideInternalRender(),this._separatorElement=this.internalRenderSeparator(),this._renderedElement?(this.id&&(this._renderedElement.id=this.id),this.customCssSelector&&this._renderedElement.classList.add(this.customCssSelector),this._renderedElement.style.boxSizing="border-box",this._defaultRenderedElementDisplayMode=this._renderedElement.style.display?this._renderedElement.style.display:void 0,this.adjustRenderedElementSize(this._renderedElement),this.updateLayout(!1)):this.isDesignMode()&&(this._renderedElement=this.createPlaceholderElement()),this.getRootElement().updateActionsEnabledState(),this._renderedElement},r.prototype.updateLayout=function(e){this.updateRenderedElementVisibility(),this.applyPadding()},r.prototype.updateActionsEnabledState=function(){for(var e=0,t=this.getRootElement().getAllActions();e<t.length;e++){t[e].updateEnabledState()}},r.prototype.indexOf=function(e){return-1},r.prototype.isDesignMode=function(){var e=this.getRootElement();return e instanceof Ce&&e.designMode},r.prototype.isFirstElement=function(e){return!0},r.prototype.isLastElement=function(e){return!0},r.prototype.isAtTheVeryLeft=function(){return!this.parent||this.parent.isLeftMostElement(this)&&this.parent.isAtTheVeryLeft()},r.prototype.isAtTheVeryRight=function(){return!this.parent||this.parent.isRightMostElement(this)&&this.parent.isAtTheVeryRight()},r.prototype.isAtTheVeryTop=function(){return!this.parent||this.parent.isFirstElement(this)&&this.parent.isAtTheVeryTop()},r.prototype.isAtTheVeryBottom=function(){return!this.parent||this.parent.isLastElement(this)&&this.parent.isAtTheVeryBottom()},r.prototype.isBleedingAtTop=function(){return!1},r.prototype.isBleedingAtBottom=function(){return!1},r.prototype.isLeftMostElement=function(e){return!0},r.prototype.isRightMostElement=function(e){return!0},r.prototype.isTopElement=function(e){return this.isFirstElement(e)},r.prototype.isBottomElement=function(e){return this.isLastElement(e)},r.prototype.isHiddenDueToOverflow=function(){return void 0!==this._renderedElement&&"hidden"===this._renderedElement.style.visibility},r.prototype.getRootElement=function(){return this.getRootObject()},r.prototype.getParentContainer=function(){for(var e=this.parent;e;){if(e instanceof de)return e;e=e.parent}},r.prototype.getAllInputs=function(e){return[]},r.prototype.getAllActions=function(){for(var e=[],t=0;t<this.getActionCount();t++){var n=this.getActionAt(t);n&&e.push(n)}return e},r.prototype.getResourceInformation=function(){return[]},r.prototype.getElementById=function(e){return this.id===e?this:void 0},r.prototype.getActionById=function(e){},r.prototype.getEffectivePadding=function(){var e=this.getPadding();return e||this.getDefaultPadding()},r.prototype.getEffectiveHorizontalAlignment=function(){return void 0!==this.horizontalAlignment?this.horizontalAlignment:this.parent?this.parent.getEffectiveHorizontalAlignment():i.HorizontalAlignment.Left},Object.defineProperty(r.prototype,"hostConfig",{get:function(){return this._hostConfig?this._hostConfig:this.parent?this.parent.hostConfig:s.defaultHostConfig},set:function(e){this._hostConfig=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"index",{get:function(){return this.parent?this.parent.indexOf(this):0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isInteractive",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isStandalone",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isInline",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hasVisibleSeparator",{get:function(){return!(!this.parent||!this.separatorElement)&&(!this.parent.isFirstElement(this)&&(this.isVisible||this.isDesignMode()))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"separatorElement",{get:function(){return this._separatorElement},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),r.prototype.getElementSingletonBehavior=function(){return d.ElementSingletonBehavior.NotAllowed},r.langProperty=new u.StringProperty(u.Versions.v1_1,"lang",!0,/^[a-z]{2,3}$/gi),r.isVisibleProperty=new u.BoolProperty(u.Versions.v1_2,"isVisible",!0),r.separatorProperty=new u.BoolProperty(u.Versions.v1_0,"separator",!1),r.heightProperty=new u.ValueSetProperty(u.Versions.v1_1,"height",[{value:"auto"},{value:"stretch"}],"auto"),r.horizontalAlignmentProperty=new u.EnumProperty(u.Versions.v1_0,"horizontalAlignment",i.HorizontalAlignment),r.spacingProperty=new u.EnumProperty(u.Versions.v1_0,"spacing",i.Spacing,i.Spacing.Default),t([(0,u.property)(r.horizontalAlignmentProperty)],r.prototype,"horizontalAlignment",void 0),t([(0,u.property)(r.spacingProperty)],r.prototype,"spacing",void 0),t([(0,u.property)(r.separatorProperty)],r.prototype,"separator",void 0),t([(0,u.property)(r.heightProperty)],r.prototype,"height",void 0),t([(0,u.property)(r.langProperty)],r.prototype,"lang",null),t([(0,u.property)(r.isVisibleProperty)],r.prototype,"isVisible",null),r}(c.CardObject);Zw.CardElement=g;var y=function(t){function n(e,n,r){void 0===r&&(r=[]);var i=t.call(this,e,n,void 0)||this;return i.targetVersion=e,i.name=n,i.forbiddenActionTypes=r,i}return e(n,t),n.prototype.parse=function(e,t,n){var r=e;return n.parseAction(r,t[this.name],this.forbiddenActionTypes,r.isDesignMode())},n.prototype.toJSON=function(e,t,n,r){r.serializeValue(t,this.name,n?n.toJSON(r):void 0,void 0,!0)},n}(u.PropertyDefinition);Zw.ActionProperty=y;var A=function(n){function r(e){var t=n.call(this)||this;return t.ariaHidden=!1,e&&(t.text=e),t}return e(r,n),r.prototype.populateSchema=function(e){n.prototype.populateSchema.call(this,e),e.remove(r.selectActionProperty)},Object.defineProperty(r.prototype,"text",{get:function(){return this.getValue(r.textProperty)},set:function(e){this.setText(e)},enumerable:!1,configurable:!0}),r.prototype.getFontSize=function(e){switch(this.effectiveSize){case i.TextSize.Small:return e.fontSizes.small;case i.TextSize.Medium:return e.fontSizes.medium;case i.TextSize.Large:return e.fontSizes.large;case i.TextSize.ExtraLarge:return e.fontSizes.extraLarge;default:return e.fontSizes.default}},r.prototype.getColorDefinition=function(e,t){switch(t){case i.TextColor.Accent:return e.accent;case i.TextColor.Dark:return e.dark;case i.TextColor.Light:return e.light;case i.TextColor.Good:return e.good;case i.TextColor.Warning:return e.warning;case i.TextColor.Attention:return e.attention;default:return e.default}},r.prototype.setText=function(e){this.setValue(r.textProperty,e)},r.prototype.init=function(e){this.size=e.size,this.weight=e.weight,this.color=e.color,this.isSubtle=e.isSubtle},r.prototype.asString=function(){return this.text},r.prototype.applyStylesTo=function(e){var t,n=this.hostConfig.getFontTypeDefinition(this.effectiveFontType);switch(n.fontFamily&&(e.style.fontFamily=n.fontFamily),this.effectiveSize){case i.TextSize.Small:t=n.fontSizes.small;break;case i.TextSize.Medium:t=n.fontSizes.medium;break;case i.TextSize.Large:t=n.fontSizes.large;break;case i.TextSize.ExtraLarge:t=n.fontSizes.extraLarge;break;default:t=n.fontSizes.default}e.style.fontSize=t+"px";var r,o=this.getColorDefinition(this.getEffectiveStyleDefinition().foregroundColors,this.effectiveColor),s=a.stringToCssColor(this.effectiveIsSubtle?o.subtle:o.default);switch(s&&(e.style.color=s),this.effectiveWeight){case i.TextWeight.Lighter:r=n.fontWeights.lighter;break;case i.TextWeight.Bolder:r=n.fontWeights.bolder;break;default:r=n.fontWeights.default}e.style.fontWeight=r.toString(),this.ariaHidden&&e.setAttribute("aria-hidden","true")},r.prototype.getAllActions=function(){var e=n.prototype.getAllActions.call(this);return this.selectAction&&e.push(this.selectAction),e},Object.defineProperty(r.prototype,"effectiveColor",{get:function(){return void 0!==this.color?this.color:this.getEffectiveTextStyleDefinition().color},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"effectiveFontType",{get:function(){return void 0!==this.fontType?this.fontType:this.getEffectiveTextStyleDefinition().fontType},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"effectiveIsSubtle",{get:function(){return void 0!==this.isSubtle?this.isSubtle:this.getEffectiveTextStyleDefinition().isSubtle},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"effectiveSize",{get:function(){return void 0!==this.size?this.size:this.getEffectiveTextStyleDefinition().size},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"effectiveWeight",{get:function(){return void 0!==this.weight?this.weight:this.getEffectiveTextStyleDefinition().weight},enumerable:!1,configurable:!0}),r.textProperty=new u.StringProperty(u.Versions.v1_0,"text",!0),r.sizeProperty=new u.EnumProperty(u.Versions.v1_0,"size",i.TextSize),r.weightProperty=new u.EnumProperty(u.Versions.v1_0,"weight",i.TextWeight),r.colorProperty=new u.EnumProperty(u.Versions.v1_0,"color",i.TextColor),r.isSubtleProperty=new u.BoolProperty(u.Versions.v1_0,"isSubtle"),r.fontTypeProperty=new u.EnumProperty(u.Versions.v1_2,"fontType",i.FontType),r.selectActionProperty=new y(u.Versions.v1_1,"selectAction",["Action.ShowCard"]),t([(0,u.property)(r.sizeProperty)],r.prototype,"size",void 0),t([(0,u.property)(r.weightProperty)],r.prototype,"weight",void 0),t([(0,u.property)(r.colorProperty)],r.prototype,"color",void 0),t([(0,u.property)(r.fontTypeProperty)],r.prototype,"fontType",void 0),t([(0,u.property)(r.isSubtleProperty)],r.prototype,"isSubtle",void 0),t([(0,u.property)(r.textProperty)],r.prototype,"text",null),t([(0,u.property)(r.selectActionProperty)],r.prototype,"selectAction",void 0),r}(g);Zw.BaseTextBlock=A;var v=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.wrap=!1,e._treatAsPlainText=!0,e.useMarkdown=!0,e}var s,c;return e(r,n),r.prototype.restoreOriginalContent=function(){var e,t;if(void 0!==this.renderedElement){this.maxLines&&this.maxLines>0&&(this.renderedElement.style.maxHeight=this._computedLineHeight*this.maxLines+"px");var n=null!==(t=null===(e=r._ttRoundtripPolicy)||void 0===e?void 0:e.createHTML(this._originalInnerHtml))&&void 0!==t?t:this._originalInnerHtml;this.renderedElement.innerHTML=n}},r.prototype.truncateIfSupported=function(e){if(void 0!==this.renderedElement){var t=this.renderedElement.children,n=!t.length;if(n||1===t.length&&"p"===t[0].tagName.toLowerCase()&&!t[0].children.length){var r=n?this.renderedElement:t[0];return a.truncateText(r,e,this._computedLineHeight),!0}}return!1},r.prototype.setText=function(e){n.prototype.setText.call(this,e),this._processedText=void 0},r.prototype.internalRender=function(){var e,t,n=this;if(this._processedText=void 0,this.text){var i=this.preProcessPropertyValue(A.textProperty),s=this.hostConfig,c=void 0;if(this.forElementId){var u=document.createElement("label");u.htmlFor=this.forElementId,c=u}else c=document.createElement("div");if(c.classList.add(s.makeCssClassName("ac-textBlock")),c.style.overflow="hidden",this.applyStylesTo(c),"heading"===this.style){c.setAttribute("role","heading");var d=this.hostConfig.textBlock.headingLevel;void 0!==d&&d>0&&c.setAttribute("aria-level",d.toString())}if(this.selectAction&&s.supportsInteractivity&&(c.onclick=function(e){n.selectAction&&n.selectAction.isEffectivelyEnabled()&&(e.preventDefault(),e.cancelBubble=!0,n.selectAction.execute())},this.selectAction.setupElementForAccessibility(c),this.selectAction.isEffectivelyEnabled()&&c.classList.add(s.makeCssClassName("ac-selectable"))),!this._processedText){this._treatAsPlainText=!0;var p=l.formatText(this.lang,i);if(this.useMarkdown&&p){o.GlobalSettings.allowMarkForTextHighlighting&&(p=p.replace(/<mark>/g,"===").replace(/<\/mark>/g,"/==/"));var h=Ce.applyMarkdown(p);if(h.didProcess&&h.outputHtml){if(this._processedText=h.outputHtml,this._treatAsPlainText=!1,o.GlobalSettings.allowMarkForTextHighlighting&&this._processedText){var f="",m=this.getEffectiveStyleDefinition();m.highlightBackgroundColor&&(f+="background-color: "+m.highlightBackgroundColor+";"),m.highlightForegroundColor&&(f+="color: "+m.highlightForegroundColor+";"),f&&(f='style="'+f+'"'),this._processedText=this._processedText.replace(/===/g,"<mark "+f+">").replace(/\/==\//g,"</mark>")}}else this._processedText=p,this._treatAsPlainText=!0}else this._processedText=p,this._treatAsPlainText=!0}if(this._processedText||(this._processedText=""),this._treatAsPlainText)c.innerText=this._processedText;else{var g=null!==(t=null===(e=r._ttMarkdownPolicy)||void 0===e?void 0:e.createHTML(this._processedText))&&void 0!==t?t:this._processedText;c.innerHTML=g}if(c.firstElementChild instanceof HTMLElement){var y=c.firstElementChild;y.style.marginTop="0px",y.style.width="100%",this.wrap||(y.style.overflow="hidden",y.style.textOverflow="ellipsis")}c.lastElementChild instanceof HTMLElement&&(c.lastElementChild.style.marginBottom="0px");for(var v=c.getElementsByTagName("a"),b=function(e){e.classList.add(s.makeCssClassName("ac-anchor")),e.target="_blank",e.onclick=function(t){me(n,e,t)&&(t.preventDefault(),t.cancelBubble=!0)},e.oncontextmenu=function(t){return!me(n,e,t)||(t.preventDefault(),t.cancelBubble=!0,!1)}},w=0,E=Array.from(v);w<E.length;w++){b(E[w])}return this.wrap?(c.style.wordWrap="break-word",this.maxLines&&this.maxLines>0&&(c.style.overflow="hidden",a.isInternetExplorer()||!o.GlobalSettings.useWebkitLineClamp?c.style.maxHeight=this._computedLineHeight*this.maxLines+"px":(c.style.removeProperty("line-height"),c.style.display="-webkit-box",c.style.webkitBoxOrient="vertical",c.style.webkitLineClamp=this.maxLines.toString()))):(c.style.whiteSpace="nowrap",c.style.textOverflow="ellipsis"),(o.GlobalSettings.useAdvancedTextBlockTruncation||o.GlobalSettings.useAdvancedCardBottomTruncation)&&(this._originalInnerHtml=c.innerHTML),c}},r.prototype.truncateOverflow=function(e){return e>=this._computedLineHeight&&this.truncateIfSupported(e)},r.prototype.undoOverflowTruncation=function(){if(this.restoreOriginalContent(),o.GlobalSettings.useAdvancedTextBlockTruncation&&this.maxLines){var e=this._computedLineHeight*this.maxLines;this.truncateIfSupported(e)}},r.prototype.applyStylesTo=function(e){switch(n.prototype.applyStylesTo.call(this,e),this.getEffectiveHorizontalAlignment()){case i.HorizontalAlignment.Center:e.style.textAlign="center";break;case i.HorizontalAlignment.Right:e.style.textAlign="end";break;default:e.style.textAlign="start"}var t=this.hostConfig.lineHeights;if(t)switch(this.effectiveSize){case i.TextSize.Small:this._computedLineHeight=t.small;break;case i.TextSize.Medium:this._computedLineHeight=t.medium;break;case i.TextSize.Large:this._computedLineHeight=t.large;break;case i.TextSize.ExtraLarge:this._computedLineHeight=t.extraLarge;break;default:this._computedLineHeight=t.default}else this._computedLineHeight=1.33*this.getFontSize(this.hostConfig.getFontTypeDefinition(this.effectiveFontType));e.style.lineHeight=this._computedLineHeight+"px"},r.prototype.getJsonTypeName=function(){return"TextBlock"},r.prototype.getEffectiveTextStyleDefinition=function(){return this.style?this.hostConfig.textStyles.getStyleByName(this.style):n.prototype.getEffectiveTextStyleDefinition.call(this)},r.prototype.updateLayout=function(e){void 0===e&&(e=!1),n.prototype.updateLayout.call(this,e),o.GlobalSettings.useAdvancedTextBlockTruncation&&this.maxLines&&this.isDisplayed()&&(this.restoreOriginalContent(),this.truncateIfSupported(this._computedLineHeight*this.maxLines))},r.wrapProperty=new u.BoolProperty(u.Versions.v1_0,"wrap",!1),r.maxLinesProperty=new u.NumProperty(u.Versions.v1_0,"maxLines"),r.styleProperty=new u.ValueSetProperty(u.Versions.v1_5,"style",[{value:"default"},{value:"columnHeader"},{value:"heading"}]),r._ttMarkdownPolicy="undefined"==typeof window||null===(s=window.trustedTypes)||void 0===s?void 0:s.createPolicy("adaptivecards#markdownPassthroughPolicy",{createHTML:function(e){return e}}),r._ttRoundtripPolicy="undefined"==typeof window||null===(c=window.trustedTypes)||void 0===c?void 0:c.createPolicy("adaptivecards#restoreContentsPolicy",{createHTML:function(e){return e}}),t([(0,u.property)(r.wrapProperty)],r.prototype,"wrap",void 0),t([(0,u.property)(r.maxLinesProperty)],r.prototype,"maxLines",void 0),t([(0,u.property)(r.styleProperty)],r.prototype,"style",void 0),r}(A);Zw.TextBlock=v;var b=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.italic=!1,e.strikethrough=!1,e.highlight=!1,e.underline=!1,e}return e(r,n),r.prototype.populateSchema=function(e){n.prototype.populateSchema.call(this,e),e.add(A.selectActionProperty)},r.prototype.internalRender=function(){var e=this;if(this.text){var t=this.preProcessPropertyValue(A.textProperty),n=this.hostConfig,r=l.formatText(this.lang,t);r||(r="");var i=document.createElement("span");if(i.classList.add(n.makeCssClassName("ac-textRun")),this.applyStylesTo(i),this.selectAction&&n.supportsInteractivity){var o=document.createElement("a");o.classList.add(n.makeCssClassName("ac-anchor"));var a=this.selectAction.getHref();o.href=a||"",o.target="_blank",o.onclick=function(t){e.selectAction&&e.selectAction.isEffectivelyEnabled()&&(t.preventDefault(),t.cancelBubble=!0,e.selectAction.execute())},this.selectAction.setupElementForAccessibility(o),o.innerText=r,i.appendChild(o)}else i.innerText=r;return i}},r.prototype.applyStylesTo=function(e){if(n.prototype.applyStylesTo.call(this,e),this.italic&&(e.style.fontStyle="italic"),this.strikethrough&&(e.style.textDecoration="line-through"),this.highlight){var t=this.getColorDefinition(this.getEffectiveStyleDefinition().foregroundColors,this.effectiveColor),r=a.stringToCssColor(this.effectiveIsSubtle?t.highlightColors.subtle:t.highlightColors.default);r&&(e.style.backgroundColor=r)}this.underline&&(e.style.textDecoration="underline")},r.prototype.getJsonTypeName=function(){return"TextRun"},Object.defineProperty(r.prototype,"isStandalone",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isInline",{get:function(){return!0},enumerable:!1,configurable:!0}),r.italicProperty=new u.BoolProperty(u.Versions.v1_2,"italic",!1),r.strikethroughProperty=new u.BoolProperty(u.Versions.v1_2,"strikethrough",!1),r.highlightProperty=new u.BoolProperty(u.Versions.v1_2,"highlight",!1),r.underlineProperty=new u.BoolProperty(u.Versions.v1_3,"underline",!1),t([(0,u.property)(r.italicProperty)],r.prototype,"italic",void 0),t([(0,u.property)(r.strikethroughProperty)],r.prototype,"strikethrough",void 0),t([(0,u.property)(r.highlightProperty)],r.prototype,"highlight",void 0),t([(0,u.property)(r.underlineProperty)],r.prototype,"underline",void 0),r}(A);Zw.TextRun=b;var w=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._inlines=[],e}return e(n,t),n.prototype.internalAddInline=function(e,t){if(void 0===t&&(t=!1),!e.isInline)throw new Error(p.Strings.errors.elementCannotBeUsedAsInline());if(!(void 0===e.parent||t)&&e.parent!==this)throw new Error(p.Strings.errors.inlineAlreadyParented());e.setParent(this),this._inlines.push(e)},n.prototype.internalParse=function(e,n){if(t.prototype.internalParse.call(this,e,n),this._inlines=[],Array.isArray(e.inlines))for(var r=0,i=e.inlines;r<i.length;r++){var o=i[r],a=void 0;if("string"==typeof o){var s=new b;s.text=o,a=s}else a=n.parseElement(this,o,[],!1);a&&this.internalAddInline(a,!0)}},n.prototype.internalToJSON=function(e,n){if(t.prototype.internalToJSON.call(this,e,n),this._inlines.length>0){for(var r=[],i=0,o=this._inlines;i<o.length;i++){var a=o[i];r.push(a.toJSON(n))}n.serializeValue(e,"inlines",r)}},n.prototype.internalRender=function(){if(this._inlines.length>0){var e=void 0;if(this.forElementId){var t=document.createElement("label");t.htmlFor=this.forElementId,e=t}else e=document.createElement("div");switch(e.className=this.hostConfig.makeCssClassName("ac-richTextBlock"),this.getEffectiveHorizontalAlignment()){case i.HorizontalAlignment.Center:e.style.textAlign="center";break;case i.HorizontalAlignment.Right:e.style.textAlign="end";break;default:e.style.textAlign="start"}for(var n=0,r=0,o=this._inlines;r<o.length;r++){var a=o[r].render();a&&(e.appendChild(a),n++)}if(n>0)return e}},n.prototype.asString=function(){for(var e="",t=0,n=this._inlines;t<n.length;t++){e+=n[t].asString()}return e},n.prototype.getJsonTypeName=function(){return"RichTextBlock"},n.prototype.getInlineCount=function(){return this._inlines.length},n.prototype.getInlineAt=function(e){if(e>=0&&e<this._inlines.length)return this._inlines[e];throw new Error(p.Strings.errors.indexOutOfRange(e))},n.prototype.addInline=function(e){"string"==typeof e?this.internalAddInline(new b(e)):this.internalAddInline(e)},n.prototype.removeInline=function(e){var t=this._inlines.indexOf(e);return t>=0&&(this._inlines[t].setParent(void 0),this._inlines.splice(t,1),!0)},n}(g);Zw.RichTextBlock=w;var E=function(n){function r(e,t){var r=n.call(this)||this;return r.name=e,r.value=t,r}return e(r,n),r.prototype.getSchemaKey=function(){return"Fact"},r.titleProperty=new u.StringProperty(u.Versions.v1_0,"title"),r.valueProperty=new u.StringProperty(u.Versions.v1_0,"value"),t([(0,u.property)(r.titleProperty)],r.prototype,"name",void 0),t([(0,u.property)(r.valueProperty)],r.prototype,"value",void 0),r}(u.SerializableObject);Zw.Fact=E;var k=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),Object.defineProperty(r.prototype,"useDefaultSizing",{get:function(){return!1},enumerable:!1,configurable:!0}),r.prototype.internalRender=function(){var e=void 0,t=this.hostConfig;if(this.facts.length>0){(e=document.createElement("table")).style.borderWidth="0px",e.style.borderSpacing="0px",e.style.borderStyle="none",e.style.borderCollapse="collapse",e.style.display="block",e.style.overflow="hidden",e.classList.add(t.makeCssClassName("ac-factset")),e.setAttribute("role","presentation");for(var n=0;n<this.facts.length;n++){var r=document.createElement("tr");n>0&&(r.style.marginTop=t.factSet.spacing+"px");var o=document.createElement("td");o.style.padding="0",o.classList.add(t.makeCssClassName("ac-fact-title")),t.factSet.title.maxWidth&&(o.style.maxWidth=t.factSet.title.maxWidth+"px"),o.style.verticalAlign="top";var s=new v;s.setParent(this),s.text=!this.facts[n].name&&this.isDesignMode()?"Title":this.facts[n].name,s.size=t.factSet.title.size,s.color=t.factSet.title.color,s.isSubtle=t.factSet.title.isSubtle,s.weight=t.factSet.title.weight,s.wrap=t.factSet.title.wrap,s.spacing=i.Spacing.None,a.appendChild(o,s.render()),a.appendChild(r,o),(o=document.createElement("td")).style.width="10px",a.appendChild(r,o),(o=document.createElement("td")).style.padding="0",o.style.verticalAlign="top",o.classList.add(t.makeCssClassName("ac-fact-value")),(s=new v).setParent(this),s.text=this.facts[n].value,s.size=t.factSet.value.size,s.color=t.factSet.value.color,s.isSubtle=t.factSet.value.isSubtle,s.weight=t.factSet.value.weight,s.wrap=t.factSet.value.wrap,s.spacing=i.Spacing.None,a.appendChild(o,s.render()),a.appendChild(r,o),a.appendChild(e,r)}}return e},r.prototype.getJsonTypeName=function(){return"FactSet"},r.factsProperty=new u.SerializableObjectCollectionProperty(u.Versions.v1_0,"facts",E),t([(0,u.property)(r.factsProperty)],r.prototype,"facts",void 0),r}(g);Zw.FactSet=k;var C=function(t){function n(e,n,r,i){var o=t.call(this,e,n)||this;return o.targetVersion=e,o.name=n,o.internalName=r,o.fallbackProperty=i,o}return e(n,t),n.prototype.getInternalName=function(){return this.internalName},n.prototype.parse=function(e,t,n){var r=void 0,a=t[this.name];if(void 0===a)return this.defaultValue;var s=!1;if("string"==typeof a){try{var l=o.SizeAndUnit.parse(a,!0);l.unit===i.SizeUnit.Pixel&&(r=l.physicalSize,s=!0)}catch(e){}!s&&this.fallbackProperty&&(s=this.fallbackProperty.isValidValue(a,n))}return s||n.logParseEvent(e,i.ValidationEvent.InvalidPropertyValue,p.Strings.errors.invalidPropertyValue(a,this.name)),r},n.prototype.toJSON=function(e,t,n,r){r.serializeValue(t,this.name,"number"!=typeof n||isNaN(n)?void 0:n+"px")},n}(u.PropertyDefinition),_=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.size=i.Size.Auto,e.style=i.ImageStyle.Default,e}return e(r,n),r.prototype.populateSchema=function(e){n.prototype.populateSchema.call(this,e),e.remove(g.heightProperty)},r.prototype.applySize=function(e){if(this.pixelWidth||this.pixelHeight)this.pixelWidth&&(e.style.width=this.pixelWidth+"px"),this.pixelHeight&&(e.style.height=this.pixelHeight+"px");else if(this.maxHeight){switch(this.size){case i.Size.Small:e.style.height=this.hostConfig.imageSizes.small+"px";break;case i.Size.Large:e.style.height=this.hostConfig.imageSizes.large+"px";break;default:e.style.height=this.hostConfig.imageSizes.medium+"px"}e.style.maxHeight=this.maxHeight+"px"}else{switch(this.size){case i.Size.Stretch:e.style.width="100%";break;case i.Size.Auto:e.style.maxWidth="100%";break;case i.Size.Small:e.style.width=this.hostConfig.imageSizes.small+"px";break;case i.Size.Large:e.style.width=this.hostConfig.imageSizes.large+"px";break;case i.Size.Medium:e.style.width=this.hostConfig.imageSizes.medium+"px"}e.style.maxHeight="100%"}},Object.defineProperty(r.prototype,"useDefaultSizing",{get:function(){return!1},enumerable:!1,configurable:!0}),r.prototype.internalRender=function(){var e=this,t=void 0;if(this.url){(t=document.createElement("div")).style.display="flex",t.style.alignItems="flex-start";var n=this.hostConfig;switch(this.getEffectiveHorizontalAlignment()){case i.HorizontalAlignment.Center:t.style.justifyContent="center";break;case i.HorizontalAlignment.Right:t.style.justifyContent="flex-end";break;default:t.style.justifyContent="flex-start"}var o=document.createElement("img");o.onload=function(t){fe(e)},o.onerror=function(t){if(e.renderedElement){var n=e.getRootElement();if(e.renderedElement,n&&n.designMode){var r=document.createElement("div");r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="center",r.style.backgroundColor="#EEEEEE",r.style.color="black",r.innerText=":-(",r.style.padding="10px",e.applySize(r),e.renderedElement.appendChild(r)}}fe(e)},o.style.minWidth="0",o.classList.add(n.makeCssClassName("ac-image")),this.selectAction&&n.supportsInteractivity&&(o.onkeypress=function(t){e.selectAction&&e.selectAction.isEffectivelyEnabled()&&("Enter"===t.code||"Space"===t.code)&&(t.preventDefault(),t.cancelBubble=!0,e.selectAction.execute())},o.onclick=function(t){e.selectAction&&e.selectAction.isEffectivelyEnabled()&&(t.preventDefault(),t.cancelBubble=!0,e.selectAction.execute())},this.selectAction.setupElementForAccessibility(o),this.selectAction.isEffectivelyEnabled()&&o.classList.add(n.makeCssClassName("ac-selectable"))),this.applySize(o),this.style===i.ImageStyle.Person&&(o.style.borderRadius="50%",o.style.backgroundPosition="50% 50%",o.style.backgroundRepeat="no-repeat");var s=a.stringToCssColor(this.backgroundColor);s&&(o.style.backgroundColor=s),o.src=this.preProcessPropertyValue(r.urlProperty);var l=this.preProcessPropertyValue(r.altTextProperty);l&&(o.alt=l),t.appendChild(o)}return t},r.prototype.getJsonTypeName=function(){return"Image"},r.prototype.getAllActions=function(){var e=n.prototype.getAllActions.call(this);return this.selectAction&&e.push(this.selectAction),e},r.prototype.getActionById=function(e){var t=n.prototype.getActionById.call(this,e);return!t&&this.selectAction&&(t=this.selectAction.getActionById(e)),t},r.prototype.getResourceInformation=function(){return this.url?[{url:this.url,mimeType:"image"}]:[]},r.urlProperty=new u.StringProperty(u.Versions.v1_0,"url"),r.altTextProperty=new u.StringProperty(u.Versions.v1_0,"altText"),r.backgroundColorProperty=new u.StringProperty(u.Versions.v1_1,"backgroundColor"),r.styleProperty=new u.EnumProperty(u.Versions.v1_0,"style",i.ImageStyle,i.ImageStyle.Default),r.sizeProperty=new u.EnumProperty(u.Versions.v1_0,"size",i.Size,i.Size.Auto),r.pixelWidthProperty=new C(u.Versions.v1_1,"width","pixelWidth"),r.pixelHeightProperty=new C(u.Versions.v1_1,"height","pixelHeight",g.heightProperty),r.selectActionProperty=new y(u.Versions.v1_1,"selectAction",["Action.ShowCard"]),t([(0,u.property)(r.urlProperty)],r.prototype,"url",void 0),t([(0,u.property)(r.altTextProperty)],r.prototype,"altText",void 0),t([(0,u.property)(r.backgroundColorProperty)],r.prototype,"backgroundColor",void 0),t([(0,u.property)(r.sizeProperty)],r.prototype,"size",void 0),t([(0,u.property)(r.styleProperty)],r.prototype,"style",void 0),t([(0,u.property)(r.pixelWidthProperty)],r.prototype,"pixelWidth",void 0),t([(0,u.property)(r.pixelHeightProperty)],r.prototype,"pixelHeight",void 0),t([(0,u.property)(r.selectActionProperty)],r.prototype,"selectAction",void 0),r}(g);Zw.Image=_;var M=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.allowVerticalOverflow=!1,e}return e(r,n),r.prototype.populateSchema=function(e){n.prototype.populateSchema.call(this,e),this.isSelectable||e.remove(r.selectActionProperty)},r.prototype.isElementAllowed=function(e){return this.hostConfig.supportsInteractivity||!e.isInteractive},r.prototype.applyPadding=function(){if(n.prototype.applyPadding.call(this),this.renderedElement){var e=new o.SpacingDefinition;this.getEffectivePadding()&&(e=this.hostConfig.paddingDefinitionToSpacingDefinition(this.getEffectivePadding())),this.renderedElement.style.paddingTop=e.top+"px",this.renderedElement.style.paddingRight=e.right+"px",this.renderedElement.style.paddingBottom=e.bottom+"px",this.renderedElement.style.paddingLeft=e.left+"px",this.renderedElement.style.marginRight="0",this.renderedElement.style.marginLeft="0"}},Object.defineProperty(r.prototype,"isSelectable",{get:function(){return!1},enumerable:!1,configurable:!0}),r.prototype.forbiddenChildElements=function(){return[]},r.prototype.releaseDOMResources=function(){n.prototype.releaseDOMResources.call(this);for(var e=0;e<this.getItemCount();e++)this.getItemAt(e).releaseDOMResources()},r.prototype.internalValidateProperties=function(e){n.prototype.internalValidateProperties.call(this,e);for(var t=0;t<this.getItemCount();t++){var r=this.getItemAt(t);!this.hostConfig.supportsInteractivity&&r.isInteractive&&e.addFailure(this,i.ValidationEvent.InteractivityNotAllowed,p.Strings.errors.interactivityNotAllowed()),this.isElementAllowed(r)||e.addFailure(this,i.ValidationEvent.InteractivityNotAllowed,p.Strings.errors.elementTypeNotAllowed(r.getJsonTypeName())),r.internalValidateProperties(e)}this._selectAction&&this._selectAction.internalValidateProperties(e)},r.prototype.render=function(){var e=this,t=n.prototype.render.call(this);if(t){var r=this.hostConfig;this.allowVerticalOverflow&&(t.style.overflowX="hidden",t.style.overflowY="auto"),t&&this.isSelectable&&this._selectAction&&r.supportsInteractivity&&(t.onclick=function(t){e._selectAction&&e._selectAction.isEffectivelyEnabled()&&(t.preventDefault(),t.cancelBubble=!0,e._selectAction.execute())},t.onkeypress=function(t){e._selectAction&&e._selectAction.isEffectivelyEnabled()&&("Enter"===t.code||"Space"===t.code)&&(t.preventDefault(),t.cancelBubble=!0,e._selectAction.execute())},this._selectAction.setupElementForAccessibility(t),this._selectAction.isEffectivelyEnabled()&&t.classList.add(r.makeCssClassName("ac-selectable")))}return t},r.prototype.updateLayout=function(e){if(void 0===e&&(e=!0),n.prototype.updateLayout.call(this,e),e)for(var t=0;t<this.getItemCount();t++)this.getItemAt(t).updateLayout()},r.prototype.getAllInputs=function(e){void 0===e&&(e=!0);for(var t=[],n=0;n<this.getItemCount();n++)t.push.apply(t,this.getItemAt(n).getAllInputs(e));return t},r.prototype.getAllActions=function(){for(var e=n.prototype.getAllActions.call(this),t=0;t<this.getItemCount();t++)e.push.apply(e,this.getItemAt(t).getAllActions());return this._selectAction&&e.push(this._selectAction),e},r.prototype.getResourceInformation=function(){for(var e=[],t=0;t<this.getItemCount();t++)e.push.apply(e,this.getItemAt(t).getResourceInformation());return e},r.prototype.getElementById=function(e){var t=n.prototype.getElementById.call(this,e);if(!t)for(var r=0;r<this.getItemCount()&&!(t=this.getItemAt(r).getElementById(e));r++);return t},r.prototype.findDOMNodeOwner=function(e){for(var t,r=void 0,i=0;i<this.getItemCount();i++)if(r=this.getItemAt(i).findDOMNodeOwner(e))return r;for(i=0;i<this.getActionCount();i++)if(r=null===(t=this.getActionAt(i))||void 0===t?void 0:t.findDOMNodeOwner(e))return r;return n.prototype.findDOMNodeOwner.call(this,e)},r.selectActionProperty=new y(u.Versions.v1_1,"selectAction",["Action.ShowCard"]),t([(0,u.property)(r.selectActionProperty)],r.prototype,"_selectAction",void 0),r}(g);Zw.CardElementContainer=M;var T=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e._images=[],e.imageSize=i.ImageSize.Medium,e}return e(r,n),r.prototype.internalRender=function(){var e=void 0;if(this._images.length>0){(e=document.createElement("div")).style.display="flex",e.style.flexWrap="wrap";for(var t=0,n=this._images;t<n.length;t++){var r=n[t];switch(this.imageSize){case i.ImageSize.Small:r.size=i.Size.Small;break;case i.ImageSize.Large:r.size=i.Size.Large;break;default:r.size=i.Size.Medium}r.maxHeight=this.hostConfig.imageSet.maxImageHeight;var o=r.render();o&&(o.style.display="inline-flex",o.style.margin="0px",o.style.marginRight="10px",a.appendChild(e,o))}}return e},r.prototype.getItemCount=function(){return this._images.length},r.prototype.getItemAt=function(e){return this._images[e]},r.prototype.getFirstVisibleRenderedItem=function(){return this._images&&this._images.length>0?this._images[0]:void 0},r.prototype.getLastVisibleRenderedItem=function(){return this._images&&this._images.length>0?this._images[this._images.length-1]:void 0},r.prototype.removeItem=function(e){if(e instanceof _){var t=this._images.indexOf(e);if(t>=0)return this._images.splice(t,1),e.setParent(void 0),this.updateLayout(),!0}return!1},r.prototype.getJsonTypeName=function(){return"ImageSet"},r.prototype.addImage=function(e){if(e.parent)throw new Error("This image already belongs to another ImageSet");this._images.push(e),e.setParent(this)},r.prototype.indexOf=function(e){return e instanceof _?this._images.indexOf(e):-1},r.imagesProperty=new u.SerializableObjectCollectionProperty(u.Versions.v1_0,"images",_,function(e,t){t.setParent(e)}),r.imageSizeProperty=new u.EnumProperty(u.Versions.v1_0,"imageSize",i.ImageSize,i.ImageSize.Medium),t([(0,u.property)(r.imagesProperty)],r.prototype,"_images",void 0),t([(0,u.property)(r.imageSizeProperty)],r.prototype,"imageSize",void 0),r}(M);Zw.ImageSet=T;var S=function(n){function r(e,t){var r=n.call(this)||this;return r.url=e,r.mimeType=t,r}return e(r,n),r.prototype.isValid=function(){return!(!this.mimeType||!this.url)},r.mimeTypeProperty=new u.StringProperty(u.Versions.v1_1,"mimeType"),r.urlProperty=new u.StringProperty(u.Versions.v1_1,"url"),t([(0,u.property)(r.mimeTypeProperty)],r.prototype,"mimeType",void 0),t([(0,u.property)(r.urlProperty)],r.prototype,"url",void 0),r}(u.SerializableObject);Zw.ContentSource=S;var D=function(n){function r(e,t,r){var i=n.call(this,e,t)||this;return i.label=r,i}return e(r,n),r.prototype.getSchemaKey=function(){return"CaptionSource"},r.prototype.render=function(){var e=void 0;return this.isValid()&&((e=document.createElement("track")).src=this.url,e.kind="captions",e.label=this.label),e},r.labelProperty=new u.StringProperty(u.Versions.v1_6,"label"),t([(0,u.property)(r.labelProperty)],r.prototype,"label",void 0),r}(S);Zw.CaptionSource=D;var x=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getSchemaKey=function(){return"MediaSource"},n.prototype.render=function(){var e=void 0;return this.isValid()&&((e=document.createElement("source")).src=this.url,e.type=this.mimeType),e},n}(S);Zw.MediaSource=x;var I=function(){function e(){}return e.prototype.play=function(){},Object.defineProperty(e.prototype,"posterUrl",{get:function(){return this._posterUrl},set:function(e){this._posterUrl=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectedMediaType",{get:function(){},enumerable:!1,configurable:!0}),e}();Zw.MediaPlayer=I;var L=function(t){function i(e){var n=t.call(this)||this;return n.owner=e,n._selectedSources=[],n._captionSources=[],n.processSources(),n}return e(i,t),i.prototype.processSources=function(){var e;this._selectedSources=[],this._captionSources=[],this._selectedMediaType=void 0;for(var t=0,n=this.owner.sources;t<n.length;t++){var r=n[t],o=r.mimeType?r.mimeType.split("/"):[];if(2===o.length){if(!this._selectedMediaType){var a=i.supportedMediaTypes.indexOf(o[0]);a>=0&&(this._selectedMediaType=i.supportedMediaTypes[a])}o[0]===this._selectedMediaType&&this._selectedSources.push(r)}}(e=this._captionSources).push.apply(e,this.owner.captionSources)},i.prototype.canPlay=function(){return this._selectedSources.length>0},i.prototype.fetchVideoDetails=function(){return n(this,void 0,void 0,function(){return r(this,function(e){return[2]})})},i.prototype.render=function(){"video"===this._selectedMediaType?this._mediaElement=document.createElement("video"):this._mediaElement=document.createElement("audio"),this._mediaElement.setAttribute("aria-label",this.owner.altText?this.owner.altText:p.Strings.defaults.mediaPlayerAriaLabel()),this._mediaElement.setAttribute("webkit-playsinline",""),this._mediaElement.setAttribute("playsinline",""),this._mediaElement.setAttribute("crossorigin",""),this._mediaElement.autoplay=!0,this._mediaElement.controls=!0,a.isMobileOS()&&(this._mediaElement.muted=!0),this._mediaElement.preload="none",this._mediaElement.style.width="100%";for(var e=0,t=this.owner.sources;e<t.length;e++){var n=t[e].render();a.appendChild(this._mediaElement,n)}for(var r=0,i=this.owner.captionSources;r<i.length;r++){var o=i[r];if("vtt"==o.mimeType){var s=o.render();a.appendChild(this._mediaElement,s)}}return this._mediaElement},i.prototype.play=function(){this._mediaElement&&this._mediaElement.play()},Object.defineProperty(i.prototype,"selectedMediaType",{get:function(){return this._selectedMediaType},enumerable:!1,configurable:!0}),i.supportedMediaTypes=["audio","video"],i}(I);Zw.HTML5MediaPlayer=L;var P=function(t){function n(e){return t.call(this)||this}return e(n,t),n}(I);Zw.CustomMediaPlayer=P;var O=function(t){function n(e,n){var r=t.call(this,e)||this;return r.iFrameTitle=n,e.length>=2&&(r._videoId=e[1]),r}return e(n,t),n.prototype.canPlay=function(){return void 0!==this._videoId},n.prototype.render=function(){var e=document.createElement("div");e.style.position="relative",e.style.width="100%",e.style.height="0",e.style.paddingBottom="56.25%";var t=document.createElement("iframe");return t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.width="100%",t.style.height="100%",t.src=this.getEmbedVideoUrl(),t.frameBorder="0",this.iFrameTitle&&(t.title=this.iFrameTitle),t.allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",t.allowFullscreen=!0,e.appendChild(t),e},Object.defineProperty(n.prototype,"videoId",{get:function(){return this._videoId},enumerable:!1,configurable:!0}),n}(P);Zw.IFrameMediaMediaPlayer=O;var R=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return e(i,t),i.prototype.fetchVideoDetails=function(){return n(this,void 0,void 0,function(){var e,t,n;return r(this,function(r){switch(r.label){case 0:return e="https://vimeo.com/api/oembed.json?url=".concat(this.getEmbedVideoUrl()),[4,fetch(e)];case 1:return(t=r.sent()).ok?[4,t.json()]:[3,3];case 2:n=r.sent(),this.posterUrl=n.thumbnail_url,r.label=3;case 3:return[2]}})})},i.prototype.getEmbedVideoUrl=function(){return"https://player.vimeo.com/video/".concat(this.videoId,"?autoplay=1")},i}(O);Zw.VimeoPlayer=R;var B=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return e(i,t),i.prototype.fetchVideoDetails=function(){return n(this,void 0,void 0,function(){var e,t,n;return r(this,function(r){switch(r.label){case 0:return e="https://api.dailymotion.com/video/".concat(this.videoId,"?fields=thumbnail_720_url"),[4,fetch(e)];case 1:return(t=r.sent()).ok?[4,t.json()]:[3,3];case 2:n=r.sent(),this.posterUrl=n.thumbnail_720_url,r.label=3;case 3:return[2]}})})},i.prototype.getEmbedVideoUrl=function(){return"https://www.dailymotion.com/embed/video/".concat(this.videoId,"?autoplay=1")},i}(O);Zw.DailymotionPlayer=B;var Y=function(t){function i(e,n){var r=t.call(this,e,n)||this;return r.iFrameTitle=n,e.length>=3&&void 0!==e[2]&&(r._startTimeIndex=parseInt(e[2])),r}return e(i,t),i.prototype.fetchVideoDetails=function(){return n(this,void 0,void 0,function(){return r(this,function(e){return this.posterUrl=this.videoId?"https://img.youtube.com/vi/".concat(this.videoId,"/maxresdefault.jpg"):void 0,[2]})})},i.prototype.getEmbedVideoUrl=function(){var e="https://www.youtube.com/embed/".concat(this.videoId,"?autoplay=1");return void 0!==this._startTimeIndex&&(e+="&start=".concat(this._startTimeIndex)),e},i}(O);Zw.YouTubePlayer=Y;var N=function(i){function o(){var e=null!==i&&i.apply(this,arguments)||this;return e.sources=[],e.captionSources=[],e}return e(o,i),o.prototype.createMediaPlayer=function(){for(var e=0,t=o.customMediaPlayers;e<t.length;e++)for(var n=t[e],r=0,i=this.sources;r<i.length;r++){var a=i[r];if(a.url)for(var s=0,l=n.urlPatterns;s<l.length;s++){var c=l[s].exec(a.url);if(null!==c)return n.createMediaPlayer(c)}}return new L(this)},o.prototype.handlePlayButtonInvoke=function(e){if(this.hostConfig.media.allowInlinePlayback){if(e.preventDefault(),e.cancelBubble=!0,this.renderedElement){var t=this._mediaPlayer.render();f(this.renderedElement),this.renderedElement.appendChild(t),this._mediaPlayer.play(),t.focus()}}else o.onPlay&&(e.preventDefault(),e.cancelBubble=!0,o.onPlay(this))},o.prototype.displayPoster=function(){return n(this,void 0,void 0,function(){var e,t,n,i,o,a,s=this;return r(this,function(r){return this.renderedElement&&((e=document.createElement("div")).className=this.hostConfig.makeCssClassName("ac-media-poster"),e.setAttribute("role","contentinfo"),e.setAttribute("aria-label",this.altText?this.altText:p.Strings.defaults.mediaPlayerAriaLabel()),e.style.position="relative",e.style.display="flex",(t=this.poster?this.poster:this._mediaPlayer.posterUrl)||(t=this.hostConfig.media.defaultPoster),t?((n=document.createElement("img")).style.width="100%",n.style.height="100%",n.setAttribute("role","presentation"),n.onerror=function(t){n.parentNode&&n.parentNode.removeChild(n),e.classList.add("empty"),e.style.minHeight="150px"},n.src=t,e.appendChild(n)):(e.classList.add("empty"),e.style.minHeight="150px"),this.hostConfig.supportsInteractivity&&this._mediaPlayer.canPlay()&&((i=document.createElement("div")).tabIndex=0,i.setAttribute("role","button"),i.setAttribute("aria-label",p.Strings.defaults.mediaPlayerPlayMedia()),i.className=this.hostConfig.makeCssClassName("ac-media-playButton"),i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center",i.onclick=function(e){s.handlePlayButtonInvoke(e)},i.onkeypress=function(e){"Enter"!==e.code&&"Space"!==e.code||s.handlePlayButtonInvoke(e)},(o=document.createElement("div")).className=this.hostConfig.makeCssClassName("ac-media-playButton-arrow"),o.style.width="12px",o.style.height="15px",o.style.borderTopWidth="7.5px",o.style.borderBottomWidth="7.5px",o.style.borderLeftWidth="12px",o.style.borderRightWidth="0",o.style.borderStyle="solid",o.style.borderTopColor="transparent",o.style.borderRightColor="transparent",o.style.borderBottomColor="transparent",o.style.transform="translate(1.2px,0px)",i.appendChild(o),(a=document.createElement("div")).style.position="absolute",a.style.left="0",a.style.top="0",a.style.width="100%",a.style.height="100%",a.style.display="flex",a.style.justifyContent="center",a.style.alignItems="center",a.appendChild(i),e.appendChild(a)),f(this.renderedElement),this.renderedElement.appendChild(e)),[2]})})},o.prototype.internalRender=function(){var e=document.createElement("div");return e.className=this.hostConfig.makeCssClassName("ac-media"),e},o.prototype.render=function(){var e=this,t=i.prototype.render.call(this);return t&&(this._mediaPlayer=this.createMediaPlayer(),this._mediaPlayer.fetchVideoDetails().then(function(){return e.displayPoster()})),t},o.prototype.releaseDOMResources=function(){i.prototype.releaseDOMResources.call(this),this.displayPoster()},o.prototype.getJsonTypeName=function(){return"Media"},o.prototype.getResourceInformation=function(){var e=[];if(this._mediaPlayer){var t=this.poster?this.poster:this.hostConfig.media.defaultPoster;t&&e.push({url:t,mimeType:"image"})}for(var n=0,r=this.sources;n<r.length;n++){var i=r[n];i.isValid()&&e.push({url:i.url,mimeType:i.mimeType})}for(var o=0,a=this.captionSources;o<a.length;o++){var s=a[o];s.isValid()&&e.push({url:s.url,mimeType:s.mimeType})}return e},Object.defineProperty(o.prototype,"selectedMediaType",{get:function(){return this._mediaPlayer.selectedMediaType},enumerable:!1,configurable:!0}),o.customMediaPlayers=[{urlPatterns:[/^(?:https?:\/\/)?(?:www\.)?youtube\.com\/watch\?(?=.*v=([\w\d-_]+))(?=(?:.*t=(\d+))?).*/gi,/^(?:https?:\/\/)?youtu.be\/([\w\d-_]+)(?:\?t=(\d+))?/gi],createMediaPlayer:function(e){return new Y(e,p.Strings.defaults.youTubeVideoPlayer())}},{urlPatterns:[/^(?:https?:\/\/)?vimeo.com\/([\w\d-_]+).*/gi],createMediaPlayer:function(e){return new R(e,p.Strings.defaults.vimeoVideoPlayer())}},{urlPatterns:[/^(?:https?:\/\/)?(?:www.)?dailymotion.com\/video\/([\w\d-_]+).*/gi],createMediaPlayer:function(e){return new B(e,p.Strings.defaults.dailymotionVideoPlayer())}}],o.sourcesProperty=new u.SerializableObjectCollectionProperty(u.Versions.v1_1,"sources",x),o.captionSourcesProperty=new u.SerializableObjectCollectionProperty(u.Versions.v1_6,"captionSources",D),o.posterProperty=new u.StringProperty(u.Versions.v1_1,"poster"),o.altTextProperty=new u.StringProperty(u.Versions.v1_1,"altText"),t([(0,u.property)(o.sourcesProperty)],o.prototype,"sources",void 0),t([(0,u.property)(o.captionSourcesProperty)],o.prototype,"captionSources",void 0),t([(0,u.property)(o.posterProperty)],o.prototype,"poster",void 0),t([(0,u.property)(o.altTextProperty)],o.prototype,"altText",void 0),o}(g);Zw.Media=N;var V=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),r.prototype.getAllLabelIds=function(){var e=[];return this.labelledBy&&e.push(this.labelledBy),this._renderedLabelElement&&e.push(this._renderedLabelElement.id),this._renderedErrorMessageElement&&e.push(this._renderedErrorMessageElement.id),e},r.prototype.updateInputControlAriaLabelledBy=function(){if(this._renderedInputControlElement){var e=this.getAllLabelIds();e.length>0?this._renderedInputControlElement.setAttribute("aria-labelledby",e.join(" ")):this._renderedInputControlElement.removeAttribute("aria-labelledby")}},Object.defineProperty(r.prototype,"isNullable",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"renderedInputControlElement",{get:function(){return this._renderedInputControlElement},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"inputControlContainerElement",{get:function(){return this._inputControlContainerElement},enumerable:!1,configurable:!0}),r.prototype.overrideInternalRender=function(){var e=this.hostConfig;this._outerContainerElement=document.createElement("div"),this._outerContainerElement.style.display="flex",this._outerContainerElement.style.flexDirection="column";var t=a.generateUniqueId();if(this.label){var n=new w;n.setParent(this),n.forElementId=t;var r=new b(this.label);if(n.addInline(r),this.isRequired){r.init(e.inputs.label.requiredInputs);var i=new b(e.inputs.label.requiredInputs.suffix);i.color=e.inputs.label.requiredInputs.suffixColor,i.ariaHidden=!0,n.addInline(i)}else r.init(e.inputs.label.optionalInputs);this._renderedLabelElement=n.render(),this._renderedLabelElement&&(this._renderedLabelElement.id=a.generateUniqueId(),this._renderedLabelElement.style.marginBottom=e.getEffectiveSpacing(e.inputs.label.inputSpacing)+"px",this._outerContainerElement.appendChild(this._renderedLabelElement))}if(this._inputControlContainerElement=document.createElement("div"),this._inputControlContainerElement.className=e.makeCssClassName("ac-input-container"),this._inputControlContainerElement.style.display="flex","stretch"===this.height&&(this._inputControlContainerElement.style.alignItems="stretch",this._inputControlContainerElement.style.flex="1 1 auto"),this._renderedInputControlElement=this.internalRender(),this._renderedInputControlElement)return this._renderedInputControlElement.id=t,this._renderedInputControlElement.style.minWidth="0px",this.isNullable&&this.isRequired&&(this._renderedInputControlElement.setAttribute("aria-required","true"),this._renderedInputControlElement.classList.add(e.makeCssClassName("ac-input-required"))),this._inputControlContainerElement.appendChild(this._renderedInputControlElement),this._outerContainerElement.appendChild(this._inputControlContainerElement),this.updateInputControlAriaLabelledBy(),this._outerContainerElement;this.resetDirtyState()},r.prototype.valueChanged=function(){this.getRootElement().updateActionsEnabledState(),this.isValid()&&this.resetValidationFailureCue(),this.onValueChanged&&this.onValueChanged(this),function(e){var t=e.getRootElement(),n=t&&t.onInputValueChanged?t.onInputValueChanged:Ce.onInputValueChanged;n&&n(e)}(this)},r.prototype.resetValidationFailureCue=function(){this.renderedInputControlElement&&(this.renderedInputControlElement.classList.remove(this.hostConfig.makeCssClassName("ac-input-validation-failed")),this.updateInputControlAriaLabelledBy(),this._renderedErrorMessageElement&&(this._outerContainerElement.removeChild(this._renderedErrorMessageElement),this._renderedErrorMessageElement=void 0))},r.prototype.showValidationErrorMessage=function(){if(this.renderedElement&&this.errorMessage&&o.GlobalSettings.displayInputValidationErrors){var e=new v;e.setParent(this),e.text=this.errorMessage,e.wrap=!0,e.init(this.hostConfig.inputs.errorMessage),this._renderedErrorMessageElement=e.render(),this._renderedErrorMessageElement&&(this._renderedErrorMessageElement.id=a.generateUniqueId(),this._outerContainerElement.appendChild(this._renderedErrorMessageElement),this.updateInputControlAriaLabelledBy())}},r.prototype.focus=function(){this._renderedInputControlElement&&this._renderedInputControlElement.focus()},r.prototype.isValid=function(){return!0},r.prototype.isDirty=function(){return this.value!==this._oldValue},r.prototype.resetDirtyState=function(){this._oldValue=this.value},r.prototype.internalValidateProperties=function(e){n.prototype.internalValidateProperties.call(this,e),this.id||e.addFailure(this,i.ValidationEvent.PropertyCantBeNull,p.Strings.errors.inputsMustHaveUniqueId()),this.isRequired&&(this.label||e.addFailure(this,i.ValidationEvent.RequiredInputsShouldHaveLabel,"Required inputs should have a label"),this.errorMessage||e.addFailure(this,i.ValidationEvent.RequiredInputsShouldHaveErrorMessage,"Required inputs should have an error message"))},r.prototype.validateValue=function(){this.resetValidationFailureCue();var e=this.isRequired?this.isSet()&&this.isValid():this.isValid();return!e&&this.renderedInputControlElement&&(this.renderedInputControlElement.classList.add(this.hostConfig.makeCssClassName("ac-input-validation-failed")),this.showValidationErrorMessage()),e},r.prototype.getAllInputs=function(e){return[this]},r.prototype.render=function(){var e=n.prototype.render.call(this);return this.resetDirtyState(),e},Object.defineProperty(r.prototype,"isInteractive",{get:function(){return!0},enumerable:!1,configurable:!0}),r.labelProperty=new u.StringProperty(u.Versions.v1_3,"label",!0),r.isRequiredProperty=new u.BoolProperty(u.Versions.v1_3,"isRequired",!1),r.errorMessageProperty=new u.StringProperty(u.Versions.v1_3,"errorMessage",!0),t([(0,u.property)(r.labelProperty)],r.prototype,"label",void 0),t([(0,u.property)(r.isRequiredProperty)],r.prototype,"isRequired",void 0),t([(0,u.property)(r.errorMessageProperty)],r.prototype,"errorMessage",void 0),r}(g);Zw.Input=V;var F=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.isMultiline=!1,e.style=i.InputTextStyle.Text,e}return e(r,n),r.prototype.setupInput=function(e){var t=this;e.style.flex="1 1 auto",e.tabIndex=this.isDesignMode()?-1:0,this.placeholder&&(e.placeholder=this.placeholder,e.setAttribute("aria-label",this.placeholder)),this.defaultValue&&(e.value=this.defaultValue),this.maxLength&&this.maxLength>0&&(e.maxLength=this.maxLength),e.oninput=function(){t.valueChanged()},e.onkeypress=function(e){e.ctrlKey&&"Enter"===e.code&&t.inlineAction&&t.inlineAction.isEffectivelyEnabled()&&t.inlineAction.execute()}},r.prototype.internalRender=function(){var e;return this.isMultiline&&this.style!==i.InputTextStyle.Password?((e=document.createElement("textarea")).className=this.hostConfig.makeCssClassName("ac-input","ac-textInput","ac-multiline"),"stretch"===this.height&&(e.style.height="initial")):((e=document.createElement("input")).className=this.hostConfig.makeCssClassName("ac-input","ac-textInput"),e.type=i.InputTextStyle[this.style].toLowerCase()),this.setupInput(e),e},r.prototype.overrideInternalRender=function(){var e=this,t=n.prototype.overrideInternalRender.call(this);if(this.inlineAction){var r=document.createElement("button");if(r.className=this.hostConfig.makeCssClassName(this.inlineAction.isEffectivelyEnabled()?"ac-inlineActionButton":"ac-inlineActionButton-disabled"),r.onclick=function(t){e.inlineAction&&e.inlineAction.isEffectivelyEnabled()&&(t.preventDefault(),t.cancelBubble=!0,e.inlineAction.execute())},this.inlineAction.iconUrl){r.classList.add("iconOnly");var i=document.createElement("img");i.style.height="100%",i.setAttribute("role","presentation"),i.style.display="none",i.onload=function(){i.style.removeProperty("display")},i.onerror=function(){r.removeChild(i),r.classList.remove("iconOnly"),r.classList.add("textOnly"),r.textContent=e.inlineAction&&e.inlineAction.title?e.inlineAction.title:p.Strings.defaults.inlineActionTitle()},i.src=this.inlineAction.iconUrl,r.appendChild(i),r.title=this.inlineAction.title?this.inlineAction.title:p.Strings.defaults.inlineActionTitle()}else r.classList.add("textOnly"),r.textContent=this.inlineAction.title?this.inlineAction.title:p.Strings.defaults.inlineActionTitle();this.inlineAction.setupElementForAccessibility(r,!0),r.style.marginLeft="8px",this.inputControlContainerElement.appendChild(r)}return t},r.prototype.getJsonTypeName=function(){return"Input.Text"},r.prototype.getAllActions=function(){var e=n.prototype.getAllActions.call(this);return this.inlineAction&&e.push(this.inlineAction),e},r.prototype.getActionById=function(e){var t=n.prototype.getActionById.call(this,e);return!t&&this.inlineAction&&(t=this.inlineAction.getActionById(e)),t},r.prototype.isSet=function(){return!!this.value},r.prototype.isValid=function(){return!this.value||(!this.regex||new RegExp(this.regex,"g").test(this.value))},Object.defineProperty(r.prototype,"value",{get:function(){return this.renderedInputControlElement?(this.isMultiline,this.renderedInputControlElement.value):void 0},enumerable:!1,configurable:!0}),r.valueProperty=new u.StringProperty(u.Versions.v1_0,"value"),r.maxLengthProperty=new u.NumProperty(u.Versions.v1_0,"maxLength"),r.isMultilineProperty=new u.BoolProperty(u.Versions.v1_0,"isMultiline",!1),r.placeholderProperty=new u.StringProperty(u.Versions.v1_0,"placeholder"),r.styleProperty=new u.EnumProperty(u.Versions.v1_0,"style",i.InputTextStyle,i.InputTextStyle.Text,[{value:i.InputTextStyle.Text},{value:i.InputTextStyle.Tel},{value:i.InputTextStyle.Url},{value:i.InputTextStyle.Email},{value:i.InputTextStyle.Password,targetVersion:u.Versions.v1_5}]),r.inlineActionProperty=new y(u.Versions.v1_0,"inlineAction",["Action.ShowCard"]),r.regexProperty=new u.StringProperty(u.Versions.v1_3,"regex",!0),t([(0,u.property)(r.valueProperty)],r.prototype,"defaultValue",void 0),t([(0,u.property)(r.maxLengthProperty)],r.prototype,"maxLength",void 0),t([(0,u.property)(r.isMultilineProperty)],r.prototype,"isMultiline",void 0),t([(0,u.property)(r.placeholderProperty)],r.prototype,"placeholder",void 0),t([(0,u.property)(r.styleProperty)],r.prototype,"style",void 0),t([(0,u.property)(r.inlineActionProperty)],r.prototype,"inlineAction",void 0),t([(0,u.property)(r.regexProperty)],r.prototype,"regex",void 0),r}(V);Zw.TextInput=F;var j=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.valueOn="true",e.valueOff="false",e.wrap=!1,e}return e(r,n),r.prototype.updateInputControlAriaLabelledBy=function(){if(this._checkboxInputElement){var e=this.getAllLabelIds().join(" ");this._checkboxInputLabelElement&&this._checkboxInputLabelElement.id&&(e+=" "+this._checkboxInputLabelElement.id),e?this._checkboxInputElement.setAttribute("aria-labelledby",e):this._checkboxInputElement.removeAttribute("aria-labelledby")}},r.prototype.internalRender=function(){var e=this,t=document.createElement("div");if(t.className=this.hostConfig.makeCssClassName("ac-input","ac-toggleInput"),t.style.width="100%",t.style.display="flex",t.style.alignItems="center",this._checkboxInputElement=document.createElement("input"),this._checkboxInputElement.id=a.generateUniqueId(),this._checkboxInputElement.type="checkbox",this._checkboxInputElement.style.display="inline-block",this._checkboxInputElement.style.verticalAlign="middle",this._checkboxInputElement.style.margin="0",this._checkboxInputElement.style.flex="0 0 auto",this.title&&this._checkboxInputElement.setAttribute("aria-label",this.title),this.isRequired&&this._checkboxInputElement.setAttribute("aria-required","true"),this._checkboxInputElement.tabIndex=this.isDesignMode()?-1:0,this.defaultValue===this.valueOn&&(this._checkboxInputElement.checked=!0),this._oldCheckboxValue=this._checkboxInputElement.checked,this._checkboxInputElement.onchange=function(){e.valueChanged()},a.appendChild(t,this._checkboxInputElement),this.title||this.isDesignMode()){var n=new v;if(n.setParent(this),n.forElementId=this._checkboxInputElement.id,n.hostConfig=this.hostConfig,n.text=this.title?this.title:this.getJsonTypeName(),n.useMarkdown=o.GlobalSettings.useMarkdownInRadioButtonAndCheckbox,n.wrap=this.wrap,this._checkboxInputLabelElement=n.render(),this._checkboxInputLabelElement){this._checkboxInputLabelElement.id=a.generateUniqueId(),this._checkboxInputLabelElement.style.display="inline-block",this._checkboxInputLabelElement.style.flex="1 1 auto",this._checkboxInputLabelElement.style.marginLeft="6px",this._checkboxInputLabelElement.style.verticalAlign="middle";var r=document.createElement("div");r.style.width="6px",a.appendChild(t,r),a.appendChild(t,this._checkboxInputLabelElement)}}return t},Object.defineProperty(r.prototype,"isNullable",{get:function(){return!1},enumerable:!1,configurable:!0}),r.prototype.getJsonTypeName=function(){return"Input.Toggle"},r.prototype.focus=function(){this._checkboxInputElement&&this._checkboxInputElement.focus()},r.prototype.isSet=function(){return this.isRequired?this.value===this.valueOn:!!this.value},r.prototype.isDirty=function(){return!!this._checkboxInputElement&&this._checkboxInputElement.checked!==this._oldCheckboxValue},Object.defineProperty(r.prototype,"value",{get:function(){return this._checkboxInputElement?this._checkboxInputElement.checked?this.valueOn:this.valueOff:void 0},enumerable:!1,configurable:!0}),r.valueProperty=new u.StringProperty(u.Versions.v1_0,"value"),r.titleProperty=new u.StringProperty(u.Versions.v1_0,"title"),r.valueOnProperty=new u.StringProperty(u.Versions.v1_0,"valueOn",!0,void 0,"true",function(e){return"true"}),r.valueOffProperty=new u.StringProperty(u.Versions.v1_0,"valueOff",!0,void 0,"false",function(e){return"false"}),r.wrapProperty=new u.BoolProperty(u.Versions.v1_2,"wrap",!1),t([(0,u.property)(r.valueProperty)],r.prototype,"defaultValue",void 0),t([(0,u.property)(r.titleProperty)],r.prototype,"title",void 0),t([(0,u.property)(r.valueOnProperty)],r.prototype,"valueOn",void 0),t([(0,u.property)(r.valueOffProperty)],r.prototype,"valueOff",void 0),t([(0,u.property)(r.wrapProperty)],r.prototype,"wrap",void 0),r}(V);Zw.ToggleInput=j;var H=function(n){function r(e,t){var r=n.call(this)||this;return r.title=e,r.value=t,r}return e(r,n),r.prototype.getSchemaKey=function(){return"Choice"},r.titleProperty=new u.StringProperty(u.Versions.v1_0,"title"),r.valueProperty=new u.StringProperty(u.Versions.v1_0,"value"),t([(0,u.property)(r.titleProperty)],r.prototype,"title",void 0),t([(0,u.property)(r.valueProperty)],r.prototype,"value",void 0),r}(u.SerializableObject);Zw.Choice=H;var q=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.isMultiSelect=!1,e.wrap=!1,e.choices=[],e}return e(r,n),Object.defineProperty(r.prototype,"isCompact",{get:function(){return!this.style||"compact"===this.style},set:function(e){this.style=e?void 0:"expanded"},enumerable:!1,configurable:!0}),r.getUniqueCategoryName=function(){var e="__ac-category"+r._uniqueCategoryCounter;return r._uniqueCategoryCounter++,e},r.prototype.internalApplyAriaCurrent=function(){if(this._selectElement){var e=this._selectElement.options;if(e)for(var t=0,n=Array.from(e);t<n.length;t++){var r=n[t];r.selected?r.setAttribute("aria-current","true"):r.removeAttribute("aria-current")}}},r.prototype.renderCompoundInput=function(e,t,n){var r=this,i=document.createElement("div");i.className=this.hostConfig.makeCssClassName("ac-input",e),i.style.width="100%",i.tabIndex=this.isDesignMode()?-1:0,this._toggleInputs=[],this._labels=[];for(var s=0,l=this.choices;s<l.length;s++){var c=l[s],u=document.createElement("input");u.id=a.generateUniqueId(),u.type=t,u.style.margin="0",u.style.display="inline-block",u.style.verticalAlign="middle",u.style.flex="0 0 auto",u.name=this.id?this.id:this._uniqueCategoryName,this.isRequired&&u.setAttribute("aria-required","true"),u.tabIndex=this.isDesignMode()?-1:0,c.value&&(u.value=c.value),c.title&&u.setAttribute("aria-label",c.title),n&&c.value&&n.indexOf(c.value)>=0&&(u.checked=!0),u.onchange=function(){r.valueChanged()},this._toggleInputs.push(u);var d=document.createElement("div");d.style.display="flex",d.style.alignItems="center",a.appendChild(d,u);var p=new v;p.setParent(this),p.forElementId=u.id,p.hostConfig=this.hostConfig,p.text=c.title?c.title:"Choice "+this._toggleInputs.length,p.useMarkdown=o.GlobalSettings.useMarkdownInRadioButtonAndCheckbox,p.wrap=this.wrap;var h=p.render();if(this._labels.push(h),h){h.id=a.generateUniqueId(),h.style.display="inline-block",h.style.flex="1 1 auto",h.style.marginLeft="6px",h.style.verticalAlign="middle";var f=document.createElement("div");f.style.width="6px",a.appendChild(d,f),a.appendChild(d,h)}a.appendChild(i,d)}return i},r.prototype.updateInputControlAriaLabelledBy=function(){if((this.isMultiSelect||"expanded"===this.style)&&this._toggleInputs&&this._labels)for(var e=this.getAllLabelIds(),t=0;t<this._toggleInputs.length;t++){var r=e.join(" "),i=this._labels[t];i&&i.id&&(r+=" "+i.id),r?this._toggleInputs[t].setAttribute("aria-labelledby",r):this._toggleInputs[t].removeAttribute("aria-labelledby")}else n.prototype.updateInputControlAriaLabelledBy.call(this)},r.prototype.internalRender=function(){var e=this;if(this._uniqueCategoryName=r.getUniqueCategoryName(),this.isMultiSelect)return this.renderCompoundInput("ac-choiceSetInput-multiSelect","checkbox",this.defaultValue?this.defaultValue.split(this.hostConfig.choiceSetInputValueSeparator):void 0);if("expanded"===this.style)return this.renderCompoundInput("ac-choiceSetInput-expanded","radio",this.defaultValue?[this.defaultValue]:void 0);if("filtered"===this.style){var t=document.createElement("div");t.style.width="100%",this._textInput=document.createElement("input"),this._textInput.className=this.hostConfig.makeCssClassName("ac-input","ac-multichoiceInput","ac-choiceSetInput-filtered"),this._textInput.type="text",this._textInput.style.width="100%",this._textInput.oninput=function(){e.valueChanged(),e._textInput&&(e.value?(e._textInput.removeAttribute("placeholder"),e._textInput.removeAttribute("aria-label")):e.placeholder&&(e._textInput.placeholder=e.placeholder,e._textInput.setAttribute("aria-label",e.placeholder)))},this.defaultValue&&(this._textInput.value=this.defaultValue),this.placeholder&&!this._textInput.value&&(this._textInput.placeholder=this.placeholder,this._textInput.setAttribute("aria-label",this.placeholder)),this._textInput.tabIndex=this.isDesignMode()?-1:0;var n=document.createElement("datalist");n.id=a.generateUniqueId();for(var i=0,o=this.choices;i<o.length;i++){var s=o[i],l=document.createElement("option");s.title&&(l.value=s.title,l.setAttribute("aria-label",s.title)),l.tabIndex=this.isDesignMode()?-1:0,n.appendChild(l)}return this._textInput.setAttribute("list",n.id),t.append(this._textInput,n),t}this._selectElement=document.createElement("select"),this._selectElement.className=this.hostConfig.makeCssClassName("ac-input","ac-multichoiceInput","ac-choiceSetInput-compact"),this._selectElement.style.width="100%",this._selectElement.tabIndex=this.isDesignMode()?-1:0;var c=document.createElement("option");c.selected=!0,c.disabled=!0,c.hidden=!0,c.value="",this.placeholder&&(c.text=this.placeholder),a.appendChild(this._selectElement,c);for(var u=0,d=this.choices;u<d.length;u++){s=d[u];(l=document.createElement("option")).value=s.value,s.title&&(l.text=s.title,l.setAttribute("aria-label",s.title)),l.tabIndex=this.isDesignMode()?-1:0,s.value===this.defaultValue&&(l.selected=!0),a.appendChild(this._selectElement,l)}return this._selectElement.onchange=function(){e.internalApplyAriaCurrent(),e.valueChanged()},this.internalApplyAriaCurrent(),this._selectElement},r.prototype.getJsonTypeName=function(){return"Input.ChoiceSet"},r.prototype.focus=function(){this._toggleInputs&&(this.isMultiSelect||"expanded"===this.style)?this._toggleInputs.length>0&&this._toggleInputs[0].focus():this._textInput?this._textInput.focus():n.prototype.focus.call(this)},r.prototype.internalValidateProperties=function(e){n.prototype.internalValidateProperties.call(this,e),0===this.choices.length&&e.addFailure(this,i.ValidationEvent.CollectionCantBeEmpty,p.Strings.errors.choiceSetMustHaveAtLeastOneChoice());for(var t=0,r=this.choices;t<r.length;t++){var o=r[t];o.title&&o.value||e.addFailure(this,i.ValidationEvent.PropertyCantBeNull,p.Strings.errors.choiceSetChoicesMustHaveTitleAndValue())}},r.prototype.isSet=function(){return!!this.value},r.prototype.isValid=function(){if(this._textInput){if(""===this.value||this.value===this.placeholder)return!0;for(var e=0,t=this.choices;e<t.length;e++){var r=t[e];if(this.value===r.value)return!0}return!1}return n.prototype.isValid.call(this)},Object.defineProperty(r.prototype,"value",{get:function(){if(this.isMultiSelect){if(!this._toggleInputs||0===this._toggleInputs.length)return;for(var e="",t=0,n=this._toggleInputs;t<n.length;t++){(l=n[t]).checked&&(""!==e&&(e+=this.hostConfig.choiceSetInputValueSeparator),e+=l.value)}return e||void 0}if(this._selectElement)return this._selectElement.selectedIndex>0?this._selectElement.value:void 0;if(this._textInput){for(var r=0,i=this.choices;r<i.length;r++){var o=i[r];if(o.title&&this._textInput.value===o.title)return o.value}return this._textInput.value}if(this._toggleInputs&&this._toggleInputs.length>0)for(var a=0,s=this._toggleInputs;a<s.length;a++){var l;if((l=s[a]).checked)return l.value}},enumerable:!1,configurable:!0}),r.valueProperty=new u.StringProperty(u.Versions.v1_0,"value"),r.choicesProperty=new u.SerializableObjectCollectionProperty(u.Versions.v1_0,"choices",H),r.styleProperty=new u.ValueSetProperty(u.Versions.v1_0,"style",[{value:"compact"},{value:"expanded"},{value:"filtered",targetVersion:u.Versions.v1_5}],"compact"),r.isMultiSelectProperty=new u.BoolProperty(u.Versions.v1_0,"isMultiSelect",!1),r.placeholderProperty=new u.StringProperty(u.Versions.v1_0,"placeholder"),r.wrapProperty=new u.BoolProperty(u.Versions.v1_2,"wrap",!1),r._uniqueCategoryCounter=0,t([(0,u.property)(r.valueProperty)],r.prototype,"defaultValue",void 0),t([(0,u.property)(r.styleProperty)],r.prototype,"style",void 0),t([(0,u.property)(r.isMultiSelectProperty)],r.prototype,"isMultiSelect",void 0),t([(0,u.property)(r.placeholderProperty)],r.prototype,"placeholder",void 0),t([(0,u.property)(r.wrapProperty)],r.prototype,"wrap",void 0),t([(0,u.property)(r.choicesProperty)],r.prototype,"choices",void 0),r}(V);Zw.ChoiceSetInput=q;var G=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),r.prototype.internalRender=function(){var e=this;return this._numberInputElement=document.createElement("input"),this._numberInputElement.setAttribute("type","number"),void 0!==this.min&&this._numberInputElement.setAttribute("min",this.min.toString()),void 0!==this.max&&this._numberInputElement.setAttribute("max",this.max.toString()),this._numberInputElement.className=this.hostConfig.makeCssClassName("ac-input","ac-numberInput"),this._numberInputElement.style.width="100%",this._numberInputElement.tabIndex=this.isDesignMode()?-1:0,void 0!==this.defaultValue&&(this._numberInputElement.valueAsNumber=this.defaultValue),this.placeholder&&(this._numberInputElement.placeholder=this.placeholder,this._numberInputElement.setAttribute("aria-label",this.placeholder)),this._numberInputElement.oninput=function(){e.valueChanged()},this._numberInputElement},r.prototype.getJsonTypeName=function(){return"Input.Number"},r.prototype.isSet=function(){return void 0!==this.value&&!isNaN(this.value)},r.prototype.isValid=function(){if(void 0===this.value)return!this.isRequired;var e=!0;return void 0!==this.min&&(e=e&&this.value>=this.min),void 0!==this.max&&(e=e&&this.value<=this.max),e},Object.defineProperty(r.prototype,"value",{get:function(){return this._numberInputElement?this._numberInputElement.valueAsNumber:void 0},set:function(e){e&&this._numberInputElement&&(this._numberInputElement.value=e.toString())},enumerable:!1,configurable:!0}),r.valueProperty=new u.NumProperty(u.Versions.v1_0,"value"),r.placeholderProperty=new u.StringProperty(u.Versions.v1_0,"placeholder"),r.minProperty=new u.NumProperty(u.Versions.v1_0,"min"),r.maxProperty=new u.NumProperty(u.Versions.v1_0,"max"),t([(0,u.property)(r.valueProperty)],r.prototype,"defaultValue",void 0),t([(0,u.property)(r.minProperty)],r.prototype,"min",void 0),t([(0,u.property)(r.maxProperty)],r.prototype,"max",void 0),t([(0,u.property)(r.placeholderProperty)],r.prototype,"placeholder",void 0),r}(V);Zw.NumberInput=G;var z=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),r.prototype.internalRender=function(){var e=this;return this._dateInputElement=document.createElement("input"),this._dateInputElement.setAttribute("type","date"),this.min&&this._dateInputElement.setAttribute("min",this.min),this.max&&this._dateInputElement.setAttribute("max",this.max),this.placeholder&&(this._dateInputElement.placeholder=this.placeholder,this._dateInputElement.setAttribute("aria-label",this.placeholder)),this._dateInputElement.tabIndex=this.isDesignMode()?-1:0,this._dateInputElement.className=this.hostConfig.makeCssClassName("ac-input","ac-dateInput"),this._dateInputElement.style.width="100%",this._dateInputElement.oninput=function(){e.valueChanged()},this.defaultValue&&(this._dateInputElement.value=this.defaultValue),this._dateInputElement},r.prototype.getJsonTypeName=function(){return"Input.Date"},r.prototype.isSet=function(){return!!this.value},r.prototype.isValid=function(){if(!this.value)return!this.isRequired;var e=new Date(this.value),t=!0;if(this.min){var n=new Date(this.min);t=t&&e>=n}if(this.max){var r=new Date(this.max);t=t&&e<=r}return t},Object.defineProperty(r.prototype,"value",{get:function(){return this._dateInputElement?this._dateInputElement.value:void 0},enumerable:!1,configurable:!0}),r.valueProperty=new u.StringProperty(u.Versions.v1_0,"value"),r.placeholderProperty=new u.StringProperty(u.Versions.v1_0,"placeholder"),r.minProperty=new u.StringProperty(u.Versions.v1_0,"min"),r.maxProperty=new u.StringProperty(u.Versions.v1_0,"max"),t([(0,u.property)(r.valueProperty)],r.prototype,"defaultValue",void 0),t([(0,u.property)(r.minProperty)],r.prototype,"min",void 0),t([(0,u.property)(r.maxProperty)],r.prototype,"max",void 0),t([(0,u.property)(r.placeholderProperty)],r.prototype,"placeholder",void 0),r}(V);Zw.DateInput=z;var U=function(t){function n(e,n){var r=t.call(this,e,n,function(e,t,n,r){var i=n[t.name];if("string"==typeof i&&i&&/^[0-9]{2}:[0-9]{2}$/.test(i))return i},function(e,t,n,r,i){i.serializeValue(n,t.name,r)})||this;return r.targetVersion=e,r.name=n,r}return e(n,t),n}(u.CustomProperty);Zw.TimeProperty=U;var W=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),r.convertTimeStringToDate=function(e){return new Date("1973-09-04T"+e+":00Z")},r.prototype.internalRender=function(){var e=this;return this._timeInputElement=document.createElement("input"),this._timeInputElement.setAttribute("type","time"),this.min&&this._timeInputElement.setAttribute("min",this.min),this.max&&this._timeInputElement.setAttribute("max",this.max),this._timeInputElement.className=this.hostConfig.makeCssClassName("ac-input","ac-timeInput"),this._timeInputElement.style.width="100%",this._timeInputElement.oninput=function(){e.valueChanged()},this.placeholder&&(this._timeInputElement.placeholder=this.placeholder,this._timeInputElement.setAttribute("aria-label",this.placeholder)),this._timeInputElement.tabIndex=this.isDesignMode()?-1:0,this.defaultValue&&(this._timeInputElement.value=this.defaultValue),this._timeInputElement},r.prototype.getJsonTypeName=function(){return"Input.Time"},r.prototype.isSet=function(){return!!this.value},r.prototype.isValid=function(){if(!this.value)return!this.isRequired;var e=r.convertTimeStringToDate(this.value),t=!0;if(this.min){var n=r.convertTimeStringToDate(this.min);t=t&&e>=n}if(this.max){var i=r.convertTimeStringToDate(this.max);t=t&&e<=i}return t},Object.defineProperty(r.prototype,"value",{get:function(){return this._timeInputElement?this._timeInputElement.value:void 0},enumerable:!1,configurable:!0}),r.valueProperty=new U(u.Versions.v1_0,"value"),r.placeholderProperty=new u.StringProperty(u.Versions.v1_0,"placeholder"),r.minProperty=new U(u.Versions.v1_0,"min"),r.maxProperty=new U(u.Versions.v1_0,"max"),t([(0,u.property)(r.valueProperty)],r.prototype,"defaultValue",void 0),t([(0,u.property)(r.minProperty)],r.prototype,"min",void 0),t([(0,u.property)(r.maxProperty)],r.prototype,"max",void 0),t([(0,u.property)(r.placeholderProperty)],r.prototype,"placeholder",void 0),r}(V);Zw.TimeInput=W;var Q=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.style=i.ActionStyle.Default,e.mode=i.ActionMode.Primary,e._state=0,e._isFocusable=!0,e}return e(r,n),r.prototype.renderButtonContent=function(){if(this.renderedElement){var e=this.hostConfig,t=document.createElement("div");if(t.style.overflow="hidden",t.style.textOverflow="ellipsis",e.actions.iconPlacement===i.ActionIconPlacement.AboveTitle||e.actions.allowTitleToWrap||(t.style.whiteSpace="nowrap"),this.title&&(t.innerText=this.title),this.iconUrl){var n=document.createElement("img");n.src=this.iconUrl,n.style.width=e.actions.iconSize+"px",n.style.height=e.actions.iconSize+"px",n.style.flex="0 0 auto",e.actions.iconPlacement===i.ActionIconPlacement.AboveTitle?(this.renderedElement.classList.add("iconAbove"),this.renderedElement.style.flexDirection="column",this.title&&(n.style.marginBottom="6px")):(this.renderedElement.classList.add("iconLeft"),n.style.maxHeight="100%",this.title&&(n.style.marginRight="6px")),this.renderedElement.appendChild(n),this.renderedElement.appendChild(t)}else this.renderedElement.classList.add("noIcon"),this.renderedElement.appendChild(t)}},r.prototype.getParentContainer=function(){return this.parent instanceof de?this.parent:this.parent?this.parent.getParentContainer():void 0},r.prototype.isDesignMode=function(){var e=this.getRootObject();return e instanceof g&&e.isDesignMode()},r.prototype.updateCssClasses=function(){var e,t;if(this.parent&&this.renderedElement){var n=this.parent.hostConfig;this.renderedElement.className=n.makeCssClassName(this.isEffectivelyEnabled()?"ac-pushButton":"ac-pushButton-disabled");var r=this.getParentContainer();if(r){var o=r.getEffectiveStyle();o&&this.renderedElement.classList.add("style-"+o)}switch(this.renderedElement.tabIndex=!this.isDesignMode()&&this.isFocusable?0:-1,this._state){case 0:break;case 1:this.renderedElement.classList.add(n.makeCssClassName("expanded"));break;case 2:this.renderedElement.classList.add(n.makeCssClassName("subdued"))}this.style&&this.isEffectivelyEnabled()&&(this.style===i.ActionStyle.Positive?(e=this.renderedElement.classList).add.apply(e,n.makeCssClassNames("primary","style-positive")):(t=this.renderedElement.classList).add.apply(t,n.makeCssClassNames("style-"+this.style.toLowerCase())))}},r.prototype.getDefaultSerializationContext=function(){return new Me},r.prototype.internalGetReferencedInputs=function(){return{}},r.prototype.internalPrepareForExecution=function(e){},r.prototype.internalValidateInputs=function(e){var t=[];if(e)for(var n=0,r=Object.keys(e);n<r.length;n++){var i=e[r[n]];i.validateValue()||t.push(i)}return t},r.prototype.shouldSerialize=function(e){return void 0!==e.actionRegistry.findByName(this.getJsonTypeName())},r.prototype.raiseExecuteActionEvent=function(){var e,t,n;this.onExecute&&this.onExecute(this),t=(e=this).parent?e.parent.getRootElement():void 0,n=t&&t.onExecuteAction?t.onExecuteAction:Ce.onExecuteAction,e.prepareForExecution()&&n&&n(e)},r.prototype.internalAfterExecute=function(){var e=this.getRootObject();e instanceof g&&e.updateActionsEnabledState()},r.prototype.getHref=function(){return""},r.prototype.getAriaRole=function(){return"button"},r.prototype.setupElementForAccessibility=function(e,t){if(void 0===t&&(t=!1),e.tabIndex=this.isEffectivelyEnabled()&&!this.isDesignMode()?0:-1,e.setAttribute("role",this.getAriaRole()),e instanceof HTMLButtonElement&&(e.disabled=!this.isEffectivelyEnabled()),this.isEffectivelyEnabled()?(e.removeAttribute("aria-disabled"),e.classList.add(this.hostConfig.makeCssClassName("ac-selectable"))):e.setAttribute("aria-disabled","true"),this.title?(e.setAttribute("aria-label",this.title),e.title=this.title):(e.removeAttribute("aria-label"),e.removeAttribute("title")),this.tooltip){var n=t?this.title?"aria-description":"aria-label":"aria-description";e.setAttribute(n,this.tooltip),e.title=this.tooltip}},r.prototype.parse=function(e,t){return n.prototype.parse.call(this,e,t||new Me)},r.prototype.render=function(){var e=this,t=document.createElement("button");t.type="button",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.onclick=function(t){e.isEffectivelyEnabled()&&(t.preventDefault(),t.cancelBubble=!0,e.execute())},this._renderedElement=t,this.renderButtonContent(),this.updateCssClasses(),this.setupElementForAccessibility(t)},r.prototype.execute=function(){this._actionCollection&&this._actionCollection.actionExecuted(this),this.raiseExecuteActionEvent(),this.internalAfterExecute()},r.prototype.prepareForExecution=function(){var e=this.getReferencedInputs(),t=this.internalValidateInputs(e);return t.length>0?(t[0].focus(),!1):(this.internalPrepareForExecution(e),!0)},r.prototype.remove=function(){return!!this._actionCollection&&this._actionCollection.removeAction(this)},r.prototype.getAllInputs=function(e){return[]},r.prototype.getAllActions=function(){return[this]},r.prototype.getResourceInformation=function(){return this.iconUrl?[{url:this.iconUrl,mimeType:"image"}]:[]},r.prototype.getActionById=function(e){return this.id===e?this:void 0},r.prototype.getReferencedInputs=function(){return this.internalGetReferencedInputs()},r.prototype.validateInputs=function(){return this.internalValidateInputs(this.getReferencedInputs())},r.prototype.updateEnabledState=function(){},r.prototype.isEffectivelyEnabled=function(){return this.isEnabled},Object.defineProperty(r.prototype,"isPrimary",{get:function(){return this.style===i.ActionStyle.Positive},set:function(e){e?this.style=i.ActionStyle.Positive:this.style===i.ActionStyle.Positive&&(this.style=i.ActionStyle.Default)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hostConfig",{get:function(){return this.parent?this.parent.hostConfig:s.defaultHostConfig},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"state",{get:function(){return this._state},set:function(e){this._state!==e&&(this._state=e,this.updateCssClasses())},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isFocusable",{get:function(){return this._isFocusable},set:function(e){this._isFocusable!==e&&(this._isFocusable=e,this.updateCssClasses())},enumerable:!1,configurable:!0}),r.titleProperty=new u.StringProperty(u.Versions.v1_0,"title"),r.iconUrlProperty=new u.StringProperty(u.Versions.v1_1,"iconUrl"),r.styleProperty=new u.ValueSetProperty(u.Versions.v1_2,"style",[{value:i.ActionStyle.Default},{value:i.ActionStyle.Positive},{value:i.ActionStyle.Destructive}],i.ActionStyle.Default),r.modeProperty=new u.ValueSetProperty(u.Versions.v1_5,"mode",[{value:i.ActionMode.Primary},{value:i.ActionMode.Secondary}],i.ActionMode.Primary),r.tooltipProperty=new u.StringProperty(u.Versions.v1_5,"tooltip"),r.isEnabledProperty=new u.BoolProperty(u.Versions.v1_5,"isEnabled",!0),t([(0,u.property)(r.titleProperty)],r.prototype,"title",void 0),t([(0,u.property)(r.iconUrlProperty)],r.prototype,"iconUrl",void 0),t([(0,u.property)(r.styleProperty)],r.prototype,"style",void 0),t([(0,u.property)(r.modeProperty)],r.prototype,"mode",void 0),t([(0,u.property)(r.tooltipProperty)],r.prototype,"tooltip",void 0),t([(0,u.property)(r.isEnabledProperty)],r.prototype,"isEnabled",void 0),r}(c.CardObject);Zw.Action=Q;var Z=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.disabledUnlessAssociatedInputsChange=!1,e._isPrepared=!1,e._areReferencedInputsDirty=!1,e}return e(r,n),r.prototype.internalGetReferencedInputs=function(){var e={};if("none"!==this.associatedInputs){for(var t=this.parent,n=[];t;)n.push.apply(n,t.getAllInputs(!1)),t=t.parent;for(var r=0,i=n;r<i.length;r++){var o=i[r];o.id&&(e[o.id]=o)}}return e},r.prototype.internalPrepareForExecution=function(e){if(this._originalData?this._processedData=JSON.parse(JSON.stringify(this._originalData)):this._processedData={},this._processedData&&e)for(var t=0,n=Object.keys(e);t<n.length;t++){var r=e[n[t]];r.id&&r.isSet()&&(this._processedData[r.id]="string"==typeof r.value?r.value:r.value.toString())}this._isPrepared=!0},r.prototype.internalAfterExecute=function(){o.GlobalSettings.resetInputsDirtyStateAfterActionExecution&&this.resetReferencedInputsDirtyState()},r.prototype.resetReferencedInputsDirtyState=function(){var e=this.getReferencedInputs();if(this._areReferencedInputsDirty=!1,e)for(var t=0,n=Object.keys(e);t<n.length;t++){e[n[t]].resetDirtyState()}},r.prototype.updateEnabledState=function(){this._areReferencedInputsDirty=!1;var e=this.getReferencedInputs();if(e)for(var t=0,n=Object.keys(e);t<n.length;t++){if(e[n[t]].isDirty()){this._areReferencedInputsDirty=!0;break}}this.updateCssClasses(),this._renderedElement&&this.setupElementForAccessibility(this._renderedElement)},r.prototype.isEffectivelyEnabled=function(){var e=n.prototype.isEffectivelyEnabled.call(this);return this.disabledUnlessAssociatedInputsChange?e&&this._areReferencedInputsDirty:e},Object.defineProperty(r.prototype,"data",{get:function(){return this._isPrepared?this._processedData:this._originalData},set:function(e){this._originalData=e,this._isPrepared=!1},enumerable:!1,configurable:!0}),r.dataProperty=new u.PropertyDefinition(u.Versions.v1_0,"data"),r.associatedInputsProperty=new u.CustomProperty(u.Versions.v1_3,"associatedInputs",function(e,t,n,r){var i=n[t.name];if(void 0!==i&&"string"==typeof i)return"none"===i.toLowerCase()?"none":"auto"},function(e,t,n,r,i){i.serializeValue(n,t.name,r)}),r.disabledUnlessAssociatedInputsChangeProperty=new u.BoolProperty(u.Versions.v1_6,"disabledUnlessAssociatedInputsChange",!1),t([(0,u.property)(r.dataProperty)],r.prototype,"_originalData",void 0),t([(0,u.property)(r.associatedInputsProperty)],r.prototype,"associatedInputs",void 0),t([(0,u.property)(r.disabledUnlessAssociatedInputsChangeProperty)],r.prototype,"disabledUnlessAssociatedInputsChange",void 0),r}(Q);Zw.SubmitActionBase=Z;var J=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getJsonTypeName=function(){return n.JsonTypeName},n.JsonTypeName="Action.Submit",n}(Z);Zw.SubmitAction=J;var K=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),r.prototype.getJsonTypeName=function(){return r.JsonTypeName},r.JsonTypeName="Action.Execute",r.verbProperty=new u.StringProperty(u.Versions.v1_4,"verb"),t([(0,u.property)(r.verbProperty)],r.prototype,"verb",void 0),r}(Z);Zw.ExecuteAction=K;var X=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),r.prototype.getJsonTypeName=function(){return r.JsonTypeName},r.prototype.getAriaRole=function(){return"link"},r.prototype.internalValidateProperties=function(e){n.prototype.internalValidateProperties.call(this,e),this.url||e.addFailure(this,i.ValidationEvent.PropertyCantBeNull,p.Strings.errors.propertyMustBeSet("url"))},r.prototype.getHref=function(){return this.url},r.urlProperty=new u.StringProperty(u.Versions.v1_0,"url"),r.JsonTypeName="Action.OpenUrl",t([(0,u.property)(r.urlProperty)],r.prototype,"url",void 0),r}(Q);Zw.OpenUrlAction=X;var $=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.targetElements={},e}return e(r,n),r.prototype.updateAriaControlsAttribute=function(){if(this.targetElements){var e=Object.keys(this.targetElements);this._renderedElement&&(e.length>0?this._renderedElement.setAttribute("aria-controls",e.join(" ")):this._renderedElement.removeAttribute("aria-controls"))}},r.prototype.internalValidateProperties=function(e){n.prototype.internalValidateProperties.call(this,e),this.targetElements||e.addFailure(this,i.ValidationEvent.PropertyCantBeNull,p.Strings.errors.propertyMustBeSet("targetElements"))},r.prototype.getJsonTypeName=function(){return r.JsonTypeName},r.prototype.render=function(){n.prototype.render.call(this),this.updateAriaControlsAttribute()},r.prototype.execute=function(){if(n.prototype.execute.call(this),this.parent)for(var e=0,t=Object.keys(this.targetElements);e<t.length;e++){var r=t[e],i=this.parent.getRootElement().getElementById(r);i&&("boolean"==typeof this.targetElements[r]?i.isVisible=this.targetElements[r]:i.isVisible=!i.isVisible)}},r.prototype.addTargetElement=function(e,t){void 0===t&&(t=void 0),this.targetElements[e]=t,this.updateAriaControlsAttribute()},r.prototype.removeTargetElement=function(e){delete this.targetElements[e],this.updateAriaControlsAttribute()},r.targetElementsProperty=new u.CustomProperty(u.Versions.v1_2,"targetElements",function(e,t,n,r){var i={};if(Array.isArray(n[t.name]))for(var o=0,s=n[t.name];o<s.length;o++){var l=s[o];if("string"==typeof l)i[l]=void 0;else if("object"==typeof l){var c=l.elementId;"string"==typeof c&&(i[c]=a.parseBool(l.isVisible))}}return i},function(e,t,n,r,i){for(var o=[],a=0,s=Object.keys(r);a<s.length;a++){var l=s[a];"boolean"==typeof r[l]?o.push({elementId:l,isVisible:r[l]}):o.push(l)}i.serializeArray(n,t.name,o)},{},function(e){return{}}),r.JsonTypeName="Action.ToggleVisibility",t([(0,u.property)(r.targetElementsProperty)],r.prototype,"targetElements",void 0),r}(Q);Zw.ToggleVisibilityAction=$;var ee=function(t){function n(e,n){var r=t.call(this,e,n,void 0,function(){return new o.StringWithSubstitutions})||this;return r.targetVersion=e,r.name=n,r}return e(n,t),n.prototype.parse=function(e,t,n){var r=new o.StringWithSubstitutions;return r.set(a.parseString(t[this.name])),r},n.prototype.toJSON=function(e,t,n,r){r.serializeValue(t,this.name,n.getOriginal())},n}(u.PropertyDefinition),te=function(n){function r(e,t){void 0===e&&(e=""),void 0===t&&(t="");var r=n.call(this)||this;return r.name=e,r.value=t,r}return e(r,n),r.prototype.getSchemaKey=function(){return"HttpHeader"},r.prototype.getReferencedInputs=function(e,t){this._value.getReferencedInputs(e,t)},r.prototype.prepareForExecution=function(e){this._value.substituteInputValues(e,o.ContentTypes.applicationXWwwFormUrlencoded)},Object.defineProperty(r.prototype,"value",{get:function(){return this._value.get()},set:function(e){this._value.set(e)},enumerable:!1,configurable:!0}),r.nameProperty=new u.StringProperty(u.Versions.v1_0,"name"),r.valueProperty=new ee(u.Versions.v1_0,"value"),t([(0,u.property)(r.nameProperty)],r.prototype,"name",void 0),t([(0,u.property)(r.valueProperty)],r.prototype,"_value",void 0),r}(u.SerializableObject);Zw.HttpHeader=te;var ne=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e._ignoreInputValidation=!1,e}return e(r,n),r.prototype.internalGetReferencedInputs=function(){var e=this.parent?this.parent.getRootElement().getAllInputs():[],t={};this._url.getReferencedInputs(e,t);for(var n=0,r=this.headers;n<r.length;n++){r[n].getReferencedInputs(e,t)}return this._body.getReferencedInputs(e,t),t},r.prototype.internalPrepareForExecution=function(e){if(e){this._url.substituteInputValues(e,o.ContentTypes.applicationXWwwFormUrlencoded);for(var t=o.ContentTypes.applicationJson,n=0,r=this.headers;n<r.length;n++){var i=r[n];i.prepareForExecution(e),i.name&&"content-type"===i.name.toLowerCase()&&(t=i.value)}this._body.substituteInputValues(e,t)}},r.prototype.getJsonTypeName=function(){return r.JsonTypeName},r.prototype.internalValidateProperties=function(e){if(n.prototype.internalValidateProperties.call(this,e),this.url||e.addFailure(this,i.ValidationEvent.PropertyCantBeNull,p.Strings.errors.propertyMustBeSet("url")),this.headers.length>0)for(var t=0,r=this.headers;t<r.length;t++){r[t].name||e.addFailure(this,i.ValidationEvent.PropertyCantBeNull,p.Strings.errors.actionHttpHeadersMustHaveNameAndValue())}},Object.defineProperty(r.prototype,"ignoreInputValidation",{get:function(){return this._ignoreInputValidation},set:function(e){this._ignoreInputValidation=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"url",{get:function(){return this._url.get()},set:function(e){this._url.set(e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"body",{get:function(){return this._body.get()},set:function(e){this._body.set(e)},enumerable:!1,configurable:!0}),r.urlProperty=new ee(u.Versions.v1_0,"url"),r.bodyProperty=new ee(u.Versions.v1_0,"body"),r.methodProperty=new u.StringProperty(u.Versions.v1_0,"method"),r.headersProperty=new u.SerializableObjectCollectionProperty(u.Versions.v1_0,"headers",te),r.ignoreInputValidationProperty=new u.BoolProperty(u.Versions.v1_3,"ignoreInputValidation",!1),r.JsonTypeName="Action.Http",t([(0,u.property)(r.urlProperty)],r.prototype,"_url",void 0),t([(0,u.property)(r.bodyProperty)],r.prototype,"_body",void 0),t([(0,u.property)(r.methodProperty)],r.prototype,"method",void 0),t([(0,u.property)(r.headersProperty)],r.prototype,"headers",void 0),t([(0,u.property)(r.ignoreInputValidationProperty)],r.prototype,"_ignoreInputValidation",void 0),r}(Q);Zw.HttpAction=ne;var re=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.card=new _e,e}return e(n,t),n.prototype.updateCssClasses=function(){if(t.prototype.updateCssClasses.call(this),this.renderedElement){var e=this.parent?this.parent.hostConfig:s.defaultHostConfig;this.renderedElement.classList.add(e.makeCssClassName("expandable")),this.renderedElement.setAttribute("aria-expanded",(1===this.state).toString())}},n.prototype.internalParse=function(e,n){t.prototype.internalParse.call(this,e,n);var r=e.card;r?this.card.parse(r,n):n.logParseEvent(this,i.ValidationEvent.PropertyCantBeNull,p.Strings.errors.showCardMustHaveCard())},n.prototype.internalToJSON=function(e,n){t.prototype.internalToJSON.call(this,e,n),this.card&&n.serializeValue(e,"card",this.card.toJSON(n))},n.prototype.raiseExecuteActionEvent=function(){this.hostConfig.actions.showCard.actionMode===i.ShowCardActionMode.Popup&&t.prototype.raiseExecuteActionEvent.call(this)},n.prototype.releaseDOMResources=function(){t.prototype.releaseDOMResources.call(this),this.card.releaseDOMResources()},n.prototype.getJsonTypeName=function(){return n.JsonTypeName},n.prototype.internalValidateProperties=function(e){t.prototype.internalValidateProperties.call(this,e),this.card.internalValidateProperties(e)},n.prototype.setParent=function(e){t.prototype.setParent.call(this,e),this.card.setParent(e)},n.prototype.getAllInputs=function(e){return void 0===e&&(e=!0),this.card.getAllInputs(e)},n.prototype.getAllActions=function(){var e=t.prototype.getAllActions.call(this);return e.push.apply(e,this.card.getAllActions()),e},n.prototype.getResourceInformation=function(){var e=t.prototype.getResourceInformation.call(this);return e.push.apply(e,this.card.getResourceInformation()),e},n.prototype.getActionById=function(e){var n=t.prototype.getActionById.call(this,e);return n||(n=this.card.getActionById(e)),n},n.JsonTypeName="Action.ShowCard",n}(Q);Zw.ShowCardAction=re;var ie=function(t){function n(e){var n=t.call(this)||this;return n._actions=e,n.title=p.Strings.defaults.overflowButtonText(),n}return e(n,t),n.prototype.getActions=function(){return this._actions},n.prototype.getAllActions=function(){var e=t.prototype.getAllActions.call(this);return e.push.apply(e,this._actions),e},n.prototype.getJsonTypeName=function(){return re.JsonTypeName},n.prototype.execute=function(){var e,t,n,r,i,o=this;if((t=this,n=this.renderedElement,r=t.parent?t.parent.getRootElement():void 0,!(void 0!==(i=r&&r.onDisplayOverflowActionMenu?r.onDisplayOverflowActionMenu:Ce.onDisplayOverflowActionMenu)&&i(t.getActions(),n)))&&this.renderedElement){var a=new h.PopupMenu;a.hostConfig=this.hostConfig;for(var s=function(t){var n=new h.MenuItem(t.toString(),null!==(e=l._actions[t].title)&&void 0!==e?e:"");n.isEnabled=l._actions[t].isEnabled,n.onClick=function(){var e=o._actions[t];a.closePopup(!1),e.isEnabled&&e.execute()},a.items.add(n)},l=this,c=0;c<this._actions.length;c++)s(c);a.popup(this.renderedElement)}},n.JsonTypeName="Action.Overflow",n}(Q),oe=function(){function e(e){this._items=[],this._renderedActions=[],this._owner=e}return e.prototype.isActionAllowed=function(e){var t=this._owner.getForbiddenActionTypes();if(t)for(var n=0,r=t;n<r.length;n++){var i=r[n];if(e.constructor===i)return!1}return!0},e.prototype.refreshContainer=function(){if(f(this._actionCardContainer),this._actionCard){this._actionCardContainer.style.marginTop=this.renderedActionCount>0?this._owner.hostConfig.actions.showCard.inlineTopMargin+"px":"0px";var e=this._owner.getEffectivePadding();this._owner.getImmediateSurroundingPadding(e);var t=this._owner.hostConfig.paddingDefinitionToSpacingDefinition(e);this._actionCard&&(this._actionCard.style.paddingLeft=t.left+"px",this._actionCard.style.paddingRight=t.right+"px",this._actionCard.style.marginLeft="-"+t.left+"px",this._actionCard.style.marginRight="-"+t.right+"px",0===t.bottom||this._owner.isDesignMode()||(this._actionCard.style.paddingBottom=t.bottom+"px",this._actionCard.style.marginBottom="-"+t.bottom+"px"),a.appendChild(this._actionCardContainer,this._actionCard))}else this._actionCardContainer.style.marginTop="0px"},e.prototype.layoutChanged=function(){this._owner.getRootElement().updateLayout()},e.prototype.showActionCard=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0),e.card.suppressStyle=t;var r=e.card.renderedElement&&!this._owner.isDesignMode()?e.card.renderedElement:e.card.render();this._actionCard=r,this._expandedAction=e,this.refreshContainer(),n&&(this.layoutChanged(),ge(e,!0))},e.prototype.collapseExpandedAction=function(){for(var e=0,t=this._renderedActions;e<t.length;e++){t[e].state=0}var n=this._expandedAction;this._expandedAction=void 0,this._actionCard=void 0,this.refreshContainer(),n&&(this.layoutChanged(),ge(n,!1))},e.prototype.expandShowCardAction=function(e,t){for(var n=this,r=!1,o=0,a=this._renderedActions;o<a.length;o++){var s=a[o];this._owner.hostConfig.actions.actionsOrientation==i.Orientation.Horizontal&&r&&(s.isFocusable=!1),s!==e?s.state=2:(s.state=1,r=!0,s.renderedElement&&(s.renderedElement.onblur=function(e){for(var t=0,r=n._renderedActions;t<r.length;t++){r[t].isFocusable=!0}}))}this.showActionCard(e,!(this._owner.isAtTheVeryLeft()&&this._owner.isAtTheVeryRight()),t)},e.prototype.releaseDOMResources=function(){for(var e=0,t=this._renderedActions;e<t.length;e++){t[e].releaseDOMResources()}},e.prototype.actionExecuted=function(e){e instanceof re?e===this._expandedAction?this.collapseExpandedAction():this._owner.hostConfig.actions.showCard.actionMode===i.ShowCardActionMode.Inline&&this.expandShowCardAction(e,!0):this.collapseExpandedAction()},e.prototype.parse=function(e,t){if(this.clear(),Array.isArray(e))for(var n=0,r=e;n<r.length;n++){var i=r[n],o=[];this._owner instanceof Ae&&(o=this._owner.getForbiddenActionNames());var a=t.parseAction(this._owner,i,o,!this._owner.isDesignMode());a&&this.addAction(a)}},e.prototype.toJSON=function(e,t,n){n.serializeArray(e,t,this._items)},e.prototype.getActionAt=function(e){return this._items[e]},e.prototype.getActionCount=function(){return this._items.length},e.prototype.getActionById=function(e){for(var t=void 0,n=0,r=this._items;n<r.length;n++){if(t=r[n].getActionById(e))break}return t},e.prototype.validateProperties=function(e){this._owner.hostConfig.actions.maxActions&&this._items.length>this._owner.hostConfig.actions.maxActions&&e.addFailure(this._owner,i.ValidationEvent.TooManyActions,p.Strings.errors.tooManyActions(this._owner.hostConfig.actions.maxActions)),this._items.length>0&&!this._owner.hostConfig.supportsInteractivity&&e.addFailure(this._owner,i.ValidationEvent.InteractivityNotAllowed,p.Strings.errors.interactivityNotAllowed());for(var t=0,n=this._items;t<n.length;t++){var r=n[t];this.isActionAllowed(r)||e.addFailure(this._owner,i.ValidationEvent.ActionTypeNotAllowed,p.Strings.errors.actionTypeNotAllowed(r.getJsonTypeName())),r.internalValidateProperties(e)}},e.prototype.render=function(e){var t=this._owner.hostConfig;if(t.supportsInteractivity){var n=document.createElement("div"),r=t.actions.maxActions?Math.min(t.actions.maxActions,this._items.length):this._items.length;if(this._actionCardContainer=document.createElement("div"),this._renderedActions=[],t.actions.preExpandSingleShowCardAction&&1===r&&this._items[0]instanceof re&&this.isActionAllowed(this._items[0]))this.showActionCard(this._items[0],!0),this._renderedActions.push(this._items[0]);else{var s=document.createElement("div");if(s.className=t.makeCssClassName("ac-actionSet"),s.style.display="flex",e===i.Orientation.Horizontal)if(s.style.flexDirection="row",this._owner.horizontalAlignment&&t.actions.actionAlignment!==i.ActionAlignment.Stretch)switch(this._owner.horizontalAlignment){case i.HorizontalAlignment.Center:s.style.justifyContent="center";break;case i.HorizontalAlignment.Right:s.style.justifyContent="flex-end";break;default:s.style.justifyContent="flex-start"}else switch(t.actions.actionAlignment){case i.ActionAlignment.Center:s.style.justifyContent="center";break;case i.ActionAlignment.Right:s.style.justifyContent="flex-end";break;default:s.style.justifyContent="flex-start"}else if(s.style.flexDirection="column",this._owner.horizontalAlignment&&t.actions.actionAlignment!==i.ActionAlignment.Stretch)switch(this._owner.horizontalAlignment){case i.HorizontalAlignment.Center:s.style.alignItems="center";break;case i.HorizontalAlignment.Right:s.style.alignItems="flex-end";break;default:s.style.alignItems="flex-start"}else switch(t.actions.actionAlignment){case i.ActionAlignment.Center:s.style.alignItems="center";break;case i.ActionAlignment.Right:s.style.alignItems="flex-end";break;case i.ActionAlignment.Stretch:s.style.alignItems="stretch";break;default:s.style.alignItems="flex-start"}var l=this._items.filter(this.isActionAllowed.bind(this)),c=[],u=[];if(this._owner.isDesignMode())c=l;else{l.forEach(function(e){return e.mode===i.ActionMode.Secondary?u.push(e):c.push(e)});var d=c.splice(t.actions.maxActions);o.GlobalSettings.allowMoreThanMaxActionsInOverflowMenu&&u.push.apply(u,d);var p=!0;if(u.length>0){this._overflowAction||(this._overflowAction=new ie(u),this._overflowAction.setParent(this._owner),this._overflowAction._actionCollection=this);var h=this._owner instanceof Ce&&!this._owner.parent;p=!function(e,t){var n=e.parent?e.parent.getRootElement():void 0,r=n&&n.onRenderOverflowActions?n.onRenderOverflowActions:Ce.onRenderOverflowActions;return void 0!==r&&r(e.getActions(),t)}(this._overflowAction,h)}this._overflowAction&&p&&c.push(this._overflowAction)}for(var f=0;f<c.length;f++){var m=c[f];if(m.render(),m.renderedElement&&(t.actions.actionsOrientation===i.Orientation.Horizontal&&t.actions.actionAlignment===i.ActionAlignment.Stretch?m.renderedElement.style.flex="0 1 100%":m.renderedElement.style.flex="0 1 auto",s.appendChild(m.renderedElement),this._renderedActions.push(m),f<c.length-1&&t.actions.buttonSpacing>0)){var g=document.createElement("div");e===i.Orientation.Horizontal?(g.style.flex="0 0 auto",g.style.width=t.actions.buttonSpacing+"px"):g.style.height=t.actions.buttonSpacing+"px",a.appendChild(s,g)}}var y=document.createElement("div");y.style.overflow="hidden",y.appendChild(s),a.appendChild(n,y)}a.appendChild(n,this._actionCardContainer);for(var A=0,v=this._renderedActions;A<v.length;A++){var b=v[A];if(1===b.state){this.expandShowCardAction(b,!1);break}}return this._renderedActions.length>0?n:void 0}},e.prototype.addAction=function(e){if(!e)throw new Error("The action parameter cannot be null.");if(e.parent&&e.parent!==this._owner||!(this._items.indexOf(e)<0))throw new Error(p.Strings.errors.actionAlreadyParented());this._items.push(e),e.parent||e.setParent(this._owner),e._actionCollection=this},e.prototype.removeAction=function(e){this.expandedAction&&this._expandedAction===e&&this.collapseExpandedAction();var t=this._items.indexOf(e);if(t>=0){this._items.splice(t,1),e.setParent(void 0),e._actionCollection=void 0;for(var n=0;n<this._renderedActions.length;n++)if(this._renderedActions[n]===e){this._renderedActions.splice(n,1);break}return!0}return!1},e.prototype.clear=function(){this._items=[],this._renderedActions=[],this._expandedAction=void 0},e.prototype.getAllInputs=function(e){void 0===e&&(e=!0);var t=[];if(e)for(var n=0,r=this._items;n<r.length;n++){var i=r[n];t.push.apply(t,i.getAllInputs())}return t},e.prototype.getResourceInformation=function(){for(var e=[],t=0,n=this._items;t<n.length;t++){var r=n[t];e.push.apply(e,r.getResourceInformation())}return e},Object.defineProperty(e.prototype,"renderedActionCount",{get:function(){return this._renderedActions.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"expandedAction",{get:function(){return this._expandedAction},enumerable:!1,configurable:!0}),e}(),ae=function(n){function r(){var e=n.call(this)||this;return e._actionCollection=new oe(e),e}return e(r,n),r.prototype.internalParse=function(e,t){n.prototype.internalParse.call(this,e,t),this._actionCollection.parse(e.actions,t)},r.prototype.internalToJSON=function(e,t){n.prototype.internalToJSON.call(this,e,t),this._actionCollection.toJSON(e,"actions",t)},r.prototype.internalRender=function(){return this._actionCollection.render(void 0!==this.orientation?this.orientation:this.hostConfig.actions.actionsOrientation)},r.prototype.releaseDOMResources=function(){n.prototype.releaseDOMResources.call(this),this._actionCollection.releaseDOMResources()},r.prototype.isBleedingAtBottom=function(){return 0===this._actionCollection.renderedActionCount?n.prototype.isBleedingAtBottom.call(this):1===this._actionCollection.getActionCount()?void 0!==this._actionCollection.expandedAction&&!this.hostConfig.actions.preExpandSingleShowCardAction:void 0!==this._actionCollection.expandedAction},r.prototype.getJsonTypeName=function(){return"ActionSet"},r.prototype.getActionCount=function(){return this._actionCollection.getActionCount()},r.prototype.getActionAt=function(e){return e>=0&&e<this.getActionCount()?this._actionCollection.getActionAt(e):n.prototype.getActionAt.call(this,e)},r.prototype.getActionById=function(e){var t=this._actionCollection.getActionById(e);return t||n.prototype.getActionById.call(this,e)},r.prototype.getAllActions=function(){for(var e=n.prototype.getAllActions.call(this),t=0;t<this.getActionCount();t++){var r=this.getActionAt(t);r&&e.push(r)}return e},r.prototype.internalValidateProperties=function(e){n.prototype.internalValidateProperties.call(this,e),this._actionCollection.validateProperties(e)},r.prototype.addAction=function(e){this._actionCollection.addAction(e)},r.prototype.getAllInputs=function(e){return void 0===e&&(e=!0),e?this._actionCollection.getAllInputs():[]},r.prototype.getResourceInformation=function(){return this._actionCollection.getResourceInformation()},r.prototype.findDOMNodeOwner=function(e){for(var t=void 0,r=0;r<this.getActionCount();r++){var i=this.getActionAt(r);if(i&&(t=i.findDOMNodeOwner(e)))return t}return n.prototype.findDOMNodeOwner.call(this,e)},Object.defineProperty(r.prototype,"isInteractive",{get:function(){return!0},enumerable:!1,configurable:!0}),r.orientationProperty=new u.EnumProperty(u.Versions.v1_1,"orientation",i.Orientation),t([(0,u.property)(r.orientationProperty)],r.prototype,"orientation",void 0),r}(g);Zw.ActionSet=ae;var se=function(t){function n(e,n,r,o){var a=t.call(this,e,n,[{value:i.ContainerStyle.Default},{value:i.ContainerStyle.Emphasis},{targetVersion:u.Versions.v1_2,value:i.ContainerStyle.Accent},{targetVersion:u.Versions.v1_2,value:i.ContainerStyle.Good},{targetVersion:u.Versions.v1_2,value:i.ContainerStyle.Attention},{targetVersion:u.Versions.v1_2,value:i.ContainerStyle.Warning}],r,o)||this;return a.targetVersion=e,a.name=n,a.defaultValue=r,a.onGetInitialValue=o,a}return e(n,t),n}(u.ValueSetProperty);Zw.ContainerStyleProperty=se;var le=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),Object.defineProperty(r.prototype,"style",{get:function(){if(this.allowCustomStyle){var e=this.getValue(r.styleProperty);if(e&&this.hostConfig.containerStyles.getStyleByName(e))return e}},set:function(e){this.setValue(r.styleProperty,e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"allowCustomStyle",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hasExplicitStyle",{get:function(){return void 0!==this.getValue(r.styleProperty)},enumerable:!1,configurable:!0}),r.prototype.applyBorder=function(){},r.prototype.applyBackground=function(){if(this.renderedElement){var e=this.hostConfig.containerStyles.getStyleByName(this.style,this.hostConfig.containerStyles.getStyleByName(this.defaultStyle));if(e.backgroundColor){var t=a.stringToCssColor(e.backgroundColor);t&&(this.renderedElement.style.backgroundColor=t)}}},r.prototype.applyPadding=function(){if(n.prototype.applyPadding.call(this),this.renderedElement){var e=new o.SpacingDefinition;if(this.getEffectivePadding()&&(e=this.hostConfig.paddingDefinitionToSpacingDefinition(this.getEffectivePadding())),this.renderedElement.style.paddingTop=e.top+"px",this.renderedElement.style.paddingRight=e.right+"px",this.renderedElement.style.paddingBottom=e.bottom+"px",this.renderedElement.style.paddingLeft=e.left+"px",this.isBleeding()){var t=new o.PaddingDefinition;this.getImmediateSurroundingPadding(t);var r=this.hostConfig.paddingDefinitionToSpacingDefinition(t);this.renderedElement.style.marginRight="-"+r.right+"px",this.renderedElement.style.marginLeft="-"+r.left+"px",this.isDesignMode()||(this.renderedElement.style.marginTop="-"+r.top+"px",this.renderedElement.style.marginBottom="-"+r.bottom+"px"),this.separatorElement&&this.separatorOrientation===i.Orientation.Horizontal&&(this.separatorElement.style.marginLeft="-"+r.left+"px",this.separatorElement.style.marginRight="-"+r.right+"px")}else this.renderedElement.style.marginRight="0",this.renderedElement.style.marginLeft="0",this.renderedElement.style.marginTop="0",this.renderedElement.style.marginBottom="0",this.separatorElement&&this.separatorOrientation===i.Orientation.Horizontal&&(this.separatorElement.style.marginRight="0",this.separatorElement.style.marginLeft="0")}},r.prototype.getHasBackground=function(e){void 0===e&&(e=!1);for(var t=this.parent;t;){var n=!1;if(n=!e&&(t instanceof de&&t.backgroundImage.isValid()),t instanceof r&&this.hasExplicitStyle&&(t.getEffectiveStyle()!==this.getEffectiveStyle()||n))return!0;t=t.parent}return!1},r.prototype.getDefaultPadding=function(){return this.getHasBackground()||this.getHasBorder()?new o.PaddingDefinition(i.Spacing.Padding,i.Spacing.Padding,i.Spacing.Padding,i.Spacing.Padding):n.prototype.getDefaultPadding.call(this)},r.prototype.internalValidateProperties=function(e){n.prototype.internalValidateProperties.call(this,e);var t=this.getValue(r.styleProperty);void 0!==t&&(this.hostConfig.containerStyles.getStyleByName(t)||e.addFailure(this,i.ValidationEvent.InvalidPropertyValue,p.Strings.errors.invalidPropertyValue(t,"style")))},r.prototype.render=function(){var e=n.prototype.render.call(this);return e&&this.getHasBackground()&&this.applyBackground(),this.applyBorder(),e},r.prototype.getEffectiveStyle=function(){var e=this.style;return e||n.prototype.getEffectiveStyle.call(this)},r.styleProperty=new se(u.Versions.v1_0,"style"),t([(0,u.property)(r.styleProperty)],r.prototype,"style",null),r}(M);Zw.StylableCardElementContainer=le;var ce=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e._bleed=!1,e}return e(r,n),r.prototype.adjustRenderedElementSize=function(e){n.prototype.adjustRenderedElementSize.call(this,e),this.minPixelHeight&&(e.style.minHeight=this.minPixelHeight+"px")},r.prototype.getHasExpandedAction=function(){return!1},r.prototype.getBleed=function(){return this._bleed},r.prototype.setBleed=function(e){this._bleed=e},Object.defineProperty(r.prototype,"renderedActionCount",{get:function(){return 0},enumerable:!1,configurable:!0}),r.prototype.isBleeding=function(){return(this.getHasBackground()||this.hostConfig.alwaysAllowBleed)&&this.getBleed()},r.bleedProperty=new u.BoolProperty(u.Versions.v1_2,"bleed",!1),r.minHeightProperty=new u.PixelSizeProperty(u.Versions.v1_2,"minHeight"),t([(0,u.property)(r.bleedProperty)],r.prototype,"_bleed",void 0),t([(0,u.property)(r.minHeightProperty)],r.prototype,"minPixelHeight",void 0),r}(le);Zw.ContainerBase=ce;var ue=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),r.prototype.getSchemaKey=function(){return"BackgroundImage"},r.prototype.internalParse=function(e,t){if("string"!=typeof e)return n.prototype.internalParse.call(this,e,t);this.resetDefaultValues(),this.url=e},r.prototype.apply=function(e){if(this.url&&e.renderedElement){switch(e.renderedElement.style.backgroundImage="url('"+e.preProcessPropertyValue(r.urlProperty,this.url)+"')",this.fillMode){case i.FillMode.Repeat:e.renderedElement.style.backgroundRepeat="repeat";break;case i.FillMode.RepeatHorizontally:e.renderedElement.style.backgroundRepeat="repeat-x";break;case i.FillMode.RepeatVertically:e.renderedElement.style.backgroundRepeat="repeat-y";break;case i.FillMode.Cover:default:e.renderedElement.style.backgroundRepeat="no-repeat",e.renderedElement.style.backgroundSize="cover"}switch(this.horizontalAlignment){case i.HorizontalAlignment.Left:break;case i.HorizontalAlignment.Center:e.renderedElement.style.backgroundPositionX="center";break;case i.HorizontalAlignment.Right:e.renderedElement.style.backgroundPositionX="right"}switch(this.verticalAlignment){case i.VerticalAlignment.Top:break;case i.VerticalAlignment.Center:e.renderedElement.style.backgroundPositionY="center";break;case i.VerticalAlignment.Bottom:e.renderedElement.style.backgroundPositionY="bottom"}}},r.prototype.isValid=function(){return!!this.url},r.urlProperty=new u.StringProperty(u.Versions.v1_0,"url"),r.fillModeProperty=new u.EnumProperty(u.Versions.v1_2,"fillMode",i.FillMode,i.FillMode.Cover),r.horizontalAlignmentProperty=new u.EnumProperty(u.Versions.v1_2,"horizontalAlignment",i.HorizontalAlignment,i.HorizontalAlignment.Left),r.verticalAlignmentProperty=new u.EnumProperty(u.Versions.v1_2,"verticalAlignment",i.VerticalAlignment,i.VerticalAlignment.Top),t([(0,u.property)(r.urlProperty)],r.prototype,"url",void 0),t([(0,u.property)(r.fillModeProperty)],r.prototype,"fillMode",void 0),t([(0,u.property)(r.horizontalAlignmentProperty)],r.prototype,"horizontalAlignment",void 0),t([(0,u.property)(r.verticalAlignmentProperty)],r.prototype,"verticalAlignment",void 0),r}(u.SerializableObject);Zw.BackgroundImage=ue;var de=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e._items=[],e._renderedItems=[],e}return e(r,n),Object.defineProperty(r.prototype,"backgroundImage",{get:function(){return this.getValue(r.backgroundImageProperty)},enumerable:!1,configurable:!0}),r.prototype.insertItemAt=function(e,t,n){if(e.parent&&!n)throw new Error(p.Strings.errors.elementAlreadyParented());if(!e.isStandalone)throw new Error(p.Strings.errors.elementTypeNotStandalone(e.getJsonTypeName()));t<0||t>=this._items.length?this._items.push(e):this._items.splice(t,0,e),e.setParent(this)},r.prototype.getItemsCollectionPropertyName=function(){return"items"},r.prototype.applyBackground=function(){this.backgroundImage.isValid()&&this.renderedElement&&this.backgroundImage.apply(this),n.prototype.applyBackground.call(this)},r.prototype.applyRTL=function(e){void 0!==this.rtl&&(e.dir=this.rtl?"rtl":"ltr")},r.prototype.internalRender=function(){this._renderedItems=[];var e=this.hostConfig,t=document.createElement("div");switch(this.applyRTL(t),t.classList.add(e.makeCssClassName("ac-container")),t.style.display="flex",t.style.flexDirection="column",o.GlobalSettings.useAdvancedCardBottomTruncation&&(t.style.minHeight="-webkit-min-content"),this.getEffectiveVerticalContentAlignment()){case i.VerticalAlignment.Center:t.style.justifyContent="center";break;case i.VerticalAlignment.Bottom:t.style.justifyContent="flex-end";break;default:t.style.justifyContent="flex-start"}if(this._items.length>0)for(var n=0,r=this._items;n<r.length;n++){var s=r[n],l=this.isElementAllowed(s)?s.render():void 0;l&&(this._renderedItems.length>0&&s.separatorElement&&(s.separatorElement.style.flex="0 0 auto",a.appendChild(t,s.separatorElement)),a.appendChild(t,l),this._renderedItems.push(s))}else if(this.isDesignMode()){var c=this.createPlaceholderElement();c.style.width="100%",c.style.height="100%",t.appendChild(c)}return t},r.prototype.truncateOverflow=function(e){if(this.renderedElement){for(var t=this.renderedElement.offsetTop+e+1,n=function(e){var r=e.renderedElement;if(r)switch(a.getFitStatus(r,t)){case i.ContainerFitStatus.FullyInContainer:e.resetOverflow()&&n(e);break;case i.ContainerFitStatus.Overflowing:var o=t-r.offsetTop;e.handleOverflow(o);break;case i.ContainerFitStatus.FullyOutOfContainer:e.handleOverflow(0)}},r=0,o=this._items;r<o.length;r++){var s=o[r];n(s)}return!0}return!1},r.prototype.undoOverflowTruncation=function(){for(var e=0,t=this._items;e<t.length;e++){t[e].resetOverflow()}},r.prototype.getHasBackground=function(e){return void 0===e&&(e=!1),!e&&this.backgroundImage.isValid()||n.prototype.getHasBackground.call(this,e)},r.prototype.canHostSingletons=function(){return!1},r.prototype.internalParse=function(e,t){n.prototype.internalParse.call(this,e,t),this.clear(),this.setShouldFallback(!1);var r=e[this.getItemsCollectionPropertyName()];if(!Array.isArray(r)&&"object"==typeof r&&this.canHostSingletons()){var i=a.parseString(r.type);if(i){var o=t.elementRegistry.findByName(i);if((null==o?void 0:o.singletonBehavior)!==d.ElementSingletonBehavior.NotAllowed)(c=t.parseElement(this,r,[],!this.isDesignMode(),!0))&&this.insertItemAt(c,-1,!0)}}else if(Array.isArray(r))for(var s=0,l=r;s<l.length;s++){var c,u=l[s];(c=t.parseElement(this,u,this.forbiddenChildElements(),!this.isDesignMode()))&&this.insertItemAt(c,-1,!0)}},r.prototype.internalToJSON=function(e,t){n.prototype.internalToJSON.call(this,e,t);var r=this.getItemsCollectionPropertyName();1===this._items.length&&this._items[0].getElementSingletonBehavior()===d.ElementSingletonBehavior.Only?t.serializeValue(e,r,this._items[0].toJSON(t)):t.serializeArray(e,r,this._items)},Object.defineProperty(r.prototype,"isSelectable",{get:function(){return!0},enumerable:!1,configurable:!0}),r.prototype.getEffectivePadding=function(){return o.GlobalSettings.removePaddingFromContainersWithBackgroundImage&&!this.getHasBackground(!0)?new o.PaddingDefinition:n.prototype.getEffectivePadding.call(this)},r.prototype.getEffectiveVerticalContentAlignment=function(){if(void 0!==this.verticalContentAlignment)return this.verticalContentAlignment;var e=this.getParentContainer();return e?e.getEffectiveVerticalContentAlignment():i.VerticalAlignment.Top},r.prototype.getItemCount=function(){return this._items.length},r.prototype.getItemAt=function(e){return this._items[e]},r.prototype.getFirstVisibleRenderedItem=function(){if(this.renderedElement&&this._renderedItems&&this._renderedItems.length>0)for(var e=0,t=this._renderedItems;e<t.length;e++){var n=t[e];if(n.isVisible)return n}},r.prototype.getLastVisibleRenderedItem=function(){if(this.renderedElement&&this._renderedItems&&this._renderedItems.length>0)for(var e=this._renderedItems.length-1;e>=0;e--)if(this._renderedItems[e].isVisible)return this._renderedItems[e]},r.prototype.getJsonTypeName=function(){return"Container"},r.prototype.isFirstElement=function(e){for(var t=this.isDesignMode(),n=0,r=this._items;n<r.length;n++){var i=r[n];if(i.isVisible||t)return i===e}return!1},r.prototype.isLastElement=function(e){for(var t=this.isDesignMode(),n=this._items.length-1;n>=0;n--)if(this._items[n].isVisible||t)return this._items[n]===e;return!1},r.prototype.isRtl=function(){if(void 0!==this.rtl)return this.rtl;var e=this.getParentContainer();return!!e&&e.isRtl()},r.prototype.isBleedingAtTop=function(){var e=this.getFirstVisibleRenderedItem();return this.isBleeding()||!!e&&e.isBleedingAtTop()},r.prototype.isBleedingAtBottom=function(){var e=this.getLastVisibleRenderedItem();return this.isBleeding()||!!e&&(e.isBleedingAtBottom()&&e.getEffectiveStyle()===this.getEffectiveStyle())},r.prototype.indexOf=function(e){return this._items.indexOf(e)},r.prototype.addItem=function(e){this.insertItemAt(e,-1,!1)},r.prototype.insertItemBefore=function(e,t){this.insertItemAt(e,this._items.indexOf(t),!1)},r.prototype.insertItemAfter=function(e,t){this.insertItemAt(e,this._items.indexOf(t)+1,!1)},r.prototype.removeItem=function(e){var t=this._items.indexOf(e);return t>=0&&(this._items.splice(t,1),e.setParent(void 0),this.updateLayout(),!0)},r.prototype.clear=function(){this._items=[],this._renderedItems=[]},r.prototype.getResourceInformation=function(){var e=n.prototype.getResourceInformation.call(this);return this.backgroundImage.isValid()&&e.push({url:this.backgroundImage.url,mimeType:"image"}),e},r.prototype.getActionById=function(e){var t=n.prototype.getActionById.call(this,e);if(!t&&(this.selectAction&&(t=this.selectAction.getActionById(e)),!t))for(var r=0,i=this._items;r<i.length;r++){if(t=i[r].getActionById(e))break}return t},Object.defineProperty(r.prototype,"padding",{get:function(){return this.getPadding()},set:function(e){this.setPadding(e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"selectAction",{get:function(){return this._selectAction},set:function(e){this._selectAction=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bleed",{get:function(){return this.getBleed()},set:function(e){this.setBleed(e)},enumerable:!1,configurable:!0}),r.backgroundImageProperty=new u.SerializableObjectProperty(u.Versions.v1_0,"backgroundImage",ue),r.verticalContentAlignmentProperty=new u.EnumProperty(u.Versions.v1_1,"verticalContentAlignment",i.VerticalAlignment),r.rtlProperty=new u.BoolProperty(u.Versions.v1_0,"rtl"),t([(0,u.property)(r.backgroundImageProperty)],r.prototype,"backgroundImage",null),t([(0,u.property)(r.verticalContentAlignmentProperty)],r.prototype,"verticalContentAlignment",void 0),t([(0,u.property)(r.rtlProperty)],r.prototype,"rtl",void 0),r}(ce);Zw.Container=de;var pe=function(n){function r(e){void 0===e&&(e="stretch");var t=n.call(this)||this;return t.width="stretch",t._computedWeight=0,t.width=e,t}return e(r,n),r.prototype.adjustRenderedElementSize=function(e){this.isDesignMode()?(e.style.minWidth="20px",e.style.minHeight=(this.minPixelHeight?Math.max(this.minPixelHeight,20):20)+"px"):(e.style.minWidth="0",this.minPixelHeight&&(e.style.minHeight=this.minPixelHeight+"px")),"auto"===this.width?e.style.flex="0 1 auto":"stretch"===this.width?e.style.flex="1 1 50px":this.width instanceof o.SizeAndUnit&&(this.width.unit===i.SizeUnit.Pixel?(e.style.flex="0 0 auto",e.style.width=this.width.physicalSize+"px"):e.style.flex="1 1 "+(this._computedWeight>0?this._computedWeight:this.width.physicalSize)+"%")},r.prototype.shouldSerialize=function(e){return!0},Object.defineProperty(r.prototype,"separatorOrientation",{get:function(){return i.Orientation.Vertical},enumerable:!1,configurable:!0}),r.prototype.getJsonTypeName=function(){return"Column"},Object.defineProperty(r.prototype,"hasVisibleSeparator",{get:function(){return!!(this.parent&&this.parent instanceof he)&&(void 0!==this.separatorElement&&!this.parent.isLeftMostElement(this))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isStandalone",{get:function(){return!1},enumerable:!1,configurable:!0}),r.widthProperty=new u.CustomProperty(u.Versions.v1_0,"width",function(e,t,n,r){var a=t.defaultValue,s=n[t.name],l=!1;if("number"!=typeof s||isNaN(s))if("auto"===s||"stretch"===s)a=s;else if("string"==typeof s)try{(a=o.SizeAndUnit.parse(s)).unit===i.SizeUnit.Pixel&&t.targetVersion.compareTo(r.targetVersion)>0&&(l=!0)}catch(e){l=!0}else l=!0;else a=new o.SizeAndUnit(s,i.SizeUnit.Weight);return l&&(r.logParseEvent(e,i.ValidationEvent.InvalidPropertyValue,p.Strings.errors.invalidColumnWidth(s)),a="auto"),a},function(e,t,n,r,a){r instanceof o.SizeAndUnit?r.unit===i.SizeUnit.Pixel?a.serializeValue(n,"width",r.physicalSize+"px"):a.serializeNumber(n,"width",r.physicalSize):a.serializeValue(n,"width",r)},"stretch"),t([(0,u.property)(r.widthProperty)],r.prototype,"width",void 0),r}(de);Zw.Column=pe;var he=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._columns=[],e}return e(n,t),n.prototype.createColumnInstance=function(e,t){return t.parseCardObject(this,e,[],!this.isDesignMode(),function(e){return e&&"Column"!==e?void 0:new pe},function(e,n){t.logParseEvent(void 0,i.ValidationEvent.ElementTypeNotAllowed,p.Strings.errors.elementTypeNotAllowed(e))})},n.prototype.internalRender=function(){if(this._renderedColumns=[],this._columns.length>0){var e=this.hostConfig,t=document.createElement("div");switch(t.className=e.makeCssClassName("ac-columnSet"),t.style.display="flex",o.GlobalSettings.useAdvancedCardBottomTruncation&&(t.style.minHeight="-webkit-min-content"),this.getEffectiveHorizontalAlignment()){case i.HorizontalAlignment.Center:t.style.justifyContent="center";break;case i.HorizontalAlignment.Right:t.style.justifyContent="flex-end";break;default:t.style.justifyContent="flex-start"}for(var n=0,r=0,s=this._columns;r<s.length;r++){(u=s[r]).width instanceof o.SizeAndUnit&&u.width.unit===i.SizeUnit.Weight&&(n+=u.width.physicalSize)}for(var l=0,c=this._columns;l<c.length;l++){var u;if((u=c[l]).width instanceof o.SizeAndUnit&&u.width.unit===i.SizeUnit.Weight&&n>0){var d=100/n*u.width.physicalSize;u._computedWeight=d}var p=u.render();p&&(this._renderedColumns.length>0&&u.separatorElement&&(u.separatorElement.style.flex="0 0 auto",a.appendChild(t,u.separatorElement)),a.appendChild(t,p),this._renderedColumns.push(u))}return this._renderedColumns.length>0?t:void 0}},n.prototype.truncateOverflow=function(e){for(var t=0,n=this._columns;t<n.length;t++){n[t].handleOverflow(e)}return!0},n.prototype.undoOverflowTruncation=function(){for(var e=0,t=this._columns;e<t.length;e++){t[e].resetOverflow()}},Object.defineProperty(n.prototype,"isSelectable",{get:function(){return!0},enumerable:!1,configurable:!0}),n.prototype.internalParse=function(e,n){t.prototype.internalParse.call(this,e,n),this._columns=[],this._renderedColumns=[];var r=e.columns;if(Array.isArray(r))for(var i=0,o=r;i<o.length;i++){var a=o[i],s=this.createColumnInstance(a,n);s&&this._columns.push(s)}},n.prototype.internalToJSON=function(e,n){t.prototype.internalToJSON.call(this,e,n),n.serializeArray(e,"columns",this._columns)},n.prototype.isFirstElement=function(e){for(var t=0,n=this._columns;t<n.length;t++){var r=n[t];if(r.isVisible)return r===e}return!1},n.prototype.isBleedingAtTop=function(){if(this.isBleeding())return!0;if(this._renderedColumns&&this._renderedColumns.length>0)for(var e=0,t=this._columns;e<t.length;e++){if(t[e].isBleedingAtTop())return!0}return!1},n.prototype.isBleedingAtBottom=function(){if(this.isBleeding())return!0;if(this._renderedColumns&&this._renderedColumns.length>0)for(var e=0,t=this._columns;e<t.length;e++){if(t[e].isBleedingAtBottom())return!0}return!1},n.prototype.getItemCount=function(){return this._columns.length},n.prototype.getFirstVisibleRenderedItem=function(){return this.renderedElement&&this._renderedColumns&&this._renderedColumns.length>0?this._renderedColumns[0]:void 0},n.prototype.getLastVisibleRenderedItem=function(){return this.renderedElement&&this._renderedColumns&&this._renderedColumns.length>0?this._renderedColumns[this._renderedColumns.length-1]:void 0},n.prototype.getColumnAt=function(e){return this._columns[e]},n.prototype.getItemAt=function(e){return this.getColumnAt(e)},n.prototype.getJsonTypeName=function(){return"ColumnSet"},n.prototype.internalValidateProperties=function(e){t.prototype.internalValidateProperties.call(this,e);for(var n=0,r=0,o=0,a=this._columns;o<a.length;o++){var s=a[o];"number"==typeof s.width?n++:"stretch"===s.width&&r++}n>0&&r>0&&e.addFailure(this,i.ValidationEvent.Hint,p.Strings.hints.dontUseWeightedAndStrecthedColumnsInSameSet())},n.prototype.addColumn=function(e){if(e.parent)throw new Error(p.Strings.errors.columnAlreadyBelongsToAnotherSet());this._columns.push(e),e.setParent(this)},n.prototype.removeItem=function(e){if(e instanceof pe){var t=this._columns.indexOf(e);if(t>=0)return this._columns.splice(t,1),e.setParent(void 0),this.updateLayout(),!0}return!1},n.prototype.indexOf=function(e){return e instanceof pe?this._columns.indexOf(e):-1},n.prototype.isLeftMostElement=function(e){return 0===this._columns.indexOf(e)},n.prototype.isRightMostElement=function(e){return this._columns.indexOf(e)===this._columns.length-1},n.prototype.isTopElement=function(e){return this._columns.indexOf(e)>=0},n.prototype.isBottomElement=function(e){return this._columns.indexOf(e)>=0},n.prototype.getActionById=function(e){for(var t=void 0,n=0,r=this._columns;n<r.length;n++){if(t=r[n].getActionById(e))break}return t},Object.defineProperty(n.prototype,"bleed",{get:function(){return this.getBleed()},set:function(e){this.setBleed(e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"padding",{get:function(){return this.getPadding()},set:function(e){this.setPadding(e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selectAction",{get:function(){return this._selectAction},set:function(e){this._selectAction=e},enumerable:!1,configurable:!0}),n}(ce);function fe(e){var t=e.getRootElement(),n=t&&t.onImageLoaded?t.onImageLoaded:Ce.onImageLoaded;n&&n(e)}function me(e,t,n){var r=e.getRootElement(),i=r&&r.onAnchorClicked?r.onAnchorClicked:Ce.onAnchorClicked;return void 0!==i&&i(e,t,n)}function ge(e,t){var n=e.parent?e.parent.getRootElement():void 0,r=n&&n.onInlineCardExpanded?n.onInlineCardExpanded:Ce.onInlineCardExpanded;r&&r(e,t)}function ye(e,t){void 0===t&&(t=!0);var n=e.getRootElement();t&&n.updateLayout();var r=n,i=r&&r.onElementVisibilityChanged?r.onElementVisibilityChanged:Ce.onElementVisibilityChanged;void 0!==i&&i(e)}Zw.ColumnSet=he;var Ae=function(t){function n(){var e=t.call(this)||this;return e._actionCollection=new oe(e),e}return e(n,t),n.prototype.internalParse=function(e,n){t.prototype.internalParse.call(this,e,n),this.parseActions(e,n)},n.prototype.parseActions=function(e,t){this._actionCollection.parse(e.actions,t)},n.prototype.internalToJSON=function(e,n){t.prototype.internalToJSON.call(this,e,n),this._actionCollection.toJSON(e,"actions",n)},n.prototype.internalRender=function(){var e=t.prototype.internalRender.call(this);if(e){var n=this._actionCollection.render(this.hostConfig.actions.actionsOrientation);return n&&(a.appendChild(e,m(this.hostConfig,{spacing:this.hostConfig.getEffectiveSpacing(this.hostConfig.actions.spacing)},i.Orientation.Horizontal)),a.appendChild(e,n)),this.renderIfEmpty||e.children.length>0?e:void 0}},n.prototype.getHasExpandedAction=function(){return 0!==this.renderedActionCount&&(1===this.renderedActionCount?void 0!==this._actionCollection.expandedAction&&!this.hostConfig.actions.preExpandSingleShowCardAction:void 0!==this._actionCollection.expandedAction)},Object.defineProperty(n.prototype,"renderedActionCount",{get:function(){return this._actionCollection.renderedActionCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"renderIfEmpty",{get:function(){return!1},enumerable:!1,configurable:!0}),n.prototype.releaseDOMResources=function(){t.prototype.releaseDOMResources.call(this),this._actionCollection.releaseDOMResources()},n.prototype.getActionCount=function(){return this._actionCollection.getActionCount()},n.prototype.getActionAt=function(e){return e>=0&&e<this.getActionCount()?this._actionCollection.getActionAt(e):t.prototype.getActionAt.call(this,e)},n.prototype.getActionById=function(e){var n=this._actionCollection.getActionById(e);return n||t.prototype.getActionById.call(this,e)},n.prototype.internalValidateProperties=function(e){t.prototype.internalValidateProperties.call(this,e),this._actionCollection&&this._actionCollection.validateProperties(e)},n.prototype.isLastElement=function(e){return t.prototype.isLastElement.call(this,e)&&0===this._actionCollection.getActionCount()},n.prototype.addAction=function(e){this._actionCollection.addAction(e)},n.prototype.clear=function(){t.prototype.clear.call(this),this._actionCollection.clear()},n.prototype.getAllInputs=function(e){void 0===e&&(e=!0);var n=t.prototype.getAllInputs.call(this,e);return e&&n.push.apply(n,this._actionCollection.getAllInputs(e)),n},n.prototype.getResourceInformation=function(){var e=t.prototype.getResourceInformation.call(this);return e.push.apply(e,this._actionCollection.getResourceInformation()),e},n.prototype.isBleedingAtBottom=function(){return 0===this._actionCollection.renderedActionCount?t.prototype.isBleedingAtBottom.call(this):1===this._actionCollection.getActionCount()?void 0!==this._actionCollection.expandedAction&&!this.hostConfig.actions.preExpandSingleShowCardAction:void 0!==this._actionCollection.expandedAction},n.prototype.getForbiddenActionNames=function(){return[]},Object.defineProperty(n.prototype,"isStandalone",{get:function(){return!1},enumerable:!1,configurable:!0}),n}(de);Zw.ContainerWithActions=Ae;var ve=function(t){function n(e,n){var r=t.call(this,e,n,void 0)||this;return r.targetVersion=e,r.name=n,r}return e(n,t),n.prototype.parse=function(e,t,n){var r=n.parseAction(e.parent,t[this.name],[],!1);if(void 0!==r){if(r instanceof K)return r;n.logParseEvent(e,i.ValidationEvent.ActionTypeNotAllowed,p.Strings.errors.actionTypeNotAllowed(r.getJsonTypeName()))}n.logParseEvent(e,i.ValidationEvent.PropertyCantBeNull,p.Strings.errors.propertyMustBeSet("action"))},n.prototype.toJSON=function(e,t,n,r){r.serializeValue(t,this.name,n?n.toJSON(r):void 0,void 0,!0)},n}(u.PropertyDefinition);Zw.RefreshActionProperty=ve;var be=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),Object.defineProperty(r.prototype,"action",{get:function(){return this.getValue(r.actionProperty)},set:function(e){this.setValue(r.actionProperty,e),e&&e.setParent(this.parent)},enumerable:!1,configurable:!0}),r.prototype.getSchemaKey=function(){return"RefreshDefinition"},r.actionProperty=new ve(u.Versions.v1_4,"action"),r.userIdsProperty=new u.StringArrayProperty(u.Versions.v1_4,"userIds"),t([(0,u.property)(r.actionProperty)],r.prototype,"action",null),t([(0,u.property)(r.userIdsProperty)],r.prototype,"userIds",void 0),r}(u.SerializableObject);Zw.RefreshDefinition=be;var we=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),r.prototype.getSchemaKey=function(){return"AuthCardButton"},r.typeProperty=new u.StringProperty(u.Versions.v1_4,"type"),r.titleProperty=new u.StringProperty(u.Versions.v1_4,"title"),r.imageProperty=new u.StringProperty(u.Versions.v1_4,"image"),r.valueProperty=new u.StringProperty(u.Versions.v1_4,"value"),t([(0,u.property)(r.typeProperty)],r.prototype,"type",void 0),t([(0,u.property)(r.titleProperty)],r.prototype,"title",void 0),t([(0,u.property)(r.imageProperty)],r.prototype,"image",void 0),t([(0,u.property)(r.valueProperty)],r.prototype,"value",void 0),r}(u.SerializableObject);Zw.AuthCardButton=we;var Ee=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),r.prototype.getSchemaKey=function(){return"TokenExchangeResource"},r.idProperty=new u.StringProperty(u.Versions.v1_4,"id"),r.uriProperty=new u.StringProperty(u.Versions.v1_4,"uri"),r.providerIdProperty=new u.StringProperty(u.Versions.v1_4,"providerId"),t([(0,u.property)(r.idProperty)],r.prototype,"id",void 0),t([(0,u.property)(r.uriProperty)],r.prototype,"uri",void 0),t([(0,u.property)(r.providerIdProperty)],r.prototype,"providerId",void 0),r}(u.SerializableObject);Zw.TokenExchangeResource=Ee;var ke=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),r.prototype.getSchemaKey=function(){return"Authentication"},r.textProperty=new u.StringProperty(u.Versions.v1_4,"text"),r.connectionNameProperty=new u.StringProperty(u.Versions.v1_4,"connectionName"),r.buttonsProperty=new u.SerializableObjectCollectionProperty(u.Versions.v1_4,"buttons",we),r.tokenExchangeResourceProperty=new u.SerializableObjectProperty(u.Versions.v1_4,"tokenExchangeResource",Ee,!0),t([(0,u.property)(r.textProperty)],r.prototype,"text",void 0),t([(0,u.property)(r.connectionNameProperty)],r.prototype,"connectionName",void 0),t([(0,u.property)(r.buttonsProperty)],r.prototype,"buttons",void 0),t([(0,u.property)(r.tokenExchangeResourceProperty)],r.prototype,"tokenExchangeResource",void 0),r}(u.SerializableObject);Zw.Authentication=ke;var Ce=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.designMode=!1,e}return e(r,n),Object.defineProperty(r.prototype,"refresh",{get:function(){return this.getValue(r.refreshProperty)},set:function(e){this.setValue(r.refreshProperty,e),e&&(e.parent=this)},enumerable:!1,configurable:!0}),Object.defineProperty(r,"processMarkdown",{get:function(){throw new Error(p.Strings.errors.processMarkdownEventRemoved())},set:function(e){throw new Error(p.Strings.errors.processMarkdownEventRemoved())},enumerable:!1,configurable:!0}),r.applyMarkdown=function(e){var t={didProcess:!1};if(r.onProcessMarkdown)r.onProcessMarkdown(e,t);else if(window.markdownit){var n=window.markdownit;t.outputHtml=n().render(e),t.didProcess=!0}else r._haveWarnedAboutNoMarkdownProcessing||(console.warn(p.Strings.errors.markdownProcessingNotEnabled),r._haveWarnedAboutNoMarkdownProcessing=!0);return t},r.prototype.isVersionSupported=function(){return!!this.bypassVersionCheck||!(!this.version||!this.version.isValid||this.maxVersion.major<this.version.major||this.maxVersion.major===this.version.major&&this.maxVersion.minor<this.version.minor)},r.prototype.getDefaultSerializationContext=function(){return new Me(this.version)},r.prototype.getItemsCollectionPropertyName=function(){return"body"},r.prototype.canHostSingletons=function(){return!0},r.prototype.internalParse=function(e,t){this._fallbackCard=void 0;var i=t.parseElement(void 0,e.fallback,this.forbiddenChildElements(),!this.isDesignMode());i&&(this._fallbackCard=new r,this._fallbackCard.addItem(i)),n.prototype.internalParse.call(this,e,t)},r.prototype.internalToJSON=function(e,t){this.setValue(r.versionProperty,t.targetVersion),n.prototype.internalToJSON.call(this,e,t)},r.prototype.internalRender=function(){var e=n.prototype.internalRender.call(this);return o.GlobalSettings.useAdvancedCardBottomTruncation&&e&&e.style.removeProperty("minHeight"),e},r.prototype.getHasBackground=function(e){return!0},r.prototype.getDefaultPadding=function(){return new o.PaddingDefinition(i.Spacing.Padding,i.Spacing.Padding,i.Spacing.Padding,i.Spacing.Padding)},r.prototype.shouldSerialize=function(e){return!0},Object.defineProperty(r.prototype,"renderIfEmpty",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bypassVersionCheck",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"allowCustomStyle",{get:function(){return this.hostConfig.adaptiveCard&&this.hostConfig.adaptiveCard.allowCustomStyle},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hasBackground",{get:function(){return!0},enumerable:!1,configurable:!0}),r.prototype.getJsonTypeName=function(){return"AdaptiveCard"},r.prototype.internalValidateProperties=function(e){n.prototype.internalValidateProperties.call(this,e),"AdaptiveCard"!==this.getValue(g.typeNameProperty)&&e.addFailure(this,i.ValidationEvent.MissingCardType,p.Strings.errors.invalidCardType()),this.bypassVersionCheck||this.version?this.isVersionSupported()||e.addFailure(this,i.ValidationEvent.UnsupportedCardVersion,p.Strings.errors.unsupportedCardVersion(this.version.toString(),this.maxVersion.toString())):e.addFailure(this,i.ValidationEvent.PropertyCantBeNull,p.Strings.errors.propertyMustBeSet("version"))},r.prototype.render=function(e){var t;return this.shouldFallback()&&this._fallbackCard?(this._fallbackCard.hostConfig=this.hostConfig,t=this._fallbackCard.render()):(t=n.prototype.render.call(this))&&(t.classList.add(this.hostConfig.makeCssClassName("ac-adaptiveCard")),o.GlobalSettings.setTabIndexAtCardRoot&&(t.tabIndex=0),this.speak&&t.setAttribute("aria-label",this.speak)),e&&(a.appendChild(e,t),this.updateLayout()),t},r.prototype.updateLayout=function(e){if(void 0===e&&(e=!0),n.prototype.updateLayout.call(this,e),o.GlobalSettings.useAdvancedCardBottomTruncation&&this.isDisplayed()){var t=this.hostConfig.getEffectiveSpacing(i.Spacing.Default);this.handleOverflow(this.renderedElement.offsetHeight-t)}},r.prototype.shouldFallback=function(){return n.prototype.shouldFallback.call(this)||!this.isVersionSupported()},Object.defineProperty(r.prototype,"hasVisibleSeparator",{get:function(){return!1},enumerable:!1,configurable:!0}),r.schemaUrl="http://adaptivecards.io/schemas/adaptive-card.json",r.$schemaProperty=new u.CustomProperty(u.Versions.v1_0,"$schema",function(e,t,n,i){return r.schemaUrl},function(e,t,n,i,o){o.serializeValue(n,t.name,r.schemaUrl)}),r.versionProperty=new u.CustomProperty(u.Versions.v1_0,"version",function(e,t,n,r){var o=u.Version.parse(n[t.name],r);return void 0===o&&(o=u.Versions.latest,r.logParseEvent(e,i.ValidationEvent.InvalidPropertyValue,p.Strings.errors.invalidCardVersion(o.toString()))),o},function(e,t,n,r,i){void 0!==r&&i.serializeValue(n,t.name,r.toString())},u.Versions.v1_0),r.fallbackTextProperty=new u.StringProperty(u.Versions.v1_0,"fallbackText"),r.speakProperty=new u.StringProperty(u.Versions.v1_0,"speak"),r.refreshProperty=new u.SerializableObjectProperty(u.Versions.v1_4,"refresh",be,!0),r.authenticationProperty=new u.SerializableObjectProperty(u.Versions.v1_4,"authentication",ke,!0),r._haveWarnedAboutNoMarkdownProcessing=!1,t([(0,u.property)(r.versionProperty)],r.prototype,"version",void 0),t([(0,u.property)(r.fallbackTextProperty)],r.prototype,"fallbackText",void 0),t([(0,u.property)(r.speakProperty)],r.prototype,"speak",void 0),t([(0,u.property)(r.refreshProperty)],r.prototype,"refresh",null),t([(0,u.property)(r.authenticationProperty)],r.prototype,"authentication",void 0),r}(Ae);Zw.AdaptiveCard=Ce;var _e=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.suppressStyle=!1,e}return e(n,t),n.prototype.getSchemaKey=function(){return"InlineAdaptiveCard"},n.prototype.populateSchema=function(e){t.prototype.populateSchema.call(this,e),e.remove(Ce.$schemaProperty,Ce.versionProperty)},n.prototype.getDefaultPadding=function(){return new o.PaddingDefinition(this.suppressStyle?i.Spacing.None:i.Spacing.Padding,i.Spacing.Padding,this.suppressStyle?i.Spacing.None:i.Spacing.Padding,i.Spacing.Padding)},Object.defineProperty(n.prototype,"bypassVersionCheck",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"defaultStyle",{get:function(){return this.suppressStyle?i.ContainerStyle.Default:this.hostConfig.actions.showCard.style?this.hostConfig.actions.showCard.style:i.ContainerStyle.Emphasis},enumerable:!1,configurable:!0}),n.prototype.render=function(e){var n=t.prototype.render.call(this,e);return n&&(n.setAttribute("aria-live","polite"),n.removeAttribute("tabindex")),n},n}(Ce),Me=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._forbiddenTypes=new Set,e}return e(n,t),n.prototype.internalParseCardObject=function(e,t,n,r,s,l,c){var u=this;void 0===c&&(c=!1);var d=void 0;if(t&&"object"==typeof t){var p=new Set;this._forbiddenTypes.forEach(function(e){p.add(e)}),n.forEach(function(e){u._forbiddenTypes.add(e)});var h=a.parseString(t.type),f=c&&"Carousel"===h;if(h&&this._forbiddenTypes.has(h)&&!f)l(h,i.TypeErrorType.ForbiddenType);else{var m=!1;if((d=s(h))?(d.setParent(e),d.parse(t,this),m=o.GlobalSettings.enableFallback&&r&&d.shouldFallback()):(m=o.GlobalSettings.enableFallback&&r,l(h,i.TypeErrorType.UnknownType)),m){var g=t.fallback;!g&&e&&e.setShouldFallback(!0),"string"==typeof g&&"drop"===g.toLowerCase()?d=void 0:"object"==typeof g&&(d=this.internalParseCardObject(e,g,n,!0,s,l))}}this._forbiddenTypes=p}return d},n.prototype.cardObjectParsed=function(e,t){e instanceof Q&&this.onParseAction?this.onParseAction(e,t,this):e instanceof g&&this.onParseElement&&this.onParseElement(e,t,this)},n.prototype.shouldSerialize=function(e){return e instanceof Q?void 0!==this.actionRegistry.findByName(e.getJsonTypeName()):!(e instanceof g)||void 0!==this.elementRegistry.findByName(e.getJsonTypeName())},n.prototype.parseCardObject=function(e,t,n,r,i,o,a){void 0===a&&(a=!1);var s=new Set(n),l=this.internalParseCardObject(e,t,s,r,i,o,a);return void 0!==l&&this.cardObjectParsed(l,t),l},n.prototype.parseElement=function(e,t,n,r,o){var a=this;return void 0===o&&(o=!1),this.parseCardObject(e,t,n,r,function(e){return a.elementRegistry.createInstance(e,a.targetVersion)},function(e,t){t===i.TypeErrorType.UnknownType?a.logParseEvent(void 0,i.ValidationEvent.UnknownElementType,p.Strings.errors.unknownElementType(e)):a.logParseEvent(void 0,i.ValidationEvent.ElementTypeNotAllowed,p.Strings.errors.elementTypeNotAllowed(e))},o)},n.prototype.parseAction=function(e,t,n,r){var o=this;return this.parseCardObject(e,t,n,r,function(e){return o.actionRegistry.createInstance(e,o.targetVersion)},function(e,t){t===i.TypeErrorType.UnknownType?o.logParseEvent(void 0,i.ValidationEvent.UnknownActionType,p.Strings.errors.unknownActionType(e)):o.logParseEvent(void 0,i.ValidationEvent.ActionTypeNotAllowed,p.Strings.errors.actionTypeNotAllowed(e))})},Object.defineProperty(n.prototype,"elementRegistry",{get:function(){var e;return null!==(e=this._elementRegistry)&&void 0!==e?e:d.GlobalRegistry.elements},enumerable:!1,configurable:!0}),n.prototype.setElementRegistry=function(e){this._elementRegistry=e},Object.defineProperty(n.prototype,"actionRegistry",{get:function(){var e;return null!==(e=this._actionRegistry)&&void 0!==e?e:d.GlobalRegistry.actions},enumerable:!1,configurable:!0}),n.prototype.setActionRegistry=function(e){this._actionRegistry=e},n}(u.BaseSerializationContext);return Zw.SerializationContext=Me,d.GlobalRegistry.defaultElements.register("Container",de),d.GlobalRegistry.defaultElements.register("TextBlock",v),d.GlobalRegistry.defaultElements.register("RichTextBlock",w,u.Versions.v1_2),d.GlobalRegistry.defaultElements.register("TextRun",b,u.Versions.v1_2),d.GlobalRegistry.defaultElements.register("Image",_),d.GlobalRegistry.defaultElements.register("ImageSet",T),d.GlobalRegistry.defaultElements.register("Media",N,u.Versions.v1_1),d.GlobalRegistry.defaultElements.register("FactSet",k),d.GlobalRegistry.defaultElements.register("ColumnSet",he),d.GlobalRegistry.defaultElements.register("ActionSet",ae,u.Versions.v1_2),d.GlobalRegistry.defaultElements.register("Input.Text",F),d.GlobalRegistry.defaultElements.register("Input.Date",z),d.GlobalRegistry.defaultElements.register("Input.Time",W),d.GlobalRegistry.defaultElements.register("Input.Number",G),d.GlobalRegistry.defaultElements.register("Input.ChoiceSet",q),d.GlobalRegistry.defaultElements.register("Input.Toggle",j),d.GlobalRegistry.defaultActions.register(X.JsonTypeName,X),d.GlobalRegistry.defaultActions.register(J.JsonTypeName,J),d.GlobalRegistry.defaultActions.register(re.JsonTypeName,re),d.GlobalRegistry.defaultActions.register($.JsonTypeName,$,u.Versions.v1_2),d.GlobalRegistry.defaultActions.register(K.JsonTypeName,K,u.Versions.v1_4),Zw}var fE,mE={};var gE,yE={};var AE,vE={};function bE(){return AE||(AE=1,function(e){var t,n=vE&&vE.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.LoginRequestResponse=e.ErrorResponse=e.SuccessResponse=e.ActivityResponse=e.ActivityRequestError=e.ActivityRequestTrigger=void 0,(t=e.ActivityRequestTrigger||(e.ActivityRequestTrigger={})).Automatic="automatic",t.Manual="manual";var r=function(){return function(e,t){this.code=e,this.message=t}}();e.ActivityRequestError=r;var i=function(){return function(e){this.request=e}}();e.ActivityResponse=i;var o=function(e){function t(t,n){var r=e.call(this,t)||this;return r.request=t,r.rawContent=n,r}return n(t,e),t}(i);e.SuccessResponse=o;var a=function(e){function t(t,n){var r=e.call(this,t)||this;return r.request=t,r.error=n,r}return n(t,e),t}(i);e.ErrorResponse=a;var s=function(e){function t(t,n){var r=e.call(this,t)||this;r.request=t,r._auth=n;for(var i=0,o=r._auth.buttons;i<o.length;i++){var a=o[i];if("signin"===a.type&&void 0!==a.value)try{new URL(a.value),r.signinButton=a;break}catch(e){}}return r}return n(t,e),Object.defineProperty(t.prototype,"tokenExchangeResource",{get:function(){return this._auth.tokenExchangeResource},enumerable:!1,configurable:!0}),t}(i);e.LoginRequestResponse=s}(vE)),vE}var wE,EE,kE={};function CE(){if(wE)return kE;wE=1;var e=kE&&kE.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})},t=kE&&kE.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(kE,"__esModule",{value:!0}),kE.AdaptiveApplet=void 0;var n=Mw(),r=Lw(),i=Dw(),o=bE(),a=kw(),s=hE(),l=Rw();function c(e,t){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];if(i.GlobalSettings.applets.logEnabled)if(i.GlobalSettings.applets.onLogEvent)i.GlobalSettings.applets.onLogEvent(e,t,r);else switch(e){case n.LogLevel.Warning:console.warn(t,r);break;case n.LogLevel.Error:console.error(t,r);break;default:console.log(t,r)}}var u=function(){function n(e,t,n){this.action=e,this.trigger=t,this.consecutiveRefreshes=n,this.attemptNumber=0}return n.prototype.retryAsync=function(){return e(this,void 0,void 0,function(){return t(this,function(e){return this.onSend&&this.onSend(this),[2]})})},n}(),d=function(){function d(){this._allowAutomaticCardUpdate=!1,this.renderedElement=document.createElement("div"),this.renderedElement.className="aaf-cardHost",this.renderedElement.style.position="relative",this.renderedElement.style.display="flex",this.renderedElement.style.flexDirection="column",this._cardHostElement=document.createElement("div"),this._refreshButtonHostElement=document.createElement("div"),this._refreshButtonHostElement.className="aaf-refreshButtonHost",this._refreshButtonHostElement.style.display="none",this.renderedElement.appendChild(this._cardHostElement),this.renderedElement.appendChild(this._refreshButtonHostElement)}return d.prototype.displayCard=function(e){if(!e.renderedElement)throw new Error("displayCard: undefined card.");r.clearElementChildren(this._cardHostElement),this._refreshButtonHostElement.style.display="none",this._cardHostElement.appendChild(e.renderedElement)},d.prototype.showManualRefreshButton=function(e){var t=this;if(!this.onShowManualRefreshButton||this.onShowManualRefreshButton(this)){this._refreshButtonHostElement.style.display="none";var c=void 0;if(this.onRenderManualRefreshButton)c=this.onRenderManualRefreshButton(this);else{var u=a.Strings.runtime.refreshThisCard();if(i.GlobalSettings.applets.refresh.mode===n.RefreshMode.Automatic){var d=a.Strings.runtime.automaticRefreshPaused();" "!==d[d.length-1]&&(d+=" "),u=a.Strings.runtime.clckToRestartAutomaticRefresh()}var p={type:"AdaptiveCard",version:"1.2",body:[{type:"RichTextBlock",horizontalAlignment:"right",inlines:[{type:"TextRun",text:u,selectAction:{type:"Action.Submit",id:"refreshCard"}}]}]},h=new s.AdaptiveCard;h.parse(p,new s.SerializationContext(l.Versions.v1_2)),h.onExecuteAction=function(n){"refreshCard"===n.id&&(r.clearElementChildren(t._refreshButtonHostElement),t.internalExecuteAction(e,o.ActivityRequestTrigger.Automatic,0))},c=h.render()}c&&(r.clearElementChildren(this._refreshButtonHostElement),this._refreshButtonHostElement.appendChild(c),this._refreshButtonHostElement.style.removeProperty("display"))}},d.prototype.createActivityRequest=function(e,t,n){var r=this;if(this.card){var i=new u(e,t,n);return i.onSend=function(e){e.attemptNumber++,r.internalSendActivityRequestAsync(i)},!!this.onPrepareActivityRequest&&!this.onPrepareActivityRequest(this,i,e)?void 0:i}throw new Error("createActivityRequest: no card has been set.")},d.prototype.createMagicCodeInputCard=function(e){var t={type:"AdaptiveCard",version:"1.0",body:[{type:"TextBlock",color:"attention",text:1===e?void 0:"That didn't work... let's try again.",wrap:!0,horizontalAlignment:"center"},{type:"TextBlock",text:'Please login in the popup. You will obtain a magic code. Paste that code below and select "Submit"',wrap:!0,horizontalAlignment:"center"},{type:"Input.Text",id:"magicCode",placeholder:"Enter magic code"},{type:"ActionSet",horizontalAlignment:"center",actions:[{type:"Action.Submit",id:d._submitMagicCodeActionId,title:"Submit"},{type:"Action.Submit",id:d._cancelMagicCodeAuthActionId,title:"Cancel"}]}]},n=new s.AdaptiveCard;return n.parse(t),n},d.prototype.cancelAutomaticRefresh=function(){this._allowAutomaticCardUpdate&&c(n.LogLevel.Warning,"Automatic card refresh has been cancelled as a result of the user interacting with the card."),this._allowAutomaticCardUpdate=!1},d.prototype.createSerializationContext=function(){return this.onCreateSerializationContext?this.onCreateSerializationContext(this):new s.SerializationContext},d.prototype.internalSetCard=function(e,t){var r=this;if("object"==typeof e&&"AdaptiveCard"===e.type&&(this._cardPayload=e),this._cardPayload)try{var a=new s.AdaptiveCard;this.hostConfig&&(a.hostConfig=this.hostConfig);var l=this.createSerializationContext();if(a.parse(this._cardPayload,l),(!this.onCardChanging||this.onCardChanging(this,this._cardPayload))&&(this._card=a,this._card.authentication&&this._card.authentication.tokenExchangeResource&&this.onPrefetchSSOToken&&this.onPrefetchSSOToken(this,this._card.authentication.tokenExchangeResource),this._card.onExecuteAction=function(e){r.cancelAutomaticRefresh(),r.internalExecuteAction(e,o.ActivityRequestTrigger.Manual,0)},this._card.onInputValueChanged=function(e){r.cancelAutomaticRefresh()},this._card.render(),this._card.renderedElement&&(this.displayCard(this._card),this.onCardChanged&&this.onCardChanged(this),this._card.refresh)))if(i.GlobalSettings.applets.refresh.mode===n.RefreshMode.Automatic&&t<i.GlobalSettings.applets.refresh.maximumConsecutiveAutomaticRefreshes)if(i.GlobalSettings.applets.refresh.timeBetweenAutomaticRefreshes<=0)c(n.LogLevel.Info,"Triggering automatic card refresh number "+(t+1)),this.internalExecuteAction(this._card.refresh.action,o.ActivityRequestTrigger.Automatic,t+1);else{c(n.LogLevel.Info,"Scheduling automatic card refresh number "+(t+1)+" in "+i.GlobalSettings.applets.refresh.timeBetweenAutomaticRefreshes+"ms");var u=this._card.refresh.action;this._allowAutomaticCardUpdate=!0,window.setTimeout(function(){r._allowAutomaticCardUpdate&&r.internalExecuteAction(u,o.ActivityRequestTrigger.Automatic,t+1)},i.GlobalSettings.applets.refresh.timeBetweenAutomaticRefreshes)}else i.GlobalSettings.applets.refresh.mode!==n.RefreshMode.Disabled&&(c(n.LogLevel.Warning,t>0?"Stopping automatic refreshes after "+t+" consecutive refreshes.":"The card has a refresh section, but automatic refreshes are disabled."),(i.GlobalSettings.applets.refresh.allowManualRefreshesAfterAutomaticRefreshes||i.GlobalSettings.applets.refresh.mode===n.RefreshMode.Manual)&&(c(n.LogLevel.Info,"Showing manual refresh button."),this.showManualRefreshButton(this._card.refresh.action)))}catch(e){c(n.LogLevel.Error,"setCard: "+e)}},d.prototype.internalExecuteAction=function(e,t,n){if(e instanceof s.ExecuteAction){if(!this.channelAdapter)throw new Error("internalExecuteAction: No channel adapter set.");var r=this.createActivityRequest(e,t,n);r&&r.retryAsync()}this.onAction&&this.onAction(this,e)},d.prototype.createProgressOverlay=function(e){if(!this._progressOverlay)if(this.onCreateProgressOverlay)this._progressOverlay=this.onCreateProgressOverlay(this,e);else{this._progressOverlay=document.createElement("div"),this._progressOverlay.className="aaf-progress-overlay";var t=document.createElement("div");t.className="aaf-spinner",t.style.width="28px",t.style.height="28px",this._progressOverlay.appendChild(t)}return this._progressOverlay},d.prototype.removeProgressOverlay=function(e){this.onRemoveProgressOverlay&&this.onRemoveProgressOverlay(this,e),void 0!==this._progressOverlay&&(this.renderedElement.removeChild(this._progressOverlay),this._progressOverlay=void 0)},d.prototype.activityRequestSucceeded=function(e,t){this.onActivityRequestSucceeded&&this.onActivityRequestSucceeded(this,e,t)},d.prototype.activityRequestFailed=function(e){return this.onActivityRequestFailed?this.onActivityRequestFailed(this,e):i.GlobalSettings.applets.defaultTimeBetweenRetryAttempts},d.prototype.showAuthCodeInputDialog=function(e){var t=this;if(!this.onShowAuthCodeInputDialog||this.onShowAuthCodeInputDialog(this,e)){var r=this.createMagicCodeInputCard(e.attemptNumber);r.render(),r.onExecuteAction=function(r){if(t.card&&r instanceof s.SubmitAction)switch(r.id){case d._submitMagicCodeActionId:var i=void 0;r.data&&"string"==typeof r.data.magicCode&&(i=r.data.magicCode),i?(t.displayCard(t.card),e.authCode=i,e.retryAsync()):alert("Please enter the magic code you received.");break;case d._cancelMagicCodeAuthActionId:c(n.LogLevel.Warning,"Authentication cancelled by user."),t.displayCard(t.card);break;default:c(n.LogLevel.Error,"Unexpected action taken from magic code input card (id = "+r.id+")"),alert(a.Strings.magicCodeInputCard.somethingWentWrong())}},this.displayCard(r)}},d.prototype.internalSendActivityRequestAsync=function(r){return e(this,void 0,void 0,function(){var e,s,l,u;return t(this,function(d){switch(d.label){case 0:if(!this.channelAdapter)throw new Error("internalSendActivityRequestAsync: channelAdapter is not set.");void 0!==(e=this.createProgressOverlay(r))&&this.renderedElement.appendChild(e),s=!1,l=function(){var e,l,d,p,h,f,m;return t(this,function(t){switch(t.label){case 0:e=void 0,1===r.attemptNumber?c(n.LogLevel.Info,"Sending activity request to channel (attempt "+r.attemptNumber+")"):c(n.LogLevel.Info,"Re-sending activity request to channel (attempt "+r.attemptNumber+")"),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,u.channelAdapter.sendRequestAsync(r)];case 2:return e=t.sent(),[3,4];case 3:return l=t.sent(),c(n.LogLevel.Error,"Activity request failed: "+l),u.removeProgressOverlay(r),s=!0,[3,4];case 4:if(!e)return[3,10];if(!(e instanceof o.SuccessResponse))return[3,5];if(u.removeProgressOverlay(r),void 0===e.rawContent)throw new Error("internalSendActivityRequestAsync: Action.Execute result is undefined");d=e.rawContent;try{d=JSON.parse(e.rawContent)}catch(e){}if("string"==typeof d)c(n.LogLevel.Info,"The activity request returned a string after "+r.attemptNumber+" attempt(s)."),u.activityRequestSucceeded(e,d);else{if("object"!=typeof d||"AdaptiveCard"!==d.type)throw new Error("internalSendActivityRequestAsync: Action.Execute result is of unsupported type ("+typeof e.rawContent+")");c(n.LogLevel.Info,"The activity request returned an Adaptive Card after "+r.attemptNumber+" attempt(s)."),u.internalSetCard(d,r.consecutiveRefreshes),u.activityRequestSucceeded(e,u.card)}return s=!0,[3,10];case 5:return e instanceof o.ErrorResponse?(p=u.activityRequestFailed(e))>=0&&r.attemptNumber<i.GlobalSettings.applets.maximumRetryAttempts?(c(n.LogLevel.Warning,"Activity request failed: ".concat(e.error.message,". Retrying in ").concat(p,"ms")),r.attemptNumber++,[4,new Promise(function(e,t){window.setTimeout(function(){e()},p)})]):[3,7]:[3,9];case 6:return t.sent(),[3,8];case 7:c(n.LogLevel.Error,"Activity request failed: ".concat(e.error.message,". Giving up after ").concat(r.attemptNumber," attempt(s)")),u.removeProgressOverlay(r),s=!0,t.label=8;case 8:return[3,10];case 9:if(e instanceof o.LoginRequestResponse){if(c(n.LogLevel.Info,"The activity request returned a LoginRequestResponse after "+r.attemptNumber+" attempt(s)."),r.attemptNumber<=i.GlobalSettings.applets.maximumRetryAttempts){if(h=!0,e.tokenExchangeResource&&u.onSSOTokenNeeded&&(h=!u.onSSOTokenNeeded(u,r,e.tokenExchangeResource)),h){if(u.removeProgressOverlay(r),void 0===e.signinButton)throw new Error("internalSendActivityRequestAsync: the login request doesn't contain a valid signin URL.");c(n.LogLevel.Info,"Login required at "+e.signinButton.value),u.onShowSigninPrompt?u.onShowSigninPrompt(u,r,e.signinButton):(u.showAuthCodeInputDialog(r),f=window.screenX+(window.outerWidth-i.GlobalSettings.applets.authPromptWidth)/2,m=window.screenY+(window.outerHeight-i.GlobalSettings.applets.authPromptHeight)/2,window.open(e.signinButton.value,e.signinButton.title?e.signinButton.title:"Sign in","width=".concat(i.GlobalSettings.applets.authPromptWidth,",height=").concat(i.GlobalSettings.applets.authPromptHeight,",left=").concat(f,",top=").concat(m)))}}else c(n.LogLevel.Error,"Authentication failed. Giving up after "+r.attemptNumber+" attempt(s)"),alert(a.Strings.magicCodeInputCard.authenticationFailed());return[2,"break"]}throw new Error("Unhandled response type: "+JSON.stringify(e));case 10:return[2]}})},u=this,d.label=1;case 1:return s?[3,3]:[5,l()];case 2:return"break"===d.sent()?[3,3]:[3,1];case 3:return[2]}})})},d.prototype.refreshCard=function(){this._card&&this._card.refresh&&this.internalExecuteAction(this._card.refresh.action,o.ActivityRequestTrigger.Manual,0)},d.prototype.setCard=function(e){this.internalSetCard(e,0)},Object.defineProperty(d.prototype,"card",{get:function(){return this._card},enumerable:!1,configurable:!0}),d._submitMagicCodeActionId="submitMagicCode",d._cancelMagicCodeAuthActionId="cancelMagicCodeAuth",d}();return kE.AdaptiveApplet=d,kE}var _E,ME=(EE||(EE=1,function(e){var t=ww&&ww.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=ww&&ww.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(kw(),e),n(Mw(),e),n(Dw(),e),n(Lw(),e),n(Rw(),e),n(Nw(),e),n(jw(),e),n(Gw(),e),n(Ww(),e),n(hE(),e),n(function(){if(fE)return mE;fE=1;var e=mE&&mE.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),t=mE&&mE.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};Object.defineProperty(mE,"__esModule",{value:!0}),mE.Table=mE.TableRow=mE.TableCell=mE.StylableContainer=mE.TableColumnDefinition=void 0;var n=hE(),r=Mw(),i=Gw(),o=Rw(),a=Dw(),s=kw(),l=Lw(),c=function(n){function i(){var e=null!==n&&n.apply(this,arguments)||this;return e.width=new a.SizeAndUnit(1,r.SizeUnit.Weight),e}return e(i,n),i.prototype.getSchemaKey=function(){return"ColumnDefinition"},i.horizontalCellContentAlignmentProperty=new o.EnumProperty(o.Versions.v1_5,"horizontalCellContentAlignment",r.HorizontalAlignment),i.verticalCellContentAlignmentProperty=new o.EnumProperty(o.Versions.v1_5,"verticalCellContentAlignment",r.VerticalAlignment),i.widthProperty=new o.CustomProperty(o.Versions.v1_5,"width",function(e,t,n,i){var o=t.defaultValue,l=n[t.name],c=!1;if("number"!=typeof l||isNaN(l))if("string"==typeof l)try{o=a.SizeAndUnit.parse(l)}catch(e){c=!0}else c=!0;else o=new a.SizeAndUnit(l,r.SizeUnit.Weight);return c&&i.logParseEvent(e,r.ValidationEvent.InvalidPropertyValue,s.Strings.errors.invalidColumnWidth(l)),o},function(e,t,n,i,o){i.unit===r.SizeUnit.Pixel?o.serializeValue(n,"width",i.physicalSize+"px"):o.serializeNumber(n,"width",i.physicalSize)},new a.SizeAndUnit(1,r.SizeUnit.Weight)),t([(0,o.property)(i.horizontalCellContentAlignmentProperty)],i.prototype,"horizontalCellContentAlignment",void 0),t([(0,o.property)(i.verticalCellContentAlignmentProperty)],i.prototype,"verticalCellContentAlignment",void 0),t([(0,o.property)(i.widthProperty)],i.prototype,"width",void 0),i}(o.SerializableObject);mE.TableColumnDefinition=c;var u=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._items=[],e}return e(n,t),n.prototype.parseItem=function(e,t){var n=this;return t.parseCardObject(this,e,[],!this.isDesignMode(),function(e){return n.createItemInstance(e)},function(e,n){t.logParseEvent(void 0,r.ValidationEvent.ElementTypeNotAllowed,s.Strings.errors.elementTypeNotAllowed(e))})},n.prototype.internalAddItem=function(e){if(e.parent)throw new Error(s.Strings.errors.elementAlreadyParented());this._items.push(e),e.setParent(this)},n.prototype.internalRemoveItem=function(e){var t=this._items.indexOf(e);return t>=0&&(this._items.splice(t,1),e.setParent(void 0),this.updateLayout(),!0)},n.prototype.internalIndexOf=function(e){return this._items.indexOf(e)},n.prototype.internalParse=function(e,n){t.prototype.internalParse.call(this,e,n),this._items=[];var r=e[this.getCollectionPropertyName()];if(Array.isArray(r))for(var i=0,o=r;i<o.length;i++){var a=o[i],s=this.parseItem(a,n);s&&this._items.push(s)}},n.prototype.internalToJSON=function(e,n){t.prototype.internalToJSON.call(this,e,n),n.serializeArray(e,this.getCollectionPropertyName(),this._items)},n.prototype.removeItem=function(e){return this.internalRemoveItem(e)},n.prototype.getItemCount=function(){return this._items.length},n.prototype.getItemAt=function(e){return this._items[e]},n.prototype.getFirstVisibleRenderedItem=function(){return this.getItemCount()>0?this.getItemAt(0):void 0},n.prototype.getLastVisibleRenderedItem=function(){return this.getItemCount()>0?this.getItemAt(this.getItemCount()-1):void 0},n}(n.StylableCardElementContainer);mE.StylableContainer=u;var d=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._columnIndex=-1,e._cellType="data",e}return e(n,t),n.prototype.getHasBorder=function(){return this.parentRow.parentTable.showGridLines},n.prototype.applyBorder=function(){if(this.renderedElement&&this.getHasBorder()){var e=this.hostConfig.containerStyles.getStyleByName(this.parentRow.parentTable.gridStyle);if(e.borderColor){var t=(0,l.stringToCssColor)(e.borderColor);t&&(this.renderedElement.style.borderRight="1px solid "+t,this.renderedElement.style.borderBottom="1px solid "+t)}}},n.prototype.getDefaultPadding=function(){return this.getHasBackground()||this.getHasBorder()?new a.PaddingDefinition(r.Spacing.Small,r.Spacing.Small,r.Spacing.Small,r.Spacing.Small):t.prototype.getDefaultPadding.call(this)},n.prototype.internalRender=function(){var e=t.prototype.internalRender.call(this);return e&&(e.setAttribute("role","data"===this.cellType?"cell":"columnheader"),e.style.minWidth="0","header"===this.cellType&&e.setAttribute("scope","col")),e},n.prototype.shouldSerialize=function(e){return!0},n.prototype.getJsonTypeName=function(){return"TableCell"},n.prototype.getEffectiveTextStyleDefinition=function(){return"header"===this.cellType?this.hostConfig.textStyles.columnHeader:t.prototype.getEffectiveTextStyleDefinition.call(this)},n.prototype.getEffectiveHorizontalAlignment=function(){if(void 0!==this.horizontalAlignment)return this.horizontalAlignment;if(void 0!==this.parentRow.horizontalCellContentAlignment)return this.parentRow.horizontalCellContentAlignment;if(this.columnIndex>=0){var e=this.parentRow.parentTable.getColumnAt(this.columnIndex).horizontalCellContentAlignment;if(void 0!==e)return e}return void 0!==this.parentRow.parentTable.horizontalCellContentAlignment?this.parentRow.parentTable.horizontalCellContentAlignment:t.prototype.getEffectiveHorizontalAlignment.call(this)},n.prototype.getEffectiveVerticalContentAlignment=function(){if(void 0!==this.verticalContentAlignment)return this.verticalContentAlignment;if(void 0!==this.parentRow.verticalCellContentAlignment)return this.parentRow.verticalCellContentAlignment;if(this.columnIndex>=0){var e=this.parentRow.parentTable.getColumnAt(this.columnIndex).verticalCellContentAlignment;if(void 0!==e)return e}return void 0!==this.parentRow.parentTable.verticalCellContentAlignment?this.parentRow.parentTable.verticalCellContentAlignment:t.prototype.getEffectiveVerticalContentAlignment.call(this)},Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this._columnIndex},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cellType",{get:function(){return this._cellType},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentRow",{get:function(){return this.parent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isStandalone",{get:function(){return!1},enumerable:!1,configurable:!0}),n}(n.Container);mE.TableCell=d;var p=function(i){function s(){return null!==i&&i.apply(this,arguments)||this}return e(s,i),s.prototype.getDefaultPadding=function(){return new a.PaddingDefinition(r.Spacing.None,r.Spacing.None,r.Spacing.None,r.Spacing.None)},s.prototype.applyBackground=function(){if(this.renderedElement){var e=this.hostConfig.containerStyles.getStyleByName(this.style,this.hostConfig.containerStyles.getStyleByName(this.defaultStyle));if(e.backgroundColor){var t=(0,l.stringToCssColor)(e.backgroundColor);t&&(this.renderedElement.style.backgroundColor=t)}}},s.prototype.getCollectionPropertyName=function(){return"cells"},s.prototype.createItemInstance=function(e){return e&&"TableCell"!==e?void 0:new d},s.prototype.internalRender=function(){var e=this.getIsFirstRow(),t=this.hostConfig.table.cellSpacing,n=document.createElement("div");n.setAttribute("role","row"),n.style.display="flex",n.style.flexDirection="row";for(var i=0;i<Math.min(this.getItemCount(),this.parentTable.getColumnCount());i++){var o=this.getItemAt(i);o._columnIndex=i,o._cellType=this.parentTable.firstRowAsHeaders&&e?"header":"data";var a=o.render();if(a){var s=this.parentTable.getColumnAt(i);s.computedWidth.unit===r.SizeUnit.Pixel?a.style.flex="0 0 "+s.computedWidth.physicalSize+"px":a.style.flex="1 1 "+s.computedWidth.physicalSize+"%",i>0&&!this.parentTable.showGridLines&&t>0&&(a.style.marginLeft=t+"px"),n.appendChild(a)}}return n.children.length>0?n:void 0},s.prototype.shouldSerialize=function(e){return!0},s.prototype.addCell=function(e){this.internalAddItem(e)},s.prototype.removeCellAt=function(e){return e>=0&&e<this.getItemCount()&&this.removeItem(this.getItemAt(e))},s.prototype.indexOf=function(e){return e instanceof d?this.internalIndexOf(e):-1},s.prototype.ensureHasEnoughCells=function(e){for(;this.getItemCount()<e;)this.addCell(new d)},s.prototype.getJsonTypeName=function(){return"TableRow"},s.prototype.getIsFirstRow=function(){return this.parentTable.getItemAt(0)===this},Object.defineProperty(s.prototype,"parentTable",{get:function(){return this.parent},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"isStandalone",{get:function(){return!1},enumerable:!1,configurable:!0}),s.styleProperty=new n.ContainerStyleProperty(o.Versions.v1_5,"style"),s.horizontalCellContentAlignmentProperty=new o.EnumProperty(o.Versions.v1_5,"horizontalCellContentAlignment",r.HorizontalAlignment),s.verticalCellContentAlignmentProperty=new o.EnumProperty(o.Versions.v1_5,"verticalCellContentAlignment",r.VerticalAlignment),t([(0,o.property)(s.horizontalCellContentAlignmentProperty)],s.prototype,"horizontalCellContentAlignment",void 0),t([(0,o.property)(s.verticalCellContentAlignmentProperty)],s.prototype,"verticalCellContentAlignment",void 0),s}(u);mE.TableRow=p;var h=function(i){function s(){var e=null!==i&&i.apply(this,arguments)||this;return e._columns=[],e.firstRowAsHeaders=!0,e.showGridLines=!0,e}return e(s,i),Object.defineProperty(s.prototype,"gridStyle",{get:function(){var e=this.getValue(s.gridStyleProperty);if(e&&this.hostConfig.containerStyles.getStyleByName(e))return e},set:function(e){this.setValue(s.gridStyleProperty,e)},enumerable:!1,configurable:!0}),s.prototype.ensureRowsHaveEnoughCells=function(){for(var e=0;e<this.getItemCount();e++)this.getItemAt(e).ensureHasEnoughCells(this.getColumnCount())},s.prototype.removeCellsFromColumn=function(e){for(var t=0;t<this.getItemCount();t++)this.getItemAt(t).removeCellAt(e)},s.prototype.getCollectionPropertyName=function(){return"rows"},s.prototype.createItemInstance=function(e){return e&&"TableRow"!==e?void 0:new p},s.prototype.internalParse=function(e,t){i.prototype.internalParse.call(this,e,t),this.ensureRowsHaveEnoughCells()},s.prototype.internalRender=function(){if(this.getItemCount()>0){for(var e=0,t=0,n=this._columns;t<n.length;t++)(s=n[t]).width.unit===r.SizeUnit.Weight&&(e+=s.width.physicalSize);for(var i=0,o=this._columns;i<o.length;i++){var s;(s=o[i]).width.unit===r.SizeUnit.Pixel?s.computedWidth=new a.SizeAndUnit(s.width.physicalSize,r.SizeUnit.Pixel):s.computedWidth=new a.SizeAndUnit(100/e*s.width.physicalSize,r.SizeUnit.Weight)}var c=document.createElement("div");if(c.setAttribute("role","table"),c.style.display="flex",c.style.flexDirection="column",this.showGridLines){var u=this.hostConfig.containerStyles.getStyleByName(this.gridStyle);if(u.borderColor){var d=(0,l.stringToCssColor)(u.borderColor);d&&(c.style.borderTop="1px solid "+d,c.style.borderLeft="1px solid "+d)}}for(var p=this.hostConfig.table.cellSpacing,h=0;h<this.getItemCount();h++){var f=this.getItemAt(h).render();if(f){if(h>0&&!this.showGridLines&&p>0){var m=document.createElement("div");m.setAttribute("aria-hidden","true"),m.style.height=p+"px",c.appendChild(m)}c.appendChild(f)}}return c}},s.prototype.addColumn=function(e){this._columns.push(e),this.ensureRowsHaveEnoughCells()},s.prototype.removeColumn=function(e){var t=this._columns.indexOf(e);t>=0&&(this.removeCellsFromColumn(t),this._columns.splice(t,1))},s.prototype.getColumnCount=function(){return this._columns.length},s.prototype.getColumnAt=function(e){return this._columns[e]},s.prototype.addRow=function(e){this.internalAddItem(e),e.ensureHasEnoughCells(this.getColumnCount())},s.prototype.indexOf=function(e){return e instanceof p?this.internalIndexOf(e):-1},s.prototype.getJsonTypeName=function(){return"Table"},s._columnsProperty=new o.SerializableObjectCollectionProperty(o.Versions.v1_5,"columns",c),s.firstRowAsHeadersProperty=new o.BoolProperty(o.Versions.v1_5,"firstRowAsHeaders",!0),s.showGridLinesProperty=new o.BoolProperty(o.Versions.v1_5,"showGridLines",!0),s.gridStyleProperty=new n.ContainerStyleProperty(o.Versions.v1_5,"gridStyle"),s.horizontalCellContentAlignmentProperty=new o.EnumProperty(o.Versions.v1_5,"horizontalCellContentAlignment",r.HorizontalAlignment),s.verticalCellContentAlignmentProperty=new o.EnumProperty(o.Versions.v1_5,"verticalCellContentAlignment",r.VerticalAlignment),t([(0,o.property)(s._columnsProperty)],s.prototype,"_columns",void 0),t([(0,o.property)(s.firstRowAsHeadersProperty)],s.prototype,"firstRowAsHeaders",void 0),t([(0,o.property)(s.showGridLinesProperty)],s.prototype,"showGridLines",void 0),t([(0,o.property)(s.gridStyleProperty)],s.prototype,"gridStyle",null),t([(0,o.property)(s.horizontalCellContentAlignmentProperty)],s.prototype,"horizontalCellContentAlignment",void 0),t([(0,o.property)(s.verticalCellContentAlignmentProperty)],s.prototype,"verticalCellContentAlignment",void 0),s}(u);return mE.Table=h,i.GlobalRegistry.defaultElements.register("Table",h,o.Versions.v1_5),mE}(),e),n(function(){if(gE)return yE;gE=1,Object.defineProperty(yE,"__esModule",{value:!0}),yE.ChannelAdapter=void 0;var e=function(){return function(){}}();return yE.ChannelAdapter=e,yE}(),e),n(bE(),e),n(CE(),e)}(ww)),ww);function TE(e){return(_E=_E||document.createElement("textarea")).innerHTML="&"+e+";",_E.value}var SE=Object.prototype.hasOwnProperty;function DE(e){return[].slice.call(arguments,1).forEach(function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}var xE=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function IE(e){return e.indexOf("\\")<0?e:e.replace(xE,"$1")}function LE(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(!!(65535&~e&&65534!=(65535&e))&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function PE(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var OE=/&([a-z#][a-z0-9]{1,31});/gi,RE=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;function BE(e,t){var n=0,r=TE(t);return t!==r?r:35===t.charCodeAt(0)&&RE.test(t)&&LE(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?PE(n):e}function YE(e){return e.indexOf("&")<0?e:e.replace(OE,BE)}var NE=/[&<>"]/,VE=/[&<>"]/g,FE={"&":"&","<":"<",">":">",'"':"""};function jE(e){return FE[e]}function HE(e){return NE.test(e)?e.replace(VE,jE):e}var qE={};function GE(e,t){return++t>=e.length-2?t:"paragraph_open"===e[t].type&&e[t].tight&&"inline"===e[t+1].type&&0===e[t+1].content.length&&"paragraph_close"===e[t+2].type&&e[t+2].tight?GE(e,t+2):t}qE.blockquote_open=function(){return"<blockquote>\n"},qE.blockquote_close=function(e,t){return"</blockquote>"+zE(e,t)},qE.code=function(e,t){return e[t].block?"<pre><code>"+HE(e[t].content)+"</code></pre>"+zE(e,t):"<code>"+HE(e[t].content)+"</code>"},qE.fence=function(e,t,n,r,i){var o,a,s,l,c=e[t],u="",d=n.langPrefix;if(c.params){if(a=(o=c.params.split(/\s+/g)).join(" "),s=i.rules.fence_custom,l=o[0],s&&SE.call(s,l))return i.rules.fence_custom[o[0]](e,t,n,r,i);u=' class="'+d+HE(YE(IE(a)))+'"'}return"<pre><code"+u+">"+(n.highlight&&n.highlight.apply(n.highlight,[c.content].concat(o))||HE(c.content))+"</code></pre>"+zE(e,t)},qE.fence_custom={},qE.heading_open=function(e,t){return"<h"+e[t].hLevel+">"},qE.heading_close=function(e,t){return"</h"+e[t].hLevel+">\n"},qE.hr=function(e,t,n){return(n.xhtmlOut?"<hr />":"<hr>")+zE(e,t)},qE.bullet_list_open=function(){return"<ul>\n"},qE.bullet_list_close=function(e,t){return"</ul>"+zE(e,t)},qE.list_item_open=function(){return"<li>"},qE.list_item_close=function(){return"</li>\n"},qE.ordered_list_open=function(e,t){var n=e[t];return"<ol"+(n.order>1?' start="'+n.order+'"':"")+">\n"},qE.ordered_list_close=function(e,t){return"</ol>"+zE(e,t)},qE.paragraph_open=function(e,t){return e[t].tight?"":"<p>"},qE.paragraph_close=function(e,t){var n=!(e[t].tight&&t&&"inline"===e[t-1].type&&!e[t-1].content);return(e[t].tight?"":"</p>")+(n?zE(e,t):"")},qE.link_open=function(e,t,n){var r=e[t].title?' title="'+HE(YE(e[t].title))+'"':"",i=n.linkTarget?' target="'+n.linkTarget+'"':"";return'<a href="'+HE(e[t].href)+'"'+r+i+">"},qE.link_close=function(){return"</a>"},qE.image=function(e,t,n){var r=' src="'+HE(e[t].src)+'"',i=e[t].title?' title="'+HE(YE(e[t].title))+'"':"";return"<img"+r+(' alt="'+(e[t].alt?HE(YE(IE(e[t].alt))):"")+'"')+i+(n.xhtmlOut?" /":"")+">"},qE.table_open=function(){return"<table>\n"},qE.table_close=function(){return"</table>\n"},qE.thead_open=function(){return"<thead>\n"},qE.thead_close=function(){return"</thead>\n"},qE.tbody_open=function(){return"<tbody>\n"},qE.tbody_close=function(){return"</tbody>\n"},qE.tr_open=function(){return"<tr>"},qE.tr_close=function(){return"</tr>\n"},qE.th_open=function(e,t){var n=e[t];return"<th"+(n.align?' style="text-align:'+n.align+'"':"")+">"},qE.th_close=function(){return"</th>"},qE.td_open=function(e,t){var n=e[t];return"<td"+(n.align?' style="text-align:'+n.align+'"':"")+">"},qE.td_close=function(){return"</td>"},qE.strong_open=function(){return"<strong>"},qE.strong_close=function(){return"</strong>"},qE.em_open=function(){return"<em>"},qE.em_close=function(){return"</em>"},qE.del_open=function(){return"<del>"},qE.del_close=function(){return"</del>"},qE.ins_open=function(){return"<ins>"},qE.ins_close=function(){return"</ins>"},qE.mark_open=function(){return"<mark>"},qE.mark_close=function(){return"</mark>"},qE.sub=function(e,t){return"<sub>"+HE(e[t].content)+"</sub>"},qE.sup=function(e,t){return"<sup>"+HE(e[t].content)+"</sup>"},qE.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},qE.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},qE.text=function(e,t){return HE(e[t].content)},qE.htmlblock=function(e,t){return e[t].content},qE.htmltag=function(e,t){return e[t].content},qE.abbr_open=function(e,t){return'<abbr title="'+HE(YE(e[t].title))+'">'},qE.abbr_close=function(){return"</abbr>"},qE.footnote_ref=function(e,t){var n=Number(e[t].id+1).toString(),r="fnref"+n;return e[t].subId>0&&(r+=":"+e[t].subId),'<sup class="footnote-ref"><a href="#fn'+n+'" id="'+r+'">['+n+"]</a></sup>"},qE.footnote_block_open=function(e,t,n){return(n.xhtmlOut?'<hr class="footnotes-sep" />\n':'<hr class="footnotes-sep">\n')+'<section class="footnotes">\n<ol class="footnotes-list">\n'},qE.footnote_block_close=function(){return"</ol>\n</section>\n"},qE.footnote_open=function(e,t){return'<li id="fn'+Number(e[t].id+1).toString()+'" class="footnote-item">'},qE.footnote_close=function(){return"</li>\n"},qE.footnote_anchor=function(e,t){var n="fnref"+Number(e[t].id+1).toString();return e[t].subId>0&&(n+=":"+e[t].subId),' <a href="#'+n+'" class="footnote-backref">↩</a>'},qE.dl_open=function(){return"<dl>\n"},qE.dt_open=function(){return"<dt>"},qE.dd_open=function(){return"<dd>"},qE.dl_close=function(){return"</dl>\n"},qE.dt_close=function(){return"</dt>\n"},qE.dd_close=function(){return"</dd>\n"};var zE=qE.getBreak=function(e,t){return(t=GE(e,t))<e.length&&"list_item_close"===e[t].type?"":"\n"};function UE(){this.rules=DE({},qE),this.getBreak=qE.getBreak}function WE(){this.__rules__=[],this.__cache__=null}function QE(e,t,n,r,i){this.src=e,this.env=r,this.options=n,this.parser=t,this.tokens=i,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.isInLabel=!1,this.linkLevel=0,this.linkContent="",this.labelUnmatchedScopes=0}function ZE(e,t){var n,r,i,o=-1,a=e.posMax,s=e.pos,l=e.isInLabel;if(e.isInLabel)return-1;if(e.labelUnmatchedScopes)return e.labelUnmatchedScopes--,-1;for(e.pos=t+1,e.isInLabel=!0,n=1;e.pos<a;){if(91===(i=e.src.charCodeAt(e.pos)))n++;else if(93===i&&0===--n){r=!0;break}e.parser.skipToken(e)}return r?(o=e.pos,e.labelUnmatchedScopes=0):e.labelUnmatchedScopes=n-1,e.pos=s,e.isInLabel=l,o}function JE(e,t,n,r){var i,o,a,s,l,c;if(42!==e.charCodeAt(0))return-1;if(91!==e.charCodeAt(1))return-1;if(-1===e.indexOf("]:"))return-1;if((o=ZE(i=new QE(e,t,n,r,[]),1))<0||58!==e.charCodeAt(o+1))return-1;for(s=i.posMax,a=o+2;a<s&&10!==i.src.charCodeAt(a);a++);return l=e.slice(2,o),0===(c=e.slice(o+2,a).trim()).length?-1:(r.abbreviations||(r.abbreviations={}),void 0===r.abbreviations[":"+l]&&(r.abbreviations[":"+l]=c),a)}function KE(e){var t=YE(e);try{t=decodeURI(t)}catch(e){}return encodeURI(t)}function XE(e,t){var n,r,i,o=t,a=e.posMax;if(60===e.src.charCodeAt(t)){for(t++;t<a;){if(10===(n=e.src.charCodeAt(t)))return!1;if(62===n)return i=KE(IE(e.src.slice(o+1,t))),!!e.parser.validateLink(i)&&(e.pos=t+1,e.linkContent=i,!0);92===n&&t+1<a?t+=2:t++}return!1}for(r=0;t<a&&32!==(n=e.src.charCodeAt(t))&&!(n<32||127===n);)if(92===n&&t+1<a)t+=2;else{if(40===n&&++r>1)break;if(41===n&&--r<0)break;t++}return o!==t&&(i=IE(e.src.slice(o,t)),!!e.parser.validateLink(i)&&(e.linkContent=i,e.pos=t,!0))}function $E(e,t){var n,r=t,i=e.posMax,o=e.src.charCodeAt(t);if(34!==o&&39!==o&&40!==o)return!1;for(t++,40===o&&(o=41);t<i;){if((n=e.src.charCodeAt(t))===o)return e.pos=t+1,e.linkContent=IE(e.src.slice(r+1,t)),!0;92===n&&t+1<i?t+=2:t++}return!1}function ek(e){return e.trim().replace(/\s+/g," ").toUpperCase()}function tk(e,t,n,r){var i,o,a,s,l,c,u,d,p;if(91!==e.charCodeAt(0))return-1;if(-1===e.indexOf("]:"))return-1;if((o=ZE(i=new QE(e,t,n,r,[]),0))<0||58!==e.charCodeAt(o+1))return-1;for(s=i.posMax,a=o+2;a<s&&(32===(l=i.src.charCodeAt(a))||10===l);a++);if(!XE(i,a))return-1;for(u=i.linkContent,c=a=i.pos,a+=1;a<s&&(32===(l=i.src.charCodeAt(a))||10===l);a++);for(a<s&&c!==a&&$E(i,a)?(d=i.linkContent,a=i.pos):(d="",a=c);a<s&&32===i.src.charCodeAt(a);)a++;return a<s&&10!==i.src.charCodeAt(a)?-1:(p=ek(e.slice(1,o)),void 0===r.references[p]&&(r.references[p]={title:d,href:u}),a)}UE.prototype.renderInline=function(e,t,n){for(var r=this.rules,i=e.length,o=0,a="";i--;)a+=r[e[o].type](e,o++,t,n,this);return a},UE.prototype.render=function(e,t,n){for(var r=this.rules,i=e.length,o=-1,a="";++o<i;)"inline"===e[o].type?a+=this.renderInline(e[o].children,t,n):a+=r[e[o].type](e,o,t,n,this);return a},WE.prototype.__find__=function(e){for(var t=this.__rules__.length,n=-1;t--;)if(this.__rules__[++n].name===e)return n;return-1},WE.prototype.__compile__=function(){var e=this,t=[""];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},WE.prototype.at=function(e,t,n){var r=this.__find__(e),i=n||{};if(-1===r)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null},WE.prototype.before=function(e,t,n,r){var i=this.__find__(e),o=r||{};if(-1===i)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},WE.prototype.after=function(e,t,n,r){var i=this.__find__(e),o=r||{};if(-1===i)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},WE.prototype.push=function(e,t,n){var r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},WE.prototype.enable=function(e,t){e=Array.isArray(e)?e:[e],t&&this.__rules__.forEach(function(e){e.enabled=!1}),e.forEach(function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!0},this),this.__cache__=null},WE.prototype.disable=function(e){(e=Array.isArray(e)?e:[e]).forEach(function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!1},this),this.__cache__=null},WE.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},QE.prototype.pushPending=function(){this.tokens.push({type:"text",content:this.pending,level:this.pendingLevel}),this.pending=""},QE.prototype.push=function(e){this.pending&&this.pushPending(),this.tokens.push(e),this.pendingLevel=this.level},QE.prototype.cacheSet=function(e,t){for(var n=this.cache.length;n<=e;n++)this.cache.push(0);this.cache[e]=t},QE.prototype.cacheGet=function(e){return e<this.cache.length?this.cache[e]:0};var nk=" \n()[]'\".,!?-";function rk(e){return e.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1")}var ik=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,ok=/\((c|tm|r|p)\)/gi,ak={c:"©",r:"®",p:"§",tm:"™"};function sk(e){return e.indexOf("(")<0?e:e.replace(ok,function(e,t){return ak[t.toLowerCase()]})}var lk=/['"]/,ck=/['"]/g,uk=/[-\s()\[\]]/;function dk(e,t){return!(t<0||t>=e.length)&&!uk.test(e[t])}function pk(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}var hk=[["block",function(e){e.inlineMode?e.tokens.push({type:"inline",content:e.src.replace(/\n/g," ").trim(),level:0,lines:[0,1],children:[]}):e.block.parse(e.src,e.options,e.env,e.tokens)}],["abbr",function(e){var t,n,r,i,o=e.tokens;if(!e.inlineMode)for(t=1,n=o.length-1;t<n;t++)if("paragraph_open"===o[t-1].type&&"inline"===o[t].type&&"paragraph_close"===o[t+1].type){for(r=o[t].content;r.length&&!((i=JE(r,e.inline,e.options,e.env))<0);)r=r.slice(i).trim();o[t].content=r,r.length||(o[t-1].tight=!0,o[t+1].tight=!0)}}],["references",function(e){var t,n,r,i,o=e.tokens;if(e.env.references=e.env.references||{},!e.inlineMode)for(t=1,n=o.length-1;t<n;t++)if("inline"===o[t].type&&"paragraph_open"===o[t-1].type&&"paragraph_close"===o[t+1].type){for(r=o[t].content;r.length&&!((i=tk(r,e.inline,e.options,e.env))<0);)r=r.slice(i).trim();o[t].content=r,r.length||(o[t-1].tight=!0,o[t+1].tight=!0)}}],["inline",function(e){var t,n,r,i=e.tokens;for(n=0,r=i.length;n<r;n++)"inline"===(t=i[n]).type&&e.inline.parse(t.content,e.options,e.env,t.children)}],["footnote_tail",function(e){var t,n,r,i,o,a,s,l,c,u=0,d=!1,p={};if(e.env.footnotes&&(e.tokens=e.tokens.filter(function(e){return"footnote_reference_open"===e.type?(d=!0,l=[],c=e.label,!1):"footnote_reference_close"===e.type?(d=!1,p[":"+c]=l,!1):(d&&l.push(e),!d)}),e.env.footnotes.list)){for(a=e.env.footnotes.list,e.tokens.push({type:"footnote_block_open",level:u++}),t=0,n=a.length;t<n;t++){for(e.tokens.push({type:"footnote_open",id:t,level:u++}),a[t].tokens?((s=[]).push({type:"paragraph_open",tight:!1,level:u++}),s.push({type:"inline",content:"",level:u,children:a[t].tokens}),s.push({type:"paragraph_close",tight:!1,level:--u})):a[t].label&&(s=p[":"+a[t].label]),e.tokens=e.tokens.concat(s),o="paragraph_close"===e.tokens[e.tokens.length-1].type?e.tokens.pop():null,i=a[t].count>0?a[t].count:1,r=0;r<i;r++)e.tokens.push({type:"footnote_anchor",id:t,subId:r,level:u});o&&e.tokens.push(o),e.tokens.push({type:"footnote_close",level:--u})}e.tokens.push({type:"footnote_block_close",level:--u})}}],["abbr2",function(e){var t,n,r,i,o,a,s,l,c,u,d,p,h=e.tokens;if(e.env.abbreviations)for(e.env.abbrRegExp||(p="(^|["+nk.split("").map(rk).join("")+"])("+Object.keys(e.env.abbreviations).map(function(e){return e.substr(1)}).sort(function(e,t){return t.length-e.length}).map(rk).join("|")+")($|["+nk.split("").map(rk).join("")+"])",e.env.abbrRegExp=new RegExp(p,"g")),u=e.env.abbrRegExp,n=0,r=h.length;n<r;n++)if("inline"===h[n].type)for(t=(i=h[n].children).length-1;t>=0;t--)if("text"===(o=i[t]).type){for(l=0,a=o.content,u.lastIndex=0,c=o.level,s=[];d=u.exec(a);)u.lastIndex>l&&s.push({type:"text",content:a.slice(l,d.index+d[1].length),level:c}),s.push({type:"abbr_open",title:e.env.abbreviations[":"+d[2]],level:c++}),s.push({type:"text",content:d[2],level:c}),s.push({type:"abbr_close",level:--c}),l=u.lastIndex-d[3].length;s.length&&(l<a.length&&s.push({type:"text",content:a.slice(l),level:c}),h[n].children=i=[].concat(i.slice(0,t),s,i.slice(t+1)))}}],["replacements",function(e){var t,n,r,i,o;if(e.options.typographer)for(o=e.tokens.length-1;o>=0;o--)if("inline"===e.tokens[o].type)for(t=(i=e.tokens[o].children).length-1;t>=0;t--)"text"===(n=i[t]).type&&(r=sk(r=n.content),ik.test(r)&&(r=r.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),n.content=r)}],["smartquotes",function(e){var t,n,r,i,o,a,s,l,c,u,d,p,h,f,m,g,y;if(e.options.typographer)for(y=[],m=e.tokens.length-1;m>=0;m--)if("inline"===e.tokens[m].type)for(g=e.tokens[m].children,y.length=0,t=0;t<g.length;t++)if("text"===(n=g[t]).type&&!lk.test(n.text)){for(s=g[t].level,h=y.length-1;h>=0&&!(y[h].level<=s);h--);y.length=h+1,o=0,a=(r=n.content).length;e:for(;o<a&&(ck.lastIndex=o,i=ck.exec(r));)if(l=!dk(r,i.index-1),o=i.index+1,f="'"===i[0],(c=!dk(r,o))||l){if(d=!c,p=!l)for(h=y.length-1;h>=0&&(u=y[h],!(y[h].level<s));h--)if(u.single===f&&y[h].level===s){u=y[h],f?(g[u.token].content=pk(g[u.token].content,u.pos,e.options.quotes[2]),n.content=pk(n.content,i.index,e.options.quotes[3])):(g[u.token].content=pk(g[u.token].content,u.pos,e.options.quotes[0]),n.content=pk(n.content,i.index,e.options.quotes[1])),y.length=h;continue e}d?y.push({token:t,pos:i.index,single:f,level:s}):p&&f&&(n.content=pk(n.content,i.index,"’"))}else f&&(n.content=pk(n.content,i.index,"’"))}}]];function fk(){this.options={},this.ruler=new WE;for(var e=0;e<hk.length;e++)this.ruler.push(hk[e][0],hk[e][1])}function mk(e,t,n,r,i){var o,a,s,l,c,u,d;for(this.src=e,this.parser=t,this.options=n,this.env=r,this.tokens=i,this.bMarks=[],this.eMarks=[],this.tShift=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType="root",this.ddIndent=-1,this.level=0,this.result="",u=0,d=!1,s=l=u=0,c=(a=this.src).length;l<c;l++){if(o=a.charCodeAt(l),!d){if(32===o){u++;continue}d=!0}10!==o&&l!==c-1||(10!==o&&l++,this.bMarks.push(s),this.eMarks.push(l),this.tShift.push(u),d=!1,u=0,s=l+1)}this.bMarks.push(a.length),this.eMarks.push(a.length),this.tShift.push(0),this.lineMax=this.bMarks.length-1}function gk(e,t){var n,r,i;return(r=e.bMarks[t]+e.tShift[t])>=(i=e.eMarks[t])||42!==(n=e.src.charCodeAt(r++))&&45!==n&&43!==n||r<i&&32!==e.src.charCodeAt(r)?-1:r}function yk(e,t){var n,r=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(r+1>=i)return-1;if((n=e.src.charCodeAt(r++))<48||n>57)return-1;for(;;){if(r>=i)return-1;if(!((n=e.src.charCodeAt(r++))>=48&&n<=57)){if(41===n||46===n)break;return-1}}return r<i&&32!==e.src.charCodeAt(r)?-1:r}fk.prototype.process=function(e){var t,n,r;for(t=0,n=(r=this.ruler.getRules("")).length;t<n;t++)r[t](e)},mk.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},mk.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},mk.prototype.skipSpaces=function(e){for(var t=this.src.length;e<t&&32===this.src.charCodeAt(e);e++);return e},mk.prototype.skipChars=function(e,t){for(var n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},mk.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},mk.prototype.getLines=function(e,t,n,r){var i,o,a,s,l,c=e;if(e>=t)return"";if(c+1===t)return o=this.bMarks[c]+Math.min(this.tShift[c],n),a=r?this.eMarks[c]+1:this.eMarks[c],this.src.slice(o,a);for(s=new Array(t-e),i=0;c<t;c++,i++)(l=this.tShift[c])>n&&(l=n),l<0&&(l=0),o=this.bMarks[c]+l,a=c+1<t||r?this.eMarks[c]+1:this.eMarks[c],s[i]=this.src.slice(o,a);return s.join("")};var Ak={};["article","aside","button","blockquote","body","canvas","caption","col","colgroup","dd","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","iframe","li","map","object","ol","output","p","pre","progress","script","section","style","table","tbody","td","textarea","tfoot","th","tr","thead","ul","video"].forEach(function(e){Ak[e]=!0});var vk=/^<([a-zA-Z]{1,15})[\s\/>]/,bk=/^<\/([a-zA-Z]{1,15})[\s>]/;function wk(e,t){var n=e.bMarks[t]+e.blkIndent,r=e.eMarks[t];return e.src.substr(n,r-n)}function Ek(e,t){var n,r,i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return i>=o||126!==(r=e.src.charCodeAt(i++))&&58!==r||i===(n=e.skipSpaces(i))||n>=o?-1:n}var kk=[["code",function(e,t,n){var r,i;if(e.tShift[t]-e.blkIndent<4)return!1;for(i=r=t+1;r<n;)if(e.isEmpty(r))r++;else{if(!(e.tShift[r]-e.blkIndent>=4))break;i=++r}return e.line=r,e.tokens.push({type:"code",content:e.getLines(t,i,4+e.blkIndent,!0),block:!0,lines:[t,e.line],level:e.level}),!0}],["fences",function(e,t,n,r){var i,o,a,s,l,c=!1,u=e.bMarks[t]+e.tShift[t],d=e.eMarks[t];if(u+3>d)return!1;if(126!==(i=e.src.charCodeAt(u))&&96!==i)return!1;if(l=u,(o=(u=e.skipChars(u,i))-l)<3)return!1;if((a=e.src.slice(u,d).trim()).indexOf("`")>=0)return!1;if(r)return!0;for(s=t;!(++s>=n)&&!((u=l=e.bMarks[s]+e.tShift[s])<(d=e.eMarks[s])&&e.tShift[s]<e.blkIndent);)if(e.src.charCodeAt(u)===i&&!(e.tShift[s]-e.blkIndent>=4||(u=e.skipChars(u,i))-l<o||(u=e.skipSpaces(u))<d)){c=!0;break}return o=e.tShift[t],e.line=s+(c?1:0),e.tokens.push({type:"fence",params:a,content:e.getLines(t+1,s,o,!0),lines:[t,e.line],level:e.level}),!0},["paragraph","blockquote","list"]],["blockquote",function(e,t,n,r){var i,o,a,s,l,c,u,d,p,h,f,m=e.bMarks[t]+e.tShift[t],g=e.eMarks[t];if(m>g)return!1;if(62!==e.src.charCodeAt(m++))return!1;if(e.level>=e.options.maxNesting)return!1;if(r)return!0;for(32===e.src.charCodeAt(m)&&m++,l=e.blkIndent,e.blkIndent=0,s=[e.bMarks[t]],e.bMarks[t]=m,o=(m=m<g?e.skipSpaces(m):m)>=g,a=[e.tShift[t]],e.tShift[t]=m-e.bMarks[t],d=e.parser.ruler.getRules("blockquote"),i=t+1;i<n&&!((m=e.bMarks[i]+e.tShift[i])>=(g=e.eMarks[i]));i++)if(62!==e.src.charCodeAt(m++)){if(o)break;for(f=!1,p=0,h=d.length;p<h;p++)if(d[p](e,i,n,!0)){f=!0;break}if(f)break;s.push(e.bMarks[i]),a.push(e.tShift[i]),e.tShift[i]=-1337}else 32===e.src.charCodeAt(m)&&m++,s.push(e.bMarks[i]),e.bMarks[i]=m,o=(m=m<g?e.skipSpaces(m):m)>=g,a.push(e.tShift[i]),e.tShift[i]=m-e.bMarks[i];for(c=e.parentType,e.parentType="blockquote",e.tokens.push({type:"blockquote_open",lines:u=[t,0],level:e.level++}),e.parser.tokenize(e,t,i),e.tokens.push({type:"blockquote_close",level:--e.level}),e.parentType=c,u[1]=e.line,p=0;p<a.length;p++)e.bMarks[p+t]=s[p],e.tShift[p+t]=a[p];return e.blkIndent=l,!0},["paragraph","blockquote","list"]],["hr",function(e,t,n,r){var i,o,a,s=e.bMarks[t],l=e.eMarks[t];if((s+=e.tShift[t])>l)return!1;if(42!==(i=e.src.charCodeAt(s++))&&45!==i&&95!==i)return!1;for(o=1;s<l;){if((a=e.src.charCodeAt(s++))!==i&&32!==a)return!1;a===i&&o++}return!(o<3)&&(r||(e.line=t+1,e.tokens.push({type:"hr",lines:[t,e.line],level:e.level})),!0)},["paragraph","blockquote","list"]],["list",function(e,t,n,r){var i,o,a,s,l,c,u,d,p,h,f,m,g,y,A,v,b,w,E,k,C,_=!0;if((d=yk(e,t))>=0)m=!0;else{if(!((d=gk(e,t))>=0))return!1;m=!1}if(e.level>=e.options.maxNesting)return!1;if(f=e.src.charCodeAt(d-1),r)return!0;for(y=e.tokens.length,m?(u=e.bMarks[t]+e.tShift[t],h=Number(e.src.substr(u,d-u-1)),e.tokens.push({type:"ordered_list_open",order:h,lines:v=[t,0],level:e.level++})):e.tokens.push({type:"bullet_list_open",lines:v=[t,0],level:e.level++}),i=t,A=!1,w=e.parser.ruler.getRules("list");!(!(i<n)||((p=(g=e.skipSpaces(d))>=e.eMarks[i]?1:g-d)>4&&(p=1),p<1&&(p=1),o=d-e.bMarks[i]+p,e.tokens.push({type:"list_item_open",lines:b=[t,0],level:e.level++}),s=e.blkIndent,l=e.tight,a=e.tShift[t],c=e.parentType,e.tShift[t]=g-e.bMarks[t],e.blkIndent=o,e.tight=!0,e.parentType="list",e.parser.tokenize(e,t,n,!0),e.tight&&!A||(_=!1),A=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=s,e.tShift[t]=a,e.tight=l,e.parentType=c,e.tokens.push({type:"list_item_close",level:--e.level}),i=t=e.line,b[1]=i,g=e.bMarks[t],i>=n)||e.isEmpty(i)||e.tShift[i]<e.blkIndent);){for(C=!1,E=0,k=w.length;E<k;E++)if(w[E](e,i,n,!0)){C=!0;break}if(C)break;if(m){if((d=yk(e,i))<0)break}else if((d=gk(e,i))<0)break;if(f!==e.src.charCodeAt(d-1))break}return e.tokens.push({type:m?"ordered_list_close":"bullet_list_close",level:--e.level}),v[1]=i,e.line=i,_&&function(e,t){var n,r,i=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===i&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}(e,y),!0},["paragraph","blockquote"]],["footnote",function(e,t,n,r){var i,o,a,s,l,c=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(c+4>u)return!1;if(91!==e.src.charCodeAt(c))return!1;if(94!==e.src.charCodeAt(c+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(s=c+2;s<u;s++){if(32===e.src.charCodeAt(s))return!1;if(93===e.src.charCodeAt(s))break}return s!==c+2&&(!(s+1>=u||58!==e.src.charCodeAt(++s))&&(r||(s++,e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.refs||(e.env.footnotes.refs={}),l=e.src.slice(c+2,s-2),e.env.footnotes.refs[":"+l]=-1,e.tokens.push({type:"footnote_reference_open",label:l,level:e.level++}),i=e.bMarks[t],o=e.tShift[t],a=e.parentType,e.tShift[t]=e.skipSpaces(s)-s,e.bMarks[t]=s,e.blkIndent+=4,e.parentType="footnote",e.tShift[t]<e.blkIndent&&(e.tShift[t]+=e.blkIndent,e.bMarks[t]-=e.blkIndent),e.parser.tokenize(e,t,n,!0),e.parentType=a,e.blkIndent-=4,e.tShift[t]=o,e.bMarks[t]=i,e.tokens.push({type:"footnote_reference_close",level:--e.level})),!0))},["paragraph"]],["heading",function(e,t,n,r){var i,o,a,s=e.bMarks[t]+e.tShift[t],l=e.eMarks[t];if(s>=l)return!1;if(35!==(i=e.src.charCodeAt(s))||s>=l)return!1;for(o=1,i=e.src.charCodeAt(++s);35===i&&s<l&&o<=6;)o++,i=e.src.charCodeAt(++s);return!(o>6||s<l&&32!==i)&&(r||(l=e.skipCharsBack(l,32,s),(a=e.skipCharsBack(l,35,s))>s&&32===e.src.charCodeAt(a-1)&&(l=a),e.line=t+1,e.tokens.push({type:"heading_open",hLevel:o,lines:[t,e.line],level:e.level}),s<l&&e.tokens.push({type:"inline",content:e.src.slice(s,l).trim(),level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"heading_close",hLevel:o,level:e.level})),!0)},["paragraph","blockquote"]],["lheading",function(e,t,n){var r,i,o,a=t+1;return!(a>=n)&&(!(e.tShift[a]<e.blkIndent)&&(!(e.tShift[a]-e.blkIndent>3)&&(!((i=e.bMarks[a]+e.tShift[a])>=(o=e.eMarks[a]))&&((45===(r=e.src.charCodeAt(i))||61===r)&&(i=e.skipChars(i,r),!((i=e.skipSpaces(i))<o)&&(i=e.bMarks[t]+e.tShift[t],e.line=a+1,e.tokens.push({type:"heading_open",hLevel:61===r?1:2,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:e.src.slice(i,e.eMarks[t]).trim(),level:e.level+1,lines:[t,e.line-1],children:[]}),e.tokens.push({type:"heading_close",hLevel:61===r?1:2,level:e.level}),!0))))))}],["htmlblock",function(e,t,n,r){var i,o,a,s=e.bMarks[t],l=e.eMarks[t],c=e.tShift[t];if(s+=c,!e.options.html)return!1;if(c>3||s+2>=l)return!1;if(60!==e.src.charCodeAt(s))return!1;if(33===(i=e.src.charCodeAt(s+1))||63===i){if(r)return!0}else{if(47!==i&&!function(e){var t=32|e;return t>=97&&t<=122}(i))return!1;if(47===i){if(!(o=e.src.slice(s,l).match(bk)))return!1}else if(!(o=e.src.slice(s,l).match(vk)))return!1;if(!0!==Ak[o[1].toLowerCase()])return!1;if(r)return!0}for(a=t+1;a<e.lineMax&&!e.isEmpty(a);)a++;return e.line=a,e.tokens.push({type:"htmlblock",level:e.level,lines:[t,e.line],content:e.getLines(t,a,0,!0)}),!0},["paragraph","blockquote"]],["table",function(e,t,n,r){var i,o,a,s,l,c,u,d,p,h,f;if(t+2>n)return!1;if(l=t+1,e.tShift[l]<e.blkIndent)return!1;if((a=e.bMarks[l]+e.tShift[l])>=e.eMarks[l])return!1;if(124!==(i=e.src.charCodeAt(a))&&45!==i&&58!==i)return!1;if(o=wk(e,t+1),!/^[-:| ]+$/.test(o))return!1;if((c=o.split("|"))<=2)return!1;for(d=[],s=0;s<c.length;s++){if(!(p=c[s].trim())){if(0===s||s===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(p))return!1;58===p.charCodeAt(p.length-1)?d.push(58===p.charCodeAt(0)?"center":"right"):58===p.charCodeAt(0)?d.push("left"):d.push("")}if(-1===(o=wk(e,t).trim()).indexOf("|"))return!1;if(c=o.replace(/^\||\|$/g,"").split("|"),d.length!==c.length)return!1;if(r)return!0;for(e.tokens.push({type:"table_open",lines:h=[t,0],level:e.level++}),e.tokens.push({type:"thead_open",lines:[t,t+1],level:e.level++}),e.tokens.push({type:"tr_open",lines:[t,t+1],level:e.level++}),s=0;s<c.length;s++)e.tokens.push({type:"th_open",align:d[s],lines:[t,t+1],level:e.level++}),e.tokens.push({type:"inline",content:c[s].trim(),lines:[t,t+1],level:e.level,children:[]}),e.tokens.push({type:"th_close",level:--e.level});for(e.tokens.push({type:"tr_close",level:--e.level}),e.tokens.push({type:"thead_close",level:--e.level}),e.tokens.push({type:"tbody_open",lines:f=[t+2,0],level:e.level++}),l=t+2;l<n&&!(e.tShift[l]<e.blkIndent)&&-1!==(o=wk(e,l).trim()).indexOf("|");l++){for(c=o.replace(/^\||\|$/g,"").split("|"),e.tokens.push({type:"tr_open",level:e.level++}),s=0;s<c.length;s++)e.tokens.push({type:"td_open",align:d[s],level:e.level++}),u=c[s].substring(124===c[s].charCodeAt(0)?1:0,124===c[s].charCodeAt(c[s].length-1)?c[s].length-1:c[s].length).trim(),e.tokens.push({type:"inline",content:u,level:e.level,children:[]}),e.tokens.push({type:"td_close",level:--e.level});e.tokens.push({type:"tr_close",level:--e.level})}return e.tokens.push({type:"tbody_close",level:--e.level}),e.tokens.push({type:"table_close",level:--e.level}),h[1]=f[1]=l,e.line=l,!0},["paragraph"]],["deflist",function(e,t,n,r){var i,o,a,s,l,c,u,d,p,h,f,m,g,y;if(r)return!(e.ddIndent<0)&&Ek(e,t)>=0;if(u=t+1,e.isEmpty(u)&&++u>n)return!1;if(e.tShift[u]<e.blkIndent)return!1;if((i=Ek(e,u))<0)return!1;if(e.level>=e.options.maxNesting)return!1;c=e.tokens.length,e.tokens.push({type:"dl_open",lines:l=[t,0],level:e.level++}),a=t,o=u;e:for(;;){for(y=!0,g=!1,e.tokens.push({type:"dt_open",lines:[a,a],level:e.level++}),e.tokens.push({type:"inline",content:e.getLines(a,a+1,e.blkIndent,!1).trim(),level:e.level+1,lines:[a,a],children:[]}),e.tokens.push({type:"dt_close",level:--e.level});;){if(e.tokens.push({type:"dd_open",lines:s=[u,0],level:e.level++}),m=e.tight,p=e.ddIndent,d=e.blkIndent,f=e.tShift[o],h=e.parentType,e.blkIndent=e.ddIndent=e.tShift[o]+2,e.tShift[o]=i-e.bMarks[o],e.tight=!0,e.parentType="deflist",e.parser.tokenize(e,o,n,!0),e.tight&&!g||(y=!1),g=e.line-o>1&&e.isEmpty(e.line-1),e.tShift[o]=f,e.tight=m,e.parentType=h,e.blkIndent=d,e.ddIndent=p,e.tokens.push({type:"dd_close",level:--e.level}),s[1]=u=e.line,u>=n)break e;if(e.tShift[u]<e.blkIndent)break e;if((i=Ek(e,u))<0)break;o=u}if(u>=n)break;if(a=u,e.isEmpty(a))break;if(e.tShift[a]<e.blkIndent)break;if((o=a+1)>=n)break;if(e.isEmpty(o)&&o++,o>=n)break;if(e.tShift[o]<e.blkIndent)break;if((i=Ek(e,o))<0)break}return e.tokens.push({type:"dl_close",level:--e.level}),l[1]=u,e.line=u,y&&function(e,t){var n,r,i=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===i&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}(e,c),!0},["paragraph"]],["paragraph",function(e,t){var n,r,i,o,a,s,l=t+1;if(l<(n=e.lineMax)&&!e.isEmpty(l))for(s=e.parser.ruler.getRules("paragraph");l<n&&!e.isEmpty(l);l++)if(!(e.tShift[l]-e.blkIndent>3)){for(i=!1,o=0,a=s.length;o<a;o++)if(s[o](e,l,n,!0)){i=!0;break}if(i)break}return r=e.getLines(t,l,e.blkIndent,!1).trim(),e.line=l,r.length&&(e.tokens.push({type:"paragraph_open",tight:!1,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:r,level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"paragraph_close",tight:!1,level:e.level})),!0}]];function Ck(){this.ruler=new WE;for(var e=0;e<kk.length;e++)this.ruler.push(kk[e][0],kk[e][1],{alt:(kk[e][2]||[]).slice()})}Ck.prototype.tokenize=function(e,t,n){for(var r,i=this.ruler.getRules(""),o=i.length,a=t,s=!1;a<n&&(e.line=a=e.skipEmptyLines(a),!(a>=n))&&!(e.tShift[a]<e.blkIndent);){for(r=0;r<o&&!i[r](e,a,n,!1);r++);if(e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),(a=e.line)<n&&e.isEmpty(a)){if(s=!0,++a<n&&"list"===e.parentType&&e.isEmpty(a))break;e.line=a}}};var _k=/[\n\t]/g,Mk=/\r[\n\u0085]|[\u2424\u2028\u0085]/g,Tk=/\u00a0/g;function Sk(e){switch(e){case 10:case 92:case 96:case 42:case 95:case 94:case 91:case 93:case 33:case 38:case 60:case 62:case 123:case 125:case 36:case 37:case 64:case 126:case 43:case 61:case 58:return!0;default:return!1}}Ck.prototype.parse=function(e,t,n,r){var i,o=0,a=0;if(!e)return[];(e=(e=e.replace(Tk," ")).replace(Mk,"\n")).indexOf("\t")>=0&&(e=e.replace(_k,function(t,n){var r;return 10===e.charCodeAt(n)?(o=n+1,a=0,t):(r=" ".slice((n-o-a)%4),a=n-o+1,r)})),i=new mk(e,this,t,n,r),this.tokenize(i,i.line,i.lineMax)};for(var Dk=[],xk=0;xk<256;xk++)Dk.push(0);function Ik(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function Lk(e,t){var n,r,i,o=t,a=!0,s=!0,l=e.posMax,c=e.src.charCodeAt(t);for(n=t>0?e.src.charCodeAt(t-1):-1;o<l&&e.src.charCodeAt(o)===c;)o++;return o>=l&&(a=!1),(i=o-t)>=4?a=s=!1:(32!==(r=o<l?e.src.charCodeAt(o):-1)&&10!==r||(a=!1),32!==n&&10!==n||(s=!1),95===c&&(Ik(n)&&(a=!1),Ik(r)&&(s=!1))),{can_open:a,can_close:s,delims:i}}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){Dk[e.charCodeAt(0)]=1});var Pk=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;var Ok=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;var Rk=["coap","doi","javascript","aaa","aaas","about","acap","cap","cid","crid","data","dav","dict","dns","file","ftp","geo","go","gopher","h323","http","https","iax","icap","im","imap","info","ipp","iris","iris.beep","iris.xpc","iris.xpcs","iris.lwz","ldap","mailto","mid","msrp","msrps","mtqp","mupdate","news","nfs","ni","nih","nntp","opaquelocktoken","pop","pres","rtsp","service","session","shttp","sieve","sip","sips","sms","snmp","soap.beep","soap.beeps","tag","tel","telnet","tftp","thismessage","tn3270","tip","tv","urn","vemmi","ws","wss","xcon","xcon-userid","xmlrpc.beep","xmlrpc.beeps","xmpp","z39.50r","z39.50s","adiumxtra","afp","afs","aim","apt","attachment","aw","beshare","bitcoin","bolo","callto","chrome","chrome-extension","com-eventbrite-attendee","content","cvs","dlna-playsingle","dlna-playcontainer","dtn","dvb","ed2k","facetime","feed","finger","fish","gg","git","gizmoproject","gtalk","hcp","icon","ipn","irc","irc6","ircs","itms","jar","jms","keyparc","lastfm","ldaps","magnet","maps","market","message","mms","ms-help","msnim","mumble","mvn","notes","oid","palm","paparazzi","platform","proxy","psyc","query","res","resource","rmi","rsync","rtmp","secondlife","sftp","sgn","skype","smb","soldat","spotify","ssh","steam","svn","teamspeak","things","udp","unreal","ut2004","ventrilo","view-source","webcal","wtai","wyciwyg","xfire","xri","ymsgr"],Bk=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,Yk=/^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;function Nk(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,e=e.replace(r,i),n):new RegExp(e,t)}}var Vk=Nk(/(?:unquoted|single_quoted|double_quoted)/)("unquoted",/[^"'=<>`\x00-\x20]+/)("single_quoted",/'[^']*'/)("double_quoted",/"[^"]*"/)(),Fk=Nk(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name",/[a-zA-Z_:][a-zA-Z0-9:._-]*/)("attr_value",Vk)(),jk=Nk(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute",Fk)(),Hk=Nk(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",jk)("close_tag",/<\/[A-Za-z][A-Za-z0-9]*\s*>/)("comment",/<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/)("processing",/<[?].*?[?]>/)("declaration",/<![A-Z]+\s+[^>]*>/)("cdata",/<!\[CDATA\[[\s\S]*?\]\]>/)();var qk=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,Gk=/^&([a-z][a-z0-9]{1,31});/i;var zk=[["text",function(e,t){for(var n=e.pos;n<e.posMax&&!Sk(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}],["newline",function(e,t){var n,r,i=e.pos;if(10!==e.src.charCodeAt(i))return!1;if(n=e.pending.length-1,r=e.posMax,!t)if(n>=0&&32===e.pending.charCodeAt(n))if(n>=1&&32===e.pending.charCodeAt(n-1)){for(var o=n-2;o>=0;o--)if(32!==e.pending.charCodeAt(o)){e.pending=e.pending.substring(0,o+1);break}e.push({type:"hardbreak",level:e.level})}else e.pending=e.pending.slice(0,-1),e.push({type:"softbreak",level:e.level});else e.push({type:"softbreak",level:e.level});for(i++;i<r&&32===e.src.charCodeAt(i);)i++;return e.pos=i,!0}],["escape",function(e,t){var n,r=e.pos,i=e.posMax;if(92!==e.src.charCodeAt(r))return!1;if(++r<i){if((n=e.src.charCodeAt(r))<256&&0!==Dk[n])return t||(e.pending+=e.src[r]),e.pos+=2,!0;if(10===n){for(t||e.push({type:"hardbreak",level:e.level}),r++;r<i&&32===e.src.charCodeAt(r);)r++;return e.pos=r,!0}}return t||(e.pending+="\\"),e.pos++,!0}],["backticks",function(e,t){var n,r,i,o,a,s=e.pos;if(96!==e.src.charCodeAt(s))return!1;for(n=s,s++,r=e.posMax;s<r&&96===e.src.charCodeAt(s);)s++;for(i=e.src.slice(n,s),o=a=s;-1!==(o=e.src.indexOf("`",a));){for(a=o+1;a<r&&96===e.src.charCodeAt(a);)a++;if(a-o===i.length)return t||e.push({type:"code",content:e.src.slice(s,o).replace(/[ \n]+/g," ").trim(),block:!1,level:e.level}),e.pos=a,!0}return t||(e.pending+=i),e.pos+=i.length,!0}],["del",function(e,t){var n,r,i,o,a,s=e.posMax,l=e.pos;if(126!==e.src.charCodeAt(l))return!1;if(t)return!1;if(l+4>=s)return!1;if(126!==e.src.charCodeAt(l+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(o=l>0?e.src.charCodeAt(l-1):-1,a=e.src.charCodeAt(l+2),126===o)return!1;if(126===a)return!1;if(32===a||10===a)return!1;for(r=l+2;r<s&&126===e.src.charCodeAt(r);)r++;if(r>l+3)return e.pos+=r-l,t||(e.pending+=e.src.slice(l,r)),!0;for(e.pos=l+2,i=1;e.pos+1<s;){if(126===e.src.charCodeAt(e.pos)&&126===e.src.charCodeAt(e.pos+1)&&(o=e.src.charCodeAt(e.pos-1),126!==(a=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&126!==o&&(32!==o&&10!==o?i--:32!==a&&10!==a&&i++,i<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=l+2,t||(e.push({type:"del_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"del_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=l,!1)}],["ins",function(e,t){var n,r,i,o,a,s=e.posMax,l=e.pos;if(43!==e.src.charCodeAt(l))return!1;if(t)return!1;if(l+4>=s)return!1;if(43!==e.src.charCodeAt(l+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(o=l>0?e.src.charCodeAt(l-1):-1,a=e.src.charCodeAt(l+2),43===o)return!1;if(43===a)return!1;if(32===a||10===a)return!1;for(r=l+2;r<s&&43===e.src.charCodeAt(r);)r++;if(r!==l+2)return e.pos+=r-l,t||(e.pending+=e.src.slice(l,r)),!0;for(e.pos=l+2,i=1;e.pos+1<s;){if(43===e.src.charCodeAt(e.pos)&&43===e.src.charCodeAt(e.pos+1)&&(o=e.src.charCodeAt(e.pos-1),43!==(a=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&43!==o&&(32!==o&&10!==o?i--:32!==a&&10!==a&&i++,i<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=l+2,t||(e.push({type:"ins_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"ins_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=l,!1)}],["mark",function(e,t){var n,r,i,o,a,s=e.posMax,l=e.pos;if(61!==e.src.charCodeAt(l))return!1;if(t)return!1;if(l+4>=s)return!1;if(61!==e.src.charCodeAt(l+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(o=l>0?e.src.charCodeAt(l-1):-1,a=e.src.charCodeAt(l+2),61===o)return!1;if(61===a)return!1;if(32===a||10===a)return!1;for(r=l+2;r<s&&61===e.src.charCodeAt(r);)r++;if(r!==l+2)return e.pos+=r-l,t||(e.pending+=e.src.slice(l,r)),!0;for(e.pos=l+2,i=1;e.pos+1<s;){if(61===e.src.charCodeAt(e.pos)&&61===e.src.charCodeAt(e.pos+1)&&(o=e.src.charCodeAt(e.pos-1),61!==(a=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&61!==o&&(32!==o&&10!==o?i--:32!==a&&10!==a&&i++,i<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=l+2,t||(e.push({type:"mark_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"mark_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=l,!1)}],["emphasis",function(e,t){var n,r,i,o,a,s,l,c=e.posMax,u=e.pos,d=e.src.charCodeAt(u);if(95!==d&&42!==d)return!1;if(t)return!1;if(n=(l=Lk(e,u)).delims,!l.can_open)return e.pos+=n,t||(e.pending+=e.src.slice(u,e.pos)),!0;if(e.level>=e.options.maxNesting)return!1;for(e.pos=u+n,s=[n];e.pos<c;)if(e.src.charCodeAt(e.pos)!==d)e.parser.skipToken(e);else{if(r=(l=Lk(e,e.pos)).delims,l.can_close){for(o=s.pop(),a=r;o!==a;){if(a<o){s.push(o-a);break}if(a-=o,0===s.length)break;e.pos+=o,o=s.pop()}if(0===s.length){n=o,i=!0;break}e.pos+=r;continue}l.can_open&&s.push(r),e.pos+=r}return i?(e.posMax=e.pos,e.pos=u+n,t||(2!==n&&3!==n||e.push({type:"strong_open",level:e.level++}),1!==n&&3!==n||e.push({type:"em_open",level:e.level++}),e.parser.tokenize(e),1!==n&&3!==n||e.push({type:"em_close",level:--e.level}),2!==n&&3!==n||e.push({type:"strong_close",level:--e.level})),e.pos=e.posMax+n,e.posMax=c,!0):(e.pos=u,!1)}],["sub",function(e,t){var n,r,i=e.posMax,o=e.pos;if(126!==e.src.charCodeAt(o))return!1;if(t)return!1;if(o+2>=i)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=o+1;e.pos<i;){if(126===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&o+1!==e.pos?(r=e.src.slice(o+1,e.pos)).match(/(^|[^\\])(\\\\)*\s/)?(e.pos=o,!1):(e.posMax=e.pos,e.pos=o+1,t||e.push({type:"sub",level:e.level,content:r.replace(Pk,"$1")}),e.pos=e.posMax+1,e.posMax=i,!0):(e.pos=o,!1)}],["sup",function(e,t){var n,r,i=e.posMax,o=e.pos;if(94!==e.src.charCodeAt(o))return!1;if(t)return!1;if(o+2>=i)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=o+1;e.pos<i;){if(94===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&o+1!==e.pos?(r=e.src.slice(o+1,e.pos)).match(/(^|[^\\])(\\\\)*\s/)?(e.pos=o,!1):(e.posMax=e.pos,e.pos=o+1,t||e.push({type:"sup",level:e.level,content:r.replace(Ok,"$1")}),e.pos=e.posMax+1,e.posMax=i,!0):(e.pos=o,!1)}],["links",function(e,t){var n,r,i,o,a,s,l,c,u=!1,d=e.pos,p=e.posMax,h=e.pos,f=e.src.charCodeAt(h);if(33===f&&(u=!0,f=e.src.charCodeAt(++h)),91!==f)return!1;if(e.level>=e.options.maxNesting)return!1;if(n=h+1,(r=ZE(e,h))<0)return!1;if((s=r+1)<p&&40===e.src.charCodeAt(s)){for(s++;s<p&&(32===(c=e.src.charCodeAt(s))||10===c);s++);if(s>=p)return!1;for(h=s,XE(e,s)?(o=e.linkContent,s=e.pos):o="",h=s;s<p&&(32===(c=e.src.charCodeAt(s))||10===c);s++);if(s<p&&h!==s&&$E(e,s))for(a=e.linkContent,s=e.pos;s<p&&(32===(c=e.src.charCodeAt(s))||10===c);s++);else a="";if(s>=p||41!==e.src.charCodeAt(s))return e.pos=d,!1;s++}else{if(e.linkLevel>0)return!1;for(;s<p&&(32===(c=e.src.charCodeAt(s))||10===c);s++);if(s<p&&91===e.src.charCodeAt(s)&&(h=s+1,(s=ZE(e,s))>=0?i=e.src.slice(h,s++):s=h-1),i||(void 0===i&&(s=r+1),i=e.src.slice(n,r)),!(l=e.env.references[ek(i)]))return e.pos=d,!1;o=l.href,a=l.title}return t||(e.pos=n,e.posMax=r,u?e.push({type:"image",src:o,title:a,alt:e.src.substr(n,r-n),level:e.level}):(e.push({type:"link_open",href:o,title:a,level:e.level++}),e.linkLevel++,e.parser.tokenize(e),e.linkLevel--,e.push({type:"link_close",level:--e.level}))),e.pos=s,e.posMax=p,!0}],["footnote_inline",function(e,t){var n,r,i,o,a=e.posMax,s=e.pos;return!(s+2>=a)&&(94===e.src.charCodeAt(s)&&(91===e.src.charCodeAt(s+1)&&(!(e.level>=e.options.maxNesting)&&(n=s+2,!((r=ZE(e,s+1))<0)&&(t||(e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.list||(e.env.footnotes.list=[]),i=e.env.footnotes.list.length,e.pos=n,e.posMax=r,e.push({type:"footnote_ref",id:i,level:e.level}),e.linkLevel++,o=e.tokens.length,e.parser.tokenize(e),e.env.footnotes.list[i]={tokens:e.tokens.splice(o)},e.linkLevel--),e.pos=r+1,e.posMax=a,!0)))))}],["footnote_ref",function(e,t){var n,r,i,o,a=e.posMax,s=e.pos;if(s+3>a)return!1;if(!e.env.footnotes||!e.env.footnotes.refs)return!1;if(91!==e.src.charCodeAt(s))return!1;if(94!==e.src.charCodeAt(s+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(r=s+2;r<a;r++){if(32===e.src.charCodeAt(r))return!1;if(10===e.src.charCodeAt(r))return!1;if(93===e.src.charCodeAt(r))break}return r!==s+2&&(!(r>=a)&&(r++,n=e.src.slice(s+2,r-1),void 0!==e.env.footnotes.refs[":"+n]&&(t||(e.env.footnotes.list||(e.env.footnotes.list=[]),e.env.footnotes.refs[":"+n]<0?(i=e.env.footnotes.list.length,e.env.footnotes.list[i]={label:n,count:0},e.env.footnotes.refs[":"+n]=i):i=e.env.footnotes.refs[":"+n],o=e.env.footnotes.list[i].count,e.env.footnotes.list[i].count++,e.push({type:"footnote_ref",id:i,subId:o,level:e.level})),e.pos=r,e.posMax=a,!0)))}],["autolink",function(e,t){var n,r,i,o,a,s=e.pos;return 60===e.src.charCodeAt(s)&&(!((n=e.src.slice(s)).indexOf(">")<0)&&((r=n.match(Yk))?!(Rk.indexOf(r[1].toLowerCase())<0)&&(a=KE(o=r[0].slice(1,-1)),!!e.parser.validateLink(o)&&(t||(e.push({type:"link_open",href:a,level:e.level}),e.push({type:"text",content:o,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=r[0].length,!0)):!!(i=n.match(Bk))&&(a=KE("mailto:"+(o=i[0].slice(1,-1))),!!e.parser.validateLink(a)&&(t||(e.push({type:"link_open",href:a,level:e.level}),e.push({type:"text",content:o,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=i[0].length,!0))))}],["htmltag",function(e,t){var n,r,i,o=e.pos;return!!e.options.html&&(i=e.posMax,!(60!==e.src.charCodeAt(o)||o+2>=i)&&(!(33!==(n=e.src.charCodeAt(o+1))&&63!==n&&47!==n&&!function(e){var t=32|e;return t>=97&&t<=122}(n))&&(!!(r=e.src.slice(o).match(Hk))&&(t||e.push({type:"htmltag",content:e.src.slice(o,o+r[0].length),level:e.level}),e.pos+=r[0].length,!0))))}],["entity",function(e,t){var n,r,i=e.pos,o=e.posMax;if(38!==e.src.charCodeAt(i))return!1;if(i+1<o)if(35===e.src.charCodeAt(i+1)){if(r=e.src.slice(i).match(qk))return t||(n="x"===r[1][0].toLowerCase()?parseInt(r[1].slice(1),16):parseInt(r[1],10),e.pending+=LE(n)?PE(n):PE(65533)),e.pos+=r[0].length,!0}else if(r=e.src.slice(i).match(Gk)){var a=TE(r[1]);if(r[1]!==a)return t||(e.pending+=a),e.pos+=r[0].length,!0}return t||(e.pending+="&"),e.pos++,!0}]];function Uk(){this.ruler=new WE;for(var e=0;e<zk.length;e++)this.ruler.push(zk[e][0],zk[e][1]);this.validateLink=Wk}function Wk(e){var t=e.trim().toLowerCase();return-1===(t=YE(t)).indexOf(":")||-1===["vbscript","javascript","file","data"].indexOf(t.split(":")[0])}Uk.prototype.skipToken=function(e){var t,n,r=this.ruler.getRules(""),i=r.length,o=e.pos;if((n=e.cacheGet(o))>0)e.pos=n;else{for(t=0;t<i;t++)if(r[t](e,!0))return void e.cacheSet(o,e.pos);e.pos++,e.cacheSet(o,e.pos)}},Uk.prototype.tokenize=function(e){for(var t,n,r=this.ruler.getRules(""),i=r.length,o=e.posMax;e.pos<o;){for(n=0;n<i&&!(t=r[n](e,!1));n++);if(t){if(e.pos>=o)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},Uk.prototype.parse=function(e,t,n,r){var i=new QE(e,this,t,n,r);this.tokenize(i)};var Qk={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","replacements","smartquotes","references","abbr2","footnote_tail"]},block:{rules:["blockquote","code","fences","footnote","heading","hr","htmlblock","lheading","list","paragraph","table"]},inline:{rules:["autolink","backticks","del","emphasis","entity","escape","footnote_ref","htmltag","links","newline","text"]}}},full:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{},block:{},inline:{}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","abbr2"]},block:{rules:["blockquote","code","fences","heading","hr","htmlblock","lheading","list","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","htmltag","links","newline","text"]}}}};function Zk(e,t,n){this.src=t,this.env=n,this.options=e.options,this.tokens=[],this.inlineMode=!1,this.inline=e.inline,this.block=e.block,this.renderer=e.renderer,this.typographer=e.typographer}function Jk(e,t){"string"!=typeof e&&(t=e,e="default"),t&&null!=t.linkify&&console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"),this.inline=new Uk,this.block=new Ck,this.core=new fk,this.renderer=new UE,this.ruler=new WE,this.options={},this.configure(Qk[e]),this.set(t||{})}Jk.prototype.set=function(e){DE(this.options,e)},Jk.prototype.configure=function(e){var t=this;if(!e)throw new Error("Wrong `remarkable` preset, check name/content");e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enable(e.components[n].rules,!0)})},Jk.prototype.use=function(e,t){return e(this,t),this},Jk.prototype.parse=function(e,t){var n=new Zk(this,e,t);return this.core.process(n),n.tokens},Jk.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},Jk.prototype.parseInline=function(e,t){var n=new Zk(this,e,t);return n.inlineMode=!0,this.core.process(n),n.tokens},Jk.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const Kk=new Jk,Xk=e=>{const{payload:t,hostConfig:n,onExecuteAction:i}=e,o=(0,r.useRef)(null),a=(0,r.useRef)(new ME.AdaptiveCard),[s,l]=(0,r.useState)(void 0),{processHTML:c}=pr();(0,r.useEffect)(()=>{ME.AdaptiveCard.onProcessMarkdown=(e,t)=>{const n=Kk.render(e),r=c(n);t.outputHtml=r,t.didProcess=!0}},[c]);const u=e=>{i?.(e)};return(0,r.useEffect)(()=>{a.current.onExecuteAction=u},[]),(0,r.useEffect)(()=>{a.current.hostConfig=new ME.HostConfig(n)},[n]),(0,r.useEffect)(()=>{if(!o.current)return;const e=a.current;try{e.parse(t);const n=e.render();if(n){o.current.innerHTML="",o.current.appendChild(n);o.current.querySelectorAll("[role='heading']").forEach(e=>{null===e.getAttribute("aria-level")&&e.setAttribute("aria-level","4")});const e=o.current.querySelector(".ac-container.ac-adaptiveCard[aria-label][tabindex='0']");if(e){const t=e.getAttribute("aria-label");t&&l(t)}}}catch(e){console.error("Unable to render Adaptive Card: ",e)}},[n,t]),rn({messageType:"adaptiveCard",data:{speakText:s},validation:()=>!!s}),(0,yt.jsx)("div",{ref:o})},$k="_adaptivecard-wrapper_v4uid_32",eC="_chatDisabled_v4uid_68",tC={fontFamily:"inherit",fontSizes:{small:10,default:14,medium:16,large:18,extraLarge:34},fontWeights:{lighter:300,default:400,bolder:600},lineHeights:{small:12,default:18.2,medium:22.4,large:23.4,extraLarge:40.8},containerStyles:{default:{backgroundColor:"#fff",foregroundColors:{default:{default:"var(--cc-black-10)",subtle:"var(--cc-black-40)"}}}}},nC="_eventPill_1n8e7_1",rC="_eventPillTextWrapper_1n8e7_11",iC=e=>{const{text:t,className:n,id:r}=e;return(0,yt.jsx)("div",{className:Dt(nC,n),id:r,"aria-live":"assertive",children:(0,yt.jsx)("div",{className:rC,children:(0,yt.jsx)(mm,{variant:"title2-semibold",component:"div",children:t})})})},oC=[{match:e=>"x-app-submit"===e?.data?._plugin?.type,component:()=>{const{message:e,"data-message-id":t}=tn(),n=e?.data?._plugin,r=(n?.data?n.data:void 0)||{},{success:i,text:o}=r;return rn({messageType:"event",data:{dataMessageId:t??""},validation:()=>!!t}),(0,yt.jsx)(iC,{text:i?o:"Submission failed"})}},{match:e=>!!e?.data?._cognigy?._webchat3?.type,component:()=>{const{message:e,"data-message-id":t}=tn();if(rn({messageType:"event",data:{dataMessageId:t??""},validation:()=>!!t}),"liveAgentEvent"!==e?.data?._cognigy?._webchat3?.type)return null;const n=e?.data?._cognigy?._webchat3?.payload?.text;return n?(0,yt.jsx)(iC,{text:n}):null}},{match:e=>"date-picker"===e?.data?._plugin?.type,component:()=>{const{action:e,message:t,messageParams:n,config:i}=tn(),o=(0,r.useMemo)(()=>((e,t)=>{if(!e?.data?._plugin||"date-picker"!==e.data._plugin.type)return;const n=e.data._plugin.data,r=e=>{switch(e){case"today":return hw().format("YYYY-MM-DD");case"tomorrow":return hw().add(1,"days").format("YYYY-MM-DD");case"yesterday":return hw().add(-1,"days").format("YYYY-MM-DD")}return e},i=e=>{switch(hw(e).isoWeekday()){case 6:case 7:return!0}return!1},o=n.dateFormat||"Y-m-d",a=r(n.defaultDate)||r(n.minDate)||void 0,s=n.locale||"us",l=(e=>{switch(e){case"au":return"en-au";case"ca":return"en-ca";case"gb":return"en-gb";case"us":return"en"}return e})(s),c=(e=>{switch(e){case"us":case"gb":case"au":case"ca":return"en"}return e})(s);let u=yw[c];const d=!!n.enableTime,p=n.time_24hr?"H:i":"h:i K",h=d?`${o} ${p}`:o,f=d?"L LT":"L";"gb"===s&&(u={...u,firstDayOfWeek:1});const m={nextArrow:Aw,prevArrow:Aw,defaultHour:n?.defaultHour||12,defaultMinute:n?.defaultMinute||0,hourIncrement:n?.hourIncrement||1,minuteIncrement:n?.minuteIncrement||5,noCalendar:!!n?.noCalendar,weekNumbers:!!n?.weekNumbers,dateFormat:h,defaultDate:a,disable:[],enable:[],enableTime:d,inline:!0,locale:u,maxDate:r(n.maxDate)||"",minDate:r(n.minDate)||"",mode:n.mode||"single",static:!0,time_24hr:!!n?.time_24hr,parseDate:e=>hw(e).toDate(),formatDate:n.dateFormat?void 0:e=>hw(e).locale(l).format(f),plugins:[(g={arrowIcon:Aw,customTranslations:t||{}},function(e){const{arrowIcon:t,customTranslations:n}=g,r=new WeakMap;function i(){if(!e?.config?.enableTime)return;const n=e?.timeContainer?.querySelector("span.flatpickr-am-pm");if(n&&!n.querySelector("span.arrowUp")){const r=e?.amPM?.innerText,i=e._createElement("span","arrowUp");"AM"===r&&i.classList.add("disabled"),i.innerHTML=t;const o=e._createElement("span","arrowDown");"PM"===r&&o.classList.add("disabled"),o.innerHTML=t,n.appendChild(i),n.appendChild(o)}}function o(t,i){if(!t)return;const o="prev"===i?n?.ariaLabels?.datePickerPreviousMonth||"Previous month":n?.ariaLabels?.datePickerNextMonth||"Next month";if(t.setAttribute("aria-label",o),t.setAttribute("role","button"),t.classList.contains("flatpickr-disabled")){t.setAttribute("aria-disabled","true"),t.removeAttribute("tabindex");const e=r.get(t);e&&(t.removeEventListener("keydown",e),r.delete(t))}else if(t.setAttribute("tabindex","0"),t.removeAttribute("aria-disabled"),!r.has(t)){const n=t=>{if("Enter"===t.key||" "===t.key){t.preventDefault();const n=t.target.classList.contains("flatpickr-prev-month");e.changeMonth(n?-1:1)}};r.set(t,n),t.addEventListener("keydown",n)}}return{onReady:[i,function(){if(!e?.config?.enableTime)return;const n=e?.timeContainer?.getElementsByClassName("arrowUp"),r=e?.timeContainer?.getElementsByClassName("arrowDown");if(n)for(let e=0;e<n.length;e++)n[e].innerHTML=t;if(r)for(let e=0;e<r.length;e++)r[e].innerHTML=t},function(){e?.calendarContainer?.setAttribute("tabindex","-1");const t=e?.calendarContainer?.getElementsByClassName("flatpickr-innerContainer")[0];t&&t.setAttribute("tabindex","0")},function(){if(e?.calendarContainer?.setAttribute("aria-labelledby","webchatDatePickerHeaderLabel"),e?.config?.enableTime){const t=e?.timeContainer?.getElementsByClassName("flatpickr-hour")?.[0];t?.setAttribute("tabIndex","0");const n=e?.timeContainer?.getElementsByClassName("flatpickr-minute")?.[0];n?.setAttribute("tabIndex","0");const r=e?.timeContainer?.getElementsByClassName("flatpickr-am-pm")?.[0];r?.setAttribute("tabIndex","0"),r?.setAttribute("role","button")}},function(){const t=e?.calendarContainer?.getElementsByClassName("flatpickr-current-month")[0],r=t?.getElementsByClassName("flatpickr-monthDropdown-months")?.[0];if(r){r.setAttribute("id","webchat-monthSelector-datepicker"),r.classList.add("webchat-monthSelector-datepicker"),r.removeAttribute("aria-label");const i=t?.querySelector("label[for='webchat-monthSelector-datepicker']");if(!i){const e=document.createElement("label");e.setAttribute("for","webchat-monthSelector-datepicker"),e.textContent=n?.datePickerMonthLabel||"Month",t?.prepend(e)}r.setAttribute("tabindex","0"),r.addEventListener("keydown",t=>{if("Enter"===t.key&&t.stopPropagation(),"ArrowUp"===t.key||"ArrowDown"===t.key){t.preventDefault(),t.stopPropagation();const n="ArrowDown"===t.key;e.changeMonth(n?1:-1)}})}},function(){const t=e?.calendarContainer?.getElementsByClassName("flatpickr-current-month")[0],r=t?.getElementsByClassName("cur-year")?.[0];if(r){const e=r?.parentElement;r.setAttribute("id","yearSelector-datepicker"),r.classList.add("yearSelector-datepicker"),r.removeAttribute("aria-label");const t=e?.querySelector("label[for='yearSelector-datepicker']");if(!t){const t=document.createElement("label");t.setAttribute("for","yearSelector-datepicker"),t.textContent=n?.datePickerYearLabel||"Year",e?.prepend(t)}r.setAttribute("tabindex","0")}},function(){const t=e?.calendarContainer?.querySelector(".flatpickr-prev-month"),n=e?.calendarContainer?.querySelector(".flatpickr-next-month");o(t,"prev"),o(n,"next")},function(){const t=e?.calendarContainer?.querySelector(".flatpickr-prev-month"),n=e?.calendarContainer?.querySelector(".flatpickr-next-month");t&&!t.dataset.observed&&(new MutationObserver(()=>{o(t,"prev")}).observe(t,{attributes:!0,attributeFilter:["class"]}),t.dataset.observed="true"),n&&!n.dataset.observed&&(new MutationObserver(()=>{o(n,"next")}).observe(n,{attributes:!0,attributeFilter:["class"]}),n.dataset.observed="true")},function(){const t=e?.calendarContainer?.getElementsByClassName("flatpickr-current-month")[0],n=t?.getElementsByClassName("flatpickr-monthDropdown-months")?.[0];if(n){if("true"===n.dataset.observed)return;let e=null;new MutationObserver(()=>{e&&clearTimeout(e),e=setTimeout(()=>{n.setAttribute("tabindex","0")},100)}).observe(n,{attributes:!0,childList:!1,subtree:!1}),n.dataset.observed="true"}},()=>{e?.loadedPlugins?.push("customElements")}],onDayCreate:[(e,t,n,r)=>{r.classList.contains("flatpickr-disabled")?r.setAttribute("aria-disabled","true"):r.removeAttribute("aria-disabled"),r.innerHTML=`<span class='dayInner'>${r.innerHTML}</span>`},function(){if(!e?.config?.weekNumbers)return;const t=e?.weekNumbers?.getElementsByClassName("flatpickr-day");if(t)for(let n=0;n<t.length;n++){const r=t[n]?.getElementsByClassName("weekdayInner");if(0===r.length){const r=e?.config?.getWeek(new Date)||0,i=t[n].innerHTML===r.toString()&&e?.currentYear===(new Date).getFullYear();t[n].innerHTML=`<span class='weekdayInner${i?" currentWeek":""}'>${t[n].innerHTML}</span>`}}}],onValueUpdate:[i]}})]};var g;const y=Array.isArray(n?.enable_disable)&&n.enable_disable.length>0?n.enable_disable:null,A=y?[...y].map(r).map(e=>"weekends"===e?i:e):[];if(n?.function_enable_disable&&n?.function_enable_disable?.length>0)try{const e=new Function(`"use strict"; return ${n.function_enable_disable}`)();"boolean"==typeof e(new Date)&&A.push(e)}catch(e){console.log(e)}return A.length>0?n.wantDisable?(m.disable=A,delete m.enable):m.enable=A:delete m.enable,m})(t,i?.settings?.customTranslations),[t,i?.settings?.customTranslations]),[a,s]=(0,r.useState)(!1),[l,c]=(0,r.useState)(""),u=(0,r.useRef)(null),d=nn("webchatDatePickerHeading");if(!t?.data?._plugin||"date-picker"!==t.data._plugin.type)return;const{openPickerButtonText:p,submitButtonText:h,enableTime:f,time_24hr:m,noCalendar:g,eventName:y}=t.data._plugin.data,A=p||"Pick date",v=h||"Confirm Selection",b=!!f,w=!!g,E=n?.isConversationEnded||n?.hasReply,k=()=>{s(!1),c(""),u.current?.focus()},C=(e,t)=>{t&&c(t)},_=i?.settings?.customTranslations?.ariaLabels?.closeDatePicker||"Close date-picker";return(0,yt.jsxs)("div",{"data-testid":"datepicker-message",children:[(0,yt.jsx)(Lm,{onClick:()=>{s(!0)},disabled:E,"data-testid":"button-open",ref:u,"aria-expanded":a,"aria-controls":`webchat-plugin-date-picker-${t.id}`,"aria-haspopup":"dialog",children:A}),a&&(0,yt.jsxs)("div",{id:`webchat-plugin-date-picker-${t.id}`,className:Dt(wb,"webchat-plugin-date-picker"),onKeyDown:e=>{const t=document.querySelector("div.webchat-plugin-date-picker"),{firstFocusable:n,lastFocusable:r,nextFocusable:i,prevFocusable:o}=(e=>{const t=e?.querySelectorAll('a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])'),n=t&&Array.from(t),r=n?.filter(e=>!(e.hasAttribute("disabled")||e.getAttribute("aria-hidden")||e instanceof HTMLInputElement&&e.readOnly||e instanceof HTMLTextAreaElement&&e.readOnly)),i=r&&r[0],o=r&&r[r.length-1],a=document.activeElement;let s=null;a&&e.contains(a)&&(s=a);let l=null,c=null;if(s&&r){const e=r.indexOf(s);-1!==e&&(l=r[e+1]||r[0],c=r[e-1]||r[r.length-1])}return{firstFocusable:i,lastFocusable:o,focusable:r,nextFocusable:l,prevFocusable:c}})(t),a=!e.shiftKey&&"Tab"===e.key,s=e.shiftKey&&"Tab"===e.key,{firstTimePickerField:l,lastTimePickerField:c}=((e,t,n)=>{if(!t||!e)return{firstTimePickerField:null,lastTimePickerField:null};const r=e?.getElementsByClassName("flatpickr-hour")?.[0],i=e?.getElementsByClassName("flatpickr-minute")?.[0],o=e?.getElementsByClassName("flatpickr-am-pm")?.[0];return{firstTimePickerField:r,lastTimePickerField:n?i:o}})(t,!!f,!!m);"Esc"!==e.key&&"Escape"!==e.key||k(),a&&(e.target===r?(e.preventDefault(),n?.focus()):e.target===c&&(e.preventDefault(),i?.focus())),s&&(e.target===n?(e.preventDefault(),r?.focus()):e.target===l&&(e.preventDefault(),o?.focus()))},tabIndex:0,role:"dialog","aria-modal":"true","aria-labelledby":d,children:[(0,yt.jsxs)("div",{className:Dt(Eb,"webchat-plugin-date-picker-header"),children:[(0,yt.jsx)("span",{className:kb}),(0,yt.jsx)("span",{className:Cb,children:(0,yt.jsx)(mm,{variant:"h2-semibold",component:"h4",className:"webchat-list-template-header-title",children:y||"Calendar"})}),(0,yt.jsx)("button",{onClick:k,"aria-label":_,className:_b,"data-testid":"button-close",autoFocus:!0,children:(0,yt.jsx)(Kf,{})})]}),(0,yt.jsxs)("div",{className:xb,children:[(0,yt.jsx)("div",{className:Dt(Mb,"webchat-plugin-date-picker-content"),children:(0,yt.jsx)(lw,{onChange:C,onReady:C,options:o})}),(0,yt.jsx)("div",{className:Dt(Tb,"webchat-plugin-date-picker-footer",b&&Sb,w&&Db),children:(0,yt.jsx)(Lm,{onClick:()=>{e&&e(l,null),k()},disabled:!l,"data-testid":"button-submit",children:v})})]})]})]})}},{match:(e,t)=>{const n=Lt(e,t);if(!n)return!1;const r=n?.message?.quick_replies&&n.message.quick_replies.length>0,i="button"===n?.message?.attachment?.payload?.template_type,o=n?.message?.text,a=t?.settings?.widgetSettings?.enableDefaultPreview,s=e?.data?._cognigy?._defaultPreview;return!(a&&!s&&e.text)&&(r||i||o)},component:e=>{const{onSetMessageAnimated:t}=e,{action:n,message:i,config:o,onEmitAnalytics:a,messageParams:s,openXAppOverlay:l,"data-message-id":c}=tn(),u=!!o?.settings?.behavior?.progressiveMessageRendering,d=o?.settings?.layout?.botOutputMaxWidthPercentage,p="bot"===i.source,h="engagement"===i.source,f=Lt(i,o),m=f?.message?.attachment,g=m?.payload?.text||f?.message?.text||"",y=(0,r.useMemo)(()=>m?.payload?.buttons||f?.message?.quick_replies||[],[m?.payload?.buttons,f?.message?.quick_replies]);(0,r.useEffect)(()=>{u&&(p||h)&&t&&i.id&&"start"===i.animationState&&!g&&t(i.id,"done")},[u,p,h,t,i.id,i.animationState,g]);const A=!o?.settings?.layout?.disableHtmlContentSanitization,v=o?.settings?.widgetSettings?.customAllowedHtmlTags,b=(0,r.useMemo)(()=>((e,t,n)=>{const{text:r,buttons:i}=e;return{textContent:mr(r,t,n),buttonLabels:i?.map(e=>{const r=Pt(e);return mr(r,t,n)||""})||[]}})({text:g,buttons:y},A,v),[g,y,A,v]),{textContent:w,buttonLabels:E}=b;rn({messageType:"textWithButtons",data:{text:w,buttons:E},validation:()=>E.length===y.length});const k="animating"===i.animationState||"start"===i.animationState,C=nn("webchatButtonTemplateHeader"),_=f?.message?.quick_replies&&f.message.quick_replies.length>0,M=_&&s?.hasReply||s?.isConversationEnded?void 0:n,T=_?"quick-reply":"buttons",S=p||h&&d?{maxWidth:`${d}%`}:{};return(0,yt.jsxs)("div",{className:`webchat-${T}-template-root`,children:[g&&(0,yt.jsx)(jf,{...e,content:g,className:`webchat-${T}-template-header`,id:C,ignoreLiveRegion:!0}),(!u||!k)&&(0,yt.jsx)(xm,{dataMessageId:c,action:M,buttonClassName:Dt(vw.button,`webchat-${T}-template-button`),containerClassName:Dt(vw.buttons,`webchat-${T}-template-replies-container`),containerStyle:S,payload:y,showUrlIcon:!0,config:o,onEmitAnalytics:a,templateTextId:C,openXAppOverlay:l})]})}},{match:(e,t)=>{const n=Lt(e,t);return!!n&&"image"===n?.message?.attachment?.type},component:()=>{const{message:e,config:t}=tn(),n=Lt(e,t),{url:i,altText:o,buttons:a}=n?.message?.attachment?.payload||{},s=a?.[0],l=(0,r.useRef)(null),c=void 0!==a?.find(e=>"type"in e&&"web_url"===e.type),[u,d]=(0,r.useState)(!1),p=(0,r.useMemo)(()=>({onExpand:()=>c&&d(!0),onClose:()=>{d(!1),l.current?.focus()},url:i,altText:o,isDownloadable:c,button:s}),[o,s,c,i]);return i?(0,yt.jsxs)(Hf.Provider,{value:p,children:[(0,yt.jsx)(Om,{ref:l}),u&&(0,yt.jsx)(am,{})]}):null}},{match:(e,t)=>{const n=Lt(e,t);return!!n&&"video"===n?.message?.attachment?.type},component:()=>{const{message:e,config:t}=tn(),n=Lt(e,t),{url:i,altText:o,captionsUrl:a}=n?.message?.attachment?.payload||{},s=(0,r.useRef)(null),[l,c]=(0,r.useState)(!1),u=(0,r.useRef)(null),d=(0,r.useRef)(null);rn({messageType:"video",data:{hasTranscript:!!o,hasCaptions:!!a},validation:()=>!!i});const p=(0,r.useCallback)(e=>{const n=document.getElementById("webchatChatHistoryWrapperLiveLogPanel");t?.settings?.widgetSettings?.enableAutoFocus&&n?.contains(document.activeElement)&&setTimeout(()=>{e.getInternalPlayer()?.focus()},100)},[t?.settings?.widgetSettings?.enableAutoFocus]),h=(0,r.useMemo)(()=>!l&&(0===d.current?.getCurrentTime()||void 0===d.current?.getCurrentTime()),[l]),f={attributes:{crossOrigin:"true"},tracks:[{kind:"subtitles",src:a,srcLang:"en-US",label:"On"}]};if(!i)return null;const m=t?.settings.customTranslations?.ariaLabels?.playVideo||"Play video";return(0,yt.jsxs)("div",{className:Dt(mg,o&&yg),children:[(0,yt.jsx)("div",{className:Dt(wg,"webchat-media-template-video"),ref:u,"data-testid":"video-message",role:h?"button":void 0,tabIndex:h?0:-1,"aria-label":h?m:void 0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),c(!l))},children:(0,yt.jsx)(fg,{ref:d,url:i,light:h,playing:l,controls:!0,className:gg,playIcon:(0,yt.jsx)(tm,{width:"35px",height:"35px"}),width:"unset",height:"unset",onPlay:()=>c(!0),onPause:()=>c(!1),onClickPreview:()=>c(!l),onReady:p,onStart:()=>{const e=d.current?.getInternalPlayer?.();e?.focus?.()},previewTabIndex:-1,config:{file:a?f:{}}})}),o&&(0,yt.jsxs)("div",{className:Ag,children:[(0,yt.jsx)(Lm,{className:Dt(vg,"webchat-buttons-template-button-video"),customIcon:(0,yt.jsx)(Xf,{className:bg,fontSize:10}),onClick:()=>s.current?.click(),children:"Download Transcript"}),(0,yt.jsx)("a",{ref:s,href:`data:text/plain;charset=utf-8,${encodeURIComponent(o)}`,download:"video-transcript.txt",style:{display:"none"},"aria-hidden":"true"})]})]})}},{match:(e,t)=>{const n=Lt(e,t);return!!n&&"audio"===n?.message?.attachment?.type},component:()=>{const{message:e,config:t}=tn(),n=Lt(e,t),{url:i,altText:o}=n?.message?.attachment?.payload||{},a=(0,r.useRef)(null),[s,l]=(0,r.useState)(!1),[c,u]=(0,r.useState)(0),[d,p]=(0,r.useState)(0),h=(0,r.useCallback)(e=>{const n=document.getElementById("webchatChatHistoryWrapperLiveLogPanel");t?.settings?.widgetSettings?.enableAutoFocus&&n?.contains(document.activeElement)&&setTimeout(()=>{e.getInternalPlayer()?.focus()},100)},[t?.settings?.widgetSettings?.enableAutoFocus]),f=(0,r.useCallback)(()=>{l(!0)},[]),m=(0,r.useCallback)(()=>{l(!1)},[]),g=(0,r.useCallback)(e=>{u(e.played)},[]),y=(0,r.useCallback)(e=>{p(e)},[]);return rn({messageType:"audio",data:{hasTranscript:!!o},validation:()=>!!i}),i?(0,yt.jsxs)("div",{className:Dt("webchat-media-template-audio",Eg),"data-testid":"audio-message",children:[(0,yt.jsx)(fg,{url:i,onReady:h,ref:a,playing:s,onPlay:f,onPause:m,onProgress:g,onDuration:y,height:0,width:0,style:{display:"none"},progressInterval:.1}),(0,yt.jsx)(yA,{playerRef:a,playing:s,progress:c,duration:d,handlePlay:f,handlePause:m,altText:o})]}):null}},{match:e=>{const t=e?.data?.attachments;return!!t},component:e=>{const{message:t}=tn(),n=t.data?.attachments,r=t.text;if(rn({messageType:"file",data:{text:r??"",attachments:n??[]},validation:()=>!!n&&n.length>0}),!n||0===n.length)return null;const i=[],o=[];return n.forEach(e=>{qt(e.mimeType)?i.push(e):o.push(e)}),(0,yt.jsxs)(yt.Fragment,{children:[(0,yt.jsxs)("div",{className:Dt(AA,"webchat-media-files-template-root"),children:[i.length>0&&(0,yt.jsx)("div",{className:Dt(vA,"webchat-media-template-image-container"),children:i.map((e,t)=>{const{fileName:r,size:i,url:o}=e;return(0,yt.jsx)("a",{href:o,target:"_blank",style:{textDecoration:"none"},children:(0,yt.jsx)("img",{src:o,alt:`${r} (${jt(i)})`,className:Dt(n.length>1?wA:bA,"webchat-media-template-image"),"data-testid":"image-message",title:`${r} (${jt(i)})`})},t)})}),o.length>0&&(0,yt.jsx)("div",{className:Dt(vA,"webchat-media-template-files-container"),children:o.map((e,t)=>{const{fileName:n,size:r,url:i}=e;return(0,yt.jsx)("a",{href:i,target:"_blank",style:{textDecoration:"none"},children:(0,yt.jsxs)("div",{className:Dt(EA,"webchat-media-template-file"),"data-testid":"file-message",children:[(0,yt.jsxs)("div",{className:kA,children:[(0,yt.jsx)(mm,{component:"span",variant:"title2-regular",className:CA,children:Vt(n)}),(0,yt.jsx)(mm,{component:"span",variant:"title2-regular",className:_A,children:Ft(n)})]}),(0,yt.jsx)(mm,{component:"span",variant:"title2-regular",className:MA,children:jt(r)})]})},t)})})]}),r&&(0,yt.jsx)(jf,{...e,content:r,ignoreLiveRegion:!0})]})}},{match:(e,t)=>{const n=Lt(e,t);return!!n&&"list"===n.message?.attachment?.payload?.template_type},component:()=>{const{message:e,messageParams:t,config:n,"data-message-id":i,action:o,onEmitAnalytics:a}=tn(),s=Lt(e,n),[l,c]=(0,r.useState)({}),{elements:u,top_element_style:d,buttons:p}=s?.message?.attachment?.payload||{},h="large"===d||!0===d,f=h?u?.slice(1):u,m=h?u?.[0]:null,g=p&&p?.[0],y=nn("webchatListTemplateRoot"),A=t?.isConversationEnded;(0,r.useEffect)(()=>{const e=document.getElementById("webchatChatHistoryWrapperLiveLogPanel");if(!n?.settings?.widgetSettings?.enableAutoFocus)return;if(!e?.contains(document.activeElement))return;const t=document.getElementById(y),r=t?.querySelectorAll('button, [href], [tabindex]:not([tabindex="-1"])'),i=r&&r[0];setTimeout(()=>{i?.focus()},200)},[n?.settings?.widgetSettings?.enableAutoFocus,y]),rn({messageType:"list",data:l,validation:()=>u?.length===Object.keys(l).length});const v=(0,r.useCallback)((e,t)=>{c(n=>n[e]===t?n:{...n,[e]:t})},[]);return u&&0!==u?.length?(0,yt.jsxs)("div",{className:Dt("webchat-list-template-root",TA),id:y,"data-testid":"list-message",children:[m&&(0,yt.jsx)(UA,{element:m,isHeaderElement:!0,headingLevel:"h4",id:`header-${y}`,onSetScreenReaderLabel:e=>{v(0,e)}}),(0,yt.jsx)("ul",{"aria-labelledby":m?`listHeader-header-${y}`:void 0,className:DA,children:f&&f.map((e,t)=>(0,yt.jsx)(r.Fragment,{children:(0,yt.jsx)(UA,{element:e,headingLevel:m?"h5":"h4",id:`${y}-${t}`,onSetScreenReaderLabel:e=>{v(t+1,e)},dividerBefore:t>0,dividerAfter:Boolean(g&&t===f.length-1)})},t))}),g&&(0,yt.jsx)(Lm,{isActionButton:!0,dataMessageId:i,action:A?void 0:o,button:g,buttonClassName:"webchat-list-template-global-button",containerClassName:qA,config:n,onEmitAnalytics:a})]}):null}},{match:(e,t)=>{const n=Lt(e,t);return!!n&&"generic"===n.message?.attachment?.payload?.template_type},component:()=>{const{message:e,config:t,"data-message-id":n}=tn(),i=!t?.settings?.layout?.disableHtmlContentSanitization,o=t?.settings?.widgetSettings?.customAllowedHtmlTags,{slide:a,actionButtonPositionText:s}=t?.settings?.customTranslations?.ariaLabels||{},l=Lt(e,t),{elements:c}=l?.message?.attachment?.payload||{},u=nn("webchatCarouselContentButton");(0,r.useEffect)(()=>{const e=document.getElementById("webchatChatHistoryWrapperLiveLogPanel"),n=document.getElementById(`${u}-0`),r=n?.getElementsByTagName("button")?.[0];t?.settings?.widgetSettings?.enableAutoFocus&&e?.contains(document.activeElement)&&("link"===n?.getAttribute("role")?setTimeout(()=>{n?.focus()},200):r&&setTimeout(()=>{r?.focus()},200))},[u,t?.settings?.widgetSettings?.enableAutoFocus]),(0,r.useEffect)(()=>{const e=document.querySelector(`[data-message-id="${n}"]`),t=e?.querySelector(".swiper-wrapper");t&&t.removeAttribute("aria-live")},[n]);const d=(0,r.useMemo)(()=>((e,t,n)=>e&&0!==e.length?e.map(e=>({slideText:`${mr(e.title,t,n)}. ${mr(e.subtitle,t,n)}`,buttonLabels:(e.buttons||[]).map(e=>mr(Pt(e),t,n))})):[])(c,i,o),[c,i,o]),p=(0,r.useMemo)(()=>{if(!a||!s)return"Slide {{index}} of {{slidesLength}}";return Rt(`${a}: ${s}`,{position:"{{index}}",total:"{{slidesLength}}"})},[a,s]);return rn({messageType:"gallery",data:{slides:d},validation:()=>!!c&&c.length>0&&d.length===c.length}),c&&0!==c?.length?1===c.length?(0,yt.jsx)("div",{className:Dt("webchat-carousel-template-root",WA.wrapper),"data-testid":"gallery-message",children:(0,yt.jsx)(bb,{slide:c[0],contentId:`${u}-0`})}):(0,yt.jsxs)(Ab,{modules:[vv,wv,Ev],spaceBetween:8,slidesPerView:"auto",navigation:{prevEl:".gallery-button-prev",nextEl:".gallery-button-next"},pagination:{clickable:!0},className:Dt("webchat-carousel-template-root",WA.wrapper),"data-testid":"gallery-message",a11y:{slideLabelMessage:p},children:[c.map((e,t)=>(0,yt.jsx)(vb,{style:{width:"206px"},children:(0,yt.jsx)(bb,{slide:e,contentId:`${u}-${t}`})},t)),(0,yt.jsx)("button",{className:"gallery-button-prev",children:(0,yt.jsx)(im,{})}),(0,yt.jsx)("button",{className:"gallery-button-next",children:(0,yt.jsx)(im,{})})]}):null}},{match:(e,t)=>{const n=e?.data?._cognigy?._webchat?.adaptiveCard,r=e?.data?._cognigy?._defaultPreview?.adaptiveCard,i="adaptivecards"===e?.data?._plugin?.type,o=t?.settings?.widgetSettings?.enableDefaultPreview;return(!e.data?._cognigy?._defaultPreview?.message||!o)&&!!(r&&o||n&&r&&!o||n||i)},component:()=>{const{message:e,messageParams:t,action:n,config:i}=tn(),o=(e=>{const t=e?.data?._cognigy?._webchat?.adaptiveCard,n=e?.data?._cognigy?._defaultPreview?.adaptiveCard,r=e?.data?._plugin?.payload,o=i?.settings?.widgetSettings?.enableDefaultPreview;return t&&n&&!o?t:n&&o?n:r||t})(e),a=t?.isConversationEnded,s=(0,r.useCallback)(e=>{if(!a)switch(e._propertyBag?.type){case"Action.Submit":return void n?.("",{adaptivecards:e._processedData,request:{value:e._processedData}});case"Action.OpenUrl":{const t=e._propertyBag?.url;return void window.open(t,"_blank")}}},[n,a]);return(0,yt.jsx)(an,{className:Dt($k,"adaptivecard-wrapper internal",a&&eC),children:(0,yt.jsx)(Xk,{payload:o,onExecuteAction:s,hostConfig:tC})})}},{match:(e,t)=>{return!("engagement"===e?.source&&!t?.settings?.teaserMessage?.showInChat||e?.data?.attachments)&&(Array.isArray(e?.text)?e?.text.length>0:!("string"==typeof(n=e.text)&&Bt.test(n)&&!t?.settings?.behavior?.collateStreamedOutputs)&&(null!=e?.text&&""!==e?.text));var n},component:jf,name:"Text"}];function aC(e,t,n=[]){const r=[...n,...oC],i=[];for(const n of r)if(n.match(e,t)&&(i.push(n),!n?.options?.passthrough))break;return i}const sC={header:"_header_21mid_1",incoming:"_incoming_21mid_8",headerMeta:"_headerMeta_21mid_13",outgoing:"_outgoing_21mid_19",timestamp:"_timestamp_21mid_23","avatar-name":"_avatar-name_21mid_27"},lC="_avatar_ry0w9_1",cC="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='50'%20height='49'%20viewBox='0%200%2050%2049'%20fill='none'%20aria-hidden='true'%3e%3crect%20x='0.5'%20width='49'%20height='49'%20rx='24.5'%20fill='var(--cc-primary-color,%20%232455e6)'/%3e%3c/svg%3e",uC=e=>{const{message:t}=tn(),[n,i]=(0,r.useState)(cC),o=t?.data?._webchat||{};(0,r.useEffect)(()=>{o.agentAvatarOverrideUrlOnce?i(o.agentAvatarOverrideUrlOnce):o.botAvatarOverrideUrlOnce?i(o.botAvatarOverrideUrlOnce):t?.avatarUrl?i(t.avatarUrl):"agent"!==t?.source&&i("data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20aria-hidden='true'%3e%3crect%20width='28'%20height='28'%20rx='14'%20fill='%232455E6'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11.0839%2010.611L6.96494%2020.4758H4.19922L9.70529%207.29932H12.4626L17.9686%2020.4758H15.2114L11.0839%2010.611ZM22.3168%207.29932V20.4758H19.418V7.29932H22.3168Z'%20fill='white'/%3e%3c/svg%3e")},[t.avatarUrl,t?.source,o.agentAvatarOverrideUrlOnce,o.botAvatarOverrideUrlOnce]);const a=Dt(lC,e.className,"webchat-avatar",t?.source);return(0,yt.jsx)("img",{alt:"",className:a,src:n,onError:()=>i(cC),"data-testid":`${t?.source||"unknown source"}-avatar`})},dC=e=>{const{message:t,config:n,onSetHeaderInfo:i}=tn(),o=n?.settings?.widgetSettings?.sourceDirectionMapping,a="user"===t.source,s="bot"===t.source,l="agent"===t.source,c=o?.user||"outgoing",u=o?.bot||"incoming",d=o?.agent||"incoming",p=Dt("message-header",e.className,sC.header,a&&sC[c],s&&sC[u],l&&sC[d]),h=t?.timestamp?Number(t.timestamp):Date.now(),f=t?.data?._webchat||{};let m=t?.avatarName||(l?"Agent":"Bot");f.agentAvatarOverrideNameOnce&&(m=f.agentAvatarOverrideNameOnce),f.botAvatarOverrideNameOnce&&(m=f.botAvatarOverrideNameOnce);const g=new Date(h).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),y=a?n?.settings.customTranslations?.ariaLabels?.messageHeader?.user??"You said:":Rt(n?.settings.customTranslations?.ariaLabels?.messageHeader?.bot??"{name} said:",{name:m});return(0,r.useEffect)(()=>{i&&i(y)},[i,y]),(0,yt.jsxs)("header",{className:p,"data-testid":"message-header",children:[e.enableAvatar&&(0,yt.jsx)(uC,{}),(0,yt.jsxs)("span",{className:GA,children:[(0,yt.jsx)("span",{"data-skip-live-region":!0,children:Rt(n?.settings.customTranslations?.ariaLabels?.messageHeader?.timestamp??"At {time},",{time:g})}),y]}),(0,yt.jsxs)(mm,{variant:"title2-regular",component:"div",className:sC.headerMeta,"aria-hidden":!0,children:[!a&&(0,yt.jsxs)(yt.Fragment,{children:[(0,yt.jsx)("span",{"data-testid":"sender-name",className:sC["avatar-name"],children:m}),(0,yt.jsx)(rm,{})]}),(0,yt.jsx)("span",{children:(0,yt.jsx)("time",{className:sC.timestamp,children:g})})]})]})},pC="_message_19l6s_1",hC="_collated_19l6s_20",fC="_fullscreen_19l6s_24",mC=new class{constructor(){bt(this,"firstBotMessageMap",new Map),bt(this,"COLLATION_LIMIT",6e4),bt(this,"SESSION_ID","default")}isMessageValid(e,t,n){if(!n)return!1;return!!aC(n,t,e).length}isMessageCollatable(e,t,n,r){const i=Number(e?.timestamp)-Number(r?.timestamp);if(t?.initialSessionId&&!this.SESSION_ID&&(this.SESSION_ID=t.initialSessionId),"x-app-submit"===e?.data?._plugin?.type)return!0;if("bot"!==e.source&&this.firstBotMessageMap.delete(this.SESSION_ID),"user"===r?.source&&"setRating"===r?.data?._cognigy?.controlCommands?.[0]?.type&&!0===r?.data?._cognigy?.controlCommands?.[0]?.parameters?.showRatingStatus)return!1;const o=this.isMessageValid(n,t,e);return!this.firstBotMessageMap.get(this.SESSION_ID)&&o&&"bot"===e.source?(this.firstBotMessageMap.set(this.SESSION_ID,e),!1):r&&!1===isNaN(i)&&i<this.COLLATION_LIMIT&&r?.source===e?.source}},gC=e=>{const{action:t,className:n,config:i,hasReply:o,isConversationEnded:a,isFullscreen:s,message:l,onDismissFullscreen:c,onEmitAnalytics:u,onSetFullscreen:d,openXAppOverlay:p,onSetMessageAnimated:h,onSetLiveRegionText:f,plugins:m,prevMessage:g,"data-message-id":y}=e,A=(0,r.useContext)(Yt)??void 0,v=A?A.isMessageCollatable(l,i,m,g):mC.isMessageCollatable(l,i,m,g),b=!v&&!s&&!(e=>!!e?.data?._cognigy?._webchat3?.type)(l),[w,E]=(0,r.useState)("");(0,r.useEffect)(()=>{b||E(null)},[b]);const k=Dt("webchat-message-row",l.source,n,pC,v&&hC,s&&fC),C=aC(l,i,m),_=(0,r.useMemo)(()=>({hasReply:o,isConversationEnded:a}),[o,a]);if(!Array.isArray(C)||C.length<1)return null;if(s){const n=C[0]?.component;if(n)return(0,yt.jsx)(n,{isFullscreen:s,message:l,onDismissFullscreen:c,onEmitAnalytics:u,onSendMessage:t,onSetFullscreen:d,prevMessage:g,theme:e.theme,attributes:{styles:{flexGrow:1,minHeight:0}},onSetMessageAnimated:e.onSetMessageAnimated})}return(0,yt.jsx)(It,{action:t,config:i,message:l,messageParams:_,onEmitAnalytics:u,openXAppOverlay:p,"data-message-id":y,onSetLiveRegionText:f,headerInfo:w,onSetHeaderInfo:E,children:(0,yt.jsxs)("article",{...l.id?{id:l.id}:{},className:k,"data-message-id":y,children:[b&&(0,yt.jsx)(dC,{enableAvatar:"user"!==l.source}),C.map((n,r)=>n.component?(0,yt.jsx)(n.component,{attributes:{styles:{}},isFullscreen:s,message:l,onDismissFullscreen:c,onEmitAnalytics:u,onSendMessage:t,onSetFullscreen:d,prevMessage:g,theme:e.theme,onSetMessageAnimated:h},r):null),(0,yt.jsx)("div",{id:`webchat-focus-target-${y}`,tabIndex:-1,className:GA,"aria-hidden":"true"})]})})},yC={typingIndicator:"_typingIndicator_10ekn_1",disableBorder:"_disableBorder_10ekn_18",incoming:"_incoming_10ekn_23",outgoing:"_outgoing_10ekn_27",dot:"_dot_10ekn_31",dot1:"_dot1_10ekn_1",dot2:"_dot2_10ekn_1",dot3:"_dot3_10ekn_1"};var AC,vC;function bC(){if(vC)return AC;vC=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>y}),e=u,AC=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();const f=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,m=/user\/([a-zA-Z0-9_-]+)\/?/,g=/youtube-nocookie\.com/;class y extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"parsePlaylist",e=>{if(e instanceof Array)return{listType:"playlist",playlist:e.map(this.getID).join(",")};if(f.test(e)){const[,t]=e.match(f);return{listType:"playlist",list:t.replace(/^UC/,"UU")}}if(m.test(e)){const[,t]=e.match(m);return{listType:"user_uploads",list:t}}return{}}),c(this,"onStateChange",e=>{const{data:t}=e,{onPlay:n,onPause:r,onBuffer:i,onBufferEnd:o,onEnded:a,onReady:s,loop:l,config:{playerVars:c,onUnstarted:u}}=this.props,{UNSTARTED:d,PLAYING:p,PAUSED:h,BUFFERING:f,ENDED:m,CUED:g}=window.YT.PlayerState;if(t===d&&u(),t===p&&(n(),o()),t===h&&r(),t===f&&i(),t===m){const e=!!this.callPlayer("getPlaylist");l&&!e&&(c.start?this.seekTo(c.start):this.play()),a()}t===g&&s()}),c(this,"mute",()=>{this.callPlayer("mute")}),c(this,"unmute",()=>{this.callPlayer("unMute")}),c(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}getID(e){return!e||e instanceof Array||f.test(e)?null:e.match(h.MATCH_URL_YOUTUBE)[1]}load(e,t){const{playing:n,muted:r,playsinline:i,controls:o,loop:a,config:s,onError:l}=this.props,{playerVars:c,embedOptions:u}=s,d=this.getID(e);if(t)return f.test(e)||m.test(e)||e instanceof Array?void this.player.loadPlaylist(this.parsePlaylist(e)):void this.player.cueVideoById({videoId:d,startSeconds:(0,p.parseStartTime)(e)||c.start,endSeconds:(0,p.parseEndTime)(e)||c.end});(0,p.getSDK)("https://www.youtube.com/iframe_api","YT","onYouTubeIframeAPIReady",e=>e.loaded).then(t=>{this.container&&(this.player=new t.Player(this.container,{width:"100%",height:"100%",videoId:d,playerVars:{autoplay:n?1:0,mute:r?1:0,controls:o?1:0,start:(0,p.parseStartTime)(e),end:(0,p.parseEndTime)(e),origin:window.location.origin,playsinline:i?1:0,...this.parsePlaylist(e),...c},events:{onReady:()=>{a&&this.player.setLoop(!0),this.props.onReady()},onPlaybackRateChange:e=>this.props.onPlaybackRateChange(e.data),onPlaybackQualityChange:e=>this.props.onPlaybackQualityChange(e),onStateChange:this.onStateChange,onError:e=>l(e.data)},host:g.test(e)?"https://www.youtube-nocookie.com":void 0,...u}))},l),u.events&&console.warn("Using `embedOptions.events` will likely break things. Use ReactPlayer’s callback props instead, eg onReady, onPlay, onPause")}play(){this.callPlayer("playVideo")}pause(){this.callPlayer("pauseVideo")}stop(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}seekTo(e,t=!1){this.callPlayer("seekTo",e),t||this.props.playing||this.pause()}setVolume(e){this.callPlayer("setVolume",100*e)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}render(){const{display:e}=this.props,t={width:"100%",height:"100%",display:e};return d.default.createElement("div",{style:t},d.default.createElement("div",{ref:this.ref}))}}return c(y,"displayName","YouTube"),c(y,"canPlay",h.canPlay.youtube),AC}var wC=bC();const EC=wt({__proto__:null,default:kt(wC)},[wC]);var kC,CC;function _C(){if(CC)return kC;CC=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>f}),e=u,kC=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();class f extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"duration",null),c(this,"currentTime",null),c(this,"fractionLoaded",null),c(this,"mute",()=>{this.setVolume(0)}),c(this,"unmute",()=>{null!==this.props.volume&&this.setVolume(this.props.volume)}),c(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,t){(0,p.getSDK)("https://w.soundcloud.com/player/api.js","SC").then(n=>{if(!this.iframe)return;const{PLAY:r,PLAY_PROGRESS:i,PAUSE:o,FINISH:a,ERROR:s}=n.Widget.Events;t||(this.player=n.Widget(this.iframe),this.player.bind(r,this.props.onPlay),this.player.bind(o,()=>{this.duration-this.currentTime<.05||this.props.onPause()}),this.player.bind(i,e=>{this.currentTime=e.currentPosition/1e3,this.fractionLoaded=e.loadedProgress}),this.player.bind(a,()=>this.props.onEnded()),this.player.bind(s,e=>this.props.onError(e))),this.player.load(e,{...this.props.config.options,callback:()=>{this.player.getDuration(e=>{this.duration=e/1e3,this.props.onReady()})}})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("seekTo",1e3*e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",100*e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.fractionLoaded*this.duration}render(){const{display:e}=this.props,t={width:"100%",height:"100%",display:e};return d.default.createElement("iframe",{ref:this.ref,src:`https://w.soundcloud.com/player/?url=${encodeURIComponent(this.props.url)}`,style:t,frameBorder:0,allow:"autoplay"})}}return c(f,"displayName","SoundCloud"),c(f,"canPlay",h.canPlay.soundcloud),c(f,"loopOnEnded",!0),kC}var MC=_C();const TC=wt({__proto__:null,default:kt(MC)},[MC]);var SC,DC;function xC(){if(DC)return SC;DC=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>m}),e=u,SC=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();const f=e=>e.replace("/manage/videos","");class m extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"duration",null),c(this,"currentTime",null),c(this,"secondsLoaded",null),c(this,"mute",()=>{this.setMuted(!0)}),c(this,"unmute",()=>{this.setMuted(!1)}),c(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){this.duration=null,(0,p.getSDK)("https://player.vimeo.com/api/player.js","Vimeo").then(t=>{if(!this.container)return;const{playerOptions:n,title:r}=this.props.config;this.player=new t.Player(this.container,{url:f(e),autoplay:this.props.playing,muted:this.props.muted,loop:this.props.loop,playsinline:this.props.playsinline,controls:this.props.controls,...n}),this.player.ready().then(()=>{const e=this.container.querySelector("iframe");e.style.width="100%",e.style.height="100%",r&&(e.title=r)}).catch(this.props.onError),this.player.on("loaded",()=>{this.props.onReady(),this.refreshDuration()}),this.player.on("play",()=>{this.props.onPlay(),this.refreshDuration()}),this.player.on("pause",this.props.onPause),this.player.on("seeked",e=>this.props.onSeek(e.seconds)),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({seconds:e})=>{this.currentTime=e}),this.player.on("progress",({seconds:e})=>{this.secondsLoaded=e}),this.player.on("bufferstart",this.props.onBuffer),this.player.on("bufferend",this.props.onBufferEnd),this.player.on("playbackratechange",e=>this.props.onPlaybackRateChange(e.playbackRate))},this.props.onError)}refreshDuration(){this.player.getDuration().then(e=>{this.duration=e})}play(){const e=this.callPlayer("play");e&&e.catch(this.props.onError)}pause(){this.callPlayer("pause")}stop(){this.callPlayer("unload")}seekTo(e,t=!0){this.callPlayer("setCurrentTime",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setMuted(e){this.callPlayer("setMuted",e)}setLoop(e){this.callPlayer("setLoop",e)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const{display:e}=this.props,t={width:"100%",height:"100%",overflow:"hidden",display:e};return d.default.createElement("div",{key:this.props.url,ref:this.ref,style:t})}}return c(m,"displayName","Vimeo"),c(m,"canPlay",h.canPlay.vimeo),c(m,"forceLoad",!0),SC}var IC=xC();const LC=wt({__proto__:null,default:kt(IC)},[IC]);var PC,OC;function RC(){if(OC)return PC;OC=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>h}),e=u,PC=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Wm();class h extends d.Component{constructor(){super(...arguments),c(this,"onReady",(...e)=>this.props.onReady(...e)),c(this,"onPlay",(...e)=>this.props.onPlay(...e)),c(this,"onBuffer",(...e)=>this.props.onBuffer(...e)),c(this,"onBufferEnd",(...e)=>this.props.onBufferEnd(...e)),c(this,"onPause",(...e)=>this.props.onPause(...e)),c(this,"onEnded",(...e)=>this.props.onEnded(...e)),c(this,"onError",(...e)=>this.props.onError(...e)),c(this,"onPlayBackRateChange",e=>this.props.onPlaybackRateChange(e.target.playbackRate)),c(this,"onEnablePIP",(...e)=>this.props.onEnablePIP(...e)),c(this,"onSeek",e=>{this.props.onSeek(e.target.currentTime)}),c(this,"onDurationChange",()=>{const e=this.getDuration();this.props.onDuration(e)}),c(this,"mute",()=>{this.player.muted=!0}),c(this,"unmute",()=>{this.player.muted=!1}),c(this,"ref",e=>{this.player=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this),this.addListeners(this.player);const e=this.getPlaybackId(this.props.url);e&&(this.player.playbackId=e)}componentWillUnmount(){this.player.playbackId=null,this.removeListeners(this.player)}addListeners(e){const{playsinline:t}=this.props;e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("ratechange",this.onPlayBackRateChange),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),e.addEventListener("canplay",this.onReady),t&&e.setAttribute("playsinline","")}removeListeners(e){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("ratechange",this.onPlayBackRateChange),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("canplay",this.onReady)}async load(e){var t;const{onError:n,config:r}=this.props;if(!(null==(t=globalThis.customElements)?void 0:t.get("mux-player")))try{const e="https://cdn.jsdelivr.net/npm/@mux/mux-player@VERSION/dist/mux-player.mjs".replace("VERSION",r.version);await import(`${e}`),this.props.onLoaded()}catch(e){n(e)}const[,i]=e.match(p.MATCH_URL_MUX);this.player.playbackId=i}play(){const e=this.player.play();e&&e.catch(this.props.onError)}pause(){this.player.pause()}stop(){this.player.playbackId=null}seekTo(e,t=!0){this.player.currentTime=e,t||this.pause()}setVolume(e){this.player.volume=e}enablePIP(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player&&this.player.requestPictureInPicture()}disablePIP(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player&&document.exitPictureInPicture()}setPlaybackRate(e){try{this.player.playbackRate=e}catch(e){this.props.onError(e)}}getDuration(){if(!this.player)return null;const{duration:e,seekable:t}=this.player;return e===1/0&&t.length>0?t.end(t.length-1):e}getCurrentTime(){return this.player?this.player.currentTime:null}getSecondsLoaded(){if(!this.player)return null;const{buffered:e}=this.player;if(0===e.length)return 0;const t=e.end(e.length-1),n=this.getDuration();return t>n?n:t}getPlaybackId(e){const[,t]=e.match(p.MATCH_URL_MUX);return t}render(){const{url:e,playing:t,loop:n,controls:r,muted:i,config:o,width:a,height:s}=this.props,l={width:"auto"===a?a:"100%",height:"auto"===s?s:"100%"};return!1===r&&(l["--controls"]="none"),d.default.createElement("mux-player",{ref:this.ref,"playback-id":this.getPlaybackId(e),style:l,preload:"auto",autoPlay:t||void 0,muted:i?"":void 0,loop:n?"":void 0,...o.attributes})}}return c(h,"displayName","Mux"),c(h,"canPlay",p.canPlay.mux),PC}var BC=RC();const YC=wt({__proto__:null,default:kt(BC)},[BC]);var NC,VC;function FC(){if(VC)return NC;VC=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>g}),e=u,NC=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();const f="https://connect.facebook.net/en_US/sdk.js",m="fbAsyncInit";class g extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"playerID",this.props.config.playerId||`facebook-player-${(0,p.randomString)()}`),c(this,"mute",()=>{this.callPlayer("mute")}),c(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,t){t?(0,p.getSDK)(f,"FB",m).then(e=>e.XFBML.parse()):(0,p.getSDK)(f,"FB",m).then(e=>{e.init({appId:this.props.config.appId,xfbml:!0,version:this.props.config.version}),e.Event.subscribe("xfbml.render",e=>{this.props.onLoaded()}),e.Event.subscribe("xfbml.ready",e=>{"video"===e.type&&e.id===this.playerID&&(this.player=e.instance,this.player.subscribe("startedPlaying",this.props.onPlay),this.player.subscribe("paused",this.props.onPause),this.player.subscribe("finishedPlaying",this.props.onEnded),this.player.subscribe("startedBuffering",this.props.onBuffer),this.player.subscribe("finishedBuffering",this.props.onBufferEnd),this.player.subscribe("error",this.props.onError),this.props.muted?this.callPlayer("mute"):this.callPlayer("unmute"),this.props.onReady(),document.getElementById(this.playerID).querySelector("iframe").style.visibility="visible")})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("seek",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentPosition")}getSecondsLoaded(){return null}render(){const{attributes:e}=this.props.config;return d.default.createElement("div",{style:{width:"100%",height:"100%"},id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false",...e})}}return c(g,"displayName","Facebook"),c(g,"canPlay",h.canPlay.facebook),c(g,"loopOnEnded",!0),NC}var jC=FC();const HC=wt({__proto__:null,default:kt(jC)},[jC]);var qC,GC;function zC(){if(GC)return qC;GC=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>f}),e=u,qC=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();class f extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"duration",null),c(this,"currentTime",null),c(this,"secondsLoaded",null),c(this,"mute",()=>{this.callPlayer("mute")}),c(this,"unmute",()=>{this.callPlayer("unmute")}),c(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,p.getSDK)("https://cdn.embed.ly/player-0.1.0.min.js","playerjs").then(e=>{this.iframe&&(this.player=new e.Player(this.iframe),this.player.setLoop(this.props.loop),this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seeked",this.props.onSeek),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({duration:e,seconds:t})=>{this.duration=e,this.currentTime=t}),this.player.on("buffered",({percent:e})=>{this.duration&&(this.secondsLoaded=this.duration*e)}),this.props.muted&&this.player.mute())},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("setCurrentTime",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",100*e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const e=this.props.url.match(h.MATCH_URL_STREAMABLE)[1];return d.default.createElement("iframe",{ref:this.ref,src:`https://streamable.com/o/${e}`,frameBorder:"0",scrolling:"no",style:{width:"100%",height:"100%"},allow:"encrypted-media; autoplay; fullscreen;"})}}return c(f,"displayName","Streamable"),c(f,"canPlay",h.canPlay.streamable),qC}var UC=zC();const WC=wt({__proto__:null,default:kt(UC)},[UC]);var QC,ZC;function JC(){if(ZC)return QC;ZC=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>f}),e=u,QC=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();class f extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"playerID",this.props.config.playerId||`wistia-player-${(0,p.randomString)()}`),c(this,"onPlay",(...e)=>this.props.onPlay(...e)),c(this,"onPause",(...e)=>this.props.onPause(...e)),c(this,"onSeek",(...e)=>this.props.onSeek(...e)),c(this,"onEnded",(...e)=>this.props.onEnded(...e)),c(this,"onPlaybackRateChange",(...e)=>this.props.onPlaybackRateChange(...e)),c(this,"mute",()=>{this.callPlayer("mute")}),c(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:t,muted:n,controls:r,onReady:i,config:o,onError:a}=this.props;(0,p.getSDK)("https://fast.wistia.com/assets/external/E-v1.js","Wistia").then(e=>{o.customControls&&o.customControls.forEach(t=>e.defineControl(t)),window._wq=window._wq||[],window._wq.push({id:this.playerID,options:{autoPlay:t,silentAutoPlay:"allow",muted:n,controlsVisibleOnLoad:r,fullscreenButton:r,playbar:r,playbackRateControl:r,qualityControl:r,volumeControl:r,settingsControl:r,smallPlayButton:r,...o.options},onReady:e=>{this.player=e,this.unbind(),this.player.bind("play",this.onPlay),this.player.bind("pause",this.onPause),this.player.bind("seek",this.onSeek),this.player.bind("end",this.onEnded),this.player.bind("playbackratechange",this.onPlaybackRateChange),i()}})},a)}unbind(){this.player.unbind("play",this.onPlay),this.player.unbind("pause",this.onPause),this.player.unbind("seek",this.onSeek),this.player.unbind("end",this.onEnded),this.player.unbind("playbackratechange",this.onPlaybackRateChange)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.unbind(),this.callPlayer("remove")}seekTo(e,t=!0){this.callPlayer("time",e),t||this.pause()}setVolume(e){this.callPlayer("volume",e)}setPlaybackRate(e){this.callPlayer("playbackRate",e)}getDuration(){return this.callPlayer("duration")}getCurrentTime(){return this.callPlayer("time")}getSecondsLoaded(){return null}render(){const{url:e}=this.props,t=e&&e.match(h.MATCH_URL_WISTIA)[1],n=`wistia_embed wistia_async_${t}`;return d.default.createElement("div",{id:this.playerID,key:t,className:n,style:{width:"100%",height:"100%"}})}}return c(f,"displayName","Wistia"),c(f,"canPlay",h.canPlay.wistia),c(f,"loopOnEnded",!0),QC}var KC=JC();const XC=wt({__proto__:null,default:kt(KC)},[KC]);var $C,e_;function t_(){if(e_)return $C;e_=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>f}),e=u,$C=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();class f extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"playerID",this.props.config.playerId||`twitch-player-${(0,p.randomString)()}`),c(this,"mute",()=>{this.callPlayer("setMuted",!0)}),c(this,"unmute",()=>{this.callPlayer("setMuted",!1)})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,t){const{playsinline:n,onError:r,config:i,controls:o}=this.props,a=h.MATCH_URL_TWITCH_CHANNEL.test(e),s=a?e.match(h.MATCH_URL_TWITCH_CHANNEL)[1]:e.match(h.MATCH_URL_TWITCH_VIDEO)[1];t?a?this.player.setChannel(s):this.player.setVideo("v"+s):(0,p.getSDK)("https://player.twitch.tv/js/embed/v1.js","Twitch").then(t=>{this.player=new t.Player(this.playerID,{video:a?"":s,channel:a?s:"",height:"100%",width:"100%",playsinline:n,autoplay:this.props.playing,muted:this.props.muted,controls:!!a||o,time:(0,p.parseStartTime)(e),...i.options});const{READY:r,PLAYING:l,PAUSE:c,ENDED:u,ONLINE:d,OFFLINE:h,SEEK:f}=t.Player;this.player.addEventListener(r,this.props.onReady),this.player.addEventListener(l,this.props.onPlay),this.player.addEventListener(c,this.props.onPause),this.player.addEventListener(u,this.props.onEnded),this.player.addEventListener(f,this.props.onSeek),this.player.addEventListener(d,this.props.onLoaded),this.player.addEventListener(h,this.props.onLoaded)},r)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.callPlayer("pause")}seekTo(e,t=!0){this.callPlayer("seek",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return null}render(){return d.default.createElement("div",{style:{width:"100%",height:"100%"},id:this.playerID})}}return c(f,"displayName","Twitch"),c(f,"canPlay",h.canPlay.twitch),c(f,"loopOnEnded",!0),$C}var n_=t_();const r_=wt({__proto__:null,default:kt(n_)},[n_]);var i_,o_;function a_(){if(o_)return i_;o_=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>f}),e=u,i_=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();class f extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"onDurationChange",()=>{const e=this.getDuration();this.props.onDuration(e)}),c(this,"mute",()=>{this.callPlayer("setMuted",!0)}),c(this,"unmute",()=>{this.callPlayer("setMuted",!1)}),c(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{controls:t,config:n,onError:r,playing:i}=this.props,[,o]=e.match(h.MATCH_URL_DAILYMOTION);this.player?this.player.load(o,{start:(0,p.parseStartTime)(e),autoplay:i}):(0,p.getSDK)("https://api.dmcdn.net/all.js","DM","dmAsyncInit",e=>e.player).then(i=>{if(!this.container)return;const a=i.player;this.player=new a(this.container,{width:"100%",height:"100%",video:o,params:{controls:t,autoplay:this.props.playing,mute:this.props.muted,start:(0,p.parseStartTime)(e),origin:window.location.origin,...n.params},events:{apiready:this.props.onReady,seeked:()=>this.props.onSeek(this.player.currentTime),video_end:this.props.onEnded,durationchange:this.onDurationChange,pause:this.props.onPause,playing:this.props.onPlay,waiting:this.props.onBuffer,error:e=>r(e)}})},r)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("seek",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.player.duration||null}getCurrentTime(){return this.player.currentTime}getSecondsLoaded(){return this.player.bufferedTime}render(){const{display:e}=this.props,t={width:"100%",height:"100%",display:e};return d.default.createElement("div",{style:t},d.default.createElement("div",{ref:this.ref}))}}return c(f,"displayName","DailyMotion"),c(f,"canPlay",h.canPlay.dailymotion),c(f,"loopOnEnded",!0),i_}var s_=a_();const l_=wt({__proto__:null,default:kt(s_)},[s_]);var c_,u_;function d_(){if(u_)return c_;u_=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>f}),e=u,c_=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();class f extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"duration",null),c(this,"currentTime",null),c(this,"secondsLoaded",null),c(this,"mute",()=>{}),c(this,"unmute",()=>{}),c(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,p.getSDK)("https://widget.mixcloud.com/media/js/widgetApi.js","Mixcloud").then(e=>{this.player=e.PlayerWidget(this.iframe),this.player.ready.then(()=>{this.player.events.play.on(this.props.onPlay),this.player.events.pause.on(this.props.onPause),this.player.events.ended.on(this.props.onEnded),this.player.events.error.on(this.props.error),this.player.events.progress.on((e,t)=>{this.currentTime=e,this.duration=t}),this.props.onReady()})},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("seek",e),t||this.pause()}setVolume(e){}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return null}render(){const{url:e,config:t}=this.props,n=e.match(h.MATCH_URL_MIXCLOUD)[1],r=(0,p.queryString)({...t.options,feed:`/${n}/`});return d.default.createElement("iframe",{key:n,ref:this.ref,style:{width:"100%",height:"100%"},src:`https://www.mixcloud.com/widget/iframe/?${r}`,frameBorder:"0",allow:"autoplay"})}}return c(f,"displayName","Mixcloud"),c(f,"canPlay",h.canPlay.mixcloud),c(f,"loopOnEnded",!0),c_}var p_=d_();const h_=wt({__proto__:null,default:kt(p_)},[p_]);var f_,m_;function g_(){if(m_)return f_;m_=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>f}),e=u,f_=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();class f extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"mute",()=>{this.setVolume(0)}),c(this,"unmute",()=>{null!==this.props.volume&&this.setVolume(this.props.volume)}),c(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:t,config:n,onError:r,onDuration:i}=this.props,o=e&&e.match(h.MATCH_URL_VIDYARD)[1];this.player&&this.stop(),(0,p.getSDK)("https://play.vidyard.com/embed/v4.js","VidyardV4","onVidyardAPI").then(e=>{this.container&&(e.api.addReadyListener((e,t)=>{this.player||(this.player=t,this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seek",this.props.onSeek),this.player.on("playerComplete",this.props.onEnded))},o),e.api.renderPlayer({uuid:o,container:this.container,autoplay:t?1:0,...n.options}),e.api.getPlayerMetadata(o).then(e=>{this.duration=e.length_in_seconds,i(e.length_in_seconds)}))},r)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){window.VidyardV4.api.destroyPlayer(this.player)}seekTo(e,t=!0){this.callPlayer("seek",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setPlaybackRate(e){this.callPlayer("setPlaybackSpeed",e)}getDuration(){return this.duration}getCurrentTime(){return this.callPlayer("currentTime")}getSecondsLoaded(){return null}render(){const{display:e}=this.props,t={width:"100%",height:"100%",display:e};return d.default.createElement("div",{style:t},d.default.createElement("div",{ref:this.ref}))}}return c(f,"displayName","Vidyard"),c(f,"canPlay",h.canPlay.vidyard),f_}var y_=g_();const A_=wt({__proto__:null,default:kt(y_)},[y_]);var v_,b_;function w_(){if(b_)return v_;b_=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>f}),e=u,v_=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();class f extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"duration",null),c(this,"currentTime",null),c(this,"secondsLoaded",null),c(this,"mute",()=>{this.callPlayer("mute")}),c(this,"unmute",()=>{this.callPlayer("unmute")}),c(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,p.getSDK)("https://cdn.embed.ly/player-0.1.0.min.js","playerjs").then(e=>{this.iframe&&(this.player=new e.Player(this.iframe),this.player.on("ready",()=>{setTimeout(()=>{this.player.isReady=!0,this.player.setLoop(this.props.loop),this.props.muted&&this.player.mute(),this.addListeners(this.player,this.props),this.props.onReady()},500)}))},this.props.onError)}addListeners(e,t){e.on("play",t.onPlay),e.on("pause",t.onPause),e.on("ended",t.onEnded),e.on("error",t.onError),e.on("timeupdate",({duration:e,seconds:t})=>{this.duration=e,this.currentTime=t})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("setCurrentTime",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){return d.default.createElement("iframe",{ref:this.ref,src:this.props.url,frameBorder:"0",scrolling:"no",style:{width:"100%",height:"100%"},allow:"encrypted-media; autoplay; fullscreen;",referrerPolicy:"no-referrer-when-downgrade"})}}return c(f,"displayName","Kaltura"),c(f,"canPlay",h.canPlay.kaltura),v_}var E_=w_();const k_=wt({__proto__:null,default:kt(E_)},[E_]);var C_,__;function M_(){if(__)return C_;__=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>b}),e=u,C_=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();const f="undefined"!=typeof navigator,m=f&&"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,g=f&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||m)&&!window.MSStream,y=f&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream,A=/www\.dropbox\.com\/.+/,v=/https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/;class b extends d.Component{constructor(){super(...arguments),c(this,"onReady",(...e)=>this.props.onReady(...e)),c(this,"onPlay",(...e)=>this.props.onPlay(...e)),c(this,"onBuffer",(...e)=>this.props.onBuffer(...e)),c(this,"onBufferEnd",(...e)=>this.props.onBufferEnd(...e)),c(this,"onPause",(...e)=>this.props.onPause(...e)),c(this,"onEnded",(...e)=>this.props.onEnded(...e)),c(this,"onError",(...e)=>this.props.onError(...e)),c(this,"onPlayBackRateChange",e=>this.props.onPlaybackRateChange(e.target.playbackRate)),c(this,"onEnablePIP",(...e)=>this.props.onEnablePIP(...e)),c(this,"onDisablePIP",e=>{const{onDisablePIP:t,playing:n}=this.props;t(e),n&&this.play()}),c(this,"onPresentationModeChange",e=>{if(this.player&&(0,p.supportsWebKitPresentationMode)(this.player)){const{webkitPresentationMode:t}=this.player;"picture-in-picture"===t?this.onEnablePIP(e):"inline"===t&&this.onDisablePIP(e)}}),c(this,"onSeek",e=>{this.props.onSeek(e.target.currentTime)}),c(this,"mute",()=>{this.player.muted=!0}),c(this,"unmute",()=>{this.player.muted=!1}),c(this,"renderSourceElement",(e,t)=>"string"==typeof e?d.default.createElement("source",{key:t,src:e}):d.default.createElement("source",{key:t,...e})),c(this,"renderTrack",(e,t)=>d.default.createElement("track",{key:t,...e})),c(this,"ref",e=>{this.player&&(this.prevPlayer=this.player),this.player=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this),this.addListeners(this.player);const e=this.getSource(this.props.url);e&&(this.player.src=e),(g||this.props.config.forceDisableHls)&&this.player.load()}componentDidUpdate(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&(this.removeListeners(this.prevPlayer,e.url),this.addListeners(this.player)),this.props.url===e.url||(0,p.isMediaStream)(this.props.url)||this.props.url instanceof Array||(this.player.srcObject=null)}componentWillUnmount(){this.player.removeAttribute("src"),this.removeListeners(this.player),this.hls&&this.hls.destroy()}addListeners(e){const{url:t,playsinline:n}=this.props;e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("ratechange",this.onPlayBackRateChange),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.addEventListener("canplay",this.onReady),n&&(e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e.setAttribute("x5-playsinline",""))}removeListeners(e,t){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("ratechange",this.onPlayBackRateChange),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.removeEventListener("canplay",this.onReady)}shouldUseAudio(e){return!e.config.forceVideo&&(!e.config.attributes.poster&&(h.AUDIO_EXTENSIONS.test(e.url)||e.config.forceAudio))}shouldUseHLS(e){return!!(y&&this.props.config.forceSafariHLS||this.props.config.forceHLS)||!g&&!this.props.config.forceDisableHls&&(h.HLS_EXTENSIONS.test(e)||v.test(e))}shouldUseDASH(e){return h.DASH_EXTENSIONS.test(e)||this.props.config.forceDASH}shouldUseFLV(e){return h.FLV_EXTENSIONS.test(e)||this.props.config.forceFLV}load(e){const{hlsVersion:t,hlsOptions:n,dashVersion:r,flvVersion:i}=this.props.config;if(this.hls&&this.hls.destroy(),this.dash&&this.dash.reset(),this.shouldUseHLS(e)&&(0,p.getSDK)("https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js".replace("VERSION",t),"Hls").then(t=>{if(this.hls=new t(n),this.hls.on(t.Events.MANIFEST_PARSED,()=>{this.props.onReady()}),this.hls.on(t.Events.ERROR,(e,n)=>{this.props.onError(e,n,this.hls,t)}),v.test(e)){const t=e.match(v)[1];this.hls.loadSource("https://videodelivery.net/{id}/manifest/video.m3u8".replace("{id}",t))}else this.hls.loadSource(e);this.hls.attachMedia(this.player),this.props.onLoaded()}),this.shouldUseDASH(e)&&(0,p.getSDK)("https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js".replace("VERSION",r),"dashjs").then(t=>{this.dash=t.MediaPlayer().create(),this.dash.initialize(this.player,e,this.props.playing),this.dash.on("error",this.props.onError),parseInt(r)<3?this.dash.getDebug().setLogToBrowserConsole(!1):this.dash.updateSettings({debug:{logLevel:t.Debug.LOG_LEVEL_NONE}}),this.props.onLoaded()}),this.shouldUseFLV(e)&&(0,p.getSDK)("https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js".replace("VERSION",i),"flvjs").then(t=>{this.flv=t.createPlayer({type:"flv",url:e}),this.flv.attachMediaElement(this.player),this.flv.on(t.Events.ERROR,(e,n)=>{this.props.onError(e,n,this.flv,t)}),this.flv.load(),this.props.onLoaded()}),e instanceof Array)this.player.load();else if((0,p.isMediaStream)(e))try{this.player.srcObject=e}catch(t){this.player.src=window.URL.createObjectURL(e)}}play(){const e=this.player.play();e&&e.catch(this.props.onError)}pause(){this.player.pause()}stop(){this.player.removeAttribute("src"),this.dash&&this.dash.reset()}seekTo(e,t=!0){this.player.currentTime=e,t||this.pause()}setVolume(e){this.player.volume=e}enablePIP(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():(0,p.supportsWebKitPresentationMode)(this.player)&&"picture-in-picture"!==this.player.webkitPresentationMode&&this.player.webkitSetPresentationMode("picture-in-picture")}disablePIP(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():(0,p.supportsWebKitPresentationMode)(this.player)&&"inline"!==this.player.webkitPresentationMode&&this.player.webkitSetPresentationMode("inline")}setPlaybackRate(e){try{this.player.playbackRate=e}catch(e){this.props.onError(e)}}getDuration(){if(!this.player)return null;const{duration:e,seekable:t}=this.player;return e===1/0&&t.length>0?t.end(t.length-1):e}getCurrentTime(){return this.player?this.player.currentTime:null}getSecondsLoaded(){if(!this.player)return null;const{buffered:e}=this.player;if(0===e.length)return 0;const t=e.end(e.length-1),n=this.getDuration();return t>n?n:t}getSource(e){const t=this.shouldUseHLS(e),n=this.shouldUseDASH(e),r=this.shouldUseFLV(e);if(!(e instanceof Array||(0,p.isMediaStream)(e)||t||n||r))return A.test(e)?e.replace("www.dropbox.com","dl.dropboxusercontent.com"):e}render(){const{url:e,playing:t,loop:n,controls:r,muted:i,config:o,width:a,height:s}=this.props,l=this.shouldUseAudio(this.props)?"audio":"video",c={width:"auto"===a?a:"100%",height:"auto"===s?s:"100%"};return d.default.createElement(l,{ref:this.ref,src:this.getSource(e),style:c,preload:"auto",autoPlay:t||void 0,controls:r,muted:i,loop:n,...o.attributes},e instanceof Array&&e.map(this.renderSourceElement),o.tracks.map(this.renderTrack))}}return c(b,"displayName","FilePlayer"),c(b,"canPlay",h.canPlay.file),C_}var T_=M_();const S_=wt({__proto__:null,default:kt(T_)},[T_]);var D_,x_;function I_(){if(x_)return D_;x_=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>f}),e=u,D_=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r);const p="64px",h={};class f extends d.Component{constructor(){super(...arguments),c(this,"mounted",!1),c(this,"state",{image:null}),c(this,"handleKeyPress",e=>{"Enter"!==e.key&&" "!==e.key||this.props.onClick()})}componentDidMount(){this.mounted=!0,this.fetchImage(this.props)}componentDidUpdate(e){const{url:t,light:n}=this.props;e.url===t&&e.light===n||this.fetchImage(this.props)}componentWillUnmount(){this.mounted=!1}fetchImage({url:e,light:t,oEmbedUrl:n}){if(!d.default.isValidElement(t))if("string"!=typeof t){if(!h[e])return this.setState({image:null}),window.fetch(n.replace("{url}",e)).then(e=>e.json()).then(t=>{if(t.thumbnail_url&&this.mounted){const n=t.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");this.setState({image:n}),h[e]=n}});this.setState({image:h[e]})}else this.setState({image:t})}render(){const{light:e,onClick:t,playIcon:n,previewTabIndex:r,previewAriaLabel:i}=this.props,{image:o}=this.state,a=d.default.isValidElement(e),s={display:"flex",alignItems:"center",justifyContent:"center"},l={preview:{width:"100%",height:"100%",backgroundImage:o&&!a?`url(${o})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...s},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:p,width:p,height:p,position:a?"absolute":void 0,...s},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},c=d.default.createElement("div",{style:l.shadow,className:"react-player__shadow"},d.default.createElement("div",{style:l.playIcon,className:"react-player__play-icon"}));return d.default.createElement("div",{style:l.preview,className:"react-player__preview",onClick:t,tabIndex:r,onKeyPress:this.handleKeyPress,...i?{"aria-label":i}:{}},a?e:null,n||c)}}return D_}var L_=I_();const P_=wt({__proto__:null,default:kt(L_)},[L_]);var O_=r.createContext(null);var R_=function(e){e()},B_=function(){return R_};var Y_={notify:function(){},get:function(){return[]}};function N_(e,t){var n,r=Y_;function i(){a.onStateChange&&a.onStateChange()}function o(){n||(n=t?t.addNestedSub(i):e.subscribe(i),r=function(){var e=B_(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e(function(){for(var e=t;e;)e.callback(),e=e.next})},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,i=n={callback:e,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){r&&null!==t&&(r=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}())}var a={addNestedSub:function(e){return o(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:i,isSubscribed:function(){return Boolean(n)},trySubscribe:o,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=Y_)},getListeners:function(){return r}};return a}var V_="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.useLayoutEffect:r.useEffect;const F_=function(e){var t=e.store,n=e.context,i=e.children,o=(0,r.useMemo)(function(){var e=N_(t);return{store:t,subscription:e}},[t]),a=(0,r.useMemo)(function(){return t.getState()},[t]);V_(function(){var e=o.subscription;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),a!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}},[o,a]);var s=n||O_;return r.createElement(s.Provider,{value:o},i)};function j_(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}var H_=i(6456),q_=i.n(H_),G_=i(3443),z_=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],U_=["reactReduxForwardedRef"],W_=[],Q_=[null,null];function Z_(e,t){var n=e[1];return[t.payload,n+1]}function J_(e,t,n){V_(function(){return e.apply(void 0,t)},n)}function K_(e,t,n,r,i,o,a){e.current=r,t.current=i,n.current=!1,o.current&&(o.current=null,a())}function X_(e,t,n,r,i,o,a,s,l,c){if(e){var u=!1,d=null,p=function(){if(!u){var e,n,p=t.getState();try{e=r(p,i.current)}catch(e){n=e,d=e}n||(d=null),e===o.current?a.current||l():(o.current=e,s.current=e,a.current=!0,c({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=p,n.trySubscribe(),p();return function(){if(u=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var $_=function(){return[null,0]};function eM(e,t){void 0===t&&(t={});var n=t,i=n.getDisplayName,o=void 0===i?function(e){return"ConnectAdvanced("+e+")"}:i,a=n.methodName,l=void 0===a?"connectAdvanced":a,c=n.renderCountProp,u=void 0===c?void 0:c,d=n.shouldHandleStateChanges,p=void 0===d||d,h=n.storeKey,f=void 0===h?"store":h,m=(n.withRef,n.forwardRef),g=void 0!==m&&m,y=n.context,A=void 0===y?O_:y,v=j_(n,z_),b=A;return function(t){var n=t.displayName||t.name||"Component",i=o(n),a=s({},v,{getDisplayName:o,methodName:l,renderCountProp:u,shouldHandleStateChanges:p,storeKey:f,displayName:i,wrappedComponentName:n,WrappedComponent:t}),c=v.pure;var d=c?r.useMemo:function(e){return e()};function h(n){var i=(0,r.useMemo)(function(){var e=n.reactReduxForwardedRef,t=j_(n,U_);return[n.context,e,t]},[n]),o=i[0],l=i[1],c=i[2],u=(0,r.useMemo)(function(){return o&&o.Consumer&&(0,G_.isContextConsumer)(r.createElement(o.Consumer,null))?o:b},[o,b]),h=(0,r.useContext)(u),f=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(h)&&Boolean(h.store);var m=f?n.store:h.store,g=(0,r.useMemo)(function(){return function(t){return e(t.dispatch,a)}(m)},[m]),y=(0,r.useMemo)(function(){if(!p)return Q_;var e=N_(m,f?null:h.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]},[m,f,h]),A=y[0],v=y[1],w=(0,r.useMemo)(function(){return f?h:s({},h,{subscription:A})},[f,h,A]),E=(0,r.useReducer)(Z_,W_,$_),k=E[0][0],C=E[1];if(k&&k.error)throw k.error;var _=(0,r.useRef)(),M=(0,r.useRef)(c),T=(0,r.useRef)(),S=(0,r.useRef)(!1),D=d(function(){return T.current&&c===M.current?T.current:g(m.getState(),c)},[m,k,c]);J_(K_,[M,_,S,c,D,T,v]),J_(X_,[p,m,A,g,M,_,S,T,v,C],[m,A,g]);var x=(0,r.useMemo)(function(){return r.createElement(t,s({},D,{ref:l}))},[l,t,D]);return(0,r.useMemo)(function(){return p?r.createElement(u.Provider,{value:w},x):x},[u,x,w])}var m=c?r.memo(h):h;if(m.WrappedComponent=t,m.displayName=h.displayName=i,g){var y=r.forwardRef(function(e,t){return r.createElement(m,s({},e,{reactReduxForwardedRef:t}))});return y.displayName=i,y.WrappedComponent=t,q_()(y,t)}return q_()(m,t)}}function tM(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function nM(e,t){if(tM(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!tM(e[n[i]],t[n[i]]))return!1;return!0}function rM(e){return function(t,n){var r=e(t,n);function i(){return r}return i.dependsOnOwnProps=!1,i}}function iM(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function oM(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=iM(e);var i=r(t,n);return"function"==typeof i&&(r.mapToProps=i,r.dependsOnOwnProps=iM(i),i=r(t,n)),i},r}}const aM=[function(e){return"function"==typeof e?oM(e):void 0},function(e){return e?void 0:rM(function(e){return{dispatch:e}})},function(e){return e&&"object"==typeof e?rM(function(t){return function(e,t){var n={},r=function(r){var i=e[r];"function"==typeof i&&(n[r]=function(){return t(i.apply(void 0,arguments))})};for(var i in e)r(i);return n}(e,t)}):void 0}];const sM=[function(e){return"function"==typeof e?oM(e):void 0},function(e){return e?void 0:rM(function(){return{}})}];function lM(e,t,n){return s({},n,e,t)}const cM=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,i=n.pure,o=n.areMergedPropsEqual,a=!1;return function(t,n,s){var l=e(t,n,s);return a?i&&o(l,r)||(r=l):(a=!0,r=l),r}}}(e):void 0},function(e){return e?void 0:function(){return lM}}];var uM=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function dM(e,t,n,r){return function(i,o){return n(e(i,o),t(r,o),o)}}function pM(e,t,n,r,i){var o,a,s,l,c,u=i.areStatesEqual,d=i.areOwnPropsEqual,p=i.areStatePropsEqual,h=!1;function f(i,h){var f,m,g=!d(h,a),y=!u(i,o,h,a);return o=i,a=h,g&&y?(s=e(o,a),t.dependsOnOwnProps&&(l=t(r,a)),c=n(s,l,a)):g?(e.dependsOnOwnProps&&(s=e(o,a)),t.dependsOnOwnProps&&(l=t(r,a)),c=n(s,l,a)):y?(f=e(o,a),m=!p(f,s),s=f,m&&(c=n(s,l,a)),c):c}return function(i,u){return h?f(i,u):(s=e(o=i,a=u),l=t(r,a),c=n(s,l,a),h=!0,c)}}function hM(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,i=t.initMergeProps,o=j_(t,uM),a=n(e,o),s=r(e,o),l=i(e,o);return(o.pure?pM:dM)(a,s,l,e,o)}var fM=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function mM(e,t,n){for(var r=t.length-1;r>=0;r--){var i=t[r](e);if(i)return i}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function gM(e,t){return e===t}function yM(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?eM:n,i=t.mapStateToPropsFactories,o=void 0===i?sM:i,a=t.mapDispatchToPropsFactories,l=void 0===a?aM:a,c=t.mergePropsFactories,u=void 0===c?cM:c,d=t.selectorFactory,p=void 0===d?hM:d;return function(e,t,n,i){void 0===i&&(i={});var a=i,c=a.pure,d=void 0===c||c,h=a.areStatesEqual,f=void 0===h?gM:h,m=a.areOwnPropsEqual,g=void 0===m?nM:m,y=a.areStatePropsEqual,A=void 0===y?nM:y,v=a.areMergedPropsEqual,b=void 0===v?nM:v,w=j_(a,fM),E=mM(e,o,"mapStateToProps"),k=mM(t,l,"mapDispatchToProps"),C=mM(n,u,"mergeProps");return r(p,s({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:E,initMapDispatchToProps:k,initMergeProps:C,pure:d,areStatesEqual:f,areOwnPropsEqual:g,areStatePropsEqual:A,areMergedPropsEqual:b},w))}}const AM=yM();function vM(){return(0,r.useContext)(O_)}function bM(e){void 0===e&&(e=O_);var t=e===O_?vM:function(){return(0,r.useContext)(e)};return function(){return t().store}}var wM=bM();function EM(e){void 0===e&&(e=O_);var t=e===O_?wM:bM(e);return function(){return t().dispatch}}var kM=EM(),CM=function(e,t){return e===t};function _M(e){void 0===e&&(e=O_);var t=e===O_?vM:function(){return(0,r.useContext)(e)};return function(e,n){void 0===n&&(n=CM);var i=t(),o=function(e,t,n,i){var o,a=(0,r.useReducer)(function(e){return e+1},0),s=a[1],l=(0,r.useMemo)(function(){return N_(n,i)},[n,i]),c=(0,r.useRef)(),u=(0,r.useRef)(),d=(0,r.useRef)(),p=(0,r.useRef)(),h=n.getState();try{if(e!==u.current||h!==d.current||c.current){var f=e(h);o=void 0!==p.current&&t(f,p.current)?p.current:f}else o=p.current}catch(e){throw c.current&&(e.message+="\nThe error may be correlated with this previous error:\n"+c.current.stack+"\n\n"),e}return V_(function(){u.current=e,d.current=h,p.current=o,c.current=void 0}),V_(function(){function e(){try{var e=n.getState();if(e===d.current)return;var r=u.current(e);if(t(r,p.current))return;p.current=r,d.current=e}catch(e){c.current=e}s()}return l.onStateChange=e,l.trySubscribe(),e(),function(){return l.tryUnsubscribe()}},[n,l]),o}(e,n,i.store,i.subscription);return(0,r.useDebugValue)(o),o}}var MM,TM=_M();MM=At.unstable_batchedUpdates,R_=MM;const SM={match:e=>!!(e=>{const{source:t,data:n}=e;if("user"===t&&"setRating"===n?._cognigy?.controlCommands?.[0]?.type&&!0===n?._cognigy?.controlCommands?.[0]?.parameters?.showRatingStatus){const{comment:t,rating:n}=e?.data?._cognigy?.controlCommands?.[0]?.parameters||{};return{comment:t,rating:n}}if(void 0!==e?.rating){const{rating:t,ratingComment:n}=e;return{rating:t,comment:n}}return null})(e),component:()=>{const e=TM(e=>e.rating.requestRatingChatStatusBadgeText);return r.createElement(iC,{text:e||"Feedback submitted"})},options:{fullwidth:!0}};(e=>{window&&(window.cognigyWebchatMessagePlugins=[...window.cognigyWebchatMessagePlugins||[],e],console.debug("added cognigy message plugin"))})(SM);function DM(e){return DM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},DM(e)}function xM(e){var t=function(e,t){if("object"!=DM(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=DM(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==DM(t)?t:t+""}function IM(e,t,n){return(t=xM(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function PM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LM(Object(n),!0).forEach(function(t){IM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function OM(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var RM="function"==typeof Symbol&&Symbol.observable||"@@observable",BM=function(){return Math.random().toString(36).substring(7).split("").join(".")},YM={INIT:"@@redux/INIT"+BM(),REPLACE:"@@redux/REPLACE"+BM(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+BM()}};function NM(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function VM(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(OM(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(OM(1));return n(VM)(e,t)}if("function"!=typeof e)throw new Error(OM(2));var i=e,o=t,a=[],s=a,l=!1;function c(){s===a&&(s=a.slice())}function u(){if(l)throw new Error(OM(3));return o}function d(e){if("function"!=typeof e)throw new Error(OM(4));if(l)throw new Error(OM(5));var t=!0;return c(),s.push(e),function(){if(t){if(l)throw new Error(OM(6));t=!1,c();var n=s.indexOf(e);s.splice(n,1),a=null}}}function p(e){if(!NM(e))throw new Error(OM(7));if(void 0===e.type)throw new Error(OM(8));if(l)throw new Error(OM(9));try{l=!0,o=i(o,e)}finally{l=!1}for(var t=a=s,n=0;n<t.length;n++){(0,t[n])()}return e}return p({type:YM.INIT}),(r={dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(OM(10));i=e,p({type:YM.REPLACE})}})[RM]=function(){var e,t=d;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(OM(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[RM]=function(){return this},e},r}function FM(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var i=t[r];0,"function"==typeof e[i]&&(n[i]=e[i])}var o,a=Object.keys(n);try{!function(e){Object.keys(e).forEach(function(t){var n=e[t];if(void 0===n(void 0,{type:YM.INIT}))throw new Error(OM(12));if(void 0===n(void 0,{type:YM.PROBE_UNKNOWN_ACTION()}))throw new Error(OM(13))})}(n)}catch(e){o=e}return function(e,t){if(void 0===e&&(e={}),o)throw o;for(var r=!1,i={},s=0;s<a.length;s++){var l=a[s],c=n[l],u=e[l],d=c(u,t);if(void 0===d){t&&t.type;throw new Error(OM(14))}i[l]=d,r=r||d!==u}return(r=r||a.length!==Object.keys(e).length)?i:e}}function jM(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}function HM(){return String(Math.random()).slice(2,18)}const qM=/^[\s\b]+$/u;const GM={messageHistory:[],visibleOutputMessages:[],currentlyAnimatingId:null},zM=(e,t)=>({type:"ADD_MESSAGE",message:e,unseen:t}),UM="CLEAR_MESSAGES",WM=()=>({type:UM}),QM=e=>e.data?._cognigy?._messageId,ZM=(e,t,n)=>!(e||"engagement"===t.source&&n||(e=>!!e.data?._plugin)(t)),JM=e=>(t=GM,n)=>{switch(n.type){case"ADD_MESSAGE_EVENT":return{...t,messageHistory:[...t.messageHistory,n.event]};case"ADD_MESSAGE":{const i=n.message,o=e().config?.settings?.behavior?.collateStreamedOutputs,a=e().config?.settings?.behavior?.progressiveMessageRendering,s=!1===e().config?.settings?.teaserMessage?.showInChat;if(!o&&!a||"bot"!==i.source&&"engagement"!==i.source)return{...t,messageHistory:[...t.messageHistory,i]};const l=t.visibleOutputMessages;let c=QM(i),u=t.currentlyAnimatingId;if(!i.text&&!c){const e=function(e){const{_facebook:t,_webchat:n}=e?.data?._cognigy||{},r=n||t||{};return!!(r?.message?.quick_replies&&r.message.quick_replies.length>0)||"button"===r?.message?.attachment?.payload?.template_type||!!r?.message?.text}(i),n=HM();t.currentlyAnimatingId||l.push(n);return ZM(u,i,s)&&(u=e?n:null),{...t,messageHistory:[...t.messageHistory,{...i,id:n,animationState:e?"start":"done",finishReason:"stop"}],visibleOutputMessages:l,currentlyAnimatingId:u}}let d=-1;o&&c&&(d=t.messageHistory.findIndex(e=>{if("text"in e){const t=QM(e);if(t)return t===c}return!1}));const p=((e,t)=>t?e.data?._cognigy?._finishReason:"stop")(i,c);c&&o||(c=HM());if(ZM(u,i,s)&&(u=c),-1===d&&(!i.text||"string"==typeof(r=i.text)&&qM.test(r)))return t;if(-1===d){t.currentlyAnimatingId||l.push(c);const e=i.text.split(/(\n)/).filter(e=>e.length>0);return{...t,messageHistory:[...t.messageHistory,{...i,text:e,id:c,animationState:"start",finishReason:o?p:"stop"}],visibleOutputMessages:l,currentlyAnimatingId:u}}const h=t.messageHistory[d],f=[...t.messageHistory];if(p)return f[d]={...h,finishReason:p},{...t,messageHistory:f};const m=Array.isArray(h.text)?h.text:[h.text];let g="start";return"exited"===h.animationState&&(g="exited"),i.text||(g=h.animationState),f[d]={...h,text:[...m,i.text],animationState:g,finishReason:p},{...t,messageHistory:f}}case"SET_MESSAGE_ANIMATED":{const e=t.messageHistory.findIndex(e=>"id"in e&&e.id===n.messageId);if(-1===e)return t;const r=new Set(t.visibleOutputMessages);let i=t.currentlyAnimatingId;if("done"===n.animationState||"exited"===n.animationState){let n=!1;for(let o=e+1;o<t.messageHistory.length;o++){const e=t.messageHistory[o];if(("bot"===e.source||"engagement"===e.source)&&"id"in e&&(r.add(e.id),"start"===e.animationState&&!n)){i=e.id,n=!0;break}}n||(i=null)}const o=t.messageHistory.filter(e=>"id"in e&&r.has(e.id)).map(e=>"id"in e?e.id:"");return{...t,messageHistory:t.messageHistory.map(e=>"id"in e&&e.id===n.messageId?{...e,animationState:n.animationState}:e),visibleOutputMessages:o,currentlyAnimatingId:i}}case UM:return{...t,messageHistory:[]};default:return t}var r},{hidden:KM,visibilityChange:XM}=void 0!==document.hidden?{hidden:"hidden",visibilityChange:"visibilitychange"}:void 0!==document.msHidden?{hidden:"msHidden",visibilityChange:"msvisibilitychange"}:void 0!==document.webkitHidden?{hidden:"webkitHidden",visibilityChange:"webkitvisibilitychange"}:{hidden:void 0,visibilityChange:void 0},$M=()=>KM&&void 0!==document[KM],eT=()=>!$M()||!document[KM];$M()||console.log('Page visibility API seems to be unsupported, page will always count as "visible".');const tT="SET_OPEN",nT=e=>({type:tT,open:e}),rT="SET_MINIMIZE",iT="SET_SHOW_HOME_SCREEN",oT=e=>({type:iT,showHomeScreen:e}),aT="SET_SHOW_PREV_CONVERSATIONS",sT="SET_SHOW_CHAT_OPTIONS",lT=e=>({type:sT,showChatOptionsScreen:e}),cT="SET_TYPING",uT=e=>({type:cT,typing:e}),dT="SET_INPUT_MODE",pT="SET_FULLSCREEN_MESSAGE",hT=e=>({type:pT,fullscreenMessage:e}),fT="SET_AGENT_AVATAR_OVERRIDE_URL",mT="SET_BOT_AVATAR_OVERRIDE_URL",gT="SET_PAGE_VISIBLE",yT="SET_HAS_ACCEPTED_TERMS",AT=e=>({type:yT,userId:e}),vT="SET_STORED_MESSAGE",bT=e=>({type:vT,message:e}),wT="SET_TTS_ACTIVE",ET=e=>({type:wT,active:e}),kT="SET_LAST_INPUT_ID",CT=(e=(()=>({open:!1,typing:"remove",inputMode:"text",fullscreenMessage:void 0,agentAvatarOverrideUrl:void 0,botAvatarOverrideUrl:void 0,isPageVisible:eT(),showHomeScreen:!0,showPrevConversations:!1,showChatOptionsScreen:!1,hasAcceptedTerms:!1,storedMessage:null,ttsActive:!1,lastInputId:""}))(),t)=>{switch(t.type){case tT:return{...e,open:t.open};case rT:return{...e,open:!1};case cT:return{...e,typing:t.typing};case iT:return{...e,showHomeScreen:t.showHomeScreen};case aT:return{...e,showPrevConversations:t.showPrevConversations};case sT:return{...e,showChatOptionsScreen:t.showChatOptionsScreen};case dT:return{...e,inputMode:t.inputMode};case pT:return{...e,fullscreenMessage:t.fullscreenMessage};case fT:return{...e,agentAvatarOverrideUrl:t.url};case mT:return{...e,botAvatarOverrideUrl:t.url};case gT:return{...e,isPageVisible:t.visible};case yT:return{...e,hasAcceptedTerms:!0};case vT:return{...e,storedMessage:t.message};case wT:return{...e,ttsActive:t.active};case kT:return{...e,lastInputId:t.id}}return e},_T="SHOW_RATING_SCREEN",MT=e=>({type:_T,show:e}),TT="SET_HAS_GIVEN_RATING",ST="SET_REQUEST_RATING_SCREEN_TITLE",DT="SET_CUSTOM_RATING_TITLE",xT="SET_CUSTOM_RATING_COMMENT_TEXT",IT="SET_REQUEST_RATING_SUBMIT_BUTTON_TEXT",LT="SET_REQUEST_RATING_EVENT_BANNER_TEXT",PT="SET_REQUEST_RATING_CHAT_STATUS_BADGE_TEXT",OT={hasGivenRating:!1,showRatingScreen:!1,requestRatingScreenTitle:"",customRatingTitle:"",customRatingCommentText:"",requestRatingSubmitButtonText:"",requestRatingEventBannerText:"",requestRatingChatStatusBadgeText:""},RT=(e={hasGivenRating:!1,showRatingScreen:!1,requestRatingScreenTitle:"",customRatingTitle:"",customRatingCommentText:"",requestRatingSubmitButtonText:"",requestRatingEventBannerText:"",requestRatingChatStatusBadgeText:""},t)=>{switch(t.type){case _T:return!1===t.show?{...e,showRatingScreen:t.show,requestRatingScreenTitle:"",customRatingTitle:"",customRatingCommentText:"",requestRatingSubmitButtonText:"",requestRatingEventBannerText:""}:{...e,showRatingScreen:t.show};case TT:return{...e,hasGivenRating:!0};case ST:return{...e,requestRatingScreenTitle:t.text};case DT:return{...e,customRatingTitle:t.text};case xT:return{...e,customRatingCommentText:t.text};case IT:return{...e,requestRatingSubmitButtonText:t.text};case LT:return{...e,requestRatingEventBannerText:t.text};case PT:return{...e,requestRatingChatStatusBadgeText:t.text}}return e},BT=e=>{let t="";return e?.text?t=e.text:e?.data?._cognigy?._webchat?.message?.text?t=e.data._cognigy._webchat.message.text:"template"===e?.data?._cognigy?._webchat?.message?.attachment?.type&&"button"===e?.data?._cognigy?._webchat?.message?.attachment?.payload?.template_type&&(t=e.data._cognigy._webchat.message.attachment.payload.text),Array.isArray(t)&&(t=t.map(e=>e.replace(/(<([^>]+)>)/gi,""))),"string"==typeof t&&(t=t.replace(/(<([^>]+)>)/gi,"")),t},YT=BT;var NT=Symbol.for("immer-nothing"),VT=Symbol.for("immer-draftable"),FT=Symbol.for("immer-state");function jT(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var HT=Object,qT=HT.getPrototypeOf,GT="constructor",zT="prototype",UT="configurable",WT="enumerable",QT="writable",ZT="value",JT=e=>!!e&&!!e[FT];function KT(e){return!!e&&(eS(e)||aS(e)||!!e[VT]||!!e[GT]?.[VT]||sS(e)||lS(e))}var XT=HT[zT][GT].toString(),$T=new WeakMap;function eS(e){if(!e||!cS(e))return!1;const t=qT(e);if(null===t||t===HT[zT])return!0;const n=HT.hasOwnProperty.call(t,GT)&&t[GT];if(n===Object)return!0;if(!uS(n))return!1;let r=$T.get(n);return void 0===r&&(r=Function.toString.call(n),$T.set(n,r)),r===XT}function tS(e,t,n=!0){if(0===nS(e)){(n?Reflect.ownKeys(e):HT.keys(e)).forEach(n=>{t(n,e[n],e)})}else e.forEach((n,r)=>t(r,n,e))}function nS(e){const t=e[FT];return t?t.type_:aS(e)?1:sS(e)?2:lS(e)?3:0}var rS=(e,t,n=nS(e))=>2===n?e.has(t):HT[zT].hasOwnProperty.call(e,t),iS=(e,t,n=nS(e))=>2===n?e.get(t):e[t],oS=(e,t,n,r=nS(e))=>{2===r?e.set(t,n):3===r?e.add(n):e[t]=n};var aS=Array.isArray,sS=e=>e instanceof Map,lS=e=>e instanceof Set,cS=e=>"object"==typeof e,uS=e=>"function"==typeof e,dS=e=>"boolean"==typeof e;var pS=e=>e.copy_||e.base_,hS=e=>e.modified_?e.copy_:e.base_;function fS(e,t){if(sS(e))return new Map(e);if(lS(e))return new Set(e);if(aS(e))return Array[zT].slice.call(e);const n=eS(e);if(!0===t||"class_only"===t&&!n){const t=HT.getOwnPropertyDescriptors(e);delete t[FT];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const i=n[r],o=t[i];!1===o[QT]&&(o[QT]=!0,o[UT]=!0),(o.get||o.set)&&(t[i]={[UT]:!0,[QT]:!0,[WT]:o[WT],[ZT]:e[i]})}return HT.create(qT(e),t)}{const t=qT(e);if(null!==t&&n)return{...e};const r=HT.create(t);return HT.assign(r,e)}}function mS(e,t=!1){return yS(e)||JT(e)||!KT(e)||(nS(e)>1&&HT.defineProperties(e,{set:gS,add:gS,clear:gS,delete:gS}),HT.freeze(e),t&&tS(e,(e,t)=>{mS(t,!0)},!1)),e}var gS={[ZT]:function(){jT(2)}};function yS(e){return null===e||!cS(e)||HT.isFrozen(e)}var AS="MapSet",vS="Patches",bS="ArrayMethods",wS={};function ES(e){const t=wS[e];return t||jT(0),t}var kS,CS=e=>!!wS[e];var _S=()=>kS;function MS(e,t){t&&(e.patchPlugin_=ES(vS),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function TS(e){SS(e),e.drafts_.forEach(xS),e.drafts_=null}function SS(e){e===kS&&(kS=e.parent_)}var DS=e=>kS={drafts_:[],parent_:kS,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:CS(AS)?ES(AS):void 0,arrayMethodsPlugin_:CS(bS)?ES(bS):void 0};function xS(e){const t=e[FT];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function IS(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(void 0!==e&&e!==n){n[FT].modified_&&(TS(t),jT(4)),KT(e)&&(e=LS(t,e));const{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[FT].base_,e,t)}else e=LS(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&mS(t,n)}(t,e,!0),TS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==NT?e:void 0}function LS(e,t){if(yS(t))return t;const n=t[FT];if(!n){return VS(t,e.handledSet_,e)}if(!OS(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:t}=n;if(t)for(;t.length>0;){t.pop()(e)}YS(n,e)}return n.copy_}function PS(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var OS=(e,t)=>e.scope_===t,RS=[];function BS(e,t,n,r){const i=pS(e),o=e.type_;if(void 0!==r){if(iS(i,r,o)===t)return void oS(i,r,n,o)}if(!e.draftLocations_){const t=e.draftLocations_=new Map;tS(i,(e,n)=>{if(JT(n)){const r=t.get(n)||[];r.push(e),t.set(n,r)}})}const a=e.draftLocations_.get(t)??RS;for(const e of a)oS(i,e,n,o)}function YS(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:n}=t;if(n){const r=n.getPath(e);r&&n.generatePatches_(e,r,t)}PS(e)}}function NS(e,t,n){const{scope_:r}=e;if(JT(n)){const i=n[FT];OS(i,r)&&i.callbacks_.push(function(){zS(e);const r=hS(i);BS(e,n,r,t)})}else KT(n)&&e.callbacks_.push(function(){const i=pS(e);3===e.type_?i.has(n)&&VS(n,r.handledSet_,r):iS(i,t,e.type_)===n&&r.drafts_.length>1&&!0===(e.assigned_.get(t)??!1)&&e.copy_&&VS(iS(e.copy_,t,e.type_),r.handledSet_,r)})}function VS(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||JT(e)||t.has(e)||!KT(e)||yS(e)||(t.add(e),tS(e,(r,i)=>{if(JT(i)){const t=i[FT];if(OS(t,n)){const n=hS(t);oS(e,r,n,e.type_),PS(t)}}else KT(i)&&VS(i,t,n)})),e}var FS={get(e,t){if(t===FT)return e;let n=e.scope_.arrayMethodsPlugin_;const r=1===e.type_&&"string"==typeof t;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=pS(e);if(!rS(i,t,e.type_))return function(e,t,n){const r=qS(t,n);return r?ZT in r?r[ZT]:r.get?.call(e.draft_):void 0}(e,i,t);const o=i[t];if(e.finalized_||!KT(o))return o;if(r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&function(e){const t=+e;return Number.isInteger(t)&&String(t)===e}(t))return o;if(o===HS(e.base_,t)){zS(e);const n=1===e.type_?+t:t,r=US(e.scope_,o,e,n);return e.copy_[n]=r}return o},has:(e,t)=>t in pS(e),ownKeys:e=>Reflect.ownKeys(pS(e)),set(e,t,n){const r=qS(pS(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=HS(pS(e),t),i=r?.[FT];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(n,r)&&(void 0!==n||rS(e.base_,t,e.type_)))return!0;zS(e),GS(e)}return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),NS(e,t,n)),!0},deleteProperty:(e,t)=>(zS(e),void 0!==HS(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),GS(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=pS(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{[QT]:!0,[UT]:1!==e.type_||"length"!==t,[WT]:r[WT],[ZT]:n[t]}:r},defineProperty(){jT(11)},getPrototypeOf:e=>qT(e.base_),setPrototypeOf(){jT(12)}},jS={};for(let e in FS){let t=FS[e];jS[e]=function(){const e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function HS(e,t){const n=e[FT];return(n?pS(n):e)[t]}function qS(e,t){if(!(t in e))return;let n=qT(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=qT(n)}}function GS(e){e.modified_||(e.modified_=!0,e.parent_&&GS(e.parent_))}function zS(e){e.copy_||(e.assigned_=new Map,e.copy_=fS(e.base_,e.scope_.immer_.useStrictShallowCopy_))}jS.deleteProperty=function(e,t){return jS.set.call(this,e,t,void 0)},jS.set=function(e,t,n){return FS.set.call(this,e[0],t,n,e[0])};function US(e,t,n,r){const[i,o]=sS(t)?ES(AS).proxyMap_(t,n):lS(t)?ES(AS).proxySet_(t,n):function(e,t){const n=aS(e),r={type_:n?1:0,scope_:t?t.scope_:_S(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,o=FS;n&&(i=[r],o=jS);const{revoke:a,proxy:s}=Proxy.revocable(i,o);return r.draft_=s,r.revoke_=a,[s,r]}(t,n);return(n?.scope_??_S()).drafts_.push(i),o.callbacks_=n?.callbacks_??[],o.key_=r,n&&void 0!==r?function(e,t,n){e.callbacks_.push(function(r){const i=t;if(!i||!OS(i,r))return;r.mapSetPlugin_?.fixSetContents(i);const o=hS(i);BS(e,i.draft_??i,o,n),YS(i,r)})}(n,o,r):o.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(o);const{patchPlugin_:t}=e;o.modified_&&t&&t.generatePatches_(o,[],e)}),i}function WS(e){if(!KT(e)||yS(e))return e;const t=e[FT];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=fS(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=fS(e,!0);return tS(n,(e,t)=>{oS(n,e,WS(t))},r),t&&(t.finalized_=!1),n}var QS=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(uS(e)&&!uS(t)){const n=t;t=e;const r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}let r;if(uS(t)||jT(6),void 0===n||uS(n)||jT(7),KT(e)){const i=DS(this),o=US(i,e,void 0);let a=!0;try{r=t(o),a=!1}finally{a?TS(i):SS(i)}return MS(i,n),IS(r,i)}if(!e||!cS(e)){if(r=t(e),void 0===r&&(r=e),r===NT&&(r=void 0),this.autoFreeze_&&mS(r,!0),n){const t=[],i=[];ES(vS).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}jT(1)},this.produceWithPatches=(e,t)=>{if(uS(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;const i=this.produce(e,t,(e,t)=>{n=e,r=t});return[i,n,r]},dS(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),dS(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),dS(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){KT(e)||jT(8),JT(e)&&(e=function(e){JT(e)||jT(10);return WS(e)}(e));const t=DS(this),n=US(t,e,void 0);return n[FT].isManual_=!0,SS(t),n}finishDraft(e,t){const n=e&&e[FT];n&&n.isManual_||jT(9);const{scope_:r}=n;return MS(r,t),IS(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=ES(vS).applyPatches_;return JT(e)?r(e,t):this.produce(e,e=>r(e,t))}},ZS=QS.produce;function JS(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function KS(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__,"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function XS(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(cD(0));return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>function(e){return JS(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}Symbol.species;function $S(e){return KT(e)?ZS(e,()=>{}):e}function eD(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function tD(e){const t={},n=[];let r;const i={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(cD(28));if(r in t)throw new Error(cD(29));return t[r]=n,i},addAsyncThunk:(e,r)=>(r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),i),addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),i),addDefaultCase:e=>(r=e,i)};return e(i),[t,n,r]}var nD=Symbol.for("rtk-slice-createasyncthunk");function rD(e,t){return`${e}/${t}`}function iD({creators:e}={}){const t=e?.asyncThunk?.[nD];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error(cD(11));const i=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},o=Object.keys(i),a={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error(cD(12));if(n in a.sliceCaseReducersByType)throw new Error(cD(13));return a.sliceCaseReducersByType[n]=t,s},addMatcher:(e,t)=>(a.sliceMatchers.push({matcher:e,reducer:t}),s),exposeAction:(e,t)=>(a.actionCreators[e]=t,s),exposeCaseReducer:(e,t)=>(a.sliceCaseReducersByName[e]=t,s)};function l(){const[t={},n=[],r]="function"==typeof e.extraReducers?tD(e.extraReducers):[e.extraReducers],i={...t,...a.sliceCaseReducersByType};return function(e,t){let n,[r,i,o]=tD(t);if(function(e){return"function"==typeof e}(e))n=()=>$S(e());else{const t=$S(e);n=()=>t}function a(e=n(),t){let a=[r[t.type],...i.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return 0===a.filter(e=>!!e).length&&(a=[o]),a.reduce((e,n)=>{if(n){if(JT(e)){const r=n(e,t);return void 0===r?e:r}if(KT(e))return ZS(e,e=>n(e,t));{const r=n(e,t);if(void 0===r){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}}return e},e)}return a.getInitialState=n,a}(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of a.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)})}o.forEach(r=>{const o=i[r],a={reducerName:r,type:rD(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(o)?function({type:e,reducerName:t,createNotation:n},r,i){let o,a;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error(cD(17));o=r.reducer,a=r.prepare}else o=r;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,a?XS(e,a):XS(e))}(a,o,s):function({type:e,reducerName:t},n,r,i){if(!i)throw new Error(cD(18));const{payloadCreator:o,fulfilled:a,pending:s,rejected:l,settled:c,options:u}=n,d=i(e,o,u);r.exposeAction(t,d),a&&r.addCase(d.fulfilled,a);s&&r.addCase(d.pending,s);l&&r.addCase(d.rejected,l);c&&r.addMatcher(d.settled,c);r.exposeCaseReducer(t,{fulfilled:a||sD,pending:s||sD,rejected:l||sD,settled:c||sD})}(a,o,s,t)});const c=e=>e,u=new Map,d=new WeakMap;let p;function h(e,t){return p||(p=l()),p(e,t)}function f(){return p||(p=l()),p.getInitialState()}function m(t,n=!1){function r(e){let i=e[t];return void 0===i&&n&&(i=eD(d,r,f)),i}function i(t=c){const r=eD(u,n,()=>new WeakMap);return eD(r,t,()=>{const r={};for(const[i,o]of Object.entries(e.selectors??{}))r[i]=oD(o,t,()=>eD(d,t,f),n);return r})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}const g={name:n,reducer:h,actions:a.actionCreators,caseReducers:a.sliceCaseReducersByName,getInitialState:f,...m(r),injectInto(e,{reducerPath:t,...n}={}){const i=t??r;return e.inject({reducerPath:i,reducer:h},n),{...g,...m(i,!0)}}};return g}}function oD(e,t,n,r){function i(i,...o){let a=t(i);return void 0===a&&r&&(a=n()),e(a,...o)}return i.unwrapped=e,i}var aD=iD();function sD(){}var{assign:lD}=Object;Symbol.for("rtk-state-proxy-original");function cD(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const uD={isQueueActive:!1,position:null,estimatedWaitTime:null,alternativeText:null},dD=aD({name:"queueUpdates",initialState:uD,reducers:{updateQueueData(e,t){e.isQueueActive=!0,e.position=t.payload?.position||null,e.estimatedWaitTime=t.payload?.estimatedWaitTime||null,e.alternativeText=t.payload?.alternativeText||null},resetQueueData:()=>uD},extraReducers(e){e.addCase("RECEIVE_MESSAGE",(e,t)=>{const{message:n}=t;if("agent"===n?.source&&e?.isQueueActive)return uD})}}),{updateQueueData:pD,resetQueueData:hD}=dD.actions,fD=dD.reducer,mD=(e,t={})=>({type:"RECEIVE_MESSAGE",message:{...e},options:t}),gD=e=>t=>{if(t.data&&t.data._webchat){const{agentAvatarOverrideUrl:n,botAvatarOverrideUrl:r}=t.data._webchat;void 0!==n&&e.dispatch({type:fT,url:n}),void 0!==r&&e.dispatch((e=>({type:mT,url:e}))(r))}var n;if(t.data&&t.data._plugin){const{type:r,data:i}=t.data._plugin;"request-rating"===r&&(i&&i.ratingCommentText&&e.dispatch((n=i.ratingCommentText,{type:xT,text:n})),i&&i.ratingTitleText&&e.dispatch((e=>({type:DT,text:e}))(i.ratingTitleText)),i&&i.ratingSubmitButtonText&&e.dispatch((e=>({type:IT,text:e}))(i.ratingSubmitButtonText)),i&&i.ratingEventBannerText&&e.dispatch((e=>({type:LT,text:e}))(i.ratingEventBannerText)),i&&i.ratingChatStatusMessage&&e.dispatch((e=>({type:PT,text:e}))(i.ratingChatStatusMessage)),i&&i.ratingScreenTitleText&&e.dispatch((e=>({type:ST,text:e}))(i.ratingScreenTitleText)),e.dispatch(MT(!0)))}if(e.dispatch(uT("remove")),(e=>!!e?.data?._cognigy?._webchat3?.type)(t?.data)){const n=(e=>e?.data?._cognigy?._webchat3?.payload)(t?.data);(e=>!("queueUpdate"!==e?.data?._cognigy?._webchat3?.type))(t?.data)&&e.dispatch(pD(n))}else e.dispatch(mD(t))},{entries:yD,setPrototypeOf:AD,isFrozen:vD,getPrototypeOf:bD,getOwnPropertyDescriptor:wD}=Object;let{freeze:ED,seal:kD,create:CD}=Object,{apply:_D,construct:MD}="undefined"!=typeof Reflect&&Reflect;ED||(ED=function(e){return e}),kD||(kD=function(e){return e}),_D||(_D=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)}),MD||(MD=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const TD=jD(Array.prototype.forEach),SD=jD(Array.prototype.lastIndexOf),DD=jD(Array.prototype.pop),xD=jD(Array.prototype.push),ID=jD(Array.prototype.splice),LD=jD(String.prototype.toLowerCase),PD=jD(String.prototype.toString),OD=jD(String.prototype.match),RD=jD(String.prototype.replace),BD=jD(String.prototype.indexOf),YD=jD(String.prototype.trim),ND=jD(Object.prototype.hasOwnProperty),VD=jD(RegExp.prototype.test),FD=function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return MD(e,n)}}(TypeError);function jD(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return _D(e,t,r)}}function HD(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:LD;AD&&AD(e,null);let r=t.length;for(;r--;){let i=t[r];if("string"==typeof i){const e=n(i);e!==i&&(vD(t)||(t[r]=e),i=e)}e[i]=!0}return e}function qD(e){for(let t=0;t<e.length;t++){ND(e,t)||(e[t]=null)}return e}function GD(e){const t=CD(null);for(const[n,r]of yD(e)){ND(e,n)&&(Array.isArray(r)?t[n]=qD(r):r&&"object"==typeof r&&r.constructor===Object?t[n]=GD(r):t[n]=r)}return t}function zD(e,t){for(;null!==e;){const n=wD(e,t);if(n){if(n.get)return jD(n.get);if("function"==typeof n.value)return jD(n.value)}e=bD(e)}return function(){return null}}const UD=ED(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),WD=ED(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),QD=ED(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),ZD=ED(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),JD=ED(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),KD=ED(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),XD=ED(["#text"]),$D=ED(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),ex=ED(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),tx=ED(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),nx=ED(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rx=kD(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ix=kD(/<%[\w\W]*|[\w\W]*%>/gm),ox=kD(/\$\{[\w\W]*/gm),ax=kD(/^data-[\-\w.\u00B7-\uFFFF]+$/),sx=kD(/^aria-[\-\w]+$/),lx=kD(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),cx=kD(/^(?:\w+script|data):/i),ux=kD(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),dx=kD(/^html$/i),px=kD(/^[a-z][.\w]*(-[.\w]+)+$/i);var hx=Object.freeze({__proto__:null,ARIA_ATTR:sx,ATTR_WHITESPACE:ux,CUSTOM_ELEMENT:px,DATA_ATTR:ax,DOCTYPE_NAME:dx,ERB_EXPR:ix,IS_ALLOWED_URI:lx,IS_SCRIPT_OR_DATA:cx,MUSTACHE_EXPR:rx,TMPLIT_EXPR:ox});const fx=1,mx=3,gx=7,yx=8,Ax=9,vx=function(){return"undefined"==typeof window?null:window};var bx=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vx();const n=t=>e(t);if(n.version="3.4.0",n.removed=[],!t||!t.document||t.document.nodeType!==Ax||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const i=r,o=i.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:c,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:h,trustedTypes:f}=t,m=c.prototype,g=zD(m,"cloneNode"),y=zD(m,"remove"),A=zD(m,"nextSibling"),v=zD(m,"childNodes"),b=zD(m,"parentNode");if("function"==typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let w,E="";const{implementation:k,createNodeIterator:C,createDocumentFragment:_,getElementsByTagName:M}=r,{importNode:T}=i;let S={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof yD&&"function"==typeof b&&k&&void 0!==k.createHTMLDocument;const{MUSTACHE_EXPR:D,ERB_EXPR:x,TMPLIT_EXPR:I,DATA_ATTR:L,ARIA_ATTR:P,IS_SCRIPT_OR_DATA:O,ATTR_WHITESPACE:R,CUSTOM_ELEMENT:B}=hx;let{IS_ALLOWED_URI:Y}=hx,N=null;const V=HD({},[...UD,...WD,...QD,...JD,...XD]);let F=null;const j=HD({},[...$D,...ex,...tx,...nx]);let H=Object.seal(CD(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),q=null,G=null;const z=Object.seal(CD(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let U=!0,W=!0,Q=!1,Z=!0,J=!1,K=!0,X=!1,$=!1,ee=!1,te=!1,ne=!1,re=!1,ie=!0,oe=!1,ae=!0,se=!1,le={},ce=null;const ue=HD({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let de=null;const pe=HD({},["audio","video","img","source","image","track"]);let he=null;const fe=HD({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),me="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",ye="http://www.w3.org/1999/xhtml";let Ae=ye,ve=!1,be=null;const we=HD({},[me,ge,ye],PD);let Ee=HD({},["mi","mo","mn","ms","mtext"]),ke=HD({},["annotation-xml"]);const Ce=HD({},["title","style","font","a","script"]);let _e=null;const Me=["application/xhtml+xml","text/html"];let Te=null,Se=null;const De=r.createElement("form"),xe=function(e){return e instanceof RegExp||e instanceof Function},Ie=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Se||Se!==e){if(e&&"object"==typeof e||(e={}),e=GD(e),_e=-1===Me.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Te="application/xhtml+xml"===_e?PD:LD,N=ND(e,"ALLOWED_TAGS")?HD({},e.ALLOWED_TAGS,Te):V,F=ND(e,"ALLOWED_ATTR")?HD({},e.ALLOWED_ATTR,Te):j,be=ND(e,"ALLOWED_NAMESPACES")?HD({},e.ALLOWED_NAMESPACES,PD):we,he=ND(e,"ADD_URI_SAFE_ATTR")?HD(GD(fe),e.ADD_URI_SAFE_ATTR,Te):fe,de=ND(e,"ADD_DATA_URI_TAGS")?HD(GD(pe),e.ADD_DATA_URI_TAGS,Te):pe,ce=ND(e,"FORBID_CONTENTS")?HD({},e.FORBID_CONTENTS,Te):ue,q=ND(e,"FORBID_TAGS")?HD({},e.FORBID_TAGS,Te):GD({}),G=ND(e,"FORBID_ATTR")?HD({},e.FORBID_ATTR,Te):GD({}),le=!!ND(e,"USE_PROFILES")&&e.USE_PROFILES,U=!1!==e.ALLOW_ARIA_ATTR,W=!1!==e.ALLOW_DATA_ATTR,Q=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Z=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,J=e.SAFE_FOR_TEMPLATES||!1,K=!1!==e.SAFE_FOR_XML,X=e.WHOLE_DOCUMENT||!1,te=e.RETURN_DOM||!1,ne=e.RETURN_DOM_FRAGMENT||!1,re=e.RETURN_TRUSTED_TYPE||!1,ee=e.FORCE_BODY||!1,ie=!1!==e.SANITIZE_DOM,oe=e.SANITIZE_NAMED_PROPS||!1,ae=!1!==e.KEEP_CONTENT,se=e.IN_PLACE||!1,Y=e.ALLOWED_URI_REGEXP||lx,Ae=e.NAMESPACE||ye,Ee=e.MATHML_TEXT_INTEGRATION_POINTS||Ee,ke=e.HTML_INTEGRATION_POINTS||ke,H=e.CUSTOM_ELEMENT_HANDLING||CD(null),e.CUSTOM_ELEMENT_HANDLING&&xe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(H.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&xe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(H.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(H.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),J&&(W=!1),ne&&(te=!0),le&&(N=HD({},XD),F=CD(null),!0===le.html&&(HD(N,UD),HD(F,$D)),!0===le.svg&&(HD(N,WD),HD(F,ex),HD(F,nx)),!0===le.svgFilters&&(HD(N,QD),HD(F,ex),HD(F,nx)),!0===le.mathMl&&(HD(N,JD),HD(F,tx),HD(F,nx))),z.tagCheck=null,z.attributeCheck=null,e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?z.tagCheck=e.ADD_TAGS:(N===V&&(N=GD(N)),HD(N,e.ADD_TAGS,Te))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?z.attributeCheck=e.ADD_ATTR:(F===j&&(F=GD(F)),HD(F,e.ADD_ATTR,Te))),e.ADD_URI_SAFE_ATTR&&HD(he,e.ADD_URI_SAFE_ATTR,Te),e.FORBID_CONTENTS&&(ce===ue&&(ce=GD(ce)),HD(ce,e.FORBID_CONTENTS,Te)),e.ADD_FORBID_CONTENTS&&(ce===ue&&(ce=GD(ce)),HD(ce,e.ADD_FORBID_CONTENTS,Te)),ae&&(N["#text"]=!0),X&&HD(N,["html","head","body"]),N.table&&(HD(N,["tbody"]),delete q.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw FD('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw FD('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=e.TRUSTED_TYPES_POLICY,E=w.createHTML("")}else void 0===w&&(w=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(f,o)),null!==w&&"string"==typeof E&&(E=w.createHTML(""));ED&&ED(e),Se=e}},Le=HD({},[...WD,...QD,...ZD]),Pe=HD({},[...JD,...KD]),Oe=function(e){xD(n.removed,{element:e});try{b(e).removeChild(e)}catch(t){y(e)}},Re=function(e,t){try{xD(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){xD(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(te||ne)try{Oe(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Be=function(e){let t=null,n=null;if(ee)e="<remove></remove>"+e;else{const t=OD(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===_e&&Ae===ye&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const i=w?w.createHTML(e):e;if(Ae===ye)try{t=(new h).parseFromString(i,_e)}catch(e){}if(!t||!t.documentElement){t=k.createDocument(Ae,"template",null);try{t.documentElement.innerHTML=ve?E:i}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(r.createTextNode(n),o.childNodes[0]||null),Ae===ye?M.call(t,X?"html":"body")[0]:X?t.documentElement:o},Ye=function(e){return C.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Ne=function(e){return e instanceof p&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Ve=function(e){return"function"==typeof l&&e instanceof l};function Fe(e,t,r){TD(e,e=>{e.call(n,t,r,Se)})}const je=function(e){let t=null;if(Fe(S.beforeSanitizeElements,e,null),Ne(e))return Oe(e),!0;const r=Te(e.nodeName);if(Fe(S.uponSanitizeElement,e,{tagName:r,allowedTags:N}),K&&e.hasChildNodes()&&!Ve(e.firstElementChild)&&VD(/<[/\w!]/g,e.innerHTML)&&VD(/<[/\w!]/g,e.textContent))return Oe(e),!0;if(K&&e.namespaceURI===ye&&"style"===r&&Ve(e.firstElementChild))return Oe(e),!0;if(e.nodeType===gx)return Oe(e),!0;if(K&&e.nodeType===yx&&VD(/<[/\w]/g,e.data))return Oe(e),!0;if(q[r]||!(z.tagCheck instanceof Function&&z.tagCheck(r))&&!N[r]){if(!q[r]&&qe(r)){if(H.tagNameCheck instanceof RegExp&&VD(H.tagNameCheck,r))return!1;if(H.tagNameCheck instanceof Function&&H.tagNameCheck(r))return!1}if(ae&&!ce[r]){const t=b(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r){const i=g(n[r],!0);i.__removalCount=(e.__removalCount||0)+1,t.insertBefore(i,A(e))}}}return Oe(e),!0}return e instanceof c&&!function(e){let t=b(e);t&&t.tagName||(t={namespaceURI:Ae,tagName:"template"});const n=LD(e.tagName),r=LD(t.tagName);return!!be[e.namespaceURI]&&(e.namespaceURI===ge?t.namespaceURI===ye?"svg"===n:t.namespaceURI===me?"svg"===n&&("annotation-xml"===r||Ee[r]):Boolean(Le[n]):e.namespaceURI===me?t.namespaceURI===ye?"math"===n:t.namespaceURI===ge?"math"===n&&ke[r]:Boolean(Pe[n]):e.namespaceURI===ye?!(t.namespaceURI===ge&&!ke[r])&&!(t.namespaceURI===me&&!Ee[r])&&!Pe[n]&&(Ce[n]||!Le[n]):!("application/xhtml+xml"!==_e||!be[e.namespaceURI]))}(e)?(Oe(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!VD(/<\/no(script|embed|frames)/i,e.innerHTML)?(J&&e.nodeType===mx&&(t=e.textContent,TD([D,x,I],e=>{t=RD(t,e," ")}),e.textContent!==t&&(xD(n.removed,{element:e.cloneNode()}),e.textContent=t)),Fe(S.afterSanitizeElements,e,null),!1):(Oe(e),!0)},He=function(e,t,n){if(G[t])return!1;if(ie&&("id"===t||"name"===t)&&(n in r||n in De))return!1;if(W&&!G[t]&&VD(L,t));else if(U&&VD(P,t));else if(z.attributeCheck instanceof Function&&z.attributeCheck(t,e));else if(!F[t]||G[t]){if(!(qe(e)&&(H.tagNameCheck instanceof RegExp&&VD(H.tagNameCheck,e)||H.tagNameCheck instanceof Function&&H.tagNameCheck(e))&&(H.attributeNameCheck instanceof RegExp&&VD(H.attributeNameCheck,t)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(t,e))||"is"===t&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&VD(H.tagNameCheck,n)||H.tagNameCheck instanceof Function&&H.tagNameCheck(n))))return!1}else if(he[t]);else if(VD(Y,RD(n,R,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==BD(n,"data:")||!de[e]){if(Q&&!VD(O,RD(n,R,"")));else if(n)return!1}else;return!0},qe=function(e){return"annotation-xml"!==e&&OD(e,B)},Ge=function(e){Fe(S.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Ne(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0};let i=t.length;for(;i--;){const o=t[i],{name:a,namespaceURI:s,value:l}=o,c=Te(a),u=l;let d="value"===a?u:YD(u);if(r.attrName=c,r.attrValue=d,r.keepAttr=!0,r.forceKeepAttr=void 0,Fe(S.uponSanitizeAttribute,e,r),d=r.attrValue,!oe||"id"!==c&&"name"!==c||(Re(a,e),d="user-content-"+d),K&&VD(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){Re(a,e);continue}if("attributename"===c&&OD(d,"href")){Re(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Re(a,e);continue}if(!Z&&VD(/\/>/i,d)){Re(a,e);continue}J&&TD([D,x,I],e=>{d=RD(d,e," ")});const p=Te(e.nodeName);if(He(p,c,d)){if(w&&"object"==typeof f&&"function"==typeof f.getAttributeType)if(s);else switch(f.getAttributeType(p,c)){case"TrustedHTML":d=w.createHTML(d);break;case"TrustedScriptURL":d=w.createScriptURL(d)}if(d!==u)try{s?e.setAttributeNS(s,a,d):e.setAttribute(a,d),Ne(e)?Oe(e):DD(n.removed)}catch(t){Re(a,e)}}else Re(a,e)}Fe(S.afterSanitizeAttributes,e,null)},ze=function(e){let t=null;const n=Ye(e);for(Fe(S.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)Fe(S.uponSanitizeShadowNode,t,null),je(t),Ge(t),t.content instanceof a&&ze(t.content);Fe(S.afterSanitizeShadowDOM,e,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,o=null,s=null,c=null;if(ve=!e,ve&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ve(e)){if("function"!=typeof e.toString)throw FD("toString is not a function");if("string"!=typeof(e=e.toString()))throw FD("dirty is not a string, aborting")}if(!n.isSupported)return e;if($||Ie(t),n.removed=[],"string"==typeof e&&(se=!1),se){if(e.nodeName){const t=Te(e.nodeName);if(!N[t]||q[t])throw FD("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)r=Be("\x3c!----\x3e"),o=r.ownerDocument.importNode(e,!0),o.nodeType===fx&&"BODY"===o.nodeName||"HTML"===o.nodeName?r=o:r.appendChild(o);else{if(!te&&!J&&!X&&-1===e.indexOf("<"))return w&&re?w.createHTML(e):e;if(r=Be(e),!r)return te?null:re?E:""}r&&ee&&Oe(r.firstChild);const u=Ye(se?e:r);for(;s=u.nextNode();)je(s),Ge(s),s.content instanceof a&&ze(s.content);if(se)return e;if(te){if(J){r.normalize();let e=r.innerHTML;TD([D,x,I],t=>{e=RD(e,t," ")}),r.innerHTML=e}if(ne)for(c=_.call(r.ownerDocument);r.firstChild;)c.appendChild(r.firstChild);else c=r;return(F.shadowroot||F.shadowrootmode)&&(c=T.call(i,c,!0)),c}let d=X?r.outerHTML:r.innerHTML;return X&&N["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&VD(dx,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),J&&TD([D,x,I],e=>{d=RD(d,e," ")}),w&&re?w.createHTML(d):d},n.setConfig=function(){Ie(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),$=!0},n.clearConfig=function(){Se=null,$=!1},n.isValidAttribute=function(e,t,n){Se||Ie({});const r=Te(e),i=Te(t);return He(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&xD(S[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=SD(S[e],t);return-1===n?void 0:ID(S[e],n,1)[0]}return DD(S[e])},n.removeHooks=function(e){S[e]=[]},n.removeAllHooks=function(){S={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const wx={ALLOWED_TAGS:["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","big","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","meta","meter","nav","noframes","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","small","source","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr"],ALLOWED_ATTR:["accept","accept-charset","accesskey","action","align","alt","autocomplete","autofocus","autoplay","bgcolor","border","charset","checked","cite","class","color","cols","colspan","content","contenteditable","controls","coords","data","data-*","datetime","default","dir","dirname","disabled","download","draggable","dropzone","enctype","for","form","formaction","headers","height","hidden","high","href","hreflang","http-equiv","id","ismap","kind","label","lang","list","loop","low","max","maxlength","media","method","min","multiple","muted","name","novalidate","open","optimum","pattern","placeholder","poster","preload","readonly","rel","required","reversed","rows","rowspan","sandbox","scope","selected","shape","size","sizes","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","value","width","wrap"]},Ex=e=>{const t=xO?.getState().config.settings.widgetSettings.customAllowedHtmlTags,n=t?{...wx,ALLOWED_TAGS:t}:wx;return bx.sanitize(e,n).toString()};var kx=i(9944);const Cx=i(9599).A,_x=new kx.A(Cx),Mx=(e,t={})=>({type:"SEND_MESSAGE",message:{...e,source:"user"},options:t}),Tx=e=>({type:"SET_USER_TYPING",typing:e}),Sx=(e,t)=>{switch(e.source){case"agent":return t.ui.agentAvatarOverrideUrl||t.config.settings.layout.useOtherAgentLogo&&t.config.settings.layout.agentLogoUrl||t.config.settings.layout.logoUrl||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAQAAABIkb+zAAACOklEQVR4Ae3ZA2ydURwF8P9s2+bjPSdGo0aN08V+URtbL+a8BbO9xfZs2zaCuW7vbDx8uLfp/3dinw+XopRSSimllFJhYm9TjV08wwdoYB0f8ix2mDkTe0p7YIZxDeto/5I6rjHDxGtdkcc72n8H75CXruKn1CAcpi0cHE4NEv9kp+EubXHB3ew08QuH4hFt8cGj5Ajxx9hePE1bYi6k+4gvMJ+29GCe+CEzhvW0ZaQ+PVZ8wDW0ZWatuJfozrqyC9Qluotr2Sra8pOtEtewMkgBrBLXsC9QgX3iGm4EKnBDXOP7QAXeiWt4G6jAW3ENNwMVuCmu4UCgAgc6/DCqE1miO9+7X0oEgtVlF1gjPkiOKHs5Pbx9b2jme7SlxPmSC5we20v8kRjJh6Vt6jlU/JKZztsBj1XcH2zxGG3h4ERqkPgp0R35AhvMOuQT3cVnyRH/O9wt4zjLzaj00/F6/dfj9WrPj9eVUkqpRPeMMTnMxxbu4fWf5uP3uME93IZ5JpcxHi4lzGjWYgPPsom2cNDIs9jAWjNaXJvaw1RyES/SlpmLXGQqHb0Rgsv5hjaEvOJyIt6lWg4nacMNTppcHMu9LqYGL2ijCZ6bGuki0TEVuEIbbXDFVEgU2JsbaWPKRvYOf6C8SBtjLoY6yKbH4h5tvMHd5DgJR6Ivb9E6yK1EX6c3AMGDlRIcZtG6i5ktQWGpywJYKkHxgtMC5yUo1tM6TL0ERes2WkALaAEtEEm0gFJKKaWUUkp9ABvn3SEbw3cFAAAAAElFTkSuQmCC";case"bot":case"engagement":return t.ui.botAvatarOverrideUrl||t.config.settings.layout.useOtherAgentLogo&&t.config.settings.layout.botLogoUrl||t.config.settings.layout.logoUrl||void 0;case"user":return}},Dx=(e,t)=>{switch(e.source){case"agent":return t.config.settings.layout.useOtherAgentLogo&&t.config.settings.layout.agentAvatarName||t.config.settings.layout.title||void 0;case"bot":case"engagement":return t.config.settings.layout.useOtherAgentLogo&&t.config.settings.layout.botAvatarName||t.config.settings.layout.title||void 0;case"user":return}},xx=(e,t)=>`${e.config.settings.layout.useOtherAgentLogo&&e.config.settings.layout.agentAvatarName||e.config.settings.layout.title||"Agent"} ${t}`,Ix=e=>t=>n=>r=>{switch(r.type){case"SEND_MESSAGE":{const{message:i,options:o}=r;let{text:a,data:s}=i;if(t.getState().config.settings.widgetSettings.disableTextInputSanitization||(a=Ex(a||"")),t.getState().config.settings.widgetSettings.disableHtmlInput&&(a=(new DOMParser).parseFromString(a||"","text/html").body.textContent||""),s=s&&"object"==typeof s&&Object.keys(s).length>0?s:null,!a&&!s)break;e.sendMessage(a||"",s);const l=HM();n({type:kT,id:l});const c={...i,text:a,id:l};"string"==typeof o.label&&(c.text=o.label),n(hT(void 0)),n(zM({...c,avatarUrl:Sx(c,t.getState()),avatarName:Dx(c,t.getState()),timestamp:Date.now()}));break}case"SET_USER_TYPING":{const{typing:n}=r;if(t.getState().config.settings.behavior.disableUserTypingEvent)return;n?e.sendTypingStatus("typingOn"):e.sendTypingStatus("typingOff");break}case"RECEIVE_MESSAGE":{const e=t.getState(),{message:i}=r,o=Sx(i,e),a=Dx(i,e),s=e.ui.open&&e.ui.isPageVisible,l=!(i.text||i.data?._cognigy?._webchat),c=e.config.settings.behavior.collateStreamedOutputs&&!!i?.data?._cognigy?._messageId&&e.messages.messageHistory.some(e=>i?.data?._cognigy?._messageId===e.id),u=!s&&!l&&!c;if("agent"===i.source&&e.queueUpdates.isQueueActive){const t={text:"",data:{_cognigy:{_webchat3:{type:"liveAgentEvent",payload:{text:xx(e,"joined")}}}}};n({type:"ADD_MESSAGE_EVENT",event:t}),_x.play()}n(zM({...i,source:i.source||"bot",timestamp:Date.now(),avatarUrl:o,avatarName:a},u));break}case"TRIGGER_ENGAGEMENT_MESSAGE":{const e=t.getState().config.settings.teaserMessage.text;e&&t.dispatch(mD({source:"engagement",traceId:`engagement-${Math.random()}`,text:e}));break}}return n(r)},Lx=({userId:e,sessionId:t},{URLToken:n})=>JSON.stringify(["webchat-client",e,t,n]),Px=e=>({type:"SET_OPTIONS",options:e}),Ox=(e={channel:"",sessionId:"",userId:""},t)=>{switch(t.type){case"SET_OPTIONS":return t.options;case"SET_USER_ID":return{...e,userId:t.userId};default:return e}};var Rx=i(7202),Bx=i.n(Rx);const Yx=e=>({type:"SET_CONFIG",config:e}),Nx=(e={URLToken:"",initialSessionId:"",active:!1,isConfigLoaded:!1,isTimedOut:!1,settings:{layout:{title:"",logoUrl:"",useOtherAgentLogo:!1,botAvatarName:"",botLogoUrl:"",agentAvatarName:"",agentLogoUrl:"",inputAutogrowMaxRows:4,enableInputCollation:!1,inputCollationTimeout:1e3,dynamicImageAspectRatio:!1,disableInputAutocomplete:!1,enableGenericHTMLStyling:!1,disableHtmlContentSanitization:!1,disableUrlButtonSanitization:!1,watermark:"default",watermarkText:"Powered by Cognigy.AI",watermarkUrl:"",disableBotOutputBorder:!1,botOutputMaxWidthPercentage:73,chatWindowWidth:460},colors:{primaryColor:"",secondaryColor:"",chatInterfaceColor:"",botMessageColor:"",userMessageColor:"",textLinkColor:""},behavior:{collateStreamedOutputs:!1,progressiveMessageRendering:!1,renderMarkdown:!1,enableTypingIndicator:!0,messageDelay:500,inputPlaceholder:"Type something here…",enableSTT:!1,enableTTS:!1,focusInputAfterPostback:!1,enableConnectionStatusIndicator:!0,scrollingBehavior:"alwaysScroll",disableUserTypingEvent:!1},startBehavior:{startBehavior:"none",getStartedButtonText:"",getStartedData:{},getStartedPayload:"",getStartedText:""},fileStorageSettings:{enabled:!1,dropzoneText:""},businessHours:{times:[],enabled:!1,mode:"inform",text:"",timeZone:"Europe/Berlin",title:""},unreadMessages:{enableIndicator:!1,enableBadge:!1,enablePreview:!1,enableSound:!1,unreadMessageTitleText:"New Message",unreadMessageTitleTextPlural:"New Messages"},homeScreen:{enabled:!0,welcomeText:"Welcome! How can we help you?",background:{imageUrl:"",color:""},startConversationButtonText:"Start conversation",previousConversations:{enabled:!0,buttonText:"Previous conversations",title:""},conversationStarters:{enabled:!0,starters:[]}},teaserMessage:{text:"",teaserMessageDelay:5e3,showInChat:!1,conversationStarters:{enabled:!0,starters:[]}},chatOptions:{enabled:!1,title:"Chat options",quickReplyOptions:{enabled:!1,sectionTitle:"People are also interested in",quickReplies:[]},showTTSToggle:!1,activateTTSToggle:!0,labelTTSToggle:"Enable text-to-speech",rating:{enabled:"once",title:"Please rate your chat experience",commentPlaceholder:"Type something here...",submitButtonText:"Send feedback",eventBannerText:"Your feedback was submitted"},footer:{enabled:!1,items:[]}},privacyNotice:{enabled:!1,title:"Privacy notice",text:"Please accept our privacy policy to start your chat.\n\nLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.",submitButtonText:"Submit",urlText:"",url:""},fileAttachmentMaxSize:10485760,maintenance:{enabled:!1,mode:"inform",text:"",title:""},demoWebchat:{enabled:!0,backgroundImageUrl:"",position:"centered"},embeddingConfiguration:{_endpointTokenUrl:"",awaitEndpointConfig:!1,disableLocalStorage:!1,disablePersistentHistory:!1,useSessionStorage:!1,connectivity:{enabled:!1,mode:"hide",text:"",timeout:2e3,title:""}},widgetSettings:{disableDefaultReplyCompatiblityMode:!1,enableStrictMessengerSync:!1,disableHtmlInput:!0,disableInputAutofocus:!1,disableRenderURLsAsLinks:!1,disableTextInputSanitization:!1,disableToggleButton:!1,disableTeaserMarkdownRemoval:!1,enableAutoFocus:!1,enableInjectionWithoutEmptyHistory:!1,enableFocusTrap:!1,enableDefaultPreview:!1,ignoreLineBreaks:!1,STTLanguage:"",customAllowedHtmlTags:void 0,sourceDirectionMapping:{agent:"incoming",bot:"incoming",user:"outgoing"},sourceColorMapping:{agent:"bot",bot:"bot",user:"user"}}}},t)=>{switch(t.type){case"SET_CONFIG":{const n=Bx()({},e.settings,t.config.settings);return{...e,...t.config,settings:n}}case"APPLY_WEBCHAT_SETTINGS_OVERRIDES":case"UPDATE_SETTINGS":{const n=Bx()({},e.settings,t.payload);return{...e,settings:n}}case"SET_INITIAL_SESSION_ID":return{...e,initialSessionId:t.sessionId}}return e},Vx={connected:!1,connecting:!1,reconnectionLimit:!1},Fx=e=>({type:"SET_CONNECTING",connecting:e}),jx=e=>({type:"SET_CONNECTED",connected:e}),Hx=e=>({type:"SET_RECONNECTION_LIMIT",reconnectionLimit:e}),qx=(e=Vx,t)=>{switch(t.type){case"SET_CONNECTED":return{...e,connected:t.connected};case"SET_CONNECTING":return{...e,connecting:t.connecting};case"SET_RECONNECTION_LIMIT":return{...e,reconnectionLimit:t.reconnectionLimit};default:return e}},Gx=(e=[],t)=>{switch(t.type){case"ADD_MESSAGE":return t.unseen?[...e,t.message]:e;case"CLEAR_UNSEEN_MESSAGES":return[]}return e},zx=(e={isChatOpenedOnce:!1,isConnectedOnce:!1,isConfiguredOnce:!1,isSessionRestoredOnce:!1,isAutoInjectHandled:!1},t)=>{switch(t.type){case"SET_CONNECTED":if(t.connected&&!e.isConnectedOnce)return{...e,isConnectedOnce:!0};break;case"SHOW_CHAT_SCREEN":if(!e.isChatOpenedOnce)return{...e,isChatOpenedOnce:!0};break;case"SET_CONFIG":if(!e.isConfiguredOnce)return{...e,isConfiguredOnce:!0};break;case"SET_OPTIONS":if(!e.isSessionRestoredOnce)return{...e,isSessionRestoredOnce:!0};break;case"AUTO_INJECT_HANDLED":if(!e.isAutoInjectHandled)return{...e,isAutoInjectHandled:!0};break;case"AUTO_INJECT_HANDLED_RESET":if(e.isAutoInjectHandled)return{...e,isAutoInjectHandled:!1}}return e},Ux=(e={messages:[]},t)=>{switch(t.type){case"ADD_COLLATED_MESSAGE":return{...e,messages:[...e.messages,t.message]};case"SUBMIT_COLLATED_MESSAGES":case"SEND_MESSAGE":return{...e,messages:[]}}return e},Wx="SET_STT_ACTIVE",Qx="SET_TEXT_ACTIVE",Zx="SET_DROP_ZONE_VISIBLE",Jx=e=>({type:Zx,visible:e}),Kx="SET_FILE_LIST",Xx=e=>({type:Kx,fileList:e}),$x="SET_FILE_UPLOAD_ERROR",eI=e=>({type:$x,error:e}),tI="REMOVE_FILE_FROM_LIST",nI=(e={sttActive:!1,textActive:!1,isDropZoneVisible:!1,fileList:[],fileUploadError:!1},t)=>{switch(t.type){case Wx:return{...e,sttActive:t.active};case Qx:return{...e,textActive:t.active};case Zx:return{...e,isDropZoneVisible:t.visible};case Kx:return{...e,fileList:t.fileList};case $x:return{...e,fileUploadError:t.error};case tI:{const n=e.fileList[t.index];n?.abortController&&n.abortController.abort();const r=e.fileList.filter((e,n)=>n!==t.index);let i=!1;return r.forEach(e=>{i=e.hasUploadError||i}),{...e,fileList:r,fileUploadError:i}}default:return e}},rI="SET_CONVERSATIONS",iI=e=>({type:rI,conversations:e}),oI="UPSERT_PREV_CONVERSATION",aI="DELETE_PREV_CONVERSATION",sI=(e={},t)=>{switch(t.type){case rI:return t.conversations;case oI:{const{sessionId:n,conversation:r}=t;return{...e,[n]:r}}case aI:{const{sessionId:n}=t;return delete e[n],e}default:return e}};const lI={autoOpen:!0,closeOnSubmit:!0,feedbackMessage:null,screenTitle:"",sendEventOnCloseIconClick:!1,showCloseIcon:!0},cI=aD({name:"xAppOverlay",initialState:{open:!1,currentUrl:null,settingsByUrl:{}},reducers:{openOverlay(e,t){e.open=!0,e.currentUrl=t.payload},closeOverlay(e){e.open=!1,e.currentUrl=null}},extraReducers(e){e.addCase("RECEIVE_MESSAGE",(e,t)=>{const{message:n}=t;if(function(e){const t=e?.data?._cognigy?._app?.overlaySettings,n=e?.data?._cognigy?._app?.url;return t&&n}(n)){const t=n.data._cognigy._app.url;if(!t)return void console.error("xApp Overlay message received without an URL");n.data._cognigy._app.overlaySettings.autoOpen&&(e.open=!0,e.currentUrl=t),e.settingsByUrl[t]={...lI,...n.data._cognigy._app.overlaySettings}}})}}),{openOverlay:uI,closeOverlay:dI}=cI.actions,pI=cI.reducer,hI=aD({name:"userTyping",initialState:{shouldSendUserTypingOff:!1,typingTimeoutId:void 0},reducers:{setShouldSendUserTypingOff:(e,t)=>{e.shouldSendUserTypingOff=t.payload},setTypingTimeoutId:(e,t)=>{e.typingTimeoutId=t.payload}}}),{setShouldSendUserTypingOff:fI,setTypingTimeoutId:mI}=hI.actions,gI=hI.reducer,yI=(e,t)=>FM({messages:JM(()=>e),unseenMessages:Gx,options:Ox,config:Nx,autoInject:zx,rating:RT,ui:CT,connection:qx,inputCollation:Ux,input:nI,prevConversations:sI,xAppOverlay:pI,queueUpdates:fD,userTyping:gI})(e,t),AI=(e=yI(void 0,{type:""}),t)=>{switch(t.type){case"RESET_STATE":{const n=(0===e.messages.messageHistory.length||1===e.messages.messageHistory.length&&"engagement"===e.messages.messageHistory[0].source?t.state.messages:[]).map(e=>"bot"!==e.source&&"engagement"!==e.source||!("animationState"in e)||"done"===e.animationState?e:{...e,animationState:"done"}),r=new Set(e.messages.visibleOutputMessages),i=[];for(const e of n)"bot"!==e.source&&"engagement"!==e.source||"string"!=typeof e.id||r.has(e.id)||(i.push(e.id),r.add(e.id));const o=[...e.messages.visibleOutputMessages,...i];return yI({...e,messages:{messageHistory:[...n,...e.messages.messageHistory],visibleOutputMessages:o},rating:{...e.rating,hasGivenRating:t.state.rating.hasGivenRating}},{type:""})}case"SET_PREV_STATE":{const{showRatingScreen:n,...r}=t.state.rating,i=[],o=t.state.messages.map(e=>(e.animationState&&(e.animationState="done"),"bot"!==e.source&&"engagement"!==e.source||!e.id||i.push(e.id),e));return yI({...e,messages:{messageHistory:[...o],visibleOutputMessages:i},rating:{showRatingScreen:!1,...r}},{type:""})}}return yI(e,t)};function vI(e){if("string"!=typeof e)return!1;try{return JSON.parse(e),!0}catch(e){return!1}}const bI=e=>e.disableLocalStorage?null:e.useSessionStorage?window.sessionStorage:window.localStorage,wI=(e,t,n,r)=>Object.keys(e).reduce((n,i)=>{if(!t||!r)return n;const o=e.getItem(i)||"";if(!vI(i)||!vI(o))return n;const a=JSON.parse(i)?.[1]||"",s=JSON.parse(i)?.[2]||"",l=JSON.parse(i)?.[3]||"";if(t!==a)return n;if(r!==l)return n;const c=JSON.parse(o)?.messages;return Array.isArray(c)&&0!==c.length?(n[s]=JSON.parse(o),n):n},{}),EI=e=>t=>n=>{const r=Lx(e.getState().options,e.getState().config),{active:i}=e.getState().config,{disableLocalStorage:o,disablePersistentHistory:a,useSessionStorage:s}=e.getState().config.settings.embeddingConfiguration,{userId:l,sessionId:c}=e.getState().options,u=bI({useSessionStorage:s,disableLocalStorage:o});switch(n.type){case"SET_OPTIONS":if(u){const t=Lx(n.options,e.getState().config),r=u.getItem(t);if(n.options?.userId){const t=wI(u,n.options?.userId,n.options,e.getState().config?.URLToken);e.dispatch(iI(t))}if(r)try{const t=JSON.parse(r);e.dispatch({type:"RESET_STATE",state:t})}catch(e){}}break;case"SET_SHOW_PREV_CONVERSATIONS":if(n.showPrevConversations&&u&&l&&!c){const t=wI(u,l,0,e.getState().config?.URLToken);e.dispatch(iI(t))}break;case"SEND_MESSAGE":case"RECEIVE_MESSAGE":case"TRIGGER_ENGAGEMENT_MESSAGE":case"SHOW_RATING_SCREEN":case"SET_HAS_GIVEN_RATING":case"SET_CUSTOM_RATING_TITLE":case"SET_CUSTOM_RATING_COMMENT_TEXT":if(u&&i&&l&&c&&!a){const{messages:t,rating:n}=e.getState();let i=[];Array.isArray(t)?i=t:t?.messageHistory&&Array.isArray(t.messageHistory)&&(i=t.messageHistory),u.setItem(r,JSON.stringify({messages:i,rating:n}))}}return t(n)},kI=e=>e?.autoInject?.isConnectedOnce,CI="DISCONNECT";function _I(e,t){return function(){return e.apply(t,arguments)}}const{toString:MI}=Object.prototype,{getPrototypeOf:TI}=Object,{iterator:SI,toStringTag:DI}=Symbol,xI=(II=Object.create(null),e=>{const t=MI.call(e);return II[t]||(II[t]=t.slice(8,-1).toLowerCase())});var II;const LI=e=>(e=e.toLowerCase(),t=>xI(t)===e),PI=e=>t=>typeof t===e,{isArray:OI}=Array,RI=PI("undefined");function BI(e){return null!==e&&!RI(e)&&null!==e.constructor&&!RI(e.constructor)&&VI(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const YI=LI("ArrayBuffer");const NI=PI("string"),VI=PI("function"),FI=PI("number"),jI=e=>null!==e&&"object"==typeof e,HI=e=>{if("object"!==xI(e))return!1;const t=TI(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||DI in e||SI in e)},qI=LI("Date"),GI=LI("File"),zI=LI("Blob"),UI=LI("FileList");const WI="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==i.g?i.g:{},QI=void 0!==WI.FormData?WI.FormData:void 0,ZI=LI("URLSearchParams"),[JI,KI,XI,$I]=["ReadableStream","Request","Response","Headers"].map(LI);function eL(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),OI(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(BI(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let a;for(r=0;r<o;r++)a=i[r],t.call(null,e[a],a,e)}}function tL(e,t){if(BI(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const nL="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:i.g,rL=e=>!RI(e)&&e!==nL;const iL=(oL="undefined"!=typeof Uint8Array&&TI(Uint8Array),e=>oL&&e instanceof oL);var oL;const aL=LI("HTMLFormElement"),sL=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),lL=LI("RegExp"),cL=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};eL(n,(n,i)=>{let o;!1!==(o=t(n,i,e))&&(r[i]=o||n)}),Object.defineProperties(e,r)};const uL=LI("AsyncFunction"),dL=(pL="function"==typeof setImmediate,hL=VI(nL.postMessage),pL?setImmediate:hL?((e,t)=>(nL.addEventListener("message",({source:n,data:r})=>{n===nL&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),nL.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e));var pL,hL;const fL="undefined"!=typeof queueMicrotask?queueMicrotask.bind(nL):"undefined"!=typeof process&&process.nextTick||dL,mL={isArray:OI,isArrayBuffer:YI,isBuffer:BI,isFormData:e=>{if(!e)return!1;if(QI&&e instanceof QI)return!0;const t=TI(e);if(!t||t===Object.prototype)return!1;if(!VI(e.append))return!1;const n=xI(e);return"formdata"===n||"object"===n&&VI(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&YI(e.buffer),t},isString:NI,isNumber:FI,isBoolean:e=>!0===e||!1===e,isObject:jI,isPlainObject:HI,isEmptyObject:e=>{if(!jI(e)||BI(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:JI,isRequest:KI,isResponse:XI,isHeaders:$I,isUndefined:RI,isDate:qI,isFile:GI,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:zI,isRegExp:lL,isFunction:VI,isStream:e=>jI(e)&&VI(e.pipe),isURLSearchParams:ZI,isTypedArray:iL,isFileList:UI,forEach:eL,merge:function e(){const{caseless:t,skipUndefined:n}=rL(this)&&this||{},r={},i=(i,o)=>{if("__proto__"===o||"constructor"===o||"prototype"===o)return;const a=t&&tL(r,o)||o;HI(r[a])&&HI(i)?r[a]=e(r[a],i):HI(i)?r[a]=e({},i):OI(i)?r[a]=i.slice():n&&RI(i)||(r[a]=i)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&eL(arguments[e],i);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(eL(t,(t,r)=>{n&&VI(t)?Object.defineProperty(e,r,{value:_I(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,o,a;const s={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&TI(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:xI,kindOfTest:LI,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(OI(e))return e;let t=e.length;if(!FI(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[SI]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:aL,hasOwnProperty:sL,hasOwnProp:sL,reduceDescriptors:cL,freezeMethods:e=>{cL(e,(t,n)=>{if(VI(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];VI(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return OI(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:tL,global:nL,isContextDefined:rL,isSpecCompliantForm:function(e){return!!(e&&VI(e.append)&&"FormData"===e[DI]&&e[SI])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(jI(e)){if(t.indexOf(e)>=0)return;if(BI(e))return e;if(!("toJSON"in e)){t[r]=e;const i=OI(e)?[]:{};return eL(e,(e,t)=>{const o=n(e,r+1);!RI(o)&&(i[t]=o)}),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:uL,isThenable:e=>e&&(jI(e)||VI(e))&&VI(e.then)&&VI(e.catch),setImmediate:dL,asap:fL,isIterable:e=>null!=e&&VI(e[SI])};class gL extends Error{static from(e,t,n,r,i,o){const a=new gL(e.message,t||e.code,n,r,i);return a.cause=e,a.name=e.name,null!=e.status&&null==a.status&&(a.status=e.status),o&&Object.assign(a,o),a}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:mL.toJSONObject(this.config),code:this.code,status:this.status}}}gL.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",gL.ERR_BAD_OPTION="ERR_BAD_OPTION",gL.ECONNABORTED="ECONNABORTED",gL.ETIMEDOUT="ETIMEDOUT",gL.ERR_NETWORK="ERR_NETWORK",gL.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",gL.ERR_DEPRECATED="ERR_DEPRECATED",gL.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",gL.ERR_BAD_REQUEST="ERR_BAD_REQUEST",gL.ERR_CANCELED="ERR_CANCELED",gL.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",gL.ERR_INVALID_URL="ERR_INVALID_URL",gL.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const yL=gL;function AL(e){return mL.isPlainObject(e)||mL.isArray(e)}function vL(e){return mL.endsWith(e,"[]")?e.slice(0,-2):e}function bL(e,t,n){return e?e.concat(t).map(function(e,t){return e=vL(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const wL=mL.toFlatObject(mL,{},null,function(e){return/^is[A-Z]/.test(e)});const EL=function(e,t,n){if(!mL.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=mL.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!mL.isUndefined(t[e])})).metaTokens,i=n.visitor||d,o=n.dots,a=n.indexes,s=n.Blob||"undefined"!=typeof Blob&&Blob,l=void 0===n.maxDepth?100:n.maxDepth,c=s&&mL.isSpecCompliantForm(t);if(!mL.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(mL.isDate(e))return e.toISOString();if(mL.isBoolean(e))return e.toString();if(!c&&mL.isBlob(e))throw new yL("Blob is not supported. Use a Buffer instead.");return mL.isArrayBuffer(e)||mL.isTypedArray(e)?c&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function d(e,n,i){let s=e;if(mL.isReactNative(t)&&mL.isReactNativeBlob(e))return t.append(bL(i,n,o),u(e)),!1;if(e&&!i&&"object"==typeof e)if(mL.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(mL.isArray(e)&&function(e){return mL.isArray(e)&&!e.some(AL)}(e)||(mL.isFileList(e)||mL.endsWith(n,"[]"))&&(s=mL.toArray(e)))return n=vL(n),s.forEach(function(e,r){!mL.isUndefined(e)&&null!==e&&t.append(!0===a?bL([n],r,o):null===a?n:n+"[]",u(e))}),!1;return!!AL(e)||(t.append(bL(i,n,o),u(e)),!1)}const p=[],h=Object.assign(wL,{defaultVisitor:d,convertValue:u,isVisitable:AL});if(!mL.isObject(e))throw new TypeError("data must be an object");return function e(n,r,o=0){if(!mL.isUndefined(n)){if(o>l)throw new yL("Object is too deeply nested ("+o+" levels). Max depth: "+l,yL.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==p.indexOf(n))throw Error("Circular reference detected in "+r.join("."));p.push(n),mL.forEach(n,function(n,a){!0===(!(mL.isUndefined(n)||null===n)&&i.call(t,n,mL.isString(a)?a.trim():a,r,h))&&e(n,r?r.concat(a):[a],o+1)}),p.pop()}}(e),t};function kL(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function CL(e,t){this._pairs=[],e&&EL(e,this,t)}const _L=CL.prototype;_L.append=function(e,t){this._pairs.push([e,t])},_L.toString=function(e){const t=e?function(t){return e.call(this,t,kL)}:kL;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const ML=CL;function TL(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function SL(e,t,n){if(!t)return e;const r=n&&n.encode||TL,i=mL.isFunction(n)?{serialize:n}:n,o=i&&i.serialize;let a;if(a=o?o(t,i):mL.isURLSearchParams(t)?t.toString():new ML(t,i).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}const DL=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){mL.forEach(this.handlers,function(t){null!==t&&e(t)})}},xL={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},IL={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ML,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},LL="undefined"!=typeof window&&"undefined"!=typeof document,PL="object"==typeof navigator&&navigator||void 0,OL=LL&&(!PL||["ReactNative","NativeScript","NS"].indexOf(PL.product)<0),RL="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,BL=LL&&window.location.href||"http://localhost",YL={...e,...IL};const NL=function(e){function t(e,n,r,i){let o=e[i++];if("__proto__"===o)return!0;const a=Number.isFinite(+o),s=i>=e.length;if(o=!o&&mL.isArray(r)?r.length:o,s)return mL.hasOwnProp(r,o)?r[o]=mL.isArray(r[o])?r[o].concat(n):[r[o],n]:r[o]=n,!a;r[o]&&mL.isObject(r[o])||(r[o]=[]);return t(e,n,r[o],i)&&mL.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}(r[o])),!a}if(mL.isFormData(e)&&mL.isFunction(e.entries)){const n={};return mL.forEachEntry(e,(e,r)=>{t(function(e){return mL.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null},VL=(e,t)=>null!=e&&mL.hasOwnProp(e,t)?e[t]:void 0;const FL={transitional:xL,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=mL.isObject(e);i&&mL.isHTMLForm(e)&&(e=new FormData(e));if(mL.isFormData(e))return r?JSON.stringify(NL(e)):e;if(mL.isArrayBuffer(e)||mL.isBuffer(e)||mL.isStream(e)||mL.isFile(e)||mL.isBlob(e)||mL.isReadableStream(e))return e;if(mL.isArrayBufferView(e))return e.buffer;if(mL.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){const t=VL(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return EL(e,new YL.classes.URLSearchParams,{visitor:function(e,t,n,r){return YL.isNode&&mL.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((o=mL.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=VL(this,"env"),r=n&&n.FormData;return EL(o?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(mL.isString(e))try{return(t||JSON.parse)(e),mL.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=VL(this,"transitional")||FL.transitional,n=t&&t.forcedJSONParsing,r=VL(this,"responseType"),i="json"===r;if(mL.isResponse(e)||mL.isReadableStream(e))return e;if(e&&mL.isString(e)&&(n&&!r||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,VL(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw yL.from(e,yL.ERR_BAD_RESPONSE,this,null,VL(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:YL.classes.FormData,Blob:YL.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};mL.forEach(["delete","get","head","post","put","patch"],e=>{FL.headers[e]={}});const jL=FL,HL=mL.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),qL=e=>{const t={};let n,r,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&HL[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t};(Object.getOwnPropertyDescriptor(qL,"name")||{}).writable||Object.defineProperty(qL,"name",{value:"default",configurable:!0});const GL=Symbol("internals"),zL=/[^\x09\x20-\x7E\x80-\xFF]/g;function UL(e){return e&&String(e).trim().toLowerCase()}function WL(e){return!1===e||null==e?e:mL.isArray(e)?e.map(WL):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(zL,""))}function QL(e,t,n,r,i){return mL.isFunction(r)?r.call(this,t,n):(i&&(t=n),mL.isString(t)?mL.isString(r)?-1!==t.indexOf(r):mL.isRegExp(r)?r.test(t):void 0:void 0)}class ZL{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=UL(t);if(!i)throw new Error("header name must be a non-empty string");const o=mL.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=WL(e))}const o=(e,t)=>mL.forEach(e,(e,n)=>i(e,n,t));if(mL.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(mL.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o(qL(e),t);else if(mL.isObject(e)&&mL.isIterable(e)){let n,r,i={};for(const t of e){if(!mL.isArray(t))throw TypeError("Object iterator must return a key-value pair");i[r=t[0]]=(n=i[r])?mL.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}o(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=UL(e)){const n=mL.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(mL.isFunction(t))return t.call(this,e,n);if(mL.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=UL(e)){const n=mL.findKey(this,e);return!(!n||void 0===this[n]||t&&!QL(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=UL(e)){const i=mL.findKey(n,e);!i||t&&!QL(0,n[i],i,t)||(delete n[i],r=!0)}}return mL.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!QL(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return mL.forEach(this,(r,i)=>{const o=mL.findKey(n,i);if(o)return t[o]=WL(r),void delete t[i];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();a!==i&&delete t[i],t[a]=WL(r),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return mL.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&mL.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[GL]=this[GL]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=UL(e);t[r]||(!function(e,t){const n=mL.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}(n,e),t[r]=!0)}return mL.isArray(e)?e.forEach(r):r(e),this}}ZL.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),mL.reduceDescriptors(ZL.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),mL.freezeMethods(ZL);const JL=ZL;function KL(e,t){const n=this||jL,r=t||n,i=JL.from(r.headers);let o=r.data;return mL.forEach(e,function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function XL(e){return!(!e||!e.__CANCEL__)}const $L=class extends yL{constructor(e,t,n){super(null==e?"canceled":e,yL.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function eP(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new yL("Request failed with status code "+n.status,[yL.ERR_BAD_REQUEST,yL.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const tP=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,a=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),c=r[a];i||(i=l),n[o]=s,r[o]=l;let u=a,d=0;for(;u!==o;)d+=n[u++],u%=e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),l-i<t)return;const p=c&&l-c;return p?Math.round(1e3*d/p):void 0}};const nP=function(e,t){let n,r,i=0,o=1e3/t;const a=(t,o=Date.now())=>{i=o,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-i;s>=o?a(e,t):(n=e,r||(r=setTimeout(()=>{r=null,a(n)},o-s)))},()=>n&&a(n)]},rP=(e,t,n=3)=>{let r=0;const i=tP(50,250);return nP(n=>{const o=n.loaded,a=n.lengthComputable?n.total:void 0,s=null!=a?Math.min(o,a):o,l=Math.max(0,s-r),c=i(l);r=Math.max(r,s);e({loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a?(a-s)/c:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})},n)},iP=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},oP=e=>(...t)=>mL.asap(()=>e(...t)),aP=YL.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,YL.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(YL.origin),YL.navigator&&/(msie|trident)/i.test(YL.navigator.userAgent)):()=>!0,sP=YL.hasStandardBrowserEnv?{write(e,t,n,r,i,o,a){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];mL.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),mL.isString(r)&&s.push(`path=${r}`),mL.isString(i)&&s.push(`domain=${i}`),!0===o&&s.push("secure"),mL.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function lP(e,t,n){let r=!("string"==typeof(i=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i));var i;return e&&(r||!1===n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const cP=e=>e instanceof JL?{...e}:e;function uP(e,t){t=t||{};const n=Object.create(null);function r(e,t,n,r){return mL.isPlainObject(e)&&mL.isPlainObject(t)?mL.merge.call({caseless:r},e,t):mL.isPlainObject(t)?mL.merge({},t):mL.isArray(t)?t.slice():t}function i(e,t,n,i){return mL.isUndefined(t)?mL.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function o(e,t){if(!mL.isUndefined(t))return r(void 0,t)}function a(e,t){return mL.isUndefined(t)?mL.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,o){return mL.hasOwnProp(t,o)?r(n,i):mL.hasOwnProp(e,o)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const l={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>i(cP(e),cP(t),0,!0)};return mL.forEach(Object.keys({...e,...t}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const o=mL.hasOwnProp(l,r)?l[r]:i,a=o(mL.hasOwnProp(e,r)?e[r]:void 0,mL.hasOwnProp(t,r)?t[r]:void 0,r);mL.isUndefined(a)&&o!==s||(n[r]=a)}),n}const dP=e=>{const t=uP({},e),n=e=>mL.hasOwnProp(t,e)?t[e]:void 0,r=n("data");let i=n("withXSRFToken");const o=n("xsrfHeaderName"),a=n("xsrfCookieName");let s=n("headers");const l=n("auth"),c=n("baseURL"),u=n("allowAbsoluteUrls"),d=n("url");if(t.headers=s=JL.from(s),t.url=SL(lP(c,d,u),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),mL.isFormData(r))if(YL.hasStandardBrowserEnv||YL.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(mL.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)})}if(YL.hasStandardBrowserEnv){mL.isFunction(i)&&(i=i(t));if(!0===i||null==i&&aP(t.url)){const e=o&&a&&sP.read(a);e&&s.set(o,e)}}return t};(Object.getOwnPropertyDescriptor(dP,"name")||{}).writable||Object.defineProperty(dP,"name",{value:"default",configurable:!0});const pP="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=dP(e);let i=r.data;const o=JL.from(r.headers).normalize();let a,s,l,c,u,{responseType:d,onUploadProgress:p,onDownloadProgress:h}=r;function f(){c&&c(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=JL.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());eP(function(e){t(e),f()},function(e){n(e),f()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new yL("Request aborted",yL.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=t&&t.message?t.message:"Network Error",i=new yL(r,yL.ERR_NETWORK,e,m);i.event=t||null,n(i),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||xL;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new yL(t,i.clarifyTimeoutError?yL.ETIMEDOUT:yL.ECONNABORTED,e,m)),m=null},void 0===i&&o.setContentType(null),"setRequestHeader"in m&&mL.forEach(o.toJSON(),function(e,t){m.setRequestHeader(t,e)}),mL.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),h&&([l,u]=rP(h,!0),m.addEventListener("progress",l)),p&&m.upload&&([s,c]=rP(p),m.upload.addEventListener("progress",s),m.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(a=t=>{m&&(n(!t||t.type?new $L(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===YL.protocols.indexOf(y)?n(new yL("Unsupported protocol "+y+":",yL.ERR_BAD_REQUEST,e)):m.send(i||null)})},hP=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof yL?t:new $L(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,i(new yL(`timeout of ${t}ms exceeded`,yL.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i));const{signal:s}=r;return s.unsubscribe=()=>mL.asap(a),s}},fP=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},mP=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},gP=(e,t,n,r)=>{const i=async function*(e,t){for await(const n of mP(e))yield*fP(n,t)}(e,t);let o,a=0,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return s(),void e.close();let o=r.byteLength;if(n){let e=a+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),i.return())},{highWaterMark:2})},{isFunction:yP}=mL,AP=(({Request:e,Response:t})=>({Request:e,Response:t}))(mL.global),{ReadableStream:vP,TextEncoder:bP}=mL.global,wP=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},EP=e=>{e=mL.merge.call({skipUndefined:!0},AP,e);const{fetch:t,Request:n,Response:r}=e,i=t?yP(t):"function"==typeof fetch,o=yP(n),a=yP(r);if(!i)return!1;const s=i&&yP(vP),l=i&&("function"==typeof bP?(c=new bP,e=>c.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var c;const u=o&&s&&wP(()=>{let e=!1;const t=new n(YL.origin,{body:new vP,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r}),d=a&&s&&wP(()=>mL.isReadableStream(new r("").body)),p={stream:d&&(e=>e.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!p[e]&&(p[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new yL(`Response type '${e}' is not supported`,yL.ERR_NOT_SUPPORT,n)})});const h=async(e,t)=>{const r=mL.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(mL.isBlob(e))return e.size;if(mL.isSpecCompliantForm(e)){const t=new n(YL.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return mL.isArrayBufferView(e)||mL.isArrayBuffer(e)?e.byteLength:(mL.isURLSearchParams(e)&&(e+=""),mL.isString(e)?(await l(e)).byteLength:void 0)})(t):r};return async e=>{let{url:i,method:a,data:s,signal:l,cancelToken:c,timeout:f,onDownloadProgress:m,onUploadProgress:g,responseType:y,headers:A,withCredentials:v="same-origin",fetchOptions:b}=dP(e),w=t||fetch;y=y?(y+"").toLowerCase():"text";let E=hP([l,c&&c.toAbortSignal()],f),k=null;const C=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let _;try{if(g&&u&&"get"!==a&&"head"!==a&&0!==(_=await h(A,s))){let e,t=new n(i,{method:"POST",body:s,duplex:"half"});if(mL.isFormData(s)&&(e=t.headers.get("content-type"))&&A.setContentType(e),t.body){const[e,n]=iP(_,rP(oP(g)));s=gP(t.body,65536,e,n)}}mL.isString(v)||(v=v?"include":"omit");const t=o&&"credentials"in n.prototype;if(mL.isFormData(s)){const e=A.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&A.delete("content-type")}const l={...b,signal:E,method:a.toUpperCase(),headers:A.normalize().toJSON(),body:s,duplex:"half",credentials:t?v:void 0};k=o&&new n(i,l);let c=await(o?w(k,b):w(i,l));const f=d&&("stream"===y||"response"===y);if(d&&(m||f&&C)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=c[t]});const t=mL.toFiniteNumber(c.headers.get("content-length")),[n,i]=m&&iP(t,rP(oP(m),!0))||[];c=new r(gP(c.body,65536,n,()=>{i&&i(),C&&C()}),e)}y=y||"text";let M=await p[mL.findKey(p,y)||"text"](c,e);return!f&&C&&C(),await new Promise((t,n)=>{eP(t,n,{data:M,headers:JL.from(c.headers),status:c.status,statusText:c.statusText,config:e,request:k})})}catch(t){if(C&&C(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new yL("Network Error",yL.ERR_NETWORK,e,k,t&&t.response),{cause:t.cause||t});throw yL.from(t,t&&t.code,e,k,t&&t.response)}}},kP=new Map,CP=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let a,s,l=o.length,c=kP;for(;l--;)a=o[l],s=c.get(a),void 0===s&&c.set(a,s=l?new Map:EP(t)),c=s;return s},_P=(CP(),{http:null,xhr:pP,fetch:{get:CP}});mL.forEach(_P,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const MP=e=>`- ${e}`,TP=e=>mL.isFunction(e)||null===e||!1===e;const SP={getAdapter:function(e,t){e=mL.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let a=0;a<n;a++){let n;if(r=e[a],i=r,!TP(r)&&(i=_P[(n=String(r)).toLowerCase()],void 0===i))throw new yL(`Unknown adapter '${n}'`);if(i&&(mL.isFunction(i)||(i=i.get(t))))break;o[n||"#"+a]=i}if(!i){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(MP).join("\n"):" "+MP(e[0]):"as no adapter specified";throw new yL("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return i},adapters:_P};function DP(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new $L(null,e)}function xP(e){DP(e),e.headers=JL.from(e.headers),e.data=KL.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return SP.getAdapter(e.adapter||jL.adapter,e)(e).then(function(t){return DP(e),t.data=KL.call(e,e.transformResponse,t),t.headers=JL.from(t.headers),t},function(t){return XL(t)||(DP(e),t&&t.response&&(t.response.data=KL.call(e,e.transformResponse,t.response),t.response.headers=JL.from(t.response.headers))),Promise.reject(t)})}const IP="1.15.2",LP={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{LP[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const PP={};LP.transitional=function(e,t,n){function r(e,t){return"[Axios v"+IP+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new yL(r(i," has been removed"+(t?" in "+t:"")),yL.ERR_DEPRECATED);return t&&!PP[i]&&(PP[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}},LP.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const OP={assertOptions:function(e,t,n){if("object"!=typeof e)throw new yL("options must be an object",yL.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(a){const t=e[o],n=void 0===t||a(t,o,e);if(!0!==n)throw new yL("option "+o+" must be "+n,yL.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new yL("Unknown option "+o,yL.ERR_BAD_OPTION)}},validators:LP},RP=OP.validators;class BP{constructor(e){this.defaults=e||{},this.interceptors={request:new DL,response:new DL}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),r=-1===t?-1:n.indexOf("\n",t+1),i=-1===r?"":n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=uP(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&OP.assertOptions(n,{silentJSONParsing:RP.transitional(RP.boolean),forcedJSONParsing:RP.transitional(RP.boolean),clarifyTimeoutError:RP.transitional(RP.boolean),legacyInterceptorReqResOrdering:RP.transitional(RP.boolean)},!1),null!=r&&(mL.isFunction(r)?t.paramsSerializer={serialize:r}:OP.assertOptions(r,{encode:RP.function,serialize:RP.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),OP.assertOptions(t,{baseUrl:RP.spelling("baseURL"),withXsrfToken:RP.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&mL.merge(i.common,i[t.method]);i&&mL.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]}),t.headers=JL.concat(o,i);const a=[];let s=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;s=s&&e.synchronous;const n=t.transitional||xL;n&&n.legacyInterceptorReqResOrdering?a.unshift(e.fulfilled,e.rejected):a.push(e.fulfilled,e.rejected)});const l=[];let c;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let u,d=0;if(!s){const e=[xP.bind(this),void 0];for(e.unshift(...a),e.push(...l),u=e.length,c=Promise.resolve(t);d<u;)c=c.then(e[d++],e[d++]);return c}u=a.length;let p=t;for(;d<u;){const e=a[d++],t=a[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{c=xP.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=l.length;d<u;)c=c.then(l[d++],l[d++]);return c}getUri(e){return SL(lP((e=uP(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}mL.forEach(["delete","get","head","options"],function(e){BP.prototype[e]=function(t,n){return this.request(uP(n||{},{method:e,url:t,data:(n||{}).data}))}}),mL.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,i){return this.request(uP(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}BP.prototype[e]=t(),BP.prototype[e+"Form"]=t(!0)});const YP=BP;class NP{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new $L(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;const t=new NP(function(t){e=t});return{token:t,cancel:e}}}const VP=NP;const FP={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(FP).forEach(([e,t])=>{FP[t]=e});const jP=FP;const HP=function e(t){const n=new YP(t),r=_I(YP.prototype.request,n);return mL.extend(r,YP.prototype,n,{allOwnKeys:!0}),mL.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(uP(t,n))},r}(jL);HP.Axios=YP,HP.CanceledError=$L,HP.CancelToken=VP,HP.isCancel=XL,HP.VERSION=IP,HP.toFormData=EL,HP.AxiosError=yL,HP.Cancel=HP.CanceledError,HP.all=function(e){return Promise.all(e)},HP.spread=function(e){return function(t){return e.apply(null,t)}},HP.isAxiosError=function(e){return mL.isObject(e)&&!0===e.isAxiosError},HP.mergeConfig=uP,HP.AxiosHeaders=JL,HP.formToJSON=e=>NL(mL.isHTMLForm(e)?new FormData(e):e),HP.getAdapter=SP.getAdapter,HP.HttpStatusCode=jP,HP.default=HP;const qP=HP;var GP="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==i.g&&i.g||{},zP="URLSearchParams"in GP,UP="Symbol"in GP&&"iterator"in Symbol,WP="FileReader"in GP&&"Blob"in GP&&function(){try{return new Blob,!0}catch(e){return!1}}(),QP="FormData"in GP,ZP="ArrayBuffer"in GP;if(ZP)var JP=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],KP=ArrayBuffer.isView||function(e){return e&&JP.indexOf(Object.prototype.toString.call(e))>-1};function XP(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function $P(e){return"string"!=typeof e&&(e=String(e)),e}function eO(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return UP&&(t[Symbol.iterator]=function(){return t}),t}function tO(e){this.map={},e instanceof tO?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function nO(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function rO(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function iO(e){var t=new FileReader,n=rO(t);return t.readAsArrayBuffer(e),n}function oO(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function aO(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:WP&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:QP&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:zP&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():ZP&&WP&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=oO(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):ZP&&(ArrayBuffer.prototype.isPrototypeOf(e)||KP(e))?this._bodyArrayBuffer=oO(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):zP&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},WP&&(this.blob=function(){var e=nO(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=nO(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(WP)return this.blob().then(iO);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e=nO(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=rO(t),r=/charset=([A-Za-z0-9_-]+)/.exec(e.type),i=r?r[1]:"utf-8";return t.readAsText(e,i),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},QP&&(this.formData=function(){return this.text().then(cO)}),this.json=function(){return this.text().then(JSON.parse)},this}tO.prototype.append=function(e,t){e=XP(e),t=$P(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},tO.prototype.delete=function(e){delete this.map[XP(e)]},tO.prototype.get=function(e){return e=XP(e),this.has(e)?this.map[e]:null},tO.prototype.has=function(e){return this.map.hasOwnProperty(XP(e))},tO.prototype.set=function(e,t){this.map[XP(e)]=$P(t)},tO.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},tO.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),eO(e)},tO.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),eO(e)},tO.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),eO(e)},UP&&(tO.prototype[Symbol.iterator]=tO.prototype.entries);var sO=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function lO(e,t){if(!(this instanceof lO))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,i=(t=t||{}).body;if(e instanceof lO){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new tO(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new tO(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),sO.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in GP)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var o=/([?&])_=[^&]*/;if(o.test(this.url))this.url=this.url.replace(o,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function cO(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}}),t}function uO(e,t){if(!(this instanceof uO))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new tO(t.headers),this.url=t.url||"",this._initBody(e)}lO.prototype.clone=function(){return new lO(this,{body:this._bodyInit})},aO.call(lO.prototype),aO.call(uO.prototype),uO.prototype.clone=function(){return new uO(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new tO(this.headers),url:this.url})},uO.error=function(){var e=new uO(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var dO=[301,302,303,307,308];uO.redirect=function(e,t){if(-1===dO.indexOf(t))throw new RangeError("Invalid status code");return new uO(null,{status:t,headers:{location:e}})};var pO=GP.DOMException;try{new pO}catch(e){pO=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},pO.prototype=Object.create(Error.prototype),pO.prototype.constructor=pO}function hO(e,t){return new Promise(function(n,r){var i=new lO(e,t);if(i.signal&&i.signal.aborted)return r(new pO("Aborted","AbortError"));var o=new XMLHttpRequest;function a(){o.abort()}if(o.onload=function(){var e,t,r={statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new tO,e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e}).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();try{t.append(r,i)}catch(e){console.warn("Response "+e.message)}}}),t)};0===i.url.indexOf("file://")&&(o.status<200||o.status>599)?r.status=200:r.status=o.status,r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL");var a="response"in o?o.response:o.responseText;setTimeout(function(){n(new uO(a,r))},0)},o.onerror=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){r(new TypeError("Network request timed out"))},0)},o.onabort=function(){setTimeout(function(){r(new pO("Aborted","AbortError"))},0)},o.open(i.method,function(e){try{return""===e&&GP.location.href?GP.location.href:e}catch(t){return e}}(i.url),!0),"include"===i.credentials?o.withCredentials=!0:"omit"===i.credentials&&(o.withCredentials=!1),"responseType"in o&&(WP?o.responseType="blob":ZP&&(o.responseType="arraybuffer")),t&&"object"==typeof t.headers&&!(t.headers instanceof tO||GP.Headers&&t.headers instanceof GP.Headers)){var s=[];Object.getOwnPropertyNames(t.headers).forEach(function(e){s.push(XP(e)),o.setRequestHeader(e,$P(t.headers[e]))}),i.headers.forEach(function(e,t){-1===s.indexOf(t)&&o.setRequestHeader(t,e)})}else i.headers.forEach(function(e,t){o.setRequestHeader(t,e)});i.signal&&(i.signal.addEventListener("abort",a),o.onreadystatechange=function(){4===o.readyState&&i.signal.removeEventListener("abort",a)}),o.send(void 0===i._bodyInit?null:i._bodyInit)})}hO.polyfill=!0,GP.fetch||(GP.fetch=hO,GP.Headers=tO,GP.Request=lO,GP.Response=uO);const fO=(e,t)=>n=>r=>i=>{if("LOAD_CONFIG"===i.type)t&&n.dispatch({type:"APPLY_WEBCHAT_SETTINGS_OVERRIDES",payload:t}),(async()=>{const r=await(async(e,t)=>{const n="signal"in new Request("")?window.fetch:hO,r=new AbortController,i=setTimeout(()=>r.abort(),t);let o=null;try{o=await n(e,{signal:r.signal})}catch(e){"AbortError"===e.name&&console.warn("Unable to fetch endpoint configuration in time")}return clearTimeout(i),o?o.json():null})(e,n.getState().config.settings.embeddingConfiguration?.connectivity?.enabled&&n.getState().config.settings.embeddingConfiguration?.connectivity?.timeout||4e3);if(r){const e=Bx()({},r.settings,t),i={...r,settings:e};n.dispatch(Yx({...i,isConfigLoaded:!0}));const o=e.chatOptions?.showTTSToggle,a=e.behavior?.enableTTS&&(!o||e.chatOptions.activateTTSToggle);n.dispatch(ET(a))}else t?n.dispatch(Yx({settings:t,isTimedOut:!0,isConfigLoaded:!0})):n.dispatch(Yx({isTimedOut:!0,isConfigLoaded:!0}))})();return r(i)},mO=(e,t)=>{const n=()=>{e.dispatch(jx(!0))};var r;r=()=>{e.dispatch({type:"NETWORK_ON"})},window.addEventListener("online",r,!1),t.on("socket/connect",n),t.on("socket/reconnect",n),t.on("socket/pong",n),t.on("output",n),t.on("socket/disconnect",()=>{e.dispatch(jx(!1))}),t.on("socket/error",t=>{"RECONNECTION_LIMIT"===t.type&&e.dispatch(Hx(!0))})},gO="hasAcceptedTerms";function yO(e){let t=[];if(e){const n=e.getItem(gO);if(n)try{const e=JSON.parse(n);Array.isArray(e)&&(t=e)}catch(t){console.error(`[Webchat Privacy Policy]: Error parsing ${gO} from ${e}`,t)}}return t}function AO(e,t){if(!e)return console.warn("No browser storage available to store accepted terms."),!0;return yO(e).includes(t)}const vO=e=>t=>n=>{const{disableLocalStorage:r,useSessionStorage:i}=e.getState().config.settings.embeddingConfiguration,o=bI({useSessionStorage:i,disableLocalStorage:r});switch(n.type){case"TOGGLE_OPEN":{const t=e.getState().ui.open;e.dispatch(nT(!t));break}case"SET_OPEN":{const{open:t}=n,{showHomeScreen:r,showPrevConversations:i,showChatOptionsScreen:o}=e.getState().ui;t&&(!i&&!o&&!r)&&e.dispatch({type:"CLEAR_UNSEEN_MESSAGES"});break}case"SHOW_CHAT_SCREEN":e.getState().ui.isPageVisible&&e.dispatch({type:"CLEAR_UNSEEN_MESSAGES"});break;case"SET_PAGE_VISIBLE":n.visible&&e.getState().ui.open&&e.dispatch({type:"CLEAR_UNSEEN_MESSAGES"});break;case"SET_HAS_ACCEPTED_TERMS":o&&function(e,t){const n=yO(e);n.push(t);const r=JSON.stringify([...new Set(n.filter(Boolean))]);e?.setItem?.(gO,r)}(o,n.userId)}return t(n)},bO=e=>{(e=>{const t=()=>e(eT());document.addEventListener(XM,t,!1)})(t=>{e.dispatch((e=>({type:gT,visible:e}))(t))})},wO=Object.keys||function(e){const t=[];for(const n in e)({}).hasOwnProperty.call(e,n)&&t.push(n);return t};function EO(e){const t=e||{};return t.features={pause:!0,export:!0,test:!0},t.type="redux",void 0===t.autoPause&&(t.autoPause=!0),void 0===t.latency&&(t.latency=500),function(e){return function(n,r){const i=e(n,r),o=i.dispatch,a=window.__REDUX_DEVTOOLS_EXTENSION__.connect(t);a.init(i.getState());const s=function(e){const t=o(e);return a.send(e,i.getState()),t};return Object.assign?Object.assign(i,{dispatch:s}):function(e,t,n){const r=wO(e),i={};for(let t=0,n=r.length;t<n;t++){const n=r[t];i[n]=e[n]}return i[t]=n,i}(i,"dispatch",s)}}}function kO(e){return function(){return jM(jM(...arguments),EO(e))}}"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;const CO=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__?0===t.length?EO():"object"==typeof t[0]?kO(t[0]):kO()(...t):0!==t.length?"object"==typeof t[0]?jM:jM(...t):void 0},_O=(e=self.crypto?.randomUUID?.(),t)=>({type:"SWITCH_SESSION",sessionId:e,conversation:t}),MO=e=>t=>n=>r=>{switch(r.type){case"SWITCH_SESSION":{const{sessionId:n,conversation:i}=r,o=n||"",a=i||t.getState().prevConversations?.[o]||{messages:[],rating:OT};t.dispatch({type:"SET_PREV_STATE",state:a}),t.dispatch(Fx(!0)),e.switchSession(o).then(()=>{t.dispatch(Fx(!1)),t.dispatch(Px(e.socketOptions)),t.dispatch({type:"AUTO_INJECT_HANDLED_RESET"}),t.dispatch({type:"TRIGGER_AUTO_INJECT"})}).catch(()=>{t.dispatch(Fx(!1))});break}case"SEND_MESSAGE":case"RECEIVE_MESSAGE":case"TRIGGER_ENGAGEMENT_MESSAGE":case"SHOW_RATING_SCREEN":case"SET_HAS_GIVEN_RATING":case"SET_CUSTOM_RATING_TITLE":case"SET_CUSTOM_RATING_COMMENT_TEXT":{const e=t.getState().options.sessionId;if(!e)break;const n={messages:t.getState().messages.messageHistory,rating:t.getState().rating};t.dispatch(((e,t)=>({type:oI,sessionId:e,conversation:t}))(e,n));break}}return n(r)},TO=e=>({type:"ADD_FILES_TO_LIST",newFiles:e}),SO=()=>e=>t=>async n=>{switch(n.type){case"ADD_FILES_TO_LIST":{const{fileAttachmentMaxSize:t,embeddingConfiguration:{_endpointTokenUrl:r}}=e.getState().config.settings,i=e.getState().input.fileList;let o=[];const a=t>0?t/1048576:0;n.newFiles?.forEach(e=>{e.size>t?o.push({file:e,progressPercentage:10,hasUploadError:!0,uploadErrorReason:`File size > ${a}MB`}):o.push({file:e,progressPercentage:30})}),e.dispatch(Xx(i.concat(o)));const s=`${r}/fileuploadtoken`;let l,c=!1;try{l=await(async e=>(await hO(e)).json())(s)}catch(e){c=!0}o=o.map(e=>(e.hasUploadError||(e.progressPercentage=50,e.hasUploadError=c,e.uploadErrorReason=c?"Upload Failed":e.uploadErrorReason),e)),setTimeout(()=>{e.dispatch(Xx(i.concat(o)))},100),o=(await Promise.all(o.map(async t=>{try{t.hasUploadError||t.isCancelled?e.dispatch(eI(!0)):(t.abortController=new AbortController,t.uploadFileMeta=await(async(e,t,n,r)=>{const i={data:{file:e},headers:{authorization:`Bearer ${n}`,"Content-Type":"multipart/form-data"},method:"POST",url:t,signal:r?r.signal:void 0};return(await qP(i)).data})(t.file,l.fileUploadUrl,l.token,t.abortController),"infected"===t.uploadFileMeta.status&&(t.hasUploadError=!0,t.uploadErrorReason="Infected File",e.dispatch(eI(!0))),t.uploadFileMeta.fileName=t.file.name,t.progressPercentage=100)}catch(n){if("ERR_CANCELED"===n.code)return void(t.isCancelled=!0);t.hasUploadError=!0,t.uploadErrorReason="Failed Upload!",e.dispatch(eI(!0))}return t}))).filter(Boolean),e.dispatch(Xx(i.concat(o)));break}}return t(n)},DO=e=>t=>n=>{const r=e.getState();switch(n.type){case"SET_TEXT_ACTIVE":case"SEND_MESSAGE":r.userTyping.shouldSendUserTypingOff&&(e.dispatch(Tx(!1)),e.dispatch(fI(!1)));break;case"input/content-updated":if(r.userTyping.shouldSendUserTypingOff){clearTimeout(r.userTyping.typingTimeoutId);const t=setTimeout(()=>{e.getState().userTyping.shouldSendUserTypingOff&&(e.dispatch(Tx(!1)),e.dispatch(fI(!1)))},2e3);e.dispatch(mI(t))}else e.dispatch(Tx(!0)),e.dispatch(fI(!0))}return t(n)};let xO=null;const IO=(e,t,n)=>{const{client:r}=e,i=VM(AI,CO(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error(OM(15))},i={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},o=t.map(function(e){return e(i)});return r=jM.apply(void 0,o)(n.dispatch),PM(PM({},n),{},{dispatch:r})}}}((e=>t=>t=>n=>{switch(n.type){case"SET_OPEN":e.emitAnalytics(n.open?"webchat/open":"webchat/close");break;case"SET_MINIMIZE":e.emitAnalytics("webchat/minimize");break;case"SEND_MESSAGE":e.emitAnalytics("webchat/outgoing-message",n.message);break;case"RECEIVE_MESSAGE":(n.message.text||n.message.data)&&e.emitAnalytics("webchat/incoming-message",n.message);break;case"SWITCH_SESSION":e.emitAnalytics("webchat/switch-session",n.sessionId)}return t(n)})(e),(e=>t=>n=>r=>{switch(r.type){case"CONNECT":{const{storedMessage:n}=t.getState().ui;e.connected||t.getState().connection.connecting||(t.dispatch(Fx(!0)),e.connect().then(()=>{t.dispatch(Fx(!1)),t.dispatch(Hx(!1)),n&&(t.dispatch(Mx({text:n.text,data:n.data},n.options)),t.dispatch(bT(null))),t.dispatch(Px(e.socketOptions))}).catch(()=>{t.dispatch(Fx(!1))}));break}case"SHOW_CHAT_SCREEN":e.connected||t.dispatch({type:"CONNECT"});break;case"SEND_MESSAGE":t.dispatch({type:"CONNECT"});break;case"SET_PAGE_VISIBLE":r.visible&&kI(t.getState())&&t.dispatch({type:"CONNECT"});break;case CI:e.disconnect();break;case"NETWORK_ON":kI(t.getState())&&t.dispatch({type:"CONNECT"})}return n(r)})(r),(()=>{let e=null;return t=>{const n=()=>{const{messages:e}=t.getState().inputCollation,n=e.map(e=>e.text).join(" ");return{...e[0],text:n,data:void 0}},r=()=>{e&&(clearTimeout(e),e=null)};return i=>o=>{switch(o.type){case"SEND_MESSAGE":{const{enableInputCollation:a,inputCollationTimeout:s}=t.getState().config.settings.layout;if(!a)break;const l=o.options?.collate;return l?(r(),e=setTimeout(()=>{t.dispatch({type:"SUBMIT_COLLATED_MESSAGES"})},s),i((e=>({type:"ADD_COLLATED_MESSAGE",message:e}))(o.message))):(r(),i(Mx(n())),i(o))}case"SUBMIT_COLLATED_MESSAGES":{r();const e=n();return i(o),void t.dispatch(Mx(e))}}return i(o)}}})(),Ix(r),fO(t,n),(e=>t=>n=>r=>{switch(r.type){case"SET_CONFIG":case"SET_CONNECTED":case"SHOW_CHAT_SCREEN":case"SET_OPTIONS":{const e=n(r);return(()=>{const e=t.getState(),{isAutoInjectHandled:n,isConfiguredOnce:r,isConnectedOnce:i,isChatOpenedOnce:o,isSessionRestoredOnce:a}=e.autoInject;n||r&&i&&o&&a&&t.dispatch({type:"TRIGGER_AUTO_INJECT"})})(),e}case"TRIGGER_AUTO_INJECT":{const n=t.getState(),r=n.config;if(t.dispatch({type:"AUTO_INJECT_HANDLED"}),"injection"!==r.settings.startBehavior.startBehavior)break;if(!r.settings.widgetSettings.enableInjectionWithoutEmptyHistory){if(n.ui.storedMessage)break;const e=n.messages.messageHistory?.filter(e=>"engagement"!==e.source);if(0!==ft(e).length)break}const i=n.config.settings.startBehavior.getStartedPayload,o=n.config.settings.startBehavior.getStartedData,a=n.config.settings.startBehavior.getStartedText;e.sendMessage(i,o,{label:a});break}}return n(r)})(e),MO(r),SO(),EI,vO,DO)));return(e=>{xO=e})(i),((e,t)=>{t.on("output",gD(e))})(i,r),((e,t)=>{t.on("typingStatus",t=>{try{const n="typingOn"===t.status,r=e.getState().ui.typing,i=n?"show":"show"===r?"hide":null;i&&e.dispatch(uT(i))}catch(e){}})})(i,r),mO(i,r),bO(i),i},LO=Ye.button(({theme:e})=>{const t="hsla(0, 0%, 0%, .24)",n="hsla(0, 0%, 0%, .54)";return{padding:e.unitSize,boxSizing:"border-box",color:t,fill:t,backgroundColor:"transparent",border:"none",outline:"none",margin:0,minWidth:24,minHeight:24,display:"flex",alignItems:"center",justifyContent:"center","&:not(.disabled)":{cursor:"pointer","&.active, &:hover":{color:n,fill:n}},transition:lt("background-color","color","fill"),svg:{width:25,height:25}}});var PO,OO=["title","titleId"];function RO(){return RO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RO.apply(null,arguments)}const BO=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,OO);return r.createElement("svg",RO({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none","aria-hidden":"true",viewBox:"0 0 16 16","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,PO||(PO=r.createElement("g",{clipRule:"evenodd"},r.createElement("path",{d:"M14.727 1.293a1 1 0 0 1 0 1.414L2.706 14.727a1 1 0 0 1-1.414-1.413l12.02-12.021a1 1 0 0 1 1.415 0"}),r.createElement("path",{d:"M14.727 14.728a1 1 0 0 1-1.415 0L1.292 2.708a1 1 0 0 1 1.414-1.415l12.02 12.02a1 1 0 0 1 0 1.415"}))))};var YO,NO=["title","titleId"];function VO(){return VO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},VO.apply(null,arguments)}const FO=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,NO);return r.createElement("svg",VO({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none","aria-hidden":"true",viewBox:"0 -960 960 960","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,YO||(YO=r.createElement("path",{d:"M180.78-427v-106h598.44v106z"})))};var jO,HO=["title","titleId"];function qO(){return qO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qO.apply(null,arguments)}const GO=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,HO);return r.createElement("svg",qO({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none","aria-hidden":"true",viewBox:"0 0 16 16","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,jO||(jO=r.createElement("path",{d:"M11.758 1.35a1 1 0 0 1-.109 1.41L5.535 8l6.114 5.24a1 1 0 0 1-1.301 1.52L4.234 9.518a2 2 0 0 1 0-3.038l6.114-5.24a1 1 0 0 1 1.41.108",clipRule:"evenodd"})))};var zO,UO=["title","titleId"];function WO(){return WO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},WO.apply(null,arguments)}const QO=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,UO);return r.createElement("svg",WO({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none","aria-hidden":"true",viewBox:"0 0 16 16","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,zO||(zO=r.createElement("g",{fill:"#1A1A1A"},r.createElement("circle",{cx:8,cy:8,r:2}),r.createElement("circle",{cx:8,cy:2,r:2}),r.createElement("circle",{cx:8,cy:14,r:2}))))};let ZO={data:""},JO=e=>{if("object"==typeof window){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||ZO},KO=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,XO=/\/\*[^]*?\*\/| +/g,$O=/\n+/g,eR=(e,t)=>{let n="",r="",i="";for(let o in e){let a=e[o];"@"==o[0]?"i"==o[1]?n=o+" "+a+";":r+="f"==o[1]?eR(a,o):o+"{"+eR(a,"k"==o[1]?"":t)+"}":"object"==typeof a?r+=eR(a,t?t.replace(/([^,])+/g,e=>o.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):o):null!=a&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=eR.p?eR.p(o,a):o+":"+a+";")}return n+(t&&i?t+"{"+i+"}":i)+r},tR={},nR=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+nR(e[n]);return t}return e},rR=(e,t,n,r,i)=>{let o=nR(e),a=tR[o]||(tR[o]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(o));if(!tR[a]){let t=o!==e?e:(e=>{let t,n,r=[{}];for(;t=KO.exec(e.replace(XO,""));)t[4]?r.shift():t[3]?(n=t[3].replace($O," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace($O," ").trim();return r[0]})(e);tR[a]=eR(i?{["@keyframes "+a]:t}:t,n?"":"."+a)}let s=n&&tR.g?tR.g:null;return n&&(tR.g=tR[a]),((e,t,n,r)=>{r?t.data=t.data.replace(r,e):-1===t.data.indexOf(e)&&(t.data=n?e+t.data:t.data+e)})(tR[a],t,r,s),a};function iR(e){let t=this||{},n=e.call?e(t.p):e;return rR(n.unshift?n.raw?((e,t,n)=>e.reduce((e,r,i)=>{let o=t[i];if(o&&o.call){let e=o(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?"."+t:e&&"object"==typeof e?e.props?"":eR(e,""):!1===e?"":e}return e+r+(null==o?"":o)},""))(n,[].slice.call(arguments,1),t.p):n.reduce((e,n)=>Object.assign(e,n&&n.call?n(t.p):n),{}):n,JO(t.target),t.g,t.o,t.k)}iR.bind({g:1});let oR,aR,sR,lR=iR.bind({k:1});function cR(e,t){let n=this||{};return function(){let r=arguments;function i(o,a){let s=Object.assign({},o),l=s.className||i.className;n.p=Object.assign({theme:aR&&aR()},s),n.o=/ *go\d+/.test(l),s.className=iR.apply(n,r)+(l?" "+l:""),t&&(s.ref=a);let c=e;return e[0]&&(c=s.as||e,delete s.as),sR&&c[0]&&sR(s),oR(c,s)}return t?t(i):i}}var uR=(e,t)=>(e=>"function"==typeof e)(e)?e(t):e,dR=(()=>{let e=0;return()=>(++e).toString()})(),pR=(()=>{let e;return()=>{if(void 0===e&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),hR="default",fR=(e,t)=>{let{toastLimit:n}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,n)};case 1:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case 2:let{toast:r}=t;return fR(e,{type:e.toasts.find(e=>e.id===r.id)?1:0,toast:r});case 3:let{toastId:i}=t;return{...e,toasts:e.toasts.map(e=>e.id===i||void 0===i?{...e,dismissed:!0,visible:!1}:e)};case 4:return void 0===t.toastId?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let o=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(e=>({...e,pauseDuration:e.pauseDuration+o}))}}},mR=[],gR={toasts:[],pausedAt:void 0,settings:{toastLimit:20}},yR={},AR=(e,t=hR)=>{yR[t]=fR(yR[t]||gR,e),mR.forEach(([e,n])=>{e===t&&n(yR[t])})},vR=e=>Object.keys(yR).forEach(t=>AR(e,t)),bR=(e=hR)=>t=>{AR(t,e)},wR={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},ER=e=>(t,n)=>{let r=((e,t="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(null==n?void 0:n.id)||dR()}))(t,e,n);return bR(r.toasterId||(e=>Object.keys(yR).find(t=>yR[t].toasts.some(t=>t.id===e)))(r.id))({type:2,toast:r}),r.id},kR=(e,t)=>ER("blank")(e,t);kR.error=ER("error"),kR.success=ER("success"),kR.loading=ER("loading"),kR.custom=ER("custom"),kR.dismiss=(e,t)=>{let n={type:3,toastId:e};t?bR(t)(n):vR(n)},kR.dismissAll=e=>kR.dismiss(void 0,e),kR.remove=(e,t)=>{let n={type:4,toastId:e};t?bR(t)(n):vR(n)},kR.removeAll=e=>kR.remove(void 0,e),kR.promise=(e,t,n)=>{let r=kR.loading(t.loading,{...n,...null==n?void 0:n.loading});return"function"==typeof e&&(e=e()),e.then(e=>{let i=t.success?uR(t.success,e):void 0;return i?kR.success(i,{id:r,...n,...null==n?void 0:n.success}):kR.dismiss(r),e}).catch(e=>{let i=t.error?uR(t.error,e):void 0;i?kR.error(i,{id:r,...n,...null==n?void 0:n.error}):kR.dismiss(r)}),e};var CR=(e,t="default")=>{let{toasts:n,pausedAt:i}=((e={},t=hR)=>{let[n,i]=(0,r.useState)(yR[t]||gR),o=(0,r.useRef)(yR[t]);(0,r.useEffect)(()=>(o.current!==yR[t]&&i(yR[t]),mR.push([t,i]),()=>{let e=mR.findIndex(([e])=>e===t);e>-1&&mR.splice(e,1)}),[t]);let a=n.toasts.map(t=>{var n,r,i;return{...e,...e[t.type],...t,removeDelay:t.removeDelay||(null==(n=e[t.type])?void 0:n.removeDelay)||(null==e?void 0:e.removeDelay),duration:t.duration||(null==(r=e[t.type])?void 0:r.duration)||(null==e?void 0:e.duration)||wR[t.type],style:{...e.style,...null==(i=e[t.type])?void 0:i.style,...t.style}}});return{...n,toasts:a}})(e,t),o=(0,r.useRef)(new Map).current,a=(0,r.useCallback)((e,t=1e3)=>{if(o.has(e))return;let n=setTimeout(()=>{o.delete(e),s({type:4,toastId:e})},t);o.set(e,n)},[]);(0,r.useEffect)(()=>{if(i)return;let e=Date.now(),r=n.map(n=>{if(n.duration===1/0)return;let r=(n.duration||0)+n.pauseDuration-(e-n.createdAt);if(!(r<0))return setTimeout(()=>kR.dismiss(n.id,t),r);n.visible&&kR.dismiss(n.id)});return()=>{r.forEach(e=>e&&clearTimeout(e))}},[n,i,t]);let s=(0,r.useCallback)(bR(t),[t]),l=(0,r.useCallback)(()=>{s({type:5,time:Date.now()})},[s]),c=(0,r.useCallback)((e,t)=>{s({type:1,toast:{id:e,height:t}})},[s]),u=(0,r.useCallback)(()=>{i&&s({type:6,time:Date.now()})},[i,s]),d=(0,r.useCallback)((e,t)=>{let{reverseOrder:r=!1,gutter:i=8,defaultPosition:o}=t||{},a=n.filter(t=>(t.position||o)===(e.position||o)&&t.height),s=a.findIndex(t=>t.id===e.id),l=a.filter((e,t)=>t<s&&e.visible).length;return a.filter(e=>e.visible).slice(...r?[l+1]:[0,l]).reduce((e,t)=>e+(t.height||0)+i,0)},[n]);return(0,r.useEffect)(()=>{n.forEach(e=>{if(e.dismissed)a(e.id,e.removeDelay);else{let t=o.get(e.id);t&&(clearTimeout(t),o.delete(e.id))}})},[n,a]),{toasts:n,handlers:{updateHeight:c,startPause:l,endPause:u,calculateOffset:d}}},_R=lR`
|
|
480
|
+
var s=function(){function e(){}return e.generate=function(){var t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return e.lut[255&t]+e.lut[t>>8&255]+e.lut[t>>16&255]+e.lut[t>>24&255]+"-"+e.lut[255&n]+e.lut[n>>8&255]+"-"+e.lut[n>>16&15|64]+e.lut[n>>24&255]+"-"+e.lut[63&r|128]+e.lut[r>>8&255]+"-"+e.lut[r>>16&255]+e.lut[r>>24&255]+e.lut[255&i]+e.lut[i>>8&255]+e.lut[i>>16&255]+e.lut[i>>24&255]},e.initialize=function(){for(var t=0;t<256;t++)e.lut[t]=(t<16?"0":"")+t.toString(16)},e.lut=[],e}();e.UUID=s,s.initialize()}(Sw)),Sw}var xw,Iw={};function Lw(){if(xw)return Iw;var e;xw=1,Object.defineProperty(Iw,"__esModule",{value:!0}),Iw.clearElementChildren=Iw.getScrollY=Iw.getScrollX=Iw.getFitStatus=Iw.truncate=Iw.truncateText=Iw.stringToCssColor=Iw.parseEnum=Iw.getEnumValueByName=Iw.parseBool=Iw.parseNumber=Iw.parseString=Iw.appendChild=Iw.generateUniqueId=Iw.isMobileOS=Iw.isInternetExplorer=void 0;var t=Mw(),n=Dw();function r(e,t){for(var n in e){var r=parseInt(n,10);if(r>=0){var i=e[n];if(i&&"string"==typeof i&&i.toLowerCase()===t.toLowerCase())return r}}}function i(e,t,n,r,i){var o=function(){return t-e.scrollHeight>=-1};if(!o()){for(var s=function(e){var t=[],n=a(e,-1);for(;n<e.length;)" "===e[n]&&t.push(n),n=a(e,n);return t}(n),l=0,c=s.length,u=0;l<c;){var d=Math.floor((l+c)/2);r(n,s[d]),o()?(u=s[d],l=d+1):c=d}if(r(n,u),i&&t-e.scrollHeight>=i-1){for(var p=a(n,u);p<n.length&&(r(n,p),o());)u=p,p=a(n,p);r(n,u)}}}Iw.isInternetExplorer=function(){return void 0!==window.document.documentMode},Iw.isMobileOS=function(){var e=window.navigator.userAgent;return!!e.match(/Android/i)||!!e.match(/iPad/i)||!!e.match(/iPhone/i)},Iw.generateUniqueId=function(){return"__ac-"+n.UUID.generate()},Iw.appendChild=function(e,t){t&&e.appendChild(t)},Iw.parseString=function(e,t){return"string"==typeof e?e:t},Iw.parseNumber=function(e,t){return"number"==typeof e?e:t},Iw.parseBool=function(e,t){if("boolean"==typeof e)return e;if("string"==typeof e)switch(e.toLowerCase()){case"true":return!0;case"false":return!1;default:return t}return t},Iw.getEnumValueByName=r,Iw.parseEnum=function(e,t,n){if(!t)return n;var i=r(e,t);return void 0!==i?i:n},Iw.stringToCssColor=function(e){if(e){var t=/#([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})?/gi.exec(e);if(t&&t[4]){var n=parseInt(t[1],16)/255;return"rgba("+parseInt(t[2],16)+","+parseInt(t[3],16)+","+parseInt(t[4],16)+","+n+")"}}return e},Iw.truncateText=function(e,t,n){i(e,t,e.innerText,function(t,n){e.innerText=t.substring(0,n)+"..."},n)};var o="undefined"==typeof window||null===(e=window.trustedTypes)||void 0===e?void 0:e.createPolicy("adaptivecards#deprecatedExportedFunctionPolicy",{createHTML:function(e){return e}});function a(e,t){for(t+=1;t<e.length&&"<"===e[t];)for(;t<e.length&&">"!==e[t++];);return t}return Iw.truncate=function(e,t,n){i(e,t,e.innerHTML,function(t,n){var r,i=t.substring(0,n)+"...",a=null!==(r=null==o?void 0:o.createHTML(i))&&void 0!==r?r:i;e.innerHTML=a},n)},Iw.getFitStatus=function(e,n){var r=e.offsetTop;return r+e.clientHeight<=n?t.ContainerFitStatus.FullyInContainer:r<n?t.ContainerFitStatus.Overflowing:t.ContainerFitStatus.FullyOutOfContainer},Iw.getScrollX=function(){return window.pageXOffset},Iw.getScrollY=function(){return window.pageYOffset},Iw.clearElementChildren=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},Iw}var Pw,Ow={};function Rw(){if(Pw)return Ow;Pw=1;var e=Ow&&Ow.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Ow,"__esModule",{value:!0}),Ow.SerializableObject=Ow.property=Ow.SerializableObjectSchema=Ow.CustomProperty=Ow.SerializableObjectCollectionProperty=Ow.SerializableObjectProperty=Ow.EnumProperty=Ow.ValueSetProperty=Ow.StringArrayProperty=Ow.PixelSizeProperty=Ow.NumProperty=Ow.BoolProperty=Ow.StringProperty=Ow.PropertyDefinition=Ow.BaseSerializationContext=Ow.isVersionLessOrEqual=Ow.Versions=Ow.Version=void 0;var t=Dw(),n=Lw(),r=Mw(),i=kw(),o=function(){function e(e,t,n){void 0===e&&(e=1),void 0===t&&(t=1),this._isValid=!0,this._major=e,this._minor=t,this._label=n}return e.parse=function(t,n){if(t){var o=new e;o._versionString=t;var a=/(\d+).(\d+)/gi.exec(t);return null!=a&&3===a.length?(o._major=parseInt(a[1]),o._minor=parseInt(a[2])):o._isValid=!1,o._isValid||n.logParseEvent(void 0,r.ValidationEvent.InvalidPropertyValue,i.Strings.errors.invalidVersionString(o._versionString)),o}},e.prototype.toString=function(){return this._isValid?this._major+"."+this._minor:this._versionString},e.prototype.toJSON=function(){return this.toString()},e.prototype.compareTo=function(e){if(!this.isValid||!e.isValid)throw new Error("Cannot compare invalid version.");return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:0},Object.defineProperty(e.prototype,"label",{get:function(){return this._label?this._label:this.toString()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"major",{get:function(){return this._major},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minor",{get:function(){return this._minor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isValid",{get:function(){return this._isValid},enumerable:!1,configurable:!0}),e}();Ow.Version=o;var a=function(){function e(){}return e.getAllDeclaredVersions=function(){var t=e,n=[];for(var r in t)if(r.match(/^v[0-9_]*$/))try{var i=t[r];i instanceof o&&n.push(i)}catch(e){}return n.sort(function(e,t){return e.compareTo(t)})},e.v1_0=new o(1,0),e.v1_1=new o(1,1),e.v1_2=new o(1,2),e.v1_3=new o(1,3),e.v1_4=new o(1,4),e.v1_5=new o(1,5),e.v1_6=new o(1,6,"1.6 Preview"),e.latest=e.v1_5,e}();Ow.Versions=a,Ow.isVersionLessOrEqual=function(e,t){return!(e instanceof o)||(!(t instanceof o)||t.compareTo(e)>=0)};var s=function(){function e(e){void 0===e&&(e=a.latest),this._validationEvents=[],this.targetVersion=e}return e.prototype.serializeValue=function(e,n,r,i,o){void 0===i&&(i=void 0),void 0===o&&(o=!1),null==r||r===i?t.GlobalSettings.enableFullJsonRoundTrip&&!o||delete e[n]:r===i?delete e[n]:e[n]=r},e.prototype.serializeString=function(e,n,r,i){null==r||r===i?t.GlobalSettings.enableFullJsonRoundTrip||delete e[n]:e[n]=r},e.prototype.serializeBool=function(e,n,r,i){null==r||r===i?t.GlobalSettings.enableFullJsonRoundTrip||delete e[n]:e[n]=r},e.prototype.serializeNumber=function(e,n,r,i){null==r||r===i||isNaN(r)?t.GlobalSettings.enableFullJsonRoundTrip||delete e[n]:e[n]=r},e.prototype.serializeEnum=function(e,n,r,i,o){void 0===o&&(o=void 0),null==i||i===o?t.GlobalSettings.enableFullJsonRoundTrip||delete n[r]:n[r]=e[i]},e.prototype.serializeArray=function(e,t,n){var r=[];if(n)for(var i=0,o=n;i<o.length;i++){var a=o[i],s=void 0;void 0!==(s=a instanceof w?a.toJSON(this):a.toJSON?a.toJSON():a)&&r.push(s)}0===r.length?e.hasOwnProperty(t)&&Array.isArray(e[t])&&delete e[t]:this.serializeValue(e,t,r)},e.prototype.clearEvents=function(){this._validationEvents=[]},e.prototype.logEvent=function(e,t,n,r){this._validationEvents.push({source:e,phase:t,event:n,message:r})},e.prototype.logParseEvent=function(e,t,n){this.logEvent(e,r.ValidationPhase.Parse,t,n)},e.prototype.getEventAt=function(e){return this._validationEvents[e]},Object.defineProperty(e.prototype,"eventCount",{get:function(){return this._validationEvents.length},enumerable:!1,configurable:!0}),e}();Ow.BaseSerializationContext=s;var l=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n}(s),c=function(){function e(t,n,r,i){this.targetVersion=t,this.name=n,this.defaultValue=r,this.onGetInitialValue=i,this.isSerializationEnabled=!0,this.sequentialNumber=e._sequentialNumber,e._sequentialNumber++}return e.prototype.getInternalName=function(){return this.name},e.prototype.parse=function(e,t,n){return t[this.name]},e.prototype.toJSON=function(e,t,n,r){r.serializeValue(t,this.name,n,this.defaultValue)},e._sequentialNumber=0,e}();Ow.PropertyDefinition=c;var u=function(t){function o(e,n,r,i,o,a){void 0===r&&(r=!0);var s=t.call(this,e,n,o,a)||this;return s.targetVersion=e,s.name=n,s.treatEmptyAsUndefined=r,s.regEx=i,s.defaultValue=o,s.onGetInitialValue=a,s}return e(o,t),o.prototype.parse=function(e,t,o){var a=n.parseString(t[this.name],this.defaultValue);if(!(void 0===a||""===a&&this.treatEmptyAsUndefined)&&void 0!==this.regEx&&!this.regEx.exec(a))return void o.logParseEvent(e,r.ValidationEvent.InvalidPropertyValue,i.Strings.errors.invalidPropertyValue(a,this.name));return a},o.prototype.toJSON=function(e,t,n,r){r.serializeString(t,this.name,""===n&&this.treatEmptyAsUndefined?void 0:n,this.defaultValue)},o}(c);Ow.StringProperty=u;var d=function(t){function r(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.targetVersion=e,o.name=n,o.defaultValue=r,o.onGetInitialValue=i,o}return e(r,t),r.prototype.parse=function(e,t,r){return n.parseBool(t[this.name],this.defaultValue)},r.prototype.toJSON=function(e,t,n,r){r.serializeBool(t,this.name,n,this.defaultValue)},r}(c);Ow.BoolProperty=d;var p=function(t){function r(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.targetVersion=e,o.name=n,o.defaultValue=r,o.onGetInitialValue=i,o}return e(r,t),r.prototype.parse=function(e,t,r){return n.parseNumber(t[this.name],this.defaultValue)},r.prototype.toJSON=function(e,t,n,r){r.serializeNumber(t,this.name,n,this.defaultValue)},r}(c);Ow.NumProperty=p;var h=function(n){function o(){return null!==n&&n.apply(this,arguments)||this}return e(o,n),o.prototype.parse=function(e,n,o){var a=void 0,s=n[this.name];if("string"==typeof s){var l=!1;try{var c=t.SizeAndUnit.parse(s,!0);c.unit===r.SizeUnit.Pixel&&(a=c.physicalSize,l=!0)}catch(e){}l||o.logParseEvent(e,r.ValidationEvent.InvalidPropertyValue,i.Strings.errors.invalidPropertyValue(n[this.name],"minHeight"))}return a},o.prototype.toJSON=function(e,t,n,r){r.serializeValue(t,this.name,"number"!=typeof n||isNaN(n)?void 0:n+"px")},o}(c);Ow.PixelSizeProperty=h;var f=function(t){function n(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.targetVersion=e,o.name=n,o.defaultValue=r,o.onGetInitialValue=i,o}return e(n,t),n.prototype.parse=function(e,t,n){var i=t[this.name];if(void 0===i||!Array.isArray(i))return this.defaultValue;for(var o=[],a=0,s=i;a<s.length;a++){var l=s[a];"string"==typeof l?o.push(l):n.logParseEvent(e,r.ValidationEvent.InvalidPropertyValue,'Invalid array value "'.concat(JSON.stringify(l),'" of type "').concat(typeof l,'" ignored for "').concat(this.name,'".'))}return o},n.prototype.toJSON=function(e,t,n,r){r.serializeArray(t,this.name,n)},n}(c);Ow.StringArrayProperty=f;var m=function(t){function n(e,n,r,i,o){var a=t.call(this,e,n,i,o)||this;return a.targetVersion=e,a.name=n,a.values=r,a.defaultValue=i,a.onGetInitialValue=o,a}return e(n,t),n.prototype.isValidValue=function(e,t){for(var n=0,r=this.values;n<r.length;n++){var i=r[n];if(e.toLowerCase()===i.value.toLowerCase())return(i.targetVersion?i.targetVersion:this.targetVersion).compareTo(t.targetVersion)<=0}return!1},n.prototype.parse=function(e,t,n){var o=t[this.name];if(void 0===o)return this.defaultValue;if("string"==typeof o)for(var a=0,s=this.values;a<s.length;a++){var l=s[a];if(o.toLowerCase()===l.value.toLowerCase()){var c=l.targetVersion?l.targetVersion:this.targetVersion;return c.compareTo(n.targetVersion)<=0?l.value:(n.logParseEvent(e,r.ValidationEvent.InvalidPropertyValue,i.Strings.errors.propertyValueNotSupported(o,this.name,c.toString(),n.targetVersion.toString())),this.defaultValue)}}return n.logParseEvent(e,r.ValidationEvent.InvalidPropertyValue,i.Strings.errors.invalidPropertyValue(o,this.name)),this.defaultValue},n.prototype.toJSON=function(e,t,n,o){var a=!1;if(void 0!==n){a=!0;for(var s=0,l=this.values;s<l.length;s++){var c=l[s];if(c.value===n){var u=c.targetVersion?c.targetVersion:this.targetVersion;if(u.compareTo(o.targetVersion)<=0){a=!1;break}o.logEvent(e,r.ValidationPhase.ToJSON,r.ValidationEvent.InvalidPropertyValue,i.Strings.errors.propertyValueNotSupported(n,this.name,u.toString(),o.targetVersion.toString()))}}}a||o.serializeValue(t,this.name,n,this.defaultValue,!0)},n}(c);Ow.ValueSetProperty=m;var g=function(t){function o(e,n,r,i,o,a){var s=t.call(this,e,n,i,a)||this;if(s.targetVersion=e,s.name=n,s.enumType=r,s.defaultValue=i,s.onGetInitialValue=a,s._values=[],o)s._values=o;else for(var l in r){var c=parseInt(l,10);c>=0&&s._values.push({value:c})}return s}return e(o,t),o.prototype.parse=function(e,t,o){var a=t[this.name];if("string"!=typeof a)return this.defaultValue;var s=n.getEnumValueByName(this.enumType,a);if(void 0!==s)for(var l=0,c=this.values;l<c.length;l++){var u=c[l];if(u.value===s){var d=u.targetVersion?u.targetVersion:this.targetVersion;return d.compareTo(o.targetVersion)<=0?s:(o.logParseEvent(e,r.ValidationEvent.InvalidPropertyValue,i.Strings.errors.propertyValueNotSupported(a,this.name,d.toString(),o.targetVersion.toString())),this.defaultValue)}}return o.logParseEvent(e,r.ValidationEvent.InvalidPropertyValue,i.Strings.errors.invalidPropertyValue(a,this.name)),this.defaultValue},o.prototype.toJSON=function(e,t,n,o){var a=!1;if(void 0!==n){a=!0;for(var s=0,l=this.values;s<l.length;s++){var c=l[s];if(c.value===n){if((c.targetVersion?c.targetVersion:this.targetVersion).compareTo(o.targetVersion)<=0){a=!1;break}o.logEvent(e,r.ValidationPhase.ToJSON,r.ValidationEvent.InvalidPropertyValue,i.Strings.errors.invalidPropertyValue(n,this.name))}}}a||o.serializeEnum(this.enumType,t,this.name,n,this.defaultValue)},Object.defineProperty(o.prototype,"values",{get:function(){return this._values},enumerable:!1,configurable:!0}),o}(c);Ow.EnumProperty=g;var y=function(t){function n(e,n,r,i,o){void 0===i&&(i=!1);var a=t.call(this,e,n,o,function(e){return a.nullable?void 0:new a.objectType})||this;return a.targetVersion=e,a.name=n,a.objectType=r,a.nullable=i,a}return e(n,t),n.prototype.parse=function(e,t,n){var r=t[this.name];if(void 0===r)return this.onGetInitialValue?this.onGetInitialValue(e):this.defaultValue;var i=new this.objectType;return i.parse(r,n),i},n.prototype.toJSON=function(e,t,n,r){var i=void 0;void 0===n||n.hasAllDefaultValues()||(i=n.toJSON(r)),"object"==typeof i&&0===Object.keys(i).length&&(i=void 0),r.serializeValue(t,this.name,i,this.defaultValue,!0)},n}(c);Ow.SerializableObjectProperty=y;var A=function(t){function n(e,n,r,i){var o=t.call(this,e,n,void 0,function(e){return[]})||this;return o.targetVersion=e,o.name=n,o.objectType=r,o.onItemAdded=i,o}return e(n,t),n.prototype.parse=function(e,t,n){var r=[],i=t[this.name];if(Array.isArray(i))for(var o=0,a=i;o<a.length;o++){var s=a[o],l=new this.objectType;l.parse(s,n),r.push(l),this.onItemAdded&&this.onItemAdded(e,l)}return r.length>0?r:this.onGetInitialValue?this.onGetInitialValue(e):void 0},n.prototype.toJSON=function(e,t,n,r){r.serializeArray(t,this.name,n)},n}(c);Ow.SerializableObjectCollectionProperty=A;var v=function(t){function n(e,n,r,i,o,a){var s=t.call(this,e,n,o,a)||this;if(s.targetVersion=e,s.name=n,s.onParse=r,s.onToJSON=i,s.defaultValue=o,s.onGetInitialValue=a,!s.onParse)throw new Error("CustomPropertyDefinition instances must have an onParse handler.");if(!s.onToJSON)throw new Error("CustomPropertyDefinition instances must have an onToJSON handler.");return s}return e(n,t),n.prototype.parse=function(e,t,n){return this.onParse(e,this,t,n)},n.prototype.toJSON=function(e,t,n,r){this.onToJSON(e,this,t,n,r)},n}(c);Ow.CustomProperty=v;var b=function(){function e(){this._properties=[]}return e.prototype.indexOf=function(e){for(var t=0;t<this._properties.length;t++)if(this._properties[t]===e)return t;return-1},e.prototype.add=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,r=e;n<r.length;n++){var i=r[n];-1===this.indexOf(i)&&this._properties.push(i)}},e.prototype.remove=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,r=e;n<r.length;n++)for(var i=r[n];;){var o=this.indexOf(i);if(!(o>=0))break;this._properties.splice(o,1)}},e.prototype.getItemAt=function(e){return this._properties[e]},e.prototype.getCount=function(){return this._properties.length},e}();Ow.SerializableObjectSchema=b,Ow.property=function(e){return function(t,n){var r=Object.getOwnPropertyDescriptor(t,n)||{};r.get||r.set||(r.get=function(){return this.getValue(e)},r.set=function(t){this.setValue(e,t)},Object.defineProperty(t,n,r))}};var w=function(){function e(){this._propertyBag={},this._rawProperties={},this.maxVersion=e.defaultMaxVersion;for(var t=this.getSchema(),n=0;n<t.getCount();n++){var r=t.getItemAt(n);r.onGetInitialValue&&this.setValue(r,r.onGetInitialValue(this))}}return e.prototype.getDefaultSerializationContext=function(){return new l},e.prototype.populateSchema=function(t){var n=this.constructor,r=[];for(var i in n)try{var o=n[i];o instanceof c&&r.push(o)}catch(e){}if(r.length>0){var a=r.sort(function(e,t){return e.sequentialNumber>t.sequentialNumber?1:e.sequentialNumber<t.sequentialNumber?-1:0});t.add.apply(t,a)}e.onRegisterCustomProperties&&e.onRegisterCustomProperties(this,t)},e.prototype.getValue=function(e){return this._propertyBag.hasOwnProperty(e.getInternalName())?this._propertyBag[e.getInternalName()]:e.defaultValue},e.prototype.setValue=function(e,t){null==t?delete this._propertyBag[e.getInternalName()]:this._propertyBag[e.getInternalName()]=t},e.prototype.internalParse=function(e,n){if(this._propertyBag={},this._rawProperties=t.GlobalSettings.enableFullJsonRoundTrip&&e||{},e)for(var o=this.getSchema(),a=0;a<o.getCount();a++){var s=o.getItemAt(a);if(s.isSerializationEnabled){var l=s.onGetInitialValue?s.onGetInitialValue(this):void 0;e.hasOwnProperty(s.name)&&(s.targetVersion.compareTo(n.targetVersion)<=0?l=s.parse(this,e,n):n.logParseEvent(this,r.ValidationEvent.UnsupportedProperty,i.Strings.errors.propertyNotSupported(s.name,s.targetVersion.toString(),n.targetVersion.toString()))),this.setValue(s,l)}}else this.resetDefaultValues()},e.prototype.internalToJSON=function(e,t){for(var n=this.getSchema(),r=[],i=0;i<n.getCount();i++){var o=n.getItemAt(i);o.isSerializationEnabled&&o.targetVersion.compareTo(t.targetVersion)<=0&&-1===r.indexOf(o.name)&&(o.toJSON(this,e,this.getValue(o),t),r.push(o.name))}},e.prototype.shouldSerialize=function(e){return!0},e.prototype.parse=function(e,t){this.internalParse(e,t||new l)},e.prototype.toJSON=function(e){var n;if(e&&e instanceof s?n=e:(n=this.getDefaultSerializationContext()).toJSONOriginalParam=e,this.shouldSerialize(n)){var r=void 0;return r=t.GlobalSettings.enableFullJsonRoundTrip&&this._rawProperties&&"object"==typeof this._rawProperties?this._rawProperties:{},this.internalToJSON(r,n),r}},e.prototype.hasDefaultValue=function(e){return this.getValue(e)===e.defaultValue},e.prototype.hasAllDefaultValues=function(){for(var e=this.getSchema(),t=0;t<e.getCount();t++){var n=e.getItemAt(t);if(!this.hasDefaultValue(n))return!1}return!0},e.prototype.resetDefaultValues=function(){for(var e=this.getSchema(),t=0;t<e.getCount();t++){var n=e.getItemAt(t);this.setValue(n,n.defaultValue)}},e.prototype.setCustomProperty=function(e,t){"string"==typeof t&&!t||null==t?delete this._rawProperties[e]:this._rawProperties[e]=t},e.prototype.getCustomProperty=function(e){return this._rawProperties[e]},e.prototype.getSchema=function(){var t=e._schemaCache[this.getSchemaKey()];return t||(t=new b,this.populateSchema(t),e._schemaCache[this.getSchemaKey()]=t),t},e.defaultMaxVersion=a.latest,e._schemaCache={},e}();return Ow.SerializableObject=w,Ow}var Bw,Yw={};function Nw(){if(Bw)return Yw;Bw=1;var e=Yw&&Yw.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Yw,"__esModule",{value:!0}),Yw.HostCapabilities=void 0;var t=Rw(),n=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e._capabilities={},e}return e(r,n),r.prototype.getSchemaKey=function(){return"HostCapabilities"},r.prototype.internalParse=function(e,r){if(n.prototype.internalParse.call(this,e,r),e)for(var i in e){var o=e[i];if("string"==typeof o)if("*"===o)this.addCapability(i,"*");else{var a=t.Version.parse(o,r);(null==a?void 0:a.isValid)&&this.addCapability(i,a)}}},r.prototype.internalToJSON=function(e,t){for(var r in n.prototype.internalToJSON.call(this,e,t),this._capabilities)e[r]=this._capabilities[r]},r.prototype.addCapability=function(e,t){this._capabilities[e]=t},r.prototype.removeCapability=function(e){delete this._capabilities[e]},r.prototype.clear=function(){this._capabilities={}},r.prototype.hasCapability=function(e,t){return!!this._capabilities.hasOwnProperty(e)&&("*"===t||"*"===this._capabilities[e]||t.compareTo(this._capabilities[e])<=0)},r.prototype.areAllMet=function(e){for(var t in this._capabilities)if(!e.hasCapability(t,this._capabilities[t]))return!1;return!0},r}(t.SerializableObject);return Yw.HostCapabilities=n,Yw}var Vw,Fw={};function jw(){if(Vw)return Fw;Vw=1;var e=Fw&&Fw.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Fw,"__esModule",{value:!0}),Fw.defaultHostConfig=Fw.HostConfig=Fw.FontTypeSet=Fw.FontTypeDefinition=Fw.ContainerStyleSet=Fw.ContainerStyleDefinition=Fw.ColorSetDefinition=Fw.ActionsConfig=Fw.ShowCardActionConfig=Fw.FactSetConfig=Fw.FactTitleDefinition=Fw.FactTextDefinition=Fw.InputConfig=Fw.InputLabelConfig=Fw.RequiredInputLabelTextDefinition=Fw.TextBlockConfig=Fw.TextStyleSet=Fw.TextStyleDefinition=Fw.BaseTextDefinition=Fw.TableConfig=Fw.MediaConfig=Fw.ImageSetConfig=Fw.AdaptiveCardConfig=Fw.TextColorDefinition=Fw.ColorDefinition=void 0;var t=Mw(),n=Lw(),r=Dw(),i=Nw();function o(e,t,r){if("string"==typeof t){var i=n.parseEnum(e,t,r);return void 0!==i?i:r}return"number"==typeof t?t:r}var a=function(){function e(e,t){this.default="#000000",this.subtle="#666666",e&&(this.default=e),t&&(this.subtle=t)}return e.prototype.parse=function(e){e&&(this.default=e.default||this.default,this.subtle=e.subtle||this.subtle)},e}();Fw.ColorDefinition=a;var s=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.highlightColors=new a("#22000000","#11000000"),e}return e(n,t),n.prototype.parse=function(e){t.prototype.parse.call(this,e),e&&this.highlightColors.parse(e.highlightColors)},n}(a);Fw.TextColorDefinition=s;var l=function(){return function(e){this.allowCustomStyle=!1,e&&(this.allowCustomStyle=e.allowCustomStyle||this.allowCustomStyle)}}();Fw.AdaptiveCardConfig=l;var c=function(){function e(e){this.imageSize=t.Size.Medium,this.maxImageHeight=100,e&&(this.imageSize=null!=e.imageSize?e.imageSize:this.imageSize,this.maxImageHeight=n.parseNumber(e.maxImageHeight,100))}return e.prototype.toJSON=function(){return{imageSize:t.Size[this.imageSize],maxImageHeight:this.maxImageHeight}},e}();Fw.ImageSetConfig=c;var u=function(){function e(e){this.allowInlinePlayback=!0,e&&(this.defaultPoster=e.defaultPoster,this.allowInlinePlayback=e.allowInlinePlayback||this.allowInlinePlayback)}return e.prototype.toJSON=function(){return{defaultPoster:this.defaultPoster,allowInlinePlayback:this.allowInlinePlayback}},e}();Fw.MediaConfig=u;var d=function(){function e(e){this.cellSpacing=8,e&&(this.cellSpacing=e.cellSpacing&&"number"==typeof e.cellSpacing?e.cellSpacing:this.cellSpacing)}return e.prototype.toJSON=function(){return{cellSpacing:this.cellSpacing}},e}();Fw.TableConfig=d;var p=function(){function e(e){this.size=t.TextSize.Default,this.color=t.TextColor.Default,this.isSubtle=!1,this.weight=t.TextWeight.Default,this.parse(e)}return e.prototype.parse=function(e){e&&(this.size=o(t.TextSize,e.size,this.size),this.color=o(t.TextColor,e.color,this.color),this.isSubtle=void 0!==e.isSubtle&&"boolean"==typeof e.isSubtle?e.isSubtle:this.isSubtle,this.weight=o(t.TextWeight,e.weight,this.getDefaultWeight()))},e.prototype.getDefaultWeight=function(){return t.TextWeight.Default},e.prototype.toJSON=function(){return{size:t.TextSize[this.size],color:t.TextColor[this.color],isSubtle:this.isSubtle,weight:t.TextWeight[this.weight]}},e}();Fw.BaseTextDefinition=p;var h=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.fontType=t.FontType.Default,e}return e(r,n),r.prototype.parse=function(e){n.prototype.parse.call(this,e),e&&(this.fontType=o(t.FontType,e.fontType,this.fontType))},r}(p);Fw.TextStyleDefinition=h;var f=function(){function e(e){this.default=new h,this.heading=new h({size:"Large",weight:"Bolder"}),this.columnHeader=new h({weight:"Bolder"}),e&&(this.heading.parse(e.heading),this.columnHeader.parse(e.columnHeader))}return e.prototype.getStyleByName=function(e){switch(e.toLowerCase()){case"heading":return this.heading;case"columnHeader":return this.columnHeader;default:return this.default}},e}();Fw.TextStyleSet=f;var m=function(){return function(e){e&&(this.headingLevel=n.parseNumber(e.headingLevel))}}();Fw.TextBlockConfig=m;var g=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.suffix=" *",e.suffixColor=t.TextColor.Attention,e}return e(r,n),r.prototype.parse=function(e){n.prototype.parse.call(this,e),e&&(this.suffix=e.suffix||this.suffix,this.suffixColor=o(t.TextColor,e.suffixColor,this.suffixColor))},r.prototype.toJSON=function(){var e=n.prototype.toJSON.call(this);return e.suffix=this.suffix,e.suffixColor=t.TextColor[this.suffixColor],e},r}(p);Fw.RequiredInputLabelTextDefinition=g;var y=function(){return function(e){this.inputSpacing=t.Spacing.Small,this.requiredInputs=new g,this.optionalInputs=new p,e&&(this.inputSpacing=o(t.Spacing,e.inputSpacing,this.inputSpacing),this.requiredInputs=new g(e.requiredInputs),this.optionalInputs=new p(e.optionalInputs))}}();Fw.InputLabelConfig=y;var A=function(){return function(e){this.label=new y,this.errorMessage=new p({color:t.TextColor.Attention}),e&&(this.label=new y(e.label),this.errorMessage=new p(e.errorMessage))}}();Fw.InputConfig=A;var v=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.wrap=!0,e}return e(n,t),n.prototype.parse=function(e){t.prototype.parse.call(this,e),e&&(this.wrap=null!=e.wrap?e.wrap:this.wrap)},n.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.wrap=this.wrap,e},n}(p);Fw.FactTextDefinition=v;var b=function(n){function r(e){var r=n.call(this,e)||this;return r.maxWidth=150,r.weight=t.TextWeight.Bolder,e&&(r.maxWidth=null!=e.maxWidth?e.maxWidth:r.maxWidth,r.weight=o(t.TextWeight,e.weight,t.TextWeight.Bolder)),r}return e(r,n),r.prototype.getDefaultWeight=function(){return t.TextWeight.Bolder},r}(v);Fw.FactTitleDefinition=b;var w=function(){return function(e){this.title=new b,this.value=new v,this.spacing=10,e&&(this.title=new b(e.title),this.value=new v(e.value),this.spacing=e.spacing&&null!=e.spacing?e.spacing&&e.spacing:this.spacing)}}();Fw.FactSetConfig=w;var E=function(){function e(e){this.actionMode=t.ShowCardActionMode.Inline,this.inlineTopMargin=16,this.style=t.ContainerStyle.Emphasis,e&&(this.actionMode=o(t.ShowCardActionMode,e.actionMode,t.ShowCardActionMode.Inline),this.inlineTopMargin=null!=e.inlineTopMargin?e.inlineTopMargin:this.inlineTopMargin,this.style=e.style&&"string"==typeof e.style?e.style:t.ContainerStyle.Emphasis)}return e.prototype.toJSON=function(){return{actionMode:t.ShowCardActionMode[this.actionMode],inlineTopMargin:this.inlineTopMargin,style:this.style}},e}();Fw.ShowCardActionConfig=E;var k=function(){function e(e){if(this.maxActions=5,this.spacing=t.Spacing.Default,this.buttonSpacing=20,this.showCard=new E,this.preExpandSingleShowCardAction=!1,this.actionsOrientation=t.Orientation.Horizontal,this.actionAlignment=t.ActionAlignment.Left,this.iconPlacement=t.ActionIconPlacement.LeftOfTitle,this.allowTitleToWrap=!1,this.iconSize=16,e){this.maxActions=null!=e.maxActions?e.maxActions:this.maxActions,this.spacing=o(t.Spacing,e.spacing&&e.spacing,t.Spacing.Default),this.buttonSpacing=null!=e.buttonSpacing?e.buttonSpacing:this.buttonSpacing,this.showCard=new E(e.showCard),this.preExpandSingleShowCardAction=n.parseBool(e.preExpandSingleShowCardAction,!1),this.actionsOrientation=o(t.Orientation,e.actionsOrientation,t.Orientation.Horizontal),this.actionAlignment=o(t.ActionAlignment,e.actionAlignment,t.ActionAlignment.Left),this.iconPlacement=o(t.ActionIconPlacement,e.iconPlacement,t.ActionIconPlacement.LeftOfTitle),this.allowTitleToWrap=null!=e.allowTitleToWrap?e.allowTitleToWrap:this.allowTitleToWrap;try{var i=r.SizeAndUnit.parse(e.iconSize);i.unit===t.SizeUnit.Pixel&&(this.iconSize=i.physicalSize)}catch(e){}}}return e.prototype.toJSON=function(){return{maxActions:this.maxActions,spacing:t.Spacing[this.spacing],buttonSpacing:this.buttonSpacing,showCard:this.showCard,preExpandSingleShowCardAction:this.preExpandSingleShowCardAction,actionsOrientation:t.Orientation[this.actionsOrientation],actionAlignment:t.ActionAlignment[this.actionAlignment]}},e}();Fw.ActionsConfig=k;var C=function(){function e(e){this.default=new s,this.dark=new s,this.light=new s,this.accent=new s,this.good=new s,this.warning=new s,this.attention=new s,this.parse(e)}return e.prototype.parseSingleColor=function(e,t){e&&this[t].parse(e[t])},e.prototype.parse=function(e){e&&(this.parseSingleColor(e,"default"),this.parseSingleColor(e,"dark"),this.parseSingleColor(e,"light"),this.parseSingleColor(e,"accent"),this.parseSingleColor(e,"good"),this.parseSingleColor(e,"warning"),this.parseSingleColor(e,"attention"))},e}();Fw.ColorSetDefinition=C;var _=function(){function e(e){this.foregroundColors=new C({default:{default:"#333333",subtle:"#EE333333"},dark:{default:"#000000",subtle:"#66000000"},light:{default:"#FFFFFF",subtle:"#33000000"},accent:{default:"#2E89FC",subtle:"#882E89FC"},good:{default:"#028A02",subtle:"#DD027502"},warning:{default:"#E69500",subtle:"#DDE69500"},attention:{default:"#CC3300",subtle:"#DDCC3300"}}),this.parse(e)}return e.prototype.parse=function(e){e&&(this.backgroundColor=e.backgroundColor,this.foregroundColors.parse(e.foregroundColors),this.highlightBackgroundColor=e.highlightBackgroundColor,this.highlightForegroundColor=e.highlightForegroundColor,this.borderColor=e.borderColor)},Object.defineProperty(e.prototype,"isBuiltIn",{get:function(){return!1},enumerable:!1,configurable:!0}),e}();Fw.ContainerStyleDefinition=_;var M=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),Object.defineProperty(n.prototype,"isBuiltIn",{get:function(){return!0},enumerable:!1,configurable:!0}),n}(_),T=function(){function e(e){if(this._allStyles={},this._allStyles[t.ContainerStyle.Default]=new M,this._allStyles[t.ContainerStyle.Emphasis]=new M,this._allStyles[t.ContainerStyle.Accent]=new M,this._allStyles[t.ContainerStyle.Good]=new M,this._allStyles[t.ContainerStyle.Attention]=new M,this._allStyles[t.ContainerStyle.Warning]=new M,e){this._allStyles[t.ContainerStyle.Default].parse(e[t.ContainerStyle.Default]),this._allStyles[t.ContainerStyle.Emphasis].parse(e[t.ContainerStyle.Emphasis]),this._allStyles[t.ContainerStyle.Accent].parse(e[t.ContainerStyle.Accent]),this._allStyles[t.ContainerStyle.Good].parse(e[t.ContainerStyle.Good]),this._allStyles[t.ContainerStyle.Attention].parse(e[t.ContainerStyle.Attention]),this._allStyles[t.ContainerStyle.Warning].parse(e[t.ContainerStyle.Warning]);var n=e.customStyles;if(n&&Array.isArray(n))for(var r=0,i=n;r<i.length;r++){var o=i[r];if(o){var a=o.name;a&&"string"==typeof a&&(this._allStyles.hasOwnProperty(a)?this._allStyles[a].parse(o.style):this._allStyles[a]=new _(o.style))}}}}return e.prototype.toJSON=function(){var e=this,t=[];Object.keys(this._allStyles).forEach(function(n){e._allStyles[n].isBuiltIn||t.push({name:n,style:e._allStyles[n]})});var n={default:this.default,emphasis:this.emphasis};return t.length>0&&(n.customStyles=t),n},e.prototype.getStyleByName=function(e,n){return e&&this._allStyles.hasOwnProperty(e)?this._allStyles[e]:n||this._allStyles[t.ContainerStyle.Default]},Object.defineProperty(e.prototype,"default",{get:function(){return this._allStyles[t.ContainerStyle.Default]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emphasis",{get:function(){return this._allStyles[t.ContainerStyle.Emphasis]},enumerable:!1,configurable:!0}),e}();Fw.ContainerStyleSet=T;var S=function(){function e(e){this.fontFamily="Segoe UI,Segoe,Segoe WP,Helvetica Neue,Helvetica,sans-serif",this.fontSizes={small:12,default:14,medium:17,large:21,extraLarge:26},this.fontWeights={lighter:200,default:400,bolder:600},e&&(this.fontFamily=e)}return e.prototype.parse=function(e){this.fontFamily=e.fontFamily||this.fontFamily,this.fontSizes={small:e.fontSizes&&e.fontSizes.small||this.fontSizes.small,default:e.fontSizes&&e.fontSizes.default||this.fontSizes.default,medium:e.fontSizes&&e.fontSizes.medium||this.fontSizes.medium,large:e.fontSizes&&e.fontSizes.large||this.fontSizes.large,extraLarge:e.fontSizes&&e.fontSizes.extraLarge||this.fontSizes.extraLarge},this.fontWeights={lighter:e.fontWeights&&e.fontWeights.lighter||this.fontWeights.lighter,default:e.fontWeights&&e.fontWeights.default||this.fontWeights.default,bolder:e.fontWeights&&e.fontWeights.bolder||this.fontWeights.bolder}},e.monospace=new e("'Courier New', Courier, monospace"),e}();Fw.FontTypeDefinition=S;var D=function(){function e(e){this.default=new S,this.monospace=new S("'Courier New', Courier, monospace"),e&&(this.default.parse(e.default),this.monospace.parse(e.monospace))}return e.prototype.getStyleDefinition=function(e){switch(e){case t.FontType.Monospace:return this.monospace;case t.FontType.Default:default:return this.default}},e}();Fw.FontTypeSet=D;var x=function(){function e(e){this.hostCapabilities=new i.HostCapabilities,this.choiceSetInputValueSeparator=",",this.supportsInteractivity=!0,this.spacing={small:3,default:8,medium:20,large:30,extraLarge:40,padding:15},this.separator={lineThickness:1,lineColor:"#EEEEEE"},this.imageSizes={small:40,medium:80,large:160},this.containerStyles=new T,this.inputs=new A,this.actions=new k,this.adaptiveCard=new l,this.imageSet=new c,this.media=new u,this.factSet=new w,this.table=new d,this.textStyles=new f,this.textBlock=new m,this.alwaysAllowBleed=!1,e&&(("string"==typeof e||e instanceof String)&&(e=JSON.parse(e)),this.choiceSetInputValueSeparator=e&&"string"==typeof e.choiceSetInputValueSeparator?e.choiceSetInputValueSeparator:this.choiceSetInputValueSeparator,this.supportsInteractivity=e&&"boolean"==typeof e.supportsInteractivity?e.supportsInteractivity:this.supportsInteractivity,this._legacyFontType=new S,this._legacyFontType.parse(e),e.fontTypes&&(this.fontTypes=new D(e.fontTypes)),e.lineHeights&&(this.lineHeights={small:e.lineHeights.small,default:e.lineHeights.default,medium:e.lineHeights.medium,large:e.lineHeights.large,extraLarge:e.lineHeights.extraLarge}),this.imageSizes={small:e.imageSizes&&e.imageSizes.small||this.imageSizes.small,medium:e.imageSizes&&e.imageSizes.medium||this.imageSizes.medium,large:e.imageSizes&&e.imageSizes.large||this.imageSizes.large},this.containerStyles=new T(e.containerStyles),this.spacing={small:e.spacing&&e.spacing.small||this.spacing.small,default:e.spacing&&e.spacing.default||this.spacing.default,medium:e.spacing&&e.spacing.medium||this.spacing.medium,large:e.spacing&&e.spacing.large||this.spacing.large,extraLarge:e.spacing&&e.spacing.extraLarge||this.spacing.extraLarge,padding:e.spacing&&e.spacing.padding||this.spacing.padding},this.separator={lineThickness:e.separator&&e.separator.lineThickness||this.separator.lineThickness,lineColor:e.separator&&e.separator.lineColor||this.separator.lineColor},this.inputs=new A(e.inputs||this.inputs),this.actions=new k(e.actions||this.actions),this.adaptiveCard=new l(e.adaptiveCard||this.adaptiveCard),this.imageSet=new c(e.imageSet),this.factSet=new w(e.factSet),this.textStyles=new f(e.textStyles),this.textBlock=new m(e.textBlock))}return e.prototype.getFontTypeDefinition=function(e){return this.fontTypes?this.fontTypes.getStyleDefinition(e):e===t.FontType.Monospace?S.monospace:this._legacyFontType},e.prototype.getEffectiveSpacing=function(e){switch(e){case t.Spacing.Small:return this.spacing.small;case t.Spacing.Default:return this.spacing.default;case t.Spacing.Medium:return this.spacing.medium;case t.Spacing.Large:return this.spacing.large;case t.Spacing.ExtraLarge:return this.spacing.extraLarge;case t.Spacing.Padding:return this.spacing.padding;default:return 0}},e.prototype.paddingDefinitionToSpacingDefinition=function(e){return new r.SpacingDefinition(this.getEffectiveSpacing(e.top),this.getEffectiveSpacing(e.right),this.getEffectiveSpacing(e.bottom),this.getEffectiveSpacing(e.left))},e.prototype.makeCssClassNames=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=[],r=0,i=e;r<i.length;r++){var o=i[r];n.push((this.cssClassNamePrefix?this.cssClassNamePrefix+"-":"")+o)}return n},e.prototype.makeCssClassName=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.makeCssClassNames.apply(this,e).join(" ");return n||""},Object.defineProperty(e.prototype,"fontFamily",{get:function(){return this._legacyFontType.fontFamily},set:function(e){this._legacyFontType.fontFamily=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontSizes",{get:function(){return this._legacyFontType.fontSizes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontWeights",{get:function(){return this._legacyFontType.fontWeights},enumerable:!1,configurable:!0}),e}();return Fw.HostConfig=x,Fw.defaultHostConfig=new x({supportsInteractivity:!0,spacing:{small:10,default:20,medium:30,large:40,extraLarge:50,padding:20},separator:{lineThickness:1,lineColor:"#EEEEEE"},fontTypes:{default:{fontFamily:"'Segoe UI', Tahoma, Geneva, Verdana, sans-serif",fontSizes:{small:12,default:14,medium:17,large:21,extraLarge:26},fontWeights:{lighter:200,default:400,bolder:600}},monospace:{fontFamily:"'Courier New', Courier, monospace",fontSizes:{small:12,default:14,medium:17,large:21,extraLarge:26},fontWeights:{lighter:200,default:400,bolder:600}}},imageSizes:{small:40,medium:80,large:160},containerStyles:{default:{backgroundColor:"#FFFFFF",foregroundColors:{default:{default:"#333333",subtle:"#EE333333"},dark:{default:"#000000",subtle:"#66000000"},light:{default:"#FFFFFF",subtle:"#33000000"},accent:{default:"#2E89FC",subtle:"#882E89FC"},attention:{default:"#cc3300",subtle:"#DDcc3300"},good:{default:"#028A02",subtle:"#DD027502"},warning:{default:"#e69500",subtle:"#DDe69500"}}},emphasis:{backgroundColor:"#08000000",foregroundColors:{default:{default:"#333333",subtle:"#EE333333"},dark:{default:"#000000",subtle:"#66000000"},light:{default:"#FFFFFF",subtle:"#33000000"},accent:{default:"#2E89FC",subtle:"#882E89FC"},attention:{default:"#cc3300",subtle:"#DDcc3300"},good:{default:"#028A02",subtle:"#DD027502"},warning:{default:"#e69500",subtle:"#DDe69500"}}},accent:{backgroundColor:"#C7DEF9",foregroundColors:{default:{default:"#333333",subtle:"#EE333333"},dark:{default:"#000000",subtle:"#66000000"},light:{default:"#FFFFFF",subtle:"#33000000"},accent:{default:"#2E89FC",subtle:"#882E89FC"},attention:{default:"#cc3300",subtle:"#DDcc3300"},good:{default:"#028A02",subtle:"#DD027502"},warning:{default:"#e69500",subtle:"#DDe69500"}}},good:{backgroundColor:"#CCFFCC",foregroundColors:{default:{default:"#333333",subtle:"#EE333333"},dark:{default:"#000000",subtle:"#66000000"},light:{default:"#FFFFFF",subtle:"#33000000"},accent:{default:"#2E89FC",subtle:"#882E89FC"},attention:{default:"#cc3300",subtle:"#DDcc3300"},good:{default:"#028A02",subtle:"#DD027502"},warning:{default:"#e69500",subtle:"#DDe69500"}}},attention:{backgroundColor:"#FFC5B2",foregroundColors:{default:{default:"#333333",subtle:"#EE333333"},dark:{default:"#000000",subtle:"#66000000"},light:{default:"#FFFFFF",subtle:"#33000000"},accent:{default:"#2E89FC",subtle:"#882E89FC"},attention:{default:"#cc3300",subtle:"#DDcc3300"},good:{default:"#028A02",subtle:"#DD027502"},warning:{default:"#e69500",subtle:"#DDe69500"}}},warning:{backgroundColor:"#FFE2B2",foregroundColors:{default:{default:"#333333",subtle:"#EE333333"},dark:{default:"#000000",subtle:"#66000000"},light:{default:"#FFFFFF",subtle:"#33000000"},accent:{default:"#2E89FC",subtle:"#882E89FC"},attention:{default:"#cc3300",subtle:"#DDcc3300"},good:{default:"#028A02",subtle:"#DD027502"},warning:{default:"#e69500",subtle:"#DDe69500"}}}},inputs:{label:{requiredInputs:{weight:t.TextWeight.Bolder,suffix:" *",suffixColor:t.TextColor.Attention},optionalInputs:{weight:t.TextWeight.Bolder}},errorMessage:{color:t.TextColor.Attention,weight:t.TextWeight.Bolder}},actions:{maxActions:5,spacing:t.Spacing.Default,buttonSpacing:10,showCard:{actionMode:t.ShowCardActionMode.Inline,inlineTopMargin:16},actionsOrientation:t.Orientation.Horizontal,actionAlignment:t.ActionAlignment.Left},adaptiveCard:{allowCustomStyle:!1},imageSet:{imageSize:t.Size.Medium,maxImageHeight:100},factSet:{title:{color:t.TextColor.Default,size:t.TextSize.Default,isSubtle:!1,weight:t.TextWeight.Bolder,wrap:!0,maxWidth:150},value:{color:t.TextColor.Default,size:t.TextSize.Default,isSubtle:!1,weight:t.TextWeight.Default,wrap:!0},spacing:10}}),Fw}var Hw,qw={};function Gw(){return Hw||(Hw=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalRegistry=e.CardObjectRegistry=e.ElementSingletonBehavior=void 0;var t,n,r=Rw();(n=t=e.ElementSingletonBehavior||(e.ElementSingletonBehavior={}))[n.Only=0]="Only",n[n.Allowed=1]="Allowed",n[n.NotAllowed=2]="NotAllowed";var i=function(){function e(){this._items={}}return e.prototype.findByName=function(e){return this._items.hasOwnProperty(e)?this._items[e]:void 0},e.prototype.clear=function(){this._items={}},e.prototype.copyTo=function(e){for(var t=0,n=Object.keys(this._items);t<n.length;t++){var r=n[t],i=this._items[r];e.register(i.typeName,i.objectType,i.schemaVersion,i.singletonBehavior)}},e.prototype.register=function(e,n,i,o){void 0===i&&(i=r.Versions.v1_0),void 0===o&&(o=t.NotAllowed);var a=this.findByName(e);void 0!==a?a.objectType=n:a={typeName:e,objectType:n,schemaVersion:i,singletonBehavior:o},this._items[e]=a},e.prototype.unregister=function(e){delete this._items[e]},e.prototype.createInstance=function(e,t){var n=this.findByName(e);return n&&n.schemaVersion.compareTo(t)<=0?new n.objectType:void 0},e.prototype.getItemCount=function(){return Object.keys(this._items).length},e.prototype.getItemAt=function(e){var t=this;return Object.keys(this._items).map(function(e){return t._items[e]})[e]},e}();e.CardObjectRegistry=i;var o=function(){function e(){}return e.populateWithDefaultElements=function(t){t.clear(),e.defaultElements.copyTo(t)},e.populateWithDefaultActions=function(t){t.clear(),e.defaultActions.copyTo(t)},Object.defineProperty(e,"elements",{get:function(){return e._elements||(e._elements=new i,e.populateWithDefaultElements(e._elements)),e._elements},enumerable:!1,configurable:!0}),Object.defineProperty(e,"actions",{get:function(){return e._actions||(e._actions=new i,e.populateWithDefaultActions(e._actions)),e._actions},enumerable:!1,configurable:!0}),e.reset=function(){e._elements=void 0,e._actions=void 0},e.defaultElements=new i,e.defaultActions=new i,e}();e.GlobalRegistry=o}(qw)),qw}var zw,Uw={};function Ww(){if(zw)return Uw;zw=1;var e=Uw&&Uw.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),t=Uw&&Uw.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};Object.defineProperty(Uw,"__esModule",{value:!0}),Uw.CardObject=Uw.ValidationResults=void 0;var n=Mw(),r=kw(),i=Dw(),o=Nw(),a=Rw(),s=function(){function e(){this.allIds={},this.validationEvents=[]}return e.prototype.addFailure=function(e,t,r){this.validationEvents.push({phase:n.ValidationPhase.Validation,source:e,event:t,message:r})},e}();Uw.ValidationResults=s;var l=function(l){function c(){var e=null!==l&&l.apply(this,arguments)||this;return e._shouldFallback=!1,e}return e(c,l),c.prototype.getSchemaKey=function(){return this.getJsonTypeName()},Object.defineProperty(c.prototype,"requires",{get:function(){return this.getValue(c.requiresProperty)},enumerable:!1,configurable:!0}),c.prototype.contains=function(e){return!!this._renderedElement&&this._renderedElement.contains(e)},c.prototype.preProcessPropertyValue=function(e,t){var n=void 0===t?this.getValue(e):t;if(i.GlobalSettings.allowPreProcessingPropertyValues){for(var r=this;r&&!r.onPreProcessPropertyValue;)r=r.parent;if(r&&r.onPreProcessPropertyValue)return r.onPreProcessPropertyValue(this,e,n)}return n},c.prototype.setParent=function(e){this._parent=e},c.prototype.setShouldFallback=function(e){this._shouldFallback=e},c.prototype.shouldFallback=function(){return this._shouldFallback||!this.requires.areAllMet(this.hostConfig.hostCapabilities)},c.prototype.getRootObject=function(){for(var e=this;e.parent;)e=e.parent;return e},c.prototype.internalValidateProperties=function(e){this.id&&(e.allIds.hasOwnProperty(this.id)?(1===e.allIds[this.id]&&e.addFailure(this,n.ValidationEvent.DuplicateId,r.Strings.errors.duplicateId(this.id)),e.allIds[this.id]+=1):e.allIds[this.id]=1)},c.prototype.validateProperties=function(){var e=new s;return this.internalValidateProperties(e),e},c.prototype.findDOMNodeOwner=function(e){return this.contains(e)?this:void 0},c.prototype.releaseDOMResources=function(){},Object.defineProperty(c.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"renderedElement",{get:function(){return this._renderedElement},enumerable:!1,configurable:!0}),c.typeNameProperty=new a.StringProperty(a.Versions.v1_0,"type",void 0,void 0,void 0,function(e){return e.getJsonTypeName()}),c.idProperty=new a.StringProperty(a.Versions.v1_0,"id"),c.requiresProperty=new a.SerializableObjectProperty(a.Versions.v1_2,"requires",o.HostCapabilities,!1,new o.HostCapabilities),t([(0,a.property)(c.idProperty)],c.prototype,"id",void 0),t([(0,a.property)(c.requiresProperty)],c.prototype,"requires",null),c}(a.SerializableObject);return Uw.CardObject=l,Uw}var Qw,Zw={},Jw={};var Kw,Xw,$w={},eE={},tE={};function nE(){if(Kw)return tE;Kw=1,Object.defineProperty(tE,"__esModule",{value:!0}),tE.Constants=void 0;var e=function(){function e(){}return e.keys={tab:"Tab",enter:"Enter",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",delete:"Delete"},e}();return tE.Constants=e,tE}var rE,iE={},oE={};var aE,sE,lE,cE,uE={};function dE(){if(sE)return iE;sE=1;var e=iE&&iE.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(iE,"__esModule",{value:!0}),iE.PopupMenu=void 0;var t=nE(),n=function(){if(rE)return oE;rE=1,Object.defineProperty(oE,"__esModule",{value:!0}),oE.Collection=void 0;var e=function(){function e(){this._items=[]}return e.prototype.get=function(e){return this._items[e]},e.prototype.add=function(e){this._items.push(e),this.onItemAdded&&this.onItemAdded(e)},e.prototype.remove=function(e){var t=this._items.indexOf(e);t>=0&&(this._items=this._items.splice(t,1),this.onItemRemoved&&this.onItemRemoved(e))},e.prototype.indexOf=function(e){return this._items.indexOf(e)},Object.defineProperty(e.prototype,"length",{get:function(){return this._items.length},enumerable:!1,configurable:!0}),e}();return oE.Collection=e,oE}(),r=function(){if(aE)return uE;aE=1,Object.defineProperty(uE,"__esModule",{value:!0}),uE.PopupControl=void 0;var e=nE(),t=Lw(),n=jw(),r=function(){function r(){this._isOpen=!1}return r.prototype.keyDown=function(t){t.key===e.Constants.keys.escape&&this.closePopup(!0)},r.prototype.render=function(e){var t=this,n=document.createElement("div");return n.tabIndex=0,n.className=this.hostConfig.makeCssClassName("ac-ctrl","ac-ctrl-popup-container"),n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true"),n.onkeydown=function(e){return t.keyDown(e),!e.cancelBubble},n.appendChild(this.renderContent()),n},r.prototype.focus=function(){this._popupElement&&this._popupElement.firstElementChild.focus()},r.prototype.popup=function(e){var n,r,i,o,a,s=this;if(!this._isOpen){this._overlayElement=document.createElement("div"),this._overlayElement.className=this.hostConfig.makeCssClassName("ac-ctrl-overlay"),this._overlayElement.tabIndex=0,this._overlayElement.style.width=document.documentElement.scrollWidth+"px",this._overlayElement.style.height=document.documentElement.scrollHeight+"px",this._overlayElement.onfocus=function(e){s.closePopup(!0)},document.body.appendChild(this._overlayElement);var l=e.getBoundingClientRect();this._popupElement=this.render(l),(n=this._popupElement.classList).remove.apply(n,this.hostConfig.makeCssClassNames("ac-ctrl-slide","ac-ctrl-slideLeftToRight","ac-ctrl-slideRightToLeft","ac-ctrl-slideTopToBottom","ac-ctrl-slideRightToLeft")),window.addEventListener("resize",function(e){s.closePopup(!0)});var c=e.getAttribute("aria-label");c&&this._popupElement.setAttribute("aria-label",c),this._overlayElement.appendChild(this._popupElement);var u,d=this._popupElement.getBoundingClientRect(),p=window.innerHeight-l.bottom,h=l.top,f=window.innerWidth-l.right,m=l.left,g=l.left+t.getScrollX();if(h<d.height&&p<d.height){var y=Math.min(d.height,window.innerHeight);if(this._popupElement.style.maxHeight=y+"px",u=y<d.height?t.getScrollY():t.getScrollY()+l.top+(l.height-y)/2,m<d.width&&f<d.width){var A=Math.min(d.width,window.innerWidth);this._popupElement.style.maxWidth=A+"px",g=A<d.width?t.getScrollX():t.getScrollX()+l.left+(l.width-A)/2}else f>=d.width?(g=t.getScrollX()+l.right,(r=this._popupElement.classList).add.apply(r,this.hostConfig.makeCssClassNames("ac-ctrl-slide","ac-ctrl-slideLeftToRight"))):(g=t.getScrollX()+l.left-d.width,(i=this._popupElement.classList).add.apply(i,this.hostConfig.makeCssClassNames("ac-ctrl-slide","ac-ctrl-slideRightToLeft")))}else p>=d.height?(u=t.getScrollY()+l.bottom,(o=this._popupElement.classList).add.apply(o,this.hostConfig.makeCssClassNames("ac-ctrl-slide","ac-ctrl-slideTopToBottom"))):(u=t.getScrollY()+l.top-d.height,(a=this._popupElement.classList).add.apply(a,this.hostConfig.makeCssClassNames("ac-ctrl-slide","ac-ctrl-slideBottomToTop"))),f<d.width&&(g=t.getScrollX()+l.right-d.width);this._popupElement.style.left=g+"px",this._popupElement.style.top=u+"px",this._popupElement.focus(),this._isOpen=!0}},r.prototype.closePopup=function(e){this._isOpen&&(document.body.removeChild(this._overlayElement),this._isOpen=!1,this.onClose&&this.onClose(this,e))},Object.defineProperty(r.prototype,"hostConfig",{get:function(){return this._hostConfig?this._hostConfig:n.defaultHostConfig},set:function(e){this._hostConfig=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),r}();return uE.PopupControl=r,uE}(),i=function(r){function i(){var e=null!==r&&r.apply(this,arguments)||this;return e._items=new n.Collection,e._renderedItems=[],e._selectedIndex=-1,e}return e(i,r),i.prototype.renderContent=function(){var e=document.createElement("div");e.className=this.hostConfig.makeCssClassName("ac-ctrl ac-popup"),e.setAttribute("role","listbox");for(var t=0;t<this._items.length;t++){var n=this._items.get(t).render(this.hostConfig);n.tabIndex=0,e.appendChild(n),t===this.selectedIndex&&n.focus(),this._renderedItems.push(n)}return e},i.prototype.keyDown=function(e){r.prototype.keyDown.call(this,e);var n=this._selectedIndex;switch(e.key){case t.Constants.keys.tab:this.closePopup(!0);break;case t.Constants.keys.up:(n<=0||--n<0)&&(n=this._renderedItems.length-1),this.selectedIndex=n,e.cancelBubble=!0;break;case t.Constants.keys.down:(n<0||++n>=this._renderedItems.length)&&(n=0),this.selectedIndex=n,e.cancelBubble=!0}},Object.defineProperty(i.prototype,"items",{get:function(){return this._items},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(e){e>=0&&e<this._renderedItems.length&&(this._renderedItems[e].focus(),this._selectedIndex=e)},enumerable:!1,configurable:!0}),i}(r.PopupControl);return iE.PopupMenu=i,iE}function pE(){return lE||(lE=1,function(e){var t=$w&&$w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=$w&&$w.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(function(){if(Xw)return eE;Xw=1,Object.defineProperty(eE,"__esModule",{value:!0}),eE.MenuItem=void 0;var e=jw(),t=nE(),n=function(){function n(e,t){this._isEnabled=!0,this.key=e,this._value=t}return n.prototype.click=function(){this.isEnabled&&this.onClick&&this.onClick(this)},n.prototype.updateCssClasses=function(){if(this._element){var t=this._hostConfig?this._hostConfig:e.defaultHostConfig;this._element.className=t.makeCssClassName("ac-ctrl"),this._element.classList.add(t.makeCssClassName(this.isEnabled?"ac-ctrl-dropdown-item":"ac-ctrl-dropdown-item-disabled")),this.isEnabled||this._element.classList.add(t.makeCssClassName("ac-disabled"))}},n.prototype.toString=function(){return this.value},n.prototype.render=function(e){var n=this;return this._hostConfig=e,this._element||(this._element=document.createElement("span"),this._element.innerText=this.value,this._element.setAttribute("role","menuitem"),this.isEnabled||this._element.setAttribute("aria-disabled","true"),this._element.setAttribute("aria-current","false"),this._element.onmouseup=function(e){n.click()},this._element.onkeydown=function(e){e.key===t.Constants.keys.enter&&(e.cancelBubble=!0,n.click())},this.updateCssClasses()),this._element},Object.defineProperty(n.prototype,"value",{get:function(){return this._value},set:function(e){this._value=e,this._element&&(this._element.innerText=e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this._isEnabled!==e&&(this._isEnabled=e,this.updateCssClasses())},enumerable:!1,configurable:!0}),n}();return eE.MenuItem=n,eE}(),e),n(dE(),e)}($w)),$w}function hE(){if(cE)return Zw;cE=1;var e=Zw&&Zw.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),t=Zw&&Zw.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},n=Zw&&Zw.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})},r=Zw&&Zw.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(Zw,"__esModule",{value:!0}),Zw.ContainerWithActions=Zw.ColumnSet=Zw.Column=Zw.Container=Zw.BackgroundImage=Zw.ContainerBase=Zw.StylableCardElementContainer=Zw.ContainerStyleProperty=Zw.ActionSet=Zw.ShowCardAction=Zw.HttpAction=Zw.HttpHeader=Zw.ToggleVisibilityAction=Zw.OpenUrlAction=Zw.ExecuteAction=Zw.SubmitAction=Zw.SubmitActionBase=Zw.Action=Zw.TimeInput=Zw.TimeProperty=Zw.DateInput=Zw.NumberInput=Zw.ChoiceSetInput=Zw.Choice=Zw.ToggleInput=Zw.TextInput=Zw.Input=Zw.Media=Zw.YouTubePlayer=Zw.DailymotionPlayer=Zw.VimeoPlayer=Zw.IFrameMediaMediaPlayer=Zw.CustomMediaPlayer=Zw.HTML5MediaPlayer=Zw.MediaPlayer=Zw.MediaSource=Zw.CaptionSource=Zw.ContentSource=Zw.ImageSet=Zw.CardElementContainer=Zw.Image=Zw.FactSet=Zw.Fact=Zw.RichTextBlock=Zw.TextRun=Zw.TextBlock=Zw.BaseTextBlock=Zw.ActionProperty=Zw.CardElement=Zw.renderSeparation=void 0,Zw.SerializationContext=Zw.AdaptiveCard=Zw.Authentication=Zw.TokenExchangeResource=Zw.AuthCardButton=Zw.RefreshDefinition=Zw.RefreshActionProperty=void 0;var i=Mw(),o=Dw(),a=Lw(),s=jw(),l=function(){if(Qw)return Jw;Qw=1;var e=Jw&&Jw.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Jw,"__esModule",{value:!0}),Jw.formatText=void 0;var t=function(){function e(e){this._regularExpression=e}return e.prototype.format=function(e,t){var n;if(t){for(var r=t;null!=(n=this._regularExpression.exec(t));)r=r.replace(n[0],this.internalFormat(e,n));return r}return t},e}(),n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.internalFormat=function(e,t){var n=new Date(Date.parse(t[1])),r=void 0!==t[2]?t[2].toLowerCase():"compact";return"compact"!==r?n.toLocaleDateString(e,{day:"numeric",weekday:r,month:r,year:"numeric"}):n.toLocaleDateString()},n}(t),r=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.internalFormat=function(e,t){return new Date(Date.parse(t[1])).toLocaleTimeString(e,{hour:"numeric",minute:"2-digit"})},n}(t);return Jw.formatText=function(e,t){for(var i=t,o=0,a=[new n(/\{{2}DATE\((\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:Z|(?:(?:-|\+)\d{2}:\d{2})))(?:, ?(COMPACT|LONG|SHORT))?\)\}{2}/g),new r(/\{{2}TIME\((\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:Z|(?:(?:-|\+)\d{2}:\d{2})))\)\}{2}/g)];o<a.length;o++)i=a[o].format(e,i);return i},Jw}(),c=Ww(),u=Rw(),d=Gw(),p=kw(),h=pE();function f(e){var t,n,r="undefined"==typeof window?"":null!==(n=null===(t=window.trustedTypes)||void 0===t?void 0:t.emptyHTML)&&void 0!==n?n:"";e.innerHTML=r}function m(e,t,n){if(t.spacing>0||t.lineThickness&&t.lineThickness>0){var r=document.createElement("div");r.className=e.makeCssClassName("ac-"+(n===i.Orientation.Horizontal?"horizontal":"vertical")+"-separator"),r.setAttribute("aria-hidden","true");var o=t.lineColor?a.stringToCssColor(t.lineColor):"";return n===i.Orientation.Horizontal?t.lineThickness?(r.style.paddingTop=t.spacing/2+"px",r.style.marginBottom=t.spacing/2+"px",r.style.borderBottom=t.lineThickness+"px solid "+o):r.style.height=t.spacing+"px":t.lineThickness?(r.style.paddingLeft=t.spacing/2+"px",r.style.marginRight=t.spacing/2+"px",r.style.borderRight=t.lineThickness+"px solid "+o):r.style.width=t.spacing+"px",r.style.overflow="hidden",r.style.flex="0 0 auto",r}}Zw.renderSeparation=m;var g=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e._truncatedDueToOverflow=!1,e}return e(r,n),Object.defineProperty(r.prototype,"lang",{get:function(){var e=this.getValue(r.langProperty);return e||(this.parent?this.parent.lang:void 0)},set:function(e){this.setValue(r.langProperty,e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isVisible",{get:function(){return this.getValue(r.isVisibleProperty)},set:function(e){o.GlobalSettings.useAdvancedCardBottomTruncation&&!e&&this.undoOverflowTruncation(),this.isVisible!==e&&(this.setValue(r.isVisibleProperty,e),this.updateRenderedElementVisibility(),this._renderedElement&&ye(this)),this._renderedElement&&this._renderedElement.setAttribute("aria-expanded",e.toString())},enumerable:!1,configurable:!0}),r.prototype.internalRenderSeparator=function(){var e=m(this.hostConfig,{spacing:this.hostConfig.getEffectiveSpacing(this.spacing),lineThickness:this.separator?this.hostConfig.separator.lineThickness:void 0,lineColor:this.separator?this.hostConfig.separator.lineColor:void 0},this.separatorOrientation);if(o.GlobalSettings.alwaysBleedSeparators&&e&&this.separatorOrientation===i.Orientation.Horizontal){var t=this.getParentContainer();if(t&&t.getEffectivePadding()){var n=this.hostConfig.paddingDefinitionToSpacingDefinition(t.getEffectivePadding());e.style.marginLeft="-"+n.left+"px",e.style.marginRight="-"+n.right+"px"}}return e},r.prototype.updateRenderedElementVisibility=function(){var e=this.isDesignMode()||this.isVisible?this._defaultRenderedElementDisplayMode:"none";this._renderedElement&&(e?this._renderedElement.style.display=e:this._renderedElement.style.removeProperty("display")),this._separatorElement&&(this.parent&&this.parent.isFirstElement(this)?this._separatorElement.style.display="none":e?this._separatorElement.style.display=e:this._separatorElement.style.removeProperty("display"))},r.prototype.hideElementDueToOverflow=function(){this._renderedElement&&this.isVisible&&(this._renderedElement.style.visibility="hidden",this.isVisible=!1,ye(this,!1))},r.prototype.showElementHiddenDueToOverflow=function(){this._renderedElement&&!this.isVisible&&(this._renderedElement.style.removeProperty("visibility"),this.isVisible=!0,ye(this,!1))},r.prototype.handleOverflow=function(e){if(this.isVisible||this.isHiddenDueToOverflow()){var t=this.truncateOverflow(e);this._truncatedDueToOverflow=t||this._truncatedDueToOverflow,t?t&&!this.isVisible&&this.showElementHiddenDueToOverflow():this.hideElementDueToOverflow()}},r.prototype.resetOverflow=function(){var e=!1;return this._truncatedDueToOverflow&&(this.undoOverflowTruncation(),this._truncatedDueToOverflow=!1,e=!0),this.isHiddenDueToOverflow()&&this.showElementHiddenDueToOverflow(),e},r.prototype.getDefaultSerializationContext=function(){return new Me},r.prototype.createPlaceholderElement=function(){var e=this.getEffectiveStyleDefinition(),t=a.stringToCssColor(e.foregroundColors.default.subtle),n=document.createElement("div");return n.style.border="1px dashed "+t,n.style.padding="4px",n.style.minHeight="32px",n.style.fontSize="10px",t&&(n.style.color=t),n.innerText="Empty "+this.getJsonTypeName(),n},r.prototype.adjustRenderedElementSize=function(e){"auto"===this.height?e.style.flex="0 0 auto":e.style.flex="1 1 auto"},r.prototype.isDisplayed=function(){return void 0!==this._renderedElement&&this.isVisible&&this._renderedElement.offsetHeight>0},r.prototype.overrideInternalRender=function(){return this.internalRender()},r.prototype.applyPadding=function(){if(this.separatorElement&&this.separatorOrientation===i.Orientation.Horizontal)if(o.GlobalSettings.alwaysBleedSeparators&&!this.isBleeding()){var e=new o.PaddingDefinition;this.getImmediateSurroundingPadding(e);var t=this.hostConfig.paddingDefinitionToSpacingDefinition(e);this.separatorElement.style.marginLeft="-"+t.left+"px",this.separatorElement.style.marginRight="-"+t.right+"px"}else this.separatorElement.style.marginRight="0",this.separatorElement.style.marginLeft="0"},r.prototype.truncateOverflow=function(e){return!1},r.prototype.undoOverflowTruncation=function(){},r.prototype.getDefaultPadding=function(){return new o.PaddingDefinition},r.prototype.getHasBackground=function(e){return!1},r.prototype.getHasBorder=function(){return!1},r.prototype.getPadding=function(){return this._padding},r.prototype.setPadding=function(e){this._padding=e},r.prototype.shouldSerialize=function(e){return void 0!==e.elementRegistry.findByName(this.getJsonTypeName())},Object.defineProperty(r.prototype,"useDefaultSizing",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"separatorOrientation",{get:function(){return i.Orientation.Horizontal},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"defaultStyle",{get:function(){return i.ContainerStyle.Default},enumerable:!1,configurable:!0}),r.prototype.parse=function(e,t){n.prototype.parse.call(this,e,t||new Me)},r.prototype.asString=function(){return""},r.prototype.isBleeding=function(){return!1},r.prototype.getEffectiveStyle=function(){return this.parent?this.parent.getEffectiveStyle():this.defaultStyle},r.prototype.getEffectiveStyleDefinition=function(){return this.hostConfig.containerStyles.getStyleByName(this.getEffectiveStyle())},r.prototype.getEffectiveTextStyleDefinition=function(){return this.parent?this.parent.getEffectiveTextStyleDefinition():this.hostConfig.textStyles.default},r.prototype.getForbiddenActionTypes=function(){return[]},r.prototype.getImmediateSurroundingPadding=function(e,t,n,r,o){if(void 0===t&&(t=!0),void 0===n&&(n=!0),void 0===r&&(r=!0),void 0===o&&(o=!0),this.parent){var a=t&&this.parent.isTopElement(this),s=n&&this.parent.isRightMostElement(this),l=r&&this.parent.isBottomElement(this),c=o&&this.parent.isLeftMostElement(this),u=this.parent.getEffectivePadding();u&&(a&&u.top!==i.Spacing.None&&(e.top=u.top,a=!1),s&&u.right!==i.Spacing.None&&(e.right=u.right,s=!1),l&&u.bottom!==i.Spacing.None&&(e.bottom=u.bottom,l=!1),c&&u.left!==i.Spacing.None&&(e.left=u.left,c=!1)),(a||s||l||c)&&this.parent.getImmediateSurroundingPadding(e,a,s,l,c)}},r.prototype.getActionCount=function(){return 0},r.prototype.getActionAt=function(e){throw new Error(p.Strings.errors.indexOutOfRange(e))},r.prototype.indexOfAction=function(e){for(var t=0;t<this.getActionCount();t++)if(this.getActionAt(t)===e)return t;return-1},r.prototype.remove=function(){return!!(this.parent&&this.parent instanceof M)&&this.parent.removeItem(this)},r.prototype.render=function(){return this._renderedElement=this.overrideInternalRender(),this._separatorElement=this.internalRenderSeparator(),this._renderedElement?(this.id&&(this._renderedElement.id=this.id),this.customCssSelector&&this._renderedElement.classList.add(this.customCssSelector),this._renderedElement.style.boxSizing="border-box",this._defaultRenderedElementDisplayMode=this._renderedElement.style.display?this._renderedElement.style.display:void 0,this.adjustRenderedElementSize(this._renderedElement),this.updateLayout(!1)):this.isDesignMode()&&(this._renderedElement=this.createPlaceholderElement()),this.getRootElement().updateActionsEnabledState(),this._renderedElement},r.prototype.updateLayout=function(e){this.updateRenderedElementVisibility(),this.applyPadding()},r.prototype.updateActionsEnabledState=function(){for(var e=0,t=this.getRootElement().getAllActions();e<t.length;e++){t[e].updateEnabledState()}},r.prototype.indexOf=function(e){return-1},r.prototype.isDesignMode=function(){var e=this.getRootElement();return e instanceof Ce&&e.designMode},r.prototype.isFirstElement=function(e){return!0},r.prototype.isLastElement=function(e){return!0},r.prototype.isAtTheVeryLeft=function(){return!this.parent||this.parent.isLeftMostElement(this)&&this.parent.isAtTheVeryLeft()},r.prototype.isAtTheVeryRight=function(){return!this.parent||this.parent.isRightMostElement(this)&&this.parent.isAtTheVeryRight()},r.prototype.isAtTheVeryTop=function(){return!this.parent||this.parent.isFirstElement(this)&&this.parent.isAtTheVeryTop()},r.prototype.isAtTheVeryBottom=function(){return!this.parent||this.parent.isLastElement(this)&&this.parent.isAtTheVeryBottom()},r.prototype.isBleedingAtTop=function(){return!1},r.prototype.isBleedingAtBottom=function(){return!1},r.prototype.isLeftMostElement=function(e){return!0},r.prototype.isRightMostElement=function(e){return!0},r.prototype.isTopElement=function(e){return this.isFirstElement(e)},r.prototype.isBottomElement=function(e){return this.isLastElement(e)},r.prototype.isHiddenDueToOverflow=function(){return void 0!==this._renderedElement&&"hidden"===this._renderedElement.style.visibility},r.prototype.getRootElement=function(){return this.getRootObject()},r.prototype.getParentContainer=function(){for(var e=this.parent;e;){if(e instanceof de)return e;e=e.parent}},r.prototype.getAllInputs=function(e){return[]},r.prototype.getAllActions=function(){for(var e=[],t=0;t<this.getActionCount();t++){var n=this.getActionAt(t);n&&e.push(n)}return e},r.prototype.getResourceInformation=function(){return[]},r.prototype.getElementById=function(e){return this.id===e?this:void 0},r.prototype.getActionById=function(e){},r.prototype.getEffectivePadding=function(){var e=this.getPadding();return e||this.getDefaultPadding()},r.prototype.getEffectiveHorizontalAlignment=function(){return void 0!==this.horizontalAlignment?this.horizontalAlignment:this.parent?this.parent.getEffectiveHorizontalAlignment():i.HorizontalAlignment.Left},Object.defineProperty(r.prototype,"hostConfig",{get:function(){return this._hostConfig?this._hostConfig:this.parent?this.parent.hostConfig:s.defaultHostConfig},set:function(e){this._hostConfig=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"index",{get:function(){return this.parent?this.parent.indexOf(this):0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isInteractive",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isStandalone",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isInline",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hasVisibleSeparator",{get:function(){return!(!this.parent||!this.separatorElement)&&(!this.parent.isFirstElement(this)&&(this.isVisible||this.isDesignMode()))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"separatorElement",{get:function(){return this._separatorElement},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),r.prototype.getElementSingletonBehavior=function(){return d.ElementSingletonBehavior.NotAllowed},r.langProperty=new u.StringProperty(u.Versions.v1_1,"lang",!0,/^[a-z]{2,3}$/gi),r.isVisibleProperty=new u.BoolProperty(u.Versions.v1_2,"isVisible",!0),r.separatorProperty=new u.BoolProperty(u.Versions.v1_0,"separator",!1),r.heightProperty=new u.ValueSetProperty(u.Versions.v1_1,"height",[{value:"auto"},{value:"stretch"}],"auto"),r.horizontalAlignmentProperty=new u.EnumProperty(u.Versions.v1_0,"horizontalAlignment",i.HorizontalAlignment),r.spacingProperty=new u.EnumProperty(u.Versions.v1_0,"spacing",i.Spacing,i.Spacing.Default),t([(0,u.property)(r.horizontalAlignmentProperty)],r.prototype,"horizontalAlignment",void 0),t([(0,u.property)(r.spacingProperty)],r.prototype,"spacing",void 0),t([(0,u.property)(r.separatorProperty)],r.prototype,"separator",void 0),t([(0,u.property)(r.heightProperty)],r.prototype,"height",void 0),t([(0,u.property)(r.langProperty)],r.prototype,"lang",null),t([(0,u.property)(r.isVisibleProperty)],r.prototype,"isVisible",null),r}(c.CardObject);Zw.CardElement=g;var y=function(t){function n(e,n,r){void 0===r&&(r=[]);var i=t.call(this,e,n,void 0)||this;return i.targetVersion=e,i.name=n,i.forbiddenActionTypes=r,i}return e(n,t),n.prototype.parse=function(e,t,n){var r=e;return n.parseAction(r,t[this.name],this.forbiddenActionTypes,r.isDesignMode())},n.prototype.toJSON=function(e,t,n,r){r.serializeValue(t,this.name,n?n.toJSON(r):void 0,void 0,!0)},n}(u.PropertyDefinition);Zw.ActionProperty=y;var A=function(n){function r(e){var t=n.call(this)||this;return t.ariaHidden=!1,e&&(t.text=e),t}return e(r,n),r.prototype.populateSchema=function(e){n.prototype.populateSchema.call(this,e),e.remove(r.selectActionProperty)},Object.defineProperty(r.prototype,"text",{get:function(){return this.getValue(r.textProperty)},set:function(e){this.setText(e)},enumerable:!1,configurable:!0}),r.prototype.getFontSize=function(e){switch(this.effectiveSize){case i.TextSize.Small:return e.fontSizes.small;case i.TextSize.Medium:return e.fontSizes.medium;case i.TextSize.Large:return e.fontSizes.large;case i.TextSize.ExtraLarge:return e.fontSizes.extraLarge;default:return e.fontSizes.default}},r.prototype.getColorDefinition=function(e,t){switch(t){case i.TextColor.Accent:return e.accent;case i.TextColor.Dark:return e.dark;case i.TextColor.Light:return e.light;case i.TextColor.Good:return e.good;case i.TextColor.Warning:return e.warning;case i.TextColor.Attention:return e.attention;default:return e.default}},r.prototype.setText=function(e){this.setValue(r.textProperty,e)},r.prototype.init=function(e){this.size=e.size,this.weight=e.weight,this.color=e.color,this.isSubtle=e.isSubtle},r.prototype.asString=function(){return this.text},r.prototype.applyStylesTo=function(e){var t,n=this.hostConfig.getFontTypeDefinition(this.effectiveFontType);switch(n.fontFamily&&(e.style.fontFamily=n.fontFamily),this.effectiveSize){case i.TextSize.Small:t=n.fontSizes.small;break;case i.TextSize.Medium:t=n.fontSizes.medium;break;case i.TextSize.Large:t=n.fontSizes.large;break;case i.TextSize.ExtraLarge:t=n.fontSizes.extraLarge;break;default:t=n.fontSizes.default}e.style.fontSize=t+"px";var r,o=this.getColorDefinition(this.getEffectiveStyleDefinition().foregroundColors,this.effectiveColor),s=a.stringToCssColor(this.effectiveIsSubtle?o.subtle:o.default);switch(s&&(e.style.color=s),this.effectiveWeight){case i.TextWeight.Lighter:r=n.fontWeights.lighter;break;case i.TextWeight.Bolder:r=n.fontWeights.bolder;break;default:r=n.fontWeights.default}e.style.fontWeight=r.toString(),this.ariaHidden&&e.setAttribute("aria-hidden","true")},r.prototype.getAllActions=function(){var e=n.prototype.getAllActions.call(this);return this.selectAction&&e.push(this.selectAction),e},Object.defineProperty(r.prototype,"effectiveColor",{get:function(){return void 0!==this.color?this.color:this.getEffectiveTextStyleDefinition().color},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"effectiveFontType",{get:function(){return void 0!==this.fontType?this.fontType:this.getEffectiveTextStyleDefinition().fontType},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"effectiveIsSubtle",{get:function(){return void 0!==this.isSubtle?this.isSubtle:this.getEffectiveTextStyleDefinition().isSubtle},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"effectiveSize",{get:function(){return void 0!==this.size?this.size:this.getEffectiveTextStyleDefinition().size},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"effectiveWeight",{get:function(){return void 0!==this.weight?this.weight:this.getEffectiveTextStyleDefinition().weight},enumerable:!1,configurable:!0}),r.textProperty=new u.StringProperty(u.Versions.v1_0,"text",!0),r.sizeProperty=new u.EnumProperty(u.Versions.v1_0,"size",i.TextSize),r.weightProperty=new u.EnumProperty(u.Versions.v1_0,"weight",i.TextWeight),r.colorProperty=new u.EnumProperty(u.Versions.v1_0,"color",i.TextColor),r.isSubtleProperty=new u.BoolProperty(u.Versions.v1_0,"isSubtle"),r.fontTypeProperty=new u.EnumProperty(u.Versions.v1_2,"fontType",i.FontType),r.selectActionProperty=new y(u.Versions.v1_1,"selectAction",["Action.ShowCard"]),t([(0,u.property)(r.sizeProperty)],r.prototype,"size",void 0),t([(0,u.property)(r.weightProperty)],r.prototype,"weight",void 0),t([(0,u.property)(r.colorProperty)],r.prototype,"color",void 0),t([(0,u.property)(r.fontTypeProperty)],r.prototype,"fontType",void 0),t([(0,u.property)(r.isSubtleProperty)],r.prototype,"isSubtle",void 0),t([(0,u.property)(r.textProperty)],r.prototype,"text",null),t([(0,u.property)(r.selectActionProperty)],r.prototype,"selectAction",void 0),r}(g);Zw.BaseTextBlock=A;var v=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.wrap=!1,e._treatAsPlainText=!0,e.useMarkdown=!0,e}var s,c;return e(r,n),r.prototype.restoreOriginalContent=function(){var e,t;if(void 0!==this.renderedElement){this.maxLines&&this.maxLines>0&&(this.renderedElement.style.maxHeight=this._computedLineHeight*this.maxLines+"px");var n=null!==(t=null===(e=r._ttRoundtripPolicy)||void 0===e?void 0:e.createHTML(this._originalInnerHtml))&&void 0!==t?t:this._originalInnerHtml;this.renderedElement.innerHTML=n}},r.prototype.truncateIfSupported=function(e){if(void 0!==this.renderedElement){var t=this.renderedElement.children,n=!t.length;if(n||1===t.length&&"p"===t[0].tagName.toLowerCase()&&!t[0].children.length){var r=n?this.renderedElement:t[0];return a.truncateText(r,e,this._computedLineHeight),!0}}return!1},r.prototype.setText=function(e){n.prototype.setText.call(this,e),this._processedText=void 0},r.prototype.internalRender=function(){var e,t,n=this;if(this._processedText=void 0,this.text){var i=this.preProcessPropertyValue(A.textProperty),s=this.hostConfig,c=void 0;if(this.forElementId){var u=document.createElement("label");u.htmlFor=this.forElementId,c=u}else c=document.createElement("div");if(c.classList.add(s.makeCssClassName("ac-textBlock")),c.style.overflow="hidden",this.applyStylesTo(c),"heading"===this.style){c.setAttribute("role","heading");var d=this.hostConfig.textBlock.headingLevel;void 0!==d&&d>0&&c.setAttribute("aria-level",d.toString())}if(this.selectAction&&s.supportsInteractivity&&(c.onclick=function(e){n.selectAction&&n.selectAction.isEffectivelyEnabled()&&(e.preventDefault(),e.cancelBubble=!0,n.selectAction.execute())},this.selectAction.setupElementForAccessibility(c),this.selectAction.isEffectivelyEnabled()&&c.classList.add(s.makeCssClassName("ac-selectable"))),!this._processedText){this._treatAsPlainText=!0;var p=l.formatText(this.lang,i);if(this.useMarkdown&&p){o.GlobalSettings.allowMarkForTextHighlighting&&(p=p.replace(/<mark>/g,"===").replace(/<\/mark>/g,"/==/"));var h=Ce.applyMarkdown(p);if(h.didProcess&&h.outputHtml){if(this._processedText=h.outputHtml,this._treatAsPlainText=!1,o.GlobalSettings.allowMarkForTextHighlighting&&this._processedText){var f="",m=this.getEffectiveStyleDefinition();m.highlightBackgroundColor&&(f+="background-color: "+m.highlightBackgroundColor+";"),m.highlightForegroundColor&&(f+="color: "+m.highlightForegroundColor+";"),f&&(f='style="'+f+'"'),this._processedText=this._processedText.replace(/===/g,"<mark "+f+">").replace(/\/==\//g,"</mark>")}}else this._processedText=p,this._treatAsPlainText=!0}else this._processedText=p,this._treatAsPlainText=!0}if(this._processedText||(this._processedText=""),this._treatAsPlainText)c.innerText=this._processedText;else{var g=null!==(t=null===(e=r._ttMarkdownPolicy)||void 0===e?void 0:e.createHTML(this._processedText))&&void 0!==t?t:this._processedText;c.innerHTML=g}if(c.firstElementChild instanceof HTMLElement){var y=c.firstElementChild;y.style.marginTop="0px",y.style.width="100%",this.wrap||(y.style.overflow="hidden",y.style.textOverflow="ellipsis")}c.lastElementChild instanceof HTMLElement&&(c.lastElementChild.style.marginBottom="0px");for(var v=c.getElementsByTagName("a"),b=function(e){e.classList.add(s.makeCssClassName("ac-anchor")),e.target="_blank",e.onclick=function(t){me(n,e,t)&&(t.preventDefault(),t.cancelBubble=!0)},e.oncontextmenu=function(t){return!me(n,e,t)||(t.preventDefault(),t.cancelBubble=!0,!1)}},w=0,E=Array.from(v);w<E.length;w++){b(E[w])}return this.wrap?(c.style.wordWrap="break-word",this.maxLines&&this.maxLines>0&&(c.style.overflow="hidden",a.isInternetExplorer()||!o.GlobalSettings.useWebkitLineClamp?c.style.maxHeight=this._computedLineHeight*this.maxLines+"px":(c.style.removeProperty("line-height"),c.style.display="-webkit-box",c.style.webkitBoxOrient="vertical",c.style.webkitLineClamp=this.maxLines.toString()))):(c.style.whiteSpace="nowrap",c.style.textOverflow="ellipsis"),(o.GlobalSettings.useAdvancedTextBlockTruncation||o.GlobalSettings.useAdvancedCardBottomTruncation)&&(this._originalInnerHtml=c.innerHTML),c}},r.prototype.truncateOverflow=function(e){return e>=this._computedLineHeight&&this.truncateIfSupported(e)},r.prototype.undoOverflowTruncation=function(){if(this.restoreOriginalContent(),o.GlobalSettings.useAdvancedTextBlockTruncation&&this.maxLines){var e=this._computedLineHeight*this.maxLines;this.truncateIfSupported(e)}},r.prototype.applyStylesTo=function(e){switch(n.prototype.applyStylesTo.call(this,e),this.getEffectiveHorizontalAlignment()){case i.HorizontalAlignment.Center:e.style.textAlign="center";break;case i.HorizontalAlignment.Right:e.style.textAlign="end";break;default:e.style.textAlign="start"}var t=this.hostConfig.lineHeights;if(t)switch(this.effectiveSize){case i.TextSize.Small:this._computedLineHeight=t.small;break;case i.TextSize.Medium:this._computedLineHeight=t.medium;break;case i.TextSize.Large:this._computedLineHeight=t.large;break;case i.TextSize.ExtraLarge:this._computedLineHeight=t.extraLarge;break;default:this._computedLineHeight=t.default}else this._computedLineHeight=1.33*this.getFontSize(this.hostConfig.getFontTypeDefinition(this.effectiveFontType));e.style.lineHeight=this._computedLineHeight+"px"},r.prototype.getJsonTypeName=function(){return"TextBlock"},r.prototype.getEffectiveTextStyleDefinition=function(){return this.style?this.hostConfig.textStyles.getStyleByName(this.style):n.prototype.getEffectiveTextStyleDefinition.call(this)},r.prototype.updateLayout=function(e){void 0===e&&(e=!1),n.prototype.updateLayout.call(this,e),o.GlobalSettings.useAdvancedTextBlockTruncation&&this.maxLines&&this.isDisplayed()&&(this.restoreOriginalContent(),this.truncateIfSupported(this._computedLineHeight*this.maxLines))},r.wrapProperty=new u.BoolProperty(u.Versions.v1_0,"wrap",!1),r.maxLinesProperty=new u.NumProperty(u.Versions.v1_0,"maxLines"),r.styleProperty=new u.ValueSetProperty(u.Versions.v1_5,"style",[{value:"default"},{value:"columnHeader"},{value:"heading"}]),r._ttMarkdownPolicy="undefined"==typeof window||null===(s=window.trustedTypes)||void 0===s?void 0:s.createPolicy("adaptivecards#markdownPassthroughPolicy",{createHTML:function(e){return e}}),r._ttRoundtripPolicy="undefined"==typeof window||null===(c=window.trustedTypes)||void 0===c?void 0:c.createPolicy("adaptivecards#restoreContentsPolicy",{createHTML:function(e){return e}}),t([(0,u.property)(r.wrapProperty)],r.prototype,"wrap",void 0),t([(0,u.property)(r.maxLinesProperty)],r.prototype,"maxLines",void 0),t([(0,u.property)(r.styleProperty)],r.prototype,"style",void 0),r}(A);Zw.TextBlock=v;var b=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.italic=!1,e.strikethrough=!1,e.highlight=!1,e.underline=!1,e}return e(r,n),r.prototype.populateSchema=function(e){n.prototype.populateSchema.call(this,e),e.add(A.selectActionProperty)},r.prototype.internalRender=function(){var e=this;if(this.text){var t=this.preProcessPropertyValue(A.textProperty),n=this.hostConfig,r=l.formatText(this.lang,t);r||(r="");var i=document.createElement("span");if(i.classList.add(n.makeCssClassName("ac-textRun")),this.applyStylesTo(i),this.selectAction&&n.supportsInteractivity){var o=document.createElement("a");o.classList.add(n.makeCssClassName("ac-anchor"));var a=this.selectAction.getHref();o.href=a||"",o.target="_blank",o.onclick=function(t){e.selectAction&&e.selectAction.isEffectivelyEnabled()&&(t.preventDefault(),t.cancelBubble=!0,e.selectAction.execute())},this.selectAction.setupElementForAccessibility(o),o.innerText=r,i.appendChild(o)}else i.innerText=r;return i}},r.prototype.applyStylesTo=function(e){if(n.prototype.applyStylesTo.call(this,e),this.italic&&(e.style.fontStyle="italic"),this.strikethrough&&(e.style.textDecoration="line-through"),this.highlight){var t=this.getColorDefinition(this.getEffectiveStyleDefinition().foregroundColors,this.effectiveColor),r=a.stringToCssColor(this.effectiveIsSubtle?t.highlightColors.subtle:t.highlightColors.default);r&&(e.style.backgroundColor=r)}this.underline&&(e.style.textDecoration="underline")},r.prototype.getJsonTypeName=function(){return"TextRun"},Object.defineProperty(r.prototype,"isStandalone",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isInline",{get:function(){return!0},enumerable:!1,configurable:!0}),r.italicProperty=new u.BoolProperty(u.Versions.v1_2,"italic",!1),r.strikethroughProperty=new u.BoolProperty(u.Versions.v1_2,"strikethrough",!1),r.highlightProperty=new u.BoolProperty(u.Versions.v1_2,"highlight",!1),r.underlineProperty=new u.BoolProperty(u.Versions.v1_3,"underline",!1),t([(0,u.property)(r.italicProperty)],r.prototype,"italic",void 0),t([(0,u.property)(r.strikethroughProperty)],r.prototype,"strikethrough",void 0),t([(0,u.property)(r.highlightProperty)],r.prototype,"highlight",void 0),t([(0,u.property)(r.underlineProperty)],r.prototype,"underline",void 0),r}(A);Zw.TextRun=b;var w=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._inlines=[],e}return e(n,t),n.prototype.internalAddInline=function(e,t){if(void 0===t&&(t=!1),!e.isInline)throw new Error(p.Strings.errors.elementCannotBeUsedAsInline());if(!(void 0===e.parent||t)&&e.parent!==this)throw new Error(p.Strings.errors.inlineAlreadyParented());e.setParent(this),this._inlines.push(e)},n.prototype.internalParse=function(e,n){if(t.prototype.internalParse.call(this,e,n),this._inlines=[],Array.isArray(e.inlines))for(var r=0,i=e.inlines;r<i.length;r++){var o=i[r],a=void 0;if("string"==typeof o){var s=new b;s.text=o,a=s}else a=n.parseElement(this,o,[],!1);a&&this.internalAddInline(a,!0)}},n.prototype.internalToJSON=function(e,n){if(t.prototype.internalToJSON.call(this,e,n),this._inlines.length>0){for(var r=[],i=0,o=this._inlines;i<o.length;i++){var a=o[i];r.push(a.toJSON(n))}n.serializeValue(e,"inlines",r)}},n.prototype.internalRender=function(){if(this._inlines.length>0){var e=void 0;if(this.forElementId){var t=document.createElement("label");t.htmlFor=this.forElementId,e=t}else e=document.createElement("div");switch(e.className=this.hostConfig.makeCssClassName("ac-richTextBlock"),this.getEffectiveHorizontalAlignment()){case i.HorizontalAlignment.Center:e.style.textAlign="center";break;case i.HorizontalAlignment.Right:e.style.textAlign="end";break;default:e.style.textAlign="start"}for(var n=0,r=0,o=this._inlines;r<o.length;r++){var a=o[r].render();a&&(e.appendChild(a),n++)}if(n>0)return e}},n.prototype.asString=function(){for(var e="",t=0,n=this._inlines;t<n.length;t++){e+=n[t].asString()}return e},n.prototype.getJsonTypeName=function(){return"RichTextBlock"},n.prototype.getInlineCount=function(){return this._inlines.length},n.prototype.getInlineAt=function(e){if(e>=0&&e<this._inlines.length)return this._inlines[e];throw new Error(p.Strings.errors.indexOutOfRange(e))},n.prototype.addInline=function(e){"string"==typeof e?this.internalAddInline(new b(e)):this.internalAddInline(e)},n.prototype.removeInline=function(e){var t=this._inlines.indexOf(e);return t>=0&&(this._inlines[t].setParent(void 0),this._inlines.splice(t,1),!0)},n}(g);Zw.RichTextBlock=w;var E=function(n){function r(e,t){var r=n.call(this)||this;return r.name=e,r.value=t,r}return e(r,n),r.prototype.getSchemaKey=function(){return"Fact"},r.titleProperty=new u.StringProperty(u.Versions.v1_0,"title"),r.valueProperty=new u.StringProperty(u.Versions.v1_0,"value"),t([(0,u.property)(r.titleProperty)],r.prototype,"name",void 0),t([(0,u.property)(r.valueProperty)],r.prototype,"value",void 0),r}(u.SerializableObject);Zw.Fact=E;var k=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),Object.defineProperty(r.prototype,"useDefaultSizing",{get:function(){return!1},enumerable:!1,configurable:!0}),r.prototype.internalRender=function(){var e=void 0,t=this.hostConfig;if(this.facts.length>0){(e=document.createElement("table")).style.borderWidth="0px",e.style.borderSpacing="0px",e.style.borderStyle="none",e.style.borderCollapse="collapse",e.style.display="block",e.style.overflow="hidden",e.classList.add(t.makeCssClassName("ac-factset")),e.setAttribute("role","presentation");for(var n=0;n<this.facts.length;n++){var r=document.createElement("tr");n>0&&(r.style.marginTop=t.factSet.spacing+"px");var o=document.createElement("td");o.style.padding="0",o.classList.add(t.makeCssClassName("ac-fact-title")),t.factSet.title.maxWidth&&(o.style.maxWidth=t.factSet.title.maxWidth+"px"),o.style.verticalAlign="top";var s=new v;s.setParent(this),s.text=!this.facts[n].name&&this.isDesignMode()?"Title":this.facts[n].name,s.size=t.factSet.title.size,s.color=t.factSet.title.color,s.isSubtle=t.factSet.title.isSubtle,s.weight=t.factSet.title.weight,s.wrap=t.factSet.title.wrap,s.spacing=i.Spacing.None,a.appendChild(o,s.render()),a.appendChild(r,o),(o=document.createElement("td")).style.width="10px",a.appendChild(r,o),(o=document.createElement("td")).style.padding="0",o.style.verticalAlign="top",o.classList.add(t.makeCssClassName("ac-fact-value")),(s=new v).setParent(this),s.text=this.facts[n].value,s.size=t.factSet.value.size,s.color=t.factSet.value.color,s.isSubtle=t.factSet.value.isSubtle,s.weight=t.factSet.value.weight,s.wrap=t.factSet.value.wrap,s.spacing=i.Spacing.None,a.appendChild(o,s.render()),a.appendChild(r,o),a.appendChild(e,r)}}return e},r.prototype.getJsonTypeName=function(){return"FactSet"},r.factsProperty=new u.SerializableObjectCollectionProperty(u.Versions.v1_0,"facts",E),t([(0,u.property)(r.factsProperty)],r.prototype,"facts",void 0),r}(g);Zw.FactSet=k;var C=function(t){function n(e,n,r,i){var o=t.call(this,e,n)||this;return o.targetVersion=e,o.name=n,o.internalName=r,o.fallbackProperty=i,o}return e(n,t),n.prototype.getInternalName=function(){return this.internalName},n.prototype.parse=function(e,t,n){var r=void 0,a=t[this.name];if(void 0===a)return this.defaultValue;var s=!1;if("string"==typeof a){try{var l=o.SizeAndUnit.parse(a,!0);l.unit===i.SizeUnit.Pixel&&(r=l.physicalSize,s=!0)}catch(e){}!s&&this.fallbackProperty&&(s=this.fallbackProperty.isValidValue(a,n))}return s||n.logParseEvent(e,i.ValidationEvent.InvalidPropertyValue,p.Strings.errors.invalidPropertyValue(a,this.name)),r},n.prototype.toJSON=function(e,t,n,r){r.serializeValue(t,this.name,"number"!=typeof n||isNaN(n)?void 0:n+"px")},n}(u.PropertyDefinition),_=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.size=i.Size.Auto,e.style=i.ImageStyle.Default,e}return e(r,n),r.prototype.populateSchema=function(e){n.prototype.populateSchema.call(this,e),e.remove(g.heightProperty)},r.prototype.applySize=function(e){if(this.pixelWidth||this.pixelHeight)this.pixelWidth&&(e.style.width=this.pixelWidth+"px"),this.pixelHeight&&(e.style.height=this.pixelHeight+"px");else if(this.maxHeight){switch(this.size){case i.Size.Small:e.style.height=this.hostConfig.imageSizes.small+"px";break;case i.Size.Large:e.style.height=this.hostConfig.imageSizes.large+"px";break;default:e.style.height=this.hostConfig.imageSizes.medium+"px"}e.style.maxHeight=this.maxHeight+"px"}else{switch(this.size){case i.Size.Stretch:e.style.width="100%";break;case i.Size.Auto:e.style.maxWidth="100%";break;case i.Size.Small:e.style.width=this.hostConfig.imageSizes.small+"px";break;case i.Size.Large:e.style.width=this.hostConfig.imageSizes.large+"px";break;case i.Size.Medium:e.style.width=this.hostConfig.imageSizes.medium+"px"}e.style.maxHeight="100%"}},Object.defineProperty(r.prototype,"useDefaultSizing",{get:function(){return!1},enumerable:!1,configurable:!0}),r.prototype.internalRender=function(){var e=this,t=void 0;if(this.url){(t=document.createElement("div")).style.display="flex",t.style.alignItems="flex-start";var n=this.hostConfig;switch(this.getEffectiveHorizontalAlignment()){case i.HorizontalAlignment.Center:t.style.justifyContent="center";break;case i.HorizontalAlignment.Right:t.style.justifyContent="flex-end";break;default:t.style.justifyContent="flex-start"}var o=document.createElement("img");o.onload=function(t){fe(e)},o.onerror=function(t){if(e.renderedElement){var n=e.getRootElement();if(e.renderedElement,n&&n.designMode){var r=document.createElement("div");r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="center",r.style.backgroundColor="#EEEEEE",r.style.color="black",r.innerText=":-(",r.style.padding="10px",e.applySize(r),e.renderedElement.appendChild(r)}}fe(e)},o.style.minWidth="0",o.classList.add(n.makeCssClassName("ac-image")),this.selectAction&&n.supportsInteractivity&&(o.onkeypress=function(t){e.selectAction&&e.selectAction.isEffectivelyEnabled()&&("Enter"===t.code||"Space"===t.code)&&(t.preventDefault(),t.cancelBubble=!0,e.selectAction.execute())},o.onclick=function(t){e.selectAction&&e.selectAction.isEffectivelyEnabled()&&(t.preventDefault(),t.cancelBubble=!0,e.selectAction.execute())},this.selectAction.setupElementForAccessibility(o),this.selectAction.isEffectivelyEnabled()&&o.classList.add(n.makeCssClassName("ac-selectable"))),this.applySize(o),this.style===i.ImageStyle.Person&&(o.style.borderRadius="50%",o.style.backgroundPosition="50% 50%",o.style.backgroundRepeat="no-repeat");var s=a.stringToCssColor(this.backgroundColor);s&&(o.style.backgroundColor=s),o.src=this.preProcessPropertyValue(r.urlProperty);var l=this.preProcessPropertyValue(r.altTextProperty);l&&(o.alt=l),t.appendChild(o)}return t},r.prototype.getJsonTypeName=function(){return"Image"},r.prototype.getAllActions=function(){var e=n.prototype.getAllActions.call(this);return this.selectAction&&e.push(this.selectAction),e},r.prototype.getActionById=function(e){var t=n.prototype.getActionById.call(this,e);return!t&&this.selectAction&&(t=this.selectAction.getActionById(e)),t},r.prototype.getResourceInformation=function(){return this.url?[{url:this.url,mimeType:"image"}]:[]},r.urlProperty=new u.StringProperty(u.Versions.v1_0,"url"),r.altTextProperty=new u.StringProperty(u.Versions.v1_0,"altText"),r.backgroundColorProperty=new u.StringProperty(u.Versions.v1_1,"backgroundColor"),r.styleProperty=new u.EnumProperty(u.Versions.v1_0,"style",i.ImageStyle,i.ImageStyle.Default),r.sizeProperty=new u.EnumProperty(u.Versions.v1_0,"size",i.Size,i.Size.Auto),r.pixelWidthProperty=new C(u.Versions.v1_1,"width","pixelWidth"),r.pixelHeightProperty=new C(u.Versions.v1_1,"height","pixelHeight",g.heightProperty),r.selectActionProperty=new y(u.Versions.v1_1,"selectAction",["Action.ShowCard"]),t([(0,u.property)(r.urlProperty)],r.prototype,"url",void 0),t([(0,u.property)(r.altTextProperty)],r.prototype,"altText",void 0),t([(0,u.property)(r.backgroundColorProperty)],r.prototype,"backgroundColor",void 0),t([(0,u.property)(r.sizeProperty)],r.prototype,"size",void 0),t([(0,u.property)(r.styleProperty)],r.prototype,"style",void 0),t([(0,u.property)(r.pixelWidthProperty)],r.prototype,"pixelWidth",void 0),t([(0,u.property)(r.pixelHeightProperty)],r.prototype,"pixelHeight",void 0),t([(0,u.property)(r.selectActionProperty)],r.prototype,"selectAction",void 0),r}(g);Zw.Image=_;var M=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.allowVerticalOverflow=!1,e}return e(r,n),r.prototype.populateSchema=function(e){n.prototype.populateSchema.call(this,e),this.isSelectable||e.remove(r.selectActionProperty)},r.prototype.isElementAllowed=function(e){return this.hostConfig.supportsInteractivity||!e.isInteractive},r.prototype.applyPadding=function(){if(n.prototype.applyPadding.call(this),this.renderedElement){var e=new o.SpacingDefinition;this.getEffectivePadding()&&(e=this.hostConfig.paddingDefinitionToSpacingDefinition(this.getEffectivePadding())),this.renderedElement.style.paddingTop=e.top+"px",this.renderedElement.style.paddingRight=e.right+"px",this.renderedElement.style.paddingBottom=e.bottom+"px",this.renderedElement.style.paddingLeft=e.left+"px",this.renderedElement.style.marginRight="0",this.renderedElement.style.marginLeft="0"}},Object.defineProperty(r.prototype,"isSelectable",{get:function(){return!1},enumerable:!1,configurable:!0}),r.prototype.forbiddenChildElements=function(){return[]},r.prototype.releaseDOMResources=function(){n.prototype.releaseDOMResources.call(this);for(var e=0;e<this.getItemCount();e++)this.getItemAt(e).releaseDOMResources()},r.prototype.internalValidateProperties=function(e){n.prototype.internalValidateProperties.call(this,e);for(var t=0;t<this.getItemCount();t++){var r=this.getItemAt(t);!this.hostConfig.supportsInteractivity&&r.isInteractive&&e.addFailure(this,i.ValidationEvent.InteractivityNotAllowed,p.Strings.errors.interactivityNotAllowed()),this.isElementAllowed(r)||e.addFailure(this,i.ValidationEvent.InteractivityNotAllowed,p.Strings.errors.elementTypeNotAllowed(r.getJsonTypeName())),r.internalValidateProperties(e)}this._selectAction&&this._selectAction.internalValidateProperties(e)},r.prototype.render=function(){var e=this,t=n.prototype.render.call(this);if(t){var r=this.hostConfig;this.allowVerticalOverflow&&(t.style.overflowX="hidden",t.style.overflowY="auto"),t&&this.isSelectable&&this._selectAction&&r.supportsInteractivity&&(t.onclick=function(t){e._selectAction&&e._selectAction.isEffectivelyEnabled()&&(t.preventDefault(),t.cancelBubble=!0,e._selectAction.execute())},t.onkeypress=function(t){e._selectAction&&e._selectAction.isEffectivelyEnabled()&&("Enter"===t.code||"Space"===t.code)&&(t.preventDefault(),t.cancelBubble=!0,e._selectAction.execute())},this._selectAction.setupElementForAccessibility(t),this._selectAction.isEffectivelyEnabled()&&t.classList.add(r.makeCssClassName("ac-selectable")))}return t},r.prototype.updateLayout=function(e){if(void 0===e&&(e=!0),n.prototype.updateLayout.call(this,e),e)for(var t=0;t<this.getItemCount();t++)this.getItemAt(t).updateLayout()},r.prototype.getAllInputs=function(e){void 0===e&&(e=!0);for(var t=[],n=0;n<this.getItemCount();n++)t.push.apply(t,this.getItemAt(n).getAllInputs(e));return t},r.prototype.getAllActions=function(){for(var e=n.prototype.getAllActions.call(this),t=0;t<this.getItemCount();t++)e.push.apply(e,this.getItemAt(t).getAllActions());return this._selectAction&&e.push(this._selectAction),e},r.prototype.getResourceInformation=function(){for(var e=[],t=0;t<this.getItemCount();t++)e.push.apply(e,this.getItemAt(t).getResourceInformation());return e},r.prototype.getElementById=function(e){var t=n.prototype.getElementById.call(this,e);if(!t)for(var r=0;r<this.getItemCount()&&!(t=this.getItemAt(r).getElementById(e));r++);return t},r.prototype.findDOMNodeOwner=function(e){for(var t,r=void 0,i=0;i<this.getItemCount();i++)if(r=this.getItemAt(i).findDOMNodeOwner(e))return r;for(i=0;i<this.getActionCount();i++)if(r=null===(t=this.getActionAt(i))||void 0===t?void 0:t.findDOMNodeOwner(e))return r;return n.prototype.findDOMNodeOwner.call(this,e)},r.selectActionProperty=new y(u.Versions.v1_1,"selectAction",["Action.ShowCard"]),t([(0,u.property)(r.selectActionProperty)],r.prototype,"_selectAction",void 0),r}(g);Zw.CardElementContainer=M;var T=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e._images=[],e.imageSize=i.ImageSize.Medium,e}return e(r,n),r.prototype.internalRender=function(){var e=void 0;if(this._images.length>0){(e=document.createElement("div")).style.display="flex",e.style.flexWrap="wrap";for(var t=0,n=this._images;t<n.length;t++){var r=n[t];switch(this.imageSize){case i.ImageSize.Small:r.size=i.Size.Small;break;case i.ImageSize.Large:r.size=i.Size.Large;break;default:r.size=i.Size.Medium}r.maxHeight=this.hostConfig.imageSet.maxImageHeight;var o=r.render();o&&(o.style.display="inline-flex",o.style.margin="0px",o.style.marginRight="10px",a.appendChild(e,o))}}return e},r.prototype.getItemCount=function(){return this._images.length},r.prototype.getItemAt=function(e){return this._images[e]},r.prototype.getFirstVisibleRenderedItem=function(){return this._images&&this._images.length>0?this._images[0]:void 0},r.prototype.getLastVisibleRenderedItem=function(){return this._images&&this._images.length>0?this._images[this._images.length-1]:void 0},r.prototype.removeItem=function(e){if(e instanceof _){var t=this._images.indexOf(e);if(t>=0)return this._images.splice(t,1),e.setParent(void 0),this.updateLayout(),!0}return!1},r.prototype.getJsonTypeName=function(){return"ImageSet"},r.prototype.addImage=function(e){if(e.parent)throw new Error("This image already belongs to another ImageSet");this._images.push(e),e.setParent(this)},r.prototype.indexOf=function(e){return e instanceof _?this._images.indexOf(e):-1},r.imagesProperty=new u.SerializableObjectCollectionProperty(u.Versions.v1_0,"images",_,function(e,t){t.setParent(e)}),r.imageSizeProperty=new u.EnumProperty(u.Versions.v1_0,"imageSize",i.ImageSize,i.ImageSize.Medium),t([(0,u.property)(r.imagesProperty)],r.prototype,"_images",void 0),t([(0,u.property)(r.imageSizeProperty)],r.prototype,"imageSize",void 0),r}(M);Zw.ImageSet=T;var S=function(n){function r(e,t){var r=n.call(this)||this;return r.url=e,r.mimeType=t,r}return e(r,n),r.prototype.isValid=function(){return!(!this.mimeType||!this.url)},r.mimeTypeProperty=new u.StringProperty(u.Versions.v1_1,"mimeType"),r.urlProperty=new u.StringProperty(u.Versions.v1_1,"url"),t([(0,u.property)(r.mimeTypeProperty)],r.prototype,"mimeType",void 0),t([(0,u.property)(r.urlProperty)],r.prototype,"url",void 0),r}(u.SerializableObject);Zw.ContentSource=S;var D=function(n){function r(e,t,r){var i=n.call(this,e,t)||this;return i.label=r,i}return e(r,n),r.prototype.getSchemaKey=function(){return"CaptionSource"},r.prototype.render=function(){var e=void 0;return this.isValid()&&((e=document.createElement("track")).src=this.url,e.kind="captions",e.label=this.label),e},r.labelProperty=new u.StringProperty(u.Versions.v1_6,"label"),t([(0,u.property)(r.labelProperty)],r.prototype,"label",void 0),r}(S);Zw.CaptionSource=D;var x=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getSchemaKey=function(){return"MediaSource"},n.prototype.render=function(){var e=void 0;return this.isValid()&&((e=document.createElement("source")).src=this.url,e.type=this.mimeType),e},n}(S);Zw.MediaSource=x;var I=function(){function e(){}return e.prototype.play=function(){},Object.defineProperty(e.prototype,"posterUrl",{get:function(){return this._posterUrl},set:function(e){this._posterUrl=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectedMediaType",{get:function(){},enumerable:!1,configurable:!0}),e}();Zw.MediaPlayer=I;var L=function(t){function i(e){var n=t.call(this)||this;return n.owner=e,n._selectedSources=[],n._captionSources=[],n.processSources(),n}return e(i,t),i.prototype.processSources=function(){var e;this._selectedSources=[],this._captionSources=[],this._selectedMediaType=void 0;for(var t=0,n=this.owner.sources;t<n.length;t++){var r=n[t],o=r.mimeType?r.mimeType.split("/"):[];if(2===o.length){if(!this._selectedMediaType){var a=i.supportedMediaTypes.indexOf(o[0]);a>=0&&(this._selectedMediaType=i.supportedMediaTypes[a])}o[0]===this._selectedMediaType&&this._selectedSources.push(r)}}(e=this._captionSources).push.apply(e,this.owner.captionSources)},i.prototype.canPlay=function(){return this._selectedSources.length>0},i.prototype.fetchVideoDetails=function(){return n(this,void 0,void 0,function(){return r(this,function(e){return[2]})})},i.prototype.render=function(){"video"===this._selectedMediaType?this._mediaElement=document.createElement("video"):this._mediaElement=document.createElement("audio"),this._mediaElement.setAttribute("aria-label",this.owner.altText?this.owner.altText:p.Strings.defaults.mediaPlayerAriaLabel()),this._mediaElement.setAttribute("webkit-playsinline",""),this._mediaElement.setAttribute("playsinline",""),this._mediaElement.setAttribute("crossorigin",""),this._mediaElement.autoplay=!0,this._mediaElement.controls=!0,a.isMobileOS()&&(this._mediaElement.muted=!0),this._mediaElement.preload="none",this._mediaElement.style.width="100%";for(var e=0,t=this.owner.sources;e<t.length;e++){var n=t[e].render();a.appendChild(this._mediaElement,n)}for(var r=0,i=this.owner.captionSources;r<i.length;r++){var o=i[r];if("vtt"==o.mimeType){var s=o.render();a.appendChild(this._mediaElement,s)}}return this._mediaElement},i.prototype.play=function(){this._mediaElement&&this._mediaElement.play()},Object.defineProperty(i.prototype,"selectedMediaType",{get:function(){return this._selectedMediaType},enumerable:!1,configurable:!0}),i.supportedMediaTypes=["audio","video"],i}(I);Zw.HTML5MediaPlayer=L;var P=function(t){function n(e){return t.call(this)||this}return e(n,t),n}(I);Zw.CustomMediaPlayer=P;var O=function(t){function n(e,n){var r=t.call(this,e)||this;return r.iFrameTitle=n,e.length>=2&&(r._videoId=e[1]),r}return e(n,t),n.prototype.canPlay=function(){return void 0!==this._videoId},n.prototype.render=function(){var e=document.createElement("div");e.style.position="relative",e.style.width="100%",e.style.height="0",e.style.paddingBottom="56.25%";var t=document.createElement("iframe");return t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.width="100%",t.style.height="100%",t.src=this.getEmbedVideoUrl(),t.frameBorder="0",this.iFrameTitle&&(t.title=this.iFrameTitle),t.allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",t.allowFullscreen=!0,e.appendChild(t),e},Object.defineProperty(n.prototype,"videoId",{get:function(){return this._videoId},enumerable:!1,configurable:!0}),n}(P);Zw.IFrameMediaMediaPlayer=O;var R=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return e(i,t),i.prototype.fetchVideoDetails=function(){return n(this,void 0,void 0,function(){var e,t,n;return r(this,function(r){switch(r.label){case 0:return e="https://vimeo.com/api/oembed.json?url=".concat(this.getEmbedVideoUrl()),[4,fetch(e)];case 1:return(t=r.sent()).ok?[4,t.json()]:[3,3];case 2:n=r.sent(),this.posterUrl=n.thumbnail_url,r.label=3;case 3:return[2]}})})},i.prototype.getEmbedVideoUrl=function(){return"https://player.vimeo.com/video/".concat(this.videoId,"?autoplay=1")},i}(O);Zw.VimeoPlayer=R;var B=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return e(i,t),i.prototype.fetchVideoDetails=function(){return n(this,void 0,void 0,function(){var e,t,n;return r(this,function(r){switch(r.label){case 0:return e="https://api.dailymotion.com/video/".concat(this.videoId,"?fields=thumbnail_720_url"),[4,fetch(e)];case 1:return(t=r.sent()).ok?[4,t.json()]:[3,3];case 2:n=r.sent(),this.posterUrl=n.thumbnail_720_url,r.label=3;case 3:return[2]}})})},i.prototype.getEmbedVideoUrl=function(){return"https://www.dailymotion.com/embed/video/".concat(this.videoId,"?autoplay=1")},i}(O);Zw.DailymotionPlayer=B;var Y=function(t){function i(e,n){var r=t.call(this,e,n)||this;return r.iFrameTitle=n,e.length>=3&&void 0!==e[2]&&(r._startTimeIndex=parseInt(e[2])),r}return e(i,t),i.prototype.fetchVideoDetails=function(){return n(this,void 0,void 0,function(){return r(this,function(e){return this.posterUrl=this.videoId?"https://img.youtube.com/vi/".concat(this.videoId,"/maxresdefault.jpg"):void 0,[2]})})},i.prototype.getEmbedVideoUrl=function(){var e="https://www.youtube.com/embed/".concat(this.videoId,"?autoplay=1");return void 0!==this._startTimeIndex&&(e+="&start=".concat(this._startTimeIndex)),e},i}(O);Zw.YouTubePlayer=Y;var N=function(i){function o(){var e=null!==i&&i.apply(this,arguments)||this;return e.sources=[],e.captionSources=[],e}return e(o,i),o.prototype.createMediaPlayer=function(){for(var e=0,t=o.customMediaPlayers;e<t.length;e++)for(var n=t[e],r=0,i=this.sources;r<i.length;r++){var a=i[r];if(a.url)for(var s=0,l=n.urlPatterns;s<l.length;s++){var c=l[s].exec(a.url);if(null!==c)return n.createMediaPlayer(c)}}return new L(this)},o.prototype.handlePlayButtonInvoke=function(e){if(this.hostConfig.media.allowInlinePlayback){if(e.preventDefault(),e.cancelBubble=!0,this.renderedElement){var t=this._mediaPlayer.render();f(this.renderedElement),this.renderedElement.appendChild(t),this._mediaPlayer.play(),t.focus()}}else o.onPlay&&(e.preventDefault(),e.cancelBubble=!0,o.onPlay(this))},o.prototype.displayPoster=function(){return n(this,void 0,void 0,function(){var e,t,n,i,o,a,s=this;return r(this,function(r){return this.renderedElement&&((e=document.createElement("div")).className=this.hostConfig.makeCssClassName("ac-media-poster"),e.setAttribute("role","contentinfo"),e.setAttribute("aria-label",this.altText?this.altText:p.Strings.defaults.mediaPlayerAriaLabel()),e.style.position="relative",e.style.display="flex",(t=this.poster?this.poster:this._mediaPlayer.posterUrl)||(t=this.hostConfig.media.defaultPoster),t?((n=document.createElement("img")).style.width="100%",n.style.height="100%",n.setAttribute("role","presentation"),n.onerror=function(t){n.parentNode&&n.parentNode.removeChild(n),e.classList.add("empty"),e.style.minHeight="150px"},n.src=t,e.appendChild(n)):(e.classList.add("empty"),e.style.minHeight="150px"),this.hostConfig.supportsInteractivity&&this._mediaPlayer.canPlay()&&((i=document.createElement("div")).tabIndex=0,i.setAttribute("role","button"),i.setAttribute("aria-label",p.Strings.defaults.mediaPlayerPlayMedia()),i.className=this.hostConfig.makeCssClassName("ac-media-playButton"),i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center",i.onclick=function(e){s.handlePlayButtonInvoke(e)},i.onkeypress=function(e){"Enter"!==e.code&&"Space"!==e.code||s.handlePlayButtonInvoke(e)},(o=document.createElement("div")).className=this.hostConfig.makeCssClassName("ac-media-playButton-arrow"),o.style.width="12px",o.style.height="15px",o.style.borderTopWidth="7.5px",o.style.borderBottomWidth="7.5px",o.style.borderLeftWidth="12px",o.style.borderRightWidth="0",o.style.borderStyle="solid",o.style.borderTopColor="transparent",o.style.borderRightColor="transparent",o.style.borderBottomColor="transparent",o.style.transform="translate(1.2px,0px)",i.appendChild(o),(a=document.createElement("div")).style.position="absolute",a.style.left="0",a.style.top="0",a.style.width="100%",a.style.height="100%",a.style.display="flex",a.style.justifyContent="center",a.style.alignItems="center",a.appendChild(i),e.appendChild(a)),f(this.renderedElement),this.renderedElement.appendChild(e)),[2]})})},o.prototype.internalRender=function(){var e=document.createElement("div");return e.className=this.hostConfig.makeCssClassName("ac-media"),e},o.prototype.render=function(){var e=this,t=i.prototype.render.call(this);return t&&(this._mediaPlayer=this.createMediaPlayer(),this._mediaPlayer.fetchVideoDetails().then(function(){return e.displayPoster()})),t},o.prototype.releaseDOMResources=function(){i.prototype.releaseDOMResources.call(this),this.displayPoster()},o.prototype.getJsonTypeName=function(){return"Media"},o.prototype.getResourceInformation=function(){var e=[];if(this._mediaPlayer){var t=this.poster?this.poster:this.hostConfig.media.defaultPoster;t&&e.push({url:t,mimeType:"image"})}for(var n=0,r=this.sources;n<r.length;n++){var i=r[n];i.isValid()&&e.push({url:i.url,mimeType:i.mimeType})}for(var o=0,a=this.captionSources;o<a.length;o++){var s=a[o];s.isValid()&&e.push({url:s.url,mimeType:s.mimeType})}return e},Object.defineProperty(o.prototype,"selectedMediaType",{get:function(){return this._mediaPlayer.selectedMediaType},enumerable:!1,configurable:!0}),o.customMediaPlayers=[{urlPatterns:[/^(?:https?:\/\/)?(?:www\.)?youtube\.com\/watch\?(?=.*v=([\w\d-_]+))(?=(?:.*t=(\d+))?).*/gi,/^(?:https?:\/\/)?youtu.be\/([\w\d-_]+)(?:\?t=(\d+))?/gi],createMediaPlayer:function(e){return new Y(e,p.Strings.defaults.youTubeVideoPlayer())}},{urlPatterns:[/^(?:https?:\/\/)?vimeo.com\/([\w\d-_]+).*/gi],createMediaPlayer:function(e){return new R(e,p.Strings.defaults.vimeoVideoPlayer())}},{urlPatterns:[/^(?:https?:\/\/)?(?:www.)?dailymotion.com\/video\/([\w\d-_]+).*/gi],createMediaPlayer:function(e){return new B(e,p.Strings.defaults.dailymotionVideoPlayer())}}],o.sourcesProperty=new u.SerializableObjectCollectionProperty(u.Versions.v1_1,"sources",x),o.captionSourcesProperty=new u.SerializableObjectCollectionProperty(u.Versions.v1_6,"captionSources",D),o.posterProperty=new u.StringProperty(u.Versions.v1_1,"poster"),o.altTextProperty=new u.StringProperty(u.Versions.v1_1,"altText"),t([(0,u.property)(o.sourcesProperty)],o.prototype,"sources",void 0),t([(0,u.property)(o.captionSourcesProperty)],o.prototype,"captionSources",void 0),t([(0,u.property)(o.posterProperty)],o.prototype,"poster",void 0),t([(0,u.property)(o.altTextProperty)],o.prototype,"altText",void 0),o}(g);Zw.Media=N;var V=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),r.prototype.getAllLabelIds=function(){var e=[];return this.labelledBy&&e.push(this.labelledBy),this._renderedLabelElement&&e.push(this._renderedLabelElement.id),this._renderedErrorMessageElement&&e.push(this._renderedErrorMessageElement.id),e},r.prototype.updateInputControlAriaLabelledBy=function(){if(this._renderedInputControlElement){var e=this.getAllLabelIds();e.length>0?this._renderedInputControlElement.setAttribute("aria-labelledby",e.join(" ")):this._renderedInputControlElement.removeAttribute("aria-labelledby")}},Object.defineProperty(r.prototype,"isNullable",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"renderedInputControlElement",{get:function(){return this._renderedInputControlElement},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"inputControlContainerElement",{get:function(){return this._inputControlContainerElement},enumerable:!1,configurable:!0}),r.prototype.overrideInternalRender=function(){var e=this.hostConfig;this._outerContainerElement=document.createElement("div"),this._outerContainerElement.style.display="flex",this._outerContainerElement.style.flexDirection="column";var t=a.generateUniqueId();if(this.label){var n=new w;n.setParent(this),n.forElementId=t;var r=new b(this.label);if(n.addInline(r),this.isRequired){r.init(e.inputs.label.requiredInputs);var i=new b(e.inputs.label.requiredInputs.suffix);i.color=e.inputs.label.requiredInputs.suffixColor,i.ariaHidden=!0,n.addInline(i)}else r.init(e.inputs.label.optionalInputs);this._renderedLabelElement=n.render(),this._renderedLabelElement&&(this._renderedLabelElement.id=a.generateUniqueId(),this._renderedLabelElement.style.marginBottom=e.getEffectiveSpacing(e.inputs.label.inputSpacing)+"px",this._outerContainerElement.appendChild(this._renderedLabelElement))}if(this._inputControlContainerElement=document.createElement("div"),this._inputControlContainerElement.className=e.makeCssClassName("ac-input-container"),this._inputControlContainerElement.style.display="flex","stretch"===this.height&&(this._inputControlContainerElement.style.alignItems="stretch",this._inputControlContainerElement.style.flex="1 1 auto"),this._renderedInputControlElement=this.internalRender(),this._renderedInputControlElement)return this._renderedInputControlElement.id=t,this._renderedInputControlElement.style.minWidth="0px",this.isNullable&&this.isRequired&&(this._renderedInputControlElement.setAttribute("aria-required","true"),this._renderedInputControlElement.classList.add(e.makeCssClassName("ac-input-required"))),this._inputControlContainerElement.appendChild(this._renderedInputControlElement),this._outerContainerElement.appendChild(this._inputControlContainerElement),this.updateInputControlAriaLabelledBy(),this._outerContainerElement;this.resetDirtyState()},r.prototype.valueChanged=function(){this.getRootElement().updateActionsEnabledState(),this.isValid()&&this.resetValidationFailureCue(),this.onValueChanged&&this.onValueChanged(this),function(e){var t=e.getRootElement(),n=t&&t.onInputValueChanged?t.onInputValueChanged:Ce.onInputValueChanged;n&&n(e)}(this)},r.prototype.resetValidationFailureCue=function(){this.renderedInputControlElement&&(this.renderedInputControlElement.classList.remove(this.hostConfig.makeCssClassName("ac-input-validation-failed")),this.updateInputControlAriaLabelledBy(),this._renderedErrorMessageElement&&(this._outerContainerElement.removeChild(this._renderedErrorMessageElement),this._renderedErrorMessageElement=void 0))},r.prototype.showValidationErrorMessage=function(){if(this.renderedElement&&this.errorMessage&&o.GlobalSettings.displayInputValidationErrors){var e=new v;e.setParent(this),e.text=this.errorMessage,e.wrap=!0,e.init(this.hostConfig.inputs.errorMessage),this._renderedErrorMessageElement=e.render(),this._renderedErrorMessageElement&&(this._renderedErrorMessageElement.id=a.generateUniqueId(),this._outerContainerElement.appendChild(this._renderedErrorMessageElement),this.updateInputControlAriaLabelledBy())}},r.prototype.focus=function(){this._renderedInputControlElement&&this._renderedInputControlElement.focus()},r.prototype.isValid=function(){return!0},r.prototype.isDirty=function(){return this.value!==this._oldValue},r.prototype.resetDirtyState=function(){this._oldValue=this.value},r.prototype.internalValidateProperties=function(e){n.prototype.internalValidateProperties.call(this,e),this.id||e.addFailure(this,i.ValidationEvent.PropertyCantBeNull,p.Strings.errors.inputsMustHaveUniqueId()),this.isRequired&&(this.label||e.addFailure(this,i.ValidationEvent.RequiredInputsShouldHaveLabel,"Required inputs should have a label"),this.errorMessage||e.addFailure(this,i.ValidationEvent.RequiredInputsShouldHaveErrorMessage,"Required inputs should have an error message"))},r.prototype.validateValue=function(){this.resetValidationFailureCue();var e=this.isRequired?this.isSet()&&this.isValid():this.isValid();return!e&&this.renderedInputControlElement&&(this.renderedInputControlElement.classList.add(this.hostConfig.makeCssClassName("ac-input-validation-failed")),this.showValidationErrorMessage()),e},r.prototype.getAllInputs=function(e){return[this]},r.prototype.render=function(){var e=n.prototype.render.call(this);return this.resetDirtyState(),e},Object.defineProperty(r.prototype,"isInteractive",{get:function(){return!0},enumerable:!1,configurable:!0}),r.labelProperty=new u.StringProperty(u.Versions.v1_3,"label",!0),r.isRequiredProperty=new u.BoolProperty(u.Versions.v1_3,"isRequired",!1),r.errorMessageProperty=new u.StringProperty(u.Versions.v1_3,"errorMessage",!0),t([(0,u.property)(r.labelProperty)],r.prototype,"label",void 0),t([(0,u.property)(r.isRequiredProperty)],r.prototype,"isRequired",void 0),t([(0,u.property)(r.errorMessageProperty)],r.prototype,"errorMessage",void 0),r}(g);Zw.Input=V;var F=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.isMultiline=!1,e.style=i.InputTextStyle.Text,e}return e(r,n),r.prototype.setupInput=function(e){var t=this;e.style.flex="1 1 auto",e.tabIndex=this.isDesignMode()?-1:0,this.placeholder&&(e.placeholder=this.placeholder,e.setAttribute("aria-label",this.placeholder)),this.defaultValue&&(e.value=this.defaultValue),this.maxLength&&this.maxLength>0&&(e.maxLength=this.maxLength),e.oninput=function(){t.valueChanged()},e.onkeypress=function(e){e.ctrlKey&&"Enter"===e.code&&t.inlineAction&&t.inlineAction.isEffectivelyEnabled()&&t.inlineAction.execute()}},r.prototype.internalRender=function(){var e;return this.isMultiline&&this.style!==i.InputTextStyle.Password?((e=document.createElement("textarea")).className=this.hostConfig.makeCssClassName("ac-input","ac-textInput","ac-multiline"),"stretch"===this.height&&(e.style.height="initial")):((e=document.createElement("input")).className=this.hostConfig.makeCssClassName("ac-input","ac-textInput"),e.type=i.InputTextStyle[this.style].toLowerCase()),this.setupInput(e),e},r.prototype.overrideInternalRender=function(){var e=this,t=n.prototype.overrideInternalRender.call(this);if(this.inlineAction){var r=document.createElement("button");if(r.className=this.hostConfig.makeCssClassName(this.inlineAction.isEffectivelyEnabled()?"ac-inlineActionButton":"ac-inlineActionButton-disabled"),r.onclick=function(t){e.inlineAction&&e.inlineAction.isEffectivelyEnabled()&&(t.preventDefault(),t.cancelBubble=!0,e.inlineAction.execute())},this.inlineAction.iconUrl){r.classList.add("iconOnly");var i=document.createElement("img");i.style.height="100%",i.setAttribute("role","presentation"),i.style.display="none",i.onload=function(){i.style.removeProperty("display")},i.onerror=function(){r.removeChild(i),r.classList.remove("iconOnly"),r.classList.add("textOnly"),r.textContent=e.inlineAction&&e.inlineAction.title?e.inlineAction.title:p.Strings.defaults.inlineActionTitle()},i.src=this.inlineAction.iconUrl,r.appendChild(i),r.title=this.inlineAction.title?this.inlineAction.title:p.Strings.defaults.inlineActionTitle()}else r.classList.add("textOnly"),r.textContent=this.inlineAction.title?this.inlineAction.title:p.Strings.defaults.inlineActionTitle();this.inlineAction.setupElementForAccessibility(r,!0),r.style.marginLeft="8px",this.inputControlContainerElement.appendChild(r)}return t},r.prototype.getJsonTypeName=function(){return"Input.Text"},r.prototype.getAllActions=function(){var e=n.prototype.getAllActions.call(this);return this.inlineAction&&e.push(this.inlineAction),e},r.prototype.getActionById=function(e){var t=n.prototype.getActionById.call(this,e);return!t&&this.inlineAction&&(t=this.inlineAction.getActionById(e)),t},r.prototype.isSet=function(){return!!this.value},r.prototype.isValid=function(){return!this.value||(!this.regex||new RegExp(this.regex,"g").test(this.value))},Object.defineProperty(r.prototype,"value",{get:function(){return this.renderedInputControlElement?(this.isMultiline,this.renderedInputControlElement.value):void 0},enumerable:!1,configurable:!0}),r.valueProperty=new u.StringProperty(u.Versions.v1_0,"value"),r.maxLengthProperty=new u.NumProperty(u.Versions.v1_0,"maxLength"),r.isMultilineProperty=new u.BoolProperty(u.Versions.v1_0,"isMultiline",!1),r.placeholderProperty=new u.StringProperty(u.Versions.v1_0,"placeholder"),r.styleProperty=new u.EnumProperty(u.Versions.v1_0,"style",i.InputTextStyle,i.InputTextStyle.Text,[{value:i.InputTextStyle.Text},{value:i.InputTextStyle.Tel},{value:i.InputTextStyle.Url},{value:i.InputTextStyle.Email},{value:i.InputTextStyle.Password,targetVersion:u.Versions.v1_5}]),r.inlineActionProperty=new y(u.Versions.v1_0,"inlineAction",["Action.ShowCard"]),r.regexProperty=new u.StringProperty(u.Versions.v1_3,"regex",!0),t([(0,u.property)(r.valueProperty)],r.prototype,"defaultValue",void 0),t([(0,u.property)(r.maxLengthProperty)],r.prototype,"maxLength",void 0),t([(0,u.property)(r.isMultilineProperty)],r.prototype,"isMultiline",void 0),t([(0,u.property)(r.placeholderProperty)],r.prototype,"placeholder",void 0),t([(0,u.property)(r.styleProperty)],r.prototype,"style",void 0),t([(0,u.property)(r.inlineActionProperty)],r.prototype,"inlineAction",void 0),t([(0,u.property)(r.regexProperty)],r.prototype,"regex",void 0),r}(V);Zw.TextInput=F;var j=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.valueOn="true",e.valueOff="false",e.wrap=!1,e}return e(r,n),r.prototype.updateInputControlAriaLabelledBy=function(){if(this._checkboxInputElement){var e=this.getAllLabelIds().join(" ");this._checkboxInputLabelElement&&this._checkboxInputLabelElement.id&&(e+=" "+this._checkboxInputLabelElement.id),e?this._checkboxInputElement.setAttribute("aria-labelledby",e):this._checkboxInputElement.removeAttribute("aria-labelledby")}},r.prototype.internalRender=function(){var e=this,t=document.createElement("div");if(t.className=this.hostConfig.makeCssClassName("ac-input","ac-toggleInput"),t.style.width="100%",t.style.display="flex",t.style.alignItems="center",this._checkboxInputElement=document.createElement("input"),this._checkboxInputElement.id=a.generateUniqueId(),this._checkboxInputElement.type="checkbox",this._checkboxInputElement.style.display="inline-block",this._checkboxInputElement.style.verticalAlign="middle",this._checkboxInputElement.style.margin="0",this._checkboxInputElement.style.flex="0 0 auto",this.title&&this._checkboxInputElement.setAttribute("aria-label",this.title),this.isRequired&&this._checkboxInputElement.setAttribute("aria-required","true"),this._checkboxInputElement.tabIndex=this.isDesignMode()?-1:0,this.defaultValue===this.valueOn&&(this._checkboxInputElement.checked=!0),this._oldCheckboxValue=this._checkboxInputElement.checked,this._checkboxInputElement.onchange=function(){e.valueChanged()},a.appendChild(t,this._checkboxInputElement),this.title||this.isDesignMode()){var n=new v;if(n.setParent(this),n.forElementId=this._checkboxInputElement.id,n.hostConfig=this.hostConfig,n.text=this.title?this.title:this.getJsonTypeName(),n.useMarkdown=o.GlobalSettings.useMarkdownInRadioButtonAndCheckbox,n.wrap=this.wrap,this._checkboxInputLabelElement=n.render(),this._checkboxInputLabelElement){this._checkboxInputLabelElement.id=a.generateUniqueId(),this._checkboxInputLabelElement.style.display="inline-block",this._checkboxInputLabelElement.style.flex="1 1 auto",this._checkboxInputLabelElement.style.marginLeft="6px",this._checkboxInputLabelElement.style.verticalAlign="middle";var r=document.createElement("div");r.style.width="6px",a.appendChild(t,r),a.appendChild(t,this._checkboxInputLabelElement)}}return t},Object.defineProperty(r.prototype,"isNullable",{get:function(){return!1},enumerable:!1,configurable:!0}),r.prototype.getJsonTypeName=function(){return"Input.Toggle"},r.prototype.focus=function(){this._checkboxInputElement&&this._checkboxInputElement.focus()},r.prototype.isSet=function(){return this.isRequired?this.value===this.valueOn:!!this.value},r.prototype.isDirty=function(){return!!this._checkboxInputElement&&this._checkboxInputElement.checked!==this._oldCheckboxValue},Object.defineProperty(r.prototype,"value",{get:function(){return this._checkboxInputElement?this._checkboxInputElement.checked?this.valueOn:this.valueOff:void 0},enumerable:!1,configurable:!0}),r.valueProperty=new u.StringProperty(u.Versions.v1_0,"value"),r.titleProperty=new u.StringProperty(u.Versions.v1_0,"title"),r.valueOnProperty=new u.StringProperty(u.Versions.v1_0,"valueOn",!0,void 0,"true",function(e){return"true"}),r.valueOffProperty=new u.StringProperty(u.Versions.v1_0,"valueOff",!0,void 0,"false",function(e){return"false"}),r.wrapProperty=new u.BoolProperty(u.Versions.v1_2,"wrap",!1),t([(0,u.property)(r.valueProperty)],r.prototype,"defaultValue",void 0),t([(0,u.property)(r.titleProperty)],r.prototype,"title",void 0),t([(0,u.property)(r.valueOnProperty)],r.prototype,"valueOn",void 0),t([(0,u.property)(r.valueOffProperty)],r.prototype,"valueOff",void 0),t([(0,u.property)(r.wrapProperty)],r.prototype,"wrap",void 0),r}(V);Zw.ToggleInput=j;var H=function(n){function r(e,t){var r=n.call(this)||this;return r.title=e,r.value=t,r}return e(r,n),r.prototype.getSchemaKey=function(){return"Choice"},r.titleProperty=new u.StringProperty(u.Versions.v1_0,"title"),r.valueProperty=new u.StringProperty(u.Versions.v1_0,"value"),t([(0,u.property)(r.titleProperty)],r.prototype,"title",void 0),t([(0,u.property)(r.valueProperty)],r.prototype,"value",void 0),r}(u.SerializableObject);Zw.Choice=H;var q=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.isMultiSelect=!1,e.wrap=!1,e.choices=[],e}return e(r,n),Object.defineProperty(r.prototype,"isCompact",{get:function(){return!this.style||"compact"===this.style},set:function(e){this.style=e?void 0:"expanded"},enumerable:!1,configurable:!0}),r.getUniqueCategoryName=function(){var e="__ac-category"+r._uniqueCategoryCounter;return r._uniqueCategoryCounter++,e},r.prototype.internalApplyAriaCurrent=function(){if(this._selectElement){var e=this._selectElement.options;if(e)for(var t=0,n=Array.from(e);t<n.length;t++){var r=n[t];r.selected?r.setAttribute("aria-current","true"):r.removeAttribute("aria-current")}}},r.prototype.renderCompoundInput=function(e,t,n){var r=this,i=document.createElement("div");i.className=this.hostConfig.makeCssClassName("ac-input",e),i.style.width="100%",i.tabIndex=this.isDesignMode()?-1:0,this._toggleInputs=[],this._labels=[];for(var s=0,l=this.choices;s<l.length;s++){var c=l[s],u=document.createElement("input");u.id=a.generateUniqueId(),u.type=t,u.style.margin="0",u.style.display="inline-block",u.style.verticalAlign="middle",u.style.flex="0 0 auto",u.name=this.id?this.id:this._uniqueCategoryName,this.isRequired&&u.setAttribute("aria-required","true"),u.tabIndex=this.isDesignMode()?-1:0,c.value&&(u.value=c.value),c.title&&u.setAttribute("aria-label",c.title),n&&c.value&&n.indexOf(c.value)>=0&&(u.checked=!0),u.onchange=function(){r.valueChanged()},this._toggleInputs.push(u);var d=document.createElement("div");d.style.display="flex",d.style.alignItems="center",a.appendChild(d,u);var p=new v;p.setParent(this),p.forElementId=u.id,p.hostConfig=this.hostConfig,p.text=c.title?c.title:"Choice "+this._toggleInputs.length,p.useMarkdown=o.GlobalSettings.useMarkdownInRadioButtonAndCheckbox,p.wrap=this.wrap;var h=p.render();if(this._labels.push(h),h){h.id=a.generateUniqueId(),h.style.display="inline-block",h.style.flex="1 1 auto",h.style.marginLeft="6px",h.style.verticalAlign="middle";var f=document.createElement("div");f.style.width="6px",a.appendChild(d,f),a.appendChild(d,h)}a.appendChild(i,d)}return i},r.prototype.updateInputControlAriaLabelledBy=function(){if((this.isMultiSelect||"expanded"===this.style)&&this._toggleInputs&&this._labels)for(var e=this.getAllLabelIds(),t=0;t<this._toggleInputs.length;t++){var r=e.join(" "),i=this._labels[t];i&&i.id&&(r+=" "+i.id),r?this._toggleInputs[t].setAttribute("aria-labelledby",r):this._toggleInputs[t].removeAttribute("aria-labelledby")}else n.prototype.updateInputControlAriaLabelledBy.call(this)},r.prototype.internalRender=function(){var e=this;if(this._uniqueCategoryName=r.getUniqueCategoryName(),this.isMultiSelect)return this.renderCompoundInput("ac-choiceSetInput-multiSelect","checkbox",this.defaultValue?this.defaultValue.split(this.hostConfig.choiceSetInputValueSeparator):void 0);if("expanded"===this.style)return this.renderCompoundInput("ac-choiceSetInput-expanded","radio",this.defaultValue?[this.defaultValue]:void 0);if("filtered"===this.style){var t=document.createElement("div");t.style.width="100%",this._textInput=document.createElement("input"),this._textInput.className=this.hostConfig.makeCssClassName("ac-input","ac-multichoiceInput","ac-choiceSetInput-filtered"),this._textInput.type="text",this._textInput.style.width="100%",this._textInput.oninput=function(){e.valueChanged(),e._textInput&&(e.value?(e._textInput.removeAttribute("placeholder"),e._textInput.removeAttribute("aria-label")):e.placeholder&&(e._textInput.placeholder=e.placeholder,e._textInput.setAttribute("aria-label",e.placeholder)))},this.defaultValue&&(this._textInput.value=this.defaultValue),this.placeholder&&!this._textInput.value&&(this._textInput.placeholder=this.placeholder,this._textInput.setAttribute("aria-label",this.placeholder)),this._textInput.tabIndex=this.isDesignMode()?-1:0;var n=document.createElement("datalist");n.id=a.generateUniqueId();for(var i=0,o=this.choices;i<o.length;i++){var s=o[i],l=document.createElement("option");s.title&&(l.value=s.title,l.setAttribute("aria-label",s.title)),l.tabIndex=this.isDesignMode()?-1:0,n.appendChild(l)}return this._textInput.setAttribute("list",n.id),t.append(this._textInput,n),t}this._selectElement=document.createElement("select"),this._selectElement.className=this.hostConfig.makeCssClassName("ac-input","ac-multichoiceInput","ac-choiceSetInput-compact"),this._selectElement.style.width="100%",this._selectElement.tabIndex=this.isDesignMode()?-1:0;var c=document.createElement("option");c.selected=!0,c.disabled=!0,c.hidden=!0,c.value="",this.placeholder&&(c.text=this.placeholder),a.appendChild(this._selectElement,c);for(var u=0,d=this.choices;u<d.length;u++){s=d[u];(l=document.createElement("option")).value=s.value,s.title&&(l.text=s.title,l.setAttribute("aria-label",s.title)),l.tabIndex=this.isDesignMode()?-1:0,s.value===this.defaultValue&&(l.selected=!0),a.appendChild(this._selectElement,l)}return this._selectElement.onchange=function(){e.internalApplyAriaCurrent(),e.valueChanged()},this.internalApplyAriaCurrent(),this._selectElement},r.prototype.getJsonTypeName=function(){return"Input.ChoiceSet"},r.prototype.focus=function(){this._toggleInputs&&(this.isMultiSelect||"expanded"===this.style)?this._toggleInputs.length>0&&this._toggleInputs[0].focus():this._textInput?this._textInput.focus():n.prototype.focus.call(this)},r.prototype.internalValidateProperties=function(e){n.prototype.internalValidateProperties.call(this,e),0===this.choices.length&&e.addFailure(this,i.ValidationEvent.CollectionCantBeEmpty,p.Strings.errors.choiceSetMustHaveAtLeastOneChoice());for(var t=0,r=this.choices;t<r.length;t++){var o=r[t];o.title&&o.value||e.addFailure(this,i.ValidationEvent.PropertyCantBeNull,p.Strings.errors.choiceSetChoicesMustHaveTitleAndValue())}},r.prototype.isSet=function(){return!!this.value},r.prototype.isValid=function(){if(this._textInput){if(""===this.value||this.value===this.placeholder)return!0;for(var e=0,t=this.choices;e<t.length;e++){var r=t[e];if(this.value===r.value)return!0}return!1}return n.prototype.isValid.call(this)},Object.defineProperty(r.prototype,"value",{get:function(){if(this.isMultiSelect){if(!this._toggleInputs||0===this._toggleInputs.length)return;for(var e="",t=0,n=this._toggleInputs;t<n.length;t++){(l=n[t]).checked&&(""!==e&&(e+=this.hostConfig.choiceSetInputValueSeparator),e+=l.value)}return e||void 0}if(this._selectElement)return this._selectElement.selectedIndex>0?this._selectElement.value:void 0;if(this._textInput){for(var r=0,i=this.choices;r<i.length;r++){var o=i[r];if(o.title&&this._textInput.value===o.title)return o.value}return this._textInput.value}if(this._toggleInputs&&this._toggleInputs.length>0)for(var a=0,s=this._toggleInputs;a<s.length;a++){var l;if((l=s[a]).checked)return l.value}},enumerable:!1,configurable:!0}),r.valueProperty=new u.StringProperty(u.Versions.v1_0,"value"),r.choicesProperty=new u.SerializableObjectCollectionProperty(u.Versions.v1_0,"choices",H),r.styleProperty=new u.ValueSetProperty(u.Versions.v1_0,"style",[{value:"compact"},{value:"expanded"},{value:"filtered",targetVersion:u.Versions.v1_5}],"compact"),r.isMultiSelectProperty=new u.BoolProperty(u.Versions.v1_0,"isMultiSelect",!1),r.placeholderProperty=new u.StringProperty(u.Versions.v1_0,"placeholder"),r.wrapProperty=new u.BoolProperty(u.Versions.v1_2,"wrap",!1),r._uniqueCategoryCounter=0,t([(0,u.property)(r.valueProperty)],r.prototype,"defaultValue",void 0),t([(0,u.property)(r.styleProperty)],r.prototype,"style",void 0),t([(0,u.property)(r.isMultiSelectProperty)],r.prototype,"isMultiSelect",void 0),t([(0,u.property)(r.placeholderProperty)],r.prototype,"placeholder",void 0),t([(0,u.property)(r.wrapProperty)],r.prototype,"wrap",void 0),t([(0,u.property)(r.choicesProperty)],r.prototype,"choices",void 0),r}(V);Zw.ChoiceSetInput=q;var G=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),r.prototype.internalRender=function(){var e=this;return this._numberInputElement=document.createElement("input"),this._numberInputElement.setAttribute("type","number"),void 0!==this.min&&this._numberInputElement.setAttribute("min",this.min.toString()),void 0!==this.max&&this._numberInputElement.setAttribute("max",this.max.toString()),this._numberInputElement.className=this.hostConfig.makeCssClassName("ac-input","ac-numberInput"),this._numberInputElement.style.width="100%",this._numberInputElement.tabIndex=this.isDesignMode()?-1:0,void 0!==this.defaultValue&&(this._numberInputElement.valueAsNumber=this.defaultValue),this.placeholder&&(this._numberInputElement.placeholder=this.placeholder,this._numberInputElement.setAttribute("aria-label",this.placeholder)),this._numberInputElement.oninput=function(){e.valueChanged()},this._numberInputElement},r.prototype.getJsonTypeName=function(){return"Input.Number"},r.prototype.isSet=function(){return void 0!==this.value&&!isNaN(this.value)},r.prototype.isValid=function(){if(void 0===this.value)return!this.isRequired;var e=!0;return void 0!==this.min&&(e=e&&this.value>=this.min),void 0!==this.max&&(e=e&&this.value<=this.max),e},Object.defineProperty(r.prototype,"value",{get:function(){return this._numberInputElement?this._numberInputElement.valueAsNumber:void 0},set:function(e){e&&this._numberInputElement&&(this._numberInputElement.value=e.toString())},enumerable:!1,configurable:!0}),r.valueProperty=new u.NumProperty(u.Versions.v1_0,"value"),r.placeholderProperty=new u.StringProperty(u.Versions.v1_0,"placeholder"),r.minProperty=new u.NumProperty(u.Versions.v1_0,"min"),r.maxProperty=new u.NumProperty(u.Versions.v1_0,"max"),t([(0,u.property)(r.valueProperty)],r.prototype,"defaultValue",void 0),t([(0,u.property)(r.minProperty)],r.prototype,"min",void 0),t([(0,u.property)(r.maxProperty)],r.prototype,"max",void 0),t([(0,u.property)(r.placeholderProperty)],r.prototype,"placeholder",void 0),r}(V);Zw.NumberInput=G;var z=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),r.prototype.internalRender=function(){var e=this;return this._dateInputElement=document.createElement("input"),this._dateInputElement.setAttribute("type","date"),this.min&&this._dateInputElement.setAttribute("min",this.min),this.max&&this._dateInputElement.setAttribute("max",this.max),this.placeholder&&(this._dateInputElement.placeholder=this.placeholder,this._dateInputElement.setAttribute("aria-label",this.placeholder)),this._dateInputElement.tabIndex=this.isDesignMode()?-1:0,this._dateInputElement.className=this.hostConfig.makeCssClassName("ac-input","ac-dateInput"),this._dateInputElement.style.width="100%",this._dateInputElement.oninput=function(){e.valueChanged()},this.defaultValue&&(this._dateInputElement.value=this.defaultValue),this._dateInputElement},r.prototype.getJsonTypeName=function(){return"Input.Date"},r.prototype.isSet=function(){return!!this.value},r.prototype.isValid=function(){if(!this.value)return!this.isRequired;var e=new Date(this.value),t=!0;if(this.min){var n=new Date(this.min);t=t&&e>=n}if(this.max){var r=new Date(this.max);t=t&&e<=r}return t},Object.defineProperty(r.prototype,"value",{get:function(){return this._dateInputElement?this._dateInputElement.value:void 0},enumerable:!1,configurable:!0}),r.valueProperty=new u.StringProperty(u.Versions.v1_0,"value"),r.placeholderProperty=new u.StringProperty(u.Versions.v1_0,"placeholder"),r.minProperty=new u.StringProperty(u.Versions.v1_0,"min"),r.maxProperty=new u.StringProperty(u.Versions.v1_0,"max"),t([(0,u.property)(r.valueProperty)],r.prototype,"defaultValue",void 0),t([(0,u.property)(r.minProperty)],r.prototype,"min",void 0),t([(0,u.property)(r.maxProperty)],r.prototype,"max",void 0),t([(0,u.property)(r.placeholderProperty)],r.prototype,"placeholder",void 0),r}(V);Zw.DateInput=z;var U=function(t){function n(e,n){var r=t.call(this,e,n,function(e,t,n,r){var i=n[t.name];if("string"==typeof i&&i&&/^[0-9]{2}:[0-9]{2}$/.test(i))return i},function(e,t,n,r,i){i.serializeValue(n,t.name,r)})||this;return r.targetVersion=e,r.name=n,r}return e(n,t),n}(u.CustomProperty);Zw.TimeProperty=U;var W=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),r.convertTimeStringToDate=function(e){return new Date("1973-09-04T"+e+":00Z")},r.prototype.internalRender=function(){var e=this;return this._timeInputElement=document.createElement("input"),this._timeInputElement.setAttribute("type","time"),this.min&&this._timeInputElement.setAttribute("min",this.min),this.max&&this._timeInputElement.setAttribute("max",this.max),this._timeInputElement.className=this.hostConfig.makeCssClassName("ac-input","ac-timeInput"),this._timeInputElement.style.width="100%",this._timeInputElement.oninput=function(){e.valueChanged()},this.placeholder&&(this._timeInputElement.placeholder=this.placeholder,this._timeInputElement.setAttribute("aria-label",this.placeholder)),this._timeInputElement.tabIndex=this.isDesignMode()?-1:0,this.defaultValue&&(this._timeInputElement.value=this.defaultValue),this._timeInputElement},r.prototype.getJsonTypeName=function(){return"Input.Time"},r.prototype.isSet=function(){return!!this.value},r.prototype.isValid=function(){if(!this.value)return!this.isRequired;var e=r.convertTimeStringToDate(this.value),t=!0;if(this.min){var n=r.convertTimeStringToDate(this.min);t=t&&e>=n}if(this.max){var i=r.convertTimeStringToDate(this.max);t=t&&e<=i}return t},Object.defineProperty(r.prototype,"value",{get:function(){return this._timeInputElement?this._timeInputElement.value:void 0},enumerable:!1,configurable:!0}),r.valueProperty=new U(u.Versions.v1_0,"value"),r.placeholderProperty=new u.StringProperty(u.Versions.v1_0,"placeholder"),r.minProperty=new U(u.Versions.v1_0,"min"),r.maxProperty=new U(u.Versions.v1_0,"max"),t([(0,u.property)(r.valueProperty)],r.prototype,"defaultValue",void 0),t([(0,u.property)(r.minProperty)],r.prototype,"min",void 0),t([(0,u.property)(r.maxProperty)],r.prototype,"max",void 0),t([(0,u.property)(r.placeholderProperty)],r.prototype,"placeholder",void 0),r}(V);Zw.TimeInput=W;var Q=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.style=i.ActionStyle.Default,e.mode=i.ActionMode.Primary,e._state=0,e._isFocusable=!0,e}return e(r,n),r.prototype.renderButtonContent=function(){if(this.renderedElement){var e=this.hostConfig,t=document.createElement("div");if(t.style.overflow="hidden",t.style.textOverflow="ellipsis",e.actions.iconPlacement===i.ActionIconPlacement.AboveTitle||e.actions.allowTitleToWrap||(t.style.whiteSpace="nowrap"),this.title&&(t.innerText=this.title),this.iconUrl){var n=document.createElement("img");n.src=this.iconUrl,n.style.width=e.actions.iconSize+"px",n.style.height=e.actions.iconSize+"px",n.style.flex="0 0 auto",e.actions.iconPlacement===i.ActionIconPlacement.AboveTitle?(this.renderedElement.classList.add("iconAbove"),this.renderedElement.style.flexDirection="column",this.title&&(n.style.marginBottom="6px")):(this.renderedElement.classList.add("iconLeft"),n.style.maxHeight="100%",this.title&&(n.style.marginRight="6px")),this.renderedElement.appendChild(n),this.renderedElement.appendChild(t)}else this.renderedElement.classList.add("noIcon"),this.renderedElement.appendChild(t)}},r.prototype.getParentContainer=function(){return this.parent instanceof de?this.parent:this.parent?this.parent.getParentContainer():void 0},r.prototype.isDesignMode=function(){var e=this.getRootObject();return e instanceof g&&e.isDesignMode()},r.prototype.updateCssClasses=function(){var e,t;if(this.parent&&this.renderedElement){var n=this.parent.hostConfig;this.renderedElement.className=n.makeCssClassName(this.isEffectivelyEnabled()?"ac-pushButton":"ac-pushButton-disabled");var r=this.getParentContainer();if(r){var o=r.getEffectiveStyle();o&&this.renderedElement.classList.add("style-"+o)}switch(this.renderedElement.tabIndex=!this.isDesignMode()&&this.isFocusable?0:-1,this._state){case 0:break;case 1:this.renderedElement.classList.add(n.makeCssClassName("expanded"));break;case 2:this.renderedElement.classList.add(n.makeCssClassName("subdued"))}this.style&&this.isEffectivelyEnabled()&&(this.style===i.ActionStyle.Positive?(e=this.renderedElement.classList).add.apply(e,n.makeCssClassNames("primary","style-positive")):(t=this.renderedElement.classList).add.apply(t,n.makeCssClassNames("style-"+this.style.toLowerCase())))}},r.prototype.getDefaultSerializationContext=function(){return new Me},r.prototype.internalGetReferencedInputs=function(){return{}},r.prototype.internalPrepareForExecution=function(e){},r.prototype.internalValidateInputs=function(e){var t=[];if(e)for(var n=0,r=Object.keys(e);n<r.length;n++){var i=e[r[n]];i.validateValue()||t.push(i)}return t},r.prototype.shouldSerialize=function(e){return void 0!==e.actionRegistry.findByName(this.getJsonTypeName())},r.prototype.raiseExecuteActionEvent=function(){var e,t,n;this.onExecute&&this.onExecute(this),t=(e=this).parent?e.parent.getRootElement():void 0,n=t&&t.onExecuteAction?t.onExecuteAction:Ce.onExecuteAction,e.prepareForExecution()&&n&&n(e)},r.prototype.internalAfterExecute=function(){var e=this.getRootObject();e instanceof g&&e.updateActionsEnabledState()},r.prototype.getHref=function(){return""},r.prototype.getAriaRole=function(){return"button"},r.prototype.setupElementForAccessibility=function(e,t){if(void 0===t&&(t=!1),e.tabIndex=this.isEffectivelyEnabled()&&!this.isDesignMode()?0:-1,e.setAttribute("role",this.getAriaRole()),e instanceof HTMLButtonElement&&(e.disabled=!this.isEffectivelyEnabled()),this.isEffectivelyEnabled()?(e.removeAttribute("aria-disabled"),e.classList.add(this.hostConfig.makeCssClassName("ac-selectable"))):e.setAttribute("aria-disabled","true"),this.title?(e.setAttribute("aria-label",this.title),e.title=this.title):(e.removeAttribute("aria-label"),e.removeAttribute("title")),this.tooltip){var n=t?this.title?"aria-description":"aria-label":"aria-description";e.setAttribute(n,this.tooltip),e.title=this.tooltip}},r.prototype.parse=function(e,t){return n.prototype.parse.call(this,e,t||new Me)},r.prototype.render=function(){var e=this,t=document.createElement("button");t.type="button",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.onclick=function(t){e.isEffectivelyEnabled()&&(t.preventDefault(),t.cancelBubble=!0,e.execute())},this._renderedElement=t,this.renderButtonContent(),this.updateCssClasses(),this.setupElementForAccessibility(t)},r.prototype.execute=function(){this._actionCollection&&this._actionCollection.actionExecuted(this),this.raiseExecuteActionEvent(),this.internalAfterExecute()},r.prototype.prepareForExecution=function(){var e=this.getReferencedInputs(),t=this.internalValidateInputs(e);return t.length>0?(t[0].focus(),!1):(this.internalPrepareForExecution(e),!0)},r.prototype.remove=function(){return!!this._actionCollection&&this._actionCollection.removeAction(this)},r.prototype.getAllInputs=function(e){return[]},r.prototype.getAllActions=function(){return[this]},r.prototype.getResourceInformation=function(){return this.iconUrl?[{url:this.iconUrl,mimeType:"image"}]:[]},r.prototype.getActionById=function(e){return this.id===e?this:void 0},r.prototype.getReferencedInputs=function(){return this.internalGetReferencedInputs()},r.prototype.validateInputs=function(){return this.internalValidateInputs(this.getReferencedInputs())},r.prototype.updateEnabledState=function(){},r.prototype.isEffectivelyEnabled=function(){return this.isEnabled},Object.defineProperty(r.prototype,"isPrimary",{get:function(){return this.style===i.ActionStyle.Positive},set:function(e){e?this.style=i.ActionStyle.Positive:this.style===i.ActionStyle.Positive&&(this.style=i.ActionStyle.Default)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hostConfig",{get:function(){return this.parent?this.parent.hostConfig:s.defaultHostConfig},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"state",{get:function(){return this._state},set:function(e){this._state!==e&&(this._state=e,this.updateCssClasses())},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isFocusable",{get:function(){return this._isFocusable},set:function(e){this._isFocusable!==e&&(this._isFocusable=e,this.updateCssClasses())},enumerable:!1,configurable:!0}),r.titleProperty=new u.StringProperty(u.Versions.v1_0,"title"),r.iconUrlProperty=new u.StringProperty(u.Versions.v1_1,"iconUrl"),r.styleProperty=new u.ValueSetProperty(u.Versions.v1_2,"style",[{value:i.ActionStyle.Default},{value:i.ActionStyle.Positive},{value:i.ActionStyle.Destructive}],i.ActionStyle.Default),r.modeProperty=new u.ValueSetProperty(u.Versions.v1_5,"mode",[{value:i.ActionMode.Primary},{value:i.ActionMode.Secondary}],i.ActionMode.Primary),r.tooltipProperty=new u.StringProperty(u.Versions.v1_5,"tooltip"),r.isEnabledProperty=new u.BoolProperty(u.Versions.v1_5,"isEnabled",!0),t([(0,u.property)(r.titleProperty)],r.prototype,"title",void 0),t([(0,u.property)(r.iconUrlProperty)],r.prototype,"iconUrl",void 0),t([(0,u.property)(r.styleProperty)],r.prototype,"style",void 0),t([(0,u.property)(r.modeProperty)],r.prototype,"mode",void 0),t([(0,u.property)(r.tooltipProperty)],r.prototype,"tooltip",void 0),t([(0,u.property)(r.isEnabledProperty)],r.prototype,"isEnabled",void 0),r}(c.CardObject);Zw.Action=Q;var Z=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.disabledUnlessAssociatedInputsChange=!1,e._isPrepared=!1,e._areReferencedInputsDirty=!1,e}return e(r,n),r.prototype.internalGetReferencedInputs=function(){var e={};if("none"!==this.associatedInputs){for(var t=this.parent,n=[];t;)n.push.apply(n,t.getAllInputs(!1)),t=t.parent;for(var r=0,i=n;r<i.length;r++){var o=i[r];o.id&&(e[o.id]=o)}}return e},r.prototype.internalPrepareForExecution=function(e){if(this._originalData?this._processedData=JSON.parse(JSON.stringify(this._originalData)):this._processedData={},this._processedData&&e)for(var t=0,n=Object.keys(e);t<n.length;t++){var r=e[n[t]];r.id&&r.isSet()&&(this._processedData[r.id]="string"==typeof r.value?r.value:r.value.toString())}this._isPrepared=!0},r.prototype.internalAfterExecute=function(){o.GlobalSettings.resetInputsDirtyStateAfterActionExecution&&this.resetReferencedInputsDirtyState()},r.prototype.resetReferencedInputsDirtyState=function(){var e=this.getReferencedInputs();if(this._areReferencedInputsDirty=!1,e)for(var t=0,n=Object.keys(e);t<n.length;t++){e[n[t]].resetDirtyState()}},r.prototype.updateEnabledState=function(){this._areReferencedInputsDirty=!1;var e=this.getReferencedInputs();if(e)for(var t=0,n=Object.keys(e);t<n.length;t++){if(e[n[t]].isDirty()){this._areReferencedInputsDirty=!0;break}}this.updateCssClasses(),this._renderedElement&&this.setupElementForAccessibility(this._renderedElement)},r.prototype.isEffectivelyEnabled=function(){var e=n.prototype.isEffectivelyEnabled.call(this);return this.disabledUnlessAssociatedInputsChange?e&&this._areReferencedInputsDirty:e},Object.defineProperty(r.prototype,"data",{get:function(){return this._isPrepared?this._processedData:this._originalData},set:function(e){this._originalData=e,this._isPrepared=!1},enumerable:!1,configurable:!0}),r.dataProperty=new u.PropertyDefinition(u.Versions.v1_0,"data"),r.associatedInputsProperty=new u.CustomProperty(u.Versions.v1_3,"associatedInputs",function(e,t,n,r){var i=n[t.name];if(void 0!==i&&"string"==typeof i)return"none"===i.toLowerCase()?"none":"auto"},function(e,t,n,r,i){i.serializeValue(n,t.name,r)}),r.disabledUnlessAssociatedInputsChangeProperty=new u.BoolProperty(u.Versions.v1_6,"disabledUnlessAssociatedInputsChange",!1),t([(0,u.property)(r.dataProperty)],r.prototype,"_originalData",void 0),t([(0,u.property)(r.associatedInputsProperty)],r.prototype,"associatedInputs",void 0),t([(0,u.property)(r.disabledUnlessAssociatedInputsChangeProperty)],r.prototype,"disabledUnlessAssociatedInputsChange",void 0),r}(Q);Zw.SubmitActionBase=Z;var J=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getJsonTypeName=function(){return n.JsonTypeName},n.JsonTypeName="Action.Submit",n}(Z);Zw.SubmitAction=J;var K=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),r.prototype.getJsonTypeName=function(){return r.JsonTypeName},r.JsonTypeName="Action.Execute",r.verbProperty=new u.StringProperty(u.Versions.v1_4,"verb"),t([(0,u.property)(r.verbProperty)],r.prototype,"verb",void 0),r}(Z);Zw.ExecuteAction=K;var X=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),r.prototype.getJsonTypeName=function(){return r.JsonTypeName},r.prototype.getAriaRole=function(){return"link"},r.prototype.internalValidateProperties=function(e){n.prototype.internalValidateProperties.call(this,e),this.url||e.addFailure(this,i.ValidationEvent.PropertyCantBeNull,p.Strings.errors.propertyMustBeSet("url"))},r.prototype.getHref=function(){return this.url},r.urlProperty=new u.StringProperty(u.Versions.v1_0,"url"),r.JsonTypeName="Action.OpenUrl",t([(0,u.property)(r.urlProperty)],r.prototype,"url",void 0),r}(Q);Zw.OpenUrlAction=X;var $=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.targetElements={},e}return e(r,n),r.prototype.updateAriaControlsAttribute=function(){if(this.targetElements){var e=Object.keys(this.targetElements);this._renderedElement&&(e.length>0?this._renderedElement.setAttribute("aria-controls",e.join(" ")):this._renderedElement.removeAttribute("aria-controls"))}},r.prototype.internalValidateProperties=function(e){n.prototype.internalValidateProperties.call(this,e),this.targetElements||e.addFailure(this,i.ValidationEvent.PropertyCantBeNull,p.Strings.errors.propertyMustBeSet("targetElements"))},r.prototype.getJsonTypeName=function(){return r.JsonTypeName},r.prototype.render=function(){n.prototype.render.call(this),this.updateAriaControlsAttribute()},r.prototype.execute=function(){if(n.prototype.execute.call(this),this.parent)for(var e=0,t=Object.keys(this.targetElements);e<t.length;e++){var r=t[e],i=this.parent.getRootElement().getElementById(r);i&&("boolean"==typeof this.targetElements[r]?i.isVisible=this.targetElements[r]:i.isVisible=!i.isVisible)}},r.prototype.addTargetElement=function(e,t){void 0===t&&(t=void 0),this.targetElements[e]=t,this.updateAriaControlsAttribute()},r.prototype.removeTargetElement=function(e){delete this.targetElements[e],this.updateAriaControlsAttribute()},r.targetElementsProperty=new u.CustomProperty(u.Versions.v1_2,"targetElements",function(e,t,n,r){var i={};if(Array.isArray(n[t.name]))for(var o=0,s=n[t.name];o<s.length;o++){var l=s[o];if("string"==typeof l)i[l]=void 0;else if("object"==typeof l){var c=l.elementId;"string"==typeof c&&(i[c]=a.parseBool(l.isVisible))}}return i},function(e,t,n,r,i){for(var o=[],a=0,s=Object.keys(r);a<s.length;a++){var l=s[a];"boolean"==typeof r[l]?o.push({elementId:l,isVisible:r[l]}):o.push(l)}i.serializeArray(n,t.name,o)},{},function(e){return{}}),r.JsonTypeName="Action.ToggleVisibility",t([(0,u.property)(r.targetElementsProperty)],r.prototype,"targetElements",void 0),r}(Q);Zw.ToggleVisibilityAction=$;var ee=function(t){function n(e,n){var r=t.call(this,e,n,void 0,function(){return new o.StringWithSubstitutions})||this;return r.targetVersion=e,r.name=n,r}return e(n,t),n.prototype.parse=function(e,t,n){var r=new o.StringWithSubstitutions;return r.set(a.parseString(t[this.name])),r},n.prototype.toJSON=function(e,t,n,r){r.serializeValue(t,this.name,n.getOriginal())},n}(u.PropertyDefinition),te=function(n){function r(e,t){void 0===e&&(e=""),void 0===t&&(t="");var r=n.call(this)||this;return r.name=e,r.value=t,r}return e(r,n),r.prototype.getSchemaKey=function(){return"HttpHeader"},r.prototype.getReferencedInputs=function(e,t){this._value.getReferencedInputs(e,t)},r.prototype.prepareForExecution=function(e){this._value.substituteInputValues(e,o.ContentTypes.applicationXWwwFormUrlencoded)},Object.defineProperty(r.prototype,"value",{get:function(){return this._value.get()},set:function(e){this._value.set(e)},enumerable:!1,configurable:!0}),r.nameProperty=new u.StringProperty(u.Versions.v1_0,"name"),r.valueProperty=new ee(u.Versions.v1_0,"value"),t([(0,u.property)(r.nameProperty)],r.prototype,"name",void 0),t([(0,u.property)(r.valueProperty)],r.prototype,"_value",void 0),r}(u.SerializableObject);Zw.HttpHeader=te;var ne=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e._ignoreInputValidation=!1,e}return e(r,n),r.prototype.internalGetReferencedInputs=function(){var e=this.parent?this.parent.getRootElement().getAllInputs():[],t={};this._url.getReferencedInputs(e,t);for(var n=0,r=this.headers;n<r.length;n++){r[n].getReferencedInputs(e,t)}return this._body.getReferencedInputs(e,t),t},r.prototype.internalPrepareForExecution=function(e){if(e){this._url.substituteInputValues(e,o.ContentTypes.applicationXWwwFormUrlencoded);for(var t=o.ContentTypes.applicationJson,n=0,r=this.headers;n<r.length;n++){var i=r[n];i.prepareForExecution(e),i.name&&"content-type"===i.name.toLowerCase()&&(t=i.value)}this._body.substituteInputValues(e,t)}},r.prototype.getJsonTypeName=function(){return r.JsonTypeName},r.prototype.internalValidateProperties=function(e){if(n.prototype.internalValidateProperties.call(this,e),this.url||e.addFailure(this,i.ValidationEvent.PropertyCantBeNull,p.Strings.errors.propertyMustBeSet("url")),this.headers.length>0)for(var t=0,r=this.headers;t<r.length;t++){r[t].name||e.addFailure(this,i.ValidationEvent.PropertyCantBeNull,p.Strings.errors.actionHttpHeadersMustHaveNameAndValue())}},Object.defineProperty(r.prototype,"ignoreInputValidation",{get:function(){return this._ignoreInputValidation},set:function(e){this._ignoreInputValidation=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"url",{get:function(){return this._url.get()},set:function(e){this._url.set(e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"body",{get:function(){return this._body.get()},set:function(e){this._body.set(e)},enumerable:!1,configurable:!0}),r.urlProperty=new ee(u.Versions.v1_0,"url"),r.bodyProperty=new ee(u.Versions.v1_0,"body"),r.methodProperty=new u.StringProperty(u.Versions.v1_0,"method"),r.headersProperty=new u.SerializableObjectCollectionProperty(u.Versions.v1_0,"headers",te),r.ignoreInputValidationProperty=new u.BoolProperty(u.Versions.v1_3,"ignoreInputValidation",!1),r.JsonTypeName="Action.Http",t([(0,u.property)(r.urlProperty)],r.prototype,"_url",void 0),t([(0,u.property)(r.bodyProperty)],r.prototype,"_body",void 0),t([(0,u.property)(r.methodProperty)],r.prototype,"method",void 0),t([(0,u.property)(r.headersProperty)],r.prototype,"headers",void 0),t([(0,u.property)(r.ignoreInputValidationProperty)],r.prototype,"_ignoreInputValidation",void 0),r}(Q);Zw.HttpAction=ne;var re=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.card=new _e,e}return e(n,t),n.prototype.updateCssClasses=function(){if(t.prototype.updateCssClasses.call(this),this.renderedElement){var e=this.parent?this.parent.hostConfig:s.defaultHostConfig;this.renderedElement.classList.add(e.makeCssClassName("expandable")),this.renderedElement.setAttribute("aria-expanded",(1===this.state).toString())}},n.prototype.internalParse=function(e,n){t.prototype.internalParse.call(this,e,n);var r=e.card;r?this.card.parse(r,n):n.logParseEvent(this,i.ValidationEvent.PropertyCantBeNull,p.Strings.errors.showCardMustHaveCard())},n.prototype.internalToJSON=function(e,n){t.prototype.internalToJSON.call(this,e,n),this.card&&n.serializeValue(e,"card",this.card.toJSON(n))},n.prototype.raiseExecuteActionEvent=function(){this.hostConfig.actions.showCard.actionMode===i.ShowCardActionMode.Popup&&t.prototype.raiseExecuteActionEvent.call(this)},n.prototype.releaseDOMResources=function(){t.prototype.releaseDOMResources.call(this),this.card.releaseDOMResources()},n.prototype.getJsonTypeName=function(){return n.JsonTypeName},n.prototype.internalValidateProperties=function(e){t.prototype.internalValidateProperties.call(this,e),this.card.internalValidateProperties(e)},n.prototype.setParent=function(e){t.prototype.setParent.call(this,e),this.card.setParent(e)},n.prototype.getAllInputs=function(e){return void 0===e&&(e=!0),this.card.getAllInputs(e)},n.prototype.getAllActions=function(){var e=t.prototype.getAllActions.call(this);return e.push.apply(e,this.card.getAllActions()),e},n.prototype.getResourceInformation=function(){var e=t.prototype.getResourceInformation.call(this);return e.push.apply(e,this.card.getResourceInformation()),e},n.prototype.getActionById=function(e){var n=t.prototype.getActionById.call(this,e);return n||(n=this.card.getActionById(e)),n},n.JsonTypeName="Action.ShowCard",n}(Q);Zw.ShowCardAction=re;var ie=function(t){function n(e){var n=t.call(this)||this;return n._actions=e,n.title=p.Strings.defaults.overflowButtonText(),n}return e(n,t),n.prototype.getActions=function(){return this._actions},n.prototype.getAllActions=function(){var e=t.prototype.getAllActions.call(this);return e.push.apply(e,this._actions),e},n.prototype.getJsonTypeName=function(){return re.JsonTypeName},n.prototype.execute=function(){var e,t,n,r,i,o=this;if((t=this,n=this.renderedElement,r=t.parent?t.parent.getRootElement():void 0,!(void 0!==(i=r&&r.onDisplayOverflowActionMenu?r.onDisplayOverflowActionMenu:Ce.onDisplayOverflowActionMenu)&&i(t.getActions(),n)))&&this.renderedElement){var a=new h.PopupMenu;a.hostConfig=this.hostConfig;for(var s=function(t){var n=new h.MenuItem(t.toString(),null!==(e=l._actions[t].title)&&void 0!==e?e:"");n.isEnabled=l._actions[t].isEnabled,n.onClick=function(){var e=o._actions[t];a.closePopup(!1),e.isEnabled&&e.execute()},a.items.add(n)},l=this,c=0;c<this._actions.length;c++)s(c);a.popup(this.renderedElement)}},n.JsonTypeName="Action.Overflow",n}(Q),oe=function(){function e(e){this._items=[],this._renderedActions=[],this._owner=e}return e.prototype.isActionAllowed=function(e){var t=this._owner.getForbiddenActionTypes();if(t)for(var n=0,r=t;n<r.length;n++){var i=r[n];if(e.constructor===i)return!1}return!0},e.prototype.refreshContainer=function(){if(f(this._actionCardContainer),this._actionCard){this._actionCardContainer.style.marginTop=this.renderedActionCount>0?this._owner.hostConfig.actions.showCard.inlineTopMargin+"px":"0px";var e=this._owner.getEffectivePadding();this._owner.getImmediateSurroundingPadding(e);var t=this._owner.hostConfig.paddingDefinitionToSpacingDefinition(e);this._actionCard&&(this._actionCard.style.paddingLeft=t.left+"px",this._actionCard.style.paddingRight=t.right+"px",this._actionCard.style.marginLeft="-"+t.left+"px",this._actionCard.style.marginRight="-"+t.right+"px",0===t.bottom||this._owner.isDesignMode()||(this._actionCard.style.paddingBottom=t.bottom+"px",this._actionCard.style.marginBottom="-"+t.bottom+"px"),a.appendChild(this._actionCardContainer,this._actionCard))}else this._actionCardContainer.style.marginTop="0px"},e.prototype.layoutChanged=function(){this._owner.getRootElement().updateLayout()},e.prototype.showActionCard=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0),e.card.suppressStyle=t;var r=e.card.renderedElement&&!this._owner.isDesignMode()?e.card.renderedElement:e.card.render();this._actionCard=r,this._expandedAction=e,this.refreshContainer(),n&&(this.layoutChanged(),ge(e,!0))},e.prototype.collapseExpandedAction=function(){for(var e=0,t=this._renderedActions;e<t.length;e++){t[e].state=0}var n=this._expandedAction;this._expandedAction=void 0,this._actionCard=void 0,this.refreshContainer(),n&&(this.layoutChanged(),ge(n,!1))},e.prototype.expandShowCardAction=function(e,t){for(var n=this,r=!1,o=0,a=this._renderedActions;o<a.length;o++){var s=a[o];this._owner.hostConfig.actions.actionsOrientation==i.Orientation.Horizontal&&r&&(s.isFocusable=!1),s!==e?s.state=2:(s.state=1,r=!0,s.renderedElement&&(s.renderedElement.onblur=function(e){for(var t=0,r=n._renderedActions;t<r.length;t++){r[t].isFocusable=!0}}))}this.showActionCard(e,!(this._owner.isAtTheVeryLeft()&&this._owner.isAtTheVeryRight()),t)},e.prototype.releaseDOMResources=function(){for(var e=0,t=this._renderedActions;e<t.length;e++){t[e].releaseDOMResources()}},e.prototype.actionExecuted=function(e){e instanceof re?e===this._expandedAction?this.collapseExpandedAction():this._owner.hostConfig.actions.showCard.actionMode===i.ShowCardActionMode.Inline&&this.expandShowCardAction(e,!0):this.collapseExpandedAction()},e.prototype.parse=function(e,t){if(this.clear(),Array.isArray(e))for(var n=0,r=e;n<r.length;n++){var i=r[n],o=[];this._owner instanceof Ae&&(o=this._owner.getForbiddenActionNames());var a=t.parseAction(this._owner,i,o,!this._owner.isDesignMode());a&&this.addAction(a)}},e.prototype.toJSON=function(e,t,n){n.serializeArray(e,t,this._items)},e.prototype.getActionAt=function(e){return this._items[e]},e.prototype.getActionCount=function(){return this._items.length},e.prototype.getActionById=function(e){for(var t=void 0,n=0,r=this._items;n<r.length;n++){if(t=r[n].getActionById(e))break}return t},e.prototype.validateProperties=function(e){this._owner.hostConfig.actions.maxActions&&this._items.length>this._owner.hostConfig.actions.maxActions&&e.addFailure(this._owner,i.ValidationEvent.TooManyActions,p.Strings.errors.tooManyActions(this._owner.hostConfig.actions.maxActions)),this._items.length>0&&!this._owner.hostConfig.supportsInteractivity&&e.addFailure(this._owner,i.ValidationEvent.InteractivityNotAllowed,p.Strings.errors.interactivityNotAllowed());for(var t=0,n=this._items;t<n.length;t++){var r=n[t];this.isActionAllowed(r)||e.addFailure(this._owner,i.ValidationEvent.ActionTypeNotAllowed,p.Strings.errors.actionTypeNotAllowed(r.getJsonTypeName())),r.internalValidateProperties(e)}},e.prototype.render=function(e){var t=this._owner.hostConfig;if(t.supportsInteractivity){var n=document.createElement("div"),r=t.actions.maxActions?Math.min(t.actions.maxActions,this._items.length):this._items.length;if(this._actionCardContainer=document.createElement("div"),this._renderedActions=[],t.actions.preExpandSingleShowCardAction&&1===r&&this._items[0]instanceof re&&this.isActionAllowed(this._items[0]))this.showActionCard(this._items[0],!0),this._renderedActions.push(this._items[0]);else{var s=document.createElement("div");if(s.className=t.makeCssClassName("ac-actionSet"),s.style.display="flex",e===i.Orientation.Horizontal)if(s.style.flexDirection="row",this._owner.horizontalAlignment&&t.actions.actionAlignment!==i.ActionAlignment.Stretch)switch(this._owner.horizontalAlignment){case i.HorizontalAlignment.Center:s.style.justifyContent="center";break;case i.HorizontalAlignment.Right:s.style.justifyContent="flex-end";break;default:s.style.justifyContent="flex-start"}else switch(t.actions.actionAlignment){case i.ActionAlignment.Center:s.style.justifyContent="center";break;case i.ActionAlignment.Right:s.style.justifyContent="flex-end";break;default:s.style.justifyContent="flex-start"}else if(s.style.flexDirection="column",this._owner.horizontalAlignment&&t.actions.actionAlignment!==i.ActionAlignment.Stretch)switch(this._owner.horizontalAlignment){case i.HorizontalAlignment.Center:s.style.alignItems="center";break;case i.HorizontalAlignment.Right:s.style.alignItems="flex-end";break;default:s.style.alignItems="flex-start"}else switch(t.actions.actionAlignment){case i.ActionAlignment.Center:s.style.alignItems="center";break;case i.ActionAlignment.Right:s.style.alignItems="flex-end";break;case i.ActionAlignment.Stretch:s.style.alignItems="stretch";break;default:s.style.alignItems="flex-start"}var l=this._items.filter(this.isActionAllowed.bind(this)),c=[],u=[];if(this._owner.isDesignMode())c=l;else{l.forEach(function(e){return e.mode===i.ActionMode.Secondary?u.push(e):c.push(e)});var d=c.splice(t.actions.maxActions);o.GlobalSettings.allowMoreThanMaxActionsInOverflowMenu&&u.push.apply(u,d);var p=!0;if(u.length>0){this._overflowAction||(this._overflowAction=new ie(u),this._overflowAction.setParent(this._owner),this._overflowAction._actionCollection=this);var h=this._owner instanceof Ce&&!this._owner.parent;p=!function(e,t){var n=e.parent?e.parent.getRootElement():void 0,r=n&&n.onRenderOverflowActions?n.onRenderOverflowActions:Ce.onRenderOverflowActions;return void 0!==r&&r(e.getActions(),t)}(this._overflowAction,h)}this._overflowAction&&p&&c.push(this._overflowAction)}for(var f=0;f<c.length;f++){var m=c[f];if(m.render(),m.renderedElement&&(t.actions.actionsOrientation===i.Orientation.Horizontal&&t.actions.actionAlignment===i.ActionAlignment.Stretch?m.renderedElement.style.flex="0 1 100%":m.renderedElement.style.flex="0 1 auto",s.appendChild(m.renderedElement),this._renderedActions.push(m),f<c.length-1&&t.actions.buttonSpacing>0)){var g=document.createElement("div");e===i.Orientation.Horizontal?(g.style.flex="0 0 auto",g.style.width=t.actions.buttonSpacing+"px"):g.style.height=t.actions.buttonSpacing+"px",a.appendChild(s,g)}}var y=document.createElement("div");y.style.overflow="hidden",y.appendChild(s),a.appendChild(n,y)}a.appendChild(n,this._actionCardContainer);for(var A=0,v=this._renderedActions;A<v.length;A++){var b=v[A];if(1===b.state){this.expandShowCardAction(b,!1);break}}return this._renderedActions.length>0?n:void 0}},e.prototype.addAction=function(e){if(!e)throw new Error("The action parameter cannot be null.");if(e.parent&&e.parent!==this._owner||!(this._items.indexOf(e)<0))throw new Error(p.Strings.errors.actionAlreadyParented());this._items.push(e),e.parent||e.setParent(this._owner),e._actionCollection=this},e.prototype.removeAction=function(e){this.expandedAction&&this._expandedAction===e&&this.collapseExpandedAction();var t=this._items.indexOf(e);if(t>=0){this._items.splice(t,1),e.setParent(void 0),e._actionCollection=void 0;for(var n=0;n<this._renderedActions.length;n++)if(this._renderedActions[n]===e){this._renderedActions.splice(n,1);break}return!0}return!1},e.prototype.clear=function(){this._items=[],this._renderedActions=[],this._expandedAction=void 0},e.prototype.getAllInputs=function(e){void 0===e&&(e=!0);var t=[];if(e)for(var n=0,r=this._items;n<r.length;n++){var i=r[n];t.push.apply(t,i.getAllInputs())}return t},e.prototype.getResourceInformation=function(){for(var e=[],t=0,n=this._items;t<n.length;t++){var r=n[t];e.push.apply(e,r.getResourceInformation())}return e},Object.defineProperty(e.prototype,"renderedActionCount",{get:function(){return this._renderedActions.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"expandedAction",{get:function(){return this._expandedAction},enumerable:!1,configurable:!0}),e}(),ae=function(n){function r(){var e=n.call(this)||this;return e._actionCollection=new oe(e),e}return e(r,n),r.prototype.internalParse=function(e,t){n.prototype.internalParse.call(this,e,t),this._actionCollection.parse(e.actions,t)},r.prototype.internalToJSON=function(e,t){n.prototype.internalToJSON.call(this,e,t),this._actionCollection.toJSON(e,"actions",t)},r.prototype.internalRender=function(){return this._actionCollection.render(void 0!==this.orientation?this.orientation:this.hostConfig.actions.actionsOrientation)},r.prototype.releaseDOMResources=function(){n.prototype.releaseDOMResources.call(this),this._actionCollection.releaseDOMResources()},r.prototype.isBleedingAtBottom=function(){return 0===this._actionCollection.renderedActionCount?n.prototype.isBleedingAtBottom.call(this):1===this._actionCollection.getActionCount()?void 0!==this._actionCollection.expandedAction&&!this.hostConfig.actions.preExpandSingleShowCardAction:void 0!==this._actionCollection.expandedAction},r.prototype.getJsonTypeName=function(){return"ActionSet"},r.prototype.getActionCount=function(){return this._actionCollection.getActionCount()},r.prototype.getActionAt=function(e){return e>=0&&e<this.getActionCount()?this._actionCollection.getActionAt(e):n.prototype.getActionAt.call(this,e)},r.prototype.getActionById=function(e){var t=this._actionCollection.getActionById(e);return t||n.prototype.getActionById.call(this,e)},r.prototype.getAllActions=function(){for(var e=n.prototype.getAllActions.call(this),t=0;t<this.getActionCount();t++){var r=this.getActionAt(t);r&&e.push(r)}return e},r.prototype.internalValidateProperties=function(e){n.prototype.internalValidateProperties.call(this,e),this._actionCollection.validateProperties(e)},r.prototype.addAction=function(e){this._actionCollection.addAction(e)},r.prototype.getAllInputs=function(e){return void 0===e&&(e=!0),e?this._actionCollection.getAllInputs():[]},r.prototype.getResourceInformation=function(){return this._actionCollection.getResourceInformation()},r.prototype.findDOMNodeOwner=function(e){for(var t=void 0,r=0;r<this.getActionCount();r++){var i=this.getActionAt(r);if(i&&(t=i.findDOMNodeOwner(e)))return t}return n.prototype.findDOMNodeOwner.call(this,e)},Object.defineProperty(r.prototype,"isInteractive",{get:function(){return!0},enumerable:!1,configurable:!0}),r.orientationProperty=new u.EnumProperty(u.Versions.v1_1,"orientation",i.Orientation),t([(0,u.property)(r.orientationProperty)],r.prototype,"orientation",void 0),r}(g);Zw.ActionSet=ae;var se=function(t){function n(e,n,r,o){var a=t.call(this,e,n,[{value:i.ContainerStyle.Default},{value:i.ContainerStyle.Emphasis},{targetVersion:u.Versions.v1_2,value:i.ContainerStyle.Accent},{targetVersion:u.Versions.v1_2,value:i.ContainerStyle.Good},{targetVersion:u.Versions.v1_2,value:i.ContainerStyle.Attention},{targetVersion:u.Versions.v1_2,value:i.ContainerStyle.Warning}],r,o)||this;return a.targetVersion=e,a.name=n,a.defaultValue=r,a.onGetInitialValue=o,a}return e(n,t),n}(u.ValueSetProperty);Zw.ContainerStyleProperty=se;var le=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),Object.defineProperty(r.prototype,"style",{get:function(){if(this.allowCustomStyle){var e=this.getValue(r.styleProperty);if(e&&this.hostConfig.containerStyles.getStyleByName(e))return e}},set:function(e){this.setValue(r.styleProperty,e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"allowCustomStyle",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hasExplicitStyle",{get:function(){return void 0!==this.getValue(r.styleProperty)},enumerable:!1,configurable:!0}),r.prototype.applyBorder=function(){},r.prototype.applyBackground=function(){if(this.renderedElement){var e=this.hostConfig.containerStyles.getStyleByName(this.style,this.hostConfig.containerStyles.getStyleByName(this.defaultStyle));if(e.backgroundColor){var t=a.stringToCssColor(e.backgroundColor);t&&(this.renderedElement.style.backgroundColor=t)}}},r.prototype.applyPadding=function(){if(n.prototype.applyPadding.call(this),this.renderedElement){var e=new o.SpacingDefinition;if(this.getEffectivePadding()&&(e=this.hostConfig.paddingDefinitionToSpacingDefinition(this.getEffectivePadding())),this.renderedElement.style.paddingTop=e.top+"px",this.renderedElement.style.paddingRight=e.right+"px",this.renderedElement.style.paddingBottom=e.bottom+"px",this.renderedElement.style.paddingLeft=e.left+"px",this.isBleeding()){var t=new o.PaddingDefinition;this.getImmediateSurroundingPadding(t);var r=this.hostConfig.paddingDefinitionToSpacingDefinition(t);this.renderedElement.style.marginRight="-"+r.right+"px",this.renderedElement.style.marginLeft="-"+r.left+"px",this.isDesignMode()||(this.renderedElement.style.marginTop="-"+r.top+"px",this.renderedElement.style.marginBottom="-"+r.bottom+"px"),this.separatorElement&&this.separatorOrientation===i.Orientation.Horizontal&&(this.separatorElement.style.marginLeft="-"+r.left+"px",this.separatorElement.style.marginRight="-"+r.right+"px")}else this.renderedElement.style.marginRight="0",this.renderedElement.style.marginLeft="0",this.renderedElement.style.marginTop="0",this.renderedElement.style.marginBottom="0",this.separatorElement&&this.separatorOrientation===i.Orientation.Horizontal&&(this.separatorElement.style.marginRight="0",this.separatorElement.style.marginLeft="0")}},r.prototype.getHasBackground=function(e){void 0===e&&(e=!1);for(var t=this.parent;t;){var n=!1;if(n=!e&&(t instanceof de&&t.backgroundImage.isValid()),t instanceof r&&this.hasExplicitStyle&&(t.getEffectiveStyle()!==this.getEffectiveStyle()||n))return!0;t=t.parent}return!1},r.prototype.getDefaultPadding=function(){return this.getHasBackground()||this.getHasBorder()?new o.PaddingDefinition(i.Spacing.Padding,i.Spacing.Padding,i.Spacing.Padding,i.Spacing.Padding):n.prototype.getDefaultPadding.call(this)},r.prototype.internalValidateProperties=function(e){n.prototype.internalValidateProperties.call(this,e);var t=this.getValue(r.styleProperty);void 0!==t&&(this.hostConfig.containerStyles.getStyleByName(t)||e.addFailure(this,i.ValidationEvent.InvalidPropertyValue,p.Strings.errors.invalidPropertyValue(t,"style")))},r.prototype.render=function(){var e=n.prototype.render.call(this);return e&&this.getHasBackground()&&this.applyBackground(),this.applyBorder(),e},r.prototype.getEffectiveStyle=function(){var e=this.style;return e||n.prototype.getEffectiveStyle.call(this)},r.styleProperty=new se(u.Versions.v1_0,"style"),t([(0,u.property)(r.styleProperty)],r.prototype,"style",null),r}(M);Zw.StylableCardElementContainer=le;var ce=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e._bleed=!1,e}return e(r,n),r.prototype.adjustRenderedElementSize=function(e){n.prototype.adjustRenderedElementSize.call(this,e),this.minPixelHeight&&(e.style.minHeight=this.minPixelHeight+"px")},r.prototype.getHasExpandedAction=function(){return!1},r.prototype.getBleed=function(){return this._bleed},r.prototype.setBleed=function(e){this._bleed=e},Object.defineProperty(r.prototype,"renderedActionCount",{get:function(){return 0},enumerable:!1,configurable:!0}),r.prototype.isBleeding=function(){return(this.getHasBackground()||this.hostConfig.alwaysAllowBleed)&&this.getBleed()},r.bleedProperty=new u.BoolProperty(u.Versions.v1_2,"bleed",!1),r.minHeightProperty=new u.PixelSizeProperty(u.Versions.v1_2,"minHeight"),t([(0,u.property)(r.bleedProperty)],r.prototype,"_bleed",void 0),t([(0,u.property)(r.minHeightProperty)],r.prototype,"minPixelHeight",void 0),r}(le);Zw.ContainerBase=ce;var ue=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),r.prototype.getSchemaKey=function(){return"BackgroundImage"},r.prototype.internalParse=function(e,t){if("string"!=typeof e)return n.prototype.internalParse.call(this,e,t);this.resetDefaultValues(),this.url=e},r.prototype.apply=function(e){if(this.url&&e.renderedElement){switch(e.renderedElement.style.backgroundImage="url('"+e.preProcessPropertyValue(r.urlProperty,this.url)+"')",this.fillMode){case i.FillMode.Repeat:e.renderedElement.style.backgroundRepeat="repeat";break;case i.FillMode.RepeatHorizontally:e.renderedElement.style.backgroundRepeat="repeat-x";break;case i.FillMode.RepeatVertically:e.renderedElement.style.backgroundRepeat="repeat-y";break;case i.FillMode.Cover:default:e.renderedElement.style.backgroundRepeat="no-repeat",e.renderedElement.style.backgroundSize="cover"}switch(this.horizontalAlignment){case i.HorizontalAlignment.Left:break;case i.HorizontalAlignment.Center:e.renderedElement.style.backgroundPositionX="center";break;case i.HorizontalAlignment.Right:e.renderedElement.style.backgroundPositionX="right"}switch(this.verticalAlignment){case i.VerticalAlignment.Top:break;case i.VerticalAlignment.Center:e.renderedElement.style.backgroundPositionY="center";break;case i.VerticalAlignment.Bottom:e.renderedElement.style.backgroundPositionY="bottom"}}},r.prototype.isValid=function(){return!!this.url},r.urlProperty=new u.StringProperty(u.Versions.v1_0,"url"),r.fillModeProperty=new u.EnumProperty(u.Versions.v1_2,"fillMode",i.FillMode,i.FillMode.Cover),r.horizontalAlignmentProperty=new u.EnumProperty(u.Versions.v1_2,"horizontalAlignment",i.HorizontalAlignment,i.HorizontalAlignment.Left),r.verticalAlignmentProperty=new u.EnumProperty(u.Versions.v1_2,"verticalAlignment",i.VerticalAlignment,i.VerticalAlignment.Top),t([(0,u.property)(r.urlProperty)],r.prototype,"url",void 0),t([(0,u.property)(r.fillModeProperty)],r.prototype,"fillMode",void 0),t([(0,u.property)(r.horizontalAlignmentProperty)],r.prototype,"horizontalAlignment",void 0),t([(0,u.property)(r.verticalAlignmentProperty)],r.prototype,"verticalAlignment",void 0),r}(u.SerializableObject);Zw.BackgroundImage=ue;var de=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e._items=[],e._renderedItems=[],e}return e(r,n),Object.defineProperty(r.prototype,"backgroundImage",{get:function(){return this.getValue(r.backgroundImageProperty)},enumerable:!1,configurable:!0}),r.prototype.insertItemAt=function(e,t,n){if(e.parent&&!n)throw new Error(p.Strings.errors.elementAlreadyParented());if(!e.isStandalone)throw new Error(p.Strings.errors.elementTypeNotStandalone(e.getJsonTypeName()));t<0||t>=this._items.length?this._items.push(e):this._items.splice(t,0,e),e.setParent(this)},r.prototype.getItemsCollectionPropertyName=function(){return"items"},r.prototype.applyBackground=function(){this.backgroundImage.isValid()&&this.renderedElement&&this.backgroundImage.apply(this),n.prototype.applyBackground.call(this)},r.prototype.applyRTL=function(e){void 0!==this.rtl&&(e.dir=this.rtl?"rtl":"ltr")},r.prototype.internalRender=function(){this._renderedItems=[];var e=this.hostConfig,t=document.createElement("div");switch(this.applyRTL(t),t.classList.add(e.makeCssClassName("ac-container")),t.style.display="flex",t.style.flexDirection="column",o.GlobalSettings.useAdvancedCardBottomTruncation&&(t.style.minHeight="-webkit-min-content"),this.getEffectiveVerticalContentAlignment()){case i.VerticalAlignment.Center:t.style.justifyContent="center";break;case i.VerticalAlignment.Bottom:t.style.justifyContent="flex-end";break;default:t.style.justifyContent="flex-start"}if(this._items.length>0)for(var n=0,r=this._items;n<r.length;n++){var s=r[n],l=this.isElementAllowed(s)?s.render():void 0;l&&(this._renderedItems.length>0&&s.separatorElement&&(s.separatorElement.style.flex="0 0 auto",a.appendChild(t,s.separatorElement)),a.appendChild(t,l),this._renderedItems.push(s))}else if(this.isDesignMode()){var c=this.createPlaceholderElement();c.style.width="100%",c.style.height="100%",t.appendChild(c)}return t},r.prototype.truncateOverflow=function(e){if(this.renderedElement){for(var t=this.renderedElement.offsetTop+e+1,n=function(e){var r=e.renderedElement;if(r)switch(a.getFitStatus(r,t)){case i.ContainerFitStatus.FullyInContainer:e.resetOverflow()&&n(e);break;case i.ContainerFitStatus.Overflowing:var o=t-r.offsetTop;e.handleOverflow(o);break;case i.ContainerFitStatus.FullyOutOfContainer:e.handleOverflow(0)}},r=0,o=this._items;r<o.length;r++){var s=o[r];n(s)}return!0}return!1},r.prototype.undoOverflowTruncation=function(){for(var e=0,t=this._items;e<t.length;e++){t[e].resetOverflow()}},r.prototype.getHasBackground=function(e){return void 0===e&&(e=!1),!e&&this.backgroundImage.isValid()||n.prototype.getHasBackground.call(this,e)},r.prototype.canHostSingletons=function(){return!1},r.prototype.internalParse=function(e,t){n.prototype.internalParse.call(this,e,t),this.clear(),this.setShouldFallback(!1);var r=e[this.getItemsCollectionPropertyName()];if(!Array.isArray(r)&&"object"==typeof r&&this.canHostSingletons()){var i=a.parseString(r.type);if(i){var o=t.elementRegistry.findByName(i);if((null==o?void 0:o.singletonBehavior)!==d.ElementSingletonBehavior.NotAllowed)(c=t.parseElement(this,r,[],!this.isDesignMode(),!0))&&this.insertItemAt(c,-1,!0)}}else if(Array.isArray(r))for(var s=0,l=r;s<l.length;s++){var c,u=l[s];(c=t.parseElement(this,u,this.forbiddenChildElements(),!this.isDesignMode()))&&this.insertItemAt(c,-1,!0)}},r.prototype.internalToJSON=function(e,t){n.prototype.internalToJSON.call(this,e,t);var r=this.getItemsCollectionPropertyName();1===this._items.length&&this._items[0].getElementSingletonBehavior()===d.ElementSingletonBehavior.Only?t.serializeValue(e,r,this._items[0].toJSON(t)):t.serializeArray(e,r,this._items)},Object.defineProperty(r.prototype,"isSelectable",{get:function(){return!0},enumerable:!1,configurable:!0}),r.prototype.getEffectivePadding=function(){return o.GlobalSettings.removePaddingFromContainersWithBackgroundImage&&!this.getHasBackground(!0)?new o.PaddingDefinition:n.prototype.getEffectivePadding.call(this)},r.prototype.getEffectiveVerticalContentAlignment=function(){if(void 0!==this.verticalContentAlignment)return this.verticalContentAlignment;var e=this.getParentContainer();return e?e.getEffectiveVerticalContentAlignment():i.VerticalAlignment.Top},r.prototype.getItemCount=function(){return this._items.length},r.prototype.getItemAt=function(e){return this._items[e]},r.prototype.getFirstVisibleRenderedItem=function(){if(this.renderedElement&&this._renderedItems&&this._renderedItems.length>0)for(var e=0,t=this._renderedItems;e<t.length;e++){var n=t[e];if(n.isVisible)return n}},r.prototype.getLastVisibleRenderedItem=function(){if(this.renderedElement&&this._renderedItems&&this._renderedItems.length>0)for(var e=this._renderedItems.length-1;e>=0;e--)if(this._renderedItems[e].isVisible)return this._renderedItems[e]},r.prototype.getJsonTypeName=function(){return"Container"},r.prototype.isFirstElement=function(e){for(var t=this.isDesignMode(),n=0,r=this._items;n<r.length;n++){var i=r[n];if(i.isVisible||t)return i===e}return!1},r.prototype.isLastElement=function(e){for(var t=this.isDesignMode(),n=this._items.length-1;n>=0;n--)if(this._items[n].isVisible||t)return this._items[n]===e;return!1},r.prototype.isRtl=function(){if(void 0!==this.rtl)return this.rtl;var e=this.getParentContainer();return!!e&&e.isRtl()},r.prototype.isBleedingAtTop=function(){var e=this.getFirstVisibleRenderedItem();return this.isBleeding()||!!e&&e.isBleedingAtTop()},r.prototype.isBleedingAtBottom=function(){var e=this.getLastVisibleRenderedItem();return this.isBleeding()||!!e&&(e.isBleedingAtBottom()&&e.getEffectiveStyle()===this.getEffectiveStyle())},r.prototype.indexOf=function(e){return this._items.indexOf(e)},r.prototype.addItem=function(e){this.insertItemAt(e,-1,!1)},r.prototype.insertItemBefore=function(e,t){this.insertItemAt(e,this._items.indexOf(t),!1)},r.prototype.insertItemAfter=function(e,t){this.insertItemAt(e,this._items.indexOf(t)+1,!1)},r.prototype.removeItem=function(e){var t=this._items.indexOf(e);return t>=0&&(this._items.splice(t,1),e.setParent(void 0),this.updateLayout(),!0)},r.prototype.clear=function(){this._items=[],this._renderedItems=[]},r.prototype.getResourceInformation=function(){var e=n.prototype.getResourceInformation.call(this);return this.backgroundImage.isValid()&&e.push({url:this.backgroundImage.url,mimeType:"image"}),e},r.prototype.getActionById=function(e){var t=n.prototype.getActionById.call(this,e);if(!t&&(this.selectAction&&(t=this.selectAction.getActionById(e)),!t))for(var r=0,i=this._items;r<i.length;r++){if(t=i[r].getActionById(e))break}return t},Object.defineProperty(r.prototype,"padding",{get:function(){return this.getPadding()},set:function(e){this.setPadding(e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"selectAction",{get:function(){return this._selectAction},set:function(e){this._selectAction=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bleed",{get:function(){return this.getBleed()},set:function(e){this.setBleed(e)},enumerable:!1,configurable:!0}),r.backgroundImageProperty=new u.SerializableObjectProperty(u.Versions.v1_0,"backgroundImage",ue),r.verticalContentAlignmentProperty=new u.EnumProperty(u.Versions.v1_1,"verticalContentAlignment",i.VerticalAlignment),r.rtlProperty=new u.BoolProperty(u.Versions.v1_0,"rtl"),t([(0,u.property)(r.backgroundImageProperty)],r.prototype,"backgroundImage",null),t([(0,u.property)(r.verticalContentAlignmentProperty)],r.prototype,"verticalContentAlignment",void 0),t([(0,u.property)(r.rtlProperty)],r.prototype,"rtl",void 0),r}(ce);Zw.Container=de;var pe=function(n){function r(e){void 0===e&&(e="stretch");var t=n.call(this)||this;return t.width="stretch",t._computedWeight=0,t.width=e,t}return e(r,n),r.prototype.adjustRenderedElementSize=function(e){this.isDesignMode()?(e.style.minWidth="20px",e.style.minHeight=(this.minPixelHeight?Math.max(this.minPixelHeight,20):20)+"px"):(e.style.minWidth="0",this.minPixelHeight&&(e.style.minHeight=this.minPixelHeight+"px")),"auto"===this.width?e.style.flex="0 1 auto":"stretch"===this.width?e.style.flex="1 1 50px":this.width instanceof o.SizeAndUnit&&(this.width.unit===i.SizeUnit.Pixel?(e.style.flex="0 0 auto",e.style.width=this.width.physicalSize+"px"):e.style.flex="1 1 "+(this._computedWeight>0?this._computedWeight:this.width.physicalSize)+"%")},r.prototype.shouldSerialize=function(e){return!0},Object.defineProperty(r.prototype,"separatorOrientation",{get:function(){return i.Orientation.Vertical},enumerable:!1,configurable:!0}),r.prototype.getJsonTypeName=function(){return"Column"},Object.defineProperty(r.prototype,"hasVisibleSeparator",{get:function(){return!!(this.parent&&this.parent instanceof he)&&(void 0!==this.separatorElement&&!this.parent.isLeftMostElement(this))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isStandalone",{get:function(){return!1},enumerable:!1,configurable:!0}),r.widthProperty=new u.CustomProperty(u.Versions.v1_0,"width",function(e,t,n,r){var a=t.defaultValue,s=n[t.name],l=!1;if("number"!=typeof s||isNaN(s))if("auto"===s||"stretch"===s)a=s;else if("string"==typeof s)try{(a=o.SizeAndUnit.parse(s)).unit===i.SizeUnit.Pixel&&t.targetVersion.compareTo(r.targetVersion)>0&&(l=!0)}catch(e){l=!0}else l=!0;else a=new o.SizeAndUnit(s,i.SizeUnit.Weight);return l&&(r.logParseEvent(e,i.ValidationEvent.InvalidPropertyValue,p.Strings.errors.invalidColumnWidth(s)),a="auto"),a},function(e,t,n,r,a){r instanceof o.SizeAndUnit?r.unit===i.SizeUnit.Pixel?a.serializeValue(n,"width",r.physicalSize+"px"):a.serializeNumber(n,"width",r.physicalSize):a.serializeValue(n,"width",r)},"stretch"),t([(0,u.property)(r.widthProperty)],r.prototype,"width",void 0),r}(de);Zw.Column=pe;var he=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._columns=[],e}return e(n,t),n.prototype.createColumnInstance=function(e,t){return t.parseCardObject(this,e,[],!this.isDesignMode(),function(e){return e&&"Column"!==e?void 0:new pe},function(e,n){t.logParseEvent(void 0,i.ValidationEvent.ElementTypeNotAllowed,p.Strings.errors.elementTypeNotAllowed(e))})},n.prototype.internalRender=function(){if(this._renderedColumns=[],this._columns.length>0){var e=this.hostConfig,t=document.createElement("div");switch(t.className=e.makeCssClassName("ac-columnSet"),t.style.display="flex",o.GlobalSettings.useAdvancedCardBottomTruncation&&(t.style.minHeight="-webkit-min-content"),this.getEffectiveHorizontalAlignment()){case i.HorizontalAlignment.Center:t.style.justifyContent="center";break;case i.HorizontalAlignment.Right:t.style.justifyContent="flex-end";break;default:t.style.justifyContent="flex-start"}for(var n=0,r=0,s=this._columns;r<s.length;r++){(u=s[r]).width instanceof o.SizeAndUnit&&u.width.unit===i.SizeUnit.Weight&&(n+=u.width.physicalSize)}for(var l=0,c=this._columns;l<c.length;l++){var u;if((u=c[l]).width instanceof o.SizeAndUnit&&u.width.unit===i.SizeUnit.Weight&&n>0){var d=100/n*u.width.physicalSize;u._computedWeight=d}var p=u.render();p&&(this._renderedColumns.length>0&&u.separatorElement&&(u.separatorElement.style.flex="0 0 auto",a.appendChild(t,u.separatorElement)),a.appendChild(t,p),this._renderedColumns.push(u))}return this._renderedColumns.length>0?t:void 0}},n.prototype.truncateOverflow=function(e){for(var t=0,n=this._columns;t<n.length;t++){n[t].handleOverflow(e)}return!0},n.prototype.undoOverflowTruncation=function(){for(var e=0,t=this._columns;e<t.length;e++){t[e].resetOverflow()}},Object.defineProperty(n.prototype,"isSelectable",{get:function(){return!0},enumerable:!1,configurable:!0}),n.prototype.internalParse=function(e,n){t.prototype.internalParse.call(this,e,n),this._columns=[],this._renderedColumns=[];var r=e.columns;if(Array.isArray(r))for(var i=0,o=r;i<o.length;i++){var a=o[i],s=this.createColumnInstance(a,n);s&&this._columns.push(s)}},n.prototype.internalToJSON=function(e,n){t.prototype.internalToJSON.call(this,e,n),n.serializeArray(e,"columns",this._columns)},n.prototype.isFirstElement=function(e){for(var t=0,n=this._columns;t<n.length;t++){var r=n[t];if(r.isVisible)return r===e}return!1},n.prototype.isBleedingAtTop=function(){if(this.isBleeding())return!0;if(this._renderedColumns&&this._renderedColumns.length>0)for(var e=0,t=this._columns;e<t.length;e++){if(t[e].isBleedingAtTop())return!0}return!1},n.prototype.isBleedingAtBottom=function(){if(this.isBleeding())return!0;if(this._renderedColumns&&this._renderedColumns.length>0)for(var e=0,t=this._columns;e<t.length;e++){if(t[e].isBleedingAtBottom())return!0}return!1},n.prototype.getItemCount=function(){return this._columns.length},n.prototype.getFirstVisibleRenderedItem=function(){return this.renderedElement&&this._renderedColumns&&this._renderedColumns.length>0?this._renderedColumns[0]:void 0},n.prototype.getLastVisibleRenderedItem=function(){return this.renderedElement&&this._renderedColumns&&this._renderedColumns.length>0?this._renderedColumns[this._renderedColumns.length-1]:void 0},n.prototype.getColumnAt=function(e){return this._columns[e]},n.prototype.getItemAt=function(e){return this.getColumnAt(e)},n.prototype.getJsonTypeName=function(){return"ColumnSet"},n.prototype.internalValidateProperties=function(e){t.prototype.internalValidateProperties.call(this,e);for(var n=0,r=0,o=0,a=this._columns;o<a.length;o++){var s=a[o];"number"==typeof s.width?n++:"stretch"===s.width&&r++}n>0&&r>0&&e.addFailure(this,i.ValidationEvent.Hint,p.Strings.hints.dontUseWeightedAndStrecthedColumnsInSameSet())},n.prototype.addColumn=function(e){if(e.parent)throw new Error(p.Strings.errors.columnAlreadyBelongsToAnotherSet());this._columns.push(e),e.setParent(this)},n.prototype.removeItem=function(e){if(e instanceof pe){var t=this._columns.indexOf(e);if(t>=0)return this._columns.splice(t,1),e.setParent(void 0),this.updateLayout(),!0}return!1},n.prototype.indexOf=function(e){return e instanceof pe?this._columns.indexOf(e):-1},n.prototype.isLeftMostElement=function(e){return 0===this._columns.indexOf(e)},n.prototype.isRightMostElement=function(e){return this._columns.indexOf(e)===this._columns.length-1},n.prototype.isTopElement=function(e){return this._columns.indexOf(e)>=0},n.prototype.isBottomElement=function(e){return this._columns.indexOf(e)>=0},n.prototype.getActionById=function(e){for(var t=void 0,n=0,r=this._columns;n<r.length;n++){if(t=r[n].getActionById(e))break}return t},Object.defineProperty(n.prototype,"bleed",{get:function(){return this.getBleed()},set:function(e){this.setBleed(e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"padding",{get:function(){return this.getPadding()},set:function(e){this.setPadding(e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selectAction",{get:function(){return this._selectAction},set:function(e){this._selectAction=e},enumerable:!1,configurable:!0}),n}(ce);function fe(e){var t=e.getRootElement(),n=t&&t.onImageLoaded?t.onImageLoaded:Ce.onImageLoaded;n&&n(e)}function me(e,t,n){var r=e.getRootElement(),i=r&&r.onAnchorClicked?r.onAnchorClicked:Ce.onAnchorClicked;return void 0!==i&&i(e,t,n)}function ge(e,t){var n=e.parent?e.parent.getRootElement():void 0,r=n&&n.onInlineCardExpanded?n.onInlineCardExpanded:Ce.onInlineCardExpanded;r&&r(e,t)}function ye(e,t){void 0===t&&(t=!0);var n=e.getRootElement();t&&n.updateLayout();var r=n,i=r&&r.onElementVisibilityChanged?r.onElementVisibilityChanged:Ce.onElementVisibilityChanged;void 0!==i&&i(e)}Zw.ColumnSet=he;var Ae=function(t){function n(){var e=t.call(this)||this;return e._actionCollection=new oe(e),e}return e(n,t),n.prototype.internalParse=function(e,n){t.prototype.internalParse.call(this,e,n),this.parseActions(e,n)},n.prototype.parseActions=function(e,t){this._actionCollection.parse(e.actions,t)},n.prototype.internalToJSON=function(e,n){t.prototype.internalToJSON.call(this,e,n),this._actionCollection.toJSON(e,"actions",n)},n.prototype.internalRender=function(){var e=t.prototype.internalRender.call(this);if(e){var n=this._actionCollection.render(this.hostConfig.actions.actionsOrientation);return n&&(a.appendChild(e,m(this.hostConfig,{spacing:this.hostConfig.getEffectiveSpacing(this.hostConfig.actions.spacing)},i.Orientation.Horizontal)),a.appendChild(e,n)),this.renderIfEmpty||e.children.length>0?e:void 0}},n.prototype.getHasExpandedAction=function(){return 0!==this.renderedActionCount&&(1===this.renderedActionCount?void 0!==this._actionCollection.expandedAction&&!this.hostConfig.actions.preExpandSingleShowCardAction:void 0!==this._actionCollection.expandedAction)},Object.defineProperty(n.prototype,"renderedActionCount",{get:function(){return this._actionCollection.renderedActionCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"renderIfEmpty",{get:function(){return!1},enumerable:!1,configurable:!0}),n.prototype.releaseDOMResources=function(){t.prototype.releaseDOMResources.call(this),this._actionCollection.releaseDOMResources()},n.prototype.getActionCount=function(){return this._actionCollection.getActionCount()},n.prototype.getActionAt=function(e){return e>=0&&e<this.getActionCount()?this._actionCollection.getActionAt(e):t.prototype.getActionAt.call(this,e)},n.prototype.getActionById=function(e){var n=this._actionCollection.getActionById(e);return n||t.prototype.getActionById.call(this,e)},n.prototype.internalValidateProperties=function(e){t.prototype.internalValidateProperties.call(this,e),this._actionCollection&&this._actionCollection.validateProperties(e)},n.prototype.isLastElement=function(e){return t.prototype.isLastElement.call(this,e)&&0===this._actionCollection.getActionCount()},n.prototype.addAction=function(e){this._actionCollection.addAction(e)},n.prototype.clear=function(){t.prototype.clear.call(this),this._actionCollection.clear()},n.prototype.getAllInputs=function(e){void 0===e&&(e=!0);var n=t.prototype.getAllInputs.call(this,e);return e&&n.push.apply(n,this._actionCollection.getAllInputs(e)),n},n.prototype.getResourceInformation=function(){var e=t.prototype.getResourceInformation.call(this);return e.push.apply(e,this._actionCollection.getResourceInformation()),e},n.prototype.isBleedingAtBottom=function(){return 0===this._actionCollection.renderedActionCount?t.prototype.isBleedingAtBottom.call(this):1===this._actionCollection.getActionCount()?void 0!==this._actionCollection.expandedAction&&!this.hostConfig.actions.preExpandSingleShowCardAction:void 0!==this._actionCollection.expandedAction},n.prototype.getForbiddenActionNames=function(){return[]},Object.defineProperty(n.prototype,"isStandalone",{get:function(){return!1},enumerable:!1,configurable:!0}),n}(de);Zw.ContainerWithActions=Ae;var ve=function(t){function n(e,n){var r=t.call(this,e,n,void 0)||this;return r.targetVersion=e,r.name=n,r}return e(n,t),n.prototype.parse=function(e,t,n){var r=n.parseAction(e.parent,t[this.name],[],!1);if(void 0!==r){if(r instanceof K)return r;n.logParseEvent(e,i.ValidationEvent.ActionTypeNotAllowed,p.Strings.errors.actionTypeNotAllowed(r.getJsonTypeName()))}n.logParseEvent(e,i.ValidationEvent.PropertyCantBeNull,p.Strings.errors.propertyMustBeSet("action"))},n.prototype.toJSON=function(e,t,n,r){r.serializeValue(t,this.name,n?n.toJSON(r):void 0,void 0,!0)},n}(u.PropertyDefinition);Zw.RefreshActionProperty=ve;var be=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),Object.defineProperty(r.prototype,"action",{get:function(){return this.getValue(r.actionProperty)},set:function(e){this.setValue(r.actionProperty,e),e&&e.setParent(this.parent)},enumerable:!1,configurable:!0}),r.prototype.getSchemaKey=function(){return"RefreshDefinition"},r.actionProperty=new ve(u.Versions.v1_4,"action"),r.userIdsProperty=new u.StringArrayProperty(u.Versions.v1_4,"userIds"),t([(0,u.property)(r.actionProperty)],r.prototype,"action",null),t([(0,u.property)(r.userIdsProperty)],r.prototype,"userIds",void 0),r}(u.SerializableObject);Zw.RefreshDefinition=be;var we=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),r.prototype.getSchemaKey=function(){return"AuthCardButton"},r.typeProperty=new u.StringProperty(u.Versions.v1_4,"type"),r.titleProperty=new u.StringProperty(u.Versions.v1_4,"title"),r.imageProperty=new u.StringProperty(u.Versions.v1_4,"image"),r.valueProperty=new u.StringProperty(u.Versions.v1_4,"value"),t([(0,u.property)(r.typeProperty)],r.prototype,"type",void 0),t([(0,u.property)(r.titleProperty)],r.prototype,"title",void 0),t([(0,u.property)(r.imageProperty)],r.prototype,"image",void 0),t([(0,u.property)(r.valueProperty)],r.prototype,"value",void 0),r}(u.SerializableObject);Zw.AuthCardButton=we;var Ee=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),r.prototype.getSchemaKey=function(){return"TokenExchangeResource"},r.idProperty=new u.StringProperty(u.Versions.v1_4,"id"),r.uriProperty=new u.StringProperty(u.Versions.v1_4,"uri"),r.providerIdProperty=new u.StringProperty(u.Versions.v1_4,"providerId"),t([(0,u.property)(r.idProperty)],r.prototype,"id",void 0),t([(0,u.property)(r.uriProperty)],r.prototype,"uri",void 0),t([(0,u.property)(r.providerIdProperty)],r.prototype,"providerId",void 0),r}(u.SerializableObject);Zw.TokenExchangeResource=Ee;var ke=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),r.prototype.getSchemaKey=function(){return"Authentication"},r.textProperty=new u.StringProperty(u.Versions.v1_4,"text"),r.connectionNameProperty=new u.StringProperty(u.Versions.v1_4,"connectionName"),r.buttonsProperty=new u.SerializableObjectCollectionProperty(u.Versions.v1_4,"buttons",we),r.tokenExchangeResourceProperty=new u.SerializableObjectProperty(u.Versions.v1_4,"tokenExchangeResource",Ee,!0),t([(0,u.property)(r.textProperty)],r.prototype,"text",void 0),t([(0,u.property)(r.connectionNameProperty)],r.prototype,"connectionName",void 0),t([(0,u.property)(r.buttonsProperty)],r.prototype,"buttons",void 0),t([(0,u.property)(r.tokenExchangeResourceProperty)],r.prototype,"tokenExchangeResource",void 0),r}(u.SerializableObject);Zw.Authentication=ke;var Ce=function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.designMode=!1,e}return e(r,n),Object.defineProperty(r.prototype,"refresh",{get:function(){return this.getValue(r.refreshProperty)},set:function(e){this.setValue(r.refreshProperty,e),e&&(e.parent=this)},enumerable:!1,configurable:!0}),Object.defineProperty(r,"processMarkdown",{get:function(){throw new Error(p.Strings.errors.processMarkdownEventRemoved())},set:function(e){throw new Error(p.Strings.errors.processMarkdownEventRemoved())},enumerable:!1,configurable:!0}),r.applyMarkdown=function(e){var t={didProcess:!1};if(r.onProcessMarkdown)r.onProcessMarkdown(e,t);else if(window.markdownit){var n=window.markdownit;t.outputHtml=n().render(e),t.didProcess=!0}else r._haveWarnedAboutNoMarkdownProcessing||(console.warn(p.Strings.errors.markdownProcessingNotEnabled),r._haveWarnedAboutNoMarkdownProcessing=!0);return t},r.prototype.isVersionSupported=function(){return!!this.bypassVersionCheck||!(!this.version||!this.version.isValid||this.maxVersion.major<this.version.major||this.maxVersion.major===this.version.major&&this.maxVersion.minor<this.version.minor)},r.prototype.getDefaultSerializationContext=function(){return new Me(this.version)},r.prototype.getItemsCollectionPropertyName=function(){return"body"},r.prototype.canHostSingletons=function(){return!0},r.prototype.internalParse=function(e,t){this._fallbackCard=void 0;var i=t.parseElement(void 0,e.fallback,this.forbiddenChildElements(),!this.isDesignMode());i&&(this._fallbackCard=new r,this._fallbackCard.addItem(i)),n.prototype.internalParse.call(this,e,t)},r.prototype.internalToJSON=function(e,t){this.setValue(r.versionProperty,t.targetVersion),n.prototype.internalToJSON.call(this,e,t)},r.prototype.internalRender=function(){var e=n.prototype.internalRender.call(this);return o.GlobalSettings.useAdvancedCardBottomTruncation&&e&&e.style.removeProperty("minHeight"),e},r.prototype.getHasBackground=function(e){return!0},r.prototype.getDefaultPadding=function(){return new o.PaddingDefinition(i.Spacing.Padding,i.Spacing.Padding,i.Spacing.Padding,i.Spacing.Padding)},r.prototype.shouldSerialize=function(e){return!0},Object.defineProperty(r.prototype,"renderIfEmpty",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bypassVersionCheck",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"allowCustomStyle",{get:function(){return this.hostConfig.adaptiveCard&&this.hostConfig.adaptiveCard.allowCustomStyle},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hasBackground",{get:function(){return!0},enumerable:!1,configurable:!0}),r.prototype.getJsonTypeName=function(){return"AdaptiveCard"},r.prototype.internalValidateProperties=function(e){n.prototype.internalValidateProperties.call(this,e),"AdaptiveCard"!==this.getValue(g.typeNameProperty)&&e.addFailure(this,i.ValidationEvent.MissingCardType,p.Strings.errors.invalidCardType()),this.bypassVersionCheck||this.version?this.isVersionSupported()||e.addFailure(this,i.ValidationEvent.UnsupportedCardVersion,p.Strings.errors.unsupportedCardVersion(this.version.toString(),this.maxVersion.toString())):e.addFailure(this,i.ValidationEvent.PropertyCantBeNull,p.Strings.errors.propertyMustBeSet("version"))},r.prototype.render=function(e){var t;return this.shouldFallback()&&this._fallbackCard?(this._fallbackCard.hostConfig=this.hostConfig,t=this._fallbackCard.render()):(t=n.prototype.render.call(this))&&(t.classList.add(this.hostConfig.makeCssClassName("ac-adaptiveCard")),o.GlobalSettings.setTabIndexAtCardRoot&&(t.tabIndex=0),this.speak&&t.setAttribute("aria-label",this.speak)),e&&(a.appendChild(e,t),this.updateLayout()),t},r.prototype.updateLayout=function(e){if(void 0===e&&(e=!0),n.prototype.updateLayout.call(this,e),o.GlobalSettings.useAdvancedCardBottomTruncation&&this.isDisplayed()){var t=this.hostConfig.getEffectiveSpacing(i.Spacing.Default);this.handleOverflow(this.renderedElement.offsetHeight-t)}},r.prototype.shouldFallback=function(){return n.prototype.shouldFallback.call(this)||!this.isVersionSupported()},Object.defineProperty(r.prototype,"hasVisibleSeparator",{get:function(){return!1},enumerable:!1,configurable:!0}),r.schemaUrl="http://adaptivecards.io/schemas/adaptive-card.json",r.$schemaProperty=new u.CustomProperty(u.Versions.v1_0,"$schema",function(e,t,n,i){return r.schemaUrl},function(e,t,n,i,o){o.serializeValue(n,t.name,r.schemaUrl)}),r.versionProperty=new u.CustomProperty(u.Versions.v1_0,"version",function(e,t,n,r){var o=u.Version.parse(n[t.name],r);return void 0===o&&(o=u.Versions.latest,r.logParseEvent(e,i.ValidationEvent.InvalidPropertyValue,p.Strings.errors.invalidCardVersion(o.toString()))),o},function(e,t,n,r,i){void 0!==r&&i.serializeValue(n,t.name,r.toString())},u.Versions.v1_0),r.fallbackTextProperty=new u.StringProperty(u.Versions.v1_0,"fallbackText"),r.speakProperty=new u.StringProperty(u.Versions.v1_0,"speak"),r.refreshProperty=new u.SerializableObjectProperty(u.Versions.v1_4,"refresh",be,!0),r.authenticationProperty=new u.SerializableObjectProperty(u.Versions.v1_4,"authentication",ke,!0),r._haveWarnedAboutNoMarkdownProcessing=!1,t([(0,u.property)(r.versionProperty)],r.prototype,"version",void 0),t([(0,u.property)(r.fallbackTextProperty)],r.prototype,"fallbackText",void 0),t([(0,u.property)(r.speakProperty)],r.prototype,"speak",void 0),t([(0,u.property)(r.refreshProperty)],r.prototype,"refresh",null),t([(0,u.property)(r.authenticationProperty)],r.prototype,"authentication",void 0),r}(Ae);Zw.AdaptiveCard=Ce;var _e=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.suppressStyle=!1,e}return e(n,t),n.prototype.getSchemaKey=function(){return"InlineAdaptiveCard"},n.prototype.populateSchema=function(e){t.prototype.populateSchema.call(this,e),e.remove(Ce.$schemaProperty,Ce.versionProperty)},n.prototype.getDefaultPadding=function(){return new o.PaddingDefinition(this.suppressStyle?i.Spacing.None:i.Spacing.Padding,i.Spacing.Padding,this.suppressStyle?i.Spacing.None:i.Spacing.Padding,i.Spacing.Padding)},Object.defineProperty(n.prototype,"bypassVersionCheck",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"defaultStyle",{get:function(){return this.suppressStyle?i.ContainerStyle.Default:this.hostConfig.actions.showCard.style?this.hostConfig.actions.showCard.style:i.ContainerStyle.Emphasis},enumerable:!1,configurable:!0}),n.prototype.render=function(e){var n=t.prototype.render.call(this,e);return n&&(n.setAttribute("aria-live","polite"),n.removeAttribute("tabindex")),n},n}(Ce),Me=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._forbiddenTypes=new Set,e}return e(n,t),n.prototype.internalParseCardObject=function(e,t,n,r,s,l,c){var u=this;void 0===c&&(c=!1);var d=void 0;if(t&&"object"==typeof t){var p=new Set;this._forbiddenTypes.forEach(function(e){p.add(e)}),n.forEach(function(e){u._forbiddenTypes.add(e)});var h=a.parseString(t.type),f=c&&"Carousel"===h;if(h&&this._forbiddenTypes.has(h)&&!f)l(h,i.TypeErrorType.ForbiddenType);else{var m=!1;if((d=s(h))?(d.setParent(e),d.parse(t,this),m=o.GlobalSettings.enableFallback&&r&&d.shouldFallback()):(m=o.GlobalSettings.enableFallback&&r,l(h,i.TypeErrorType.UnknownType)),m){var g=t.fallback;!g&&e&&e.setShouldFallback(!0),"string"==typeof g&&"drop"===g.toLowerCase()?d=void 0:"object"==typeof g&&(d=this.internalParseCardObject(e,g,n,!0,s,l))}}this._forbiddenTypes=p}return d},n.prototype.cardObjectParsed=function(e,t){e instanceof Q&&this.onParseAction?this.onParseAction(e,t,this):e instanceof g&&this.onParseElement&&this.onParseElement(e,t,this)},n.prototype.shouldSerialize=function(e){return e instanceof Q?void 0!==this.actionRegistry.findByName(e.getJsonTypeName()):!(e instanceof g)||void 0!==this.elementRegistry.findByName(e.getJsonTypeName())},n.prototype.parseCardObject=function(e,t,n,r,i,o,a){void 0===a&&(a=!1);var s=new Set(n),l=this.internalParseCardObject(e,t,s,r,i,o,a);return void 0!==l&&this.cardObjectParsed(l,t),l},n.prototype.parseElement=function(e,t,n,r,o){var a=this;return void 0===o&&(o=!1),this.parseCardObject(e,t,n,r,function(e){return a.elementRegistry.createInstance(e,a.targetVersion)},function(e,t){t===i.TypeErrorType.UnknownType?a.logParseEvent(void 0,i.ValidationEvent.UnknownElementType,p.Strings.errors.unknownElementType(e)):a.logParseEvent(void 0,i.ValidationEvent.ElementTypeNotAllowed,p.Strings.errors.elementTypeNotAllowed(e))},o)},n.prototype.parseAction=function(e,t,n,r){var o=this;return this.parseCardObject(e,t,n,r,function(e){return o.actionRegistry.createInstance(e,o.targetVersion)},function(e,t){t===i.TypeErrorType.UnknownType?o.logParseEvent(void 0,i.ValidationEvent.UnknownActionType,p.Strings.errors.unknownActionType(e)):o.logParseEvent(void 0,i.ValidationEvent.ActionTypeNotAllowed,p.Strings.errors.actionTypeNotAllowed(e))})},Object.defineProperty(n.prototype,"elementRegistry",{get:function(){var e;return null!==(e=this._elementRegistry)&&void 0!==e?e:d.GlobalRegistry.elements},enumerable:!1,configurable:!0}),n.prototype.setElementRegistry=function(e){this._elementRegistry=e},Object.defineProperty(n.prototype,"actionRegistry",{get:function(){var e;return null!==(e=this._actionRegistry)&&void 0!==e?e:d.GlobalRegistry.actions},enumerable:!1,configurable:!0}),n.prototype.setActionRegistry=function(e){this._actionRegistry=e},n}(u.BaseSerializationContext);return Zw.SerializationContext=Me,d.GlobalRegistry.defaultElements.register("Container",de),d.GlobalRegistry.defaultElements.register("TextBlock",v),d.GlobalRegistry.defaultElements.register("RichTextBlock",w,u.Versions.v1_2),d.GlobalRegistry.defaultElements.register("TextRun",b,u.Versions.v1_2),d.GlobalRegistry.defaultElements.register("Image",_),d.GlobalRegistry.defaultElements.register("ImageSet",T),d.GlobalRegistry.defaultElements.register("Media",N,u.Versions.v1_1),d.GlobalRegistry.defaultElements.register("FactSet",k),d.GlobalRegistry.defaultElements.register("ColumnSet",he),d.GlobalRegistry.defaultElements.register("ActionSet",ae,u.Versions.v1_2),d.GlobalRegistry.defaultElements.register("Input.Text",F),d.GlobalRegistry.defaultElements.register("Input.Date",z),d.GlobalRegistry.defaultElements.register("Input.Time",W),d.GlobalRegistry.defaultElements.register("Input.Number",G),d.GlobalRegistry.defaultElements.register("Input.ChoiceSet",q),d.GlobalRegistry.defaultElements.register("Input.Toggle",j),d.GlobalRegistry.defaultActions.register(X.JsonTypeName,X),d.GlobalRegistry.defaultActions.register(J.JsonTypeName,J),d.GlobalRegistry.defaultActions.register(re.JsonTypeName,re),d.GlobalRegistry.defaultActions.register($.JsonTypeName,$,u.Versions.v1_2),d.GlobalRegistry.defaultActions.register(K.JsonTypeName,K,u.Versions.v1_4),Zw}var fE,mE={};var gE,yE={};var AE,vE={};function bE(){return AE||(AE=1,function(e){var t,n=vE&&vE.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.LoginRequestResponse=e.ErrorResponse=e.SuccessResponse=e.ActivityResponse=e.ActivityRequestError=e.ActivityRequestTrigger=void 0,(t=e.ActivityRequestTrigger||(e.ActivityRequestTrigger={})).Automatic="automatic",t.Manual="manual";var r=function(){return function(e,t){this.code=e,this.message=t}}();e.ActivityRequestError=r;var i=function(){return function(e){this.request=e}}();e.ActivityResponse=i;var o=function(e){function t(t,n){var r=e.call(this,t)||this;return r.request=t,r.rawContent=n,r}return n(t,e),t}(i);e.SuccessResponse=o;var a=function(e){function t(t,n){var r=e.call(this,t)||this;return r.request=t,r.error=n,r}return n(t,e),t}(i);e.ErrorResponse=a;var s=function(e){function t(t,n){var r=e.call(this,t)||this;r.request=t,r._auth=n;for(var i=0,o=r._auth.buttons;i<o.length;i++){var a=o[i];if("signin"===a.type&&void 0!==a.value)try{new URL(a.value),r.signinButton=a;break}catch(e){}}return r}return n(t,e),Object.defineProperty(t.prototype,"tokenExchangeResource",{get:function(){return this._auth.tokenExchangeResource},enumerable:!1,configurable:!0}),t}(i);e.LoginRequestResponse=s}(vE)),vE}var wE,EE,kE={};function CE(){if(wE)return kE;wE=1;var e=kE&&kE.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})},t=kE&&kE.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(kE,"__esModule",{value:!0}),kE.AdaptiveApplet=void 0;var n=Mw(),r=Lw(),i=Dw(),o=bE(),a=kw(),s=hE(),l=Rw();function c(e,t){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];if(i.GlobalSettings.applets.logEnabled)if(i.GlobalSettings.applets.onLogEvent)i.GlobalSettings.applets.onLogEvent(e,t,r);else switch(e){case n.LogLevel.Warning:console.warn(t,r);break;case n.LogLevel.Error:console.error(t,r);break;default:console.log(t,r)}}var u=function(){function n(e,t,n){this.action=e,this.trigger=t,this.consecutiveRefreshes=n,this.attemptNumber=0}return n.prototype.retryAsync=function(){return e(this,void 0,void 0,function(){return t(this,function(e){return this.onSend&&this.onSend(this),[2]})})},n}(),d=function(){function d(){this._allowAutomaticCardUpdate=!1,this.renderedElement=document.createElement("div"),this.renderedElement.className="aaf-cardHost",this.renderedElement.style.position="relative",this.renderedElement.style.display="flex",this.renderedElement.style.flexDirection="column",this._cardHostElement=document.createElement("div"),this._refreshButtonHostElement=document.createElement("div"),this._refreshButtonHostElement.className="aaf-refreshButtonHost",this._refreshButtonHostElement.style.display="none",this.renderedElement.appendChild(this._cardHostElement),this.renderedElement.appendChild(this._refreshButtonHostElement)}return d.prototype.displayCard=function(e){if(!e.renderedElement)throw new Error("displayCard: undefined card.");r.clearElementChildren(this._cardHostElement),this._refreshButtonHostElement.style.display="none",this._cardHostElement.appendChild(e.renderedElement)},d.prototype.showManualRefreshButton=function(e){var t=this;if(!this.onShowManualRefreshButton||this.onShowManualRefreshButton(this)){this._refreshButtonHostElement.style.display="none";var c=void 0;if(this.onRenderManualRefreshButton)c=this.onRenderManualRefreshButton(this);else{var u=a.Strings.runtime.refreshThisCard();if(i.GlobalSettings.applets.refresh.mode===n.RefreshMode.Automatic){var d=a.Strings.runtime.automaticRefreshPaused();" "!==d[d.length-1]&&(d+=" "),u=a.Strings.runtime.clckToRestartAutomaticRefresh()}var p={type:"AdaptiveCard",version:"1.2",body:[{type:"RichTextBlock",horizontalAlignment:"right",inlines:[{type:"TextRun",text:u,selectAction:{type:"Action.Submit",id:"refreshCard"}}]}]},h=new s.AdaptiveCard;h.parse(p,new s.SerializationContext(l.Versions.v1_2)),h.onExecuteAction=function(n){"refreshCard"===n.id&&(r.clearElementChildren(t._refreshButtonHostElement),t.internalExecuteAction(e,o.ActivityRequestTrigger.Automatic,0))},c=h.render()}c&&(r.clearElementChildren(this._refreshButtonHostElement),this._refreshButtonHostElement.appendChild(c),this._refreshButtonHostElement.style.removeProperty("display"))}},d.prototype.createActivityRequest=function(e,t,n){var r=this;if(this.card){var i=new u(e,t,n);return i.onSend=function(e){e.attemptNumber++,r.internalSendActivityRequestAsync(i)},!!this.onPrepareActivityRequest&&!this.onPrepareActivityRequest(this,i,e)?void 0:i}throw new Error("createActivityRequest: no card has been set.")},d.prototype.createMagicCodeInputCard=function(e){var t={type:"AdaptiveCard",version:"1.0",body:[{type:"TextBlock",color:"attention",text:1===e?void 0:"That didn't work... let's try again.",wrap:!0,horizontalAlignment:"center"},{type:"TextBlock",text:'Please login in the popup. You will obtain a magic code. Paste that code below and select "Submit"',wrap:!0,horizontalAlignment:"center"},{type:"Input.Text",id:"magicCode",placeholder:"Enter magic code"},{type:"ActionSet",horizontalAlignment:"center",actions:[{type:"Action.Submit",id:d._submitMagicCodeActionId,title:"Submit"},{type:"Action.Submit",id:d._cancelMagicCodeAuthActionId,title:"Cancel"}]}]},n=new s.AdaptiveCard;return n.parse(t),n},d.prototype.cancelAutomaticRefresh=function(){this._allowAutomaticCardUpdate&&c(n.LogLevel.Warning,"Automatic card refresh has been cancelled as a result of the user interacting with the card."),this._allowAutomaticCardUpdate=!1},d.prototype.createSerializationContext=function(){return this.onCreateSerializationContext?this.onCreateSerializationContext(this):new s.SerializationContext},d.prototype.internalSetCard=function(e,t){var r=this;if("object"==typeof e&&"AdaptiveCard"===e.type&&(this._cardPayload=e),this._cardPayload)try{var a=new s.AdaptiveCard;this.hostConfig&&(a.hostConfig=this.hostConfig);var l=this.createSerializationContext();if(a.parse(this._cardPayload,l),(!this.onCardChanging||this.onCardChanging(this,this._cardPayload))&&(this._card=a,this._card.authentication&&this._card.authentication.tokenExchangeResource&&this.onPrefetchSSOToken&&this.onPrefetchSSOToken(this,this._card.authentication.tokenExchangeResource),this._card.onExecuteAction=function(e){r.cancelAutomaticRefresh(),r.internalExecuteAction(e,o.ActivityRequestTrigger.Manual,0)},this._card.onInputValueChanged=function(e){r.cancelAutomaticRefresh()},this._card.render(),this._card.renderedElement&&(this.displayCard(this._card),this.onCardChanged&&this.onCardChanged(this),this._card.refresh)))if(i.GlobalSettings.applets.refresh.mode===n.RefreshMode.Automatic&&t<i.GlobalSettings.applets.refresh.maximumConsecutiveAutomaticRefreshes)if(i.GlobalSettings.applets.refresh.timeBetweenAutomaticRefreshes<=0)c(n.LogLevel.Info,"Triggering automatic card refresh number "+(t+1)),this.internalExecuteAction(this._card.refresh.action,o.ActivityRequestTrigger.Automatic,t+1);else{c(n.LogLevel.Info,"Scheduling automatic card refresh number "+(t+1)+" in "+i.GlobalSettings.applets.refresh.timeBetweenAutomaticRefreshes+"ms");var u=this._card.refresh.action;this._allowAutomaticCardUpdate=!0,window.setTimeout(function(){r._allowAutomaticCardUpdate&&r.internalExecuteAction(u,o.ActivityRequestTrigger.Automatic,t+1)},i.GlobalSettings.applets.refresh.timeBetweenAutomaticRefreshes)}else i.GlobalSettings.applets.refresh.mode!==n.RefreshMode.Disabled&&(c(n.LogLevel.Warning,t>0?"Stopping automatic refreshes after "+t+" consecutive refreshes.":"The card has a refresh section, but automatic refreshes are disabled."),(i.GlobalSettings.applets.refresh.allowManualRefreshesAfterAutomaticRefreshes||i.GlobalSettings.applets.refresh.mode===n.RefreshMode.Manual)&&(c(n.LogLevel.Info,"Showing manual refresh button."),this.showManualRefreshButton(this._card.refresh.action)))}catch(e){c(n.LogLevel.Error,"setCard: "+e)}},d.prototype.internalExecuteAction=function(e,t,n){if(e instanceof s.ExecuteAction){if(!this.channelAdapter)throw new Error("internalExecuteAction: No channel adapter set.");var r=this.createActivityRequest(e,t,n);r&&r.retryAsync()}this.onAction&&this.onAction(this,e)},d.prototype.createProgressOverlay=function(e){if(!this._progressOverlay)if(this.onCreateProgressOverlay)this._progressOverlay=this.onCreateProgressOverlay(this,e);else{this._progressOverlay=document.createElement("div"),this._progressOverlay.className="aaf-progress-overlay";var t=document.createElement("div");t.className="aaf-spinner",t.style.width="28px",t.style.height="28px",this._progressOverlay.appendChild(t)}return this._progressOverlay},d.prototype.removeProgressOverlay=function(e){this.onRemoveProgressOverlay&&this.onRemoveProgressOverlay(this,e),void 0!==this._progressOverlay&&(this.renderedElement.removeChild(this._progressOverlay),this._progressOverlay=void 0)},d.prototype.activityRequestSucceeded=function(e,t){this.onActivityRequestSucceeded&&this.onActivityRequestSucceeded(this,e,t)},d.prototype.activityRequestFailed=function(e){return this.onActivityRequestFailed?this.onActivityRequestFailed(this,e):i.GlobalSettings.applets.defaultTimeBetweenRetryAttempts},d.prototype.showAuthCodeInputDialog=function(e){var t=this;if(!this.onShowAuthCodeInputDialog||this.onShowAuthCodeInputDialog(this,e)){var r=this.createMagicCodeInputCard(e.attemptNumber);r.render(),r.onExecuteAction=function(r){if(t.card&&r instanceof s.SubmitAction)switch(r.id){case d._submitMagicCodeActionId:var i=void 0;r.data&&"string"==typeof r.data.magicCode&&(i=r.data.magicCode),i?(t.displayCard(t.card),e.authCode=i,e.retryAsync()):alert("Please enter the magic code you received.");break;case d._cancelMagicCodeAuthActionId:c(n.LogLevel.Warning,"Authentication cancelled by user."),t.displayCard(t.card);break;default:c(n.LogLevel.Error,"Unexpected action taken from magic code input card (id = "+r.id+")"),alert(a.Strings.magicCodeInputCard.somethingWentWrong())}},this.displayCard(r)}},d.prototype.internalSendActivityRequestAsync=function(r){return e(this,void 0,void 0,function(){var e,s,l,u;return t(this,function(d){switch(d.label){case 0:if(!this.channelAdapter)throw new Error("internalSendActivityRequestAsync: channelAdapter is not set.");void 0!==(e=this.createProgressOverlay(r))&&this.renderedElement.appendChild(e),s=!1,l=function(){var e,l,d,p,h,f,m;return t(this,function(t){switch(t.label){case 0:e=void 0,1===r.attemptNumber?c(n.LogLevel.Info,"Sending activity request to channel (attempt "+r.attemptNumber+")"):c(n.LogLevel.Info,"Re-sending activity request to channel (attempt "+r.attemptNumber+")"),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,u.channelAdapter.sendRequestAsync(r)];case 2:return e=t.sent(),[3,4];case 3:return l=t.sent(),c(n.LogLevel.Error,"Activity request failed: "+l),u.removeProgressOverlay(r),s=!0,[3,4];case 4:if(!e)return[3,10];if(!(e instanceof o.SuccessResponse))return[3,5];if(u.removeProgressOverlay(r),void 0===e.rawContent)throw new Error("internalSendActivityRequestAsync: Action.Execute result is undefined");d=e.rawContent;try{d=JSON.parse(e.rawContent)}catch(e){}if("string"==typeof d)c(n.LogLevel.Info,"The activity request returned a string after "+r.attemptNumber+" attempt(s)."),u.activityRequestSucceeded(e,d);else{if("object"!=typeof d||"AdaptiveCard"!==d.type)throw new Error("internalSendActivityRequestAsync: Action.Execute result is of unsupported type ("+typeof e.rawContent+")");c(n.LogLevel.Info,"The activity request returned an Adaptive Card after "+r.attemptNumber+" attempt(s)."),u.internalSetCard(d,r.consecutiveRefreshes),u.activityRequestSucceeded(e,u.card)}return s=!0,[3,10];case 5:return e instanceof o.ErrorResponse?(p=u.activityRequestFailed(e))>=0&&r.attemptNumber<i.GlobalSettings.applets.maximumRetryAttempts?(c(n.LogLevel.Warning,"Activity request failed: ".concat(e.error.message,". Retrying in ").concat(p,"ms")),r.attemptNumber++,[4,new Promise(function(e,t){window.setTimeout(function(){e()},p)})]):[3,7]:[3,9];case 6:return t.sent(),[3,8];case 7:c(n.LogLevel.Error,"Activity request failed: ".concat(e.error.message,". Giving up after ").concat(r.attemptNumber," attempt(s)")),u.removeProgressOverlay(r),s=!0,t.label=8;case 8:return[3,10];case 9:if(e instanceof o.LoginRequestResponse){if(c(n.LogLevel.Info,"The activity request returned a LoginRequestResponse after "+r.attemptNumber+" attempt(s)."),r.attemptNumber<=i.GlobalSettings.applets.maximumRetryAttempts){if(h=!0,e.tokenExchangeResource&&u.onSSOTokenNeeded&&(h=!u.onSSOTokenNeeded(u,r,e.tokenExchangeResource)),h){if(u.removeProgressOverlay(r),void 0===e.signinButton)throw new Error("internalSendActivityRequestAsync: the login request doesn't contain a valid signin URL.");c(n.LogLevel.Info,"Login required at "+e.signinButton.value),u.onShowSigninPrompt?u.onShowSigninPrompt(u,r,e.signinButton):(u.showAuthCodeInputDialog(r),f=window.screenX+(window.outerWidth-i.GlobalSettings.applets.authPromptWidth)/2,m=window.screenY+(window.outerHeight-i.GlobalSettings.applets.authPromptHeight)/2,window.open(e.signinButton.value,e.signinButton.title?e.signinButton.title:"Sign in","width=".concat(i.GlobalSettings.applets.authPromptWidth,",height=").concat(i.GlobalSettings.applets.authPromptHeight,",left=").concat(f,",top=").concat(m)))}}else c(n.LogLevel.Error,"Authentication failed. Giving up after "+r.attemptNumber+" attempt(s)"),alert(a.Strings.magicCodeInputCard.authenticationFailed());return[2,"break"]}throw new Error("Unhandled response type: "+JSON.stringify(e));case 10:return[2]}})},u=this,d.label=1;case 1:return s?[3,3]:[5,l()];case 2:return"break"===d.sent()?[3,3]:[3,1];case 3:return[2]}})})},d.prototype.refreshCard=function(){this._card&&this._card.refresh&&this.internalExecuteAction(this._card.refresh.action,o.ActivityRequestTrigger.Manual,0)},d.prototype.setCard=function(e){this.internalSetCard(e,0)},Object.defineProperty(d.prototype,"card",{get:function(){return this._card},enumerable:!1,configurable:!0}),d._submitMagicCodeActionId="submitMagicCode",d._cancelMagicCodeAuthActionId="cancelMagicCodeAuth",d}();return kE.AdaptiveApplet=d,kE}var _E,ME=(EE||(EE=1,function(e){var t=ww&&ww.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=ww&&ww.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(kw(),e),n(Mw(),e),n(Dw(),e),n(Lw(),e),n(Rw(),e),n(Nw(),e),n(jw(),e),n(Gw(),e),n(Ww(),e),n(hE(),e),n(function(){if(fE)return mE;fE=1;var e=mE&&mE.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),t=mE&&mE.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};Object.defineProperty(mE,"__esModule",{value:!0}),mE.Table=mE.TableRow=mE.TableCell=mE.StylableContainer=mE.TableColumnDefinition=void 0;var n=hE(),r=Mw(),i=Gw(),o=Rw(),a=Dw(),s=kw(),l=Lw(),c=function(n){function i(){var e=null!==n&&n.apply(this,arguments)||this;return e.width=new a.SizeAndUnit(1,r.SizeUnit.Weight),e}return e(i,n),i.prototype.getSchemaKey=function(){return"ColumnDefinition"},i.horizontalCellContentAlignmentProperty=new o.EnumProperty(o.Versions.v1_5,"horizontalCellContentAlignment",r.HorizontalAlignment),i.verticalCellContentAlignmentProperty=new o.EnumProperty(o.Versions.v1_5,"verticalCellContentAlignment",r.VerticalAlignment),i.widthProperty=new o.CustomProperty(o.Versions.v1_5,"width",function(e,t,n,i){var o=t.defaultValue,l=n[t.name],c=!1;if("number"!=typeof l||isNaN(l))if("string"==typeof l)try{o=a.SizeAndUnit.parse(l)}catch(e){c=!0}else c=!0;else o=new a.SizeAndUnit(l,r.SizeUnit.Weight);return c&&i.logParseEvent(e,r.ValidationEvent.InvalidPropertyValue,s.Strings.errors.invalidColumnWidth(l)),o},function(e,t,n,i,o){i.unit===r.SizeUnit.Pixel?o.serializeValue(n,"width",i.physicalSize+"px"):o.serializeNumber(n,"width",i.physicalSize)},new a.SizeAndUnit(1,r.SizeUnit.Weight)),t([(0,o.property)(i.horizontalCellContentAlignmentProperty)],i.prototype,"horizontalCellContentAlignment",void 0),t([(0,o.property)(i.verticalCellContentAlignmentProperty)],i.prototype,"verticalCellContentAlignment",void 0),t([(0,o.property)(i.widthProperty)],i.prototype,"width",void 0),i}(o.SerializableObject);mE.TableColumnDefinition=c;var u=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._items=[],e}return e(n,t),n.prototype.parseItem=function(e,t){var n=this;return t.parseCardObject(this,e,[],!this.isDesignMode(),function(e){return n.createItemInstance(e)},function(e,n){t.logParseEvent(void 0,r.ValidationEvent.ElementTypeNotAllowed,s.Strings.errors.elementTypeNotAllowed(e))})},n.prototype.internalAddItem=function(e){if(e.parent)throw new Error(s.Strings.errors.elementAlreadyParented());this._items.push(e),e.setParent(this)},n.prototype.internalRemoveItem=function(e){var t=this._items.indexOf(e);return t>=0&&(this._items.splice(t,1),e.setParent(void 0),this.updateLayout(),!0)},n.prototype.internalIndexOf=function(e){return this._items.indexOf(e)},n.prototype.internalParse=function(e,n){t.prototype.internalParse.call(this,e,n),this._items=[];var r=e[this.getCollectionPropertyName()];if(Array.isArray(r))for(var i=0,o=r;i<o.length;i++){var a=o[i],s=this.parseItem(a,n);s&&this._items.push(s)}},n.prototype.internalToJSON=function(e,n){t.prototype.internalToJSON.call(this,e,n),n.serializeArray(e,this.getCollectionPropertyName(),this._items)},n.prototype.removeItem=function(e){return this.internalRemoveItem(e)},n.prototype.getItemCount=function(){return this._items.length},n.prototype.getItemAt=function(e){return this._items[e]},n.prototype.getFirstVisibleRenderedItem=function(){return this.getItemCount()>0?this.getItemAt(0):void 0},n.prototype.getLastVisibleRenderedItem=function(){return this.getItemCount()>0?this.getItemAt(this.getItemCount()-1):void 0},n}(n.StylableCardElementContainer);mE.StylableContainer=u;var d=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._columnIndex=-1,e._cellType="data",e}return e(n,t),n.prototype.getHasBorder=function(){return this.parentRow.parentTable.showGridLines},n.prototype.applyBorder=function(){if(this.renderedElement&&this.getHasBorder()){var e=this.hostConfig.containerStyles.getStyleByName(this.parentRow.parentTable.gridStyle);if(e.borderColor){var t=(0,l.stringToCssColor)(e.borderColor);t&&(this.renderedElement.style.borderRight="1px solid "+t,this.renderedElement.style.borderBottom="1px solid "+t)}}},n.prototype.getDefaultPadding=function(){return this.getHasBackground()||this.getHasBorder()?new a.PaddingDefinition(r.Spacing.Small,r.Spacing.Small,r.Spacing.Small,r.Spacing.Small):t.prototype.getDefaultPadding.call(this)},n.prototype.internalRender=function(){var e=t.prototype.internalRender.call(this);return e&&(e.setAttribute("role","data"===this.cellType?"cell":"columnheader"),e.style.minWidth="0","header"===this.cellType&&e.setAttribute("scope","col")),e},n.prototype.shouldSerialize=function(e){return!0},n.prototype.getJsonTypeName=function(){return"TableCell"},n.prototype.getEffectiveTextStyleDefinition=function(){return"header"===this.cellType?this.hostConfig.textStyles.columnHeader:t.prototype.getEffectiveTextStyleDefinition.call(this)},n.prototype.getEffectiveHorizontalAlignment=function(){if(void 0!==this.horizontalAlignment)return this.horizontalAlignment;if(void 0!==this.parentRow.horizontalCellContentAlignment)return this.parentRow.horizontalCellContentAlignment;if(this.columnIndex>=0){var e=this.parentRow.parentTable.getColumnAt(this.columnIndex).horizontalCellContentAlignment;if(void 0!==e)return e}return void 0!==this.parentRow.parentTable.horizontalCellContentAlignment?this.parentRow.parentTable.horizontalCellContentAlignment:t.prototype.getEffectiveHorizontalAlignment.call(this)},n.prototype.getEffectiveVerticalContentAlignment=function(){if(void 0!==this.verticalContentAlignment)return this.verticalContentAlignment;if(void 0!==this.parentRow.verticalCellContentAlignment)return this.parentRow.verticalCellContentAlignment;if(this.columnIndex>=0){var e=this.parentRow.parentTable.getColumnAt(this.columnIndex).verticalCellContentAlignment;if(void 0!==e)return e}return void 0!==this.parentRow.parentTable.verticalCellContentAlignment?this.parentRow.parentTable.verticalCellContentAlignment:t.prototype.getEffectiveVerticalContentAlignment.call(this)},Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this._columnIndex},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cellType",{get:function(){return this._cellType},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentRow",{get:function(){return this.parent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isStandalone",{get:function(){return!1},enumerable:!1,configurable:!0}),n}(n.Container);mE.TableCell=d;var p=function(i){function s(){return null!==i&&i.apply(this,arguments)||this}return e(s,i),s.prototype.getDefaultPadding=function(){return new a.PaddingDefinition(r.Spacing.None,r.Spacing.None,r.Spacing.None,r.Spacing.None)},s.prototype.applyBackground=function(){if(this.renderedElement){var e=this.hostConfig.containerStyles.getStyleByName(this.style,this.hostConfig.containerStyles.getStyleByName(this.defaultStyle));if(e.backgroundColor){var t=(0,l.stringToCssColor)(e.backgroundColor);t&&(this.renderedElement.style.backgroundColor=t)}}},s.prototype.getCollectionPropertyName=function(){return"cells"},s.prototype.createItemInstance=function(e){return e&&"TableCell"!==e?void 0:new d},s.prototype.internalRender=function(){var e=this.getIsFirstRow(),t=this.hostConfig.table.cellSpacing,n=document.createElement("div");n.setAttribute("role","row"),n.style.display="flex",n.style.flexDirection="row";for(var i=0;i<Math.min(this.getItemCount(),this.parentTable.getColumnCount());i++){var o=this.getItemAt(i);o._columnIndex=i,o._cellType=this.parentTable.firstRowAsHeaders&&e?"header":"data";var a=o.render();if(a){var s=this.parentTable.getColumnAt(i);s.computedWidth.unit===r.SizeUnit.Pixel?a.style.flex="0 0 "+s.computedWidth.physicalSize+"px":a.style.flex="1 1 "+s.computedWidth.physicalSize+"%",i>0&&!this.parentTable.showGridLines&&t>0&&(a.style.marginLeft=t+"px"),n.appendChild(a)}}return n.children.length>0?n:void 0},s.prototype.shouldSerialize=function(e){return!0},s.prototype.addCell=function(e){this.internalAddItem(e)},s.prototype.removeCellAt=function(e){return e>=0&&e<this.getItemCount()&&this.removeItem(this.getItemAt(e))},s.prototype.indexOf=function(e){return e instanceof d?this.internalIndexOf(e):-1},s.prototype.ensureHasEnoughCells=function(e){for(;this.getItemCount()<e;)this.addCell(new d)},s.prototype.getJsonTypeName=function(){return"TableRow"},s.prototype.getIsFirstRow=function(){return this.parentTable.getItemAt(0)===this},Object.defineProperty(s.prototype,"parentTable",{get:function(){return this.parent},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"isStandalone",{get:function(){return!1},enumerable:!1,configurable:!0}),s.styleProperty=new n.ContainerStyleProperty(o.Versions.v1_5,"style"),s.horizontalCellContentAlignmentProperty=new o.EnumProperty(o.Versions.v1_5,"horizontalCellContentAlignment",r.HorizontalAlignment),s.verticalCellContentAlignmentProperty=new o.EnumProperty(o.Versions.v1_5,"verticalCellContentAlignment",r.VerticalAlignment),t([(0,o.property)(s.horizontalCellContentAlignmentProperty)],s.prototype,"horizontalCellContentAlignment",void 0),t([(0,o.property)(s.verticalCellContentAlignmentProperty)],s.prototype,"verticalCellContentAlignment",void 0),s}(u);mE.TableRow=p;var h=function(i){function s(){var e=null!==i&&i.apply(this,arguments)||this;return e._columns=[],e.firstRowAsHeaders=!0,e.showGridLines=!0,e}return e(s,i),Object.defineProperty(s.prototype,"gridStyle",{get:function(){var e=this.getValue(s.gridStyleProperty);if(e&&this.hostConfig.containerStyles.getStyleByName(e))return e},set:function(e){this.setValue(s.gridStyleProperty,e)},enumerable:!1,configurable:!0}),s.prototype.ensureRowsHaveEnoughCells=function(){for(var e=0;e<this.getItemCount();e++)this.getItemAt(e).ensureHasEnoughCells(this.getColumnCount())},s.prototype.removeCellsFromColumn=function(e){for(var t=0;t<this.getItemCount();t++)this.getItemAt(t).removeCellAt(e)},s.prototype.getCollectionPropertyName=function(){return"rows"},s.prototype.createItemInstance=function(e){return e&&"TableRow"!==e?void 0:new p},s.prototype.internalParse=function(e,t){i.prototype.internalParse.call(this,e,t),this.ensureRowsHaveEnoughCells()},s.prototype.internalRender=function(){if(this.getItemCount()>0){for(var e=0,t=0,n=this._columns;t<n.length;t++)(s=n[t]).width.unit===r.SizeUnit.Weight&&(e+=s.width.physicalSize);for(var i=0,o=this._columns;i<o.length;i++){var s;(s=o[i]).width.unit===r.SizeUnit.Pixel?s.computedWidth=new a.SizeAndUnit(s.width.physicalSize,r.SizeUnit.Pixel):s.computedWidth=new a.SizeAndUnit(100/e*s.width.physicalSize,r.SizeUnit.Weight)}var c=document.createElement("div");if(c.setAttribute("role","table"),c.style.display="flex",c.style.flexDirection="column",this.showGridLines){var u=this.hostConfig.containerStyles.getStyleByName(this.gridStyle);if(u.borderColor){var d=(0,l.stringToCssColor)(u.borderColor);d&&(c.style.borderTop="1px solid "+d,c.style.borderLeft="1px solid "+d)}}for(var p=this.hostConfig.table.cellSpacing,h=0;h<this.getItemCount();h++){var f=this.getItemAt(h).render();if(f){if(h>0&&!this.showGridLines&&p>0){var m=document.createElement("div");m.setAttribute("aria-hidden","true"),m.style.height=p+"px",c.appendChild(m)}c.appendChild(f)}}return c}},s.prototype.addColumn=function(e){this._columns.push(e),this.ensureRowsHaveEnoughCells()},s.prototype.removeColumn=function(e){var t=this._columns.indexOf(e);t>=0&&(this.removeCellsFromColumn(t),this._columns.splice(t,1))},s.prototype.getColumnCount=function(){return this._columns.length},s.prototype.getColumnAt=function(e){return this._columns[e]},s.prototype.addRow=function(e){this.internalAddItem(e),e.ensureHasEnoughCells(this.getColumnCount())},s.prototype.indexOf=function(e){return e instanceof p?this.internalIndexOf(e):-1},s.prototype.getJsonTypeName=function(){return"Table"},s._columnsProperty=new o.SerializableObjectCollectionProperty(o.Versions.v1_5,"columns",c),s.firstRowAsHeadersProperty=new o.BoolProperty(o.Versions.v1_5,"firstRowAsHeaders",!0),s.showGridLinesProperty=new o.BoolProperty(o.Versions.v1_5,"showGridLines",!0),s.gridStyleProperty=new n.ContainerStyleProperty(o.Versions.v1_5,"gridStyle"),s.horizontalCellContentAlignmentProperty=new o.EnumProperty(o.Versions.v1_5,"horizontalCellContentAlignment",r.HorizontalAlignment),s.verticalCellContentAlignmentProperty=new o.EnumProperty(o.Versions.v1_5,"verticalCellContentAlignment",r.VerticalAlignment),t([(0,o.property)(s._columnsProperty)],s.prototype,"_columns",void 0),t([(0,o.property)(s.firstRowAsHeadersProperty)],s.prototype,"firstRowAsHeaders",void 0),t([(0,o.property)(s.showGridLinesProperty)],s.prototype,"showGridLines",void 0),t([(0,o.property)(s.gridStyleProperty)],s.prototype,"gridStyle",null),t([(0,o.property)(s.horizontalCellContentAlignmentProperty)],s.prototype,"horizontalCellContentAlignment",void 0),t([(0,o.property)(s.verticalCellContentAlignmentProperty)],s.prototype,"verticalCellContentAlignment",void 0),s}(u);return mE.Table=h,i.GlobalRegistry.defaultElements.register("Table",h,o.Versions.v1_5),mE}(),e),n(function(){if(gE)return yE;gE=1,Object.defineProperty(yE,"__esModule",{value:!0}),yE.ChannelAdapter=void 0;var e=function(){return function(){}}();return yE.ChannelAdapter=e,yE}(),e),n(bE(),e),n(CE(),e)}(ww)),ww);function TE(e){return(_E=_E||document.createElement("textarea")).innerHTML="&"+e+";",_E.value}var SE=Object.prototype.hasOwnProperty;function DE(e){return[].slice.call(arguments,1).forEach(function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}var xE=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function IE(e){return e.indexOf("\\")<0?e:e.replace(xE,"$1")}function LE(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(!!(65535&~e&&65534!=(65535&e))&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function PE(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var OE=/&([a-z#][a-z0-9]{1,31});/gi,RE=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;function BE(e,t){var n=0,r=TE(t);return t!==r?r:35===t.charCodeAt(0)&&RE.test(t)&&LE(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?PE(n):e}function YE(e){return e.indexOf("&")<0?e:e.replace(OE,BE)}var NE=/[&<>"]/,VE=/[&<>"]/g,FE={"&":"&","<":"<",">":">",'"':"""};function jE(e){return FE[e]}function HE(e){return NE.test(e)?e.replace(VE,jE):e}var qE={};function GE(e,t){return++t>=e.length-2?t:"paragraph_open"===e[t].type&&e[t].tight&&"inline"===e[t+1].type&&0===e[t+1].content.length&&"paragraph_close"===e[t+2].type&&e[t+2].tight?GE(e,t+2):t}qE.blockquote_open=function(){return"<blockquote>\n"},qE.blockquote_close=function(e,t){return"</blockquote>"+zE(e,t)},qE.code=function(e,t){return e[t].block?"<pre><code>"+HE(e[t].content)+"</code></pre>"+zE(e,t):"<code>"+HE(e[t].content)+"</code>"},qE.fence=function(e,t,n,r,i){var o,a,s,l,c=e[t],u="",d=n.langPrefix;if(c.params){if(a=(o=c.params.split(/\s+/g)).join(" "),s=i.rules.fence_custom,l=o[0],s&&SE.call(s,l))return i.rules.fence_custom[o[0]](e,t,n,r,i);u=' class="'+d+HE(YE(IE(a)))+'"'}return"<pre><code"+u+">"+(n.highlight&&n.highlight.apply(n.highlight,[c.content].concat(o))||HE(c.content))+"</code></pre>"+zE(e,t)},qE.fence_custom={},qE.heading_open=function(e,t){return"<h"+e[t].hLevel+">"},qE.heading_close=function(e,t){return"</h"+e[t].hLevel+">\n"},qE.hr=function(e,t,n){return(n.xhtmlOut?"<hr />":"<hr>")+zE(e,t)},qE.bullet_list_open=function(){return"<ul>\n"},qE.bullet_list_close=function(e,t){return"</ul>"+zE(e,t)},qE.list_item_open=function(){return"<li>"},qE.list_item_close=function(){return"</li>\n"},qE.ordered_list_open=function(e,t){var n=e[t];return"<ol"+(n.order>1?' start="'+n.order+'"':"")+">\n"},qE.ordered_list_close=function(e,t){return"</ol>"+zE(e,t)},qE.paragraph_open=function(e,t){return e[t].tight?"":"<p>"},qE.paragraph_close=function(e,t){var n=!(e[t].tight&&t&&"inline"===e[t-1].type&&!e[t-1].content);return(e[t].tight?"":"</p>")+(n?zE(e,t):"")},qE.link_open=function(e,t,n){var r=e[t].title?' title="'+HE(YE(e[t].title))+'"':"",i=n.linkTarget?' target="'+n.linkTarget+'"':"";return'<a href="'+HE(e[t].href)+'"'+r+i+">"},qE.link_close=function(){return"</a>"},qE.image=function(e,t,n){var r=' src="'+HE(e[t].src)+'"',i=e[t].title?' title="'+HE(YE(e[t].title))+'"':"";return"<img"+r+(' alt="'+(e[t].alt?HE(YE(IE(e[t].alt))):"")+'"')+i+(n.xhtmlOut?" /":"")+">"},qE.table_open=function(){return"<table>\n"},qE.table_close=function(){return"</table>\n"},qE.thead_open=function(){return"<thead>\n"},qE.thead_close=function(){return"</thead>\n"},qE.tbody_open=function(){return"<tbody>\n"},qE.tbody_close=function(){return"</tbody>\n"},qE.tr_open=function(){return"<tr>"},qE.tr_close=function(){return"</tr>\n"},qE.th_open=function(e,t){var n=e[t];return"<th"+(n.align?' style="text-align:'+n.align+'"':"")+">"},qE.th_close=function(){return"</th>"},qE.td_open=function(e,t){var n=e[t];return"<td"+(n.align?' style="text-align:'+n.align+'"':"")+">"},qE.td_close=function(){return"</td>"},qE.strong_open=function(){return"<strong>"},qE.strong_close=function(){return"</strong>"},qE.em_open=function(){return"<em>"},qE.em_close=function(){return"</em>"},qE.del_open=function(){return"<del>"},qE.del_close=function(){return"</del>"},qE.ins_open=function(){return"<ins>"},qE.ins_close=function(){return"</ins>"},qE.mark_open=function(){return"<mark>"},qE.mark_close=function(){return"</mark>"},qE.sub=function(e,t){return"<sub>"+HE(e[t].content)+"</sub>"},qE.sup=function(e,t){return"<sup>"+HE(e[t].content)+"</sup>"},qE.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},qE.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},qE.text=function(e,t){return HE(e[t].content)},qE.htmlblock=function(e,t){return e[t].content},qE.htmltag=function(e,t){return e[t].content},qE.abbr_open=function(e,t){return'<abbr title="'+HE(YE(e[t].title))+'">'},qE.abbr_close=function(){return"</abbr>"},qE.footnote_ref=function(e,t){var n=Number(e[t].id+1).toString(),r="fnref"+n;return e[t].subId>0&&(r+=":"+e[t].subId),'<sup class="footnote-ref"><a href="#fn'+n+'" id="'+r+'">['+n+"]</a></sup>"},qE.footnote_block_open=function(e,t,n){return(n.xhtmlOut?'<hr class="footnotes-sep" />\n':'<hr class="footnotes-sep">\n')+'<section class="footnotes">\n<ol class="footnotes-list">\n'},qE.footnote_block_close=function(){return"</ol>\n</section>\n"},qE.footnote_open=function(e,t){return'<li id="fn'+Number(e[t].id+1).toString()+'" class="footnote-item">'},qE.footnote_close=function(){return"</li>\n"},qE.footnote_anchor=function(e,t){var n="fnref"+Number(e[t].id+1).toString();return e[t].subId>0&&(n+=":"+e[t].subId),' <a href="#'+n+'" class="footnote-backref">↩</a>'},qE.dl_open=function(){return"<dl>\n"},qE.dt_open=function(){return"<dt>"},qE.dd_open=function(){return"<dd>"},qE.dl_close=function(){return"</dl>\n"},qE.dt_close=function(){return"</dt>\n"},qE.dd_close=function(){return"</dd>\n"};var zE=qE.getBreak=function(e,t){return(t=GE(e,t))<e.length&&"list_item_close"===e[t].type?"":"\n"};function UE(){this.rules=DE({},qE),this.getBreak=qE.getBreak}function WE(){this.__rules__=[],this.__cache__=null}function QE(e,t,n,r,i){this.src=e,this.env=r,this.options=n,this.parser=t,this.tokens=i,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.isInLabel=!1,this.linkLevel=0,this.linkContent="",this.labelUnmatchedScopes=0}function ZE(e,t){var n,r,i,o=-1,a=e.posMax,s=e.pos,l=e.isInLabel;if(e.isInLabel)return-1;if(e.labelUnmatchedScopes)return e.labelUnmatchedScopes--,-1;for(e.pos=t+1,e.isInLabel=!0,n=1;e.pos<a;){if(91===(i=e.src.charCodeAt(e.pos)))n++;else if(93===i&&0===--n){r=!0;break}e.parser.skipToken(e)}return r?(o=e.pos,e.labelUnmatchedScopes=0):e.labelUnmatchedScopes=n-1,e.pos=s,e.isInLabel=l,o}function JE(e,t,n,r){var i,o,a,s,l,c;if(42!==e.charCodeAt(0))return-1;if(91!==e.charCodeAt(1))return-1;if(-1===e.indexOf("]:"))return-1;if((o=ZE(i=new QE(e,t,n,r,[]),1))<0||58!==e.charCodeAt(o+1))return-1;for(s=i.posMax,a=o+2;a<s&&10!==i.src.charCodeAt(a);a++);return l=e.slice(2,o),0===(c=e.slice(o+2,a).trim()).length?-1:(r.abbreviations||(r.abbreviations={}),void 0===r.abbreviations[":"+l]&&(r.abbreviations[":"+l]=c),a)}function KE(e){var t=YE(e);try{t=decodeURI(t)}catch(e){}return encodeURI(t)}function XE(e,t){var n,r,i,o=t,a=e.posMax;if(60===e.src.charCodeAt(t)){for(t++;t<a;){if(10===(n=e.src.charCodeAt(t)))return!1;if(62===n)return i=KE(IE(e.src.slice(o+1,t))),!!e.parser.validateLink(i)&&(e.pos=t+1,e.linkContent=i,!0);92===n&&t+1<a?t+=2:t++}return!1}for(r=0;t<a&&32!==(n=e.src.charCodeAt(t))&&!(n<32||127===n);)if(92===n&&t+1<a)t+=2;else{if(40===n&&++r>1)break;if(41===n&&--r<0)break;t++}return o!==t&&(i=IE(e.src.slice(o,t)),!!e.parser.validateLink(i)&&(e.linkContent=i,e.pos=t,!0))}function $E(e,t){var n,r=t,i=e.posMax,o=e.src.charCodeAt(t);if(34!==o&&39!==o&&40!==o)return!1;for(t++,40===o&&(o=41);t<i;){if((n=e.src.charCodeAt(t))===o)return e.pos=t+1,e.linkContent=IE(e.src.slice(r+1,t)),!0;92===n&&t+1<i?t+=2:t++}return!1}function ek(e){return e.trim().replace(/\s+/g," ").toUpperCase()}function tk(e,t,n,r){var i,o,a,s,l,c,u,d,p;if(91!==e.charCodeAt(0))return-1;if(-1===e.indexOf("]:"))return-1;if((o=ZE(i=new QE(e,t,n,r,[]),0))<0||58!==e.charCodeAt(o+1))return-1;for(s=i.posMax,a=o+2;a<s&&(32===(l=i.src.charCodeAt(a))||10===l);a++);if(!XE(i,a))return-1;for(u=i.linkContent,c=a=i.pos,a+=1;a<s&&(32===(l=i.src.charCodeAt(a))||10===l);a++);for(a<s&&c!==a&&$E(i,a)?(d=i.linkContent,a=i.pos):(d="",a=c);a<s&&32===i.src.charCodeAt(a);)a++;return a<s&&10!==i.src.charCodeAt(a)?-1:(p=ek(e.slice(1,o)),void 0===r.references[p]&&(r.references[p]={title:d,href:u}),a)}UE.prototype.renderInline=function(e,t,n){for(var r=this.rules,i=e.length,o=0,a="";i--;)a+=r[e[o].type](e,o++,t,n,this);return a},UE.prototype.render=function(e,t,n){for(var r=this.rules,i=e.length,o=-1,a="";++o<i;)"inline"===e[o].type?a+=this.renderInline(e[o].children,t,n):a+=r[e[o].type](e,o,t,n,this);return a},WE.prototype.__find__=function(e){for(var t=this.__rules__.length,n=-1;t--;)if(this.__rules__[++n].name===e)return n;return-1},WE.prototype.__compile__=function(){var e=this,t=[""];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},WE.prototype.at=function(e,t,n){var r=this.__find__(e),i=n||{};if(-1===r)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null},WE.prototype.before=function(e,t,n,r){var i=this.__find__(e),o=r||{};if(-1===i)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},WE.prototype.after=function(e,t,n,r){var i=this.__find__(e),o=r||{};if(-1===i)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},WE.prototype.push=function(e,t,n){var r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},WE.prototype.enable=function(e,t){e=Array.isArray(e)?e:[e],t&&this.__rules__.forEach(function(e){e.enabled=!1}),e.forEach(function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!0},this),this.__cache__=null},WE.prototype.disable=function(e){(e=Array.isArray(e)?e:[e]).forEach(function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!1},this),this.__cache__=null},WE.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},QE.prototype.pushPending=function(){this.tokens.push({type:"text",content:this.pending,level:this.pendingLevel}),this.pending=""},QE.prototype.push=function(e){this.pending&&this.pushPending(),this.tokens.push(e),this.pendingLevel=this.level},QE.prototype.cacheSet=function(e,t){for(var n=this.cache.length;n<=e;n++)this.cache.push(0);this.cache[e]=t},QE.prototype.cacheGet=function(e){return e<this.cache.length?this.cache[e]:0};var nk=" \n()[]'\".,!?-";function rk(e){return e.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1")}var ik=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,ok=/\((c|tm|r|p)\)/gi,ak={c:"©",r:"®",p:"§",tm:"™"};function sk(e){return e.indexOf("(")<0?e:e.replace(ok,function(e,t){return ak[t.toLowerCase()]})}var lk=/['"]/,ck=/['"]/g,uk=/[-\s()\[\]]/;function dk(e,t){return!(t<0||t>=e.length)&&!uk.test(e[t])}function pk(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}var hk=[["block",function(e){e.inlineMode?e.tokens.push({type:"inline",content:e.src.replace(/\n/g," ").trim(),level:0,lines:[0,1],children:[]}):e.block.parse(e.src,e.options,e.env,e.tokens)}],["abbr",function(e){var t,n,r,i,o=e.tokens;if(!e.inlineMode)for(t=1,n=o.length-1;t<n;t++)if("paragraph_open"===o[t-1].type&&"inline"===o[t].type&&"paragraph_close"===o[t+1].type){for(r=o[t].content;r.length&&!((i=JE(r,e.inline,e.options,e.env))<0);)r=r.slice(i).trim();o[t].content=r,r.length||(o[t-1].tight=!0,o[t+1].tight=!0)}}],["references",function(e){var t,n,r,i,o=e.tokens;if(e.env.references=e.env.references||{},!e.inlineMode)for(t=1,n=o.length-1;t<n;t++)if("inline"===o[t].type&&"paragraph_open"===o[t-1].type&&"paragraph_close"===o[t+1].type){for(r=o[t].content;r.length&&!((i=tk(r,e.inline,e.options,e.env))<0);)r=r.slice(i).trim();o[t].content=r,r.length||(o[t-1].tight=!0,o[t+1].tight=!0)}}],["inline",function(e){var t,n,r,i=e.tokens;for(n=0,r=i.length;n<r;n++)"inline"===(t=i[n]).type&&e.inline.parse(t.content,e.options,e.env,t.children)}],["footnote_tail",function(e){var t,n,r,i,o,a,s,l,c,u=0,d=!1,p={};if(e.env.footnotes&&(e.tokens=e.tokens.filter(function(e){return"footnote_reference_open"===e.type?(d=!0,l=[],c=e.label,!1):"footnote_reference_close"===e.type?(d=!1,p[":"+c]=l,!1):(d&&l.push(e),!d)}),e.env.footnotes.list)){for(a=e.env.footnotes.list,e.tokens.push({type:"footnote_block_open",level:u++}),t=0,n=a.length;t<n;t++){for(e.tokens.push({type:"footnote_open",id:t,level:u++}),a[t].tokens?((s=[]).push({type:"paragraph_open",tight:!1,level:u++}),s.push({type:"inline",content:"",level:u,children:a[t].tokens}),s.push({type:"paragraph_close",tight:!1,level:--u})):a[t].label&&(s=p[":"+a[t].label]),e.tokens=e.tokens.concat(s),o="paragraph_close"===e.tokens[e.tokens.length-1].type?e.tokens.pop():null,i=a[t].count>0?a[t].count:1,r=0;r<i;r++)e.tokens.push({type:"footnote_anchor",id:t,subId:r,level:u});o&&e.tokens.push(o),e.tokens.push({type:"footnote_close",level:--u})}e.tokens.push({type:"footnote_block_close",level:--u})}}],["abbr2",function(e){var t,n,r,i,o,a,s,l,c,u,d,p,h=e.tokens;if(e.env.abbreviations)for(e.env.abbrRegExp||(p="(^|["+nk.split("").map(rk).join("")+"])("+Object.keys(e.env.abbreviations).map(function(e){return e.substr(1)}).sort(function(e,t){return t.length-e.length}).map(rk).join("|")+")($|["+nk.split("").map(rk).join("")+"])",e.env.abbrRegExp=new RegExp(p,"g")),u=e.env.abbrRegExp,n=0,r=h.length;n<r;n++)if("inline"===h[n].type)for(t=(i=h[n].children).length-1;t>=0;t--)if("text"===(o=i[t]).type){for(l=0,a=o.content,u.lastIndex=0,c=o.level,s=[];d=u.exec(a);)u.lastIndex>l&&s.push({type:"text",content:a.slice(l,d.index+d[1].length),level:c}),s.push({type:"abbr_open",title:e.env.abbreviations[":"+d[2]],level:c++}),s.push({type:"text",content:d[2],level:c}),s.push({type:"abbr_close",level:--c}),l=u.lastIndex-d[3].length;s.length&&(l<a.length&&s.push({type:"text",content:a.slice(l),level:c}),h[n].children=i=[].concat(i.slice(0,t),s,i.slice(t+1)))}}],["replacements",function(e){var t,n,r,i,o;if(e.options.typographer)for(o=e.tokens.length-1;o>=0;o--)if("inline"===e.tokens[o].type)for(t=(i=e.tokens[o].children).length-1;t>=0;t--)"text"===(n=i[t]).type&&(r=sk(r=n.content),ik.test(r)&&(r=r.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),n.content=r)}],["smartquotes",function(e){var t,n,r,i,o,a,s,l,c,u,d,p,h,f,m,g,y;if(e.options.typographer)for(y=[],m=e.tokens.length-1;m>=0;m--)if("inline"===e.tokens[m].type)for(g=e.tokens[m].children,y.length=0,t=0;t<g.length;t++)if("text"===(n=g[t]).type&&!lk.test(n.text)){for(s=g[t].level,h=y.length-1;h>=0&&!(y[h].level<=s);h--);y.length=h+1,o=0,a=(r=n.content).length;e:for(;o<a&&(ck.lastIndex=o,i=ck.exec(r));)if(l=!dk(r,i.index-1),o=i.index+1,f="'"===i[0],(c=!dk(r,o))||l){if(d=!c,p=!l)for(h=y.length-1;h>=0&&(u=y[h],!(y[h].level<s));h--)if(u.single===f&&y[h].level===s){u=y[h],f?(g[u.token].content=pk(g[u.token].content,u.pos,e.options.quotes[2]),n.content=pk(n.content,i.index,e.options.quotes[3])):(g[u.token].content=pk(g[u.token].content,u.pos,e.options.quotes[0]),n.content=pk(n.content,i.index,e.options.quotes[1])),y.length=h;continue e}d?y.push({token:t,pos:i.index,single:f,level:s}):p&&f&&(n.content=pk(n.content,i.index,"’"))}else f&&(n.content=pk(n.content,i.index,"’"))}}]];function fk(){this.options={},this.ruler=new WE;for(var e=0;e<hk.length;e++)this.ruler.push(hk[e][0],hk[e][1])}function mk(e,t,n,r,i){var o,a,s,l,c,u,d;for(this.src=e,this.parser=t,this.options=n,this.env=r,this.tokens=i,this.bMarks=[],this.eMarks=[],this.tShift=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType="root",this.ddIndent=-1,this.level=0,this.result="",u=0,d=!1,s=l=u=0,c=(a=this.src).length;l<c;l++){if(o=a.charCodeAt(l),!d){if(32===o){u++;continue}d=!0}10!==o&&l!==c-1||(10!==o&&l++,this.bMarks.push(s),this.eMarks.push(l),this.tShift.push(u),d=!1,u=0,s=l+1)}this.bMarks.push(a.length),this.eMarks.push(a.length),this.tShift.push(0),this.lineMax=this.bMarks.length-1}function gk(e,t){var n,r,i;return(r=e.bMarks[t]+e.tShift[t])>=(i=e.eMarks[t])||42!==(n=e.src.charCodeAt(r++))&&45!==n&&43!==n||r<i&&32!==e.src.charCodeAt(r)?-1:r}function yk(e,t){var n,r=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(r+1>=i)return-1;if((n=e.src.charCodeAt(r++))<48||n>57)return-1;for(;;){if(r>=i)return-1;if(!((n=e.src.charCodeAt(r++))>=48&&n<=57)){if(41===n||46===n)break;return-1}}return r<i&&32!==e.src.charCodeAt(r)?-1:r}fk.prototype.process=function(e){var t,n,r;for(t=0,n=(r=this.ruler.getRules("")).length;t<n;t++)r[t](e)},mk.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},mk.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},mk.prototype.skipSpaces=function(e){for(var t=this.src.length;e<t&&32===this.src.charCodeAt(e);e++);return e},mk.prototype.skipChars=function(e,t){for(var n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},mk.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},mk.prototype.getLines=function(e,t,n,r){var i,o,a,s,l,c=e;if(e>=t)return"";if(c+1===t)return o=this.bMarks[c]+Math.min(this.tShift[c],n),a=r?this.eMarks[c]+1:this.eMarks[c],this.src.slice(o,a);for(s=new Array(t-e),i=0;c<t;c++,i++)(l=this.tShift[c])>n&&(l=n),l<0&&(l=0),o=this.bMarks[c]+l,a=c+1<t||r?this.eMarks[c]+1:this.eMarks[c],s[i]=this.src.slice(o,a);return s.join("")};var Ak={};["article","aside","button","blockquote","body","canvas","caption","col","colgroup","dd","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","iframe","li","map","object","ol","output","p","pre","progress","script","section","style","table","tbody","td","textarea","tfoot","th","tr","thead","ul","video"].forEach(function(e){Ak[e]=!0});var vk=/^<([a-zA-Z]{1,15})[\s\/>]/,bk=/^<\/([a-zA-Z]{1,15})[\s>]/;function wk(e,t){var n=e.bMarks[t]+e.blkIndent,r=e.eMarks[t];return e.src.substr(n,r-n)}function Ek(e,t){var n,r,i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return i>=o||126!==(r=e.src.charCodeAt(i++))&&58!==r||i===(n=e.skipSpaces(i))||n>=o?-1:n}var kk=[["code",function(e,t,n){var r,i;if(e.tShift[t]-e.blkIndent<4)return!1;for(i=r=t+1;r<n;)if(e.isEmpty(r))r++;else{if(!(e.tShift[r]-e.blkIndent>=4))break;i=++r}return e.line=r,e.tokens.push({type:"code",content:e.getLines(t,i,4+e.blkIndent,!0),block:!0,lines:[t,e.line],level:e.level}),!0}],["fences",function(e,t,n,r){var i,o,a,s,l,c=!1,u=e.bMarks[t]+e.tShift[t],d=e.eMarks[t];if(u+3>d)return!1;if(126!==(i=e.src.charCodeAt(u))&&96!==i)return!1;if(l=u,(o=(u=e.skipChars(u,i))-l)<3)return!1;if((a=e.src.slice(u,d).trim()).indexOf("`")>=0)return!1;if(r)return!0;for(s=t;!(++s>=n)&&!((u=l=e.bMarks[s]+e.tShift[s])<(d=e.eMarks[s])&&e.tShift[s]<e.blkIndent);)if(e.src.charCodeAt(u)===i&&!(e.tShift[s]-e.blkIndent>=4||(u=e.skipChars(u,i))-l<o||(u=e.skipSpaces(u))<d)){c=!0;break}return o=e.tShift[t],e.line=s+(c?1:0),e.tokens.push({type:"fence",params:a,content:e.getLines(t+1,s,o,!0),lines:[t,e.line],level:e.level}),!0},["paragraph","blockquote","list"]],["blockquote",function(e,t,n,r){var i,o,a,s,l,c,u,d,p,h,f,m=e.bMarks[t]+e.tShift[t],g=e.eMarks[t];if(m>g)return!1;if(62!==e.src.charCodeAt(m++))return!1;if(e.level>=e.options.maxNesting)return!1;if(r)return!0;for(32===e.src.charCodeAt(m)&&m++,l=e.blkIndent,e.blkIndent=0,s=[e.bMarks[t]],e.bMarks[t]=m,o=(m=m<g?e.skipSpaces(m):m)>=g,a=[e.tShift[t]],e.tShift[t]=m-e.bMarks[t],d=e.parser.ruler.getRules("blockquote"),i=t+1;i<n&&!((m=e.bMarks[i]+e.tShift[i])>=(g=e.eMarks[i]));i++)if(62!==e.src.charCodeAt(m++)){if(o)break;for(f=!1,p=0,h=d.length;p<h;p++)if(d[p](e,i,n,!0)){f=!0;break}if(f)break;s.push(e.bMarks[i]),a.push(e.tShift[i]),e.tShift[i]=-1337}else 32===e.src.charCodeAt(m)&&m++,s.push(e.bMarks[i]),e.bMarks[i]=m,o=(m=m<g?e.skipSpaces(m):m)>=g,a.push(e.tShift[i]),e.tShift[i]=m-e.bMarks[i];for(c=e.parentType,e.parentType="blockquote",e.tokens.push({type:"blockquote_open",lines:u=[t,0],level:e.level++}),e.parser.tokenize(e,t,i),e.tokens.push({type:"blockquote_close",level:--e.level}),e.parentType=c,u[1]=e.line,p=0;p<a.length;p++)e.bMarks[p+t]=s[p],e.tShift[p+t]=a[p];return e.blkIndent=l,!0},["paragraph","blockquote","list"]],["hr",function(e,t,n,r){var i,o,a,s=e.bMarks[t],l=e.eMarks[t];if((s+=e.tShift[t])>l)return!1;if(42!==(i=e.src.charCodeAt(s++))&&45!==i&&95!==i)return!1;for(o=1;s<l;){if((a=e.src.charCodeAt(s++))!==i&&32!==a)return!1;a===i&&o++}return!(o<3)&&(r||(e.line=t+1,e.tokens.push({type:"hr",lines:[t,e.line],level:e.level})),!0)},["paragraph","blockquote","list"]],["list",function(e,t,n,r){var i,o,a,s,l,c,u,d,p,h,f,m,g,y,A,v,b,w,E,k,C,_=!0;if((d=yk(e,t))>=0)m=!0;else{if(!((d=gk(e,t))>=0))return!1;m=!1}if(e.level>=e.options.maxNesting)return!1;if(f=e.src.charCodeAt(d-1),r)return!0;for(y=e.tokens.length,m?(u=e.bMarks[t]+e.tShift[t],h=Number(e.src.substr(u,d-u-1)),e.tokens.push({type:"ordered_list_open",order:h,lines:v=[t,0],level:e.level++})):e.tokens.push({type:"bullet_list_open",lines:v=[t,0],level:e.level++}),i=t,A=!1,w=e.parser.ruler.getRules("list");!(!(i<n)||((p=(g=e.skipSpaces(d))>=e.eMarks[i]?1:g-d)>4&&(p=1),p<1&&(p=1),o=d-e.bMarks[i]+p,e.tokens.push({type:"list_item_open",lines:b=[t,0],level:e.level++}),s=e.blkIndent,l=e.tight,a=e.tShift[t],c=e.parentType,e.tShift[t]=g-e.bMarks[t],e.blkIndent=o,e.tight=!0,e.parentType="list",e.parser.tokenize(e,t,n,!0),e.tight&&!A||(_=!1),A=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=s,e.tShift[t]=a,e.tight=l,e.parentType=c,e.tokens.push({type:"list_item_close",level:--e.level}),i=t=e.line,b[1]=i,g=e.bMarks[t],i>=n)||e.isEmpty(i)||e.tShift[i]<e.blkIndent);){for(C=!1,E=0,k=w.length;E<k;E++)if(w[E](e,i,n,!0)){C=!0;break}if(C)break;if(m){if((d=yk(e,i))<0)break}else if((d=gk(e,i))<0)break;if(f!==e.src.charCodeAt(d-1))break}return e.tokens.push({type:m?"ordered_list_close":"bullet_list_close",level:--e.level}),v[1]=i,e.line=i,_&&function(e,t){var n,r,i=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===i&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}(e,y),!0},["paragraph","blockquote"]],["footnote",function(e,t,n,r){var i,o,a,s,l,c=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(c+4>u)return!1;if(91!==e.src.charCodeAt(c))return!1;if(94!==e.src.charCodeAt(c+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(s=c+2;s<u;s++){if(32===e.src.charCodeAt(s))return!1;if(93===e.src.charCodeAt(s))break}return s!==c+2&&(!(s+1>=u||58!==e.src.charCodeAt(++s))&&(r||(s++,e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.refs||(e.env.footnotes.refs={}),l=e.src.slice(c+2,s-2),e.env.footnotes.refs[":"+l]=-1,e.tokens.push({type:"footnote_reference_open",label:l,level:e.level++}),i=e.bMarks[t],o=e.tShift[t],a=e.parentType,e.tShift[t]=e.skipSpaces(s)-s,e.bMarks[t]=s,e.blkIndent+=4,e.parentType="footnote",e.tShift[t]<e.blkIndent&&(e.tShift[t]+=e.blkIndent,e.bMarks[t]-=e.blkIndent),e.parser.tokenize(e,t,n,!0),e.parentType=a,e.blkIndent-=4,e.tShift[t]=o,e.bMarks[t]=i,e.tokens.push({type:"footnote_reference_close",level:--e.level})),!0))},["paragraph"]],["heading",function(e,t,n,r){var i,o,a,s=e.bMarks[t]+e.tShift[t],l=e.eMarks[t];if(s>=l)return!1;if(35!==(i=e.src.charCodeAt(s))||s>=l)return!1;for(o=1,i=e.src.charCodeAt(++s);35===i&&s<l&&o<=6;)o++,i=e.src.charCodeAt(++s);return!(o>6||s<l&&32!==i)&&(r||(l=e.skipCharsBack(l,32,s),(a=e.skipCharsBack(l,35,s))>s&&32===e.src.charCodeAt(a-1)&&(l=a),e.line=t+1,e.tokens.push({type:"heading_open",hLevel:o,lines:[t,e.line],level:e.level}),s<l&&e.tokens.push({type:"inline",content:e.src.slice(s,l).trim(),level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"heading_close",hLevel:o,level:e.level})),!0)},["paragraph","blockquote"]],["lheading",function(e,t,n){var r,i,o,a=t+1;return!(a>=n)&&(!(e.tShift[a]<e.blkIndent)&&(!(e.tShift[a]-e.blkIndent>3)&&(!((i=e.bMarks[a]+e.tShift[a])>=(o=e.eMarks[a]))&&((45===(r=e.src.charCodeAt(i))||61===r)&&(i=e.skipChars(i,r),!((i=e.skipSpaces(i))<o)&&(i=e.bMarks[t]+e.tShift[t],e.line=a+1,e.tokens.push({type:"heading_open",hLevel:61===r?1:2,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:e.src.slice(i,e.eMarks[t]).trim(),level:e.level+1,lines:[t,e.line-1],children:[]}),e.tokens.push({type:"heading_close",hLevel:61===r?1:2,level:e.level}),!0))))))}],["htmlblock",function(e,t,n,r){var i,o,a,s=e.bMarks[t],l=e.eMarks[t],c=e.tShift[t];if(s+=c,!e.options.html)return!1;if(c>3||s+2>=l)return!1;if(60!==e.src.charCodeAt(s))return!1;if(33===(i=e.src.charCodeAt(s+1))||63===i){if(r)return!0}else{if(47!==i&&!function(e){var t=32|e;return t>=97&&t<=122}(i))return!1;if(47===i){if(!(o=e.src.slice(s,l).match(bk)))return!1}else if(!(o=e.src.slice(s,l).match(vk)))return!1;if(!0!==Ak[o[1].toLowerCase()])return!1;if(r)return!0}for(a=t+1;a<e.lineMax&&!e.isEmpty(a);)a++;return e.line=a,e.tokens.push({type:"htmlblock",level:e.level,lines:[t,e.line],content:e.getLines(t,a,0,!0)}),!0},["paragraph","blockquote"]],["table",function(e,t,n,r){var i,o,a,s,l,c,u,d,p,h,f;if(t+2>n)return!1;if(l=t+1,e.tShift[l]<e.blkIndent)return!1;if((a=e.bMarks[l]+e.tShift[l])>=e.eMarks[l])return!1;if(124!==(i=e.src.charCodeAt(a))&&45!==i&&58!==i)return!1;if(o=wk(e,t+1),!/^[-:| ]+$/.test(o))return!1;if((c=o.split("|"))<=2)return!1;for(d=[],s=0;s<c.length;s++){if(!(p=c[s].trim())){if(0===s||s===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(p))return!1;58===p.charCodeAt(p.length-1)?d.push(58===p.charCodeAt(0)?"center":"right"):58===p.charCodeAt(0)?d.push("left"):d.push("")}if(-1===(o=wk(e,t).trim()).indexOf("|"))return!1;if(c=o.replace(/^\||\|$/g,"").split("|"),d.length!==c.length)return!1;if(r)return!0;for(e.tokens.push({type:"table_open",lines:h=[t,0],level:e.level++}),e.tokens.push({type:"thead_open",lines:[t,t+1],level:e.level++}),e.tokens.push({type:"tr_open",lines:[t,t+1],level:e.level++}),s=0;s<c.length;s++)e.tokens.push({type:"th_open",align:d[s],lines:[t,t+1],level:e.level++}),e.tokens.push({type:"inline",content:c[s].trim(),lines:[t,t+1],level:e.level,children:[]}),e.tokens.push({type:"th_close",level:--e.level});for(e.tokens.push({type:"tr_close",level:--e.level}),e.tokens.push({type:"thead_close",level:--e.level}),e.tokens.push({type:"tbody_open",lines:f=[t+2,0],level:e.level++}),l=t+2;l<n&&!(e.tShift[l]<e.blkIndent)&&-1!==(o=wk(e,l).trim()).indexOf("|");l++){for(c=o.replace(/^\||\|$/g,"").split("|"),e.tokens.push({type:"tr_open",level:e.level++}),s=0;s<c.length;s++)e.tokens.push({type:"td_open",align:d[s],level:e.level++}),u=c[s].substring(124===c[s].charCodeAt(0)?1:0,124===c[s].charCodeAt(c[s].length-1)?c[s].length-1:c[s].length).trim(),e.tokens.push({type:"inline",content:u,level:e.level,children:[]}),e.tokens.push({type:"td_close",level:--e.level});e.tokens.push({type:"tr_close",level:--e.level})}return e.tokens.push({type:"tbody_close",level:--e.level}),e.tokens.push({type:"table_close",level:--e.level}),h[1]=f[1]=l,e.line=l,!0},["paragraph"]],["deflist",function(e,t,n,r){var i,o,a,s,l,c,u,d,p,h,f,m,g,y;if(r)return!(e.ddIndent<0)&&Ek(e,t)>=0;if(u=t+1,e.isEmpty(u)&&++u>n)return!1;if(e.tShift[u]<e.blkIndent)return!1;if((i=Ek(e,u))<0)return!1;if(e.level>=e.options.maxNesting)return!1;c=e.tokens.length,e.tokens.push({type:"dl_open",lines:l=[t,0],level:e.level++}),a=t,o=u;e:for(;;){for(y=!0,g=!1,e.tokens.push({type:"dt_open",lines:[a,a],level:e.level++}),e.tokens.push({type:"inline",content:e.getLines(a,a+1,e.blkIndent,!1).trim(),level:e.level+1,lines:[a,a],children:[]}),e.tokens.push({type:"dt_close",level:--e.level});;){if(e.tokens.push({type:"dd_open",lines:s=[u,0],level:e.level++}),m=e.tight,p=e.ddIndent,d=e.blkIndent,f=e.tShift[o],h=e.parentType,e.blkIndent=e.ddIndent=e.tShift[o]+2,e.tShift[o]=i-e.bMarks[o],e.tight=!0,e.parentType="deflist",e.parser.tokenize(e,o,n,!0),e.tight&&!g||(y=!1),g=e.line-o>1&&e.isEmpty(e.line-1),e.tShift[o]=f,e.tight=m,e.parentType=h,e.blkIndent=d,e.ddIndent=p,e.tokens.push({type:"dd_close",level:--e.level}),s[1]=u=e.line,u>=n)break e;if(e.tShift[u]<e.blkIndent)break e;if((i=Ek(e,u))<0)break;o=u}if(u>=n)break;if(a=u,e.isEmpty(a))break;if(e.tShift[a]<e.blkIndent)break;if((o=a+1)>=n)break;if(e.isEmpty(o)&&o++,o>=n)break;if(e.tShift[o]<e.blkIndent)break;if((i=Ek(e,o))<0)break}return e.tokens.push({type:"dl_close",level:--e.level}),l[1]=u,e.line=u,y&&function(e,t){var n,r,i=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===i&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}(e,c),!0},["paragraph"]],["paragraph",function(e,t){var n,r,i,o,a,s,l=t+1;if(l<(n=e.lineMax)&&!e.isEmpty(l))for(s=e.parser.ruler.getRules("paragraph");l<n&&!e.isEmpty(l);l++)if(!(e.tShift[l]-e.blkIndent>3)){for(i=!1,o=0,a=s.length;o<a;o++)if(s[o](e,l,n,!0)){i=!0;break}if(i)break}return r=e.getLines(t,l,e.blkIndent,!1).trim(),e.line=l,r.length&&(e.tokens.push({type:"paragraph_open",tight:!1,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:r,level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"paragraph_close",tight:!1,level:e.level})),!0}]];function Ck(){this.ruler=new WE;for(var e=0;e<kk.length;e++)this.ruler.push(kk[e][0],kk[e][1],{alt:(kk[e][2]||[]).slice()})}Ck.prototype.tokenize=function(e,t,n){for(var r,i=this.ruler.getRules(""),o=i.length,a=t,s=!1;a<n&&(e.line=a=e.skipEmptyLines(a),!(a>=n))&&!(e.tShift[a]<e.blkIndent);){for(r=0;r<o&&!i[r](e,a,n,!1);r++);if(e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),(a=e.line)<n&&e.isEmpty(a)){if(s=!0,++a<n&&"list"===e.parentType&&e.isEmpty(a))break;e.line=a}}};var _k=/[\n\t]/g,Mk=/\r[\n\u0085]|[\u2424\u2028\u0085]/g,Tk=/\u00a0/g;function Sk(e){switch(e){case 10:case 92:case 96:case 42:case 95:case 94:case 91:case 93:case 33:case 38:case 60:case 62:case 123:case 125:case 36:case 37:case 64:case 126:case 43:case 61:case 58:return!0;default:return!1}}Ck.prototype.parse=function(e,t,n,r){var i,o=0,a=0;if(!e)return[];(e=(e=e.replace(Tk," ")).replace(Mk,"\n")).indexOf("\t")>=0&&(e=e.replace(_k,function(t,n){var r;return 10===e.charCodeAt(n)?(o=n+1,a=0,t):(r=" ".slice((n-o-a)%4),a=n-o+1,r)})),i=new mk(e,this,t,n,r),this.tokenize(i,i.line,i.lineMax)};for(var Dk=[],xk=0;xk<256;xk++)Dk.push(0);function Ik(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function Lk(e,t){var n,r,i,o=t,a=!0,s=!0,l=e.posMax,c=e.src.charCodeAt(t);for(n=t>0?e.src.charCodeAt(t-1):-1;o<l&&e.src.charCodeAt(o)===c;)o++;return o>=l&&(a=!1),(i=o-t)>=4?a=s=!1:(32!==(r=o<l?e.src.charCodeAt(o):-1)&&10!==r||(a=!1),32!==n&&10!==n||(s=!1),95===c&&(Ik(n)&&(a=!1),Ik(r)&&(s=!1))),{can_open:a,can_close:s,delims:i}}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){Dk[e.charCodeAt(0)]=1});var Pk=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;var Ok=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;var Rk=["coap","doi","javascript","aaa","aaas","about","acap","cap","cid","crid","data","dav","dict","dns","file","ftp","geo","go","gopher","h323","http","https","iax","icap","im","imap","info","ipp","iris","iris.beep","iris.xpc","iris.xpcs","iris.lwz","ldap","mailto","mid","msrp","msrps","mtqp","mupdate","news","nfs","ni","nih","nntp","opaquelocktoken","pop","pres","rtsp","service","session","shttp","sieve","sip","sips","sms","snmp","soap.beep","soap.beeps","tag","tel","telnet","tftp","thismessage","tn3270","tip","tv","urn","vemmi","ws","wss","xcon","xcon-userid","xmlrpc.beep","xmlrpc.beeps","xmpp","z39.50r","z39.50s","adiumxtra","afp","afs","aim","apt","attachment","aw","beshare","bitcoin","bolo","callto","chrome","chrome-extension","com-eventbrite-attendee","content","cvs","dlna-playsingle","dlna-playcontainer","dtn","dvb","ed2k","facetime","feed","finger","fish","gg","git","gizmoproject","gtalk","hcp","icon","ipn","irc","irc6","ircs","itms","jar","jms","keyparc","lastfm","ldaps","magnet","maps","market","message","mms","ms-help","msnim","mumble","mvn","notes","oid","palm","paparazzi","platform","proxy","psyc","query","res","resource","rmi","rsync","rtmp","secondlife","sftp","sgn","skype","smb","soldat","spotify","ssh","steam","svn","teamspeak","things","udp","unreal","ut2004","ventrilo","view-source","webcal","wtai","wyciwyg","xfire","xri","ymsgr"],Bk=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,Yk=/^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;function Nk(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,e=e.replace(r,i),n):new RegExp(e,t)}}var Vk=Nk(/(?:unquoted|single_quoted|double_quoted)/)("unquoted",/[^"'=<>`\x00-\x20]+/)("single_quoted",/'[^']*'/)("double_quoted",/"[^"]*"/)(),Fk=Nk(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name",/[a-zA-Z_:][a-zA-Z0-9:._-]*/)("attr_value",Vk)(),jk=Nk(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute",Fk)(),Hk=Nk(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",jk)("close_tag",/<\/[A-Za-z][A-Za-z0-9]*\s*>/)("comment",/<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/)("processing",/<[?].*?[?]>/)("declaration",/<![A-Z]+\s+[^>]*>/)("cdata",/<!\[CDATA\[[\s\S]*?\]\]>/)();var qk=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,Gk=/^&([a-z][a-z0-9]{1,31});/i;var zk=[["text",function(e,t){for(var n=e.pos;n<e.posMax&&!Sk(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}],["newline",function(e,t){var n,r,i=e.pos;if(10!==e.src.charCodeAt(i))return!1;if(n=e.pending.length-1,r=e.posMax,!t)if(n>=0&&32===e.pending.charCodeAt(n))if(n>=1&&32===e.pending.charCodeAt(n-1)){for(var o=n-2;o>=0;o--)if(32!==e.pending.charCodeAt(o)){e.pending=e.pending.substring(0,o+1);break}e.push({type:"hardbreak",level:e.level})}else e.pending=e.pending.slice(0,-1),e.push({type:"softbreak",level:e.level});else e.push({type:"softbreak",level:e.level});for(i++;i<r&&32===e.src.charCodeAt(i);)i++;return e.pos=i,!0}],["escape",function(e,t){var n,r=e.pos,i=e.posMax;if(92!==e.src.charCodeAt(r))return!1;if(++r<i){if((n=e.src.charCodeAt(r))<256&&0!==Dk[n])return t||(e.pending+=e.src[r]),e.pos+=2,!0;if(10===n){for(t||e.push({type:"hardbreak",level:e.level}),r++;r<i&&32===e.src.charCodeAt(r);)r++;return e.pos=r,!0}}return t||(e.pending+="\\"),e.pos++,!0}],["backticks",function(e,t){var n,r,i,o,a,s=e.pos;if(96!==e.src.charCodeAt(s))return!1;for(n=s,s++,r=e.posMax;s<r&&96===e.src.charCodeAt(s);)s++;for(i=e.src.slice(n,s),o=a=s;-1!==(o=e.src.indexOf("`",a));){for(a=o+1;a<r&&96===e.src.charCodeAt(a);)a++;if(a-o===i.length)return t||e.push({type:"code",content:e.src.slice(s,o).replace(/[ \n]+/g," ").trim(),block:!1,level:e.level}),e.pos=a,!0}return t||(e.pending+=i),e.pos+=i.length,!0}],["del",function(e,t){var n,r,i,o,a,s=e.posMax,l=e.pos;if(126!==e.src.charCodeAt(l))return!1;if(t)return!1;if(l+4>=s)return!1;if(126!==e.src.charCodeAt(l+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(o=l>0?e.src.charCodeAt(l-1):-1,a=e.src.charCodeAt(l+2),126===o)return!1;if(126===a)return!1;if(32===a||10===a)return!1;for(r=l+2;r<s&&126===e.src.charCodeAt(r);)r++;if(r>l+3)return e.pos+=r-l,t||(e.pending+=e.src.slice(l,r)),!0;for(e.pos=l+2,i=1;e.pos+1<s;){if(126===e.src.charCodeAt(e.pos)&&126===e.src.charCodeAt(e.pos+1)&&(o=e.src.charCodeAt(e.pos-1),126!==(a=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&126!==o&&(32!==o&&10!==o?i--:32!==a&&10!==a&&i++,i<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=l+2,t||(e.push({type:"del_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"del_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=l,!1)}],["ins",function(e,t){var n,r,i,o,a,s=e.posMax,l=e.pos;if(43!==e.src.charCodeAt(l))return!1;if(t)return!1;if(l+4>=s)return!1;if(43!==e.src.charCodeAt(l+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(o=l>0?e.src.charCodeAt(l-1):-1,a=e.src.charCodeAt(l+2),43===o)return!1;if(43===a)return!1;if(32===a||10===a)return!1;for(r=l+2;r<s&&43===e.src.charCodeAt(r);)r++;if(r!==l+2)return e.pos+=r-l,t||(e.pending+=e.src.slice(l,r)),!0;for(e.pos=l+2,i=1;e.pos+1<s;){if(43===e.src.charCodeAt(e.pos)&&43===e.src.charCodeAt(e.pos+1)&&(o=e.src.charCodeAt(e.pos-1),43!==(a=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&43!==o&&(32!==o&&10!==o?i--:32!==a&&10!==a&&i++,i<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=l+2,t||(e.push({type:"ins_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"ins_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=l,!1)}],["mark",function(e,t){var n,r,i,o,a,s=e.posMax,l=e.pos;if(61!==e.src.charCodeAt(l))return!1;if(t)return!1;if(l+4>=s)return!1;if(61!==e.src.charCodeAt(l+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(o=l>0?e.src.charCodeAt(l-1):-1,a=e.src.charCodeAt(l+2),61===o)return!1;if(61===a)return!1;if(32===a||10===a)return!1;for(r=l+2;r<s&&61===e.src.charCodeAt(r);)r++;if(r!==l+2)return e.pos+=r-l,t||(e.pending+=e.src.slice(l,r)),!0;for(e.pos=l+2,i=1;e.pos+1<s;){if(61===e.src.charCodeAt(e.pos)&&61===e.src.charCodeAt(e.pos+1)&&(o=e.src.charCodeAt(e.pos-1),61!==(a=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&61!==o&&(32!==o&&10!==o?i--:32!==a&&10!==a&&i++,i<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=l+2,t||(e.push({type:"mark_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"mark_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=l,!1)}],["emphasis",function(e,t){var n,r,i,o,a,s,l,c=e.posMax,u=e.pos,d=e.src.charCodeAt(u);if(95!==d&&42!==d)return!1;if(t)return!1;if(n=(l=Lk(e,u)).delims,!l.can_open)return e.pos+=n,t||(e.pending+=e.src.slice(u,e.pos)),!0;if(e.level>=e.options.maxNesting)return!1;for(e.pos=u+n,s=[n];e.pos<c;)if(e.src.charCodeAt(e.pos)!==d)e.parser.skipToken(e);else{if(r=(l=Lk(e,e.pos)).delims,l.can_close){for(o=s.pop(),a=r;o!==a;){if(a<o){s.push(o-a);break}if(a-=o,0===s.length)break;e.pos+=o,o=s.pop()}if(0===s.length){n=o,i=!0;break}e.pos+=r;continue}l.can_open&&s.push(r),e.pos+=r}return i?(e.posMax=e.pos,e.pos=u+n,t||(2!==n&&3!==n||e.push({type:"strong_open",level:e.level++}),1!==n&&3!==n||e.push({type:"em_open",level:e.level++}),e.parser.tokenize(e),1!==n&&3!==n||e.push({type:"em_close",level:--e.level}),2!==n&&3!==n||e.push({type:"strong_close",level:--e.level})),e.pos=e.posMax+n,e.posMax=c,!0):(e.pos=u,!1)}],["sub",function(e,t){var n,r,i=e.posMax,o=e.pos;if(126!==e.src.charCodeAt(o))return!1;if(t)return!1;if(o+2>=i)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=o+1;e.pos<i;){if(126===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&o+1!==e.pos?(r=e.src.slice(o+1,e.pos)).match(/(^|[^\\])(\\\\)*\s/)?(e.pos=o,!1):(e.posMax=e.pos,e.pos=o+1,t||e.push({type:"sub",level:e.level,content:r.replace(Pk,"$1")}),e.pos=e.posMax+1,e.posMax=i,!0):(e.pos=o,!1)}],["sup",function(e,t){var n,r,i=e.posMax,o=e.pos;if(94!==e.src.charCodeAt(o))return!1;if(t)return!1;if(o+2>=i)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=o+1;e.pos<i;){if(94===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&o+1!==e.pos?(r=e.src.slice(o+1,e.pos)).match(/(^|[^\\])(\\\\)*\s/)?(e.pos=o,!1):(e.posMax=e.pos,e.pos=o+1,t||e.push({type:"sup",level:e.level,content:r.replace(Ok,"$1")}),e.pos=e.posMax+1,e.posMax=i,!0):(e.pos=o,!1)}],["links",function(e,t){var n,r,i,o,a,s,l,c,u=!1,d=e.pos,p=e.posMax,h=e.pos,f=e.src.charCodeAt(h);if(33===f&&(u=!0,f=e.src.charCodeAt(++h)),91!==f)return!1;if(e.level>=e.options.maxNesting)return!1;if(n=h+1,(r=ZE(e,h))<0)return!1;if((s=r+1)<p&&40===e.src.charCodeAt(s)){for(s++;s<p&&(32===(c=e.src.charCodeAt(s))||10===c);s++);if(s>=p)return!1;for(h=s,XE(e,s)?(o=e.linkContent,s=e.pos):o="",h=s;s<p&&(32===(c=e.src.charCodeAt(s))||10===c);s++);if(s<p&&h!==s&&$E(e,s))for(a=e.linkContent,s=e.pos;s<p&&(32===(c=e.src.charCodeAt(s))||10===c);s++);else a="";if(s>=p||41!==e.src.charCodeAt(s))return e.pos=d,!1;s++}else{if(e.linkLevel>0)return!1;for(;s<p&&(32===(c=e.src.charCodeAt(s))||10===c);s++);if(s<p&&91===e.src.charCodeAt(s)&&(h=s+1,(s=ZE(e,s))>=0?i=e.src.slice(h,s++):s=h-1),i||(void 0===i&&(s=r+1),i=e.src.slice(n,r)),!(l=e.env.references[ek(i)]))return e.pos=d,!1;o=l.href,a=l.title}return t||(e.pos=n,e.posMax=r,u?e.push({type:"image",src:o,title:a,alt:e.src.substr(n,r-n),level:e.level}):(e.push({type:"link_open",href:o,title:a,level:e.level++}),e.linkLevel++,e.parser.tokenize(e),e.linkLevel--,e.push({type:"link_close",level:--e.level}))),e.pos=s,e.posMax=p,!0}],["footnote_inline",function(e,t){var n,r,i,o,a=e.posMax,s=e.pos;return!(s+2>=a)&&(94===e.src.charCodeAt(s)&&(91===e.src.charCodeAt(s+1)&&(!(e.level>=e.options.maxNesting)&&(n=s+2,!((r=ZE(e,s+1))<0)&&(t||(e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.list||(e.env.footnotes.list=[]),i=e.env.footnotes.list.length,e.pos=n,e.posMax=r,e.push({type:"footnote_ref",id:i,level:e.level}),e.linkLevel++,o=e.tokens.length,e.parser.tokenize(e),e.env.footnotes.list[i]={tokens:e.tokens.splice(o)},e.linkLevel--),e.pos=r+1,e.posMax=a,!0)))))}],["footnote_ref",function(e,t){var n,r,i,o,a=e.posMax,s=e.pos;if(s+3>a)return!1;if(!e.env.footnotes||!e.env.footnotes.refs)return!1;if(91!==e.src.charCodeAt(s))return!1;if(94!==e.src.charCodeAt(s+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(r=s+2;r<a;r++){if(32===e.src.charCodeAt(r))return!1;if(10===e.src.charCodeAt(r))return!1;if(93===e.src.charCodeAt(r))break}return r!==s+2&&(!(r>=a)&&(r++,n=e.src.slice(s+2,r-1),void 0!==e.env.footnotes.refs[":"+n]&&(t||(e.env.footnotes.list||(e.env.footnotes.list=[]),e.env.footnotes.refs[":"+n]<0?(i=e.env.footnotes.list.length,e.env.footnotes.list[i]={label:n,count:0},e.env.footnotes.refs[":"+n]=i):i=e.env.footnotes.refs[":"+n],o=e.env.footnotes.list[i].count,e.env.footnotes.list[i].count++,e.push({type:"footnote_ref",id:i,subId:o,level:e.level})),e.pos=r,e.posMax=a,!0)))}],["autolink",function(e,t){var n,r,i,o,a,s=e.pos;return 60===e.src.charCodeAt(s)&&(!((n=e.src.slice(s)).indexOf(">")<0)&&((r=n.match(Yk))?!(Rk.indexOf(r[1].toLowerCase())<0)&&(a=KE(o=r[0].slice(1,-1)),!!e.parser.validateLink(o)&&(t||(e.push({type:"link_open",href:a,level:e.level}),e.push({type:"text",content:o,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=r[0].length,!0)):!!(i=n.match(Bk))&&(a=KE("mailto:"+(o=i[0].slice(1,-1))),!!e.parser.validateLink(a)&&(t||(e.push({type:"link_open",href:a,level:e.level}),e.push({type:"text",content:o,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=i[0].length,!0))))}],["htmltag",function(e,t){var n,r,i,o=e.pos;return!!e.options.html&&(i=e.posMax,!(60!==e.src.charCodeAt(o)||o+2>=i)&&(!(33!==(n=e.src.charCodeAt(o+1))&&63!==n&&47!==n&&!function(e){var t=32|e;return t>=97&&t<=122}(n))&&(!!(r=e.src.slice(o).match(Hk))&&(t||e.push({type:"htmltag",content:e.src.slice(o,o+r[0].length),level:e.level}),e.pos+=r[0].length,!0))))}],["entity",function(e,t){var n,r,i=e.pos,o=e.posMax;if(38!==e.src.charCodeAt(i))return!1;if(i+1<o)if(35===e.src.charCodeAt(i+1)){if(r=e.src.slice(i).match(qk))return t||(n="x"===r[1][0].toLowerCase()?parseInt(r[1].slice(1),16):parseInt(r[1],10),e.pending+=LE(n)?PE(n):PE(65533)),e.pos+=r[0].length,!0}else if(r=e.src.slice(i).match(Gk)){var a=TE(r[1]);if(r[1]!==a)return t||(e.pending+=a),e.pos+=r[0].length,!0}return t||(e.pending+="&"),e.pos++,!0}]];function Uk(){this.ruler=new WE;for(var e=0;e<zk.length;e++)this.ruler.push(zk[e][0],zk[e][1]);this.validateLink=Wk}function Wk(e){var t=e.trim().toLowerCase();return-1===(t=YE(t)).indexOf(":")||-1===["vbscript","javascript","file","data"].indexOf(t.split(":")[0])}Uk.prototype.skipToken=function(e){var t,n,r=this.ruler.getRules(""),i=r.length,o=e.pos;if((n=e.cacheGet(o))>0)e.pos=n;else{for(t=0;t<i;t++)if(r[t](e,!0))return void e.cacheSet(o,e.pos);e.pos++,e.cacheSet(o,e.pos)}},Uk.prototype.tokenize=function(e){for(var t,n,r=this.ruler.getRules(""),i=r.length,o=e.posMax;e.pos<o;){for(n=0;n<i&&!(t=r[n](e,!1));n++);if(t){if(e.pos>=o)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},Uk.prototype.parse=function(e,t,n,r){var i=new QE(e,this,t,n,r);this.tokenize(i)};var Qk={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","replacements","smartquotes","references","abbr2","footnote_tail"]},block:{rules:["blockquote","code","fences","footnote","heading","hr","htmlblock","lheading","list","paragraph","table"]},inline:{rules:["autolink","backticks","del","emphasis","entity","escape","footnote_ref","htmltag","links","newline","text"]}}},full:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{},block:{},inline:{}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","abbr2"]},block:{rules:["blockquote","code","fences","heading","hr","htmlblock","lheading","list","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","htmltag","links","newline","text"]}}}};function Zk(e,t,n){this.src=t,this.env=n,this.options=e.options,this.tokens=[],this.inlineMode=!1,this.inline=e.inline,this.block=e.block,this.renderer=e.renderer,this.typographer=e.typographer}function Jk(e,t){"string"!=typeof e&&(t=e,e="default"),t&&null!=t.linkify&&console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"),this.inline=new Uk,this.block=new Ck,this.core=new fk,this.renderer=new UE,this.ruler=new WE,this.options={},this.configure(Qk[e]),this.set(t||{})}Jk.prototype.set=function(e){DE(this.options,e)},Jk.prototype.configure=function(e){var t=this;if(!e)throw new Error("Wrong `remarkable` preset, check name/content");e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enable(e.components[n].rules,!0)})},Jk.prototype.use=function(e,t){return e(this,t),this},Jk.prototype.parse=function(e,t){var n=new Zk(this,e,t);return this.core.process(n),n.tokens},Jk.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},Jk.prototype.parseInline=function(e,t){var n=new Zk(this,e,t);return n.inlineMode=!0,this.core.process(n),n.tokens},Jk.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const Kk=new Jk,Xk=e=>{const{payload:t,hostConfig:n,onExecuteAction:i}=e,o=(0,r.useRef)(null),a=(0,r.useRef)(new ME.AdaptiveCard),[s,l]=(0,r.useState)(void 0),{processHTML:c}=pr();(0,r.useEffect)(()=>{ME.AdaptiveCard.onProcessMarkdown=(e,t)=>{const n=Kk.render(e),r=c(n);t.outputHtml=r,t.didProcess=!0}},[c]);const u=e=>{i?.(e)};return(0,r.useEffect)(()=>{a.current.onExecuteAction=u},[]),(0,r.useEffect)(()=>{a.current.hostConfig=new ME.HostConfig(n)},[n]),(0,r.useEffect)(()=>{if(!o.current)return;const e=a.current;try{e.parse(t);const n=e.render();if(n){o.current.innerHTML="",o.current.appendChild(n);o.current.querySelectorAll("[role='heading']").forEach(e=>{null===e.getAttribute("aria-level")&&e.setAttribute("aria-level","4")});const e=o.current.querySelector(".ac-container.ac-adaptiveCard[aria-label][tabindex='0']");if(e){const t=e.getAttribute("aria-label");t&&l(t)}}}catch(e){console.error("Unable to render Adaptive Card: ",e)}},[n,t]),rn({messageType:"adaptiveCard",data:{speakText:s},validation:()=>!!s}),(0,yt.jsx)("div",{ref:o})},$k="_adaptivecard-wrapper_v4uid_32",eC="_chatDisabled_v4uid_68",tC={fontFamily:"inherit",fontSizes:{small:10,default:14,medium:16,large:18,extraLarge:34},fontWeights:{lighter:300,default:400,bolder:600},lineHeights:{small:12,default:18.2,medium:22.4,large:23.4,extraLarge:40.8},containerStyles:{default:{backgroundColor:"#fff",foregroundColors:{default:{default:"var(--cc-black-10)",subtle:"var(--cc-black-40)"}}}}},nC="_eventPill_1n8e7_1",rC="_eventPillTextWrapper_1n8e7_11",iC=e=>{const{text:t,className:n,id:r}=e;return(0,yt.jsx)("div",{className:Dt(nC,n),id:r,"aria-live":"assertive",children:(0,yt.jsx)("div",{className:rC,children:(0,yt.jsx)(mm,{variant:"title2-semibold",component:"div",children:t})})})},oC=[{match:e=>"x-app-submit"===e?.data?._plugin?.type,component:()=>{const{message:e,"data-message-id":t}=tn(),n=e?.data?._plugin,r=(n?.data?n.data:void 0)||{},{success:i,text:o}=r;return rn({messageType:"event",data:{dataMessageId:t??""},validation:()=>!!t}),(0,yt.jsx)(iC,{text:i?o:"Submission failed"})}},{match:e=>!!e?.data?._cognigy?._webchat3?.type,component:()=>{const{message:e,"data-message-id":t}=tn();if(rn({messageType:"event",data:{dataMessageId:t??""},validation:()=>!!t}),"liveAgentEvent"!==e?.data?._cognigy?._webchat3?.type)return null;const n=e?.data?._cognigy?._webchat3?.payload?.text;return n?(0,yt.jsx)(iC,{text:n}):null}},{match:e=>"date-picker"===e?.data?._plugin?.type,component:()=>{const{action:e,message:t,messageParams:n,config:i}=tn(),o=(0,r.useMemo)(()=>((e,t)=>{if(!e?.data?._plugin||"date-picker"!==e.data._plugin.type)return;const n=e.data._plugin.data,r=e=>{switch(e){case"today":return hw().format("YYYY-MM-DD");case"tomorrow":return hw().add(1,"days").format("YYYY-MM-DD");case"yesterday":return hw().add(-1,"days").format("YYYY-MM-DD")}return e},i=e=>{switch(hw(e).isoWeekday()){case 6:case 7:return!0}return!1},o=n.dateFormat||"Y-m-d",a=r(n.defaultDate)||r(n.minDate)||void 0,s=n.locale||"us",l=(e=>{switch(e){case"au":return"en-au";case"ca":return"en-ca";case"gb":return"en-gb";case"us":return"en"}return e})(s),c=(e=>{switch(e){case"us":case"gb":case"au":case"ca":return"en"}return e})(s);let u=yw[c];const d=!!n.enableTime,p=n.time_24hr?"H:i":"h:i K",h=d?`${o} ${p}`:o,f=d?"L LT":"L";"gb"===s&&(u={...u,firstDayOfWeek:1});const m={nextArrow:Aw,prevArrow:Aw,defaultHour:n?.defaultHour||12,defaultMinute:n?.defaultMinute||0,hourIncrement:n?.hourIncrement||1,minuteIncrement:n?.minuteIncrement||5,noCalendar:!!n?.noCalendar,weekNumbers:!!n?.weekNumbers,dateFormat:h,defaultDate:a,disable:[],enable:[],enableTime:d,inline:!0,locale:u,maxDate:r(n.maxDate)||"",minDate:r(n.minDate)||"",mode:n.mode||"single",static:!0,time_24hr:!!n?.time_24hr,parseDate:e=>hw(e).toDate(),formatDate:n.dateFormat?void 0:e=>hw(e).locale(l).format(f),plugins:[(g={arrowIcon:Aw,customTranslations:t||{}},function(e){const{arrowIcon:t,customTranslations:n}=g,r=new WeakMap;function i(){if(!e?.config?.enableTime)return;const n=e?.timeContainer?.querySelector("span.flatpickr-am-pm");if(n&&!n.querySelector("span.arrowUp")){const r=e?.amPM?.innerText,i=e._createElement("span","arrowUp");"AM"===r&&i.classList.add("disabled"),i.innerHTML=t;const o=e._createElement("span","arrowDown");"PM"===r&&o.classList.add("disabled"),o.innerHTML=t,n.appendChild(i),n.appendChild(o)}}function o(t,i){if(!t)return;const o="prev"===i?n?.ariaLabels?.datePickerPreviousMonth||"Previous month":n?.ariaLabels?.datePickerNextMonth||"Next month";if(t.setAttribute("aria-label",o),t.setAttribute("role","button"),t.classList.contains("flatpickr-disabled")){t.setAttribute("aria-disabled","true"),t.removeAttribute("tabindex");const e=r.get(t);e&&(t.removeEventListener("keydown",e),r.delete(t))}else if(t.setAttribute("tabindex","0"),t.removeAttribute("aria-disabled"),!r.has(t)){const n=t=>{if("Enter"===t.key||" "===t.key){t.preventDefault();const n=t.target.classList.contains("flatpickr-prev-month");e.changeMonth(n?-1:1)}};r.set(t,n),t.addEventListener("keydown",n)}}return{onReady:[i,function(){if(!e?.config?.enableTime)return;const n=e?.timeContainer?.getElementsByClassName("arrowUp"),r=e?.timeContainer?.getElementsByClassName("arrowDown");if(n)for(let e=0;e<n.length;e++)n[e].innerHTML=t;if(r)for(let e=0;e<r.length;e++)r[e].innerHTML=t},function(){e?.calendarContainer?.setAttribute("tabindex","-1");const t=e?.calendarContainer?.getElementsByClassName("flatpickr-innerContainer")[0];t&&t.setAttribute("tabindex","0")},function(){if(e?.calendarContainer?.setAttribute("aria-labelledby","webchatDatePickerHeaderLabel"),e?.config?.enableTime){const t=e?.timeContainer?.getElementsByClassName("flatpickr-hour")?.[0];t?.setAttribute("tabIndex","0");const n=e?.timeContainer?.getElementsByClassName("flatpickr-minute")?.[0];n?.setAttribute("tabIndex","0");const r=e?.timeContainer?.getElementsByClassName("flatpickr-am-pm")?.[0];r?.setAttribute("tabIndex","0"),r?.setAttribute("role","button")}},function(){const t=e?.calendarContainer?.getElementsByClassName("flatpickr-current-month")[0],r=t?.getElementsByClassName("flatpickr-monthDropdown-months")?.[0];if(r){r.setAttribute("id","webchat-monthSelector-datepicker"),r.classList.add("webchat-monthSelector-datepicker"),r.removeAttribute("aria-label");const i=t?.querySelector("label[for='webchat-monthSelector-datepicker']");if(!i){const e=document.createElement("label");e.setAttribute("for","webchat-monthSelector-datepicker"),e.textContent=n?.datePickerMonthLabel||"Month",t?.prepend(e)}r.setAttribute("tabindex","0"),r.addEventListener("keydown",t=>{if("Enter"===t.key&&t.stopPropagation(),"ArrowUp"===t.key||"ArrowDown"===t.key){t.preventDefault(),t.stopPropagation();const n="ArrowDown"===t.key;e.changeMonth(n?1:-1)}})}},function(){const t=e?.calendarContainer?.getElementsByClassName("flatpickr-current-month")[0],r=t?.getElementsByClassName("cur-year")?.[0];if(r){const e=r?.parentElement;r.setAttribute("id","yearSelector-datepicker"),r.classList.add("yearSelector-datepicker"),r.removeAttribute("aria-label");const t=e?.querySelector("label[for='yearSelector-datepicker']");if(!t){const t=document.createElement("label");t.setAttribute("for","yearSelector-datepicker"),t.textContent=n?.datePickerYearLabel||"Year",e?.prepend(t)}r.setAttribute("tabindex","0")}},function(){const t=e?.calendarContainer?.querySelector(".flatpickr-prev-month"),n=e?.calendarContainer?.querySelector(".flatpickr-next-month");o(t,"prev"),o(n,"next")},function(){const t=e?.calendarContainer?.querySelector(".flatpickr-prev-month"),n=e?.calendarContainer?.querySelector(".flatpickr-next-month");t&&!t.dataset.observed&&(new MutationObserver(()=>{o(t,"prev")}).observe(t,{attributes:!0,attributeFilter:["class"]}),t.dataset.observed="true"),n&&!n.dataset.observed&&(new MutationObserver(()=>{o(n,"next")}).observe(n,{attributes:!0,attributeFilter:["class"]}),n.dataset.observed="true")},function(){const t=e?.calendarContainer?.getElementsByClassName("flatpickr-current-month")[0],n=t?.getElementsByClassName("flatpickr-monthDropdown-months")?.[0];if(n){if("true"===n.dataset.observed)return;let e=null;new MutationObserver(()=>{e&&clearTimeout(e),e=setTimeout(()=>{n.setAttribute("tabindex","0")},100)}).observe(n,{attributes:!0,childList:!1,subtree:!1}),n.dataset.observed="true"}},()=>{e?.loadedPlugins?.push("customElements")}],onDayCreate:[(e,t,n,r)=>{r.classList.contains("flatpickr-disabled")?r.setAttribute("aria-disabled","true"):r.removeAttribute("aria-disabled"),r.innerHTML=`<span class='dayInner'>${r.innerHTML}</span>`},function(){if(!e?.config?.weekNumbers)return;const t=e?.weekNumbers?.getElementsByClassName("flatpickr-day");if(t)for(let n=0;n<t.length;n++){const r=t[n]?.getElementsByClassName("weekdayInner");if(0===r.length){const r=e?.config?.getWeek(new Date)||0,i=t[n].innerHTML===r.toString()&&e?.currentYear===(new Date).getFullYear();t[n].innerHTML=`<span class='weekdayInner${i?" currentWeek":""}'>${t[n].innerHTML}</span>`}}}],onValueUpdate:[i]}})]};var g;const y=Array.isArray(n?.enable_disable)&&n.enable_disable.length>0?n.enable_disable:null,A=y?[...y].map(r).map(e=>"weekends"===e?i:e):[];if(n?.function_enable_disable&&n?.function_enable_disable?.length>0)try{const e=new Function(`"use strict"; return ${n.function_enable_disable}`)();"boolean"==typeof e(new Date)&&A.push(e)}catch(e){console.log(e)}return A.length>0?n.wantDisable?(m.disable=A,delete m.enable):m.enable=A:delete m.enable,m})(t,i?.settings?.customTranslations),[t,i?.settings?.customTranslations]),[a,s]=(0,r.useState)(!1),[l,c]=(0,r.useState)(""),u=(0,r.useRef)(null),d=nn("webchatDatePickerHeading");if(!t?.data?._plugin||"date-picker"!==t.data._plugin.type)return;const{openPickerButtonText:p,submitButtonText:h,enableTime:f,time_24hr:m,noCalendar:g,eventName:y}=t.data._plugin.data,A=p||"Pick date",v=h||"Confirm Selection",b=!!f,w=!!g,E=n?.isConversationEnded||n?.hasReply,k=()=>{s(!1),c(""),u.current?.focus()},C=(e,t)=>{t&&c(t)},_=i?.settings?.customTranslations?.ariaLabels?.closeDatePicker||"Close date-picker";return(0,yt.jsxs)("div",{"data-testid":"datepicker-message",children:[(0,yt.jsx)(Lm,{onClick:()=>{s(!0)},disabled:E,"data-testid":"button-open",ref:u,"aria-expanded":a,"aria-controls":`webchat-plugin-date-picker-${t.id}`,"aria-haspopup":"dialog",children:A}),a&&(0,yt.jsxs)("div",{id:`webchat-plugin-date-picker-${t.id}`,className:Dt(wb,"webchat-plugin-date-picker"),onKeyDown:e=>{const t=document.querySelector("div.webchat-plugin-date-picker"),{firstFocusable:n,lastFocusable:r,nextFocusable:i,prevFocusable:o}=(e=>{const t=e?.querySelectorAll('a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])'),n=t&&Array.from(t),r=n?.filter(e=>!(e.hasAttribute("disabled")||e.getAttribute("aria-hidden")||e instanceof HTMLInputElement&&e.readOnly||e instanceof HTMLTextAreaElement&&e.readOnly)),i=r&&r[0],o=r&&r[r.length-1],a=document.activeElement;let s=null;a&&e.contains(a)&&(s=a);let l=null,c=null;if(s&&r){const e=r.indexOf(s);-1!==e&&(l=r[e+1]||r[0],c=r[e-1]||r[r.length-1])}return{firstFocusable:i,lastFocusable:o,focusable:r,nextFocusable:l,prevFocusable:c}})(t),a=!e.shiftKey&&"Tab"===e.key,s=e.shiftKey&&"Tab"===e.key,{firstTimePickerField:l,lastTimePickerField:c}=((e,t,n)=>{if(!t||!e)return{firstTimePickerField:null,lastTimePickerField:null};const r=e?.getElementsByClassName("flatpickr-hour")?.[0],i=e?.getElementsByClassName("flatpickr-minute")?.[0],o=e?.getElementsByClassName("flatpickr-am-pm")?.[0];return{firstTimePickerField:r,lastTimePickerField:n?i:o}})(t,!!f,!!m);"Esc"!==e.key&&"Escape"!==e.key||k(),a&&(e.target===r?(e.preventDefault(),n?.focus()):e.target===c&&(e.preventDefault(),i?.focus())),s&&(e.target===n?(e.preventDefault(),r?.focus()):e.target===l&&(e.preventDefault(),o?.focus()))},tabIndex:0,role:"dialog","aria-modal":"true","aria-labelledby":d,children:[(0,yt.jsxs)("div",{className:Dt(Eb,"webchat-plugin-date-picker-header"),children:[(0,yt.jsx)("span",{className:kb}),(0,yt.jsx)("span",{className:Cb,children:(0,yt.jsx)(mm,{variant:"h2-semibold",component:"h4",className:"webchat-list-template-header-title",children:y||"Calendar"})}),(0,yt.jsx)("button",{onClick:k,"aria-label":_,className:_b,"data-testid":"button-close",autoFocus:!0,children:(0,yt.jsx)(Kf,{})})]}),(0,yt.jsxs)("div",{className:xb,children:[(0,yt.jsx)("div",{className:Dt(Mb,"webchat-plugin-date-picker-content"),children:(0,yt.jsx)(lw,{onChange:C,onReady:C,options:o})}),(0,yt.jsx)("div",{className:Dt(Tb,"webchat-plugin-date-picker-footer",b&&Sb,w&&Db),children:(0,yt.jsx)(Lm,{onClick:()=>{e&&e(l,null),k()},disabled:!l,"data-testid":"button-submit",children:v})})]})]})]})}},{match:(e,t)=>{const n=Lt(e,t);if(!n)return!1;const r=n?.message?.quick_replies&&n.message.quick_replies.length>0,i="button"===n?.message?.attachment?.payload?.template_type,o=n?.message?.text,a=t?.settings?.widgetSettings?.enableDefaultPreview,s=e?.data?._cognigy?._defaultPreview;return!(a&&!s&&e.text)&&(r||i||o)},component:e=>{const{onSetMessageAnimated:t}=e,{action:n,message:i,config:o,onEmitAnalytics:a,messageParams:s,openXAppOverlay:l,"data-message-id":c}=tn(),u=!!o?.settings?.behavior?.progressiveMessageRendering,d=o?.settings?.layout?.botOutputMaxWidthPercentage,p="bot"===i.source,h="engagement"===i.source,f=Lt(i,o),m=f?.message?.attachment,g=m?.payload?.text||f?.message?.text||"",y=(0,r.useMemo)(()=>m?.payload?.buttons||f?.message?.quick_replies||[],[m?.payload?.buttons,f?.message?.quick_replies]);(0,r.useEffect)(()=>{u&&(p||h)&&t&&i.id&&"start"===i.animationState&&!g&&t(i.id,"done")},[u,p,h,t,i.id,i.animationState,g]);const A=!o?.settings?.layout?.disableHtmlContentSanitization,v=o?.settings?.widgetSettings?.customAllowedHtmlTags,b=(0,r.useMemo)(()=>((e,t,n)=>{const{text:r,buttons:i}=e;return{textContent:mr(r,t,n),buttonLabels:i?.map(e=>{const r=Pt(e);return mr(r,t,n)||""})||[]}})({text:g,buttons:y},A,v),[g,y,A,v]),{textContent:w,buttonLabels:E}=b;rn({messageType:"textWithButtons",data:{text:w,buttons:E},validation:()=>E.length===y.length});const k="animating"===i.animationState||"start"===i.animationState,C=nn("webchatButtonTemplateHeader"),_=f?.message?.quick_replies&&f.message.quick_replies.length>0,M=_&&s?.hasReply||s?.isConversationEnded?void 0:n,T=_?"quick-reply":"buttons",S=p||h&&d?{maxWidth:`${d}%`}:{};return(0,yt.jsxs)("div",{className:`webchat-${T}-template-root`,children:[g&&(0,yt.jsx)(jf,{...e,content:g,className:`webchat-${T}-template-header`,id:C,ignoreLiveRegion:!0}),(!u||!k)&&(0,yt.jsx)(xm,{dataMessageId:c,action:M,buttonClassName:Dt(vw.button,`webchat-${T}-template-button`),containerClassName:Dt(vw.buttons,`webchat-${T}-template-replies-container`),containerStyle:S,payload:y,showUrlIcon:!0,config:o,onEmitAnalytics:a,templateTextId:C,openXAppOverlay:l})]})}},{match:(e,t)=>{const n=Lt(e,t);return!!n&&"image"===n?.message?.attachment?.type},component:()=>{const{message:e,config:t}=tn(),n=Lt(e,t),{url:i,altText:o,buttons:a}=n?.message?.attachment?.payload||{},s=a?.[0],l=(0,r.useRef)(null),c=void 0!==a?.find(e=>"type"in e&&"web_url"===e.type),[u,d]=(0,r.useState)(!1),p=(0,r.useMemo)(()=>({onExpand:()=>c&&d(!0),onClose:()=>{d(!1),l.current?.focus()},url:i,altText:o,isDownloadable:c,button:s}),[o,s,c,i]);return i?(0,yt.jsxs)(Hf.Provider,{value:p,children:[(0,yt.jsx)(Om,{ref:l}),u&&(0,yt.jsx)(am,{})]}):null}},{match:(e,t)=>{const n=Lt(e,t);return!!n&&"video"===n?.message?.attachment?.type},component:()=>{const{message:e,config:t}=tn(),n=Lt(e,t),{url:i,altText:o,captionsUrl:a}=n?.message?.attachment?.payload||{},s=(0,r.useRef)(null),[l,c]=(0,r.useState)(!1),u=(0,r.useRef)(null),d=(0,r.useRef)(null);rn({messageType:"video",data:{hasTranscript:!!o,hasCaptions:!!a},validation:()=>!!i});const p=(0,r.useCallback)(e=>{const n=document.getElementById("webchatChatHistoryWrapperLiveLogPanel");t?.settings?.widgetSettings?.enableAutoFocus&&n?.contains(document.activeElement)&&setTimeout(()=>{e.getInternalPlayer()?.focus()},100)},[t?.settings?.widgetSettings?.enableAutoFocus]),h=(0,r.useMemo)(()=>!l&&(0===d.current?.getCurrentTime()||void 0===d.current?.getCurrentTime()),[l]),f={attributes:{crossOrigin:"true"},tracks:[{kind:"subtitles",src:a,srcLang:"en-US",label:"On"}]};if(!i)return null;const m=t?.settings.customTranslations?.ariaLabels?.playVideo||"Play video";return(0,yt.jsxs)("div",{className:Dt(mg,o&&yg),children:[(0,yt.jsx)("div",{className:Dt(wg,"webchat-media-template-video"),ref:u,"data-testid":"video-message",role:h?"button":void 0,tabIndex:h?0:-1,"aria-label":h?m:void 0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),c(!l))},children:(0,yt.jsx)(fg,{ref:d,url:i,light:h,playing:l,controls:!0,className:gg,playIcon:(0,yt.jsx)(tm,{width:"35px",height:"35px"}),width:"unset",height:"unset",onPlay:()=>c(!0),onPause:()=>c(!1),onClickPreview:()=>c(!l),onReady:p,onStart:()=>{const e=d.current?.getInternalPlayer?.();e?.focus?.()},previewTabIndex:-1,config:{file:a?f:{}}})}),o&&(0,yt.jsxs)("div",{className:Ag,children:[(0,yt.jsx)(Lm,{className:Dt(vg,"webchat-buttons-template-button-video"),customIcon:(0,yt.jsx)(Xf,{className:bg,fontSize:10}),onClick:()=>s.current?.click(),children:"Download Transcript"}),(0,yt.jsx)("a",{ref:s,href:`data:text/plain;charset=utf-8,${encodeURIComponent(o)}`,download:"video-transcript.txt",style:{display:"none"},"aria-hidden":"true"})]})]})}},{match:(e,t)=>{const n=Lt(e,t);return!!n&&"audio"===n?.message?.attachment?.type},component:()=>{const{message:e,config:t}=tn(),n=Lt(e,t),{url:i,altText:o}=n?.message?.attachment?.payload||{},a=(0,r.useRef)(null),[s,l]=(0,r.useState)(!1),[c,u]=(0,r.useState)(0),[d,p]=(0,r.useState)(0),h=(0,r.useCallback)(e=>{const n=document.getElementById("webchatChatHistoryWrapperLiveLogPanel");t?.settings?.widgetSettings?.enableAutoFocus&&n?.contains(document.activeElement)&&setTimeout(()=>{e.getInternalPlayer()?.focus()},100)},[t?.settings?.widgetSettings?.enableAutoFocus]),f=(0,r.useCallback)(()=>{l(!0)},[]),m=(0,r.useCallback)(()=>{l(!1)},[]),g=(0,r.useCallback)(e=>{u(e.played)},[]),y=(0,r.useCallback)(e=>{p(e)},[]);return rn({messageType:"audio",data:{hasTranscript:!!o},validation:()=>!!i}),i?(0,yt.jsxs)("div",{className:Dt("webchat-media-template-audio",Eg),"data-testid":"audio-message",children:[(0,yt.jsx)(fg,{url:i,onReady:h,ref:a,playing:s,onPlay:f,onPause:m,onProgress:g,onDuration:y,height:0,width:0,style:{display:"none"},progressInterval:.1}),(0,yt.jsx)(yA,{playerRef:a,playing:s,progress:c,duration:d,handlePlay:f,handlePause:m,altText:o})]}):null}},{match:e=>{const t=e?.data?.attachments;return!!t},component:e=>{const{message:t}=tn(),n=t.data?.attachments,r=t.text;if(rn({messageType:"file",data:{text:r??"",attachments:n??[]},validation:()=>!!n&&n.length>0}),!n||0===n.length)return null;const i=[],o=[];return n.forEach(e=>{qt(e.mimeType)?i.push(e):o.push(e)}),(0,yt.jsxs)(yt.Fragment,{children:[(0,yt.jsxs)("div",{className:Dt(AA,"webchat-media-files-template-root"),children:[i.length>0&&(0,yt.jsx)("div",{className:Dt(vA,"webchat-media-template-image-container"),children:i.map((e,t)=>{const{fileName:r,size:i,url:o}=e;return(0,yt.jsx)("a",{href:o,target:"_blank",style:{textDecoration:"none"},children:(0,yt.jsx)("img",{src:o,alt:`${r} (${jt(i)})`,className:Dt(n.length>1?wA:bA,"webchat-media-template-image"),"data-testid":"image-message",title:`${r} (${jt(i)})`})},t)})}),o.length>0&&(0,yt.jsx)("div",{className:Dt(vA,"webchat-media-template-files-container"),children:o.map((e,t)=>{const{fileName:n,size:r,url:i}=e;return(0,yt.jsx)("a",{href:i,target:"_blank",style:{textDecoration:"none"},children:(0,yt.jsxs)("div",{className:Dt(EA,"webchat-media-template-file"),"data-testid":"file-message",children:[(0,yt.jsxs)("div",{className:kA,children:[(0,yt.jsx)(mm,{component:"span",variant:"title2-regular",className:CA,children:Vt(n)}),(0,yt.jsx)(mm,{component:"span",variant:"title2-regular",className:_A,children:Ft(n)})]}),(0,yt.jsx)(mm,{component:"span",variant:"title2-regular",className:MA,children:jt(r)})]})},t)})})]}),r&&(0,yt.jsx)(jf,{...e,content:r,ignoreLiveRegion:!0})]})}},{match:(e,t)=>{const n=Lt(e,t);return!!n&&"list"===n.message?.attachment?.payload?.template_type},component:()=>{const{message:e,messageParams:t,config:n,"data-message-id":i,action:o,onEmitAnalytics:a}=tn(),s=Lt(e,n),[l,c]=(0,r.useState)({}),{elements:u,top_element_style:d,buttons:p}=s?.message?.attachment?.payload||{},h="large"===d||!0===d,f=h?u?.slice(1):u,m=h?u?.[0]:null,g=p&&p?.[0],y=nn("webchatListTemplateRoot"),A=t?.isConversationEnded;(0,r.useEffect)(()=>{const e=document.getElementById("webchatChatHistoryWrapperLiveLogPanel");if(!n?.settings?.widgetSettings?.enableAutoFocus)return;if(!e?.contains(document.activeElement))return;const t=document.getElementById(y),r=t?.querySelectorAll('button, [href], [tabindex]:not([tabindex="-1"])'),i=r&&r[0];setTimeout(()=>{i?.focus()},200)},[n?.settings?.widgetSettings?.enableAutoFocus,y]),rn({messageType:"list",data:l,validation:()=>u?.length===Object.keys(l).length});const v=(0,r.useCallback)((e,t)=>{c(n=>n[e]===t?n:{...n,[e]:t})},[]);return u&&0!==u?.length?(0,yt.jsxs)("div",{className:Dt("webchat-list-template-root",TA),id:y,"data-testid":"list-message",children:[m&&(0,yt.jsx)(UA,{element:m,isHeaderElement:!0,headingLevel:"h4",id:`header-${y}`,onSetScreenReaderLabel:e=>{v(0,e)}}),(0,yt.jsx)("ul",{"aria-labelledby":m?`listHeader-header-${y}`:void 0,className:DA,children:f&&f.map((e,t)=>(0,yt.jsx)(r.Fragment,{children:(0,yt.jsx)(UA,{element:e,headingLevel:m?"h5":"h4",id:`${y}-${t}`,onSetScreenReaderLabel:e=>{v(t+1,e)},dividerBefore:t>0,dividerAfter:Boolean(g&&t===f.length-1)})},t))}),g&&(0,yt.jsx)(Lm,{isActionButton:!0,dataMessageId:i,action:A?void 0:o,button:g,buttonClassName:"webchat-list-template-global-button",containerClassName:qA,config:n,onEmitAnalytics:a})]}):null}},{match:(e,t)=>{const n=Lt(e,t);return!!n&&"generic"===n.message?.attachment?.payload?.template_type},component:()=>{const{message:e,config:t,"data-message-id":n}=tn(),i=!t?.settings?.layout?.disableHtmlContentSanitization,o=t?.settings?.widgetSettings?.customAllowedHtmlTags,{slide:a,actionButtonPositionText:s}=t?.settings?.customTranslations?.ariaLabels||{},l=Lt(e,t),{elements:c}=l?.message?.attachment?.payload||{},u=nn("webchatCarouselContentButton");(0,r.useEffect)(()=>{const e=document.getElementById("webchatChatHistoryWrapperLiveLogPanel"),n=document.getElementById(`${u}-0`),r=n?.getElementsByTagName("button")?.[0];t?.settings?.widgetSettings?.enableAutoFocus&&e?.contains(document.activeElement)&&("link"===n?.getAttribute("role")?setTimeout(()=>{n?.focus()},200):r&&setTimeout(()=>{r?.focus()},200))},[u,t?.settings?.widgetSettings?.enableAutoFocus]),(0,r.useEffect)(()=>{const e=document.querySelector(`[data-message-id="${n}"]`),t=e?.querySelector(".swiper-wrapper");t&&t.removeAttribute("aria-live")},[n]);const d=(0,r.useMemo)(()=>((e,t,n)=>e&&0!==e.length?e.map(e=>({slideText:`${mr(e.title,t,n)}. ${mr(e.subtitle,t,n)}`,buttonLabels:(e.buttons||[]).map(e=>mr(Pt(e),t,n))})):[])(c,i,o),[c,i,o]),p=(0,r.useMemo)(()=>{if(!a||!s)return"Slide {{index}} of {{slidesLength}}";return Rt(`${a}: ${s}`,{position:"{{index}}",total:"{{slidesLength}}"})},[a,s]);return rn({messageType:"gallery",data:{slides:d},validation:()=>!!c&&c.length>0&&d.length===c.length}),c&&0!==c?.length?1===c.length?(0,yt.jsx)("div",{className:Dt("webchat-carousel-template-root",WA.wrapper),"data-testid":"gallery-message",children:(0,yt.jsx)(bb,{slide:c[0],contentId:`${u}-0`})}):(0,yt.jsxs)(Ab,{modules:[vv,wv,Ev],spaceBetween:8,slidesPerView:"auto",navigation:{prevEl:".gallery-button-prev",nextEl:".gallery-button-next"},pagination:{clickable:!0},className:Dt("webchat-carousel-template-root",WA.wrapper),"data-testid":"gallery-message",a11y:{slideLabelMessage:p},children:[c.map((e,t)=>(0,yt.jsx)(vb,{style:{width:"206px"},children:(0,yt.jsx)(bb,{slide:e,contentId:`${u}-${t}`})},t)),(0,yt.jsx)("button",{className:"gallery-button-prev",children:(0,yt.jsx)(im,{})}),(0,yt.jsx)("button",{className:"gallery-button-next",children:(0,yt.jsx)(im,{})})]}):null}},{match:(e,t)=>{const n=e?.data?._cognigy?._webchat?.adaptiveCard,r=e?.data?._cognigy?._defaultPreview?.adaptiveCard,i="adaptivecards"===e?.data?._plugin?.type,o=t?.settings?.widgetSettings?.enableDefaultPreview;return(!e.data?._cognigy?._defaultPreview?.message||!o)&&!!(r&&o||n&&r&&!o||n||i)},component:()=>{const{message:e,messageParams:t,action:n,config:i}=tn(),o=(e=>{const t=e?.data?._cognigy?._webchat?.adaptiveCard,n=e?.data?._cognigy?._defaultPreview?.adaptiveCard,r=e?.data?._plugin?.payload,o=i?.settings?.widgetSettings?.enableDefaultPreview;return t&&n&&!o?t:n&&o?n:r||t})(e),a=t?.isConversationEnded,s=(0,r.useCallback)(e=>{if(!a)switch(e._propertyBag?.type){case"Action.Submit":return void n?.("",{adaptivecards:e._processedData,request:{value:e._processedData}});case"Action.OpenUrl":{const t=e._propertyBag?.url;return void window.open(t,"_blank")}}},[n,a]);return(0,yt.jsx)(an,{className:Dt($k,"adaptivecard-wrapper internal",a&&eC),children:(0,yt.jsx)(Xk,{payload:o,onExecuteAction:s,hostConfig:tC})})}},{match:(e,t)=>{return!("engagement"===e?.source&&!t?.settings?.teaserMessage?.showInChat||e?.data?.attachments)&&(Array.isArray(e?.text)?e?.text.length>0:!("string"==typeof(n=e.text)&&Bt.test(n)&&!t?.settings?.behavior?.collateStreamedOutputs)&&(null!=e?.text&&""!==e?.text));var n},component:jf,name:"Text"}];function aC(e,t,n=[]){const r=[...n,...oC],i=[];for(const n of r)if(n.match(e,t)&&(i.push(n),!n?.options?.passthrough))break;return i}const sC={header:"_header_21mid_1",incoming:"_incoming_21mid_8",headerMeta:"_headerMeta_21mid_13",outgoing:"_outgoing_21mid_19",timestamp:"_timestamp_21mid_23","avatar-name":"_avatar-name_21mid_27"},lC="_avatar_ry0w9_1",cC="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='50'%20height='49'%20viewBox='0%200%2050%2049'%20fill='none'%20aria-hidden='true'%3e%3crect%20x='0.5'%20width='49'%20height='49'%20rx='24.5'%20fill='var(--cc-primary-color,%20%232455e6)'/%3e%3c/svg%3e",uC=e=>{const{message:t}=tn(),[n,i]=(0,r.useState)(cC),o=t?.data?._webchat||{};(0,r.useEffect)(()=>{o.agentAvatarOverrideUrlOnce?i(o.agentAvatarOverrideUrlOnce):o.botAvatarOverrideUrlOnce?i(o.botAvatarOverrideUrlOnce):t?.avatarUrl?i(t.avatarUrl):"agent"!==t?.source&&i("data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20aria-hidden='true'%3e%3crect%20width='28'%20height='28'%20rx='14'%20fill='%232455E6'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11.0839%2010.611L6.96494%2020.4758H4.19922L9.70529%207.29932H12.4626L17.9686%2020.4758H15.2114L11.0839%2010.611ZM22.3168%207.29932V20.4758H19.418V7.29932H22.3168Z'%20fill='white'/%3e%3c/svg%3e")},[t.avatarUrl,t?.source,o.agentAvatarOverrideUrlOnce,o.botAvatarOverrideUrlOnce]);const a=Dt(lC,e.className,"webchat-avatar",t?.source);return(0,yt.jsx)("img",{alt:"",className:a,src:n,onError:()=>i(cC),"data-testid":`${t?.source||"unknown source"}-avatar`})},dC=e=>{const{message:t,config:n,onSetHeaderInfo:i}=tn(),o=n?.settings?.widgetSettings?.sourceDirectionMapping,a="user"===t.source,s="bot"===t.source,l="agent"===t.source,c=o?.user||"outgoing",u=o?.bot||"incoming",d=o?.agent||"incoming",p=Dt("message-header",e.className,sC.header,a&&sC[c],s&&sC[u],l&&sC[d]),h=t?.timestamp?Number(t.timestamp):Date.now(),f=t?.data?._webchat||{};let m=t?.avatarName||(l?"Agent":"Bot");f.agentAvatarOverrideNameOnce&&(m=f.agentAvatarOverrideNameOnce),f.botAvatarOverrideNameOnce&&(m=f.botAvatarOverrideNameOnce);const g=new Date(h).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),y=a?n?.settings.customTranslations?.ariaLabels?.messageHeader?.user??"You said:":Rt(n?.settings.customTranslations?.ariaLabels?.messageHeader?.bot??"{name} said:",{name:m});return(0,r.useEffect)(()=>{i&&i(y)},[i,y]),(0,yt.jsxs)("header",{className:p,"data-testid":"message-header",children:[e.enableAvatar&&(0,yt.jsx)(uC,{}),(0,yt.jsxs)("span",{className:GA,children:[(0,yt.jsx)("span",{"data-skip-live-region":!0,children:Rt(n?.settings.customTranslations?.ariaLabels?.messageHeader?.timestamp??"At {time},",{time:g})}),y]}),(0,yt.jsxs)(mm,{variant:"title2-regular",component:"div",className:sC.headerMeta,"aria-hidden":!0,children:[!a&&(0,yt.jsxs)(yt.Fragment,{children:[(0,yt.jsx)("span",{"data-testid":"sender-name",className:sC["avatar-name"],children:m}),(0,yt.jsx)(rm,{})]}),(0,yt.jsx)("span",{children:(0,yt.jsx)("time",{className:sC.timestamp,children:g})})]})]})},pC="_message_19l6s_1",hC="_collated_19l6s_20",fC="_fullscreen_19l6s_24",mC=new class{constructor(){bt(this,"firstBotMessageMap",new Map),bt(this,"COLLATION_LIMIT",6e4),bt(this,"SESSION_ID","default")}isMessageValid(e,t,n){if(!n)return!1;return!!aC(n,t,e).length}isMessageCollatable(e,t,n,r){const i=Number(e?.timestamp)-Number(r?.timestamp);if(t?.initialSessionId&&!this.SESSION_ID&&(this.SESSION_ID=t.initialSessionId),"x-app-submit"===e?.data?._plugin?.type)return!0;if("bot"!==e.source&&this.firstBotMessageMap.delete(this.SESSION_ID),"user"===r?.source&&"setRating"===r?.data?._cognigy?.controlCommands?.[0]?.type&&!0===r?.data?._cognigy?.controlCommands?.[0]?.parameters?.showRatingStatus)return!1;const o=this.isMessageValid(n,t,e);return!this.firstBotMessageMap.get(this.SESSION_ID)&&o&&"bot"===e.source?(this.firstBotMessageMap.set(this.SESSION_ID,e),!1):r&&!1===isNaN(i)&&i<this.COLLATION_LIMIT&&r?.source===e?.source}},gC=e=>{const{action:t,className:n,config:i,hasReply:o,isConversationEnded:a,isFullscreen:s,message:l,onDismissFullscreen:c,onEmitAnalytics:u,onSetFullscreen:d,openXAppOverlay:p,onSetMessageAnimated:h,onSetLiveRegionText:f,plugins:m,prevMessage:g,"data-message-id":y}=e,A=(0,r.useContext)(Yt)??void 0,v=A?A.isMessageCollatable(l,i,m,g):mC.isMessageCollatable(l,i,m,g),b=!v&&!s&&!(e=>!!e?.data?._cognigy?._webchat3?.type)(l),[w,E]=(0,r.useState)("");(0,r.useEffect)(()=>{b||E(null)},[b]);const k=Dt("webchat-message-row",l.source,n,pC,v&&hC,s&&fC),C=aC(l,i,m),_=(0,r.useMemo)(()=>({hasReply:o,isConversationEnded:a}),[o,a]);if(!Array.isArray(C)||C.length<1)return null;if(s){const n=C[0]?.component;if(n)return(0,yt.jsx)(n,{isFullscreen:s,message:l,onDismissFullscreen:c,onEmitAnalytics:u,onSendMessage:t,onSetFullscreen:d,prevMessage:g,theme:e.theme,attributes:{styles:{flexGrow:1,minHeight:0}},onSetMessageAnimated:e.onSetMessageAnimated})}return(0,yt.jsx)(It,{action:t,config:i,message:l,messageParams:_,onEmitAnalytics:u,openXAppOverlay:p,"data-message-id":y,onSetLiveRegionText:f,headerInfo:w,onSetHeaderInfo:E,children:(0,yt.jsxs)("article",{...l.id?{id:l.id}:{},className:k,"data-message-id":y,children:[b&&(0,yt.jsx)(dC,{enableAvatar:"user"!==l.source}),C.map((n,r)=>n.component?(0,yt.jsx)(n.component,{attributes:{styles:{}},isFullscreen:s,message:l,onDismissFullscreen:c,onEmitAnalytics:u,onSendMessage:t,onSetFullscreen:d,prevMessage:g,theme:e.theme,onSetMessageAnimated:h},r):null),(0,yt.jsx)("div",{id:`webchat-focus-target-${y}`,tabIndex:-1,className:GA,"aria-hidden":"true"})]})})},yC={typingIndicator:"_typingIndicator_10ekn_1",disableBorder:"_disableBorder_10ekn_18",incoming:"_incoming_10ekn_23",outgoing:"_outgoing_10ekn_27",dot:"_dot_10ekn_31",dot1:"_dot1_10ekn_1",dot2:"_dot2_10ekn_1",dot3:"_dot3_10ekn_1"};var AC,vC;function bC(){if(vC)return AC;vC=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>y}),e=u,AC=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();const f=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,m=/user\/([a-zA-Z0-9_-]+)\/?/,g=/youtube-nocookie\.com/;class y extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"parsePlaylist",e=>{if(e instanceof Array)return{listType:"playlist",playlist:e.map(this.getID).join(",")};if(f.test(e)){const[,t]=e.match(f);return{listType:"playlist",list:t.replace(/^UC/,"UU")}}if(m.test(e)){const[,t]=e.match(m);return{listType:"user_uploads",list:t}}return{}}),c(this,"onStateChange",e=>{const{data:t}=e,{onPlay:n,onPause:r,onBuffer:i,onBufferEnd:o,onEnded:a,onReady:s,loop:l,config:{playerVars:c,onUnstarted:u}}=this.props,{UNSTARTED:d,PLAYING:p,PAUSED:h,BUFFERING:f,ENDED:m,CUED:g}=window.YT.PlayerState;if(t===d&&u(),t===p&&(n(),o()),t===h&&r(),t===f&&i(),t===m){const e=!!this.callPlayer("getPlaylist");l&&!e&&(c.start?this.seekTo(c.start):this.play()),a()}t===g&&s()}),c(this,"mute",()=>{this.callPlayer("mute")}),c(this,"unmute",()=>{this.callPlayer("unMute")}),c(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}getID(e){return!e||e instanceof Array||f.test(e)?null:e.match(h.MATCH_URL_YOUTUBE)[1]}load(e,t){const{playing:n,muted:r,playsinline:i,controls:o,loop:a,config:s,onError:l}=this.props,{playerVars:c,embedOptions:u}=s,d=this.getID(e);if(t)return f.test(e)||m.test(e)||e instanceof Array?void this.player.loadPlaylist(this.parsePlaylist(e)):void this.player.cueVideoById({videoId:d,startSeconds:(0,p.parseStartTime)(e)||c.start,endSeconds:(0,p.parseEndTime)(e)||c.end});(0,p.getSDK)("https://www.youtube.com/iframe_api","YT","onYouTubeIframeAPIReady",e=>e.loaded).then(t=>{this.container&&(this.player=new t.Player(this.container,{width:"100%",height:"100%",videoId:d,playerVars:{autoplay:n?1:0,mute:r?1:0,controls:o?1:0,start:(0,p.parseStartTime)(e),end:(0,p.parseEndTime)(e),origin:window.location.origin,playsinline:i?1:0,...this.parsePlaylist(e),...c},events:{onReady:()=>{a&&this.player.setLoop(!0),this.props.onReady()},onPlaybackRateChange:e=>this.props.onPlaybackRateChange(e.data),onPlaybackQualityChange:e=>this.props.onPlaybackQualityChange(e),onStateChange:this.onStateChange,onError:e=>l(e.data)},host:g.test(e)?"https://www.youtube-nocookie.com":void 0,...u}))},l),u.events&&console.warn("Using `embedOptions.events` will likely break things. Use ReactPlayer’s callback props instead, eg onReady, onPlay, onPause")}play(){this.callPlayer("playVideo")}pause(){this.callPlayer("pauseVideo")}stop(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}seekTo(e,t=!1){this.callPlayer("seekTo",e),t||this.props.playing||this.pause()}setVolume(e){this.callPlayer("setVolume",100*e)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}render(){const{display:e}=this.props,t={width:"100%",height:"100%",display:e};return d.default.createElement("div",{style:t},d.default.createElement("div",{ref:this.ref}))}}return c(y,"displayName","YouTube"),c(y,"canPlay",h.canPlay.youtube),AC}var wC=bC();const EC=wt({__proto__:null,default:kt(wC)},[wC]);var kC,CC;function _C(){if(CC)return kC;CC=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>f}),e=u,kC=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();class f extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"duration",null),c(this,"currentTime",null),c(this,"fractionLoaded",null),c(this,"mute",()=>{this.setVolume(0)}),c(this,"unmute",()=>{null!==this.props.volume&&this.setVolume(this.props.volume)}),c(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,t){(0,p.getSDK)("https://w.soundcloud.com/player/api.js","SC").then(n=>{if(!this.iframe)return;const{PLAY:r,PLAY_PROGRESS:i,PAUSE:o,FINISH:a,ERROR:s}=n.Widget.Events;t||(this.player=n.Widget(this.iframe),this.player.bind(r,this.props.onPlay),this.player.bind(o,()=>{this.duration-this.currentTime<.05||this.props.onPause()}),this.player.bind(i,e=>{this.currentTime=e.currentPosition/1e3,this.fractionLoaded=e.loadedProgress}),this.player.bind(a,()=>this.props.onEnded()),this.player.bind(s,e=>this.props.onError(e))),this.player.load(e,{...this.props.config.options,callback:()=>{this.player.getDuration(e=>{this.duration=e/1e3,this.props.onReady()})}})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("seekTo",1e3*e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",100*e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.fractionLoaded*this.duration}render(){const{display:e}=this.props,t={width:"100%",height:"100%",display:e};return d.default.createElement("iframe",{ref:this.ref,src:`https://w.soundcloud.com/player/?url=${encodeURIComponent(this.props.url)}`,style:t,frameBorder:0,allow:"autoplay"})}}return c(f,"displayName","SoundCloud"),c(f,"canPlay",h.canPlay.soundcloud),c(f,"loopOnEnded",!0),kC}var MC=_C();const TC=wt({__proto__:null,default:kt(MC)},[MC]);var SC,DC;function xC(){if(DC)return SC;DC=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>m}),e=u,SC=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();const f=e=>e.replace("/manage/videos","");class m extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"duration",null),c(this,"currentTime",null),c(this,"secondsLoaded",null),c(this,"mute",()=>{this.setMuted(!0)}),c(this,"unmute",()=>{this.setMuted(!1)}),c(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){this.duration=null,(0,p.getSDK)("https://player.vimeo.com/api/player.js","Vimeo").then(t=>{if(!this.container)return;const{playerOptions:n,title:r}=this.props.config;this.player=new t.Player(this.container,{url:f(e),autoplay:this.props.playing,muted:this.props.muted,loop:this.props.loop,playsinline:this.props.playsinline,controls:this.props.controls,...n}),this.player.ready().then(()=>{const e=this.container.querySelector("iframe");e.style.width="100%",e.style.height="100%",r&&(e.title=r)}).catch(this.props.onError),this.player.on("loaded",()=>{this.props.onReady(),this.refreshDuration()}),this.player.on("play",()=>{this.props.onPlay(),this.refreshDuration()}),this.player.on("pause",this.props.onPause),this.player.on("seeked",e=>this.props.onSeek(e.seconds)),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({seconds:e})=>{this.currentTime=e}),this.player.on("progress",({seconds:e})=>{this.secondsLoaded=e}),this.player.on("bufferstart",this.props.onBuffer),this.player.on("bufferend",this.props.onBufferEnd),this.player.on("playbackratechange",e=>this.props.onPlaybackRateChange(e.playbackRate))},this.props.onError)}refreshDuration(){this.player.getDuration().then(e=>{this.duration=e})}play(){const e=this.callPlayer("play");e&&e.catch(this.props.onError)}pause(){this.callPlayer("pause")}stop(){this.callPlayer("unload")}seekTo(e,t=!0){this.callPlayer("setCurrentTime",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setMuted(e){this.callPlayer("setMuted",e)}setLoop(e){this.callPlayer("setLoop",e)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const{display:e}=this.props,t={width:"100%",height:"100%",overflow:"hidden",display:e};return d.default.createElement("div",{key:this.props.url,ref:this.ref,style:t})}}return c(m,"displayName","Vimeo"),c(m,"canPlay",h.canPlay.vimeo),c(m,"forceLoad",!0),SC}var IC=xC();const LC=wt({__proto__:null,default:kt(IC)},[IC]);var PC,OC;function RC(){if(OC)return PC;OC=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>h}),e=u,PC=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Wm();class h extends d.Component{constructor(){super(...arguments),c(this,"onReady",(...e)=>this.props.onReady(...e)),c(this,"onPlay",(...e)=>this.props.onPlay(...e)),c(this,"onBuffer",(...e)=>this.props.onBuffer(...e)),c(this,"onBufferEnd",(...e)=>this.props.onBufferEnd(...e)),c(this,"onPause",(...e)=>this.props.onPause(...e)),c(this,"onEnded",(...e)=>this.props.onEnded(...e)),c(this,"onError",(...e)=>this.props.onError(...e)),c(this,"onPlayBackRateChange",e=>this.props.onPlaybackRateChange(e.target.playbackRate)),c(this,"onEnablePIP",(...e)=>this.props.onEnablePIP(...e)),c(this,"onSeek",e=>{this.props.onSeek(e.target.currentTime)}),c(this,"onDurationChange",()=>{const e=this.getDuration();this.props.onDuration(e)}),c(this,"mute",()=>{this.player.muted=!0}),c(this,"unmute",()=>{this.player.muted=!1}),c(this,"ref",e=>{this.player=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this),this.addListeners(this.player);const e=this.getPlaybackId(this.props.url);e&&(this.player.playbackId=e)}componentWillUnmount(){this.player.playbackId=null,this.removeListeners(this.player)}addListeners(e){const{playsinline:t}=this.props;e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("ratechange",this.onPlayBackRateChange),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),e.addEventListener("canplay",this.onReady),t&&e.setAttribute("playsinline","")}removeListeners(e){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("ratechange",this.onPlayBackRateChange),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("canplay",this.onReady)}async load(e){var t;const{onError:n,config:r}=this.props;if(!(null==(t=globalThis.customElements)?void 0:t.get("mux-player")))try{const e="https://cdn.jsdelivr.net/npm/@mux/mux-player@VERSION/dist/mux-player.mjs".replace("VERSION",r.version);await import(`${e}`),this.props.onLoaded()}catch(e){n(e)}const[,i]=e.match(p.MATCH_URL_MUX);this.player.playbackId=i}play(){const e=this.player.play();e&&e.catch(this.props.onError)}pause(){this.player.pause()}stop(){this.player.playbackId=null}seekTo(e,t=!0){this.player.currentTime=e,t||this.pause()}setVolume(e){this.player.volume=e}enablePIP(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player&&this.player.requestPictureInPicture()}disablePIP(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player&&document.exitPictureInPicture()}setPlaybackRate(e){try{this.player.playbackRate=e}catch(e){this.props.onError(e)}}getDuration(){if(!this.player)return null;const{duration:e,seekable:t}=this.player;return e===1/0&&t.length>0?t.end(t.length-1):e}getCurrentTime(){return this.player?this.player.currentTime:null}getSecondsLoaded(){if(!this.player)return null;const{buffered:e}=this.player;if(0===e.length)return 0;const t=e.end(e.length-1),n=this.getDuration();return t>n?n:t}getPlaybackId(e){const[,t]=e.match(p.MATCH_URL_MUX);return t}render(){const{url:e,playing:t,loop:n,controls:r,muted:i,config:o,width:a,height:s}=this.props,l={width:"auto"===a?a:"100%",height:"auto"===s?s:"100%"};return!1===r&&(l["--controls"]="none"),d.default.createElement("mux-player",{ref:this.ref,"playback-id":this.getPlaybackId(e),style:l,preload:"auto",autoPlay:t||void 0,muted:i?"":void 0,loop:n?"":void 0,...o.attributes})}}return c(h,"displayName","Mux"),c(h,"canPlay",p.canPlay.mux),PC}var BC=RC();const YC=wt({__proto__:null,default:kt(BC)},[BC]);var NC,VC;function FC(){if(VC)return NC;VC=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>g}),e=u,NC=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();const f="https://connect.facebook.net/en_US/sdk.js",m="fbAsyncInit";class g extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"playerID",this.props.config.playerId||`facebook-player-${(0,p.randomString)()}`),c(this,"mute",()=>{this.callPlayer("mute")}),c(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,t){t?(0,p.getSDK)(f,"FB",m).then(e=>e.XFBML.parse()):(0,p.getSDK)(f,"FB",m).then(e=>{e.init({appId:this.props.config.appId,xfbml:!0,version:this.props.config.version}),e.Event.subscribe("xfbml.render",e=>{this.props.onLoaded()}),e.Event.subscribe("xfbml.ready",e=>{"video"===e.type&&e.id===this.playerID&&(this.player=e.instance,this.player.subscribe("startedPlaying",this.props.onPlay),this.player.subscribe("paused",this.props.onPause),this.player.subscribe("finishedPlaying",this.props.onEnded),this.player.subscribe("startedBuffering",this.props.onBuffer),this.player.subscribe("finishedBuffering",this.props.onBufferEnd),this.player.subscribe("error",this.props.onError),this.props.muted?this.callPlayer("mute"):this.callPlayer("unmute"),this.props.onReady(),document.getElementById(this.playerID).querySelector("iframe").style.visibility="visible")})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("seek",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentPosition")}getSecondsLoaded(){return null}render(){const{attributes:e}=this.props.config;return d.default.createElement("div",{style:{width:"100%",height:"100%"},id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false",...e})}}return c(g,"displayName","Facebook"),c(g,"canPlay",h.canPlay.facebook),c(g,"loopOnEnded",!0),NC}var jC=FC();const HC=wt({__proto__:null,default:kt(jC)},[jC]);var qC,GC;function zC(){if(GC)return qC;GC=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>f}),e=u,qC=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();class f extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"duration",null),c(this,"currentTime",null),c(this,"secondsLoaded",null),c(this,"mute",()=>{this.callPlayer("mute")}),c(this,"unmute",()=>{this.callPlayer("unmute")}),c(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,p.getSDK)("https://cdn.embed.ly/player-0.1.0.min.js","playerjs").then(e=>{this.iframe&&(this.player=new e.Player(this.iframe),this.player.setLoop(this.props.loop),this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seeked",this.props.onSeek),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({duration:e,seconds:t})=>{this.duration=e,this.currentTime=t}),this.player.on("buffered",({percent:e})=>{this.duration&&(this.secondsLoaded=this.duration*e)}),this.props.muted&&this.player.mute())},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("setCurrentTime",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",100*e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const e=this.props.url.match(h.MATCH_URL_STREAMABLE)[1];return d.default.createElement("iframe",{ref:this.ref,src:`https://streamable.com/o/${e}`,frameBorder:"0",scrolling:"no",style:{width:"100%",height:"100%"},allow:"encrypted-media; autoplay; fullscreen;"})}}return c(f,"displayName","Streamable"),c(f,"canPlay",h.canPlay.streamable),qC}var UC=zC();const WC=wt({__proto__:null,default:kt(UC)},[UC]);var QC,ZC;function JC(){if(ZC)return QC;ZC=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>f}),e=u,QC=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();class f extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"playerID",this.props.config.playerId||`wistia-player-${(0,p.randomString)()}`),c(this,"onPlay",(...e)=>this.props.onPlay(...e)),c(this,"onPause",(...e)=>this.props.onPause(...e)),c(this,"onSeek",(...e)=>this.props.onSeek(...e)),c(this,"onEnded",(...e)=>this.props.onEnded(...e)),c(this,"onPlaybackRateChange",(...e)=>this.props.onPlaybackRateChange(...e)),c(this,"mute",()=>{this.callPlayer("mute")}),c(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:t,muted:n,controls:r,onReady:i,config:o,onError:a}=this.props;(0,p.getSDK)("https://fast.wistia.com/assets/external/E-v1.js","Wistia").then(e=>{o.customControls&&o.customControls.forEach(t=>e.defineControl(t)),window._wq=window._wq||[],window._wq.push({id:this.playerID,options:{autoPlay:t,silentAutoPlay:"allow",muted:n,controlsVisibleOnLoad:r,fullscreenButton:r,playbar:r,playbackRateControl:r,qualityControl:r,volumeControl:r,settingsControl:r,smallPlayButton:r,...o.options},onReady:e=>{this.player=e,this.unbind(),this.player.bind("play",this.onPlay),this.player.bind("pause",this.onPause),this.player.bind("seek",this.onSeek),this.player.bind("end",this.onEnded),this.player.bind("playbackratechange",this.onPlaybackRateChange),i()}})},a)}unbind(){this.player.unbind("play",this.onPlay),this.player.unbind("pause",this.onPause),this.player.unbind("seek",this.onSeek),this.player.unbind("end",this.onEnded),this.player.unbind("playbackratechange",this.onPlaybackRateChange)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.unbind(),this.callPlayer("remove")}seekTo(e,t=!0){this.callPlayer("time",e),t||this.pause()}setVolume(e){this.callPlayer("volume",e)}setPlaybackRate(e){this.callPlayer("playbackRate",e)}getDuration(){return this.callPlayer("duration")}getCurrentTime(){return this.callPlayer("time")}getSecondsLoaded(){return null}render(){const{url:e}=this.props,t=e&&e.match(h.MATCH_URL_WISTIA)[1],n=`wistia_embed wistia_async_${t}`;return d.default.createElement("div",{id:this.playerID,key:t,className:n,style:{width:"100%",height:"100%"}})}}return c(f,"displayName","Wistia"),c(f,"canPlay",h.canPlay.wistia),c(f,"loopOnEnded",!0),QC}var KC=JC();const XC=wt({__proto__:null,default:kt(KC)},[KC]);var $C,e_;function t_(){if(e_)return $C;e_=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>f}),e=u,$C=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();class f extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"playerID",this.props.config.playerId||`twitch-player-${(0,p.randomString)()}`),c(this,"mute",()=>{this.callPlayer("setMuted",!0)}),c(this,"unmute",()=>{this.callPlayer("setMuted",!1)})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,t){const{playsinline:n,onError:r,config:i,controls:o}=this.props,a=h.MATCH_URL_TWITCH_CHANNEL.test(e),s=a?e.match(h.MATCH_URL_TWITCH_CHANNEL)[1]:e.match(h.MATCH_URL_TWITCH_VIDEO)[1];t?a?this.player.setChannel(s):this.player.setVideo("v"+s):(0,p.getSDK)("https://player.twitch.tv/js/embed/v1.js","Twitch").then(t=>{this.player=new t.Player(this.playerID,{video:a?"":s,channel:a?s:"",height:"100%",width:"100%",playsinline:n,autoplay:this.props.playing,muted:this.props.muted,controls:!!a||o,time:(0,p.parseStartTime)(e),...i.options});const{READY:r,PLAYING:l,PAUSE:c,ENDED:u,ONLINE:d,OFFLINE:h,SEEK:f}=t.Player;this.player.addEventListener(r,this.props.onReady),this.player.addEventListener(l,this.props.onPlay),this.player.addEventListener(c,this.props.onPause),this.player.addEventListener(u,this.props.onEnded),this.player.addEventListener(f,this.props.onSeek),this.player.addEventListener(d,this.props.onLoaded),this.player.addEventListener(h,this.props.onLoaded)},r)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.callPlayer("pause")}seekTo(e,t=!0){this.callPlayer("seek",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return null}render(){return d.default.createElement("div",{style:{width:"100%",height:"100%"},id:this.playerID})}}return c(f,"displayName","Twitch"),c(f,"canPlay",h.canPlay.twitch),c(f,"loopOnEnded",!0),$C}var n_=t_();const r_=wt({__proto__:null,default:kt(n_)},[n_]);var i_,o_;function a_(){if(o_)return i_;o_=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>f}),e=u,i_=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();class f extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"onDurationChange",()=>{const e=this.getDuration();this.props.onDuration(e)}),c(this,"mute",()=>{this.callPlayer("setMuted",!0)}),c(this,"unmute",()=>{this.callPlayer("setMuted",!1)}),c(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{controls:t,config:n,onError:r,playing:i}=this.props,[,o]=e.match(h.MATCH_URL_DAILYMOTION);this.player?this.player.load(o,{start:(0,p.parseStartTime)(e),autoplay:i}):(0,p.getSDK)("https://api.dmcdn.net/all.js","DM","dmAsyncInit",e=>e.player).then(i=>{if(!this.container)return;const a=i.player;this.player=new a(this.container,{width:"100%",height:"100%",video:o,params:{controls:t,autoplay:this.props.playing,mute:this.props.muted,start:(0,p.parseStartTime)(e),origin:window.location.origin,...n.params},events:{apiready:this.props.onReady,seeked:()=>this.props.onSeek(this.player.currentTime),video_end:this.props.onEnded,durationchange:this.onDurationChange,pause:this.props.onPause,playing:this.props.onPlay,waiting:this.props.onBuffer,error:e=>r(e)}})},r)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("seek",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.player.duration||null}getCurrentTime(){return this.player.currentTime}getSecondsLoaded(){return this.player.bufferedTime}render(){const{display:e}=this.props,t={width:"100%",height:"100%",display:e};return d.default.createElement("div",{style:t},d.default.createElement("div",{ref:this.ref}))}}return c(f,"displayName","DailyMotion"),c(f,"canPlay",h.canPlay.dailymotion),c(f,"loopOnEnded",!0),i_}var s_=a_();const l_=wt({__proto__:null,default:kt(s_)},[s_]);var c_,u_;function d_(){if(u_)return c_;u_=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>f}),e=u,c_=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();class f extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"duration",null),c(this,"currentTime",null),c(this,"secondsLoaded",null),c(this,"mute",()=>{}),c(this,"unmute",()=>{}),c(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,p.getSDK)("https://widget.mixcloud.com/media/js/widgetApi.js","Mixcloud").then(e=>{this.player=e.PlayerWidget(this.iframe),this.player.ready.then(()=>{this.player.events.play.on(this.props.onPlay),this.player.events.pause.on(this.props.onPause),this.player.events.ended.on(this.props.onEnded),this.player.events.error.on(this.props.error),this.player.events.progress.on((e,t)=>{this.currentTime=e,this.duration=t}),this.props.onReady()})},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("seek",e),t||this.pause()}setVolume(e){}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return null}render(){const{url:e,config:t}=this.props,n=e.match(h.MATCH_URL_MIXCLOUD)[1],r=(0,p.queryString)({...t.options,feed:`/${n}/`});return d.default.createElement("iframe",{key:n,ref:this.ref,style:{width:"100%",height:"100%"},src:`https://www.mixcloud.com/widget/iframe/?${r}`,frameBorder:"0",allow:"autoplay"})}}return c(f,"displayName","Mixcloud"),c(f,"canPlay",h.canPlay.mixcloud),c(f,"loopOnEnded",!0),c_}var p_=d_();const h_=wt({__proto__:null,default:kt(p_)},[p_]);var f_,m_;function g_(){if(m_)return f_;m_=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>f}),e=u,f_=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();class f extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"mute",()=>{this.setVolume(0)}),c(this,"unmute",()=>{null!==this.props.volume&&this.setVolume(this.props.volume)}),c(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:t,config:n,onError:r,onDuration:i}=this.props,o=e&&e.match(h.MATCH_URL_VIDYARD)[1];this.player&&this.stop(),(0,p.getSDK)("https://play.vidyard.com/embed/v4.js","VidyardV4","onVidyardAPI").then(e=>{this.container&&(e.api.addReadyListener((e,t)=>{this.player||(this.player=t,this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seek",this.props.onSeek),this.player.on("playerComplete",this.props.onEnded))},o),e.api.renderPlayer({uuid:o,container:this.container,autoplay:t?1:0,...n.options}),e.api.getPlayerMetadata(o).then(e=>{this.duration=e.length_in_seconds,i(e.length_in_seconds)}))},r)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){window.VidyardV4.api.destroyPlayer(this.player)}seekTo(e,t=!0){this.callPlayer("seek",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setPlaybackRate(e){this.callPlayer("setPlaybackSpeed",e)}getDuration(){return this.duration}getCurrentTime(){return this.callPlayer("currentTime")}getSecondsLoaded(){return null}render(){const{display:e}=this.props,t={width:"100%",height:"100%",display:e};return d.default.createElement("div",{style:t},d.default.createElement("div",{ref:this.ref}))}}return c(f,"displayName","Vidyard"),c(f,"canPlay",h.canPlay.vidyard),f_}var y_=g_();const A_=wt({__proto__:null,default:kt(y_)},[y_]);var v_,b_;function w_(){if(b_)return v_;b_=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>f}),e=u,v_=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();class f extends d.Component{constructor(){super(...arguments),c(this,"callPlayer",p.callPlayer),c(this,"duration",null),c(this,"currentTime",null),c(this,"secondsLoaded",null),c(this,"mute",()=>{this.callPlayer("mute")}),c(this,"unmute",()=>{this.callPlayer("unmute")}),c(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,p.getSDK)("https://cdn.embed.ly/player-0.1.0.min.js","playerjs").then(e=>{this.iframe&&(this.player=new e.Player(this.iframe),this.player.on("ready",()=>{setTimeout(()=>{this.player.isReady=!0,this.player.setLoop(this.props.loop),this.props.muted&&this.player.mute(),this.addListeners(this.player,this.props),this.props.onReady()},500)}))},this.props.onError)}addListeners(e,t){e.on("play",t.onPlay),e.on("pause",t.onPause),e.on("ended",t.onEnded),e.on("error",t.onError),e.on("timeupdate",({duration:e,seconds:t})=>{this.duration=e,this.currentTime=t})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("setCurrentTime",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){return d.default.createElement("iframe",{ref:this.ref,src:this.props.url,frameBorder:"0",scrolling:"no",style:{width:"100%",height:"100%"},allow:"encrypted-media; autoplay; fullscreen;",referrerPolicy:"no-referrer-when-downgrade"})}}return c(f,"displayName","Kaltura"),c(f,"canPlay",h.canPlay.kaltura),v_}var E_=w_();const k_=wt({__proto__:null,default:kt(E_)},[E_]);var C_,__;function M_(){if(__)return C_;__=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>b}),e=u,C_=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r),p=Um(),h=Wm();const f="undefined"!=typeof navigator,m=f&&"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,g=f&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||m)&&!window.MSStream,y=f&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream,A=/www\.dropbox\.com\/.+/,v=/https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/;class b extends d.Component{constructor(){super(...arguments),c(this,"onReady",(...e)=>this.props.onReady(...e)),c(this,"onPlay",(...e)=>this.props.onPlay(...e)),c(this,"onBuffer",(...e)=>this.props.onBuffer(...e)),c(this,"onBufferEnd",(...e)=>this.props.onBufferEnd(...e)),c(this,"onPause",(...e)=>this.props.onPause(...e)),c(this,"onEnded",(...e)=>this.props.onEnded(...e)),c(this,"onError",(...e)=>this.props.onError(...e)),c(this,"onPlayBackRateChange",e=>this.props.onPlaybackRateChange(e.target.playbackRate)),c(this,"onEnablePIP",(...e)=>this.props.onEnablePIP(...e)),c(this,"onDisablePIP",e=>{const{onDisablePIP:t,playing:n}=this.props;t(e),n&&this.play()}),c(this,"onPresentationModeChange",e=>{if(this.player&&(0,p.supportsWebKitPresentationMode)(this.player)){const{webkitPresentationMode:t}=this.player;"picture-in-picture"===t?this.onEnablePIP(e):"inline"===t&&this.onDisablePIP(e)}}),c(this,"onSeek",e=>{this.props.onSeek(e.target.currentTime)}),c(this,"mute",()=>{this.player.muted=!0}),c(this,"unmute",()=>{this.player.muted=!1}),c(this,"renderSourceElement",(e,t)=>"string"==typeof e?d.default.createElement("source",{key:t,src:e}):d.default.createElement("source",{key:t,...e})),c(this,"renderTrack",(e,t)=>d.default.createElement("track",{key:t,...e})),c(this,"ref",e=>{this.player&&(this.prevPlayer=this.player),this.player=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this),this.addListeners(this.player);const e=this.getSource(this.props.url);e&&(this.player.src=e),(g||this.props.config.forceDisableHls)&&this.player.load()}componentDidUpdate(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&(this.removeListeners(this.prevPlayer,e.url),this.addListeners(this.player)),this.props.url===e.url||(0,p.isMediaStream)(this.props.url)||this.props.url instanceof Array||(this.player.srcObject=null)}componentWillUnmount(){this.player.removeAttribute("src"),this.removeListeners(this.player),this.hls&&this.hls.destroy()}addListeners(e){const{url:t,playsinline:n}=this.props;e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("ratechange",this.onPlayBackRateChange),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.addEventListener("canplay",this.onReady),n&&(e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e.setAttribute("x5-playsinline",""))}removeListeners(e,t){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("ratechange",this.onPlayBackRateChange),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.removeEventListener("canplay",this.onReady)}shouldUseAudio(e){return!e.config.forceVideo&&(!e.config.attributes.poster&&(h.AUDIO_EXTENSIONS.test(e.url)||e.config.forceAudio))}shouldUseHLS(e){return!!(y&&this.props.config.forceSafariHLS||this.props.config.forceHLS)||!g&&!this.props.config.forceDisableHls&&(h.HLS_EXTENSIONS.test(e)||v.test(e))}shouldUseDASH(e){return h.DASH_EXTENSIONS.test(e)||this.props.config.forceDASH}shouldUseFLV(e){return h.FLV_EXTENSIONS.test(e)||this.props.config.forceFLV}load(e){const{hlsVersion:t,hlsOptions:n,dashVersion:r,flvVersion:i}=this.props.config;if(this.hls&&this.hls.destroy(),this.dash&&this.dash.reset(),this.shouldUseHLS(e)&&(0,p.getSDK)("https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js".replace("VERSION",t),"Hls").then(t=>{if(this.hls=new t(n),this.hls.on(t.Events.MANIFEST_PARSED,()=>{this.props.onReady()}),this.hls.on(t.Events.ERROR,(e,n)=>{this.props.onError(e,n,this.hls,t)}),v.test(e)){const t=e.match(v)[1];this.hls.loadSource("https://videodelivery.net/{id}/manifest/video.m3u8".replace("{id}",t))}else this.hls.loadSource(e);this.hls.attachMedia(this.player),this.props.onLoaded()}),this.shouldUseDASH(e)&&(0,p.getSDK)("https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js".replace("VERSION",r),"dashjs").then(t=>{this.dash=t.MediaPlayer().create(),this.dash.initialize(this.player,e,this.props.playing),this.dash.on("error",this.props.onError),parseInt(r)<3?this.dash.getDebug().setLogToBrowserConsole(!1):this.dash.updateSettings({debug:{logLevel:t.Debug.LOG_LEVEL_NONE}}),this.props.onLoaded()}),this.shouldUseFLV(e)&&(0,p.getSDK)("https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js".replace("VERSION",i),"flvjs").then(t=>{this.flv=t.createPlayer({type:"flv",url:e}),this.flv.attachMediaElement(this.player),this.flv.on(t.Events.ERROR,(e,n)=>{this.props.onError(e,n,this.flv,t)}),this.flv.load(),this.props.onLoaded()}),e instanceof Array)this.player.load();else if((0,p.isMediaStream)(e))try{this.player.srcObject=e}catch(t){this.player.src=window.URL.createObjectURL(e)}}play(){const e=this.player.play();e&&e.catch(this.props.onError)}pause(){this.player.pause()}stop(){this.player.removeAttribute("src"),this.dash&&this.dash.reset()}seekTo(e,t=!0){this.player.currentTime=e,t||this.pause()}setVolume(e){this.player.volume=e}enablePIP(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():(0,p.supportsWebKitPresentationMode)(this.player)&&"picture-in-picture"!==this.player.webkitPresentationMode&&this.player.webkitSetPresentationMode("picture-in-picture")}disablePIP(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():(0,p.supportsWebKitPresentationMode)(this.player)&&"inline"!==this.player.webkitPresentationMode&&this.player.webkitSetPresentationMode("inline")}setPlaybackRate(e){try{this.player.playbackRate=e}catch(e){this.props.onError(e)}}getDuration(){if(!this.player)return null;const{duration:e,seekable:t}=this.player;return e===1/0&&t.length>0?t.end(t.length-1):e}getCurrentTime(){return this.player?this.player.currentTime:null}getSecondsLoaded(){if(!this.player)return null;const{buffered:e}=this.player;if(0===e.length)return 0;const t=e.end(e.length-1),n=this.getDuration();return t>n?n:t}getSource(e){const t=this.shouldUseHLS(e),n=this.shouldUseDASH(e),r=this.shouldUseFLV(e);if(!(e instanceof Array||(0,p.isMediaStream)(e)||t||n||r))return A.test(e)?e.replace("www.dropbox.com","dl.dropboxusercontent.com"):e}render(){const{url:e,playing:t,loop:n,controls:r,muted:i,config:o,width:a,height:s}=this.props,l=this.shouldUseAudio(this.props)?"audio":"video",c={width:"auto"===a?a:"100%",height:"auto"===s?s:"100%"};return d.default.createElement(l,{ref:this.ref,src:this.getSource(e),style:c,preload:"auto",autoPlay:t||void 0,controls:r,muted:i,loop:n,...o.attributes},e instanceof Array&&e.map(this.renderSourceElement),o.tracks.map(this.renderTrack))}}return c(b,"displayName","FilePlayer"),c(b,"canPlay",h.canPlay.file),C_}var T_=M_();const S_=wt({__proto__:null,default:kt(T_)},[T_]);var D_,x_;function I_(){if(x_)return D_;x_=1;var e,t=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},c=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{default:()=>f}),e=u,D_=l(n({},"__esModule",{value:!0}),e);var d=((e,r,i)=>(i=null!=e?t(a(e)):{},l(e&&e.__esModule?i:n(i,"default",{value:e,enumerable:!0}),e)))(r);const p="64px",h={};class f extends d.Component{constructor(){super(...arguments),c(this,"mounted",!1),c(this,"state",{image:null}),c(this,"handleKeyPress",e=>{"Enter"!==e.key&&" "!==e.key||this.props.onClick()})}componentDidMount(){this.mounted=!0,this.fetchImage(this.props)}componentDidUpdate(e){const{url:t,light:n}=this.props;e.url===t&&e.light===n||this.fetchImage(this.props)}componentWillUnmount(){this.mounted=!1}fetchImage({url:e,light:t,oEmbedUrl:n}){if(!d.default.isValidElement(t))if("string"!=typeof t){if(!h[e])return this.setState({image:null}),window.fetch(n.replace("{url}",e)).then(e=>e.json()).then(t=>{if(t.thumbnail_url&&this.mounted){const n=t.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");this.setState({image:n}),h[e]=n}});this.setState({image:h[e]})}else this.setState({image:t})}render(){const{light:e,onClick:t,playIcon:n,previewTabIndex:r,previewAriaLabel:i}=this.props,{image:o}=this.state,a=d.default.isValidElement(e),s={display:"flex",alignItems:"center",justifyContent:"center"},l={preview:{width:"100%",height:"100%",backgroundImage:o&&!a?`url(${o})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...s},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:p,width:p,height:p,position:a?"absolute":void 0,...s},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},c=d.default.createElement("div",{style:l.shadow,className:"react-player__shadow"},d.default.createElement("div",{style:l.playIcon,className:"react-player__play-icon"}));return d.default.createElement("div",{style:l.preview,className:"react-player__preview",onClick:t,tabIndex:r,onKeyPress:this.handleKeyPress,...i?{"aria-label":i}:{}},a?e:null,n||c)}}return D_}var L_=I_();const P_=wt({__proto__:null,default:kt(L_)},[L_]);var O_=r.createContext(null);var R_=function(e){e()},B_=function(){return R_};var Y_={notify:function(){},get:function(){return[]}};function N_(e,t){var n,r=Y_;function i(){a.onStateChange&&a.onStateChange()}function o(){n||(n=t?t.addNestedSub(i):e.subscribe(i),r=function(){var e=B_(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e(function(){for(var e=t;e;)e.callback(),e=e.next})},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,i=n={callback:e,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){r&&null!==t&&(r=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}())}var a={addNestedSub:function(e){return o(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:i,isSubscribed:function(){return Boolean(n)},trySubscribe:o,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=Y_)},getListeners:function(){return r}};return a}var V_="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.useLayoutEffect:r.useEffect;const F_=function(e){var t=e.store,n=e.context,i=e.children,o=(0,r.useMemo)(function(){var e=N_(t);return{store:t,subscription:e}},[t]),a=(0,r.useMemo)(function(){return t.getState()},[t]);V_(function(){var e=o.subscription;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),a!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}},[o,a]);var s=n||O_;return r.createElement(s.Provider,{value:o},i)};function j_(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}var H_=i(6456),q_=i.n(H_),G_=i(3443),z_=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],U_=["reactReduxForwardedRef"],W_=[],Q_=[null,null];function Z_(e,t){var n=e[1];return[t.payload,n+1]}function J_(e,t,n){V_(function(){return e.apply(void 0,t)},n)}function K_(e,t,n,r,i,o,a){e.current=r,t.current=i,n.current=!1,o.current&&(o.current=null,a())}function X_(e,t,n,r,i,o,a,s,l,c){if(e){var u=!1,d=null,p=function(){if(!u){var e,n,p=t.getState();try{e=r(p,i.current)}catch(e){n=e,d=e}n||(d=null),e===o.current?a.current||l():(o.current=e,s.current=e,a.current=!0,c({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=p,n.trySubscribe(),p();return function(){if(u=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var $_=function(){return[null,0]};function eM(e,t){void 0===t&&(t={});var n=t,i=n.getDisplayName,o=void 0===i?function(e){return"ConnectAdvanced("+e+")"}:i,a=n.methodName,l=void 0===a?"connectAdvanced":a,c=n.renderCountProp,u=void 0===c?void 0:c,d=n.shouldHandleStateChanges,p=void 0===d||d,h=n.storeKey,f=void 0===h?"store":h,m=(n.withRef,n.forwardRef),g=void 0!==m&&m,y=n.context,A=void 0===y?O_:y,v=j_(n,z_),b=A;return function(t){var n=t.displayName||t.name||"Component",i=o(n),a=s({},v,{getDisplayName:o,methodName:l,renderCountProp:u,shouldHandleStateChanges:p,storeKey:f,displayName:i,wrappedComponentName:n,WrappedComponent:t}),c=v.pure;var d=c?r.useMemo:function(e){return e()};function h(n){var i=(0,r.useMemo)(function(){var e=n.reactReduxForwardedRef,t=j_(n,U_);return[n.context,e,t]},[n]),o=i[0],l=i[1],c=i[2],u=(0,r.useMemo)(function(){return o&&o.Consumer&&(0,G_.isContextConsumer)(r.createElement(o.Consumer,null))?o:b},[o,b]),h=(0,r.useContext)(u),f=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(h)&&Boolean(h.store);var m=f?n.store:h.store,g=(0,r.useMemo)(function(){return function(t){return e(t.dispatch,a)}(m)},[m]),y=(0,r.useMemo)(function(){if(!p)return Q_;var e=N_(m,f?null:h.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]},[m,f,h]),A=y[0],v=y[1],w=(0,r.useMemo)(function(){return f?h:s({},h,{subscription:A})},[f,h,A]),E=(0,r.useReducer)(Z_,W_,$_),k=E[0][0],C=E[1];if(k&&k.error)throw k.error;var _=(0,r.useRef)(),M=(0,r.useRef)(c),T=(0,r.useRef)(),S=(0,r.useRef)(!1),D=d(function(){return T.current&&c===M.current?T.current:g(m.getState(),c)},[m,k,c]);J_(K_,[M,_,S,c,D,T,v]),J_(X_,[p,m,A,g,M,_,S,T,v,C],[m,A,g]);var x=(0,r.useMemo)(function(){return r.createElement(t,s({},D,{ref:l}))},[l,t,D]);return(0,r.useMemo)(function(){return p?r.createElement(u.Provider,{value:w},x):x},[u,x,w])}var m=c?r.memo(h):h;if(m.WrappedComponent=t,m.displayName=h.displayName=i,g){var y=r.forwardRef(function(e,t){return r.createElement(m,s({},e,{reactReduxForwardedRef:t}))});return y.displayName=i,y.WrappedComponent=t,q_()(y,t)}return q_()(m,t)}}function tM(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function nM(e,t){if(tM(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!tM(e[n[i]],t[n[i]]))return!1;return!0}function rM(e){return function(t,n){var r=e(t,n);function i(){return r}return i.dependsOnOwnProps=!1,i}}function iM(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function oM(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=iM(e);var i=r(t,n);return"function"==typeof i&&(r.mapToProps=i,r.dependsOnOwnProps=iM(i),i=r(t,n)),i},r}}const aM=[function(e){return"function"==typeof e?oM(e):void 0},function(e){return e?void 0:rM(function(e){return{dispatch:e}})},function(e){return e&&"object"==typeof e?rM(function(t){return function(e,t){var n={},r=function(r){var i=e[r];"function"==typeof i&&(n[r]=function(){return t(i.apply(void 0,arguments))})};for(var i in e)r(i);return n}(e,t)}):void 0}];const sM=[function(e){return"function"==typeof e?oM(e):void 0},function(e){return e?void 0:rM(function(){return{}})}];function lM(e,t,n){return s({},n,e,t)}const cM=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,i=n.pure,o=n.areMergedPropsEqual,a=!1;return function(t,n,s){var l=e(t,n,s);return a?i&&o(l,r)||(r=l):(a=!0,r=l),r}}}(e):void 0},function(e){return e?void 0:function(){return lM}}];var uM=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function dM(e,t,n,r){return function(i,o){return n(e(i,o),t(r,o),o)}}function pM(e,t,n,r,i){var o,a,s,l,c,u=i.areStatesEqual,d=i.areOwnPropsEqual,p=i.areStatePropsEqual,h=!1;function f(i,h){var f,m,g=!d(h,a),y=!u(i,o,h,a);return o=i,a=h,g&&y?(s=e(o,a),t.dependsOnOwnProps&&(l=t(r,a)),c=n(s,l,a)):g?(e.dependsOnOwnProps&&(s=e(o,a)),t.dependsOnOwnProps&&(l=t(r,a)),c=n(s,l,a)):y?(f=e(o,a),m=!p(f,s),s=f,m&&(c=n(s,l,a)),c):c}return function(i,u){return h?f(i,u):(s=e(o=i,a=u),l=t(r,a),c=n(s,l,a),h=!0,c)}}function hM(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,i=t.initMergeProps,o=j_(t,uM),a=n(e,o),s=r(e,o),l=i(e,o);return(o.pure?pM:dM)(a,s,l,e,o)}var fM=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function mM(e,t,n){for(var r=t.length-1;r>=0;r--){var i=t[r](e);if(i)return i}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function gM(e,t){return e===t}function yM(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?eM:n,i=t.mapStateToPropsFactories,o=void 0===i?sM:i,a=t.mapDispatchToPropsFactories,l=void 0===a?aM:a,c=t.mergePropsFactories,u=void 0===c?cM:c,d=t.selectorFactory,p=void 0===d?hM:d;return function(e,t,n,i){void 0===i&&(i={});var a=i,c=a.pure,d=void 0===c||c,h=a.areStatesEqual,f=void 0===h?gM:h,m=a.areOwnPropsEqual,g=void 0===m?nM:m,y=a.areStatePropsEqual,A=void 0===y?nM:y,v=a.areMergedPropsEqual,b=void 0===v?nM:v,w=j_(a,fM),E=mM(e,o,"mapStateToProps"),k=mM(t,l,"mapDispatchToProps"),C=mM(n,u,"mergeProps");return r(p,s({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:E,initMapDispatchToProps:k,initMergeProps:C,pure:d,areStatesEqual:f,areOwnPropsEqual:g,areStatePropsEqual:A,areMergedPropsEqual:b},w))}}const AM=yM();function vM(){return(0,r.useContext)(O_)}function bM(e){void 0===e&&(e=O_);var t=e===O_?vM:function(){return(0,r.useContext)(e)};return function(){return t().store}}var wM=bM();function EM(e){void 0===e&&(e=O_);var t=e===O_?wM:bM(e);return function(){return t().dispatch}}var kM=EM(),CM=function(e,t){return e===t};function _M(e){void 0===e&&(e=O_);var t=e===O_?vM:function(){return(0,r.useContext)(e)};return function(e,n){void 0===n&&(n=CM);var i=t(),o=function(e,t,n,i){var o,a=(0,r.useReducer)(function(e){return e+1},0),s=a[1],l=(0,r.useMemo)(function(){return N_(n,i)},[n,i]),c=(0,r.useRef)(),u=(0,r.useRef)(),d=(0,r.useRef)(),p=(0,r.useRef)(),h=n.getState();try{if(e!==u.current||h!==d.current||c.current){var f=e(h);o=void 0!==p.current&&t(f,p.current)?p.current:f}else o=p.current}catch(e){throw c.current&&(e.message+="\nThe error may be correlated with this previous error:\n"+c.current.stack+"\n\n"),e}return V_(function(){u.current=e,d.current=h,p.current=o,c.current=void 0}),V_(function(){function e(){try{var e=n.getState();if(e===d.current)return;var r=u.current(e);if(t(r,p.current))return;p.current=r,d.current=e}catch(e){c.current=e}s()}return l.onStateChange=e,l.trySubscribe(),e(),function(){return l.tryUnsubscribe()}},[n,l]),o}(e,n,i.store,i.subscription);return(0,r.useDebugValue)(o),o}}var MM,TM=_M();MM=At.unstable_batchedUpdates,R_=MM;const SM={match:e=>!!(e=>{const{source:t,data:n}=e;if("user"===t&&"setRating"===n?._cognigy?.controlCommands?.[0]?.type&&!0===n?._cognigy?.controlCommands?.[0]?.parameters?.showRatingStatus){const{comment:t,rating:n}=e?.data?._cognigy?.controlCommands?.[0]?.parameters||{};return{comment:t,rating:n}}if(void 0!==e?.rating){const{rating:t,ratingComment:n}=e;return{rating:t,comment:n}}return null})(e),component:()=>{const e=TM(e=>e.rating.requestRatingChatStatusBadgeText);return r.createElement(iC,{text:e||"Feedback submitted"})},options:{fullwidth:!0}};(e=>{window&&(window.cognigyWebchatMessagePlugins=[...window.cognigyWebchatMessagePlugins||[],e],console.debug("added cognigy message plugin"))})(SM);function DM(e){return DM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},DM(e)}function xM(e){var t=function(e,t){if("object"!=DM(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=DM(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==DM(t)?t:t+""}function IM(e,t,n){return(t=xM(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function PM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LM(Object(n),!0).forEach(function(t){IM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function OM(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var RM="function"==typeof Symbol&&Symbol.observable||"@@observable",BM=function(){return Math.random().toString(36).substring(7).split("").join(".")},YM={INIT:"@@redux/INIT"+BM(),REPLACE:"@@redux/REPLACE"+BM(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+BM()}};function NM(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function VM(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(OM(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(OM(1));return n(VM)(e,t)}if("function"!=typeof e)throw new Error(OM(2));var i=e,o=t,a=[],s=a,l=!1;function c(){s===a&&(s=a.slice())}function u(){if(l)throw new Error(OM(3));return o}function d(e){if("function"!=typeof e)throw new Error(OM(4));if(l)throw new Error(OM(5));var t=!0;return c(),s.push(e),function(){if(t){if(l)throw new Error(OM(6));t=!1,c();var n=s.indexOf(e);s.splice(n,1),a=null}}}function p(e){if(!NM(e))throw new Error(OM(7));if(void 0===e.type)throw new Error(OM(8));if(l)throw new Error(OM(9));try{l=!0,o=i(o,e)}finally{l=!1}for(var t=a=s,n=0;n<t.length;n++){(0,t[n])()}return e}return p({type:YM.INIT}),(r={dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(OM(10));i=e,p({type:YM.REPLACE})}})[RM]=function(){var e,t=d;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(OM(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[RM]=function(){return this},e},r}function FM(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var i=t[r];0,"function"==typeof e[i]&&(n[i]=e[i])}var o,a=Object.keys(n);try{!function(e){Object.keys(e).forEach(function(t){var n=e[t];if(void 0===n(void 0,{type:YM.INIT}))throw new Error(OM(12));if(void 0===n(void 0,{type:YM.PROBE_UNKNOWN_ACTION()}))throw new Error(OM(13))})}(n)}catch(e){o=e}return function(e,t){if(void 0===e&&(e={}),o)throw o;for(var r=!1,i={},s=0;s<a.length;s++){var l=a[s],c=n[l],u=e[l],d=c(u,t);if(void 0===d){t&&t.type;throw new Error(OM(14))}i[l]=d,r=r||d!==u}return(r=r||a.length!==Object.keys(e).length)?i:e}}function jM(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}function HM(){return String(Math.random()).slice(2,18)}const qM=/^[\s\b]+$/u;const GM={messageHistory:[],visibleOutputMessages:[],currentlyAnimatingId:null},zM=(e,t)=>({type:"ADD_MESSAGE",message:e,unseen:t}),UM="CLEAR_MESSAGES",WM=()=>({type:UM}),QM=e=>e.data?._cognigy?._messageId,ZM=(e,t,n)=>!(e||"engagement"===t.source&&n||(e=>!!e.data?._plugin)(t)),JM=e=>(t=GM,n)=>{switch(n.type){case"ADD_MESSAGE_EVENT":return{...t,messageHistory:[...t.messageHistory,n.event]};case"ADD_MESSAGE":{const i=n.message,o=e().config?.settings?.behavior?.collateStreamedOutputs,a=e().config?.settings?.behavior?.progressiveMessageRendering,s=!1===e().config?.settings?.teaserMessage?.showInChat;if(!o&&!a||"bot"!==i.source&&"engagement"!==i.source)return{...t,messageHistory:[...t.messageHistory,i]};const l=t.visibleOutputMessages;let c=QM(i),u=t.currentlyAnimatingId;if(!i.text&&!c){const e=function(e){const{_facebook:t,_webchat:n}=e?.data?._cognigy||{},r=n||t||{};return!!(r?.message?.quick_replies&&r.message.quick_replies.length>0)||"button"===r?.message?.attachment?.payload?.template_type||!!r?.message?.text}(i),n=HM();t.currentlyAnimatingId||l.push(n);return ZM(u,i,s)&&(u=e?n:null),{...t,messageHistory:[...t.messageHistory,{...i,id:n,animationState:e?"start":"done",finishReason:"stop"}],visibleOutputMessages:l,currentlyAnimatingId:u}}let d=-1;o&&c&&(d=t.messageHistory.findIndex(e=>{if("text"in e){const t=QM(e);if(t)return t===c}return!1}));const p=((e,t)=>t?e.data?._cognigy?._finishReason:"stop")(i,c);c&&o||(c=HM());if(ZM(u,i,s)&&(u=c),-1===d&&(!i.text||"string"==typeof(r=i.text)&&qM.test(r)))return t;if(-1===d){t.currentlyAnimatingId||l.push(c);const e=i.text.split(/(\n)/).filter(e=>e.length>0);return{...t,messageHistory:[...t.messageHistory,{...i,text:e,id:c,animationState:"start",finishReason:o?p:"stop"}],visibleOutputMessages:l,currentlyAnimatingId:u}}const h=t.messageHistory[d],f=[...t.messageHistory];if(p)return f[d]={...h,finishReason:p},{...t,messageHistory:f};const m=Array.isArray(h.text)?h.text:[h.text];let g="start";return"exited"===h.animationState&&(g="exited"),i.text||(g=h.animationState),f[d]={...h,text:[...m,i.text],animationState:g,finishReason:p},{...t,messageHistory:f}}case"SET_MESSAGE_ANIMATED":{const e=t.messageHistory.findIndex(e=>"id"in e&&e.id===n.messageId);if(-1===e)return t;const r=new Set(t.visibleOutputMessages);let i=t.currentlyAnimatingId;if("done"===n.animationState||"exited"===n.animationState){let n=!1;for(let o=e+1;o<t.messageHistory.length;o++){const e=t.messageHistory[o];if(("bot"===e.source||"engagement"===e.source)&&"id"in e&&(r.add(e.id),"start"===e.animationState&&!n)){i=e.id,n=!0;break}}n||(i=null)}const o=t.messageHistory.filter(e=>"id"in e&&r.has(e.id)).map(e=>"id"in e?e.id:"");return{...t,messageHistory:t.messageHistory.map(e=>"id"in e&&e.id===n.messageId?{...e,animationState:n.animationState}:e),visibleOutputMessages:o,currentlyAnimatingId:i}}case UM:return{...t,messageHistory:[]};default:return t}var r},{hidden:KM,visibilityChange:XM}=void 0!==document.hidden?{hidden:"hidden",visibilityChange:"visibilitychange"}:void 0!==document.msHidden?{hidden:"msHidden",visibilityChange:"msvisibilitychange"}:void 0!==document.webkitHidden?{hidden:"webkitHidden",visibilityChange:"webkitvisibilitychange"}:{hidden:void 0,visibilityChange:void 0},$M=()=>KM&&void 0!==document[KM],eT=()=>!$M()||!document[KM];$M()||console.log('Page visibility API seems to be unsupported, page will always count as "visible".');const tT="SET_OPEN",nT=e=>({type:tT,open:e}),rT="SET_MINIMIZE",iT="SET_SHOW_HOME_SCREEN",oT=e=>({type:iT,showHomeScreen:e}),aT="SET_SHOW_PREV_CONVERSATIONS",sT="SET_SHOW_CHAT_OPTIONS",lT=e=>({type:sT,showChatOptionsScreen:e}),cT="SET_TYPING",uT=e=>({type:cT,typing:e}),dT="SET_INPUT_MODE",pT="SET_FULLSCREEN_MESSAGE",hT=e=>({type:pT,fullscreenMessage:e}),fT="SET_AGENT_AVATAR_OVERRIDE_URL",mT="SET_BOT_AVATAR_OVERRIDE_URL",gT="SET_PAGE_VISIBLE",yT="SET_HAS_ACCEPTED_TERMS",AT=e=>({type:yT,userId:e}),vT="SET_STORED_MESSAGE",bT=e=>({type:vT,message:e}),wT="SET_TTS_ACTIVE",ET=e=>({type:wT,active:e}),kT="SET_LAST_INPUT_ID",CT=(e=(()=>({open:!1,typing:"remove",inputMode:"text",fullscreenMessage:void 0,agentAvatarOverrideUrl:void 0,botAvatarOverrideUrl:void 0,isPageVisible:eT(),showHomeScreen:!0,showPrevConversations:!1,showChatOptionsScreen:!1,hasAcceptedTerms:!1,storedMessage:null,ttsActive:!1,lastInputId:""}))(),t)=>{switch(t.type){case tT:return{...e,open:t.open};case rT:return{...e,open:!1};case cT:return{...e,typing:t.typing};case iT:return{...e,showHomeScreen:t.showHomeScreen};case aT:return{...e,showPrevConversations:t.showPrevConversations};case sT:return{...e,showChatOptionsScreen:t.showChatOptionsScreen};case dT:return{...e,inputMode:t.inputMode};case pT:return{...e,fullscreenMessage:t.fullscreenMessage};case fT:return{...e,agentAvatarOverrideUrl:t.url};case mT:return{...e,botAvatarOverrideUrl:t.url};case gT:return{...e,isPageVisible:t.visible};case yT:return{...e,hasAcceptedTerms:!0};case vT:return{...e,storedMessage:t.message};case wT:return{...e,ttsActive:t.active};case kT:return{...e,lastInputId:t.id}}return e},_T="SHOW_RATING_SCREEN",MT=e=>({type:_T,show:e}),TT="SET_HAS_GIVEN_RATING",ST="SET_REQUEST_RATING_SCREEN_TITLE",DT="SET_CUSTOM_RATING_TITLE",xT="SET_CUSTOM_RATING_COMMENT_TEXT",IT="SET_REQUEST_RATING_SUBMIT_BUTTON_TEXT",LT="SET_REQUEST_RATING_EVENT_BANNER_TEXT",PT="SET_REQUEST_RATING_CHAT_STATUS_BADGE_TEXT",OT={hasGivenRating:!1,showRatingScreen:!1,requestRatingScreenTitle:"",customRatingTitle:"",customRatingCommentText:"",requestRatingSubmitButtonText:"",requestRatingEventBannerText:"",requestRatingChatStatusBadgeText:""},RT=(e={hasGivenRating:!1,showRatingScreen:!1,requestRatingScreenTitle:"",customRatingTitle:"",customRatingCommentText:"",requestRatingSubmitButtonText:"",requestRatingEventBannerText:"",requestRatingChatStatusBadgeText:""},t)=>{switch(t.type){case _T:return!1===t.show?{...e,showRatingScreen:t.show,requestRatingScreenTitle:"",customRatingTitle:"",customRatingCommentText:"",requestRatingSubmitButtonText:"",requestRatingEventBannerText:""}:{...e,showRatingScreen:t.show};case TT:return{...e,hasGivenRating:!0};case ST:return{...e,requestRatingScreenTitle:t.text};case DT:return{...e,customRatingTitle:t.text};case xT:return{...e,customRatingCommentText:t.text};case IT:return{...e,requestRatingSubmitButtonText:t.text};case LT:return{...e,requestRatingEventBannerText:t.text};case PT:return{...e,requestRatingChatStatusBadgeText:t.text}}return e},BT=e=>{let t="";return e?.text?t=e.text:e?.data?._cognigy?._webchat?.message?.text?t=e.data._cognigy._webchat.message.text:"template"===e?.data?._cognigy?._webchat?.message?.attachment?.type&&"button"===e?.data?._cognigy?._webchat?.message?.attachment?.payload?.template_type&&(t=e.data._cognigy._webchat.message.attachment.payload.text),Array.isArray(t)&&(t=t.map(e=>e.replace(/(<([^>]+)>)/gi,""))),"string"==typeof t&&(t=t.replace(/(<([^>]+)>)/gi,"")),t},YT=BT;var NT=Symbol.for("immer-nothing"),VT=Symbol.for("immer-draftable"),FT=Symbol.for("immer-state");function jT(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var HT=Object,qT=HT.getPrototypeOf,GT="constructor",zT="prototype",UT="configurable",WT="enumerable",QT="writable",ZT="value",JT=e=>!!e&&!!e[FT];function KT(e){return!!e&&(eS(e)||aS(e)||!!e[VT]||!!e[GT]?.[VT]||sS(e)||lS(e))}var XT=HT[zT][GT].toString(),$T=new WeakMap;function eS(e){if(!e||!cS(e))return!1;const t=qT(e);if(null===t||t===HT[zT])return!0;const n=HT.hasOwnProperty.call(t,GT)&&t[GT];if(n===Object)return!0;if(!uS(n))return!1;let r=$T.get(n);return void 0===r&&(r=Function.toString.call(n),$T.set(n,r)),r===XT}function tS(e,t,n=!0){if(0===nS(e)){(n?Reflect.ownKeys(e):HT.keys(e)).forEach(n=>{t(n,e[n],e)})}else e.forEach((n,r)=>t(r,n,e))}function nS(e){const t=e[FT];return t?t.type_:aS(e)?1:sS(e)?2:lS(e)?3:0}var rS=(e,t,n=nS(e))=>2===n?e.has(t):HT[zT].hasOwnProperty.call(e,t),iS=(e,t,n=nS(e))=>2===n?e.get(t):e[t],oS=(e,t,n,r=nS(e))=>{2===r?e.set(t,n):3===r?e.add(n):e[t]=n};var aS=Array.isArray,sS=e=>e instanceof Map,lS=e=>e instanceof Set,cS=e=>"object"==typeof e,uS=e=>"function"==typeof e,dS=e=>"boolean"==typeof e;var pS=e=>e.copy_||e.base_,hS=e=>e.modified_?e.copy_:e.base_;function fS(e,t){if(sS(e))return new Map(e);if(lS(e))return new Set(e);if(aS(e))return Array[zT].slice.call(e);const n=eS(e);if(!0===t||"class_only"===t&&!n){const t=HT.getOwnPropertyDescriptors(e);delete t[FT];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const i=n[r],o=t[i];!1===o[QT]&&(o[QT]=!0,o[UT]=!0),(o.get||o.set)&&(t[i]={[UT]:!0,[QT]:!0,[WT]:o[WT],[ZT]:e[i]})}return HT.create(qT(e),t)}{const t=qT(e);if(null!==t&&n)return{...e};const r=HT.create(t);return HT.assign(r,e)}}function mS(e,t=!1){return yS(e)||JT(e)||!KT(e)||(nS(e)>1&&HT.defineProperties(e,{set:gS,add:gS,clear:gS,delete:gS}),HT.freeze(e),t&&tS(e,(e,t)=>{mS(t,!0)},!1)),e}var gS={[ZT]:function(){jT(2)}};function yS(e){return null===e||!cS(e)||HT.isFrozen(e)}var AS="MapSet",vS="Patches",bS="ArrayMethods",wS={};function ES(e){const t=wS[e];return t||jT(0),t}var kS,CS=e=>!!wS[e];var _S=()=>kS;function MS(e,t){t&&(e.patchPlugin_=ES(vS),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function TS(e){SS(e),e.drafts_.forEach(xS),e.drafts_=null}function SS(e){e===kS&&(kS=e.parent_)}var DS=e=>kS={drafts_:[],parent_:kS,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:CS(AS)?ES(AS):void 0,arrayMethodsPlugin_:CS(bS)?ES(bS):void 0};function xS(e){const t=e[FT];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function IS(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(void 0!==e&&e!==n){n[FT].modified_&&(TS(t),jT(4)),KT(e)&&(e=LS(t,e));const{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[FT].base_,e,t)}else e=LS(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&mS(t,n)}(t,e,!0),TS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==NT?e:void 0}function LS(e,t){if(yS(t))return t;const n=t[FT];if(!n){return VS(t,e.handledSet_,e)}if(!OS(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:t}=n;if(t)for(;t.length>0;){t.pop()(e)}YS(n,e)}return n.copy_}function PS(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var OS=(e,t)=>e.scope_===t,RS=[];function BS(e,t,n,r){const i=pS(e),o=e.type_;if(void 0!==r){if(iS(i,r,o)===t)return void oS(i,r,n,o)}if(!e.draftLocations_){const t=e.draftLocations_=new Map;tS(i,(e,n)=>{if(JT(n)){const r=t.get(n)||[];r.push(e),t.set(n,r)}})}const a=e.draftLocations_.get(t)??RS;for(const e of a)oS(i,e,n,o)}function YS(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:n}=t;if(n){const r=n.getPath(e);r&&n.generatePatches_(e,r,t)}PS(e)}}function NS(e,t,n){const{scope_:r}=e;if(JT(n)){const i=n[FT];OS(i,r)&&i.callbacks_.push(function(){zS(e);const r=hS(i);BS(e,n,r,t)})}else KT(n)&&e.callbacks_.push(function(){const i=pS(e);3===e.type_?i.has(n)&&VS(n,r.handledSet_,r):iS(i,t,e.type_)===n&&r.drafts_.length>1&&!0===(e.assigned_.get(t)??!1)&&e.copy_&&VS(iS(e.copy_,t,e.type_),r.handledSet_,r)})}function VS(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||JT(e)||t.has(e)||!KT(e)||yS(e)||(t.add(e),tS(e,(r,i)=>{if(JT(i)){const t=i[FT];if(OS(t,n)){const n=hS(t);oS(e,r,n,e.type_),PS(t)}}else KT(i)&&VS(i,t,n)})),e}var FS={get(e,t){if(t===FT)return e;let n=e.scope_.arrayMethodsPlugin_;const r=1===e.type_&&"string"==typeof t;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=pS(e);if(!rS(i,t,e.type_))return function(e,t,n){const r=qS(t,n);return r?ZT in r?r[ZT]:r.get?.call(e.draft_):void 0}(e,i,t);const o=i[t];if(e.finalized_||!KT(o))return o;if(r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&function(e){const t=+e;return Number.isInteger(t)&&String(t)===e}(t))return o;if(o===HS(e.base_,t)){zS(e);const n=1===e.type_?+t:t,r=US(e.scope_,o,e,n);return e.copy_[n]=r}return o},has:(e,t)=>t in pS(e),ownKeys:e=>Reflect.ownKeys(pS(e)),set(e,t,n){const r=qS(pS(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=HS(pS(e),t),i=r?.[FT];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(n,r)&&(void 0!==n||rS(e.base_,t,e.type_)))return!0;zS(e),GS(e)}return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),NS(e,t,n)),!0},deleteProperty:(e,t)=>(zS(e),void 0!==HS(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),GS(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=pS(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{[QT]:!0,[UT]:1!==e.type_||"length"!==t,[WT]:r[WT],[ZT]:n[t]}:r},defineProperty(){jT(11)},getPrototypeOf:e=>qT(e.base_),setPrototypeOf(){jT(12)}},jS={};for(let e in FS){let t=FS[e];jS[e]=function(){const e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function HS(e,t){const n=e[FT];return(n?pS(n):e)[t]}function qS(e,t){if(!(t in e))return;let n=qT(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=qT(n)}}function GS(e){e.modified_||(e.modified_=!0,e.parent_&&GS(e.parent_))}function zS(e){e.copy_||(e.assigned_=new Map,e.copy_=fS(e.base_,e.scope_.immer_.useStrictShallowCopy_))}jS.deleteProperty=function(e,t){return jS.set.call(this,e,t,void 0)},jS.set=function(e,t,n){return FS.set.call(this,e[0],t,n,e[0])};function US(e,t,n,r){const[i,o]=sS(t)?ES(AS).proxyMap_(t,n):lS(t)?ES(AS).proxySet_(t,n):function(e,t){const n=aS(e),r={type_:n?1:0,scope_:t?t.scope_:_S(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,o=FS;n&&(i=[r],o=jS);const{revoke:a,proxy:s}=Proxy.revocable(i,o);return r.draft_=s,r.revoke_=a,[s,r]}(t,n);return(n?.scope_??_S()).drafts_.push(i),o.callbacks_=n?.callbacks_??[],o.key_=r,n&&void 0!==r?function(e,t,n){e.callbacks_.push(function(r){const i=t;if(!i||!OS(i,r))return;r.mapSetPlugin_?.fixSetContents(i);const o=hS(i);BS(e,i.draft_??i,o,n),YS(i,r)})}(n,o,r):o.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(o);const{patchPlugin_:t}=e;o.modified_&&t&&t.generatePatches_(o,[],e)}),i}function WS(e){if(!KT(e)||yS(e))return e;const t=e[FT];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=fS(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=fS(e,!0);return tS(n,(e,t)=>{oS(n,e,WS(t))},r),t&&(t.finalized_=!1),n}var QS=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(uS(e)&&!uS(t)){const n=t;t=e;const r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}let r;if(uS(t)||jT(6),void 0===n||uS(n)||jT(7),KT(e)){const i=DS(this),o=US(i,e,void 0);let a=!0;try{r=t(o),a=!1}finally{a?TS(i):SS(i)}return MS(i,n),IS(r,i)}if(!e||!cS(e)){if(r=t(e),void 0===r&&(r=e),r===NT&&(r=void 0),this.autoFreeze_&&mS(r,!0),n){const t=[],i=[];ES(vS).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}jT(1)},this.produceWithPatches=(e,t)=>{if(uS(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;const i=this.produce(e,t,(e,t)=>{n=e,r=t});return[i,n,r]},dS(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),dS(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),dS(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){KT(e)||jT(8),JT(e)&&(e=function(e){JT(e)||jT(10);return WS(e)}(e));const t=DS(this),n=US(t,e,void 0);return n[FT].isManual_=!0,SS(t),n}finishDraft(e,t){const n=e&&e[FT];n&&n.isManual_||jT(9);const{scope_:r}=n;return MS(r,t),IS(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=ES(vS).applyPatches_;return JT(e)?r(e,t):this.produce(e,e=>r(e,t))}},ZS=QS.produce;function JS(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function KS(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__,"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function XS(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(cD(0));return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>function(e){return JS(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}Symbol.species;function $S(e){return KT(e)?ZS(e,()=>{}):e}function eD(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function tD(e){const t={},n=[];let r;const i={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(cD(28));if(r in t)throw new Error(cD(29));return t[r]=n,i},addAsyncThunk:(e,r)=>(r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),i),addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),i),addDefaultCase:e=>(r=e,i)};return e(i),[t,n,r]}var nD=Symbol.for("rtk-slice-createasyncthunk");function rD(e,t){return`${e}/${t}`}function iD({creators:e}={}){const t=e?.asyncThunk?.[nD];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error(cD(11));const i=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},o=Object.keys(i),a={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error(cD(12));if(n in a.sliceCaseReducersByType)throw new Error(cD(13));return a.sliceCaseReducersByType[n]=t,s},addMatcher:(e,t)=>(a.sliceMatchers.push({matcher:e,reducer:t}),s),exposeAction:(e,t)=>(a.actionCreators[e]=t,s),exposeCaseReducer:(e,t)=>(a.sliceCaseReducersByName[e]=t,s)};function l(){const[t={},n=[],r]="function"==typeof e.extraReducers?tD(e.extraReducers):[e.extraReducers],i={...t,...a.sliceCaseReducersByType};return function(e,t){let n,[r,i,o]=tD(t);if(function(e){return"function"==typeof e}(e))n=()=>$S(e());else{const t=$S(e);n=()=>t}function a(e=n(),t){let a=[r[t.type],...i.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return 0===a.filter(e=>!!e).length&&(a=[o]),a.reduce((e,n)=>{if(n){if(JT(e)){const r=n(e,t);return void 0===r?e:r}if(KT(e))return ZS(e,e=>n(e,t));{const r=n(e,t);if(void 0===r){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}}return e},e)}return a.getInitialState=n,a}(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of a.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)})}o.forEach(r=>{const o=i[r],a={reducerName:r,type:rD(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(o)?function({type:e,reducerName:t,createNotation:n},r,i){let o,a;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error(cD(17));o=r.reducer,a=r.prepare}else o=r;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,a?XS(e,a):XS(e))}(a,o,s):function({type:e,reducerName:t},n,r,i){if(!i)throw new Error(cD(18));const{payloadCreator:o,fulfilled:a,pending:s,rejected:l,settled:c,options:u}=n,d=i(e,o,u);r.exposeAction(t,d),a&&r.addCase(d.fulfilled,a);s&&r.addCase(d.pending,s);l&&r.addCase(d.rejected,l);c&&r.addMatcher(d.settled,c);r.exposeCaseReducer(t,{fulfilled:a||sD,pending:s||sD,rejected:l||sD,settled:c||sD})}(a,o,s,t)});const c=e=>e,u=new Map,d=new WeakMap;let p;function h(e,t){return p||(p=l()),p(e,t)}function f(){return p||(p=l()),p.getInitialState()}function m(t,n=!1){function r(e){let i=e[t];return void 0===i&&n&&(i=eD(d,r,f)),i}function i(t=c){const r=eD(u,n,()=>new WeakMap);return eD(r,t,()=>{const r={};for(const[i,o]of Object.entries(e.selectors??{}))r[i]=oD(o,t,()=>eD(d,t,f),n);return r})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}const g={name:n,reducer:h,actions:a.actionCreators,caseReducers:a.sliceCaseReducersByName,getInitialState:f,...m(r),injectInto(e,{reducerPath:t,...n}={}){const i=t??r;return e.inject({reducerPath:i,reducer:h},n),{...g,...m(i,!0)}}};return g}}function oD(e,t,n,r){function i(i,...o){let a=t(i);return void 0===a&&r&&(a=n()),e(a,...o)}return i.unwrapped=e,i}var aD=iD();function sD(){}var{assign:lD}=Object;Symbol.for("rtk-state-proxy-original");function cD(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const uD={isQueueActive:!1,position:null,estimatedWaitTime:null,alternativeText:null},dD=aD({name:"queueUpdates",initialState:uD,reducers:{updateQueueData(e,t){e.isQueueActive=!0,e.position=t.payload?.position||null,e.estimatedWaitTime=t.payload?.estimatedWaitTime||null,e.alternativeText=t.payload?.alternativeText||null},resetQueueData:()=>uD},extraReducers(e){e.addCase("RECEIVE_MESSAGE",(e,t)=>{const{message:n}=t;if("agent"===n?.source&&e?.isQueueActive)return uD})}}),{updateQueueData:pD,resetQueueData:hD}=dD.actions,fD=dD.reducer,mD=(e,t={})=>({type:"RECEIVE_MESSAGE",message:{...e},options:t}),gD=e=>t=>{if(t.data&&t.data._webchat){const{agentAvatarOverrideUrl:n,botAvatarOverrideUrl:r}=t.data._webchat;void 0!==n&&e.dispatch({type:fT,url:n}),void 0!==r&&e.dispatch((e=>({type:mT,url:e}))(r))}var n;if(t.data&&t.data._plugin){const{type:r,data:i}=t.data._plugin;"request-rating"===r&&(i&&i.ratingCommentText&&e.dispatch((n=i.ratingCommentText,{type:xT,text:n})),i&&i.ratingTitleText&&e.dispatch((e=>({type:DT,text:e}))(i.ratingTitleText)),i&&i.ratingSubmitButtonText&&e.dispatch((e=>({type:IT,text:e}))(i.ratingSubmitButtonText)),i&&i.ratingEventBannerText&&e.dispatch((e=>({type:LT,text:e}))(i.ratingEventBannerText)),i&&i.ratingChatStatusMessage&&e.dispatch((e=>({type:PT,text:e}))(i.ratingChatStatusMessage)),i&&i.ratingScreenTitleText&&e.dispatch((e=>({type:ST,text:e}))(i.ratingScreenTitleText)),e.dispatch(MT(!0)))}if(e.dispatch(uT("remove")),(e=>!!e?.data?._cognigy?._webchat3?.type)(t?.data)){const n=(e=>e?.data?._cognigy?._webchat3?.payload)(t?.data);(e=>!("queueUpdate"!==e?.data?._cognigy?._webchat3?.type))(t?.data)&&e.dispatch(pD(n))}else e.dispatch(mD(t))},{entries:yD,setPrototypeOf:AD,isFrozen:vD,getPrototypeOf:bD,getOwnPropertyDescriptor:wD}=Object;let{freeze:ED,seal:kD,create:CD}=Object,{apply:_D,construct:MD}="undefined"!=typeof Reflect&&Reflect;ED||(ED=function(e){return e}),kD||(kD=function(e){return e}),_D||(_D=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)}),MD||(MD=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const TD=jD(Array.prototype.forEach),SD=jD(Array.prototype.lastIndexOf),DD=jD(Array.prototype.pop),xD=jD(Array.prototype.push),ID=jD(Array.prototype.splice),LD=jD(String.prototype.toLowerCase),PD=jD(String.prototype.toString),OD=jD(String.prototype.match),RD=jD(String.prototype.replace),BD=jD(String.prototype.indexOf),YD=jD(String.prototype.trim),ND=jD(Object.prototype.hasOwnProperty),VD=jD(RegExp.prototype.test),FD=function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return MD(e,n)}}(TypeError);function jD(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return _D(e,t,r)}}function HD(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:LD;AD&&AD(e,null);let r=t.length;for(;r--;){let i=t[r];if("string"==typeof i){const e=n(i);e!==i&&(vD(t)||(t[r]=e),i=e)}e[i]=!0}return e}function qD(e){for(let t=0;t<e.length;t++){ND(e,t)||(e[t]=null)}return e}function GD(e){const t=CD(null);for(const[n,r]of yD(e)){ND(e,n)&&(Array.isArray(r)?t[n]=qD(r):r&&"object"==typeof r&&r.constructor===Object?t[n]=GD(r):t[n]=r)}return t}function zD(e,t){for(;null!==e;){const n=wD(e,t);if(n){if(n.get)return jD(n.get);if("function"==typeof n.value)return jD(n.value)}e=bD(e)}return function(){return null}}const UD=ED(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),WD=ED(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),QD=ED(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),ZD=ED(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),JD=ED(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),KD=ED(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),XD=ED(["#text"]),$D=ED(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),ex=ED(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),tx=ED(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),nx=ED(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rx=kD(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ix=kD(/<%[\w\W]*|[\w\W]*%>/gm),ox=kD(/\$\{[\w\W]*/gm),ax=kD(/^data-[\-\w.\u00B7-\uFFFF]+$/),sx=kD(/^aria-[\-\w]+$/),lx=kD(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),cx=kD(/^(?:\w+script|data):/i),ux=kD(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),dx=kD(/^html$/i),px=kD(/^[a-z][.\w]*(-[.\w]+)+$/i);var hx=Object.freeze({__proto__:null,ARIA_ATTR:sx,ATTR_WHITESPACE:ux,CUSTOM_ELEMENT:px,DATA_ATTR:ax,DOCTYPE_NAME:dx,ERB_EXPR:ix,IS_ALLOWED_URI:lx,IS_SCRIPT_OR_DATA:cx,MUSTACHE_EXPR:rx,TMPLIT_EXPR:ox});const fx=1,mx=3,gx=7,yx=8,Ax=9,vx=function(){return"undefined"==typeof window?null:window};var bx=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vx();const n=t=>e(t);if(n.version="3.4.0",n.removed=[],!t||!t.document||t.document.nodeType!==Ax||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const i=r,o=i.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:c,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:h,trustedTypes:f}=t,m=c.prototype,g=zD(m,"cloneNode"),y=zD(m,"remove"),A=zD(m,"nextSibling"),v=zD(m,"childNodes"),b=zD(m,"parentNode");if("function"==typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let w,E="";const{implementation:k,createNodeIterator:C,createDocumentFragment:_,getElementsByTagName:M}=r,{importNode:T}=i;let S={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof yD&&"function"==typeof b&&k&&void 0!==k.createHTMLDocument;const{MUSTACHE_EXPR:D,ERB_EXPR:x,TMPLIT_EXPR:I,DATA_ATTR:L,ARIA_ATTR:P,IS_SCRIPT_OR_DATA:O,ATTR_WHITESPACE:R,CUSTOM_ELEMENT:B}=hx;let{IS_ALLOWED_URI:Y}=hx,N=null;const V=HD({},[...UD,...WD,...QD,...JD,...XD]);let F=null;const j=HD({},[...$D,...ex,...tx,...nx]);let H=Object.seal(CD(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),q=null,G=null;const z=Object.seal(CD(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let U=!0,W=!0,Q=!1,Z=!0,J=!1,K=!0,X=!1,$=!1,ee=!1,te=!1,ne=!1,re=!1,ie=!0,oe=!1,ae=!0,se=!1,le={},ce=null;const ue=HD({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let de=null;const pe=HD({},["audio","video","img","source","image","track"]);let he=null;const fe=HD({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),me="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",ye="http://www.w3.org/1999/xhtml";let Ae=ye,ve=!1,be=null;const we=HD({},[me,ge,ye],PD);let Ee=HD({},["mi","mo","mn","ms","mtext"]),ke=HD({},["annotation-xml"]);const Ce=HD({},["title","style","font","a","script"]);let _e=null;const Me=["application/xhtml+xml","text/html"];let Te=null,Se=null;const De=r.createElement("form"),xe=function(e){return e instanceof RegExp||e instanceof Function},Ie=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Se||Se!==e){if(e&&"object"==typeof e||(e={}),e=GD(e),_e=-1===Me.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Te="application/xhtml+xml"===_e?PD:LD,N=ND(e,"ALLOWED_TAGS")?HD({},e.ALLOWED_TAGS,Te):V,F=ND(e,"ALLOWED_ATTR")?HD({},e.ALLOWED_ATTR,Te):j,be=ND(e,"ALLOWED_NAMESPACES")?HD({},e.ALLOWED_NAMESPACES,PD):we,he=ND(e,"ADD_URI_SAFE_ATTR")?HD(GD(fe),e.ADD_URI_SAFE_ATTR,Te):fe,de=ND(e,"ADD_DATA_URI_TAGS")?HD(GD(pe),e.ADD_DATA_URI_TAGS,Te):pe,ce=ND(e,"FORBID_CONTENTS")?HD({},e.FORBID_CONTENTS,Te):ue,q=ND(e,"FORBID_TAGS")?HD({},e.FORBID_TAGS,Te):GD({}),G=ND(e,"FORBID_ATTR")?HD({},e.FORBID_ATTR,Te):GD({}),le=!!ND(e,"USE_PROFILES")&&e.USE_PROFILES,U=!1!==e.ALLOW_ARIA_ATTR,W=!1!==e.ALLOW_DATA_ATTR,Q=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Z=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,J=e.SAFE_FOR_TEMPLATES||!1,K=!1!==e.SAFE_FOR_XML,X=e.WHOLE_DOCUMENT||!1,te=e.RETURN_DOM||!1,ne=e.RETURN_DOM_FRAGMENT||!1,re=e.RETURN_TRUSTED_TYPE||!1,ee=e.FORCE_BODY||!1,ie=!1!==e.SANITIZE_DOM,oe=e.SANITIZE_NAMED_PROPS||!1,ae=!1!==e.KEEP_CONTENT,se=e.IN_PLACE||!1,Y=e.ALLOWED_URI_REGEXP||lx,Ae=e.NAMESPACE||ye,Ee=e.MATHML_TEXT_INTEGRATION_POINTS||Ee,ke=e.HTML_INTEGRATION_POINTS||ke,H=e.CUSTOM_ELEMENT_HANDLING||CD(null),e.CUSTOM_ELEMENT_HANDLING&&xe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(H.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&xe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(H.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(H.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),J&&(W=!1),ne&&(te=!0),le&&(N=HD({},XD),F=CD(null),!0===le.html&&(HD(N,UD),HD(F,$D)),!0===le.svg&&(HD(N,WD),HD(F,ex),HD(F,nx)),!0===le.svgFilters&&(HD(N,QD),HD(F,ex),HD(F,nx)),!0===le.mathMl&&(HD(N,JD),HD(F,tx),HD(F,nx))),z.tagCheck=null,z.attributeCheck=null,e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?z.tagCheck=e.ADD_TAGS:(N===V&&(N=GD(N)),HD(N,e.ADD_TAGS,Te))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?z.attributeCheck=e.ADD_ATTR:(F===j&&(F=GD(F)),HD(F,e.ADD_ATTR,Te))),e.ADD_URI_SAFE_ATTR&&HD(he,e.ADD_URI_SAFE_ATTR,Te),e.FORBID_CONTENTS&&(ce===ue&&(ce=GD(ce)),HD(ce,e.FORBID_CONTENTS,Te)),e.ADD_FORBID_CONTENTS&&(ce===ue&&(ce=GD(ce)),HD(ce,e.ADD_FORBID_CONTENTS,Te)),ae&&(N["#text"]=!0),X&&HD(N,["html","head","body"]),N.table&&(HD(N,["tbody"]),delete q.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw FD('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw FD('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=e.TRUSTED_TYPES_POLICY,E=w.createHTML("")}else void 0===w&&(w=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(f,o)),null!==w&&"string"==typeof E&&(E=w.createHTML(""));ED&&ED(e),Se=e}},Le=HD({},[...WD,...QD,...ZD]),Pe=HD({},[...JD,...KD]),Oe=function(e){xD(n.removed,{element:e});try{b(e).removeChild(e)}catch(t){y(e)}},Re=function(e,t){try{xD(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){xD(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(te||ne)try{Oe(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Be=function(e){let t=null,n=null;if(ee)e="<remove></remove>"+e;else{const t=OD(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===_e&&Ae===ye&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const i=w?w.createHTML(e):e;if(Ae===ye)try{t=(new h).parseFromString(i,_e)}catch(e){}if(!t||!t.documentElement){t=k.createDocument(Ae,"template",null);try{t.documentElement.innerHTML=ve?E:i}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(r.createTextNode(n),o.childNodes[0]||null),Ae===ye?M.call(t,X?"html":"body")[0]:X?t.documentElement:o},Ye=function(e){return C.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Ne=function(e){return e instanceof p&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Ve=function(e){return"function"==typeof l&&e instanceof l};function Fe(e,t,r){TD(e,e=>{e.call(n,t,r,Se)})}const je=function(e){let t=null;if(Fe(S.beforeSanitizeElements,e,null),Ne(e))return Oe(e),!0;const r=Te(e.nodeName);if(Fe(S.uponSanitizeElement,e,{tagName:r,allowedTags:N}),K&&e.hasChildNodes()&&!Ve(e.firstElementChild)&&VD(/<[/\w!]/g,e.innerHTML)&&VD(/<[/\w!]/g,e.textContent))return Oe(e),!0;if(K&&e.namespaceURI===ye&&"style"===r&&Ve(e.firstElementChild))return Oe(e),!0;if(e.nodeType===gx)return Oe(e),!0;if(K&&e.nodeType===yx&&VD(/<[/\w]/g,e.data))return Oe(e),!0;if(q[r]||!(z.tagCheck instanceof Function&&z.tagCheck(r))&&!N[r]){if(!q[r]&&qe(r)){if(H.tagNameCheck instanceof RegExp&&VD(H.tagNameCheck,r))return!1;if(H.tagNameCheck instanceof Function&&H.tagNameCheck(r))return!1}if(ae&&!ce[r]){const t=b(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r){const i=g(n[r],!0);i.__removalCount=(e.__removalCount||0)+1,t.insertBefore(i,A(e))}}}return Oe(e),!0}return e instanceof c&&!function(e){let t=b(e);t&&t.tagName||(t={namespaceURI:Ae,tagName:"template"});const n=LD(e.tagName),r=LD(t.tagName);return!!be[e.namespaceURI]&&(e.namespaceURI===ge?t.namespaceURI===ye?"svg"===n:t.namespaceURI===me?"svg"===n&&("annotation-xml"===r||Ee[r]):Boolean(Le[n]):e.namespaceURI===me?t.namespaceURI===ye?"math"===n:t.namespaceURI===ge?"math"===n&&ke[r]:Boolean(Pe[n]):e.namespaceURI===ye?!(t.namespaceURI===ge&&!ke[r])&&!(t.namespaceURI===me&&!Ee[r])&&!Pe[n]&&(Ce[n]||!Le[n]):!("application/xhtml+xml"!==_e||!be[e.namespaceURI]))}(e)?(Oe(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!VD(/<\/no(script|embed|frames)/i,e.innerHTML)?(J&&e.nodeType===mx&&(t=e.textContent,TD([D,x,I],e=>{t=RD(t,e," ")}),e.textContent!==t&&(xD(n.removed,{element:e.cloneNode()}),e.textContent=t)),Fe(S.afterSanitizeElements,e,null),!1):(Oe(e),!0)},He=function(e,t,n){if(G[t])return!1;if(ie&&("id"===t||"name"===t)&&(n in r||n in De))return!1;if(W&&!G[t]&&VD(L,t));else if(U&&VD(P,t));else if(z.attributeCheck instanceof Function&&z.attributeCheck(t,e));else if(!F[t]||G[t]){if(!(qe(e)&&(H.tagNameCheck instanceof RegExp&&VD(H.tagNameCheck,e)||H.tagNameCheck instanceof Function&&H.tagNameCheck(e))&&(H.attributeNameCheck instanceof RegExp&&VD(H.attributeNameCheck,t)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(t,e))||"is"===t&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&VD(H.tagNameCheck,n)||H.tagNameCheck instanceof Function&&H.tagNameCheck(n))))return!1}else if(he[t]);else if(VD(Y,RD(n,R,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==BD(n,"data:")||!de[e]){if(Q&&!VD(O,RD(n,R,"")));else if(n)return!1}else;return!0},qe=function(e){return"annotation-xml"!==e&&OD(e,B)},Ge=function(e){Fe(S.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Ne(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0};let i=t.length;for(;i--;){const o=t[i],{name:a,namespaceURI:s,value:l}=o,c=Te(a),u=l;let d="value"===a?u:YD(u);if(r.attrName=c,r.attrValue=d,r.keepAttr=!0,r.forceKeepAttr=void 0,Fe(S.uponSanitizeAttribute,e,r),d=r.attrValue,!oe||"id"!==c&&"name"!==c||(Re(a,e),d="user-content-"+d),K&&VD(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){Re(a,e);continue}if("attributename"===c&&OD(d,"href")){Re(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Re(a,e);continue}if(!Z&&VD(/\/>/i,d)){Re(a,e);continue}J&&TD([D,x,I],e=>{d=RD(d,e," ")});const p=Te(e.nodeName);if(He(p,c,d)){if(w&&"object"==typeof f&&"function"==typeof f.getAttributeType)if(s);else switch(f.getAttributeType(p,c)){case"TrustedHTML":d=w.createHTML(d);break;case"TrustedScriptURL":d=w.createScriptURL(d)}if(d!==u)try{s?e.setAttributeNS(s,a,d):e.setAttribute(a,d),Ne(e)?Oe(e):DD(n.removed)}catch(t){Re(a,e)}}else Re(a,e)}Fe(S.afterSanitizeAttributes,e,null)},ze=function(e){let t=null;const n=Ye(e);for(Fe(S.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)Fe(S.uponSanitizeShadowNode,t,null),je(t),Ge(t),t.content instanceof a&&ze(t.content);Fe(S.afterSanitizeShadowDOM,e,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,o=null,s=null,c=null;if(ve=!e,ve&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ve(e)){if("function"!=typeof e.toString)throw FD("toString is not a function");if("string"!=typeof(e=e.toString()))throw FD("dirty is not a string, aborting")}if(!n.isSupported)return e;if($||Ie(t),n.removed=[],"string"==typeof e&&(se=!1),se){if(e.nodeName){const t=Te(e.nodeName);if(!N[t]||q[t])throw FD("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)r=Be("\x3c!----\x3e"),o=r.ownerDocument.importNode(e,!0),o.nodeType===fx&&"BODY"===o.nodeName||"HTML"===o.nodeName?r=o:r.appendChild(o);else{if(!te&&!J&&!X&&-1===e.indexOf("<"))return w&&re?w.createHTML(e):e;if(r=Be(e),!r)return te?null:re?E:""}r&&ee&&Oe(r.firstChild);const u=Ye(se?e:r);for(;s=u.nextNode();)je(s),Ge(s),s.content instanceof a&&ze(s.content);if(se)return e;if(te){if(J){r.normalize();let e=r.innerHTML;TD([D,x,I],t=>{e=RD(e,t," ")}),r.innerHTML=e}if(ne)for(c=_.call(r.ownerDocument);r.firstChild;)c.appendChild(r.firstChild);else c=r;return(F.shadowroot||F.shadowrootmode)&&(c=T.call(i,c,!0)),c}let d=X?r.outerHTML:r.innerHTML;return X&&N["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&VD(dx,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),J&&TD([D,x,I],e=>{d=RD(d,e," ")}),w&&re?w.createHTML(d):d},n.setConfig=function(){Ie(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),$=!0},n.clearConfig=function(){Se=null,$=!1},n.isValidAttribute=function(e,t,n){Se||Ie({});const r=Te(e),i=Te(t);return He(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&xD(S[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=SD(S[e],t);return-1===n?void 0:ID(S[e],n,1)[0]}return DD(S[e])},n.removeHooks=function(e){S[e]=[]},n.removeAllHooks=function(){S={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const wx={ALLOWED_TAGS:["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","big","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","meta","meter","nav","noframes","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","small","source","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr"],ALLOWED_ATTR:["accept","accept-charset","accesskey","action","align","alt","autocomplete","autofocus","autoplay","bgcolor","border","charset","checked","cite","class","color","cols","colspan","content","contenteditable","controls","coords","data","data-*","datetime","default","dir","dirname","disabled","download","draggable","dropzone","enctype","for","form","formaction","headers","height","hidden","high","href","hreflang","http-equiv","id","ismap","kind","label","lang","list","loop","low","max","maxlength","media","method","min","multiple","muted","name","novalidate","open","optimum","pattern","placeholder","poster","preload","readonly","rel","required","reversed","rows","rowspan","sandbox","scope","selected","shape","size","sizes","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","value","width","wrap"]},Ex=e=>{const t=xO?.getState().config.settings.widgetSettings.customAllowedHtmlTags,n=t?{...wx,ALLOWED_TAGS:t}:wx;return bx.sanitize(e,n).toString()};var kx=i(9944);const Cx=i(9599).A,_x=new kx.A(Cx),Mx=(e,t={})=>({type:"SEND_MESSAGE",message:{...e,source:"user"},options:t}),Tx=e=>({type:"SET_USER_TYPING",typing:e}),Sx=(e,t)=>{switch(e.source){case"agent":return t.ui.agentAvatarOverrideUrl||t.config.settings.layout.useOtherAgentLogo&&t.config.settings.layout.agentLogoUrl||t.config.settings.layout.logoUrl||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAQAAABIkb+zAAACOklEQVR4Ae3ZA2ydURwF8P9s2+bjPSdGo0aN08V+URtbL+a8BbO9xfZs2zaCuW7vbDx8uLfp/3dinw+XopRSSimllFJhYm9TjV08wwdoYB0f8ix2mDkTe0p7YIZxDeto/5I6rjHDxGtdkcc72n8H75CXruKn1CAcpi0cHE4NEv9kp+EubXHB3ew08QuH4hFt8cGj5Ajxx9hePE1bYi6k+4gvMJ+29GCe+CEzhvW0ZaQ+PVZ8wDW0ZWatuJfozrqyC9Qluotr2Sra8pOtEtewMkgBrBLXsC9QgX3iGm4EKnBDXOP7QAXeiWt4G6jAW3ENNwMVuCmu4UCgAgc6/DCqE1miO9+7X0oEgtVlF1gjPkiOKHs5Pbx9b2jme7SlxPmSC5we20v8kRjJh6Vt6jlU/JKZztsBj1XcH2zxGG3h4ERqkPgp0R35AhvMOuQT3cVnyRH/O9wt4zjLzaj00/F6/dfj9WrPj9eVUkqpRPeMMTnMxxbu4fWf5uP3uME93IZ5JpcxHi4lzGjWYgPPsom2cNDIs9jAWjNaXJvaw1RyES/SlpmLXGQqHb0Rgsv5hjaEvOJyIt6lWg4nacMNTppcHMu9LqYGL2ijCZ6bGuki0TEVuEIbbXDFVEgU2JsbaWPKRvYOf6C8SBtjLoY6yKbH4h5tvMHd5DgJR6Ivb9E6yK1EX6c3AMGDlRIcZtG6i5ktQWGpywJYKkHxgtMC5yUo1tM6TL0ERes2WkALaAEtEEm0gFJKKaWUUkp9ABvn3SEbw3cFAAAAAElFTkSuQmCC";case"bot":case"engagement":return t.ui.botAvatarOverrideUrl||t.config.settings.layout.useOtherAgentLogo&&t.config.settings.layout.botLogoUrl||t.config.settings.layout.logoUrl||void 0;case"user":return}},Dx=(e,t)=>{switch(e.source){case"agent":return t.config.settings.layout.useOtherAgentLogo&&t.config.settings.layout.agentAvatarName||t.config.settings.layout.title||void 0;case"bot":case"engagement":return t.config.settings.layout.useOtherAgentLogo&&t.config.settings.layout.botAvatarName||t.config.settings.layout.title||void 0;case"user":return}},xx=(e,t)=>`${e.config.settings.layout.useOtherAgentLogo&&e.config.settings.layout.agentAvatarName||e.config.settings.layout.title||"Agent"} ${t}`,Ix=e=>t=>n=>r=>{switch(r.type){case"SEND_MESSAGE":{const{message:i,options:o}=r;let{text:a,data:s}=i;if(t.getState().config.settings.widgetSettings.disableTextInputSanitization||(a=Ex(a||"")),t.getState().config.settings.widgetSettings.disableHtmlInput&&(a=(new DOMParser).parseFromString(a||"","text/html").body.textContent||""),s=s&&"object"==typeof s&&Object.keys(s).length>0?s:null,!a&&!s)break;e.sendMessage(a||"",s);const l=HM();n({type:kT,id:l});const c={...i,text:a,id:l};"string"==typeof o.label&&(c.text=o.label),n(hT(void 0)),n(zM({...c,avatarUrl:Sx(c,t.getState()),avatarName:Dx(c,t.getState()),timestamp:Date.now()}));break}case"SET_USER_TYPING":{const{typing:n}=r;if(t.getState().config.settings.behavior.disableUserTypingEvent)return;n?e.sendTypingStatus("typingOn"):e.sendTypingStatus("typingOff");break}case"RECEIVE_MESSAGE":{const e=t.getState(),{message:i}=r,o=Sx(i,e),a=Dx(i,e),s=e.ui.open&&e.ui.isPageVisible,l=!(i.text||i.data?._cognigy?._webchat),c=e.config.settings.behavior.collateStreamedOutputs&&!!i?.data?._cognigy?._messageId&&e.messages.messageHistory.some(e=>i?.data?._cognigy?._messageId===e.id),u=!s&&!l&&!c;if("agent"===i.source&&e.queueUpdates.isQueueActive){const t={text:"",data:{_cognigy:{_webchat3:{type:"liveAgentEvent",payload:{text:xx(e,"joined")}}}}};n({type:"ADD_MESSAGE_EVENT",event:t}),_x.play()}n(zM({...i,source:i.source||"bot",timestamp:Date.now(),avatarUrl:o,avatarName:a},u));break}case"TRIGGER_ENGAGEMENT_MESSAGE":{const e=t.getState().config.settings.teaserMessage.text;e&&t.dispatch(mD({source:"engagement",traceId:`engagement-${Math.random()}`,text:e}));break}}return n(r)},Lx=({userId:e,sessionId:t},{URLToken:n})=>JSON.stringify(["webchat-client",e,t,n]),Px=e=>({type:"SET_OPTIONS",options:e}),Ox=(e={channel:"",sessionId:"",userId:""},t)=>{switch(t.type){case"SET_OPTIONS":return t.options;case"SET_USER_ID":return{...e,userId:t.userId};default:return e}};var Rx=i(7202),Bx=i.n(Rx);const Yx=e=>({type:"SET_CONFIG",config:e}),Nx=(e={URLToken:"",initialSessionId:"",active:!1,isConfigLoaded:!1,isTimedOut:!1,settings:{layout:{title:"",logoUrl:"",useOtherAgentLogo:!1,botAvatarName:"",botLogoUrl:"",agentAvatarName:"",agentLogoUrl:"",inputAutogrowMaxRows:4,enableInputCollation:!1,inputCollationTimeout:1e3,dynamicImageAspectRatio:!1,disableInputAutocomplete:!1,enableGenericHTMLStyling:!1,disableHtmlContentSanitization:!1,disableUrlButtonSanitization:!1,watermark:"default",watermarkText:"Powered by Cognigy.AI",watermarkUrl:"",disableBotOutputBorder:!1,botOutputMaxWidthPercentage:73,chatWindowWidth:460},colors:{primaryColor:"",secondaryColor:"",chatInterfaceColor:"",botMessageColor:"",userMessageColor:"",textLinkColor:""},behavior:{collateStreamedOutputs:!1,progressiveMessageRendering:!1,renderMarkdown:!1,enableTypingIndicator:!0,messageDelay:500,inputPlaceholder:"Type something here…",enableSTT:!1,enableTTS:!1,focusInputAfterPostback:!1,enableConnectionStatusIndicator:!0,scrollingBehavior:"alwaysScroll",disableUserTypingEvent:!1},startBehavior:{startBehavior:"none",getStartedButtonText:"",getStartedData:{},getStartedPayload:"",getStartedText:""},fileStorageSettings:{enabled:!1,dropzoneText:""},businessHours:{times:[],enabled:!1,mode:"inform",text:"",timeZone:"Europe/Berlin",title:""},unreadMessages:{enableIndicator:!1,enableBadge:!1,enablePreview:!1,enableSound:!1,unreadMessageTitleText:"New Message",unreadMessageTitleTextPlural:"New Messages"},homeScreen:{enabled:!0,welcomeText:"Welcome! How can we help you?",background:{imageUrl:"",color:""},startConversationButtonText:"Start conversation",previousConversations:{enabled:!0,buttonText:"Previous conversations",title:""},conversationStarters:{enabled:!0,starters:[]}},teaserMessage:{text:"",teaserMessageDelay:5e3,showInChat:!1,conversationStarters:{enabled:!0,starters:[]}},chatOptions:{enabled:!1,title:"Chat options",quickReplyOptions:{enabled:!1,sectionTitle:"People are also interested in",quickReplies:[]},showTTSToggle:!1,activateTTSToggle:!0,labelTTSToggle:"Enable text-to-speech",rating:{enabled:"once",title:"Please rate your chat experience",commentPlaceholder:"Type something here...",submitButtonText:"Send feedback",eventBannerText:"Your feedback was submitted"},footer:{enabled:!1,items:[]}},privacyNotice:{enabled:!1,title:"Privacy notice",text:"Please accept our privacy policy to start your chat.\n\nLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.",submitButtonText:"Submit",urlText:"",url:""},fileAttachmentMaxSize:10485760,maintenance:{enabled:!1,mode:"inform",text:"",title:""},demoWebchat:{enabled:!0,backgroundImageUrl:"",position:"centered"},embeddingConfiguration:{_endpointTokenUrl:"",awaitEndpointConfig:!1,disableLocalStorage:!1,disablePersistentHistory:!1,useSessionStorage:!1,connectivity:{enabled:!1,mode:"hide",text:"",timeout:2e3,title:""}},widgetSettings:{disableDefaultReplyCompatiblityMode:!1,enableStrictMessengerSync:!1,disableHtmlInput:!0,disableInputAutofocus:!1,disableRenderURLsAsLinks:!1,disableTextInputSanitization:!1,disableToggleButton:!1,disableTeaserMarkdownRemoval:!1,disableMobileScrollLock:!1,enableAutoFocus:!1,enableInjectionWithoutEmptyHistory:!1,enableFocusTrap:!1,enableDefaultPreview:!1,ignoreLineBreaks:!1,STTLanguage:"",customAllowedHtmlTags:void 0,sourceDirectionMapping:{agent:"incoming",bot:"incoming",user:"outgoing"},sourceColorMapping:{agent:"bot",bot:"bot",user:"user"}}}},t)=>{switch(t.type){case"SET_CONFIG":{const n=Bx()({},e.settings,t.config.settings);return{...e,...t.config,settings:n}}case"APPLY_WEBCHAT_SETTINGS_OVERRIDES":case"UPDATE_SETTINGS":{const n=Bx()({},e.settings,t.payload);return{...e,settings:n}}case"SET_INITIAL_SESSION_ID":return{...e,initialSessionId:t.sessionId}}return e},Vx={connected:!1,connecting:!1,reconnectionLimit:!1},Fx=e=>({type:"SET_CONNECTING",connecting:e}),jx=e=>({type:"SET_CONNECTED",connected:e}),Hx=e=>({type:"SET_RECONNECTION_LIMIT",reconnectionLimit:e}),qx=(e=Vx,t)=>{switch(t.type){case"SET_CONNECTED":return{...e,connected:t.connected};case"SET_CONNECTING":return{...e,connecting:t.connecting};case"SET_RECONNECTION_LIMIT":return{...e,reconnectionLimit:t.reconnectionLimit};default:return e}},Gx=(e=[],t)=>{switch(t.type){case"ADD_MESSAGE":return t.unseen?[...e,t.message]:e;case"CLEAR_UNSEEN_MESSAGES":return[]}return e},zx=(e={isChatOpenedOnce:!1,isConnectedOnce:!1,isConfiguredOnce:!1,isSessionRestoredOnce:!1,isAutoInjectHandled:!1},t)=>{switch(t.type){case"SET_CONNECTED":if(t.connected&&!e.isConnectedOnce)return{...e,isConnectedOnce:!0};break;case"SHOW_CHAT_SCREEN":if(!e.isChatOpenedOnce)return{...e,isChatOpenedOnce:!0};break;case"SET_CONFIG":if(!e.isConfiguredOnce)return{...e,isConfiguredOnce:!0};break;case"SET_OPTIONS":if(!e.isSessionRestoredOnce)return{...e,isSessionRestoredOnce:!0};break;case"AUTO_INJECT_HANDLED":if(!e.isAutoInjectHandled)return{...e,isAutoInjectHandled:!0};break;case"AUTO_INJECT_HANDLED_RESET":if(e.isAutoInjectHandled)return{...e,isAutoInjectHandled:!1}}return e},Ux=(e={messages:[]},t)=>{switch(t.type){case"ADD_COLLATED_MESSAGE":return{...e,messages:[...e.messages,t.message]};case"SUBMIT_COLLATED_MESSAGES":case"SEND_MESSAGE":return{...e,messages:[]}}return e},Wx="SET_STT_ACTIVE",Qx="SET_TEXT_ACTIVE",Zx="SET_DROP_ZONE_VISIBLE",Jx=e=>({type:Zx,visible:e}),Kx="SET_FILE_LIST",Xx=e=>({type:Kx,fileList:e}),$x="SET_FILE_UPLOAD_ERROR",eI=e=>({type:$x,error:e}),tI="REMOVE_FILE_FROM_LIST",nI=(e={sttActive:!1,textActive:!1,isDropZoneVisible:!1,fileList:[],fileUploadError:!1},t)=>{switch(t.type){case Wx:return{...e,sttActive:t.active};case Qx:return{...e,textActive:t.active};case Zx:return{...e,isDropZoneVisible:t.visible};case Kx:return{...e,fileList:t.fileList};case $x:return{...e,fileUploadError:t.error};case tI:{const n=e.fileList[t.index];n?.abortController&&n.abortController.abort();const r=e.fileList.filter((e,n)=>n!==t.index);let i=!1;return r.forEach(e=>{i=e.hasUploadError||i}),{...e,fileList:r,fileUploadError:i}}default:return e}},rI="SET_CONVERSATIONS",iI=e=>({type:rI,conversations:e}),oI="UPSERT_PREV_CONVERSATION",aI="DELETE_PREV_CONVERSATION",sI=(e={},t)=>{switch(t.type){case rI:return t.conversations;case oI:{const{sessionId:n,conversation:r}=t;return{...e,[n]:r}}case aI:{const{sessionId:n}=t;return delete e[n],e}default:return e}};const lI={autoOpen:!0,closeOnSubmit:!0,feedbackMessage:null,screenTitle:"",sendEventOnCloseIconClick:!1,showCloseIcon:!0},cI=aD({name:"xAppOverlay",initialState:{open:!1,currentUrl:null,settingsByUrl:{}},reducers:{openOverlay(e,t){e.open=!0,e.currentUrl=t.payload},closeOverlay(e){e.open=!1,e.currentUrl=null}},extraReducers(e){e.addCase("RECEIVE_MESSAGE",(e,t)=>{const{message:n}=t;if(function(e){const t=e?.data?._cognigy?._app?.overlaySettings,n=e?.data?._cognigy?._app?.url;return t&&n}(n)){const t=n.data._cognigy._app.url;if(!t)return void console.error("xApp Overlay message received without an URL");n.data._cognigy._app.overlaySettings.autoOpen&&(e.open=!0,e.currentUrl=t),e.settingsByUrl[t]={...lI,...n.data._cognigy._app.overlaySettings}}})}}),{openOverlay:uI,closeOverlay:dI}=cI.actions,pI=cI.reducer,hI=aD({name:"userTyping",initialState:{shouldSendUserTypingOff:!1,typingTimeoutId:void 0},reducers:{setShouldSendUserTypingOff:(e,t)=>{e.shouldSendUserTypingOff=t.payload},setTypingTimeoutId:(e,t)=>{e.typingTimeoutId=t.payload}}}),{setShouldSendUserTypingOff:fI,setTypingTimeoutId:mI}=hI.actions,gI=hI.reducer,yI=(e,t)=>FM({messages:JM(()=>e),unseenMessages:Gx,options:Ox,config:Nx,autoInject:zx,rating:RT,ui:CT,connection:qx,inputCollation:Ux,input:nI,prevConversations:sI,xAppOverlay:pI,queueUpdates:fD,userTyping:gI})(e,t),AI=(e=yI(void 0,{type:""}),t)=>{switch(t.type){case"RESET_STATE":{const n=(0===e.messages.messageHistory.length||1===e.messages.messageHistory.length&&"engagement"===e.messages.messageHistory[0].source?t.state.messages:[]).map(e=>"bot"!==e.source&&"engagement"!==e.source||!("animationState"in e)||"done"===e.animationState?e:{...e,animationState:"done"}),r=new Set(e.messages.visibleOutputMessages),i=[];for(const e of n)"bot"!==e.source&&"engagement"!==e.source||"string"!=typeof e.id||r.has(e.id)||(i.push(e.id),r.add(e.id));const o=[...e.messages.visibleOutputMessages,...i];return yI({...e,messages:{messageHistory:[...n,...e.messages.messageHistory],visibleOutputMessages:o},rating:{...e.rating,hasGivenRating:t.state.rating.hasGivenRating}},{type:""})}case"SET_PREV_STATE":{const{showRatingScreen:n,...r}=t.state.rating,i=[],o=t.state.messages.map(e=>(e.animationState&&(e.animationState="done"),"bot"!==e.source&&"engagement"!==e.source||!e.id||i.push(e.id),e));return yI({...e,messages:{messageHistory:[...o],visibleOutputMessages:i},rating:{showRatingScreen:!1,...r}},{type:""})}}return yI(e,t)};function vI(e){if("string"!=typeof e)return!1;try{return JSON.parse(e),!0}catch(e){return!1}}const bI=e=>e.disableLocalStorage?null:e.useSessionStorage?window.sessionStorage:window.localStorage,wI=(e,t,n,r)=>Object.keys(e).reduce((n,i)=>{if(!t||!r)return n;const o=e.getItem(i)||"";if(!vI(i)||!vI(o))return n;const a=JSON.parse(i)?.[1]||"",s=JSON.parse(i)?.[2]||"",l=JSON.parse(i)?.[3]||"";if(t!==a)return n;if(r!==l)return n;const c=JSON.parse(o)?.messages;return Array.isArray(c)&&0!==c.length?(n[s]=JSON.parse(o),n):n},{}),EI=e=>t=>n=>{const r=Lx(e.getState().options,e.getState().config),{active:i}=e.getState().config,{disableLocalStorage:o,disablePersistentHistory:a,useSessionStorage:s}=e.getState().config.settings.embeddingConfiguration,{userId:l,sessionId:c}=e.getState().options,u=bI({useSessionStorage:s,disableLocalStorage:o});switch(n.type){case"SET_OPTIONS":if(u){const t=Lx(n.options,e.getState().config),r=u.getItem(t);if(n.options?.userId){const t=wI(u,n.options?.userId,n.options,e.getState().config?.URLToken);e.dispatch(iI(t))}if(r)try{const t=JSON.parse(r);e.dispatch({type:"RESET_STATE",state:t})}catch(e){}}break;case"SET_SHOW_PREV_CONVERSATIONS":if(n.showPrevConversations&&u&&l&&!c){const t=wI(u,l,0,e.getState().config?.URLToken);e.dispatch(iI(t))}break;case"SEND_MESSAGE":case"RECEIVE_MESSAGE":case"TRIGGER_ENGAGEMENT_MESSAGE":case"SHOW_RATING_SCREEN":case"SET_HAS_GIVEN_RATING":case"SET_CUSTOM_RATING_TITLE":case"SET_CUSTOM_RATING_COMMENT_TEXT":if(u&&i&&l&&c&&!a){const{messages:t,rating:n}=e.getState();let i=[];Array.isArray(t)?i=t:t?.messageHistory&&Array.isArray(t.messageHistory)&&(i=t.messageHistory),u.setItem(r,JSON.stringify({messages:i,rating:n}))}}return t(n)},kI=e=>e?.autoInject?.isConnectedOnce,CI="DISCONNECT";function _I(e,t){return function(){return e.apply(t,arguments)}}const{toString:MI}=Object.prototype,{getPrototypeOf:TI}=Object,{iterator:SI,toStringTag:DI}=Symbol,xI=(II=Object.create(null),e=>{const t=MI.call(e);return II[t]||(II[t]=t.slice(8,-1).toLowerCase())});var II;const LI=e=>(e=e.toLowerCase(),t=>xI(t)===e),PI=e=>t=>typeof t===e,{isArray:OI}=Array,RI=PI("undefined");function BI(e){return null!==e&&!RI(e)&&null!==e.constructor&&!RI(e.constructor)&&VI(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const YI=LI("ArrayBuffer");const NI=PI("string"),VI=PI("function"),FI=PI("number"),jI=e=>null!==e&&"object"==typeof e,HI=e=>{if("object"!==xI(e))return!1;const t=TI(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||DI in e||SI in e)},qI=LI("Date"),GI=LI("File"),zI=LI("Blob"),UI=LI("FileList");const WI="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==i.g?i.g:{},QI=void 0!==WI.FormData?WI.FormData:void 0,ZI=LI("URLSearchParams"),[JI,KI,XI,$I]=["ReadableStream","Request","Response","Headers"].map(LI);function eL(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),OI(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(BI(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let a;for(r=0;r<o;r++)a=i[r],t.call(null,e[a],a,e)}}function tL(e,t){if(BI(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const nL="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:i.g,rL=e=>!RI(e)&&e!==nL;const iL=(oL="undefined"!=typeof Uint8Array&&TI(Uint8Array),e=>oL&&e instanceof oL);var oL;const aL=LI("HTMLFormElement"),sL=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),lL=LI("RegExp"),cL=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};eL(n,(n,i)=>{let o;!1!==(o=t(n,i,e))&&(r[i]=o||n)}),Object.defineProperties(e,r)};const uL=LI("AsyncFunction"),dL=(pL="function"==typeof setImmediate,hL=VI(nL.postMessage),pL?setImmediate:hL?((e,t)=>(nL.addEventListener("message",({source:n,data:r})=>{n===nL&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),nL.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e));var pL,hL;const fL="undefined"!=typeof queueMicrotask?queueMicrotask.bind(nL):"undefined"!=typeof process&&process.nextTick||dL,mL={isArray:OI,isArrayBuffer:YI,isBuffer:BI,isFormData:e=>{if(!e)return!1;if(QI&&e instanceof QI)return!0;const t=TI(e);if(!t||t===Object.prototype)return!1;if(!VI(e.append))return!1;const n=xI(e);return"formdata"===n||"object"===n&&VI(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&YI(e.buffer),t},isString:NI,isNumber:FI,isBoolean:e=>!0===e||!1===e,isObject:jI,isPlainObject:HI,isEmptyObject:e=>{if(!jI(e)||BI(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:JI,isRequest:KI,isResponse:XI,isHeaders:$I,isUndefined:RI,isDate:qI,isFile:GI,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:zI,isRegExp:lL,isFunction:VI,isStream:e=>jI(e)&&VI(e.pipe),isURLSearchParams:ZI,isTypedArray:iL,isFileList:UI,forEach:eL,merge:function e(){const{caseless:t,skipUndefined:n}=rL(this)&&this||{},r={},i=(i,o)=>{if("__proto__"===o||"constructor"===o||"prototype"===o)return;const a=t&&tL(r,o)||o;HI(r[a])&&HI(i)?r[a]=e(r[a],i):HI(i)?r[a]=e({},i):OI(i)?r[a]=i.slice():n&&RI(i)||(r[a]=i)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&eL(arguments[e],i);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(eL(t,(t,r)=>{n&&VI(t)?Object.defineProperty(e,r,{value:_I(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,o,a;const s={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&TI(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:xI,kindOfTest:LI,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(OI(e))return e;let t=e.length;if(!FI(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[SI]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:aL,hasOwnProperty:sL,hasOwnProp:sL,reduceDescriptors:cL,freezeMethods:e=>{cL(e,(t,n)=>{if(VI(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];VI(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return OI(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:tL,global:nL,isContextDefined:rL,isSpecCompliantForm:function(e){return!!(e&&VI(e.append)&&"FormData"===e[DI]&&e[SI])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(jI(e)){if(t.indexOf(e)>=0)return;if(BI(e))return e;if(!("toJSON"in e)){t[r]=e;const i=OI(e)?[]:{};return eL(e,(e,t)=>{const o=n(e,r+1);!RI(o)&&(i[t]=o)}),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:uL,isThenable:e=>e&&(jI(e)||VI(e))&&VI(e.then)&&VI(e.catch),setImmediate:dL,asap:fL,isIterable:e=>null!=e&&VI(e[SI])};class gL extends Error{static from(e,t,n,r,i,o){const a=new gL(e.message,t||e.code,n,r,i);return a.cause=e,a.name=e.name,null!=e.status&&null==a.status&&(a.status=e.status),o&&Object.assign(a,o),a}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:mL.toJSONObject(this.config),code:this.code,status:this.status}}}gL.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",gL.ERR_BAD_OPTION="ERR_BAD_OPTION",gL.ECONNABORTED="ECONNABORTED",gL.ETIMEDOUT="ETIMEDOUT",gL.ERR_NETWORK="ERR_NETWORK",gL.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",gL.ERR_DEPRECATED="ERR_DEPRECATED",gL.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",gL.ERR_BAD_REQUEST="ERR_BAD_REQUEST",gL.ERR_CANCELED="ERR_CANCELED",gL.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",gL.ERR_INVALID_URL="ERR_INVALID_URL",gL.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const yL=gL;function AL(e){return mL.isPlainObject(e)||mL.isArray(e)}function vL(e){return mL.endsWith(e,"[]")?e.slice(0,-2):e}function bL(e,t,n){return e?e.concat(t).map(function(e,t){return e=vL(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const wL=mL.toFlatObject(mL,{},null,function(e){return/^is[A-Z]/.test(e)});const EL=function(e,t,n){if(!mL.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=mL.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!mL.isUndefined(t[e])})).metaTokens,i=n.visitor||d,o=n.dots,a=n.indexes,s=n.Blob||"undefined"!=typeof Blob&&Blob,l=void 0===n.maxDepth?100:n.maxDepth,c=s&&mL.isSpecCompliantForm(t);if(!mL.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(mL.isDate(e))return e.toISOString();if(mL.isBoolean(e))return e.toString();if(!c&&mL.isBlob(e))throw new yL("Blob is not supported. Use a Buffer instead.");return mL.isArrayBuffer(e)||mL.isTypedArray(e)?c&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function d(e,n,i){let s=e;if(mL.isReactNative(t)&&mL.isReactNativeBlob(e))return t.append(bL(i,n,o),u(e)),!1;if(e&&!i&&"object"==typeof e)if(mL.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(mL.isArray(e)&&function(e){return mL.isArray(e)&&!e.some(AL)}(e)||(mL.isFileList(e)||mL.endsWith(n,"[]"))&&(s=mL.toArray(e)))return n=vL(n),s.forEach(function(e,r){!mL.isUndefined(e)&&null!==e&&t.append(!0===a?bL([n],r,o):null===a?n:n+"[]",u(e))}),!1;return!!AL(e)||(t.append(bL(i,n,o),u(e)),!1)}const p=[],h=Object.assign(wL,{defaultVisitor:d,convertValue:u,isVisitable:AL});if(!mL.isObject(e))throw new TypeError("data must be an object");return function e(n,r,o=0){if(!mL.isUndefined(n)){if(o>l)throw new yL("Object is too deeply nested ("+o+" levels). Max depth: "+l,yL.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==p.indexOf(n))throw Error("Circular reference detected in "+r.join("."));p.push(n),mL.forEach(n,function(n,a){!0===(!(mL.isUndefined(n)||null===n)&&i.call(t,n,mL.isString(a)?a.trim():a,r,h))&&e(n,r?r.concat(a):[a],o+1)}),p.pop()}}(e),t};function kL(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function CL(e,t){this._pairs=[],e&&EL(e,this,t)}const _L=CL.prototype;_L.append=function(e,t){this._pairs.push([e,t])},_L.toString=function(e){const t=e?function(t){return e.call(this,t,kL)}:kL;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const ML=CL;function TL(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function SL(e,t,n){if(!t)return e;const r=n&&n.encode||TL,i=mL.isFunction(n)?{serialize:n}:n,o=i&&i.serialize;let a;if(a=o?o(t,i):mL.isURLSearchParams(t)?t.toString():new ML(t,i).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}const DL=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){mL.forEach(this.handlers,function(t){null!==t&&e(t)})}},xL={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},IL={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ML,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},LL="undefined"!=typeof window&&"undefined"!=typeof document,PL="object"==typeof navigator&&navigator||void 0,OL=LL&&(!PL||["ReactNative","NativeScript","NS"].indexOf(PL.product)<0),RL="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,BL=LL&&window.location.href||"http://localhost",YL={...e,...IL};const NL=function(e){function t(e,n,r,i){let o=e[i++];if("__proto__"===o)return!0;const a=Number.isFinite(+o),s=i>=e.length;if(o=!o&&mL.isArray(r)?r.length:o,s)return mL.hasOwnProp(r,o)?r[o]=mL.isArray(r[o])?r[o].concat(n):[r[o],n]:r[o]=n,!a;r[o]&&mL.isObject(r[o])||(r[o]=[]);return t(e,n,r[o],i)&&mL.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}(r[o])),!a}if(mL.isFormData(e)&&mL.isFunction(e.entries)){const n={};return mL.forEachEntry(e,(e,r)=>{t(function(e){return mL.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null},VL=(e,t)=>null!=e&&mL.hasOwnProp(e,t)?e[t]:void 0;const FL={transitional:xL,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=mL.isObject(e);i&&mL.isHTMLForm(e)&&(e=new FormData(e));if(mL.isFormData(e))return r?JSON.stringify(NL(e)):e;if(mL.isArrayBuffer(e)||mL.isBuffer(e)||mL.isStream(e)||mL.isFile(e)||mL.isBlob(e)||mL.isReadableStream(e))return e;if(mL.isArrayBufferView(e))return e.buffer;if(mL.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){const t=VL(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return EL(e,new YL.classes.URLSearchParams,{visitor:function(e,t,n,r){return YL.isNode&&mL.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((o=mL.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=VL(this,"env"),r=n&&n.FormData;return EL(o?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(mL.isString(e))try{return(t||JSON.parse)(e),mL.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=VL(this,"transitional")||FL.transitional,n=t&&t.forcedJSONParsing,r=VL(this,"responseType"),i="json"===r;if(mL.isResponse(e)||mL.isReadableStream(e))return e;if(e&&mL.isString(e)&&(n&&!r||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,VL(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw yL.from(e,yL.ERR_BAD_RESPONSE,this,null,VL(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:YL.classes.FormData,Blob:YL.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};mL.forEach(["delete","get","head","post","put","patch"],e=>{FL.headers[e]={}});const jL=FL,HL=mL.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),qL=e=>{const t={};let n,r,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&HL[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t};(Object.getOwnPropertyDescriptor(qL,"name")||{}).writable||Object.defineProperty(qL,"name",{value:"default",configurable:!0});const GL=Symbol("internals"),zL=/[^\x09\x20-\x7E\x80-\xFF]/g;function UL(e){return e&&String(e).trim().toLowerCase()}function WL(e){return!1===e||null==e?e:mL.isArray(e)?e.map(WL):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(zL,""))}function QL(e,t,n,r,i){return mL.isFunction(r)?r.call(this,t,n):(i&&(t=n),mL.isString(t)?mL.isString(r)?-1!==t.indexOf(r):mL.isRegExp(r)?r.test(t):void 0:void 0)}class ZL{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=UL(t);if(!i)throw new Error("header name must be a non-empty string");const o=mL.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=WL(e))}const o=(e,t)=>mL.forEach(e,(e,n)=>i(e,n,t));if(mL.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(mL.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o(qL(e),t);else if(mL.isObject(e)&&mL.isIterable(e)){let n,r,i={};for(const t of e){if(!mL.isArray(t))throw TypeError("Object iterator must return a key-value pair");i[r=t[0]]=(n=i[r])?mL.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}o(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=UL(e)){const n=mL.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(mL.isFunction(t))return t.call(this,e,n);if(mL.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=UL(e)){const n=mL.findKey(this,e);return!(!n||void 0===this[n]||t&&!QL(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=UL(e)){const i=mL.findKey(n,e);!i||t&&!QL(0,n[i],i,t)||(delete n[i],r=!0)}}return mL.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!QL(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return mL.forEach(this,(r,i)=>{const o=mL.findKey(n,i);if(o)return t[o]=WL(r),void delete t[i];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();a!==i&&delete t[i],t[a]=WL(r),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return mL.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&mL.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[GL]=this[GL]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=UL(e);t[r]||(!function(e,t){const n=mL.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}(n,e),t[r]=!0)}return mL.isArray(e)?e.forEach(r):r(e),this}}ZL.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),mL.reduceDescriptors(ZL.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),mL.freezeMethods(ZL);const JL=ZL;function KL(e,t){const n=this||jL,r=t||n,i=JL.from(r.headers);let o=r.data;return mL.forEach(e,function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function XL(e){return!(!e||!e.__CANCEL__)}const $L=class extends yL{constructor(e,t,n){super(null==e?"canceled":e,yL.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function eP(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new yL("Request failed with status code "+n.status,[yL.ERR_BAD_REQUEST,yL.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const tP=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,a=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),c=r[a];i||(i=l),n[o]=s,r[o]=l;let u=a,d=0;for(;u!==o;)d+=n[u++],u%=e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),l-i<t)return;const p=c&&l-c;return p?Math.round(1e3*d/p):void 0}};const nP=function(e,t){let n,r,i=0,o=1e3/t;const a=(t,o=Date.now())=>{i=o,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-i;s>=o?a(e,t):(n=e,r||(r=setTimeout(()=>{r=null,a(n)},o-s)))},()=>n&&a(n)]},rP=(e,t,n=3)=>{let r=0;const i=tP(50,250);return nP(n=>{const o=n.loaded,a=n.lengthComputable?n.total:void 0,s=null!=a?Math.min(o,a):o,l=Math.max(0,s-r),c=i(l);r=Math.max(r,s);e({loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a?(a-s)/c:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})},n)},iP=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},oP=e=>(...t)=>mL.asap(()=>e(...t)),aP=YL.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,YL.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(YL.origin),YL.navigator&&/(msie|trident)/i.test(YL.navigator.userAgent)):()=>!0,sP=YL.hasStandardBrowserEnv?{write(e,t,n,r,i,o,a){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];mL.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),mL.isString(r)&&s.push(`path=${r}`),mL.isString(i)&&s.push(`domain=${i}`),!0===o&&s.push("secure"),mL.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function lP(e,t,n){let r=!("string"==typeof(i=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i));var i;return e&&(r||!1===n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const cP=e=>e instanceof JL?{...e}:e;function uP(e,t){t=t||{};const n=Object.create(null);function r(e,t,n,r){return mL.isPlainObject(e)&&mL.isPlainObject(t)?mL.merge.call({caseless:r},e,t):mL.isPlainObject(t)?mL.merge({},t):mL.isArray(t)?t.slice():t}function i(e,t,n,i){return mL.isUndefined(t)?mL.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function o(e,t){if(!mL.isUndefined(t))return r(void 0,t)}function a(e,t){return mL.isUndefined(t)?mL.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,o){return mL.hasOwnProp(t,o)?r(n,i):mL.hasOwnProp(e,o)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const l={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>i(cP(e),cP(t),0,!0)};return mL.forEach(Object.keys({...e,...t}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const o=mL.hasOwnProp(l,r)?l[r]:i,a=o(mL.hasOwnProp(e,r)?e[r]:void 0,mL.hasOwnProp(t,r)?t[r]:void 0,r);mL.isUndefined(a)&&o!==s||(n[r]=a)}),n}const dP=e=>{const t=uP({},e),n=e=>mL.hasOwnProp(t,e)?t[e]:void 0,r=n("data");let i=n("withXSRFToken");const o=n("xsrfHeaderName"),a=n("xsrfCookieName");let s=n("headers");const l=n("auth"),c=n("baseURL"),u=n("allowAbsoluteUrls"),d=n("url");if(t.headers=s=JL.from(s),t.url=SL(lP(c,d,u),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),mL.isFormData(r))if(YL.hasStandardBrowserEnv||YL.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(mL.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)})}if(YL.hasStandardBrowserEnv){mL.isFunction(i)&&(i=i(t));if(!0===i||null==i&&aP(t.url)){const e=o&&a&&sP.read(a);e&&s.set(o,e)}}return t};(Object.getOwnPropertyDescriptor(dP,"name")||{}).writable||Object.defineProperty(dP,"name",{value:"default",configurable:!0});const pP="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=dP(e);let i=r.data;const o=JL.from(r.headers).normalize();let a,s,l,c,u,{responseType:d,onUploadProgress:p,onDownloadProgress:h}=r;function f(){c&&c(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=JL.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());eP(function(e){t(e),f()},function(e){n(e),f()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new yL("Request aborted",yL.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=t&&t.message?t.message:"Network Error",i=new yL(r,yL.ERR_NETWORK,e,m);i.event=t||null,n(i),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||xL;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new yL(t,i.clarifyTimeoutError?yL.ETIMEDOUT:yL.ECONNABORTED,e,m)),m=null},void 0===i&&o.setContentType(null),"setRequestHeader"in m&&mL.forEach(o.toJSON(),function(e,t){m.setRequestHeader(t,e)}),mL.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),h&&([l,u]=rP(h,!0),m.addEventListener("progress",l)),p&&m.upload&&([s,c]=rP(p),m.upload.addEventListener("progress",s),m.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(a=t=>{m&&(n(!t||t.type?new $L(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===YL.protocols.indexOf(y)?n(new yL("Unsupported protocol "+y+":",yL.ERR_BAD_REQUEST,e)):m.send(i||null)})},hP=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof yL?t:new $L(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,i(new yL(`timeout of ${t}ms exceeded`,yL.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i));const{signal:s}=r;return s.unsubscribe=()=>mL.asap(a),s}},fP=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},mP=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},gP=(e,t,n,r)=>{const i=async function*(e,t){for await(const n of mP(e))yield*fP(n,t)}(e,t);let o,a=0,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return s(),void e.close();let o=r.byteLength;if(n){let e=a+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),i.return())},{highWaterMark:2})},{isFunction:yP}=mL,AP=(({Request:e,Response:t})=>({Request:e,Response:t}))(mL.global),{ReadableStream:vP,TextEncoder:bP}=mL.global,wP=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},EP=e=>{e=mL.merge.call({skipUndefined:!0},AP,e);const{fetch:t,Request:n,Response:r}=e,i=t?yP(t):"function"==typeof fetch,o=yP(n),a=yP(r);if(!i)return!1;const s=i&&yP(vP),l=i&&("function"==typeof bP?(c=new bP,e=>c.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var c;const u=o&&s&&wP(()=>{let e=!1;const t=new n(YL.origin,{body:new vP,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r}),d=a&&s&&wP(()=>mL.isReadableStream(new r("").body)),p={stream:d&&(e=>e.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!p[e]&&(p[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new yL(`Response type '${e}' is not supported`,yL.ERR_NOT_SUPPORT,n)})});const h=async(e,t)=>{const r=mL.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(mL.isBlob(e))return e.size;if(mL.isSpecCompliantForm(e)){const t=new n(YL.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return mL.isArrayBufferView(e)||mL.isArrayBuffer(e)?e.byteLength:(mL.isURLSearchParams(e)&&(e+=""),mL.isString(e)?(await l(e)).byteLength:void 0)})(t):r};return async e=>{let{url:i,method:a,data:s,signal:l,cancelToken:c,timeout:f,onDownloadProgress:m,onUploadProgress:g,responseType:y,headers:A,withCredentials:v="same-origin",fetchOptions:b}=dP(e),w=t||fetch;y=y?(y+"").toLowerCase():"text";let E=hP([l,c&&c.toAbortSignal()],f),k=null;const C=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let _;try{if(g&&u&&"get"!==a&&"head"!==a&&0!==(_=await h(A,s))){let e,t=new n(i,{method:"POST",body:s,duplex:"half"});if(mL.isFormData(s)&&(e=t.headers.get("content-type"))&&A.setContentType(e),t.body){const[e,n]=iP(_,rP(oP(g)));s=gP(t.body,65536,e,n)}}mL.isString(v)||(v=v?"include":"omit");const t=o&&"credentials"in n.prototype;if(mL.isFormData(s)){const e=A.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&A.delete("content-type")}const l={...b,signal:E,method:a.toUpperCase(),headers:A.normalize().toJSON(),body:s,duplex:"half",credentials:t?v:void 0};k=o&&new n(i,l);let c=await(o?w(k,b):w(i,l));const f=d&&("stream"===y||"response"===y);if(d&&(m||f&&C)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=c[t]});const t=mL.toFiniteNumber(c.headers.get("content-length")),[n,i]=m&&iP(t,rP(oP(m),!0))||[];c=new r(gP(c.body,65536,n,()=>{i&&i(),C&&C()}),e)}y=y||"text";let M=await p[mL.findKey(p,y)||"text"](c,e);return!f&&C&&C(),await new Promise((t,n)=>{eP(t,n,{data:M,headers:JL.from(c.headers),status:c.status,statusText:c.statusText,config:e,request:k})})}catch(t){if(C&&C(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new yL("Network Error",yL.ERR_NETWORK,e,k,t&&t.response),{cause:t.cause||t});throw yL.from(t,t&&t.code,e,k,t&&t.response)}}},kP=new Map,CP=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let a,s,l=o.length,c=kP;for(;l--;)a=o[l],s=c.get(a),void 0===s&&c.set(a,s=l?new Map:EP(t)),c=s;return s},_P=(CP(),{http:null,xhr:pP,fetch:{get:CP}});mL.forEach(_P,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const MP=e=>`- ${e}`,TP=e=>mL.isFunction(e)||null===e||!1===e;const SP={getAdapter:function(e,t){e=mL.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let a=0;a<n;a++){let n;if(r=e[a],i=r,!TP(r)&&(i=_P[(n=String(r)).toLowerCase()],void 0===i))throw new yL(`Unknown adapter '${n}'`);if(i&&(mL.isFunction(i)||(i=i.get(t))))break;o[n||"#"+a]=i}if(!i){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(MP).join("\n"):" "+MP(e[0]):"as no adapter specified";throw new yL("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return i},adapters:_P};function DP(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new $L(null,e)}function xP(e){DP(e),e.headers=JL.from(e.headers),e.data=KL.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return SP.getAdapter(e.adapter||jL.adapter,e)(e).then(function(t){return DP(e),t.data=KL.call(e,e.transformResponse,t),t.headers=JL.from(t.headers),t},function(t){return XL(t)||(DP(e),t&&t.response&&(t.response.data=KL.call(e,e.transformResponse,t.response),t.response.headers=JL.from(t.response.headers))),Promise.reject(t)})}const IP="1.15.2",LP={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{LP[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const PP={};LP.transitional=function(e,t,n){function r(e,t){return"[Axios v"+IP+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new yL(r(i," has been removed"+(t?" in "+t:"")),yL.ERR_DEPRECATED);return t&&!PP[i]&&(PP[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}},LP.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const OP={assertOptions:function(e,t,n){if("object"!=typeof e)throw new yL("options must be an object",yL.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(a){const t=e[o],n=void 0===t||a(t,o,e);if(!0!==n)throw new yL("option "+o+" must be "+n,yL.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new yL("Unknown option "+o,yL.ERR_BAD_OPTION)}},validators:LP},RP=OP.validators;class BP{constructor(e){this.defaults=e||{},this.interceptors={request:new DL,response:new DL}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),r=-1===t?-1:n.indexOf("\n",t+1),i=-1===r?"":n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=uP(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&OP.assertOptions(n,{silentJSONParsing:RP.transitional(RP.boolean),forcedJSONParsing:RP.transitional(RP.boolean),clarifyTimeoutError:RP.transitional(RP.boolean),legacyInterceptorReqResOrdering:RP.transitional(RP.boolean)},!1),null!=r&&(mL.isFunction(r)?t.paramsSerializer={serialize:r}:OP.assertOptions(r,{encode:RP.function,serialize:RP.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),OP.assertOptions(t,{baseUrl:RP.spelling("baseURL"),withXsrfToken:RP.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&mL.merge(i.common,i[t.method]);i&&mL.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]}),t.headers=JL.concat(o,i);const a=[];let s=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;s=s&&e.synchronous;const n=t.transitional||xL;n&&n.legacyInterceptorReqResOrdering?a.unshift(e.fulfilled,e.rejected):a.push(e.fulfilled,e.rejected)});const l=[];let c;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let u,d=0;if(!s){const e=[xP.bind(this),void 0];for(e.unshift(...a),e.push(...l),u=e.length,c=Promise.resolve(t);d<u;)c=c.then(e[d++],e[d++]);return c}u=a.length;let p=t;for(;d<u;){const e=a[d++],t=a[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{c=xP.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=l.length;d<u;)c=c.then(l[d++],l[d++]);return c}getUri(e){return SL(lP((e=uP(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}mL.forEach(["delete","get","head","options"],function(e){BP.prototype[e]=function(t,n){return this.request(uP(n||{},{method:e,url:t,data:(n||{}).data}))}}),mL.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,i){return this.request(uP(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}BP.prototype[e]=t(),BP.prototype[e+"Form"]=t(!0)});const YP=BP;class NP{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new $L(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;const t=new NP(function(t){e=t});return{token:t,cancel:e}}}const VP=NP;const FP={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(FP).forEach(([e,t])=>{FP[t]=e});const jP=FP;const HP=function e(t){const n=new YP(t),r=_I(YP.prototype.request,n);return mL.extend(r,YP.prototype,n,{allOwnKeys:!0}),mL.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(uP(t,n))},r}(jL);HP.Axios=YP,HP.CanceledError=$L,HP.CancelToken=VP,HP.isCancel=XL,HP.VERSION=IP,HP.toFormData=EL,HP.AxiosError=yL,HP.Cancel=HP.CanceledError,HP.all=function(e){return Promise.all(e)},HP.spread=function(e){return function(t){return e.apply(null,t)}},HP.isAxiosError=function(e){return mL.isObject(e)&&!0===e.isAxiosError},HP.mergeConfig=uP,HP.AxiosHeaders=JL,HP.formToJSON=e=>NL(mL.isHTMLForm(e)?new FormData(e):e),HP.getAdapter=SP.getAdapter,HP.HttpStatusCode=jP,HP.default=HP;const qP=HP;var GP="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==i.g&&i.g||{},zP="URLSearchParams"in GP,UP="Symbol"in GP&&"iterator"in Symbol,WP="FileReader"in GP&&"Blob"in GP&&function(){try{return new Blob,!0}catch(e){return!1}}(),QP="FormData"in GP,ZP="ArrayBuffer"in GP;if(ZP)var JP=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],KP=ArrayBuffer.isView||function(e){return e&&JP.indexOf(Object.prototype.toString.call(e))>-1};function XP(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function $P(e){return"string"!=typeof e&&(e=String(e)),e}function eO(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return UP&&(t[Symbol.iterator]=function(){return t}),t}function tO(e){this.map={},e instanceof tO?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function nO(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function rO(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function iO(e){var t=new FileReader,n=rO(t);return t.readAsArrayBuffer(e),n}function oO(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function aO(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:WP&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:QP&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:zP&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():ZP&&WP&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=oO(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):ZP&&(ArrayBuffer.prototype.isPrototypeOf(e)||KP(e))?this._bodyArrayBuffer=oO(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):zP&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},WP&&(this.blob=function(){var e=nO(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=nO(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(WP)return this.blob().then(iO);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e=nO(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=rO(t),r=/charset=([A-Za-z0-9_-]+)/.exec(e.type),i=r?r[1]:"utf-8";return t.readAsText(e,i),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},QP&&(this.formData=function(){return this.text().then(cO)}),this.json=function(){return this.text().then(JSON.parse)},this}tO.prototype.append=function(e,t){e=XP(e),t=$P(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},tO.prototype.delete=function(e){delete this.map[XP(e)]},tO.prototype.get=function(e){return e=XP(e),this.has(e)?this.map[e]:null},tO.prototype.has=function(e){return this.map.hasOwnProperty(XP(e))},tO.prototype.set=function(e,t){this.map[XP(e)]=$P(t)},tO.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},tO.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),eO(e)},tO.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),eO(e)},tO.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),eO(e)},UP&&(tO.prototype[Symbol.iterator]=tO.prototype.entries);var sO=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function lO(e,t){if(!(this instanceof lO))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,i=(t=t||{}).body;if(e instanceof lO){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new tO(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new tO(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),sO.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in GP)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var o=/([?&])_=[^&]*/;if(o.test(this.url))this.url=this.url.replace(o,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function cO(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}}),t}function uO(e,t){if(!(this instanceof uO))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new tO(t.headers),this.url=t.url||"",this._initBody(e)}lO.prototype.clone=function(){return new lO(this,{body:this._bodyInit})},aO.call(lO.prototype),aO.call(uO.prototype),uO.prototype.clone=function(){return new uO(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new tO(this.headers),url:this.url})},uO.error=function(){var e=new uO(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var dO=[301,302,303,307,308];uO.redirect=function(e,t){if(-1===dO.indexOf(t))throw new RangeError("Invalid status code");return new uO(null,{status:t,headers:{location:e}})};var pO=GP.DOMException;try{new pO}catch(e){pO=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},pO.prototype=Object.create(Error.prototype),pO.prototype.constructor=pO}function hO(e,t){return new Promise(function(n,r){var i=new lO(e,t);if(i.signal&&i.signal.aborted)return r(new pO("Aborted","AbortError"));var o=new XMLHttpRequest;function a(){o.abort()}if(o.onload=function(){var e,t,r={statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new tO,e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e}).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();try{t.append(r,i)}catch(e){console.warn("Response "+e.message)}}}),t)};0===i.url.indexOf("file://")&&(o.status<200||o.status>599)?r.status=200:r.status=o.status,r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL");var a="response"in o?o.response:o.responseText;setTimeout(function(){n(new uO(a,r))},0)},o.onerror=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){r(new TypeError("Network request timed out"))},0)},o.onabort=function(){setTimeout(function(){r(new pO("Aborted","AbortError"))},0)},o.open(i.method,function(e){try{return""===e&&GP.location.href?GP.location.href:e}catch(t){return e}}(i.url),!0),"include"===i.credentials?o.withCredentials=!0:"omit"===i.credentials&&(o.withCredentials=!1),"responseType"in o&&(WP?o.responseType="blob":ZP&&(o.responseType="arraybuffer")),t&&"object"==typeof t.headers&&!(t.headers instanceof tO||GP.Headers&&t.headers instanceof GP.Headers)){var s=[];Object.getOwnPropertyNames(t.headers).forEach(function(e){s.push(XP(e)),o.setRequestHeader(e,$P(t.headers[e]))}),i.headers.forEach(function(e,t){-1===s.indexOf(t)&&o.setRequestHeader(t,e)})}else i.headers.forEach(function(e,t){o.setRequestHeader(t,e)});i.signal&&(i.signal.addEventListener("abort",a),o.onreadystatechange=function(){4===o.readyState&&i.signal.removeEventListener("abort",a)}),o.send(void 0===i._bodyInit?null:i._bodyInit)})}hO.polyfill=!0,GP.fetch||(GP.fetch=hO,GP.Headers=tO,GP.Request=lO,GP.Response=uO);const fO=(e,t)=>n=>r=>i=>{if("LOAD_CONFIG"===i.type)t&&n.dispatch({type:"APPLY_WEBCHAT_SETTINGS_OVERRIDES",payload:t}),(async()=>{const r=await(async(e,t)=>{const n="signal"in new Request("")?window.fetch:hO,r=new AbortController,i=setTimeout(()=>r.abort(),t);let o=null;try{o=await n(e,{signal:r.signal})}catch(e){"AbortError"===e.name&&console.warn("Unable to fetch endpoint configuration in time")}return clearTimeout(i),o?o.json():null})(e,n.getState().config.settings.embeddingConfiguration?.connectivity?.enabled&&n.getState().config.settings.embeddingConfiguration?.connectivity?.timeout||4e3);if(r){const e=Bx()({},r.settings,t),i={...r,settings:e};n.dispatch(Yx({...i,isConfigLoaded:!0}));const o=e.chatOptions?.showTTSToggle,a=e.behavior?.enableTTS&&(!o||e.chatOptions.activateTTSToggle);n.dispatch(ET(a))}else t?n.dispatch(Yx({settings:t,isTimedOut:!0,isConfigLoaded:!0})):n.dispatch(Yx({isTimedOut:!0,isConfigLoaded:!0}))})();return r(i)},mO=(e,t)=>{const n=()=>{e.dispatch(jx(!0))};var r;r=()=>{e.dispatch({type:"NETWORK_ON"})},window.addEventListener("online",r,!1),t.on("socket/connect",n),t.on("socket/reconnect",n),t.on("socket/pong",n),t.on("output",n),t.on("socket/disconnect",()=>{e.dispatch(jx(!1))}),t.on("socket/error",t=>{"RECONNECTION_LIMIT"===t.type&&e.dispatch(Hx(!0))})},gO="hasAcceptedTerms";function yO(e){let t=[];if(e){const n=e.getItem(gO);if(n)try{const e=JSON.parse(n);Array.isArray(e)&&(t=e)}catch(t){console.error(`[Webchat Privacy Policy]: Error parsing ${gO} from ${e}`,t)}}return t}function AO(e,t){if(!e)return console.warn("No browser storage available to store accepted terms."),!0;return yO(e).includes(t)}const vO=e=>t=>n=>{const{disableLocalStorage:r,useSessionStorage:i}=e.getState().config.settings.embeddingConfiguration,o=bI({useSessionStorage:i,disableLocalStorage:r});switch(n.type){case"TOGGLE_OPEN":{const t=e.getState().ui.open;e.dispatch(nT(!t));break}case"SET_OPEN":{const{open:t}=n,{showHomeScreen:r,showPrevConversations:i,showChatOptionsScreen:o}=e.getState().ui;t&&(!i&&!o&&!r)&&e.dispatch({type:"CLEAR_UNSEEN_MESSAGES"});break}case"SHOW_CHAT_SCREEN":e.getState().ui.isPageVisible&&e.dispatch({type:"CLEAR_UNSEEN_MESSAGES"});break;case"SET_PAGE_VISIBLE":n.visible&&e.getState().ui.open&&e.dispatch({type:"CLEAR_UNSEEN_MESSAGES"});break;case"SET_HAS_ACCEPTED_TERMS":o&&function(e,t){const n=yO(e);n.push(t);const r=JSON.stringify([...new Set(n.filter(Boolean))]);e?.setItem?.(gO,r)}(o,n.userId)}return t(n)},bO=e=>{(e=>{const t=()=>e(eT());document.addEventListener(XM,t,!1)})(t=>{e.dispatch((e=>({type:gT,visible:e}))(t))})},wO=Object.keys||function(e){const t=[];for(const n in e)({}).hasOwnProperty.call(e,n)&&t.push(n);return t};function EO(e){const t=e||{};return t.features={pause:!0,export:!0,test:!0},t.type="redux",void 0===t.autoPause&&(t.autoPause=!0),void 0===t.latency&&(t.latency=500),function(e){return function(n,r){const i=e(n,r),o=i.dispatch,a=window.__REDUX_DEVTOOLS_EXTENSION__.connect(t);a.init(i.getState());const s=function(e){const t=o(e);return a.send(e,i.getState()),t};return Object.assign?Object.assign(i,{dispatch:s}):function(e,t,n){const r=wO(e),i={};for(let t=0,n=r.length;t<n;t++){const n=r[t];i[n]=e[n]}return i[t]=n,i}(i,"dispatch",s)}}}function kO(e){return function(){return jM(jM(...arguments),EO(e))}}"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;const CO=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__?0===t.length?EO():"object"==typeof t[0]?kO(t[0]):kO()(...t):0!==t.length?"object"==typeof t[0]?jM:jM(...t):void 0},_O=(e=self.crypto?.randomUUID?.(),t)=>({type:"SWITCH_SESSION",sessionId:e,conversation:t}),MO=e=>t=>n=>r=>{switch(r.type){case"SWITCH_SESSION":{const{sessionId:n,conversation:i}=r,o=n||"",a=i||t.getState().prevConversations?.[o]||{messages:[],rating:OT};t.dispatch({type:"SET_PREV_STATE",state:a}),t.dispatch(Fx(!0)),e.switchSession(o).then(()=>{t.dispatch(Fx(!1)),t.dispatch(Px(e.socketOptions)),t.dispatch({type:"AUTO_INJECT_HANDLED_RESET"}),t.dispatch({type:"TRIGGER_AUTO_INJECT"})}).catch(()=>{t.dispatch(Fx(!1))});break}case"SEND_MESSAGE":case"RECEIVE_MESSAGE":case"TRIGGER_ENGAGEMENT_MESSAGE":case"SHOW_RATING_SCREEN":case"SET_HAS_GIVEN_RATING":case"SET_CUSTOM_RATING_TITLE":case"SET_CUSTOM_RATING_COMMENT_TEXT":{const e=t.getState().options.sessionId;if(!e)break;const n={messages:t.getState().messages.messageHistory,rating:t.getState().rating};t.dispatch(((e,t)=>({type:oI,sessionId:e,conversation:t}))(e,n));break}}return n(r)},TO=e=>({type:"ADD_FILES_TO_LIST",newFiles:e}),SO=()=>e=>t=>async n=>{switch(n.type){case"ADD_FILES_TO_LIST":{const{fileAttachmentMaxSize:t,embeddingConfiguration:{_endpointTokenUrl:r}}=e.getState().config.settings,i=e.getState().input.fileList;let o=[];const a=t>0?t/1048576:0;n.newFiles?.forEach(e=>{e.size>t?o.push({file:e,progressPercentage:10,hasUploadError:!0,uploadErrorReason:`File size > ${a}MB`}):o.push({file:e,progressPercentage:30})}),e.dispatch(Xx(i.concat(o)));const s=`${r}/fileuploadtoken`;let l,c=!1;try{l=await(async e=>(await hO(e)).json())(s)}catch(e){c=!0}o=o.map(e=>(e.hasUploadError||(e.progressPercentage=50,e.hasUploadError=c,e.uploadErrorReason=c?"Upload Failed":e.uploadErrorReason),e)),setTimeout(()=>{e.dispatch(Xx(i.concat(o)))},100),o=(await Promise.all(o.map(async t=>{try{t.hasUploadError||t.isCancelled?e.dispatch(eI(!0)):(t.abortController=new AbortController,t.uploadFileMeta=await(async(e,t,n,r)=>{const i={data:{file:e},headers:{authorization:`Bearer ${n}`,"Content-Type":"multipart/form-data"},method:"POST",url:t,signal:r?r.signal:void 0};return(await qP(i)).data})(t.file,l.fileUploadUrl,l.token,t.abortController),"infected"===t.uploadFileMeta.status&&(t.hasUploadError=!0,t.uploadErrorReason="Infected File",e.dispatch(eI(!0))),t.uploadFileMeta.fileName=t.file.name,t.progressPercentage=100)}catch(n){if("ERR_CANCELED"===n.code)return void(t.isCancelled=!0);t.hasUploadError=!0,t.uploadErrorReason="Failed Upload!",e.dispatch(eI(!0))}return t}))).filter(Boolean),e.dispatch(Xx(i.concat(o)));break}}return t(n)},DO=e=>t=>n=>{const r=e.getState();switch(n.type){case"SET_TEXT_ACTIVE":case"SEND_MESSAGE":r.userTyping.shouldSendUserTypingOff&&(e.dispatch(Tx(!1)),e.dispatch(fI(!1)));break;case"input/content-updated":if(r.userTyping.shouldSendUserTypingOff){clearTimeout(r.userTyping.typingTimeoutId);const t=setTimeout(()=>{e.getState().userTyping.shouldSendUserTypingOff&&(e.dispatch(Tx(!1)),e.dispatch(fI(!1)))},2e3);e.dispatch(mI(t))}else e.dispatch(Tx(!0)),e.dispatch(fI(!0))}return t(n)};let xO=null;const IO=(e,t,n)=>{const{client:r}=e,i=VM(AI,CO(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error(OM(15))},i={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},o=t.map(function(e){return e(i)});return r=jM.apply(void 0,o)(n.dispatch),PM(PM({},n),{},{dispatch:r})}}}((e=>t=>t=>n=>{switch(n.type){case"SET_OPEN":e.emitAnalytics(n.open?"webchat/open":"webchat/close");break;case"SET_MINIMIZE":e.emitAnalytics("webchat/minimize");break;case"SEND_MESSAGE":e.emitAnalytics("webchat/outgoing-message",n.message);break;case"RECEIVE_MESSAGE":(n.message.text||n.message.data)&&e.emitAnalytics("webchat/incoming-message",n.message);break;case"SWITCH_SESSION":e.emitAnalytics("webchat/switch-session",n.sessionId)}return t(n)})(e),(e=>t=>n=>r=>{switch(r.type){case"CONNECT":{const{storedMessage:n}=t.getState().ui;e.connected||t.getState().connection.connecting||(t.dispatch(Fx(!0)),e.connect().then(()=>{t.dispatch(Fx(!1)),t.dispatch(Hx(!1)),n&&(t.dispatch(Mx({text:n.text,data:n.data},n.options)),t.dispatch(bT(null))),t.dispatch(Px(e.socketOptions))}).catch(()=>{t.dispatch(Fx(!1))}));break}case"SHOW_CHAT_SCREEN":e.connected||t.dispatch({type:"CONNECT"});break;case"SEND_MESSAGE":t.dispatch({type:"CONNECT"});break;case"SET_PAGE_VISIBLE":r.visible&&kI(t.getState())&&t.dispatch({type:"CONNECT"});break;case CI:e.disconnect();break;case"NETWORK_ON":kI(t.getState())&&t.dispatch({type:"CONNECT"})}return n(r)})(r),(()=>{let e=null;return t=>{const n=()=>{const{messages:e}=t.getState().inputCollation,n=e.map(e=>e.text).join(" "),r=e.flatMap(e=>{const t=e.data?.attachments;return Array.isArray(t)?t:[]});return{...e[0],text:n,data:r.length>0?{attachments:r}:void 0}},r=()=>{e&&(clearTimeout(e),e=null)};return i=>o=>{switch(o.type){case"SEND_MESSAGE":{const{enableInputCollation:a,inputCollationTimeout:s}=t.getState().config.settings.layout;if(!a)break;const l=o.options?.collate;return l?(r(),e=setTimeout(()=>{t.dispatch({type:"SUBMIT_COLLATED_MESSAGES"})},s),i((e=>({type:"ADD_COLLATED_MESSAGE",message:e}))(o.message))):(r(),i(Mx(n())),i(o))}case"SUBMIT_COLLATED_MESSAGES":{r();const e=n();return i(o),void t.dispatch(Mx(e))}}return i(o)}}})(),Ix(r),fO(t,n),(e=>t=>n=>r=>{switch(r.type){case"SET_CONFIG":case"SET_CONNECTED":case"SHOW_CHAT_SCREEN":case"SET_OPTIONS":{const e=n(r);return(()=>{const e=t.getState(),{isAutoInjectHandled:n,isConfiguredOnce:r,isConnectedOnce:i,isChatOpenedOnce:o,isSessionRestoredOnce:a}=e.autoInject;n||r&&i&&o&&a&&t.dispatch({type:"TRIGGER_AUTO_INJECT"})})(),e}case"TRIGGER_AUTO_INJECT":{const n=t.getState(),r=n.config;if(t.dispatch({type:"AUTO_INJECT_HANDLED"}),"injection"!==r.settings.startBehavior.startBehavior)break;if(!r.settings.widgetSettings.enableInjectionWithoutEmptyHistory){if(n.ui.storedMessage)break;const e=n.messages.messageHistory?.filter(e=>"engagement"!==e.source);if(0!==ft(e).length)break}const i=n.config.settings.startBehavior.getStartedPayload,o=n.config.settings.startBehavior.getStartedData,a=n.config.settings.startBehavior.getStartedText;e.sendMessage(i,o,{label:a});break}}return n(r)})(e),MO(r),SO(),EI,vO,DO)));return(e=>{xO=e})(i),((e,t)=>{t.on("output",gD(e))})(i,r),((e,t)=>{t.on("typingStatus",t=>{try{const n="typingOn"===t.status,r=e.getState().ui.typing,i=n?"show":"show"===r?"hide":null;i&&e.dispatch(uT(i))}catch(e){}})})(i,r),mO(i,r),bO(i),i},LO=Ye.button(({theme:e})=>{const t="hsla(0, 0%, 0%, .24)",n="hsla(0, 0%, 0%, .54)";return{padding:e.unitSize,boxSizing:"border-box",color:t,fill:t,backgroundColor:"transparent",border:"none",outline:"none",margin:0,minWidth:24,minHeight:24,display:"flex",alignItems:"center",justifyContent:"center","&:not(.disabled)":{cursor:"pointer","&.active, &:hover":{color:n,fill:n}},transition:lt("background-color","color","fill"),svg:{width:25,height:25}}});var PO,OO=["title","titleId"];function RO(){return RO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RO.apply(null,arguments)}const BO=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,OO);return r.createElement("svg",RO({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none","aria-hidden":"true",viewBox:"0 0 16 16","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,PO||(PO=r.createElement("g",{clipRule:"evenodd"},r.createElement("path",{d:"M14.727 1.293a1 1 0 0 1 0 1.414L2.706 14.727a1 1 0 0 1-1.414-1.413l12.02-12.021a1 1 0 0 1 1.415 0"}),r.createElement("path",{d:"M14.727 14.728a1 1 0 0 1-1.415 0L1.292 2.708a1 1 0 0 1 1.414-1.415l12.02 12.02a1 1 0 0 1 0 1.415"}))))};var YO,NO=["title","titleId"];function VO(){return VO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},VO.apply(null,arguments)}const FO=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,NO);return r.createElement("svg",VO({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none","aria-hidden":"true",viewBox:"0 -960 960 960","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,YO||(YO=r.createElement("path",{d:"M180.78-427v-106h598.44v106z"})))};var jO,HO=["title","titleId"];function qO(){return qO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qO.apply(null,arguments)}const GO=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,HO);return r.createElement("svg",qO({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none","aria-hidden":"true",viewBox:"0 0 16 16","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,jO||(jO=r.createElement("path",{d:"M11.758 1.35a1 1 0 0 1-.109 1.41L5.535 8l6.114 5.24a1 1 0 0 1-1.301 1.52L4.234 9.518a2 2 0 0 1 0-3.038l6.114-5.24a1 1 0 0 1 1.41.108",clipRule:"evenodd"})))};var zO,UO=["title","titleId"];function WO(){return WO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},WO.apply(null,arguments)}const QO=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,UO);return r.createElement("svg",WO({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none","aria-hidden":"true",viewBox:"0 0 16 16","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,zO||(zO=r.createElement("g",{fill:"#1A1A1A"},r.createElement("circle",{cx:8,cy:8,r:2}),r.createElement("circle",{cx:8,cy:2,r:2}),r.createElement("circle",{cx:8,cy:14,r:2}))))};let ZO={data:""},JO=e=>{if("object"==typeof window){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||ZO},KO=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,XO=/\/\*[^]*?\*\/| +/g,$O=/\n+/g,eR=(e,t)=>{let n="",r="",i="";for(let o in e){let a=e[o];"@"==o[0]?"i"==o[1]?n=o+" "+a+";":r+="f"==o[1]?eR(a,o):o+"{"+eR(a,"k"==o[1]?"":t)+"}":"object"==typeof a?r+=eR(a,t?t.replace(/([^,])+/g,e=>o.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):o):null!=a&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=eR.p?eR.p(o,a):o+":"+a+";")}return n+(t&&i?t+"{"+i+"}":i)+r},tR={},nR=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+nR(e[n]);return t}return e},rR=(e,t,n,r,i)=>{let o=nR(e),a=tR[o]||(tR[o]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(o));if(!tR[a]){let t=o!==e?e:(e=>{let t,n,r=[{}];for(;t=KO.exec(e.replace(XO,""));)t[4]?r.shift():t[3]?(n=t[3].replace($O," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace($O," ").trim();return r[0]})(e);tR[a]=eR(i?{["@keyframes "+a]:t}:t,n?"":"."+a)}let s=n&&tR.g?tR.g:null;return n&&(tR.g=tR[a]),((e,t,n,r)=>{r?t.data=t.data.replace(r,e):-1===t.data.indexOf(e)&&(t.data=n?e+t.data:t.data+e)})(tR[a],t,r,s),a};function iR(e){let t=this||{},n=e.call?e(t.p):e;return rR(n.unshift?n.raw?((e,t,n)=>e.reduce((e,r,i)=>{let o=t[i];if(o&&o.call){let e=o(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?"."+t:e&&"object"==typeof e?e.props?"":eR(e,""):!1===e?"":e}return e+r+(null==o?"":o)},""))(n,[].slice.call(arguments,1),t.p):n.reduce((e,n)=>Object.assign(e,n&&n.call?n(t.p):n),{}):n,JO(t.target),t.g,t.o,t.k)}iR.bind({g:1});let oR,aR,sR,lR=iR.bind({k:1});function cR(e,t){let n=this||{};return function(){let r=arguments;function i(o,a){let s=Object.assign({},o),l=s.className||i.className;n.p=Object.assign({theme:aR&&aR()},s),n.o=/ *go\d+/.test(l),s.className=iR.apply(n,r)+(l?" "+l:""),t&&(s.ref=a);let c=e;return e[0]&&(c=s.as||e,delete s.as),sR&&c[0]&&sR(s),oR(c,s)}return t?t(i):i}}var uR=(e,t)=>(e=>"function"==typeof e)(e)?e(t):e,dR=(()=>{let e=0;return()=>(++e).toString()})(),pR=(()=>{let e;return()=>{if(void 0===e&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),hR="default",fR=(e,t)=>{let{toastLimit:n}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,n)};case 1:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case 2:let{toast:r}=t;return fR(e,{type:e.toasts.find(e=>e.id===r.id)?1:0,toast:r});case 3:let{toastId:i}=t;return{...e,toasts:e.toasts.map(e=>e.id===i||void 0===i?{...e,dismissed:!0,visible:!1}:e)};case 4:return void 0===t.toastId?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let o=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(e=>({...e,pauseDuration:e.pauseDuration+o}))}}},mR=[],gR={toasts:[],pausedAt:void 0,settings:{toastLimit:20}},yR={},AR=(e,t=hR)=>{yR[t]=fR(yR[t]||gR,e),mR.forEach(([e,n])=>{e===t&&n(yR[t])})},vR=e=>Object.keys(yR).forEach(t=>AR(e,t)),bR=(e=hR)=>t=>{AR(t,e)},wR={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},ER=e=>(t,n)=>{let r=((e,t="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(null==n?void 0:n.id)||dR()}))(t,e,n);return bR(r.toasterId||(e=>Object.keys(yR).find(t=>yR[t].toasts.some(t=>t.id===e)))(r.id))({type:2,toast:r}),r.id},kR=(e,t)=>ER("blank")(e,t);kR.error=ER("error"),kR.success=ER("success"),kR.loading=ER("loading"),kR.custom=ER("custom"),kR.dismiss=(e,t)=>{let n={type:3,toastId:e};t?bR(t)(n):vR(n)},kR.dismissAll=e=>kR.dismiss(void 0,e),kR.remove=(e,t)=>{let n={type:4,toastId:e};t?bR(t)(n):vR(n)},kR.removeAll=e=>kR.remove(void 0,e),kR.promise=(e,t,n)=>{let r=kR.loading(t.loading,{...n,...null==n?void 0:n.loading});return"function"==typeof e&&(e=e()),e.then(e=>{let i=t.success?uR(t.success,e):void 0;return i?kR.success(i,{id:r,...n,...null==n?void 0:n.success}):kR.dismiss(r),e}).catch(e=>{let i=t.error?uR(t.error,e):void 0;i?kR.error(i,{id:r,...n,...null==n?void 0:n.error}):kR.dismiss(r)}),e};var CR=(e,t="default")=>{let{toasts:n,pausedAt:i}=((e={},t=hR)=>{let[n,i]=(0,r.useState)(yR[t]||gR),o=(0,r.useRef)(yR[t]);(0,r.useEffect)(()=>(o.current!==yR[t]&&i(yR[t]),mR.push([t,i]),()=>{let e=mR.findIndex(([e])=>e===t);e>-1&&mR.splice(e,1)}),[t]);let a=n.toasts.map(t=>{var n,r,i;return{...e,...e[t.type],...t,removeDelay:t.removeDelay||(null==(n=e[t.type])?void 0:n.removeDelay)||(null==e?void 0:e.removeDelay),duration:t.duration||(null==(r=e[t.type])?void 0:r.duration)||(null==e?void 0:e.duration)||wR[t.type],style:{...e.style,...null==(i=e[t.type])?void 0:i.style,...t.style}}});return{...n,toasts:a}})(e,t),o=(0,r.useRef)(new Map).current,a=(0,r.useCallback)((e,t=1e3)=>{if(o.has(e))return;let n=setTimeout(()=>{o.delete(e),s({type:4,toastId:e})},t);o.set(e,n)},[]);(0,r.useEffect)(()=>{if(i)return;let e=Date.now(),r=n.map(n=>{if(n.duration===1/0)return;let r=(n.duration||0)+n.pauseDuration-(e-n.createdAt);if(!(r<0))return setTimeout(()=>kR.dismiss(n.id,t),r);n.visible&&kR.dismiss(n.id)});return()=>{r.forEach(e=>e&&clearTimeout(e))}},[n,i,t]);let s=(0,r.useCallback)(bR(t),[t]),l=(0,r.useCallback)(()=>{s({type:5,time:Date.now()})},[s]),c=(0,r.useCallback)((e,t)=>{s({type:1,toast:{id:e,height:t}})},[s]),u=(0,r.useCallback)(()=>{i&&s({type:6,time:Date.now()})},[i,s]),d=(0,r.useCallback)((e,t)=>{let{reverseOrder:r=!1,gutter:i=8,defaultPosition:o}=t||{},a=n.filter(t=>(t.position||o)===(e.position||o)&&t.height),s=a.findIndex(t=>t.id===e.id),l=a.filter((e,t)=>t<s&&e.visible).length;return a.filter(e=>e.visible).slice(...r?[l+1]:[0,l]).reduce((e,t)=>e+(t.height||0)+i,0)},[n]);return(0,r.useEffect)(()=>{n.forEach(e=>{if(e.dismissed)a(e.id,e.removeDelay);else{let t=o.get(e.id);t&&(clearTimeout(t),o.delete(e.id))}})},[n,a]),{toasts:n,handlers:{updateHeight:c,startPause:l,endPause:u,calculateOffset:d}}},_R=lR`
|
|
481
481
|
from {
|
|
482
482
|
transform: scale(0) rotate(45deg);
|
|
483
483
|
opacity: 0;
|
|
@@ -647,4 +647,4 @@ to {
|
|
|
647
647
|
> * {
|
|
648
648
|
pointer-events: auto;
|
|
649
649
|
}
|
|
650
|
-
`,UR=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:i,children:o,toasterId:a,containerStyle:s,containerClassName:l})=>{let{toasts:c,handlers:u}=CR(n,a);return r.createElement("div",{"data-rht-toaster":a||"",style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...s},className:l,onMouseEnter:u.startPause,onMouseLeave:u.endPause},c.map(n=>{let a=n.position||t,s=((e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:pR()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}})(a,u.calculateOffset(n,{reverseOrder:e,gutter:i,defaultPosition:t}));return r.createElement(GR,{id:n.id,key:n.id,onHeightUpdate:u.updateHeight,className:n.visible?zR:"",style:s},"custom"===n.type?uR(n.message,n):o?o(n):r.createElement(qR,{toast:n,position:a}))}))},WR=kR;function QR(e,t={}){WR(e,t)}const ZR=()=>{const e=r.useContext(Te);return r.createElement(UR,{gutter:1,toastOptions:{duration:1500,style:{backgroundColor:e.green10,borderRadius:0,boxShadow:"none",color:e.green,fontFamily:e.fontFamily,fontSize:14,fontWeight:600,lineHeight:1.3,maxWidth:"unset",paddingBlock:16,paddingInlineStart:20,width:"100%"}},containerStyle:{left:0,position:"relative",right:0,top:0,width:"100%"}})};var JR,KR,XR=i(4176),$R=i.n(XR),eB=["title","titleId"];function tB(){return tB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tB.apply(null,arguments)}const nB=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,eB);return r.createElement("svg",tB({xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",viewBox:"0 0 28 28","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,JR||(JR=r.createElement("rect",{width:28,height:28,fill:"#2455E6",rx:14})),KR||(KR=r.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"m11.084 10.61-4.12 9.865H4.2L9.705 7.3h2.758l5.506 13.176H15.21zM22.317 7.3v13.176h-2.899V7.3z",clipRule:"evenodd"})))};function rB(e){return rB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rB(e)}var iB=/^\s+/,oB=/\s+$/;function aB(e,t){if(t=t||{},(e=e||"")instanceof aB)return e;if(!(this instanceof aB))return new aB(e,t);var n=function(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,o=null,a=!1,s=!1;"string"==typeof e&&(e=function(e){e=e.replace(iB,"").replace(oB,"").toLowerCase();var t,n=!1;if(kB[e])e=kB[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=BB.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=BB.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=BB.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=BB.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=BB.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=BB.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=BB.hex8.exec(e))return{r:SB(t[1]),g:SB(t[2]),b:SB(t[3]),a:LB(t[4]),format:n?"name":"hex8"};if(t=BB.hex6.exec(e))return{r:SB(t[1]),g:SB(t[2]),b:SB(t[3]),format:n?"name":"hex"};if(t=BB.hex4.exec(e))return{r:SB(t[1]+""+t[1]),g:SB(t[2]+""+t[2]),b:SB(t[3]+""+t[3]),a:LB(t[4]+""+t[4]),format:n?"name":"hex8"};if(t=BB.hex3.exec(e))return{r:SB(t[1]+""+t[1]),g:SB(t[2]+""+t[2]),b:SB(t[3]+""+t[3]),format:n?"name":"hex"};return!1}(e));"object"==rB(e)&&(YB(e.r)&&YB(e.g)&&YB(e.b)?(t=function(e,t,n){return{r:255*MB(e,255),g:255*MB(t,255),b:255*MB(n,255)}}(e.r,e.g,e.b),a=!0,s="%"===String(e.r).substr(-1)?"prgb":"rgb"):YB(e.h)&&YB(e.s)&&YB(e.v)?(r=xB(e.s),i=xB(e.v),t=function(e,t,n){e=6*MB(e,360),t=MB(t,100),n=MB(n,100);var r=Math.floor(e),i=e-r,o=n*(1-t),a=n*(1-i*t),s=n*(1-(1-i)*t),l=r%6,c=[n,a,o,o,s,n][l],u=[s,n,n,a,o,o][l],d=[o,o,s,n,n,a][l];return{r:255*c,g:255*u,b:255*d}}(e.h,r,i),a=!0,s="hsv"):YB(e.h)&&YB(e.s)&&YB(e.l)&&(r=xB(e.s),o=xB(e.l),t=function(e,t,n){var r,i,o;function a(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=MB(e,360),t=MB(t,100),n=MB(n,100),0===t)r=i=o=n;else{var s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;r=a(l,s,e+1/3),i=a(l,s,e),o=a(l,s,e-1/3)}return{r:255*r,g:255*i,b:255*o}}(e.h,r,o),a=!0,s="hsl"),e.hasOwnProperty("a")&&(n=e.a));return n=_B(n),{ok:a,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function sB(e,t,n){e=MB(e,255),t=MB(t,255),n=MB(n,255);var r,i,o=Math.max(e,t,n),a=Math.min(e,t,n),s=(o+a)/2;if(o==a)r=i=0;else{var l=o-a;switch(i=s>.5?l/(2-o-a):l/(o+a),o){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return{h:r,s:i,l:s}}function lB(e,t,n){e=MB(e,255),t=MB(t,255),n=MB(n,255);var r,i,o=Math.max(e,t,n),a=Math.min(e,t,n),s=o,l=o-a;if(i=0===o?0:l/o,o==a)r=0;else{switch(o){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return{h:r,s:i,v:s}}function cB(e,t,n,r){var i=[DB(Math.round(e).toString(16)),DB(Math.round(t).toString(16)),DB(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function uB(e,t,n,r){return[DB(IB(r)),DB(Math.round(e).toString(16)),DB(Math.round(t).toString(16)),DB(Math.round(n).toString(16))].join("")}function dB(e,t){t=0===t?0:t||10;var n=aB(e).toHsl();return n.s-=t/100,n.s=TB(n.s),aB(n)}function pB(e,t){t=0===t?0:t||10;var n=aB(e).toHsl();return n.s+=t/100,n.s=TB(n.s),aB(n)}function hB(e){return aB(e).desaturate(100)}function fB(e,t){t=0===t?0:t||10;var n=aB(e).toHsl();return n.l+=t/100,n.l=TB(n.l),aB(n)}function mB(e,t){t=0===t?0:t||10;var n=aB(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),aB(n)}function gB(e,t){t=0===t?0:t||10;var n=aB(e).toHsl();return n.l-=t/100,n.l=TB(n.l),aB(n)}function yB(e,t){var n=aB(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,aB(n)}function AB(e){var t=aB(e).toHsl();return t.h=(t.h+180)%360,aB(t)}function vB(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=aB(e).toHsl(),r=[aB(e)],i=360/t,o=1;o<t;o++)r.push(aB({h:(n.h+o*i)%360,s:n.s,l:n.l}));return r}function bB(e){var t=aB(e).toHsl(),n=t.h;return[aB(e),aB({h:(n+72)%360,s:t.s,l:t.l}),aB({h:(n+216)%360,s:t.s,l:t.l})]}function wB(e,t,n){t=t||6,n=n||30;var r=aB(e).toHsl(),i=360/n,o=[aB(e)];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(aB(r));return o}function EB(e,t){t=t||6;for(var n=aB(e).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/t;t--;)a.push(aB({h:r,s:i,v:o})),o=(o+s)%1;return a}aB.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,t=r.g/255,n=r.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=_B(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=lB(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=lB(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=sB(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=sB(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return cB(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,r,i){var o=[DB(Math.round(e).toString(16)),DB(Math.round(t).toString(16)),DB(Math.round(n).toString(16)),DB(IB(r))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*MB(this._r,255))+"%",g:Math.round(100*MB(this._g,255))+"%",b:Math.round(100*MB(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*MB(this._r,255))+"%, "+Math.round(100*MB(this._g,255))+"%, "+Math.round(100*MB(this._b,255))+"%)":"rgba("+Math.round(100*MB(this._r,255))+"%, "+Math.round(100*MB(this._g,255))+"%, "+Math.round(100*MB(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(CB[cB(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+uB(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var i=aB(e);n="#"+uB(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return aB(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(fB,arguments)},brighten:function(){return this._applyModification(mB,arguments)},darken:function(){return this._applyModification(gB,arguments)},desaturate:function(){return this._applyModification(dB,arguments)},saturate:function(){return this._applyModification(pB,arguments)},greyscale:function(){return this._applyModification(hB,arguments)},spin:function(){return this._applyModification(yB,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(wB,arguments)},complement:function(){return this._applyCombination(AB,arguments)},monochromatic:function(){return this._applyCombination(EB,arguments)},splitcomplement:function(){return this._applyCombination(bB,arguments)},triad:function(){return this._applyCombination(vB,[3])},tetrad:function(){return this._applyCombination(vB,[4])}},aB.fromRatio=function(e,t){if("object"==rB(e)){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]="a"===r?e[r]:xB(e[r]));e=n}return aB(e,t)},aB.equals=function(e,t){return!(!e||!t)&&aB(e).toRgbString()==aB(t).toRgbString()},aB.random=function(){return aB.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},aB.mix=function(e,t,n){n=0===n?0:n||50;var r=aB(e).toRgb(),i=aB(t).toRgb(),o=n/100;return aB({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})},aB.readability=function(e,t){var n=aB(e),r=aB(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},aB.isReadable=function(e,t,n){var r,i,o=aB.readability(e,t);switch(i=!1,(r=function(e){var t,n;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==n&&"large"!==n&&(n="small");return{level:t,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},aB.mostReadable=function(e,t,n){var r,i,o,a,s=null,l=0;i=(n=n||{}).includeFallbackColors,o=n.level,a=n.size;for(var c=0;c<t.length;c++)(r=aB.readability(e,t[c]))>l&&(l=r,s=aB(t[c]));return aB.isReadable(e,s,{level:o,size:a})||!i?s:(n.includeFallbackColors=!1,aB.mostReadable(e,["#fff","#000"],n))};var kB=aB.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},CB=aB.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(kB);function _B(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function MB(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function TB(e){return Math.min(1,Math.max(0,e))}function SB(e){return parseInt(e,16)}function DB(e){return 1==e.length?"0"+e:""+e}function xB(e){return e<=1&&(e=100*e+"%"),e}function IB(e){return Math.round(255*parseFloat(e)).toString(16)}function LB(e){return SB(e)/255}var PB,OB,RB,BB=(OB="[\\s|\\(]+("+(PB="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+PB+")[,|\\s]+("+PB+")\\s*\\)?",RB="[\\s|\\(]+("+PB+")[,|\\s]+("+PB+")[,|\\s]+("+PB+")[,|\\s]+("+PB+")\\s*\\)?",{CSS_UNIT:new RegExp(PB),rgb:new RegExp("rgb"+OB),rgba:new RegExp("rgba"+RB),hsl:new RegExp("hsl"+OB),hsla:new RegExp("hsla"+RB),hsv:new RegExp("hsv"+OB),hsva:new RegExp("hsva"+RB),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function YB(e){return!!BB.CSS_UNIT.exec(e)}const NB=new Map,VB=e=>{if(!NB.has(e)){const t=aB.readability(e,"#000000"),n=aB.readability(e,"#FFFFFF");NB.set(e,{contrastWithBlack:t,contrastWithWhite:n})}const{contrastWithBlack:t,contrastWithWhite:n}=NB.get(e);return t>n},FB=e=>(VB(e)?aB(e).lighten():aB(e).darken()).toHslString(),jB=e=>(VB(e)?aB(e).darken():aB(e).lighten()).toHslString(),HB=e=>{const t=aB(e);return`linear-gradient(185deg, ${t.clone().brighten(4)}, ${t.clone()})`},qB=e=>{const t=aB(e).toHsl();return t.l>.92?(t.l=Math.max(0,t.l-.08),aB(t).toHslString()):t.l<.12?(t.l=Math.min(1,t.l+.18),aB(t).toHslString()):(VB(e)?t.l=Math.min(1,t.l+.08):t.l=Math.max(0,t.l-.08),aB(t).toHslString())},GB=e=>{const t=aB(e).toHsl();return t.l=.9,aB(t).toHslString()},zB=(e,t)=>{const n=t.textDark||"#1A1A1A",r=t.textLight||"#FFFFFF",i=aB.readability(e,r),o=aB.readability(e,n);if(i>=4.5||o>=4.5)return i>o?r:n;return aB.readability(e,"#FFFFFF")>aB.readability(e,"#000000")?"#FFFFFF":"#000000"},UB=(e,t)=>{let n=e,r=aB.readability(e,t);const i=(e,i)=>{let o=e;for(let e=0;e<20;e++){o=i(o);const e=aB.readability(o,t);if(e>=4.5)return o;e>r&&(r=e,n=o)}return n};return n=i(e,e=>aB(e).darken(5).toHexString()),n=i(e,e=>aB(e).lighten(5).toHexString()),n},WB=(e={})=>{const t=document?.documentElement?.dir,n=document?.body?.dir;let r="radial-gradient(204.5% 136.79% at 0.53% 95.79%, #EDECF9 0%, #BFBAFF 31.77%, #2152E3 65.63%, #05309E 100%)";("rtl"===t||"rtl"===n)&&(r="radial-gradient(at right 95.79%, hsl(225, 80%, 32%) 0%, #2455E6 34.37%, hsl(225, 80%, 72%) 68.23%, hsl(225, 79%, 92%) 100%)");const i="#1A1A1A",o="#FFFFFF",a=i,s=o;return e.primaryColor&&"#2455E6"!==e.primaryColor&&!e.backgroundHome&&(r=aB(e.primaryColor).isLight()?`radial-gradient(204.5% 136.79% at 0.53% 95.79%, ${aB(e.primaryColor).lighten(20).toHslString()} 0%, ${e.primaryColor} 31.77%, ${aB(e.primaryColor).darken(20).toHslString()} 65.63%, ${aB(e.primaryColor).darken(40).toHslString()} 100%)`:`radial-gradient(204.5% 136.79% at 0.53% 95.79%, ${aB(e.primaryColor).lighten(40).toHslString()} 0%, ${aB(e.primaryColor).lighten(20).toHslString()} 31.77%, ${e.primaryColor} 65.63%, ${aB(e.primaryColor).darken(20).toHslString()} 100%)`),e.primaryColor||(e.primaryColor="#2455E6"),e.primaryColorHover||(e.primaryColorHover=qB(e.primaryColor)),e.primaryColorDisabled||(e.primaryColorDisabled=GB(e.primaryColor)),e.primaryContrastColor||(e.primaryContrastColor=zB(e.primaryColor,e)),e.primaryColorFocus||(e.primaryColorFocus=UB(e.primaryColor,e.white||"#FFFFFF")),e.secondaryColor||(e.secondaryColor="#1A1A1A"),e.secondaryColorHover||(e.secondaryColorHover=qB(e.secondaryColor)),e.secondaryColorDisabled||(e.secondaryColorDisabled=GB(e.secondaryColor)),e.secondaryContrastColor||(e.secondaryContrastColor=zB(e.secondaryColor,e)),e.backgroundHome||(e.backgroundHome=r),e.backgroundWebchat||(e.backgroundWebchat="#FFFFFF"),e.backgroundBotMessage||(e.backgroundBotMessage="#FFFFFF"),e.backgroundUserMessage||(e.backgroundUserMessage="#E8EBFF"),e.backgroundEngagementMessage||(e.backgroundEngagementMessage="#FFFFFF"),e.textLink||(e.textLink="#6688ED"),e.textLinkHover||(e.textLinkHover="#1947D2"),e.textLinkDisabled||(e.textLinkDisabled="#D1DCFA"),e.black10||(e.black10=i),e.black20||(e.black20="#333333"),e.black40||(e.black40="#666666"),e.black50||(e.black50="#808080"),e.black60||(e.black60="#999999"),e.black80||(e.black80="#CCCCCC"),e.black95||(e.black95="#F2F2F2"),e.white||(e.white=o),e.textDark||(e.textDark=a),e.textLight||(e.textLight=s),e.green||(e.green="#009918"),e.green10||(e.green10="#E5F5E8"),e.red||(e.red="#FF0000"),e.red10||(e.red10="#FFE5E5"),e.red20||(e.red20="#E55050"),e.red30||(e.red30="#E02E2E"),e.red40||(e.red40="#B22F2F"),e.primaryWeakColor||(e.primaryWeakColor=jB(e.primaryColor)),e.primaryStrongColor||(e.primaryStrongColor=FB(e.primaryColor)),e.primaryGradient||(e.primaryGradient=HB(e.primaryColor)),e.primaryStrongGradient||(e.primaryStrongGradient=HB(e.primaryStrongColor)),e.shadow||(e.shadow="0 5px 18px 0 rgba(151, 124, 156, 0.2), 0 5px 32px 0 rgba(203, 195, 212, 0.2), 0 8px 58px 0 rgba(216, 212, 221, 0.1)"),e.messageShadow||(e.messageShadow="0 5px 9px 0 rgba(151,124,156,0.1), 0 5px 16px 0 rgba(203,195,212,0.1), 0 8px 20px 0 rgba(216,212,221,0.1)"),e.greyColor||(e.greyColor="#e6e6e6"),e.greyWeakColor||(e.greyWeakColor=jB(e.greyColor)),e.greyStrongColor||(e.greyStrongColor=FB(e.greyColor)),e.greyContrastColor||(e.greyContrastColor=zB(e.greyColor,e)),e.unitSize||(e.unitSize=8),e.blockSize||(e.blockSize=7*e.unitSize),e.cornerSize||(e.cornerSize=e.unitSize/2),e.fontFamily||(e.fontFamily="Figtree, sans-serif"),e};var QB,ZB=["title","titleId"];function JB(){return JB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},JB.apply(null,arguments)}const KB=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,ZB);return r.createElement("svg",JB({xmlns:"http://www.w3.org/2000/svg",width:20,height:22,fill:"none","aria-hidden":"true",viewBox:"0 0 20 22","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,QB||(QB=r.createElement("path",{fill:"#252525",d:"M1 5V4a1 1 0 0 0-1 1zm18 0h1a1 1 0 0 0-1-1zm0 3v1a1 1 0 0 0 1-1zM1 8H0a1 1 0 0 0 1 1zm8 4a1 1 0 1 0-2 0zm-2 5a1 1 0 1 0 2 0zm6-5a1 1 0 1 0-2 0zm-2 5a1 1 0 1 0 2 0zM1 6h6V4H1zm7-1V2H6v3zm0-3h4V0H8zm4 0v3h2V2zm1 4h6V4h-6zm5-1v3h2V5zm1 2h-2v2h2zm-3 1v11h2V8zm-1 12H5v2h10zM4 19V8H2v11zM3 7H1v2h2zM2 8V5H0v3zm1 1h14V7H3zm4 3v5h2v-5zm4 0v5h2v-5zm2-8H7v2h6zM5 20a1 1 0 0 1-1-1H2a3 3 0 0 0 3 3zm11-1a1 1 0 0 1-1 1v2a3 3 0 0 0 3-3zM12 2h2a2 2 0 0 0-2-2zM8 2V0a2 2 0 0 0-2 2z"})))},XB=TM;function $B(){return $B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$B.apply(null,arguments)}const eY=Ye.div(({theme:e})=>({alignItems:"center",borderBottom:`1px solid ${e.black80}`,backgroundColor:e.backgroundWebchat,position:"relative",color:zB(e.backgroundWebchat,e),display:"flex",flexShrink:0,fontSize:18,fontWeight:600,lineHeight:1.3,margin:0,padding:"20px 16px",resize:"vertical",textAlign:"center",zIndex:3,"& .webchat-header-logo-name-container":{alignItems:"center",display:"flex",flexDirection:"row",height:28,marginInline:"auto",gap:8,"& .webchat-header-logo":{borderRadius:"50%",width:28,height:28},"& .webchat-header-cognigy-logo":{borderRadius:"50%",width:28,height:28}},"&.slide-in-enter":{transform:"translateY(-100%)"},"&.slide-in-enter-active":{transform:"translateY(0%)",transition:"transform 400ms ease-out"},"&.slide-in-exit":{transform:"translateY(0%)"},"&.slide-in-exit-active":{transform:"translateY(-100%)",transition:"transform 400ms ease-out"}})),tY=Ye.div(()=>({display:"flex",gap:24})),nY=Ye.div(()=>({display:"flex",alignItems:"flex-start",gap:16})),rY=Ye(LO)(({theme:e,iconColor:t})=>({color:zB(e.backgroundWebchat,e),borderRadius:4,"&:focus-visible":{outline:`2px solid ${UB(e.primaryColor,e.backgroundWebchat)}`,outlineOffset:2},"& svg":{fill:t||zB(e.backgroundWebchat,e),width:16,height:16,"& path, & circle":{fill:t||zB(e.backgroundWebchat,e)}},padding:0})),iY=Ye.img(()=>({borderRadius:"50%",fontSize:12,width:28,height:28,marginInline:8})),oY=Ye(mm)(({theme:e})=>({"&:focus-visible":{outline:`2px solid ${UB(e.primaryColor,e.backgroundWebchat)}`,outlineOffset:2}})),aY=e=>{const{logoUrl:t,title:n,onClose:i,onMinimize:o,onGoBack:a,onSetShowChatOptionsScreen:s,closeButtonRef:l,menuButtonRef:c,chatToggleButtonRef:u,isChatOptionsButtonVisible:d,hideBackButton:p,showChatScreen:h,autoFocusScreenTitle:f,onDeleteAllConversations:m,...g}=e,y=XB(e=>e.config.settings.customTranslations?.ariaLabels),A=XB(e=>e.config.settings),v=r.useRef(null);return(0,r.useEffect)(()=>{if(f){const e=setTimeout(()=>{const e=v.current;e?.focus()},200);return()=>clearTimeout(e)}},[f]),r.createElement(r.Fragment,null,r.createElement(eY,$B({},g,{className:"webchat-header-bar"}),a&&!p&&r.createElement(tY,{style:{width:d?64:24}},r.createElement(rY,{"data-header-back-button":!0,onClick:a,className:"webchat-header-back-button cc-rtl-flip","aria-label":y?.goBack??"Go back",ref:l},r.createElement(GO,null))),r.createElement("div",{className:$R()("webchat-header-logo-name-container")},h&&(t?r.createElement(iY,{src:t,className:$R()("webchat-header-logo"),alt:""}):r.createElement(nB,{title:"Cognigy.AI Logo",role:"img",className:$R()("webchat-header-cognigy-logo")})),r.createElement(oY,{ref:v,variant:"h2-semibold",id:"webchatHeaderTitle",className:"webchat-header-title",margin:0,tabIndex:-1},n)),r.createElement(nY,null,g.isDeleteAllConversationsButtonVisible&&r.createElement(rY,{"data-header-delete-all-conversations-button":!0,onClick:m,"aria-label":y?.deleteAllConversations??"Delete all conversations",className:"webchat-header-delete-all-conversations-button",iconColor:g.deleteIconColor,tabIndex:0,ref:g.deleteButtonRef},r.createElement(KB,null)),d&&r.createElement(rY,{"data-header-menu-button":!0,onClick:()=>{s?.(!0)},"aria-label":y?.chatOptions??A.chatOptions.title,ref:c},r.createElement(QO,null)),o&&r.createElement(rY,{"data-header-minimize-button":!0,onClick:o,className:"webchat-header-minimize-button","aria-label":y?.minimizeChat??"Minimize chat"},r.createElement(FO,null)),i&&r.createElement(rY,{"data-header-close-button":!0,onClick:()=>{i?.(),u?.current?.focus?.()},className:"webchat-header-close-button","aria-label":y?.closeChat??"Close chat",ref:l},r.createElement(BO,null)))),r.createElement(ZR,null))},sY=Ye.div({}),lY=Ye(sY)(({theme:e,chatWindowWidth:t})=>{const n=t??460;return{display:"flex",flexDirection:"column",backgroundColor:e.backgroundWebchat,overflow:"hidden",fontSize:16,fontFamily:e.fontFamily,overscrollBehavior:"contain","@media screen and (min-width: 576px)":{width:n},[`@media screen and (min-width: 576px) and (max-width: ${n+40}px)`]:{width:"90%",right:"5%"}}}),cY=e=>{const[t,n]=(0,r.useState)(!0),[i,o]=(0,r.useState)(!1),a=(0,r.useRef)(0),s=(0,r.useRef)(null);return(0,r.useEffect)(()=>{const t=()=>{if(!e.current)return;const{scrollTop:t,scrollHeight:r,clientHeight:i}=e.current,a=r-t-i<=20;n(a),a&&o(!1)},r=()=>{if(!e.current)return;const n=e.current.scrollTop;n<a.current&&o(!0),a.current=n,s.current&&clearTimeout(s.current),s.current=setTimeout(t,150)},i=e.current;if(!i)return;i.addEventListener("scroll",r);const l=new ResizeObserver(r),c=new MutationObserver(r);return l.observe(i),c.observe(i,{childList:!0,subtree:!0}),t(),()=>{i.removeEventListener("scroll",r),l.disconnect(),c.disconnect(),s.current&&clearTimeout(s.current)}},[e]),{isAtBottom:t,userScrolledUp:i}};function uY(){return uY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uY.apply(null,arguments)}const dY=Ye.div(({theme:e})=>t=>({overflowY:"auto",flexGrow:1,minHeight:0,height:e.blockSize,outline:t.showFocusOutline?`2px auto ${e.primaryColorFocus}`:"none",outlineOffset:-1})),pY=Ye.div(({theme:e})=>({paddingBottom:2*e.unitSize,"&:focus":{outline:"none"}})),hY=Ye("button")(({theme:e})=>({position:"absolute",zIndex:10,bottom:"110px",left:"50%",transform:"translateX(-50%)",backgroundColor:e.primaryColor,color:e.primaryContrastColor,border:"none",borderRadius:"50%",width:"30px",height:"30px",cursor:"pointer",boxShadow:"0 2px 5px rgba(0,0,0,0.2)","&:hover":{backgroundColor:e.primaryStrongColor},"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2,boxShadow:"0 0 0 4px white"}}));const fY=({children:e,isAtBottom:t,onScrollToBottom:n})=>{const i=XB(e=>e.config.settings.customTranslations?.ariaLabels?.scrollToBottom),o=!1===XB(e=>e.config.settings.behavior.enableScrollButton),[a,s]=(0,r.useState)(0);return(0,r.useEffect)(()=>{const e=new MutationObserver(()=>{const t=document.querySelector(".webchat-input");t&&((e=>{const t=new ResizeObserver(e=>{for(const t of e)s(t.contentRect.height)});t.observe(e)})(t),e.disconnect())});return e.observe(document.body,{childList:!0,subtree:!0}),()=>e.disconnect()},[]),r.createElement("div",null,e,!t&&!o&&r.createElement(hY,{className:"webchat-scroll-to-bottom-button",onClick:n,"aria-label":i??"Scroll to the bottom of the chat",style:{bottom:`${a+50}px`}},"↓"))},mY=Ye(function({children:e,lastInputId:t,scrollBehavior:n,...i}){const o=(0,r.useRef)(null),a=(0,r.useRef)(null),[s,l]=(0,r.useState)(!1),[c,u]=(0,r.useState)(!1),{isAtBottom:d,userScrolledUp:p}=cY(a),h=(0,r.useRef)(t);(0,r.useEffect)(()=>{u(!1)},[t]),(0,r.useEffect)(()=>{const e=t!==h.current;if(h.current=t,e&&a.current)setTimeout(()=>{if(!a.current)return;const e=a.current.scrollHeight-a.current.clientHeight;f(e)},0);else if(!p&&a.current)if("alwaysScroll"===n||c){const e=a.current.scrollHeight-a.current.clientHeight;f(e)}else if(!c&&t){const e=document.getElementById(t);if(e){const t=e.offsetTop-a.current.offsetTop;t>a.current.scrollTop&&f(t)}}},[e,n,t]);const f=e=>{a.current&&a.current.scrollTo({top:e,behavior:"smooth"})};return r.createElement(dY,uY({ref:a},i,{showFocusOutline:s}),r.createElement(pY,{ref:o,id:"webchatChatHistoryWrapperLiveLogPanel",role:"region",tabIndex:(()=>{if(!a.current||!o.current)return!1;const e=a.current.clientHeight;return o.current.scrollHeight>e})()?0:-1,"aria-labelledby":"webchatChatHistoryHeading",onFocus:()=>{o.current===document.activeElement&&l(!0)},onBlur:()=>{l(!1)}},r.createElement(fY,{isAtBottom:d,onScrollToBottom:()=>{if(u(!0),a.current){const e=a.current?.scrollHeight-a.current?.clientHeight;f(e)}}},e)))})(({theme:e})=>({}));var gY=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t,n=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(n,t),this.tags.push(n)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var i=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(r);try{var o=105===e.charCodeAt(1)&&64===e.charCodeAt(0);i.insertRule(e,o?0:i.cssRules.length)}catch(e){0}}else r.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0},e}();const yY=function(e){function t(e,r,l,c,p){for(var h,f,m,g,b,E=0,k=0,C=0,_=0,M=0,L=0,O=m=h=0,B=0,Y=0,N=0,V=0,F=l.length,j=F-1,H="",q="",G="",z="";B<F;){if(f=l.charCodeAt(B),B===j&&0!==k+_+C+E&&(0!==k&&(f=47===k?10:47),_=C=E=0,F++,j++),0===k+_+C+E){if(B===j&&(0<Y&&(H=H.replace(d,"")),0<H.trim().length)){switch(f){case 32:case 9:case 59:case 13:case 10:break;default:H+=l.charAt(B)}f=59}switch(f){case 123:for(h=(H=H.trim()).charCodeAt(0),m=1,V=++B;B<F;){switch(f=l.charCodeAt(B)){case 123:m++;break;case 125:m--;break;case 47:switch(f=l.charCodeAt(B+1)){case 42:case 47:e:{for(O=B+1;O<j;++O)switch(l.charCodeAt(O)){case 47:if(42===f&&42===l.charCodeAt(O-1)&&B+2!==O){B=O+1;break e}break;case 10:if(47===f){B=O+1;break e}}B=O}}break;case 91:f++;case 40:f++;case 34:case 39:for(;B++<j&&l.charCodeAt(B)!==f;);}if(0===m)break;B++}if(m=l.substring(V,B),0===h&&(h=(H=H.replace(u,"").trim()).charCodeAt(0)),64===h){switch(0<Y&&(H=H.replace(d,"")),f=H.charCodeAt(1)){case 100:case 109:case 115:case 45:Y=r;break;default:Y=I}if(V=(m=t(r,Y,m,f,p+1)).length,0<P&&(b=s(3,m,Y=n(I,H,N),r,S,T,V,f,p,c),H=Y.join(""),void 0!==b&&0===(V=(m=b.trim()).length)&&(f=0,m="")),0<V)switch(f){case 115:H=H.replace(w,a);case 100:case 109:case 45:m=H+"{"+m+"}";break;case 107:m=(H=H.replace(y,"$1 $2"))+"{"+m+"}",m=1===x||2===x&&o("@"+m,3)?"@-webkit-"+m+"@"+m:"@"+m;break;default:m=H+m,112===c&&(q+=m,m="")}else m=""}else m=t(r,n(r,H,N),m,c,p+1);G+=m,m=N=Y=O=h=0,H="",f=l.charCodeAt(++B);break;case 125:case 59:if(1<(V=(H=(0<Y?H.replace(d,""):H).trim()).length))switch(0===O&&(h=H.charCodeAt(0),45===h||96<h&&123>h)&&(V=(H=H.replace(" ",":")).length),0<P&&void 0!==(b=s(1,H,r,e,S,T,q.length,c,p,c))&&0===(V=(H=b.trim()).length)&&(H="\0\0"),h=H.charCodeAt(0),f=H.charCodeAt(1),h){case 0:break;case 64:if(105===f||99===f){z+=H+l.charAt(B);break}default:58!==H.charCodeAt(V-1)&&(q+=i(H,h,f,H.charCodeAt(2)))}N=Y=O=h=0,H="",f=l.charCodeAt(++B)}}switch(f){case 13:case 10:47===k?k=0:0===1+h&&107!==c&&0<H.length&&(Y=1,H+="\0"),0<P*R&&s(0,H,r,e,S,T,q.length,c,p,c),T=1,S++;break;case 59:case 125:if(0===k+_+C+E){T++;break}default:switch(T++,g=l.charAt(B),f){case 9:case 32:if(0===_+E+k)switch(M){case 44:case 58:case 9:case 32:g="";break;default:32!==f&&(g=" ")}break;case 0:g="\\0";break;case 12:g="\\f";break;case 11:g="\\v";break;case 38:0===_+k+E&&(Y=N=1,g="\f"+g);break;case 108:if(0===_+k+E+D&&0<O)switch(B-O){case 2:112===M&&58===l.charCodeAt(B-3)&&(D=M);case 8:111===L&&(D=L)}break;case 58:0===_+k+E&&(O=B);break;case 44:0===k+C+_+E&&(Y=1,g+="\r");break;case 34:case 39:0===k&&(_=_===f?0:0===_?f:_);break;case 91:0===_+k+C&&E++;break;case 93:0===_+k+C&&E--;break;case 41:0===_+k+E&&C--;break;case 40:if(0===_+k+E){if(0===h)if(2*M+3*L==533);else h=1;C++}break;case 64:0===k+C+_+E+O+m&&(m=1);break;case 42:case 47:if(!(0<_+E+C))switch(k){case 0:switch(2*f+3*l.charCodeAt(B+1)){case 235:k=47;break;case 220:V=B,k=42}break;case 42:47===f&&42===M&&V+2!==B&&(33===l.charCodeAt(V+2)&&(q+=l.substring(V,B+1)),g="",k=0)}}0===k&&(H+=g)}L=M,M=f,B++}if(0<(V=q.length)){if(Y=r,0<P&&(void 0!==(b=s(2,q,Y,e,S,T,V,c,p,c))&&0===(q=b).length))return z+q+G;if(q=Y.join(",")+"{"+q+"}",0!==x*D){switch(2!==x||o(q,2)||(D=0),D){case 111:q=q.replace(v,":-moz-$1")+q;break;case 112:q=q.replace(A,"::-webkit-input-$1")+q.replace(A,"::-moz-$1")+q.replace(A,":-ms-input-$1")+q}D=0}}return z+q+G}function n(e,t,n){var i=t.trim().split(m);t=i;var o=i.length,a=e.length;switch(a){case 0:case 1:var s=0;for(e=0===a?"":e[0]+" ";s<o;++s)t[s]=r(e,t[s],n).trim();break;default:var l=s=0;for(t=[];s<o;++s)for(var c=0;c<a;++c)t[l++]=r(e[c]+" ",i[s],n).trim()}return t}function r(e,t,n){var r=t.charCodeAt(0);switch(33>r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(g,"$1"+e.trim());case 58:return e.trim()+t.replace(g,"$1"+e.trim());default:if(0<1*n&&0<t.indexOf("\f"))return t.replace(g,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function i(e,t,n,r){var a=e+";",s=2*t+3*n+4*r;if(944===s){e=a.indexOf(":",9)+1;var l=a.substring(e,a.length-1).trim();return l=a.substring(0,e).trim()+l+";",1===x||2===x&&o(l,1)?"-webkit-"+l+l:l}if(0===x||2===x&&!o(a,1))return a;switch(s){case 1015:return 97===a.charCodeAt(10)?"-webkit-"+a+a:a;case 951:return 116===a.charCodeAt(3)?"-webkit-"+a+a:a;case 963:return 110===a.charCodeAt(5)?"-webkit-"+a+a:a;case 1009:if(100!==a.charCodeAt(4))break;case 969:case 942:return"-webkit-"+a+a;case 978:return"-webkit-"+a+"-moz-"+a+a;case 1019:case 983:return"-webkit-"+a+"-moz-"+a+"-ms-"+a+a;case 883:if(45===a.charCodeAt(8))return"-webkit-"+a+a;if(0<a.indexOf("image-set(",11))return a.replace(M,"$1-webkit-$2")+a;break;case 932:if(45===a.charCodeAt(4))switch(a.charCodeAt(5)){case 103:return"-webkit-box-"+a.replace("-grow","")+"-webkit-"+a+"-ms-"+a.replace("grow","positive")+a;case 115:return"-webkit-"+a+"-ms-"+a.replace("shrink","negative")+a;case 98:return"-webkit-"+a+"-ms-"+a.replace("basis","preferred-size")+a}return"-webkit-"+a+"-ms-"+a+a;case 964:return"-webkit-"+a+"-ms-flex-"+a+a;case 1023:if(99!==a.charCodeAt(8))break;return"-webkit-box-pack"+(l=a.substring(a.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+a+"-ms-flex-pack"+l+a;case 1005:return h.test(a)?a.replace(p,":-webkit-")+a.replace(p,":-moz-")+a:a;case 1e3:switch(t=(l=a.substring(13).trim()).indexOf("-")+1,l.charCodeAt(0)+l.charCodeAt(t)){case 226:l=a.replace(b,"tb");break;case 232:l=a.replace(b,"tb-rl");break;case 220:l=a.replace(b,"lr");break;default:return a}return"-webkit-"+a+"-ms-"+l+a;case 1017:if(-1===a.indexOf("sticky",9))break;case 975:switch(t=(a=e).length-10,s=(l=(33===a.charCodeAt(t)?a.substring(0,t):a).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|l.charCodeAt(7))){case 203:if(111>l.charCodeAt(8))break;case 115:a=a.replace(l,"-webkit-"+l)+";"+a;break;case 207:case 102:a=a.replace(l,"-webkit-"+(102<s?"inline-":"")+"box")+";"+a.replace(l,"-webkit-"+l)+";"+a.replace(l,"-ms-"+l+"box")+";"+a}return a+";";case 938:if(45===a.charCodeAt(5))switch(a.charCodeAt(6)){case 105:return l=a.replace("-items",""),"-webkit-"+a+"-webkit-box-"+l+"-ms-flex-"+l+a;case 115:return"-webkit-"+a+"-ms-flex-item-"+a.replace(k,"")+a;default:return"-webkit-"+a+"-ms-flex-line-pack"+a.replace("align-content","").replace(k,"")+a}break;case 973:case 989:if(45!==a.charCodeAt(3)||122===a.charCodeAt(4))break;case 931:case 953:if(!0===_.test(e))return 115===(l=e.substring(e.indexOf(":")+1)).charCodeAt(0)?i(e.replace("stretch","fill-available"),t,n,r).replace(":fill-available",":stretch"):a.replace(l,"-webkit-"+l)+a.replace(l,"-moz-"+l.replace("fill-",""))+a;break;case 962:if(a="-webkit-"+a+(102===a.charCodeAt(5)?"-ms-"+a:"")+a,211===n+r&&105===a.charCodeAt(13)&&0<a.indexOf("transform",10))return a.substring(0,a.indexOf(";",27)+1).replace(f,"$1-webkit-$2")+a}return a}function o(e,t){var n=e.indexOf(1===t?":":"{"),r=e.substring(0,3!==t?n:10);return n=e.substring(n+1,e.length-1),O(2!==t?r:r.replace(C,"$1"),n,t)}function a(e,t){var n=i(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return n!==t+";"?n.replace(E," or ($1)").substring(4):"("+t+")"}function s(e,t,n,r,i,o,a,s,l,u){for(var d,p=0,h=t;p<P;++p)switch(d=L[p].call(c,e,h,n,r,i,o,a,s,l,u)){case void 0:case!1:case!0:case null:break;default:h=d}if(h!==t)return h}function l(e){return void 0!==(e=e.prefix)&&(O=null,e?"function"!=typeof e?x=1:(x=2,O=e):x=0),l}function c(e,n){var r=e;if(33>r.charCodeAt(0)&&(r=r.trim()),r=[r],0<P){var i=s(-1,n,r,r,S,T,0,0,0,0);void 0!==i&&"string"==typeof i&&(n=i)}var o=t(I,r,n,0,0);return 0<P&&(void 0!==(i=s(-2,o,r,r,S,T,o.length,0,0,0))&&(o=i)),D=0,T=S=1,o}var u=/^\0+/g,d=/[\0\r\f]/g,p=/: */g,h=/zoo|gra/,f=/([,: ])(transform)/g,m=/,\r+?/g,g=/([\t\r\n ])*\f?&/g,y=/@(k\w+)\s*(\S*)\s*/,A=/::(place)/g,v=/:(read-only)/g,b=/[svh]\w+-[tblr]{2}/,w=/\(\s*(.*)\s*\)/g,E=/([\s\S]*?);/g,k=/-self|flex-/g,C=/[^]*?(:[rp][el]a[\w-]+)[^]*/,_=/stretch|:\s*\w+\-(?:conte|avail)/,M=/([^-])(image-set\()/,T=1,S=1,D=0,x=1,I=[],L=[],P=0,O=null,R=0;return c.use=function e(t){switch(t){case void 0:case null:P=L.length=0;break;default:if("function"==typeof t)L[P++]=t;else if("object"==typeof t)for(var n=0,r=t.length;n<r;++n)e(t[n]);else R=0|!!t}return e},c.set=l,void 0!==e&&l(e),c};var AY="/*|*/",vY=AY+"}";function bY(e){e&&wY.current.insert(e+"}")}var wY={current:null},EY=function(e,t,n,r,i,o,a,s,l,c){switch(e){case 1:switch(t.charCodeAt(0)){case 64:return wY.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===s)return t+AY;break;case 3:switch(s){case 102:case 112:return wY.current.insert(n[0]+t),"";default:return t+(0===c?AY:"")}case-2:t.split(vY).forEach(bY)}};const kY=function(e){void 0===e&&(e={});var t,n=e.key||"css";void 0!==e.prefix&&(t={prefix:e.prefix});var r=new yY(t);var i,o={};i=e.container||document.head;var a,s=document.querySelectorAll("style[data-emotion-"+n+"]");Array.prototype.forEach.call(s,function(e){e.getAttribute("data-emotion-"+n).split(" ").forEach(function(e){o[e]=!0}),e.parentNode!==i&&i.appendChild(e)}),r.use(e.stylisPlugins)(EY),a=function(e,t,n,i){var o=t.name;wY.current=n,r(e,t.styles),i&&(l.inserted[o]=!0)};var l={key:n,sheet:new gY({key:n,container:i,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:o,registered:{},insert:a};return l};function CY(){return CY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},CY.apply(null,arguments)}const _Y=e=>r.createElement(gC,CY({},e,{isFullscreen:!0})),MY=Ye.a(({theme:e})=>({display:"flex",alignItems:"baseline",alignSelf:"center",width:"fit-content",height:12,color:e.textDark,textDecoration:"none","&:focus, &:hover":{outline:"none",color:e.primaryColorFocus},"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2}})),TY=Ye.div(()=>({})),SY=`https://www.cognigy.com/?utm_campaign=CognigyWebchatEmbedded&utm_medium=webchat&utm_term=webchat&utm_content=webchat&utm_source=${window.location.hostname}`,DY=e=>{const{id:t,watermark:n,watermarkText:i,watermarkUrl:o}=e,a=XB(e=>e.config.settings.customTranslations?.ariaLabels);return"none"===n?r.createElement(TY,null):r.createElement(MY,{href:o||SY,target:"_blank","aria-label":`${i}. ${a?.opensInNewTab??"Opens in new tab"}`,id:t??"cognigyBrandingLink"},r.createElement(mm,{variant:"copy-medium",component:"span",fontSize:"0.625rem",lineHeight:"120%"},"custom"===n&&i?i:"Powered by Cognigy.AI"))},xY=(0,r.memo)(DY,()=>!0),IY=Ye(at)({minHeight:"auto",height:40,"&>*":{flexShrink:0}}),LY=Ye.div(({theme:e})=>({borderTop:`1px solid ${e.black80}`,backgroundColor:e.white,display:"flex",flexDirection:"column",gap:12,padding:"12px 20px",borderBottom:"2px solid transparent",borderBottomLeftRadius:2*e.unitSize,borderBottomRightRadius:2*e.unitSize,transition:"border-bottom .2s ease-out",zIndex:11,"&.webchat-input-stt-active":{backgroundColor:e.backgroundUserMessage},"&.webchat-input-text-active":{borderBottomColor:e.primaryColorFocus}})),PY=({messages:e,config:t,onSendMessage:n,plugins:i,inputMode:o,onSetInputMode:a,webchatTheme:s,onEmitAnalytics:l,sttActive:c,...u})=>{const d=XB(e=>e.input.textActive),p=Object.keys(u).length>0?u:void 0,h=i.filter(e=>"rule"===e.type).find(n=>n.rule({messages:e,config:t}));if(h){const e=(e,t)=>l(`plugin/${h.name||"unknown"}/${e}`,t);return r.createElement(h.component,{config:t,onSendMessage:n,attributes:p,theme:s,onEmitAnalytics:e})}const f=i.filter(e=>"select"===e.type),m=f.find(e=>e.id===o),g=f.length>1&&r.createElement(IY,null,f.map(e=>r.createElement(LO,{key:e.id,className:e===m?"active":"",onClick:()=>a(e.id)},r.createElement(e.icon,null))));return r.createElement(LY,{className:$R()("webchat-input",c&&"webchat-input-stt-active",d&&"webchat-input-text-active")},g,m&&r.createElement(m.component,{config:t,onSendMessage:n,attributes:p,theme:s,onEmitAnalytics:(e,t)=>l(`plugin/${m&&m.name||"unknown"}/${e}`,t)}),r.createElement(xY,{watermark:t.settings.layout.watermark,watermarkText:t.settings.layout.watermarkText,watermarkUrl:t.settings.layout.watermarkUrl}))};var OY,RY,BY=["title","titleId"];function YY(){return YY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},YY.apply(null,arguments)}const NY=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,BY);return r.createElement("svg",YY({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,"aria-hidden":"true",viewBox:"0 0 24 24","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,OY||(OY=r.createElement("path",{d:"M20 5H4c-1.1 0-1.99.9-1.99 2L2 17c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m-9 3h2v2h-2zm0 3h2v2h-2zM8 8h2v2H8zm0 3h2v2H8zm-1 2H5v-2h2zm0-3H5V8h2zm9 7H8v-2h8zm0-4h-2v-2h2zm0-3h-2V8h2zm3 3h-2v-2h2zm0-3h-2V8h2z"})),RY||(RY=r.createElement("path",{fill:"none",d:"M0 0h24v24H0zm0 0h24v24H0z"})))};var VY,FY,jY=["title","titleId"];function HY(){return HY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},HY.apply(null,arguments)}const qY=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,jY);return r.createElement("svg",HY({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,"aria-hidden":"true",viewBox:"0 0 16 16","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,VY||(VY=r.createElement("g",{clipPath:"url(#a)"},r.createElement("path",{fillRule:"evenodd",d:"M15 8a.82.82 0 0 1-.38.696L3.481 15.745c-1.267.802-2.84-.414-2.41-1.863L2.815 8 1.072 2.118C.642.668 2.215-.547 3.482.255l11.137 7.05c.237.15.381.412.381.695m-10.737.82-1.64 5.533 8.743-5.533zm7.103-1.64H4.263l-1.64-5.533z",clipRule:"evenodd"}))),FY||(FY=r.createElement("defs",null,r.createElement("clipPath",{id:"a"},r.createElement("path",{fill:"#fff",d:"M0 0h16v16H0z"})))))};var GY,zY=["title","titleId"];function UY(){return UY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},UY.apply(null,arguments)}const WY=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,zY);return r.createElement("svg",UY({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,"aria-hidden":"true",viewBox:"0 0 16 16","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,GY||(GY=r.createElement("g",{fillRule:"evenodd",clipRule:"evenodd"},r.createElement("path",{d:"M8 0a3 3 0 0 0-3 3v5.5a3 3 0 1 0 6 0V3a3 3 0 0 0-3-3m0 1.5A1.5 1.5 0 0 0 6.5 3v5.5a1.5 1.5 0 1 0 3 0V3A1.5 1.5 0 0 0 8 1.5"}),r.createElement("path",{d:"M3.75 8a.75.75 0 0 0-1.5 0 5.75 5.75 0 0 0 5 5.701v.799H4A.75.75 0 0 0 4 16h8a.75.75 0 0 0 0-1.5H8.75v-.799c2.821-.367 5-2.78 5-5.701a.75.75 0 0 0-1.5 0 4.25 4.25 0 0 1-8.5 0"}))))};var QY,ZY,JY=["title","titleId"];function KY(){return KY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KY.apply(null,arguments)}const XY=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,JY);return r.createElement("svg",KY({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,"aria-hidden":"true",viewBox:"0 0 24 24","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,QY||(QY=r.createElement("path",{fill:"none",d:"M0 0h24v24H0z"})),ZY||(ZY=r.createElement("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"})))};var $Y,eN=["title","titleId"];function tN(){return tN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tN.apply(null,arguments)}const nN=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,eN);return r.createElement("svg",tN({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,"aria-hidden":"true",viewBox:"0 0 16 16","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,$Y||($Y=r.createElement("path",{fillRule:"evenodd",d:"M4.096 2.322C4.432 1.548 5.232.25 6.833.25c1.744 0 2.536 1.53 2.828 2.292.222.58.256 1.174.256 1.678v6.613a1.917 1.917 0 1 1-3.834 0V4a.75.75 0 0 1 1.5 0v6.833a.417.417 0 1 0 .834 0V4.22c0-.454-.035-.825-.156-1.14-.276-.718-.728-1.33-1.428-1.33-.64 0-1.072.504-1.362 1.17-.18.414-.221.904-.221 1.505V11.5a2.75 2.75 0 1 0 5.5 0V4a.75.75 0 0 1 1.5 0v7.5a4.25 4.25 0 0 1-8.5 0V4.425c0-.63.034-1.387.346-2.103",clipRule:"evenodd"})))};var rN=r.useLayoutEffect,iN=function(e,t){"function"!=typeof e?e.current=t:e(t)},oN={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},aN=function(e){Object.keys(oN).forEach(function(t){e.style.setProperty(t,oN[t],"important")})},sN=null,lN=function(e,t){var n=e.scrollHeight;return"border-box"===t.sizingStyle.boxSizing?n+t.borderSize:n-t.paddingSize};var cN=function(){},uN=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],dN=!!document.documentElement.currentStyle,pN=function(e){var t=window.getComputedStyle(e);if(null===t)return null;var n=function(e,t){return e.reduce(function(e,n){return e[n]=t[n],e},{})}(uN,t),r=n.boxSizing;return""===r?null:(dN&&"border-box"===r&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+"px"),{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)})};function hN(e,t,n){var i,o,a=(i=n,o=r.useRef(i),rN(function(){o.current=i}),o);r.useLayoutEffect(function(){var n=function(e){return a.current(e)};if(e)return e.addEventListener(t,n),function(){return e.removeEventListener(t,n)}},[])}var fN,mN,gN=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],yN=function(e,t){var n=e.cacheMeasurements,i=e.maxRows,o=e.minRows,a=e.onChange,l=void 0===a?cN:a,c=e.onHeightChange,u=void 0===c?cN:c,d=j_(e,gN),p=void 0!==d.value,h=r.useRef(null),f=function(e,t){var n=r.useRef();return r.useCallback(function(r){e.current=r,n.current&&iN(n.current,null),n.current=t,t&&iN(t,r)},[t])}(h,t),m=r.useRef(0),g=r.useRef(),y=function(){var e=h.current,t=n&&g.current?g.current:pN(e);if(t){g.current=t;var r=function(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=1/0),sN||((sN=document.createElement("textarea")).setAttribute("tabindex","-1"),sN.setAttribute("aria-hidden","true"),aN(sN)),null===sN.parentNode&&document.body.appendChild(sN);var i=e.paddingSize,o=e.borderSize,a=e.sizingStyle,s=a.boxSizing;Object.keys(a).forEach(function(e){var t=e;sN.style[t]=a[t]}),aN(sN),sN.value=t;var l=lN(sN,e);sN.value=t,l=lN(sN,e),sN.value="x";var c=sN.scrollHeight-i,u=c*n;"border-box"===s&&(u=u+i+o),l=Math.max(u,l);var d=c*r;return"border-box"===s&&(d=d+i+o),[l=Math.min(d,l),c]}(t,e.value||e.placeholder||"x",o,i),a=r[0],s=r[1];m.current!==a&&(m.current=a,e.style.setProperty("height",a+"px","important"),u(a,{rowHeight:s}))}};return r.useLayoutEffect(y),function(e,t){hN(document.body,"reset",function(n){e.current.form===n.target&&t(n)})}(h,function(){if(!p){var e=h.current.value;requestAnimationFrame(function(){var t=h.current;t&&e!==t.value&&y()})}}),function(e){hN(window,"resize",e)}(y),function(e){hN(document.fonts,"loadingdone",e)}(y),r.createElement("textarea",s({},d,{onChange:function(e){p||y(),l(e)},ref:f}))},AN=r.forwardRef(yN),vN=["title","titleId"];function bN(){return bN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bN.apply(null,arguments)}const wN=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,vN);return r.createElement("svg",bN({xmlns:"http://www.w3.org/2000/svg",width:10,height:11,fill:"none","aria-hidden":"true",viewBox:"0 0 10 11","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,fN||(fN=r.createElement("path",{fill:"#1A1A1A",fillRule:"evenodd",d:"M9.204 1.308a.625.625 0 0 1 0 .884L1.691 9.705a.625.625 0 0 1-.884-.884L8.32 1.308a.625.625 0 0 1 .884 0",clipRule:"evenodd"})),mN||(mN=r.createElement("path",{fill:"#1A1A1A",fillRule:"evenodd",d:"M9.204 9.705a.625.625 0 0 1-.884 0L.807 2.192a.625.625 0 1 1 .884-.884l7.513 7.513a.625.625 0 0 1 0 .884",clipRule:"evenodd"})))},EN=Ye.div(()=>({height:2,width:"100%",backgroundColor:"#e0e0de",borderRadius:50,position:"absolute",bottom:0,left:0})),kN=Ye.div(({theme:e,progressPercentage:t})=>({height:"100%",width:`${t}%`,backgroundColor:e.primaryColor,borderRadius:"inherit",textAlign:"right"}));class CN extends r.PureComponent{render(){const{progressPercentage:e}=this.props;return r.createElement(EN,null,r.createElement(kN,{progressPercentage:e}))}}const _N=CN,MN=Ye.div(({theme:e})=>({display:"flex",flexDirection:"row",overflowX:"auto",overflowY:"hidden",alignItems:"center",gap:12,"&::-webkit-scrollbar":{width:2,height:2,visibility:"hidden"},"&:hover":{"&::-webkit-scrollbar-track":{backgroundColor:e.black95},"&::-webkit-scrollbar-thumb":{backgroundColor:e.black60}}})),TN=Ye.div(({theme:e})=>({position:"relative",overflow:"hidden",borderRadius:15,height:33,backgroundColor:e.black95,"&:focus-within":{backgroundColor:e.black80}})),SN=Ye.div(()=>({display:"flex",alignItems:"center",justifyContent:"center",gap:12,padding:"0 12px 0 6px",height:"100%"})),DN=Ye(mm)(({hasUploadError:e,theme:t})=>({whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:e?t.red40:t.black10,alignSelf:"center"})),xN=Ye(mm)(({theme:e})=>({color:e.black40,alignSelf:"center",textWrap:"nowrap"})),IN=Ye(LO)(({theme:e})=>({padding:0,marginRight:-6,"& svg":{width:12,height:12},"&:focus, &:hover":{"& path":{fill:`${e.primaryColor} !important`,outline:"none"}}})),LN=()=>{const e=(0,r.useRef)([]),t=TM(e=>e.input.fileList),n=TM(e=>e.config.settings.customTranslations?.ariaLabels?.removeFileAttachment),i=kM(),o=e=>{i((e=>({type:tI,index:e}))(e))};return r.createElement(MN,null,t?.map((t,i)=>r.createElement(TN,{key:i,id:`filePreview${i}`},r.createElement(SN,null,r.createElement(IN,{onClick:()=>o(i),onFocus:()=>{e.current[i]&&e.current[i].scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})},"aria-label":`${n??"Remove file attachment"} ${i+1}`,ref:t=>{t&&(e.current[i]=t)}},r.createElement(wN,null)),r.createElement(DN,{component:"span",variant:"title2-regular",hasUploadError:t.hasUploadError},t.hasUploadError?t.uploadErrorReason:`${(e=>{const t=e.split(".");return t.length>1?`${t.slice(0,-1).join(".")}.`:e})(t.file.name)}${(e=>{const t=e.split(".");return t.length>1?t.pop():null})(t.file.name)}`),r.createElement(xN,{component:"span",variant:"title2-regular"},t.file.size>1e6?`${(t.file.size/1e6).toFixed(2)} MB`:`${(t.file.size/1e3).toFixed(2)} KB`)),t.progressPercentage&&100!==t.progressPercentage&&!t.hasUploadError&&r.createElement(_N,{progressPercentage:t.progressPercentage}))))};var PN=i(3546),ON=i.n(PN);const RN=Ye.div(({theme:e})=>({minHeight:0,flexGrow:1,maxHeight:3*e.blockSize,overflowY:"auto",overscrollBehavior:"contain",paddingBottom:e.unitSize,"&:focus":{outline:"none"},marginRight:"-20px"})),BN=Ye.div(({theme:e})=>({"> div":{flexDirection:"column"},paddingLeft:e.unitSize})),YN=({title:e,menuItems:t,onSelect:n})=>{const i=r.useRef(null),o=t.map(e=>({title:e.title,type:"postback",payload:e.payload}));return r.createElement(RN,{className:"webchat-input-persistent-menu",tabIndex:-1},r.createElement(mm,{variant:"body-semibold",component:"h3",marginTop:4,marginLeft:8},e),r.createElement(BN,{"aria-labelledby":"persistentMenuTitle",role:"menu",ref:i,onKeyDown:e=>{const{key:t,target:n}=e;let r=null;if(i.current){switch(t){case"ArrowUp":r=n.previousElementSibling||i.current.lastChild;break;case"ArrowDown":r=n.nextElementSibling||i.current.firstChild;break;case"Home":r=i.current.firstChild;break;case"End":r=i.current.lastChild}null!==r&&(r.focus(),e.preventDefault())}}},r.createElement(xm,{buttonClassName:"webchat-input-persistent-menu-item",containerClassName:"webchat-input-persistent-menu-item-container",payload:o,config:{},onEmitAnalytics:()=>{},action:e=>{const r=t.find(t=>t.payload===e);r&&n(r)}})))},NN=Ye.label(({theme:e,visible:t,disabled:n})=>({position:"absolute",left:0,top:0,color:n?e.black50:e.black10,fontSize:"0.875rem",fontWeight:400,lineHeight:"140%",pointerEvents:"none",opacity:t?1:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"})),VN=e=>{const{label:t,isVisible:n,inputId:i,className:o,disabled:a}=e;return r.createElement(NN,{htmlFor:i,visible:n,disabled:a,className:o},t)},FN=Ye.div({display:"flex",flexDirection:"column",gap:12}),jN=Ye.form(({persistentMenuOpen:e})=>({display:"flex",alignItems:e?"flex-end":"center",gap:12,marginBottom:0})),HN=Ye(AN)(({theme:e})=>({display:"block",flexGrow:1,alignSelf:"stretch",padding:"8px 2px",border:"none",boxSizing:"border-box",outline:"none",resize:"none",backgroundColor:"transparent",overscrollBehavior:"contain",fontSize:"0.875rem",fontStyle:"normal",fontWeight:400,lineHeight:"140%","::-webkit-scrollbar":{width:2,height:2},"::-webkit-scrollbar-track":{backgroundColor:e.black95},"::-webkit-scrollbar-thumb":{backgroundColor:e.black60}})),qN=Ye.button(({theme:e})=>({margin:0,padding:0,backgroundColor:"transparent",border:"none",borderRadius:4,fill:e.textDark,cursor:"pointer",outline:"none","&[disabled]":{fill:e.black60,cursor:"default"},"&:not(:disabled):hover":{fill:e.primaryColorFocus},"&:focus":{fill:e.primaryColorFocus},"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`}})),GN={padding:"8px",display:"flex",alignItems:"center",justifyContent:"center",minWidth:"32px",minHeight:"32px"},zN=Ye(qN)(({theme:e,open:t})=>({...GN,padding:"6px",fill:t?e.primaryColor:"initial"})),UN=Ye(qN)(()=>GN),WN=Ye(qN)(({theme:e})=>({...GN,position:"relative","&.webchat-input-button-speech-active":{fill:e.textLight}})),QN=Ye(WY)({position:"relative"}),ZN=Ye.div(({theme:e})=>({position:"absolute",backgroundColor:e.primaryColor,height:28,width:28,borderRadius:16})),JN=Ye.div(({theme:e})=>({position:"absolute",backgroundColor:e.primaryColor,opacity:.2,height:28,width:28,borderRadius:16,animation:"expanding 2s ease-in-out infinite","@keyframes expanding":{"from, to":{transform:"scale(1)"},"50%":{transform:"scale(1.3)"}}})),KN=Ye.input(()=>({display:"none"})),XN=Ye(qN)(()=>GN),$N=Ye.div({position:"relative",display:"flex",flexDirection:"column",flexGrow:1}),eV=Ye(VN)({padding:"8px 2px"}),tV=(e,t)=>e?t?e+" "+t:e:t;let nV=null;class rV extends r.PureComponent{constructor(e){super(e);const t=(()=>{try{return new SpeechRecognition}catch(e){}try{return new webkitSpeechRecognition}catch(e){}return null})();t&&(t.continuous=!0,t.interimResults=!0,t.onresult=this.handleSpeechResult,e.config.settings.widgetSettings.STTLanguage&&(t.lang=e.config.settings.widgetSettings.STTLanguage)),this.state={text:"",speechRecognition:t,speechResult:"",isFinalResult:!1,isMenuOpen:!1,selectionStart:0,selectionEnd:0}}inputRef=r.createRef();menuRef=r.createRef();fileInputRef=r.createRef();componentDidMount(){window.WebChatInputTextCallback=e=>{this.setState({text:e})},setTimeout(()=>{this.props.config.settings.widgetSettings.disableInputAutofocus||this.inputRef.current?.focus?.()},200)}componentDidUpdate(){const e=this.props.config.settings.widgetSettings.STTLanguage;this.state.speechRecognition&&e&&this.state.speechRecognition.lang!==e&&this.setState({speechRecognition:{...this.state.speechRecognition,lang:e}})}componentWillUnmount(){nV&&clearTimeout(nV)}handleSpeechResult=e=>{const t=e.results[e.resultIndex],{isFinal:n}=t,{transcript:r}=t[0];nV&&clearTimeout(nV),nV=setTimeout(()=>{this.handleCancelSpeech()},3e3),this.setState({speechResult:r,isFinalResult:n}),n&&this.setState({speechResult:"",text:tV(this.state.text,r)})};handleCancelSpeech=()=>{const{speechRecognition:e}=this.state;e.stop(),nV&&clearTimeout(nV),this.props.onSetSTTActive(!1),this.setState({speechResult:"",isFinalResult:!1}),this.inputRef.current&&this.inputRef.current.focus()};isSTTSupported(){return!!this.state.speechRecognition}toggleSTT=e=>{e.preventDefault();const{speechRecognition:t}=this.state,{sttActive:n,onSetSTTActive:r}=this.props;n?this.handleCancelSpeech():(t.start(),nV&&clearTimeout(nV),nV=setTimeout(()=>{this.handleCancelSpeech()},3e3)),r(!n)};handleChangeTextValue=e=>{this.setState({text:e.target.value}),this.props.onChange(e.target.value)};handleSubmit=e=>{e.preventDefault(),e.stopPropagation();const{text:t,speechResult:n}=this.state,{sttActive:r,fileList:i}=this.props;let o=t;if(r&&(t&&n&&(o=t+" "+n),this.handleCancelSpeech()),!t&&!i)return;const a=[];i.forEach(e=>{e.uploadFileMeta&&(e.hasUploadError||a.push(e.uploadFileMeta))});let s=null;a.length>0&&(s={attachments:a}),this.props.onSetFileList([]),this.setState({text:""},()=>{this.props.onSendMessage(o,s,{collate:!0}),this.inputRef.current&&this.inputRef.current.focus()})};handleInputKeyDown=e=>{"Enter"!==e.key||e.shiftKey||e?.nativeEvent?.isComposing||(e.preventDefault(),e.stopPropagation(),this.handleSubmit(e))};handleSelectFile=e=>{const t=e.target.files,n=Array.prototype.slice.call(t);this.props.onAddFilesToList(n),e.target.value=""};handleUploadFile=e=>{e.preventDefault(),this.fileInputRef.current?.click()};handleFocus=()=>{setTimeout(()=>{this.props.onSetTextActive(!0)},200)};handleBlur=e=>{setTimeout(()=>{this.props.onSetTextActive(!1)},200),this.setState({selectionStart:e.target.selectionStart,selectionEnd:e.target.selectionEnd})};togglePeristentMenu=()=>{this.setState(e=>({isMenuOpen:!e.isMenuOpen}),()=>{this.state.isMenuOpen||this.inputRef.current&&(this.inputRef.current?.setSelectionRange(this.state.selectionStart,this.state.selectionEnd),this.inputRef.current.focus())})};onSelectPersistentMenuItem=e=>{this.togglePeristentMenu(),this.props.onSendMessage(e.payload,null,{label:e.title})};render(){const{props:e,state:t}=this,{sttActive:n,fileUploadError:i,fileList:o}=e,{text:a,speechResult:s,isMenuOpen:l}=t,{layout:c,fileStorageSettings:u,widgetSettings:d,customTranslations:p}=e.config.settings,{disableInputAutocomplete:h,inputAutogrowMaxRows:f,enablePersistentMenu:m,persistentMenu:g}=c,y=m&&g?.menuItems.length>0,{disableInputAutofocus:A}=d,v=u?.enabled,b=0===o?.length;return r.createElement(r.Fragment,null,r.createElement(FN,null,r.createElement(jN,{onSubmit:this.handleSubmit,className:$R()("webchat-input-menu-form"),persistentMenuOpen:l},y&&r.createElement(zN,{onClick:this.togglePeristentMenu,"aria-label":p?.ariaLabels?.togglePersistentMenu??"Toggle chat input menu","aria-expanded":l,className:"webchat-input-persistent-menu-button",id:"webchatInputButtonMenu",open:l,type:"button"},r.createElement(XY,null)),l&&y?r.createElement(YN,{title:g.title,menuItems:g.menuItems,onSelect:this.onSelectPersistentMenuItem}):r.createElement(r.Fragment,null,v&&r.createElement(r.Fragment,null,r.createElement(KN,{ref:this.fileInputRef,type:"file",multiple:!0,onChange:this.handleSelectFile,"aria-hidden":"true"}),r.createElement(UN,{className:"webchat-input-button-add-attachments",onClick:this.handleUploadFile,"aria-label":p?.ariaLabels?.addAttachment??"Add attachments",id:"webchatInputMessageAttachFileButton"},r.createElement(nN,null))),r.createElement(ON(),{maxWidth:575},t=>{const n=!!tV(a,s);return r.createElement($N,{className:"webchat-input-message-container"},r.createElement(eV,{inputId:"webchatInputMessageInputInTextMode",isVisible:!n,label:e.config.settings.behavior.inputPlaceholder,className:"webchat-input-message-label"}),r.createElement(HN,{ref:this.inputRef,autoFocus:!A,value:tV(a,s),onChange:this.handleChangeTextValue,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyDown:this.handleInputKeyDown,className:"webchat-input-message-input",minRows:1,maxRows:f,autoComplete:h?"off":void 0,enterKeyHint:"send",spellCheck:!1,id:"webchatInputMessageInputInTextMode",style:t?{fontSize:"1rem"}:void 0}))}),e.config.settings.behavior.enableSTT&&r.createElement(WN,{className:$R()("webchat-input-button-speech",n&&"webchat-input-button-speech-active"),"aria-label":p?.ariaLabels?.speechToText??"Speech to text",id:"webchatInputMessageSpeechButton",onClick:this.toggleSTT,disabled:!this.isSTTSupported()},n&&r.createElement(r.Fragment,null,r.createElement(JN,{className:$R()("webchat-input-button-speech-background"),"aria-hidden":"true"}),r.createElement(ZN,{className:$R()("webchat-input-button-speech-background"),"aria-hidden":"true"})),r.createElement(QN,null)),r.createElement(XN,{disabled:""===this.state.text&&b||i,className:"webchat-input-button-send cc-rtl-flip","aria-label":p?.ariaLabels?.sendMessage??"Send message",id:"webchatInputMessageSendMessageButton"},r.createElement(qY,null)))),!b&&r.createElement(LN,null)))}}const iV=XS("input/content-updated");var oV=i(7120),aV=i.n(oV);function sV(){return sV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sV.apply(null,arguments)}const lV={name:"text-input",type:"select",id:"text",component:e=>{const t=TM(e=>e.input.sttActive),n=TM(e=>e.input.fileList),i=TM(e=>e.input.fileUploadError),o=kM(),a=(0,r.useCallback)(aV()(()=>{o(iV())},1e3),[]);return r.createElement(rV,sV({},e,{sttActive:t,onSetSTTActive:e=>o((e=>({type:Wx,active:e}))(e)),onSetTextActive:e=>o((e=>({type:Qx,active:e}))(e)),onChange:a,fileList:n,fileUploadError:i,onSetFileList:e=>o(Xx(e)),onAddFilesToList:e=>o(TO(e))}))},icon:NY},cV=lV;var uV=i(8538),dV=i(1281);var pV=function(){return pV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},pV.apply(this,arguments)};function hV(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}Object.create;function fV(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}Object.create;"function"==typeof SuppressedError&&SuppressedError;var mV="right-scroll-bar-position",gV="width-before-scroll-bar";function yV(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var AV="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,vV=new WeakMap;function bV(e,t){var n,i,o,a=(n=t||null,i=function(t){return e.forEach(function(e){return yV(e,t)})},(o=(0,r.useState)(function(){return{value:n,callback:i,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}})[0]).callback=i,o.facade);return AV(function(){var t=vV.get(a);if(t){var n=new Set(t),r=new Set(e),i=a.current;n.forEach(function(e){r.has(e)||yV(e,null)}),r.forEach(function(e){n.has(e)||yV(e,i)})}vV.set(a,e)},[e]),a}function wV(e){return e}function EV(e,t){void 0===t&&(t=wV);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var o=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(o)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}};return i}var kV=function(e){void 0===e&&(e={});var t=EV(null);return t.options=pV({async:!0,ssr:!1},e),t}(),CV=function(){},_V=r.forwardRef(function(e,t){var n=r.useRef(null),i=r.useState({onScrollCapture:CV,onWheelCapture:CV,onTouchMoveCapture:CV}),o=i[0],a=i[1],s=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,h=e.sideCar,f=e.noRelative,m=e.noIsolation,g=e.inert,y=e.allowPinchZoom,A=e.as,v=void 0===A?"div":A,b=e.gapMode,w=hV(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=h,k=bV([n,t]),C=pV(pV({},w),o);return r.createElement(r.Fragment,null,d&&r.createElement(E,{sideCar:kV,removeScrollBar:u,shards:p,noRelative:f,noIsolation:m,inert:g,setCallbacks:a,allowPinchZoom:!!y,lockRef:n,gapMode:b}),s?r.cloneElement(r.Children.only(l),pV(pV({},C),{ref:k})):r.createElement(v,pV({},C,{className:c,ref:k}),l))});_V.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},_V.classNames={fullWidth:gV,zeroRight:mV};var MV,TV=function(e){var t=e.sideCar,n=hV(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw new Error("Sidecar medium not found");return r.createElement(i,pV({},n))};TV.isSideCarExport=!0;function SV(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=MV||i.nc;return t&&e.setAttribute("nonce",t),e}var DV=function(){var e=0,t=null;return{add:function(n){var r,i;0==e&&(t=SV())&&(i=n,(r=t).styleSheet?r.styleSheet.cssText=i:r.appendChild(document.createTextNode(i)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},xV=function(){var e,t=(e=DV(),function(t,n){r.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},IV={left:0,top:0,right:0,gap:0},LV=function(e){return parseInt(e||"",10)||0},PV=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return IV;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],i=t["padding"===e?"paddingRight":"marginRight"];return[LV(n),LV(r),LV(i)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},OV=xV(),RV="data-scroll-locked",BV=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body[").concat(RV,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(i,"px;\n padding-top: ").concat(o,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(mV," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(gV," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(mV," .").concat(mV," {\n right: 0 ").concat(r,";\n }\n \n .").concat(gV," .").concat(gV," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(RV,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},YV=function(){var e=parseInt(document.body.getAttribute(RV)||"0",10);return isFinite(e)?e:0},NV=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,o=void 0===i?"margin":i;r.useEffect(function(){return document.body.setAttribute(RV,(YV()+1).toString()),function(){var e=YV()-1;e<=0?document.body.removeAttribute(RV):document.body.setAttribute(RV,e.toString())}},[]);var a=r.useMemo(function(){return PV(o)},[o]);return r.createElement(OV,{styles:BV(a,!t,o,n?"":"!important")})},VV=!1;if("undefined"!=typeof window)try{var FV=Object.defineProperty({},"passive",{get:function(){return VV=!0,!0}});window.addEventListener("test",FV,FV),window.removeEventListener("test",FV,FV)}catch(e){VV=!1}var jV=!!VV&&{passive:!1},HV=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},qV=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),GV(e,r)){var i=zV(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},GV=function(e,t){return"v"===e?function(e){return HV(e,"overflowY")}(t):function(e){return HV(e,"overflowX")}(t)},zV=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},UV=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},WV=function(e){return[e.deltaX,e.deltaY]},QV=function(e){return e&&"current"in e?e.current:e},ZV=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},JV=0,KV=[];function XV(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const $V=(eF=function(e){var t=r.useRef([]),n=r.useRef([0,0]),i=r.useRef(),o=r.useState(JV++)[0],a=r.useState(xV)[0],s=r.useRef(e);r.useEffect(function(){s.current=e},[e]),r.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=fV([e.lockRef.current],(e.shards||[]).map(QV),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=r.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var r,o=UV(e),a=n.current,l="deltaX"in e?e.deltaX:a[0]-o[0],c="deltaY"in e?e.deltaY:a[1]-o[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var p=window.getSelection(),h=p&&p.anchorNode;if(h&&(h===u||h.contains(u)))return!1;var f=qV(d,u);if(!f)return!0;if(f?r=d:(r="v"===d?"h":"v",f=qV(d,u)),!f)return!1;if(!i.current&&"changedTouches"in e&&(l||c)&&(i.current=r),!r)return!0;var m=i.current||r;return function(e,t,n,r,i){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),c=!1,u=a>0,d=0,p=0;do{if(!s)break;var h=zV(e,s),f=h[0],m=h[1]-h[2]-o*f;(f||m)&&GV(e,s)&&(d+=m,p+=f);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&a>d)||!u&&(i&&Math.abs(p)<1||!i&&-a>p))&&(c=!0),c}(m,t,e,"h"===m?l:c,!0)},[]),c=r.useCallback(function(e){var n=e;if(KV.length&&KV[KV.length-1]===a){var r="deltaY"in n?WV(n):UV(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var o=(s.current.shards||[]).map(QV).filter(Boolean).filter(function(e){return e.contains(n.target)});(o.length>0?l(n,o[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=r.useCallback(function(e,n,r,i){var o={name:e,delta:n,target:r,should:i,shadowParent:XV(r)};t.current.push(o),setTimeout(function(){t.current=t.current.filter(function(e){return e!==o})},1)},[]),d=r.useCallback(function(e){n.current=UV(e),i.current=void 0},[]),p=r.useCallback(function(t){u(t.type,WV(t),t.target,l(t,e.lockRef.current))},[]),h=r.useCallback(function(t){u(t.type,UV(t),t.target,l(t,e.lockRef.current))},[]);r.useEffect(function(){return KV.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,jV),document.addEventListener("touchmove",c,jV),document.addEventListener("touchstart",d,jV),function(){KV=KV.filter(function(e){return e!==a}),document.removeEventListener("wheel",c,jV),document.removeEventListener("touchmove",c,jV),document.removeEventListener("touchstart",d,jV)}},[]);var f=e.removeScrollBar,m=e.inert;return r.createElement(r.Fragment,null,m?r.createElement(a,{styles:ZV(o)}):null,f?r.createElement(NV,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},kV.useMedium(eF),TV);var eF,tF=r.forwardRef(function(e,t){return r.createElement(_V,pV({},e,{ref:t,sideCar:$V}))});tF.classNames=_V.classNames;const nF=tF;var rF=i(2070),iF={};iF.styleTagTransform=nt(),iF.setAttributes=Xe(),iF.insert=Je().bind(null,"head"),iF.domAPI=Qe(),iF.insertStyleElement=et();Ue()(rF.A,iF);rF.A&&rF.A.locals&&rF.A.locals;const oF=Ye(LO)(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",width:50,height:50,backgroundColor:e.primaryColor,backgroundImage:e.primaryGradient,color:e.primaryContrastColor,fill:e.primaryContrastColor,stroke:e.primaryContrastColor,overflow:"visible",boxShadow:e.shadow,borderRadius:"50%",marginTop:2*e.unitSize,"&.active, &:hover":{backgroundImage:e.primaryStrongGradient,fill:`${e.primaryContrastColor} !important`,stroke:`${e.primaryContrastColor}`,color:`${e.primaryContrastColor} !important`},"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2,boxShadow:`0 0 0 4px ${e.white}`},"&.burst, &.pulse, &.swing":{"--icon-burst-duration":"0.8s","--icon-bounce-amp":"10px","--icon-swing-deg":"12deg","--icon-pulse-scale":"1.08"},"&.burst.bounce .iconAnimationContainer.optionActive":{animationName:"bounceBurst",animationDuration:"var(--icon-burst-duration)",animationTimingFunction:"ease-in-out",animationIterationCount:1,animationFillMode:"both"},"&.burst.swing .iconAnimationContainer.optionActive":{animationName:"swingBurst",animationDuration:"var(--icon-burst-duration)",animationTimingFunction:"ease-in-out",animationIterationCount:1,animationFillMode:"both",transformOrigin:"left bottom"},"&.burst.pulse .iconAnimationContainer.optionActive":{animationName:"pulseBurst",animationDuration:"var(--icon-burst-duration)",animationTimingFunction:"ease-in-out",animationIterationCount:1,animationFillMode:"both"},"@keyframes bounceBurst":{"0%":{transform:"translateY(0)"},"30%":{transform:"translateY(calc(-1 * var(--icon-bounce-amp)))"},"50%":{transform:"translateY(calc(-0.2 * var(--icon-bounce-amp)))"},"70%":{transform:"translateY(calc(-0.6 * var(--icon-bounce-amp)))"},"100%":{transform:"translateY(0)"}},"@keyframes swingBurst":{"0%":{transform:"rotate(0deg)"},"40%":{transform:"rotate(var(--icon-swing-deg))"},"70%":{transform:"rotate(calc(-1 * var(--icon-swing-deg))"},"100%":{transform:"rotate(0deg)"}},"@keyframes pulseBurst":{"0%":{transform:"scale(1)",opacity:1},"50%":{transform:"scale(var(--icon-pulse-scale))",opacity:.9},"100%":{transform:"scale(1)",opacity:1}}})),aF=Ye.div({display:"flex",flexDirection:"column",alignItems:"flex-end"});var sF,lF=["title","titleId"];function cF(){return cF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cF.apply(null,arguments)}const uF=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,lF);return r.createElement("svg",cF({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,"aria-hidden":"true",viewBox:"0 -960 960 960","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,sF||(sF=r.createElement("path",{d:"M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240zm126-240h594v-480H160v525zm-46 0v-480z"})))};var dF,pF=["title","titleId"];function hF(){return hF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hF.apply(null,arguments)}const fF=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,pF);return r.createElement("svg",hF({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,"aria-hidden":"true",viewBox:"0 -960 960 960","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,dF||(dF=r.createElement("path",{fill:"inherit",d:"M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240zm126-240h594v-480H160v525zm-46 0v-480z"})))};var mF,gF,yF=["title","titleId"];function AF(){return AF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},AF.apply(null,arguments)}const vF=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,yF);return r.createElement("svg",AF({xmlns:"http://www.w3.org/2000/svg",width:30,height:30,fill:"none",viewBox:"0 0 44 44","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,mF||(mF=r.createElement("path",{stroke:"inherit",strokeLinecap:"round",strokeWidth:2,d:"M19.071 12.714H3.5a2 2 0 0 0-2 2v17.151a2 2 0 0 0 2 2h5.517v6.67l8.59-6.67h14.107a2 2 0 0 0 2-2v-4.508"})),gF||(gF=r.createElement("path",{stroke:"inherit",strokeLinejoin:"round",strokeWidth:2,d:"M36.155 15.826c1.903-1.904 5.023-2.76 6.345-2.76-1.85-.529-4.818-.508-6.853-2.792-2.034-2.284-2.02-4.759-2.284-6.345 0 1.057-.666 4.188-2.284 6.345-1.523 2.03-6.028 2.792-7.615 2.792 1.322 0 4.95.856 6.853 2.76 2.19 2.19 2.782 5.552 3.046 7.138.264-1.586.888-5.234 2.792-7.138ZM23.952 5.576c.732-.732 1.932-1.062 2.44-1.062-.71-.203-1.852-.195-2.635-1.073-.782-.879-.777-1.83-.878-2.44 0 .406-.257 1.61-.879 2.44-.586.78-2.318 1.073-2.929 1.073.509 0 1.904.33 2.636 1.062.842.842 1.07 2.135 1.172 2.745.101-.61.341-2.013 1.073-2.745Z"})))};var bF,wF=["title","titleId"];function EF(){return EF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},EF.apply(null,arguments)}const kF=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,wF);return r.createElement("svg",EF({xmlns:"http://www.w3.org/2000/svg",width:23,height:23,viewBox:"0 0 23 23","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,bF||(bF=r.createElement("path",{fill:"inherit",stroke:"transparent",d:"M21 11.375a9.625 9.625 0 1 0-18.08 4.603l.16.293-.076.324-.953 4.085 3.983-.99.336-.085.303.17A9.6 9.6 0 0 0 11.375 21 9.625 9.625 0 0 0 21 11.375Zm-8.458 1.458a.875.875 0 0 1 0 1.75H7.875a.875.875 0 1 1 0-1.75zm2.333-4.666a.875.875 0 0 1 0 1.75h-7a.875.875 0 1 1 0-1.75zm7.875 3.208c0 6.282-5.093 11.375-11.375 11.375-1.891 0-3.677-.463-5.248-1.282l-5.041 1.256a.875.875 0 0 1-1.063-1.047l1.203-5.161A11.3 11.3 0 0 1 0 11.375C0 5.093 5.093 0 11.375 0S22.75 5.093 22.75 11.375Z"})))},CF=Ye.span(({theme:e,src:t})=>{const n=`url("${String(t).replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`;return{display:"inline-block",width:20,height:20,backgroundColor:e.primaryContrastColor,WebkitMaskImage:n,maskImage:n,WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center",WebkitMaskSize:"contain",maskSize:"contain"}}),_F=({config:e})=>{const t=e.settings?.layout?.iconUrl??"default-1",n=e.settings?.layout?.iconAnimation||"",i={"--icon-burst-duration":`${Math.max(.2,1/Math.max(.1,e.settings?.layout?.iconAnimationSpeed||1))}s`};if("string"==typeof t&&t.startsWith("default-")){const e=Math.max(0,Number(t.replace("default-",""))-1),o=[fF,vF,kF][e]??uF;return r.createElement(o,{className:$R()("iconAnimationContainer",n),"aria-hidden":!0,style:i})}const o=/^data:image\/(svg\+xml|svg)/i.test(String(t)),a=String(t).trim().toLowerCase().endsWith(".svg");if(o||a)return r.createElement(CF,{src:String(t),"aria-hidden":!0,className:$R()("iconAnimationContainer",n),style:i});const s=/^data:image\/(png|x-png)/i.test(String(t)),l=String(t).trim().toLowerCase().endsWith(".png");return s||l?r.createElement("img",{src:String(t),alt:"","aria-hidden":!0,className:$R()("iconAnimationContainer",n),style:{width:20,height:20,display:"inline-block",...i}}):r.createElement(uF,{"aria-hidden":!0,className:$R()("iconAnimationContainer",n),style:i})};var MF,TF=["title","titleId"];function SF(){return SF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SF.apply(null,arguments)}const DF=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,TF);return r.createElement("svg",SF({xmlns:"http://www.w3.org/2000/svg",width:20,height:20,"aria-hidden":"true",viewBox:"0 0 20 20","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,MF||(MF=r.createElement("path",{fillRule:"evenodd",stroke:"transparent",d:"M1.687 5.302a1.25 1.25 0 0 1 1.762.135L10 13.08l6.551-7.643a1.25 1.25 0 1 1 1.898 1.627l-6.55 7.643a2.5 2.5 0 0 1-3.797 0L1.55 7.064a1.25 1.25 0 0 1 .136-1.762Z",clipRule:"evenodd"})))};var xF,IF,LF=i(7458),PF=i.n(LF),OF=["title","titleId"];function RF(){return RF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RF.apply(null,arguments)}const BF=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,OF);return r.createElement("svg",RF({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,"aria-hidden":"true",viewBox:"0 0 24 24","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,xF||(xF=r.createElement("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),IF||(IF=r.createElement("path",{fill:"none",d:"M0 0h24v24H0z"})))},YF=Ye.h2(({theme:e})=>({fontSize:"1.5rem",marginBlockStart:"-.25rem",fontWeight:600,boxSizing:"border-box",zIndex:4})),NF=Ye(LO)(({theme:e})=>({position:"absolute",right:15,top:17,borderRadius:4,"&:focus":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2}})),VF=e=>{const{isPermanent:t,onClose:n,onConnect:i,config:o,isOpen:a}=e,s=(0,r.useRef)(null);return(0,r.useEffect)(()=>{setTimeout(()=>s.current?.focus(),200)},[]),r.createElement(PF(),{isOpen:a,parentSelector:()=>document.querySelector("#webchatWindow"),onRequestClose:n,style:{overlay:{position:"absolute",zIndex:3,backgroundColor:"rgba(0, 0, 0, 0.5)"},content:{inset:50,display:"flex",flexDirection:"column",alignItems:"center",margin:"auto",justifyContent:"center"}}},r.createElement(NF,{autoFocus:!t,"data-disconnect-overlay-close-button":!0,onClick:n,ref:s,className:"webchat-header-close-button","aria-label":o.settings.customTranslations?.ariaLabels?.closeConnectionWarning??"Close connection lost overlay"},r.createElement(BF,{style:{fill:"#000"}})),r.createElement(YF,null,o.settings.customTranslations?.network_error??"Connection lost"),t?r.createElement(r.Fragment,null,navigator.onLine?r.createElement(ct,{autoFocus:!0,onClick:i,color:"primary",style:{margin:"auto"}},o.settings.customTranslations?.reconnect??"Reconnect"):r.createElement("div",null,o.settings.customTranslations?.no_network??"No network connection")):r.createElement("div",null,o.settings.customTranslations?.reconnecting??"Reconnecting..."))},FF=Ye.span(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",top:0,right:0,fontSize:3*e.unitSize/2,lineHeight:12,fontWeight:700,width:2*e.unitSize,height:2*e.unitSize,borderRadius:"50%",backgroundColor:"rgb(235, 15, 0)",color:"white",fontFamily:"sans-serif"})),jF=e=>{const{_content:t,...n}=e;let i=t;return 0===i?null:(i>99&&(i=99),r.createElement(FF,n,i))},HF=e=>{const t=e?.querySelectorAll('a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])'),n=t&&Array.from(t),r=n?.filter(e=>!e.hasAttribute("disabled")&&!e.getAttribute("aria-hidden"));return{firstFocusable:r&&r[0],lastFocusable:r&&r[r.length-1],focusable:r}},qF=i(1393).A,GF=new kx.A(qF),zF=(e,t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];if(t(r))return r}};var UF=i(2254),WF={};WF.styleTagTransform=nt(),WF.setAttributes=Xe(),WF.insert=Je().bind(null,"head"),WF.domAPI=Qe(),WF.insertStyleElement=et();Ue()(UF.A,WF);UF.A&&UF.A.locals&&UF.A.locals;const QF=Ye(e=>{const t=Dt(yC.typingIndicator,e.className,"webchat-typing-indicator",e.direction&&yC[e.direction],e.disableBorder&&yC.disableBorder);return(0,yt.jsxs)("div",{className:t,children:[(0,yt.jsx)("div",{className:yC.dot}),(0,yt.jsx)("div",{className:yC.dot}),(0,yt.jsx)("div",{className:yC.dot})]})})({marginBlock:0}),ZF=Ye(QF)({visibility:"hidden"}),JF=e=>{const{active:t,delay:n,direction:i,disableBorder:o}=e,a=(()=>{const e=(0,r.useRef)(!0);return(0,r.useEffect)(()=>()=>{e.current=!1},[]),e})(),[s,l]=(0,r.useState)(t);return(0,r.useEffect)(()=>{let e;return t?l(t):e=setTimeout(()=>{a.current&&l(!1)},n||500),()=>{e&&clearTimeout(e)}},[t]),s?r.createElement(QF,{direction:i,disableBorder:o}):r.createElement(ZF,null)},KF=e=>{if(e&&e.enabled){let t=!0;const n=XF(e.timeZone),r=e.times.filter(e=>e.weekDay===n.weekDay);for(let e=0;e<r.length;e++){const{0:i,1:o}=r[e].startTime.split(":"),{0:a,1:s}=r[e].endTime.split(":");(parseInt(i)<n.hour&&n.hour<parseInt(a)||parseInt(i)===n.hour&&n.minute>=parseInt(o)&&n.hour<parseInt(a)||parseInt(i)===n.hour&&n.minute>=parseInt(o)&&n.hour===parseInt(a)&&n.minute<parseInt(s)||parseInt(i)<n.hour&&n.hour===parseInt(a)&&n.minute<parseInt(s))&&(t=!1)}return t}return!1},XF=e=>{const t=(new Date).toLocaleString("en-US",{timeZone:e}),n=new Date(t).getDay(),r=new Date(t).getHours(),i=new Date(t).getMinutes();let o;switch(n){case 0:o="sunday";break;case 1:o="monday";break;case 2:o="tuesday";break;case 3:o="wednesday";break;case 4:o="thursday";break;case 5:o="friday";break;case 6:o="saturday"}return{weekDay:o,hour:r,minute:i}},$F=e=>!(!KF(e)||"hide"!==e.mode),ej=e=>!(!KF(e)||"disable"!==e.mode),tj=e=>!(!KF(e)||"inform"!==e.mode),nj=e=>!(!e.maintenance?.enabled||"hide"!==e.maintenance?.mode),rj=e=>!(!e.maintenance?.enabled||"disable"!==e.maintenance?.mode),ij=e=>!(!e.maintenance?.enabled||"inform"!==e.maintenance?.mode),oj=Ye(LO)(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",width:56,height:56,backgroundColor:e.greyColor,backgroundImage:e.greyColor,color:e.greyContrastColor,fill:e.greyContrastColor,overflow:"visible",boxShadow:e.shadow,borderRadius:"50%",marginTop:2*e.unitSize,"&.active, &:hover":{color:`${e.greyContrastColor} !important`,fill:`${e.greyContrastColor} !important`}})),aj=(e,t)=>!(!e.embeddingConfiguration?.connectivity?.enabled||"hide"!==e.embeddingConfiguration?.connectivity?.mode||!t),sj=(e,t)=>!(!e.embeddingConfiguration?.connectivity?.enabled||"disable"!==e.embeddingConfiguration?.connectivity?.mode||!t),lj=(e,t)=>!(!e.embeddingConfiguration?.connectivity?.enabled||"inform"!==e.embeddingConfiguration?.connectivity?.mode||!t);function cj(){return cj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cj.apply(null,arguments)}const uj=(0,r.forwardRef)((e,t)=>r.createElement(ct,cj({},e,{ref:t,color:"primary"}))),dj=uj,pj=Ye(ct)(({theme:e})=>({color:e.secondaryColor,backgroundColor:e.white,border:`1px solid ${e.secondaryColor}`,"&:disabled":{opacity:.4,cursor:"default",color:e.secondaryColorDisabled,borderColor:e.secondaryColorDisabled,backgroundColor:e.white},"&:hover:not(:disabled)":{color:e.secondaryColorHover,borderColor:e.secondaryColorHover,backgroundColor:e.white},"&:focus:not(:disabled)":{color:e.secondaryColorHover,borderColor:e.secondaryColorHover,backgroundColor:e.white},"&:active:not(:disabled)":{color:e.secondaryColorDisabled,borderColor:e.secondaryColorDisabled,backgroundColor:e.white}})),hj=Ye.div(({theme:e})=>({display:"flex",position:"absolute",top:0,flexDirection:"column",height:"100%",width:"100%",color:e.primaryContrastColor,fontSize:16,fontWeight:700,boxSizing:"border-box","& *":{boxSizing:"border-box"},"&.hidebackground-enter-done":{"& .webchat-homescreen-content":{backgroundImage:"none"}}})),fj=Ye.div(({theme:e,settings:t})=>{const n=t?.homeScreen?.background?.color||e.backgroundHome;let r="none";const i=t?.homeScreen?.background?.imageUrl;i&&(r=`url("${i}")`);return{background:`${r}, ${n}`,backgroundSize:"cover",backgroundPosition:"center center",flexGrow:1,display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",height:"100%",width:"100%",padding:"20px 20px 35px 20px"}}),mj=Ye.div(()=>({marginInline:-20,width:"calc(100% + 40px)"})),gj=Ye.div({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",marginBottom:20,height:28,"& .webchat-homescreen-header-logo":{borderRadius:"50%",width:28,height:28},"& .webchat-homescreen-header-cognigy-logo":{borderRadius:"50%",width:28,height:28}}),yj=Ye(LO)(({theme:e})=>({color:e.white,borderRadius:4,padding:0,margin:4,svg:{fill:e.white,width:16,height:16},"&.active, &:hover":{color:e.white,fill:e.white},"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2,boxShadow:`0 0 0 4px ${e.white}`}})),Aj=Ye(mm)(({theme:e})=>({color:e.textLight,fontWeight:700,margin:0})),vj=Ye.div({marginTop:"auto","> div":{flexDirection:"column"}}),bj=Ye.div(({theme:e})=>({alignSelf:"flex-end",display:"flex",flexDirection:"column",alignItems:" center",justifyContent:"center",width:"100%",padding:"20px 20px 12px 20px",backgroundColor:e.white})),wj=Ye(dj)(({theme:e})=>({marginBottom:16,flexGrow:1,"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2}})),Ej=Ye(pj)(({theme:e})=>({marginBottom:24,flexGrow:1,"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2}})),kj=e=>{const{config:t,showHomeScreen:n,closeButtonRef:i,onSetShowHomeScreen:o,onSetShowPrevConversations:a,onClose:s,onEmitAnalytics:l,onSendActionButtonMessage:c,onStartConversation:u}=e,d=(0,r.useRef)(null),{homeScreen:p}=t.settings,h=t.settings.homeScreen.conversationStarters.starters;return(0,r.useEffect)(()=>{if(d.current){const{firstFocusable:e}=HF(d.current);e.focus()}},[]),(0,r.useEffect)(()=>{const e=n?0:-1;if(d.current){const{focusable:t}=HF(d.current);t.forEach(t=>{t.setAttribute("tabindex",e.toString())})}},[n]),r.createElement(hj,{className:"webchat-homescreen-root","aria-hidden":!n,ref:d},r.createElement("h2",{className:"sr-only"},t.settings.customTranslations?.ariaLabels?.homeScreen??"Chat window home screen"),r.createElement(fj,{className:"webchat-homescreen-content",settings:t?.settings},r.createElement(gj,{className:"webchat-homescreen-header"},t?.settings?.layout?.logoUrl?r.createElement(iY,{src:t?.settings?.layout?.logoUrl,className:"webchat-homescreen-header-logo",alt:""}):r.createElement(nB,{className:"webchat-homescreen-header-cognigy-logo",role:"img",title:"Cognigy.AI Logo"}),r.createElement(yj,{ref:i,onClick:s,className:"webchat-homescreen-close-button","aria-label":t.settings.customTranslations?.ariaLabels?.closeChat??"Close chat",color:"primary"},r.createElement(BO,null))),r.createElement(mj,null,r.createElement(ZR,null)),r.createElement(Aj,{variant:"title1-semibold",component:"h3",className:"webchat-homescreen-title",id:"webchatHeaderTitle"},p.welcomeText||"Welcome to the Cognigy Webchat"),p?.conversationStarters?.enabled&&r.createElement(vj,{className:"webchat-homescreen-buttons"},r.createElement(xm,{size:"large",showUrlIcon:!0,buttonClassName:"webchat-homescreen-button",containerClassName:"webchat-homescreen-button-container",payload:h,config:t,action:n?c:void 0,onEmitAnalytics:l}))),r.createElement(bj,{className:"webchat-homescreen-actions"},r.createElement(wj,{onClick:u,className:"webchat-homescreen-send-button","data-test":"webchat-start-chat-button"},t.settings.homeScreen.startConversationButtonText||"Start conversation"),t.settings.homeScreen.previousConversations.enabled&&r.createElement(Ej,{onClick:()=>{o(!1),a(!0)},className:"webchat-homescreen-previous-conversation-button"},t.settings.homeScreen.previousConversations.buttonText||"Previous conversations"),r.createElement(xY,{id:"cognigyHomeScreenBranding",watermark:t?.settings?.layout?.watermark,watermarkText:t?.settings?.layout?.watermarkText,watermarkUrl:t?.settings?.layout?.watermarkUrl})))};var Cj,_j=["title","titleId"];function Mj(){return Mj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mj.apply(null,arguments)}const Tj=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,_j);return r.createElement("svg",Mj({xmlns:"http://www.w3.org/2000/svg",width:4,height:4,fill:"none","aria-hidden":"true",viewBox:"0 0 4 4","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,Cj||(Cj=r.createElement("circle",{cx:2,cy:2,r:2,fill:"#999"})))},Sj=e=>{const t=zF(e,e=>!!YT(e));if(t)return YT(t);const n=(e=>BT(e)?"":e?.data?._cognigy?._webchat?.message?.attachment?.type||"")(e[e.length-1]);switch(n){case"template":return"template...";case"image":return"image...";case"video":return"video...";case"audio":return"audio...";default:return"..."}},Dj=e=>{if(!Array.isArray(e)||0===e.length)return!1;const t=e[e.length-1]?.timestamp||Date.now(),n=Date.now();return Math.floor((n-t)/864e5)>=30},xj=Ye.div(({theme:e})=>({display:"flex",gap:"12px",height:"4.32rem",width:"100%",border:`1px solid ${e.black80}`,borderRadius:"10px",padding:"12px",cursor:"pointer",justifyContent:"space-between",alignItems:"center",":focus":{border:`2px solid ${e.primaryColorFocus}`,outline:"none"}})),Ij=Ye.div({display:"inline-flex",flexDirection:"row-reverse"}),Lj=Ye.div({display:"flex",flexDirection:"column",justifyContent:"space-between",width:"100%",height:"100%"}),Pj=Ye(mm)(({theme:e})=>({color:e.black10,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"290px"})),Oj=Ye(mm)(({theme:e})=>({color:e.black10,display:"flex",gap:"8px",alignItems:"center"})),Rj=Ye.span(()=>({})),Bj=Ye.span(({theme:e})=>({color:e.black40})),Yj=Ye.div(({theme:e})=>({svg:{transform:"rotate(180deg)"},"svg path":{fill:e.black10}})),Nj=Ye.img(({theme:e})=>({borderRadius:"50%",width:"28px",height:"28px",backgroundColor:e.primaryColor,boxSizing:"border-box",border:`2px solid ${e.white}`,overflow:"hidden",position:"relative",":not(:last-child)":{marginLeft:"-12px"}})),Vj=Ye(nB)(({theme:e})=>({borderRadius:"50%",width:"28px",height:"28px",boxSizing:"border-box",border:`2px solid ${e.white}`})),Fj=e=>{const{sessionId:t,conversation:n,config:i,index:o,switchSession:a}=e,s=n.messages,l=(e=>{const t=e.filter(e=>"user"!==e?.source);return[...new Set(t.map(e=>e?.avatarUrl))]})(s),c=()=>{a(t,n)},u=i.settings.customTranslations?.ariaLabels?.openConversation??"Open conversation";return r.createElement(xj,{className:"webchat-prev-conversations-item",onClick:c,onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key&&c()},tabIndex:0,role:"button","aria-label":`${u} ${o+1}`},r.createElement(Ij,null,l.length>0?l.map((e,t)=>e?r.createElement(Nj,{key:t,src:e,alt:""}):r.createElement(Vj,{title:"Cognigy.AI Logo",role:"img",key:t,className:"webchat-header-cognigy-logo"})):r.createElement(Vj,{title:"Cognigy.AI Logo"})),r.createElement(Lj,null,r.createElement(Pj,{variant:"body-regular",component:"div"},Sj(s)),r.createElement(Oj,{variant:"title2-regular",component:"div"},r.createElement(Rj,null,((e,t)=>{const n=[],r=e.some(e=>["bot","engagement"].includes(e?.source)),i=e.some(e=>"agent"===e?.source);return r&&n.push(t?.settings?.layout?.title||"Bot"),i&&n.push("Agent"),r||i?n.join(", "):"You"})(s,i)),r.createElement(Tj,null),r.createElement(Bj,{className:"webchat-prev-conversations-time"},(e=>{const t=e[e.length-1];if(!t?.timestamp)return"";const n=new Date(t.timestamp),r=new Date,i=e=>{const t=new Date(e);return t.setHours(0,0,0,0),t},o=i(n),a=i(r),s=Math.floor((a.getTime()-o.getTime())/864e5),l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});if(s>=0&&s<=1)return(c=l.format(-s,"day")).charAt(0).toUpperCase()+c.slice(1);var c;if(s>=2&&s<7)return l.format(-s,"day");const u=Math.floor(s/7);if(u<=4&&s<31)return l.format(-u,"week");let d=12*(r.getFullYear()-n.getFullYear())+(r.getMonth()-n.getMonth());if(r.getDate()<n.getDate()&&d--,d>0&&d<12)return l.format(-d,"month");const p=Math.floor(d/12);return p>0?l.format(-p,"year"):l.format(-Math.floor(d/12),"year")})(s)))),r.createElement(Yj,null,r.createElement(GO,{className:"cc-rtl-flip-invert"})))},jj=Ye.div(({theme:e})=>({height:"100%",width:"100%",fontSize:16,fontWeight:700,boxSizing:"border-box",backgroundColor:e.white,display:"flex",flexDirection:"column","& *":{boxSizing:"border-box"}})),Hj=Ye.div(({theme:e})=>({rowGap:"8px",display:"flex",flexDirection:"column",padding:"20px",overflowY:"auto",flexGrow:1,minHeight:0,height:e.blockSize,overscrollBehavior:"contain","&:focus":{outline:"none"}})),qj=Ye.div(({theme:e})=>({alignSelf:"flex-end",display:"flex",flexDirection:"column",alignItems:" center",justifyContent:"center",width:"100%",padding:"20px 20px 12px 20px",backgroundColor:e.white,borderTop:`1px solid var(--basics-black-80, ${e.black80})`})),Gj=Ye(dj)(({theme:e})=>({marginBottom:20,flexGrow:1,"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`}})),zj=e=>{const{conversations:t,config:n,onSetShowPrevConversations:i,onSwitchSession:o,currentSession:a,startNewConversationButtonRef:s}=e,l=(e=>{const t=Object.entries(e).sort(([,e],[,t])=>(t.messages[t.messages.length-1]?.timestamp||0)-(e.messages[e.messages.length-1]?.timestamp||0)).reduce((e,[t,n])=>({...e,[t]:n}),{});return t})(t),c=Object.keys(l),u=(0,r.useCallback)((e,t)=>{e&&e!==a&&o(e,t),i(!1)},[]);return r.createElement(jj,{className:"webchat-prev-conversations-root"},r.createElement(Hj,{className:"webchat-prev-conversations-content"},c.length>0&&c.map((e,t)=>r.createElement(Fj,{key:t,index:t,sessionId:e,switchSession:u,conversation:l[e],config:n}))),r.createElement(qj,{className:"webchat-prev-conversations-actions"},r.createElement(Gj,{onClick:()=>{o(),i(!1)},className:"webchat-prev-conversations-send-button","data-testid":"webchat-start-chat-button",ref:s},n.settings.homeScreen?.previousConversations?.startNewConversationButtonText??"Start new conversation"),r.createElement(xY,{id:"cognigyConversationListBranding",watermark:n?.settings?.layout?.watermark,watermarkText:n?.settings?.layout?.watermarkText,watermarkUrl:n?.settings?.layout?.watermarkUrl})))};var Uj,Wj,Qj=["title","titleId"];function Zj(){return Zj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zj.apply(null,arguments)}const Jj=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,Qj);return r.createElement("svg",Zj({xmlns:"http://www.w3.org/2000/svg",width:111,height:82,fill:"none","aria-hidden":"true",viewBox:"0 0 111 82","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,Uj||(Uj=r.createElement("path",{fill:"#F2F2F2",d:"M.5 27c0-8.284 6.716-15 15-15h80c8.284 0 15 6.716 15 15v40c0 8.284-6.716 15-15 15H.5z"})),Wj||(Wj=r.createElement("g",{stroke:"#999",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3},r.createElement("path",{d:"M29.48 18h12.606c.89 0 1.337 1.077.707 1.707L30.207 32.293c-.63.63-.184 1.707.707 1.707H44.5M52.5 41h9.586c.89 0 1.337 1.077.707 1.707l-8.586 8.586c-.63.63-.184 1.707.707 1.707H64.5M58.5 2h21.586c.89 0 1.337 1.077.707 1.707L60.207 24.293c-.63.63-.184 1.707.707 1.707H82.5"}))))},Kj=Ye.div(({theme:e})=>({height:"100%",width:"100%",backgroundColor:e.white,display:"flex",alignItems:"center",justifyContent:"center"})),Xj=Ye.div(()=>({display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:"24px",maxWidth:"295px",textAlign:"center"})),$j=e=>{const{message:t}=e;return r.createElement(Kj,{className:"webchat-information-message-root"},r.createElement(Xj,{className:"webchat-information-message-content"},r.createElement(Jj,null),r.createElement(mm,{variant:"title1-regular",style:{margin:0},component:"p"},t)))},eH=Ye.a(({theme:e})=>({display:"inline-flex",justifyContent:"center",alignItems:"center",gap:8,color:e.black10,backgroundColor:e.white,width:303,height:44,borderRadius:10,textDecoration:"none",svg:{transform:"rotate(180deg)",fill:e.black10},"& svg:dir(rtl)":{transform:"rotate(0deg)"},"&:disabled":{cursor:"default",color:e.black60,backgroundColor:e.white,svg:{fill:e.black60}},"&:hover:not(:disabled)":{color:e.black40,backgroundColor:e.white,svg:{fill:e.black40}},"&:focus:not(:disabled)":{color:e.black40,backgroundColor:e.white,svg:{fill:e.black40}},"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2},"&:active:not(:disabled)":{color:e.black40,backgroundColor:e.white,svg:{fill:e.black40}}})),tH=e=>{const{text:t,url:n,target:i,icon:o,className:a,rel:s}=e,l=XB(e=>e.config.settings.customTranslations?.ariaLabels),c="_blank"===i?`${t}. ${l?.opensInNewTab||"Opens in new tab"}`:void 0,u=s??("_blank"===i?"noopener noreferrer":void 0);return r.createElement(eH,{className:$R()("tertiary-button",a),href:n,target:i,"aria-label":c,rel:u},r.createElement(mm,{variant:"cta-semibold"},t),o||r.createElement(GO,null))};function nH(){}function rH(){}const iH=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oH=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,aH={};function sH(e,t){return((t||aH).jsx?oH:iH).test(e)}const lH=/[ \t\n\f\r]/g;function cH(e){return""===e.replace(lH,"")}class uH{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function dH(e,t){const n={},r={};for(const t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new uH(n,r,t)}function pH(e){return e.toLowerCase()}uH.prototype.normal={},uH.prototype.property={},uH.prototype.space=void 0;class hH{constructor(e,t){this.attribute=t,this.property=e}}hH.prototype.attribute="",hH.prototype.booleanish=!1,hH.prototype.boolean=!1,hH.prototype.commaOrSpaceSeparated=!1,hH.prototype.commaSeparated=!1,hH.prototype.defined=!1,hH.prototype.mustUseProperty=!1,hH.prototype.number=!1,hH.prototype.overloadedBoolean=!1,hH.prototype.property="",hH.prototype.spaceSeparated=!1,hH.prototype.space=void 0;let fH=0;const mH=EH(),gH=EH(),yH=EH(),AH=EH(),vH=EH(),bH=EH(),wH=EH();function EH(){return 2**++fH}const kH=Object.keys(t);class CH extends hH{constructor(e,n,r,i){let o=-1;if(super(e,n),_H(this,"space",i),"number"==typeof r)for(;++o<kH.length;){const e=kH[o];_H(this,kH[o],(r&t[e])===t[e])}}}function _H(e,t,n){n&&(e[t]=n)}function MH(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new CH(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[pH(r)]=r,n[pH(o.attribute)]=r}return new uH(t,n,e.space)}CH.prototype.defined=!0;const TH=MH({properties:{ariaActiveDescendant:null,ariaAtomic:gH,ariaAutoComplete:null,ariaBusy:gH,ariaChecked:gH,ariaColCount:AH,ariaColIndex:AH,ariaColSpan:AH,ariaControls:vH,ariaCurrent:null,ariaDescribedBy:vH,ariaDetails:null,ariaDisabled:gH,ariaDropEffect:vH,ariaErrorMessage:null,ariaExpanded:gH,ariaFlowTo:vH,ariaGrabbed:gH,ariaHasPopup:null,ariaHidden:gH,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:vH,ariaLevel:AH,ariaLive:null,ariaModal:gH,ariaMultiLine:gH,ariaMultiSelectable:gH,ariaOrientation:null,ariaOwns:vH,ariaPlaceholder:null,ariaPosInSet:AH,ariaPressed:gH,ariaReadOnly:gH,ariaRelevant:null,ariaRequired:gH,ariaRoleDescription:vH,ariaRowCount:AH,ariaRowIndex:AH,ariaRowSpan:AH,ariaSelected:gH,ariaSetSize:AH,ariaSort:null,ariaValueMax:AH,ariaValueMin:AH,ariaValueNow:AH,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function SH(e,t){return t in e?e[t]:t}function DH(e,t){return SH(e,t.toLowerCase())}const xH=MH({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:bH,acceptCharset:vH,accessKey:vH,action:null,allow:null,allowFullScreen:mH,allowPaymentRequest:mH,allowUserMedia:mH,alt:null,as:null,async:mH,autoCapitalize:null,autoComplete:vH,autoFocus:mH,autoPlay:mH,blocking:vH,capture:null,charSet:null,checked:mH,cite:null,className:vH,cols:AH,colSpan:null,content:null,contentEditable:gH,controls:mH,controlsList:vH,coords:AH|bH,crossOrigin:null,data:null,dateTime:null,decoding:null,default:mH,defer:mH,dir:null,dirName:null,disabled:mH,download:yH,draggable:gH,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:mH,formTarget:null,headers:vH,height:AH,hidden:yH,high:AH,href:null,hrefLang:null,htmlFor:vH,httpEquiv:vH,id:null,imageSizes:null,imageSrcSet:null,inert:mH,inputMode:null,integrity:null,is:null,isMap:mH,itemId:null,itemProp:vH,itemRef:vH,itemScope:mH,itemType:vH,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:mH,low:AH,manifest:null,max:null,maxLength:AH,media:null,method:null,min:null,minLength:AH,multiple:mH,muted:mH,name:null,nonce:null,noModule:mH,noValidate:mH,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:mH,optimum:AH,pattern:null,ping:vH,placeholder:null,playsInline:mH,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:mH,referrerPolicy:null,rel:vH,required:mH,reversed:mH,rows:AH,rowSpan:AH,sandbox:vH,scope:null,scoped:mH,seamless:mH,selected:mH,shadowRootClonable:mH,shadowRootDelegatesFocus:mH,shadowRootMode:null,shape:null,size:AH,sizes:null,slot:null,span:AH,spellCheck:gH,src:null,srcDoc:null,srcLang:null,srcSet:null,start:AH,step:null,style:null,tabIndex:AH,target:null,title:null,translate:null,type:null,typeMustMatch:mH,useMap:null,value:gH,width:AH,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:vH,axis:null,background:null,bgColor:null,border:AH,borderColor:null,bottomMargin:AH,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:mH,declare:mH,event:null,face:null,frame:null,frameBorder:null,hSpace:AH,leftMargin:AH,link:null,longDesc:null,lowSrc:null,marginHeight:AH,marginWidth:AH,noResize:mH,noHref:mH,noShade:mH,noWrap:mH,object:null,profile:null,prompt:null,rev:null,rightMargin:AH,rules:null,scheme:null,scrolling:gH,standby:null,summary:null,text:null,topMargin:AH,valueType:null,version:null,vAlign:null,vLink:null,vSpace:AH,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:mH,disableRemotePlayback:mH,prefix:null,property:null,results:AH,security:null,unselectable:null},space:"html",transform:DH}),IH=MH({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:wH,accentHeight:AH,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:AH,amplitude:AH,arabicForm:null,ascent:AH,attributeName:null,attributeType:null,azimuth:AH,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:AH,by:null,calcMode:null,capHeight:AH,className:vH,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:AH,diffuseConstant:AH,direction:null,display:null,dur:null,divisor:AH,dominantBaseline:null,download:mH,dx:null,dy:null,edgeMode:null,editable:null,elevation:AH,enableBackground:null,end:null,event:null,exponent:AH,externalResourcesRequired:null,fill:null,fillOpacity:AH,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:bH,g2:bH,glyphName:bH,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:AH,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:AH,horizOriginX:AH,horizOriginY:AH,id:null,ideographic:AH,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:AH,k:AH,k1:AH,k2:AH,k3:AH,k4:AH,kernelMatrix:wH,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:AH,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:AH,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:AH,overlineThickness:AH,paintOrder:null,panose1:null,path:null,pathLength:AH,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:vH,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:AH,pointsAtY:AH,pointsAtZ:AH,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:wH,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:wH,rev:wH,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:wH,requiredFeatures:wH,requiredFonts:wH,requiredFormats:wH,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:AH,specularExponent:AH,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:AH,strikethroughThickness:AH,string:null,stroke:null,strokeDashArray:wH,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:AH,strokeOpacity:AH,strokeWidth:null,style:null,surfaceScale:AH,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:wH,tabIndex:AH,tableValues:null,target:null,targetX:AH,targetY:AH,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:wH,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:AH,underlineThickness:AH,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:AH,values:null,vAlphabetic:AH,vMathematical:AH,vectorEffect:null,vHanging:AH,vIdeographic:AH,version:null,vertAdvY:AH,vertOriginX:AH,vertOriginY:AH,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:AH,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:SH}),LH=MH({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),PH=MH({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:DH}),OH=MH({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),RH=dH([TH,xH,LH,PH,OH],"html"),BH=dH([TH,IH,LH,PH,OH],"svg"),YH=/[A-Z]/g,NH=/-[a-z]/g,VH=/^data[-\w.:]+$/i;function FH(e){return"-"+e.toLowerCase()}function jH(e){return e.charAt(1).toUpperCase()}const HH={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var qH=i(5936);const GH=UH("end"),zH=UH("start");function UH(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function WH(e){return e&&"object"==typeof e?"position"in e||"type"in e?ZH(e.position):"start"in e||"end"in e?ZH(e):"line"in e||"column"in e?QH(e):"":""}function QH(e){return JH(e&&e.line)+":"+JH(e&&e.column)}function ZH(e){return QH(e&&e.start)+"-"+QH(e&&e.end)}function JH(e){return e&&"number"==typeof e?e:1}class KH extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},o=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(o=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){const e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=WH(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}KH.prototype.file="",KH.prototype.name="",KH.prototype.reason="",KH.prototype.message="",KH.prototype.stack="",KH.prototype.column=void 0,KH.prototype.line=void 0,KH.prototype.ancestors=void 0,KH.prototype.cause=void 0,KH.prototype.fatal=void 0,KH.prototype.place=void 0,KH.prototype.ruleId=void 0,KH.prototype.source=void 0;const XH={}.hasOwnProperty,$H=new Map,eq=/[A-Z]/g,tq=new Set(["table","tbody","thead","tfoot","tr"]),nq=new Set(["td","th"]),rq="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function iq(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return n;function n(n,r,i,o){const a=Array.isArray(i.children),s=zH(n);return t(r,i,o,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=function(e,t,n){return r;function r(e,r,i,o){const a=Array.isArray(i.children)?n:t;return o?a(r,i,o):a(r,i)}}(0,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?BH:RH,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},o=oq(i,e,void 0);return o&&"string"!=typeof o?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function oq(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let i=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(i=BH,e.schema=i);e.ancestors.push(t);const o=uq(e,t.tagName,!1),a=function(e,t){const n={};let r,i;for(i in t.properties)if("children"!==i&&XH.call(t.properties,i)){const o=cq(e,i,t.properties[i]);if(o){const[i,a]=o;e.tableCellAlignToStyle&&"align"===i&&"string"==typeof a&&nq.has(t.tagName)?r=a:n[i]=a}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let s=lq(e,t);tq.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&cH(t.value):cH(t));var t}));return aq(e,a,o,t),sq(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}dq(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let i=r;"svg"===t.name&&"html"===r.space&&(i=BH,e.schema=i);e.ancestors.push(t);const o=null===t.name?e.Fragment:uq(e,t.name,!0),a=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];nH(t.type);const i=t.expression;nH(i.type);const o=i.properties[0];nH(o.type),Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else dq(e,t.position);else{const i=r.name;let o;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];nH(t.type),o=e.evaluater.evaluateExpression(t.expression)}else dq(e,t.position);else o=null===r.value||r.value;n[i]=o}return n}(e,t),s=lq(e,t);return aq(e,a,o,t),sq(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);dq(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return sq(r,lq(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function aq(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function sq(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function lq(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:$H;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys){const e="element"===o.type?o.tagName:"mdxJsxFlowElement"===o.type||"mdxJsxTextElement"===o.type?o.name:void 0;if(e){const t=i.get(e)||0;a=e+"-"+t,i.set(e,t+1)}}const s=oq(e,o,a);void 0!==s&&n.push(s)}return n}function cq(e,t,n){const r=function(e,t){const n=pH(t);let r=t,i=hH;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&VH.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(NH,jH);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!NH.test(e)){let n=e.replace(YH,FH);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=CH}return new i(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e,t){const n=t||{};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}(n):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return qH(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const n=t,r=new KH("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=rq+"#cannot-parse-style-attribute",r}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)XH.call(e,n)&&(t[pq(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?HH[r.property]||r.property:r.attribute,n]}}function uq(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,i=-1;for(;++i<e.length;){const t=sH(e[i])?{type:"Identifier",name:e[i]}:{type:"Literal",value:e[i]};n=n?{type:"MemberExpression",object:n,property:t,computed:Boolean(i&&"Literal"===t.type),optional:!1}:t}r=n}else r=sH(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){const t=r.value;return XH.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);dq(e)}function dq(e,t){const n=new KH("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=rq+"#cannot-handle-mdx-estrees-without-createevaluater",n}function pq(e){let t=e.replace(eq,hq);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function hq(e){return"-"+e.toLowerCase()}const fq={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},mq={};function gq(e,t){const n=t||mq;return yq(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function yq(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Aq(e.children,t,n)}return Array.isArray(e)?Aq(e,t,n):""}function Aq(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=yq(e[i],t,n);return r.join("")}function vq(e,t,n,r){const i=e.length;let o,a=0;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function bq(e,t){return e.length>0?(vq(e,e.length,0,t),e):t}class wq{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=null==t?Number.POSITIVE_INFINITY:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&Eq(this.left,n),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Eq(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Eq(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);Eq(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Eq(this.left,t.reverse())}}}function Eq(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function kq(e){const t={};let n,r,i,o,a,s,l,c=-1;const u=new wq(e);for(;++c<u.length;){for(;c in t;)c=t[c];if(n=u.get(c),c&&"chunkFlow"===n[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&(s=n[1]._tokenizer.events,i=0,i<s.length&&"lineEndingBlank"===s[i][1].type&&(i+=2),i<s.length&&"content"===s[i][1].type))for(;++i<s.length&&"content"!==s[i][1].type;)"chunkText"===s[i][1].type&&(s[i][1]._isInFirstContentOfListItem=!0,i++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,Cq(u,c)),c=t[c],l=!0);else if(n[1]._container){for(i=c,r=void 0;i--;)if(o=u.get(i),"lineEnding"===o[1].type||"lineEndingBlank"===o[1].type)"enter"===o[0]&&(r&&(u.get(r)[1].type="lineEndingBlank"),o[1].type="lineEnding",r=i);else if("linePrefix"!==o[1].type&&"listItemIndent"!==o[1].type)break;r&&(n[1].end={...u.get(r)[1].start},a=u.slice(r,c),a.unshift(n),u.splice(r,c-r+1,a))}}return vq(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!l}function Cq(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],c={};let u,d,p=-1,h=n,f=0,m=0;const g=[m];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(u=r.sliceStream(h),h.next||u.push(null),d&&a.defineSkip(h.start),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=h,h=h.next}for(h=n;++p<s.length;)"exit"===s[p][0]&&"enter"===s[p-1][0]&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(m=p+1,g.push(m),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(a.events=[],h?(h._tokenizer=void 0,h.previous=void 0):g.pop(),p=g.length;p--;){const t=s.slice(g[p],g[p+1]),n=o.pop();l.push([n,n+t.length-1]),e.splice(n,2,t)}for(l.reverse(),p=-1;++p<l.length;)c[f+l[p][0]]=f+l[p][1],f+=l[p][1]-l[p][0]-1;return c}const _q={}.hasOwnProperty;function Mq(e){const t={};let n=-1;for(;++n<e.length;)Tq(t,e[n]);return t}function Tq(e,t){let n;for(n in t){const r=(_q.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){_q.call(r,o)||(r[o]=[]);const e=i[o];Sq(r[o],Array.isArray(e)?e:e?[e]:[])}}}function Sq(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);vq(e,0,0,r)}const Dq=jq(/[A-Za-z]/),xq=jq(/[\dA-Za-z]/),Iq=jq(/[#-'*+\--9=?A-Z^-~]/);function Lq(e){return null!==e&&(e<32||127===e)}const Pq=jq(/\d/),Oq=jq(/[\dA-Fa-f]/),Rq=jq(/[!-/:-@[-`{-~]/);function Bq(e){return null!==e&&e<-2}function Yq(e){return null!==e&&(e<0||32===e)}function Nq(e){return-2===e||-1===e||32===e}const Vq=jq(/\p{P}|\p{S}/u),Fq=jq(/\s/);function jq(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function Hq(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return function(r){if(Nq(r))return e.enter(n),a(r);return t(r)};function a(r){return Nq(r)&&o++<i?(e.consume(r),a):(e.exit(n),t(r))}}const qq={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Hq(e,t,"linePrefix")},function(t){return e.enter("paragraph"),r(t)});let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,i(t)}function i(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):Bq(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),i)}}};const Gq={tokenize:function(e){const t=this,n=[];let r,i,o,a=0;return s;function s(r){if(a<n.length){const i=n[a];return t.containerState=i[1],e.attempt(i[0].continuation,l,c)(r)}return c(r)}function l(e){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&A();const n=t.events.length;let i,o=n;for(;o--;)if("exit"===t.events[o][0]&&"chunkFlow"===t.events[o][1].type){i=t.events[o][1].end;break}y(a);let s=n;for(;s<t.events.length;)t.events[s][1].end={...i},s++;return vq(t.events,o+1,0,t.events.slice(n)),t.events.length=s,c(e)}return s(e)}function c(i){if(a===n.length){if(!r)return p(i);if(r.currentConstruct&&r.currentConstruct.concrete)return f(i);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(zq,u,d)(i)}function u(e){return r&&A(),y(a),p(e)}function d(e){return t.parser.lazy[t.now().line]=a!==n.length,o=t.now().offset,f(e)}function p(n){return t.containerState={},e.attempt(zq,h,f)(n)}function h(e){return a++,n.push([t.currentConstruct,t.containerState]),p(e)}function f(n){return null===n?(r&&A(),y(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:i}),m(n))}function m(n){return null===n?(g(e.exit("chunkFlow"),!0),y(0),void e.consume(n)):Bq(n)?(e.consume(n),g(e.exit("chunkFlow")),a=0,t.interrupt=void 0,s):(e.consume(n),m)}function g(e,n){const s=t.sliceStream(e);if(n&&s.push(null),e.previous=i,i&&(i.next=e),i=e,r.defineSkip(e.start),r.write(s),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<o&&(!r.events[e][1].end||r.events[e][1].end.offset>o))return;const n=t.events.length;let i,s,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(i){s=t.events[l][1].end;break}i=!0}for(y(a),e=n;e<t.events.length;)t.events[e][1].end={...s},e++;vq(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function y(r){let i=n.length;for(;i-- >r;){const r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function A(){r.write([null]),i=void 0,r=void 0,t.containerState._closeFlow=void 0}}},zq={tokenize:function(e,t,n){return Hq(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};const Uq={partial:!0,tokenize:function(e,t,n){return function(t){return Nq(t)?Hq(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||Bq(e)?t(e):n(e)}}};const Wq={resolve:function(e){return kq(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?i(t):Bq(t)?e.check(Qq,o,i)(t):(e.consume(t),r)}function i(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function o(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},Qq={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),Hq(e,i,"linePrefix")};function i(i){if(null===i||Bq(i))return n(i);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}};const Zq={tokenize:function(e){const t=this,n=e.attempt(Uq,function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,Hq(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Wq,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const Jq={resolveAll:eG()},Kq=$q("string"),Xq=$q("text");function $q(e){return{resolveAll:eG("text"===e?tG:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],i=t.attempt(r,o,a);return o;function o(e){return l(e)?i(e):a(e)}function a(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return l(e)?(t.exit("data"),i(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;const t=r[e];let i=-1;if(t)for(;++i<t.length;){const e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function eG(e){return function(t,n){let r,i=-1;for(;++i<=t.length;)void 0===r?t[i]&&"data"===t[i][1].type&&(r=i,i++):t[i]&&"data"===t[i][1].type||(i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),i=r+2),r=void 0);return e?e(t,n):t}}function tG(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],i=t.sliceStream(r);let o,a=i.length,s=-1,l=0;for(;a--;){const e=i[a];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)l++,s--;if(s)break;s=-1}else if(-2===e)o=!0,l++;else if(-1!==e){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const i={type:n===e.length||o||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,["enter",i,t],["exit",i,t]),n+=2)}n++}return e}const nG={name:"thematicBreak",tokenize:function(e,t,n){let r,i=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,o(e)}(t)};function o(o){return o===r?(e.enter("thematicBreakSequence"),a(o)):i>=3&&(null===o||Bq(o))?(e.exit("thematicBreak"),t(o)):n(o)}function a(t){return t===r?(e.consume(t),i++,a):(e.exit("thematicBreakSequence"),Nq(t)?Hq(e,o,"whitespace")(t):o(t))}}};const rG={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Uq,i,o);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Hq(e,t,"listItemIndent",r.containerState.size+1)(n)}function o(n){return r.containerState.furtherBlankLines||!Nq(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(oG,t,a)(n))}function a(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Hq(e,e.attempt(rG,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,a=0;return function(t){const i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:Pq(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(nG,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return Pq(t)&&++a<10?(e.consume(t),s):(!r.interrupt||a<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(Uq,r.interrupt?n:c,e.attempt(iG,d,u))}function c(e){return r.containerState.initialBlankLine=!0,o++,d(e)}function u(t){return Nq(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},iG={partial:!0,tokenize:function(e,t,n){const r=this;return Hq(e,function(e){const i=r.events[r.events.length-1];return!Nq(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},oG={partial:!0,tokenize:function(e,t,n){const r=this;return Hq(e,function(e){const i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}};const aG={continuation:{tokenize:function(e,t,n){const r=this;return function(t){if(Nq(t))return Hq(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t);return i(t)};function i(r){return e.attempt(aG,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),i}return n(t)};function i(n){return Nq(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};function sG(e,t,n,r,i,o,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){if(60===t)return e.enter(r),e.enter(i),e.enter(o),e.consume(t),e.exit(o),d;if(null===t||32===t||41===t||Lq(t))return n(t);return e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),f(t)};function d(n){return 62===n?(e.enter(o),e.consume(n),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(n))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||Bq(t)?n(t):(e.consume(t),92===t?h:p)}function h(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function f(i){return u||null!==i&&41!==i&&!Yq(i)?u<c&&40===i?(e.consume(i),u++,f):41===i?(e.consume(i),u--,f):null===i||32===i||40===i||Lq(i)?n(i):(e.consume(i),92===i?m:f):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(i))}function m(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function lG(e,t,n,r,i,o){const a=this;let s,l=0;return function(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(o),c};function c(d){return l>999||null===d||91===d||93===d&&!s||94===d&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):93===d?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):Bq(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||Bq(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),s||(s=!Nq(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function cG(e,t,n,r,i,o){let a;return function(t){if(34===t||39===t||40===t)return e.enter(r),e.enter(i),e.consume(t),e.exit(i),a=40===t?41:t,s;return n(t)};function s(n){return n===a?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(o),l(n))}function l(t){return t===a?(e.exit(o),s(a)):null===t?n(t):Bq(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),Hq(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===a||null===t||Bq(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===a||92===t?(e.consume(t),c):c(t)}}function uG(e,t){let n;return function r(i){if(Bq(i))return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r;if(Nq(i))return Hq(e,r,n?"linePrefix":"lineSuffix")(i);return t(i)}}function dG(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const pG={name:"definition",tokenize:function(e,t,n){const r=this;let i;return function(t){return e.enter("definition"),function(t){return lG.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function o(t){return i=dG(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return Yq(t)?uG(e,s)(t):s(t)}function s(t){return sG(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(hG,c,c)(t)}function c(t){return Nq(t)?Hq(e,u,"whitespace")(t):u(t)}function u(o){return null===o||Bq(o)?(e.exit("definition"),r.parser.defined.push(i),t(o)):n(o)}}},hG={partial:!0,tokenize:function(e,t,n){return function(t){return Yq(t)?uG(e,r)(t):n(t)};function r(t){return cG(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return Nq(t)?Hq(e,o,"whitespace")(t):o(t)}function o(e){return null===e||Bq(e)?t(e):n(e)}}};const fG={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),Hq(e,i,"linePrefix",5)(t)};function i(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return null===t?s(t):Bq(t)?e.attempt(mG,o,s)(t):(e.enter("codeFlowValue"),a(t))}function a(t){return null===t||Bq(t)?(e.exit("codeFlowValue"),o(t)):(e.consume(t),a)}function s(n){return e.exit("codeIndented"),t(n)}}},mG={partial:!0,tokenize:function(e,t,n){const r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Bq(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):Hq(e,o,"linePrefix",5)(t)}function o(e){const o=r.events[r.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(e):Bq(e)?i(e):n(e)}}};const gG={name:"headingAtx",resolve:function(e,t){let n,r,i=e.length-2,o=3;"whitespace"===e[o][1].type&&(o+=2);i-2>o&&"whitespace"===e[i][1].type&&(i-=2);"atxHeadingSequence"===e[i][1].type&&(o===i-1||i-4>o&&"whitespace"===e[i-2][1].type)&&(i-=o+1===i?2:4);i>o&&(n={type:"atxHeadingText",start:e[o][1].start,end:e[i][1].end},r={type:"chunkText",start:e[o][1].start,end:e[i][1].end,contentType:"text"},vq(e,o,i-o+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]]));return e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),i(t)}(t)};function i(t){return 35===t&&r++<6?(e.consume(t),i):null===t||Yq(t)?(e.exit("atxHeadingSequence"),o(t)):n(t)}function o(n){return 35===n?(e.enter("atxHeadingSequence"),a(n)):null===n||Bq(n)?(e.exit("atxHeading"),t(n)):Nq(n)?Hq(e,o,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function a(t){return 35===t?(e.consume(t),a):(e.exit("atxHeadingSequence"),o(t))}function s(t){return null===t||35===t||Yq(t)?(e.exit("atxHeadingText"),o(t)):(e.consume(t),s)}}};const yG={name:"setextUnderline",resolveTo:function(e,t){let n,r,i,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){n=o;break}"paragraph"===e[o][1].type&&(r=o)}else"content"===e[o][1].type&&e.splice(o,1),i||"definition"!==e[o][1].type||(i=o);const a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",a,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=a;return e.push(["exit",a,t]),e},tokenize:function(e,t,n){const r=this;let i;return function(t){let a,s=r.events.length;for(;s--;)if("lineEnding"!==r.events[s][1].type&&"linePrefix"!==r.events[s][1].type&&"content"!==r.events[s][1].type){a="paragraph"===r.events[s][1].type;break}if(!r.parser.lazy[r.now().line]&&(r.interrupt||a))return e.enter("setextHeadingLine"),i=t,function(t){return e.enter("setextHeadingLineSequence"),o(t)}(t);return n(t)};function o(t){return t===i?(e.consume(t),o):(e.exit("setextHeadingLineSequence"),Nq(t)?Hq(e,a,"lineSuffix")(t):a(t))}function a(r){return null===r||Bq(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const AG=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],vG=["pre","script","style","textarea"],bG={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},tokenize:function(e,t,n){const r=this;let i,o,a,s,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(s){return 33===s?(e.consume(s),u):47===s?(e.consume(s),o=!0,h):63===s?(e.consume(s),i=3,r.interrupt?t:O):Dq(s)?(e.consume(s),a=String.fromCharCode(s),f):n(s)}function u(o){return 45===o?(e.consume(o),i=2,d):91===o?(e.consume(o),i=5,s=0,p):Dq(o)?(e.consume(o),i=4,r.interrupt?t:O):n(o)}function d(i){return 45===i?(e.consume(i),r.interrupt?t:O):n(i)}function p(i){const o="CDATA[";return i===o.charCodeAt(s++)?(e.consume(i),6===s?r.interrupt?t:M:p):n(i)}function h(t){return Dq(t)?(e.consume(t),a=String.fromCharCode(t),f):n(t)}function f(s){if(null===s||47===s||62===s||Yq(s)){const l=47===s,c=a.toLowerCase();return l||o||!vG.includes(c)?AG.includes(a.toLowerCase())?(i=6,l?(e.consume(s),m):r.interrupt?t(s):M(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):o?g(s):y(s)):(i=1,r.interrupt?t(s):M(s))}return 45===s||xq(s)?(e.consume(s),a+=String.fromCharCode(s),f):n(s)}function m(i){return 62===i?(e.consume(i),r.interrupt?t:M):n(i)}function g(t){return Nq(t)?(e.consume(t),g):C(t)}function y(t){return 47===t?(e.consume(t),C):58===t||95===t||Dq(t)?(e.consume(t),A):Nq(t)?(e.consume(t),y):C(t)}function A(t){return 45===t||46===t||58===t||95===t||xq(t)?(e.consume(t),A):v(t)}function v(t){return 61===t?(e.consume(t),b):Nq(t)?(e.consume(t),v):y(t)}function b(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,w):Nq(t)?(e.consume(t),b):E(t)}function w(t){return t===l?(e.consume(t),l=null,k):null===t||Bq(t)?n(t):(e.consume(t),w)}function E(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||Yq(t)?v(t):(e.consume(t),E)}function k(e){return 47===e||62===e||Nq(e)?y(e):n(e)}function C(t){return 62===t?(e.consume(t),_):n(t)}function _(t){return null===t||Bq(t)?M(t):Nq(t)?(e.consume(t),_):n(t)}function M(t){return 45===t&&2===i?(e.consume(t),x):60===t&&1===i?(e.consume(t),I):62===t&&4===i?(e.consume(t),R):63===t&&3===i?(e.consume(t),O):93===t&&5===i?(e.consume(t),P):!Bq(t)||6!==i&&7!==i?null===t||Bq(t)?(e.exit("htmlFlowData"),T(t)):(e.consume(t),M):(e.exit("htmlFlowData"),e.check(wG,B,T)(t))}function T(t){return e.check(EG,S,B)(t)}function S(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),D}function D(t){return null===t||Bq(t)?T(t):(e.enter("htmlFlowData"),M(t))}function x(t){return 45===t?(e.consume(t),O):M(t)}function I(t){return 47===t?(e.consume(t),a="",L):M(t)}function L(t){if(62===t){const n=a.toLowerCase();return vG.includes(n)?(e.consume(t),R):M(t)}return Dq(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),L):M(t)}function P(t){return 93===t?(e.consume(t),O):M(t)}function O(t){return 62===t?(e.consume(t),R):45===t&&2===i?(e.consume(t),O):M(t)}function R(t){return null===t||Bq(t)?(e.exit("htmlFlowData"),B(t)):(e.consume(t),R)}function B(n){return e.exit("htmlFlow"),t(n)}}},wG={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(Uq,t,n)}}},EG={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(Bq(t))return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i;return n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}};const kG={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(null===t)return n(t);return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},CG={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,i={partial:!0,tokenize:function(e,t,n){let i=0;return a;function a(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l}function l(t){return e.enter("codeFencedFence"),Nq(t)?Hq(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):c(t)}function c(t){return t===o?(e.enter("codeFencedFenceSequence"),u(t)):n(t)}function u(t){return t===o?(i++,e.consume(t),u):i>=s?(e.exit("codeFencedFenceSequence"),Nq(t)?Hq(e,d,"whitespace")(t):d(t)):n(t)}function d(r){return null===r||Bq(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let o,a=0,s=0;return function(t){return function(t){const n=r.events[r.events.length-1];return a=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,o=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===o?(s++,e.consume(t),l):s<3?n(t):(e.exit("codeFencedFenceSequence"),Nq(t)?Hq(e,c,"whitespace")(t):c(t))}function c(n){return null===n||Bq(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(kG,h,A)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||Bq(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):Nq(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Hq(e,d,"whitespace")(t)):96===t&&t===o?n(t):(e.consume(t),u)}function d(t){return null===t||Bq(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(t))}function p(t){return null===t||Bq(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===o?n(t):(e.consume(t),p)}function h(t){return e.attempt(i,A,f)(t)}function f(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m}function m(t){return a>0&&Nq(t)?Hq(e,g,"linePrefix",a+1)(t):g(t)}function g(t){return null===t||Bq(t)?e.check(kG,h,A)(t):(e.enter("codeFlowValue"),y(t))}function y(t){return null===t||Bq(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),y)}function A(n){return e.exit("codeFenced"),t(n)}}};const _G=document.createElement("i");function MG(e){const t="&"+e+";";_G.innerHTML=t;const n=_G.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&(n!==t&&n)}const TG={name:"characterReference",tokenize:function(e,t,n){const r=this;let i,o,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),i=31,o=xq,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,o=Oq,c):(e.enter("characterReferenceValue"),i=7,o=Pq,c(t))}function c(s){if(59===s&&a){const i=e.exit("characterReferenceValue");return o!==xq||MG(r.sliceSerialize(i))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return o(s)&&a++<i?(e.consume(s),c):n(s)}}};const SG={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return Rq(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const DG={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Hq(e,t,"linePrefix")}}};function xG(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const IG={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){const e="labelImage"===r.type?4:2;r.type="data",t+=e}}e.length!==n.length&&vq(e,0,e.length,n);return e},resolveTo:function(e,t){let n,r,i,o,a=e.length,s=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(i){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(i=a);const l={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[i][1].end}},u={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[i-2][1].start}};return o=[["enter",l,t],["enter",c,t]],o=bq(o,e.slice(r+1,r+s+3)),o=bq(o,[["enter",u,t]]),o=bq(o,xG(t.parser.constructs.insideSpan.null,e.slice(r+s+4,i-3),t)),o=bq(o,[["exit",u,t],e[i-2],e[i-1],["exit",c,t]]),o=bq(o,e.slice(i+1)),o=bq(o,[["exit",l,t]]),vq(e,r,e.length,o),e},tokenize:function(e,t,n){const r=this;let i,o,a=r.events.length;for(;a--;)if(("labelImage"===r.events[a][1].type||"labelLink"===r.events[a][1].type)&&!r.events[a][1]._balanced){i=r.events[a][1];break}return function(t){if(!i)return n(t);if(i._inactive)return u(t);return o=r.parser.defined.includes(dG(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s};function s(t){return 40===t?e.attempt(LG,c,o?c:u)(t):91===t?e.attempt(PG,c,o?l:u)(t):o?c(t):u(t)}function l(t){return e.attempt(OG,c,u)(t)}function c(e){return t(e)}function u(e){return i._balanced=!0,n(e)}}},LG={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return Yq(t)?uG(e,i)(t):i(t)}function i(t){return 41===t?c(t):sG(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function o(t){return Yq(t)?uG(e,s)(t):c(t)}function a(e){return n(e)}function s(t){return 34===t||39===t||40===t?cG(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function l(t){return Yq(t)?uG(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},PG={tokenize:function(e,t,n){const r=this;return function(t){return lG.call(r,e,i,o,"reference","referenceMarker","referenceString")(t)};function i(e){return r.parser.defined.includes(dG(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}},OG={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}};const RG={name:"labelStartImage",resolveAll:IG.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),i};function i(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),o):n(t)}function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};function BG(e){return null===e||Yq(e)||Fq(e)?1:Vq(e)?2:void 0}const YG={name:"attention",resolveAll:function(e,t){let n,r,i,o,a,s,l,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close)for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const d={...e[n][1].end},p={...e[u][1].start};NG(d,-s),NG(p,s),o={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:p},i={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:s>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[n][1].end={...o.start},e[u][1].start={...a.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=bq(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=bq(l,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",i,t]]),l=bq(l,xG(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=bq(l,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=bq(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,vq(e,n-1,u-n+3,l),u=n+l.length-c-2;break}u=-1;for(;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=BG(r);let o;return function(t){return o=t,e.enter("attentionSequence"),a(t)};function a(s){if(s===o)return e.consume(s),a;const l=e.exit("attentionSequence"),c=BG(s),u=!c||2===c&&i||n.includes(s),d=!i||2===i&&c||n.includes(r);return l._open=Boolean(42===o?u:u&&(i||!d)),l._close=Boolean(42===o?d:d&&(c||!u)),t(s)}}};function NG(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const VG={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i};function i(t){return Dq(t)?(e.consume(t),o):64===t?n(t):l(t)}function o(e){return 43===e||45===e||46===e||xq(e)?(r=1,a(e)):l(e)}function a(t){return 58===t?(e.consume(t),r=0,s):(43===t||45===t||46===t||xq(t))&&r++<32?(e.consume(t),a):(r=0,l(t))}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||Lq(r)?n(r):(e.consume(r),s)}function l(t){return 64===t?(e.consume(t),c):Iq(t)?(e.consume(t),l):n(t)}function c(e){return xq(e)?u(e):n(e)}function u(n){return 46===n?(e.consume(n),r=0,c):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):d(n)}function d(t){if((45===t||xq(t))&&r++<63){const n=45===t?d:u;return e.consume(t),n}return n(t)}}};const FG={name:"htmlText",tokenize:function(e,t,n){const r=this;let i,o,a;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),b):63===t?(e.consume(t),A):Dq(t)?(e.consume(t),k):n(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),o=0,h):Dq(t)?(e.consume(t),y):n(t)}function c(t){return 45===t?(e.consume(t),p):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),d):Bq(t)?(a=u,L(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),p):u(t)}function p(e){return 62===e?I(e):45===e?d(e):u(e)}function h(t){const r="CDATA[";return t===r.charCodeAt(o++)?(e.consume(t),6===o?f:h):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),m):Bq(t)?(a=f,L(t)):(e.consume(t),f)}function m(t){return 93===t?(e.consume(t),g):f(t)}function g(t){return 62===t?I(t):93===t?(e.consume(t),g):f(t)}function y(t){return null===t||62===t?I(t):Bq(t)?(a=y,L(t)):(e.consume(t),y)}function A(t){return null===t?n(t):63===t?(e.consume(t),v):Bq(t)?(a=A,L(t)):(e.consume(t),A)}function v(e){return 62===e?I(e):A(e)}function b(t){return Dq(t)?(e.consume(t),w):n(t)}function w(t){return 45===t||xq(t)?(e.consume(t),w):E(t)}function E(t){return Bq(t)?(a=E,L(t)):Nq(t)?(e.consume(t),E):I(t)}function k(t){return 45===t||xq(t)?(e.consume(t),k):47===t||62===t||Yq(t)?C(t):n(t)}function C(t){return 47===t?(e.consume(t),I):58===t||95===t||Dq(t)?(e.consume(t),_):Bq(t)?(a=C,L(t)):Nq(t)?(e.consume(t),C):I(t)}function _(t){return 45===t||46===t||58===t||95===t||xq(t)?(e.consume(t),_):M(t)}function M(t){return 61===t?(e.consume(t),T):Bq(t)?(a=M,L(t)):Nq(t)?(e.consume(t),M):C(t)}function T(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),i=t,S):Bq(t)?(a=T,L(t)):Nq(t)?(e.consume(t),T):(e.consume(t),D)}function S(t){return t===i?(e.consume(t),i=void 0,x):null===t?n(t):Bq(t)?(a=S,L(t)):(e.consume(t),S)}function D(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||Yq(t)?C(t):(e.consume(t),D)}function x(e){return 47===e||62===e||Yq(e)?C(e):n(e)}function I(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function L(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),P}function P(t){return Nq(t)?Hq(e,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):O(t)}function O(t){return e.enter("htmlTextData"),a(t)}}};const jG={name:"labelStartLink",resolveAll:IG.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),i};function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const HG={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return Bq(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const qG={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,i=3;if(!("lineEnding"!==e[i][1].type&&"space"!==e[i][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=i;++t<r;)if("codeTextData"===e[t][1].type){e[i][1].type="codeTextPadding",e[r][1].type="codeTextPadding",i+=2,r-=2;break}t=i-1,r++;for(;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,i,o=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),a(t)};function a(t){return 96===t?(e.consume(t),o++,a):(e.exit("codeTextSequence"),s(t))}function s(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),s):96===t?(i=e.enter("codeTextSequence"),r=0,c(t)):Bq(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||Bq(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),l)}function c(n){return 96===n?(e.consume(n),r++,c):r===o?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(i.type="codeTextData",l(n))}}};const GG={42:rG,43:rG,45:rG,48:rG,49:rG,50:rG,51:rG,52:rG,53:rG,54:rG,55:rG,56:rG,57:rG,62:aG},zG={91:pG},UG={[-2]:fG,[-1]:fG,32:fG},WG={35:gG,42:nG,45:[yG,nG],60:bG,61:yG,95:nG,96:CG,126:CG},QG={38:TG,92:SG},ZG={[-5]:DG,[-4]:DG,[-3]:DG,33:RG,38:TG,42:YG,60:[VG,FG],91:jG,92:[HG,SG],93:IG,95:YG,96:qG},JG={null:[YG,Jq]},KG={null:[42,95]},XG={null:[]};function $G(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let a=[],s=[],l=!0;const c={attempt:A(function(e,t){v(e,t.from)}),check:A(y),consume:function(e){Bq(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,b()):-1!==e&&(r.column++,r.offset++);r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++));u.previous=e,l=!0},enter:function(e,t){const n=t||{};return n.type=e,n.start=f(),u.events.push(["enter",n,u]),s.push(n),n},exit:function(e){const t=s.pop();return t.end=f(),u.events.push(["exit",t,u]),t},interrupt:A(y,{interrupt:!0})},u={code:null,containerState:{},defineSkip:function(e){i[e.line]=e.column,b()},events:[],now:f,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if("string"==typeof o)a=o;else switch(o){case-5:a="\r";break;case-4:a="\n";break;case-3:a="\r\n";break;case-2:a=t?" ":"\t";break;case-1:if(!t&&i)continue;a=" ";break;default:a=String.fromCharCode(o)}i=-2===o,r.push(a)}return r.join("")}(h(e),t)},sliceStream:h,write:function(e){if(a=bq(a,e),m(),null!==a[a.length-1])return[];return v(t,0),u.events=xG(o,u.events,u),u.events}};let d,p=t.tokenize.call(u,c);return t.resolveAll&&o.push(t),u;function h(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const e=a[0];"string"==typeof e?a[0]=e.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}(a,e)}function f(){const{_bufferIndex:e,_index:t,line:n,column:i,offset:o}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:o}}function m(){let e;for(;r._index<a.length;){const t=a[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)g(t.charCodeAt(r._bufferIndex));else g(t)}}function g(e){l=void 0,d=e,p=p(e)}function y(e,t){t.restore()}function A(e,t){return function(n,i,o){let a,d,p,h;return Array.isArray(n)?m(n):"tokenize"in n?m([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return m([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function m(e){return a=e,d=0,0===e.length?o:g(e[d])}function g(e){return function(n){h=function(){const e=f(),t=u.previous,n=u.currentConstruct,i=u.events.length,o=Array.from(s);return{from:i,restore:a};function a(){r=e,u.previous=t,u.currentConstruct=n,u.events.length=i,s=o,b()}}(),p=e,e.partial||(u.currentConstruct=e);if(e.name&&u.parser.constructs.disable.null.includes(e.name))return A(n);return e.tokenize.call(t?Object.assign(Object.create(u),t):u,c,y,A)(n)}}function y(t){return l=!0,e(p,h),i}function A(e){return l=!0,h.restore(),++d<a.length?g(a[d]):o}}}function v(e,t){e.resolveAll&&!o.includes(e)&&o.push(e),e.resolve&&vq(u.events,t,u.events.length-t,e.resolve(u.events.slice(t),u)),e.resolveTo&&(u.events=e.resolveTo(u.events,u))}function b(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}const ez=/[\0\t\n\r]/g;function tz(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}const nz=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rz(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return tz(n.slice(t?2:1),t?16:10)}return MG(n)||e}const iz={}.hasOwnProperty;function oz(e,t,r){return t&&"object"==typeof t&&(r=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(te),autolinkProtocol:_,autolinkEmail:_,atxHeading:o(K),blockQuote:o(U),characterEscape:_,characterReference:_,codeFenced:o(W),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(W,a),codeText:o(Q,a),codeTextData:_,data:_,codeFlowValue:_,definition:o(Z),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(J),hardBreakEscape:o(X),hardBreakTrailing:o(X),htmlFlow:o($,a),htmlFlowData:_,htmlText:o($,a),htmlTextData:_,image:o(ee),label:a,link:o(te),listItem:o(re),listItemValue:p,listOrdered:o(ne,d),listUnordered:o(ne),paragraph:o(ie),reference:V,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(K),strong:o(oe),thematicBreak:o(se)},exit:{atxHeading:l(),atxHeadingSequence:w,autolink:l(),autolinkEmail:z,autolinkProtocol:G,blockQuote:l(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:j,characterReferenceMarkerNumeric:j,characterReferenceValue:H,characterReference:q,codeFenced:l(g),codeFencedFence:m,codeFencedFenceInfo:h,codeFencedFenceMeta:f,codeFlowValue:M,codeIndented:l(y),codeText:l(I),codeTextData:M,data:M,definition:l(),definitionDestinationString:b,definitionLabelString:A,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(S),hardBreakTrailing:l(S),htmlFlow:l(D),htmlFlowData:M,htmlText:l(x),htmlTextData:M,image:l(P),label:R,labelText:O,lineEnding:T,link:l(L),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:F,resourceDestinationString:B,resourceTitleString:Y,resource:N,setextHeading:l(C),setextHeadingLineSequence:k,setextHeadingText:E,strong:l(),thematicBreak:l()}};sz(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const o={stack:[r],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:u,data:n},l=[];let d=-1;for(;++d<e.length;)if("listOrdered"===e[d][1].type||"listUnordered"===e[d][1].type)if("enter"===e[d][0])l.push(d);else{d=i(e,l.pop(),d)}for(d=-1;++d<e.length;){const n=t[e[d][0]];iz.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},o),e[d][1])}if(o.tokenStack.length>0){const e=o.tokenStack[o.tokenStack.length-1];(e[1]||cz).call(o,void 0,e[0])}for(r.position={start:az(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:az(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r,i,o,a,s=t-1,l=-1,c=!1;for(;++s<=n;){const t=e[s];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,a=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||a||l||o||(o=s),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let a=s;for(i=void 0;a--;){const t=e[a];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;i&&(e[i][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",i=a}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}o&&(!i||o<i)&&(r._spread=!0),r.end=Object.assign({},i?e[i][1].start:t[1].end),e.splice(i||s,0,["exit",r,t[2]]),s++,n++}if("listItemPrefix"===t[1].type){const i={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=i,e.splice(s,0,["enter",i,t[2]]),s++,n++,o=void 0,a=!0}}}return e[t][1]._spread=c,n}function o(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:az(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),c.call(this,t)}}function c(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+WH({start:e.start,end:e.end})+"): it’s not open");if(r[0].type!==e.type)if(t)t.call(this,e,r[0]);else{(r[1]||cz).call(this,e,r[0])}n.position.end=az(e.end)}function u(){return gq(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function h(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function f(){const e=this.resume();this.stack[this.stack.length-1].meta=e}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}function A(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=dG(this.sliceSerialize(e)).toLowerCase()}function v(){const e=this.resume();this.stack[this.stack.length-1].title=e}function b(){const e=this.resume();this.stack[this.stack.length-1].url=e}function w(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function k(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function C(){this.data.setextHeadingSlurpLineEnding=void 0}function _(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];n&&"text"===n.type||(n=ae(),n.position={start:az(e.start),end:void 0},t.push(n)),this.stack.push(n)}function M(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=az(e.end)}function T(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=az(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(_.call(this,e),M.call(this,e))}function S(){this.data.atHardBreak=!0}function D(){const e=this.resume();this.stack[this.stack.length-1].value=e}function x(){const e=this.resume();this.stack[this.stack.length-1].value=e}function I(){const e=this.resume();this.stack[this.stack.length-1].value=e}function L(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function O(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(nz,rz)}(t),n.identifier=dG(t).toLowerCase()}function R(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t}function B(){const e=this.resume();this.stack[this.stack.length-1].url=e}function Y(){const e=this.resume();this.stack[this.stack.length-1].title=e}function N(){this.data.inReference=void 0}function V(){this.data.referenceType="collapsed"}function F(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=dG(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function j(e){this.data.characterReferenceType=e.type}function H(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;if(n)r=tz(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0;else{r=MG(t)}this.stack[this.stack.length-1].value+=r}function q(e){this.stack.pop().position.end=az(e.end)}function G(e){M.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function z(e){M.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function U(){return{type:"blockquote",children:[]}}function W(){return{type:"code",lang:null,meta:null,value:""}}function Q(){return{type:"inlineCode",value:""}}function Z(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function J(){return{type:"emphasis",children:[]}}function K(){return{type:"heading",depth:0,children:[]}}function X(){return{type:"break"}}function $(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function ie(){return{type:"paragraph",children:[]}}function oe(){return{type:"strong",children:[]}}function ae(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}(r)(function(e){for(;!kq(e););return e}(function(e){const t={constructs:Mq([n,...(e||{}).extensions||[]]),content:r(qq),defined:[],document:r(Gq),flow:r(Zq),lazy:{},string:r(Kq),text:r(Xq)};return t;function r(e){return function(n){return $G(t,e,n)}}}(r).document().write(function(){let e,t=1,n="",r=!0;return function(i,o,a){const s=[];let l,c,u,d,p;for(i=n+("string"==typeof i?i.toString():new TextDecoder(o||void 0).decode(i)),u=0,n="",r&&(65279===i.charCodeAt(0)&&u++,r=void 0);u<i.length;){if(ez.lastIndex=u,l=ez.exec(i),d=l&&void 0!==l.index?l.index:i.length,p=i.charCodeAt(d),!l){n=i.slice(u);break}if(10===p&&u===d&&e)s.push(-3),e=void 0;else switch(e&&(s.push(-5),e=void 0),u<d&&(s.push(i.slice(u,d)),t+=d-u),p){case 0:s.push(65533),t++;break;case 9:for(c=4*Math.ceil(t/4),s.push(-2);t++<c;)s.push(-1);break;case 10:s.push(-4),t=1;break;default:e=!0,t=1}u=d+1}return a&&(e&&s.push(-5),n&&s.push(n),s.push(null)),s}}()(e,t,!0))))}function az(e){return{line:e.line,column:e.column,offset:e.offset}}function sz(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?sz(e,r):lz(e,r)}}function lz(e,t){let n;for(n in t)if(iz.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function cz(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+WH({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+WH({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+WH({start:t.start,end:t.end})+") is still open")}function uz(e){const t=this;t.parser=function(n){return oz(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}const dz="object"==typeof self?self:globalThis,pz=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case 0:case-1:return n(a,i);case 1:{const e=n([],i);for(const t of a)e.push(r(t));return e}case 2:{const e=n({},i);for(const[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),i);case 4:{const{source:e,flags:t}=a;return n(new RegExp(e,t),i)}case 5:{const e=n(new Map,i);for(const[t,n]of a)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,i);for(const t of a)e.add(r(t));return e}case 7:{const{name:e,message:t}=a;return n(new dz[e](t),i)}case 8:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:e}=new Uint8Array(a);return n(new DataView(e),a)}}return n(new dz[o](a),i)};return r})(new Map,e)(0),hz="",{toString:fz}={},{keys:mz}=Object,gz=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=fz.call(e).slice(8,-1);switch(n){case"Array":return[1,hz];case"Object":return[2,hz];case"Date":return[3,hz];case"RegExp":return[4,hz];case"Map":return[5,hz];case"Set":return[6,hz];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},yz=([e,t])=>0===e&&("function"===t||"symbol"===t),Az=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const i=(e,t)=>{const i=r.push(e)-1;return n.set(t,i),i},o=r=>{if(n.has(r))return n.get(r);let[a,s]=gz(r);switch(a){case 0:{let t=r;switch(s){case"bigint":a=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);t=null;break;case"undefined":return i([-1],r)}return i([a,t],r)}case 1:{if(s){let e=r;return"DataView"===s?e=new Uint8Array(r.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(r)),i([s,[...e]],r)}const e=[],t=i([a,e],r);for(const t of r)e.push(o(t));return t}case 2:{if(s)switch(s){case"BigInt":return i([s,r.toString()],r);case"Boolean":case"Number":case"String":return i([s,r.valueOf()],r)}if(t&&"toJSON"in r)return o(r.toJSON());const n=[],l=i([a,n],r);for(const t of mz(r))!e&&yz(gz(r[t]))||n.push([o(t),o(r[t])]);return l}case 3:return i([a,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return i([a,{source:e,flags:t}],r)}case 5:{const t=[],n=i([a,t],r);for(const[n,i]of r)(e||!yz(gz(n))&&!yz(gz(i)))&&t.push([o(n),o(i)]);return n}case 6:{const t=[],n=i([a,t],r);for(const n of r)!e&&yz(gz(n))||t.push(o(n));return n}}const{message:l}=r;return i([a,{name:s,message:l}],r)};return o})(!(t||n),!!t,new Map,r)(e),r},vz="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?pz(Az(e,t)):structuredClone(e):(e,t)=>pz(Az(e,t));function bz(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(37===o&&xq(e.charCodeAt(n+1))&&xq(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const t=e.charCodeAt(n+1);o<56320&&t>56319&&t<57344?(a=String.fromCharCode(o,t),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function wz(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Ez(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const kz=function(e){if(null==e)return _z;if("function"==typeof e)return Cz(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=kz(e[n]);return Cz(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}(e):function(e){const t=e;return Cz(n);function n(n){const r=n;let i;for(i in e)if(r[i]!==t[i])return!1;return!0}}(e);if("string"==typeof e)return function(e){return Cz(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function Cz(e){return function(t,n,r){return Boolean(Mz(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function _z(){return!0}function Mz(e){return null!==e&&"object"==typeof e&&"type"in e}const Tz=[],Sz=!0,Dz=!1;function xz(e,t,n,r){let i;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):i=t;const o=kz(i),a=r?-1:1;!function e(i,s,l){const c=i&&"object"==typeof i?i:{};if("string"==typeof c.type){const e="string"==typeof c.tagName?c.tagName:"string"==typeof c.name?c.name:void 0;Object.defineProperty(u,"name",{value:"node ("+i.type+(e?"<"+e+">":"")+")"})}return u;function u(){let c,u,d,p=Tz;if((!t||o(i,s,l[l.length-1]||void 0))&&(p=function(e){if(Array.isArray(e))return e;if("number"==typeof e)return[Sz,e];return null==e?Tz:[e]}(n(i,l)),p[0]===Dz))return p;if("children"in i&&i.children){const t=i;if(t.children&&"skip"!==p[0])for(u=(r?t.children.length:-1)+a,d=l.concat(t);u>-1&&u<t.children.length;){const n=t.children[u];if(c=e(n,u,d)(),c[0]===Dz)return c;u="number"==typeof c[1]?c[1]:u+a}}return p}}(e,void 0,[])()}function Iz(e,t,n,r){let i,o,a;"function"==typeof t&&"function"!=typeof n?(o=void 0,a=t,i=n):(o=t,a=n,i=r),xz(e,o,function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return a(e,r,n)},i)}function Lz(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&"text"===o.type?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&"text"===a.type?a.value+=r:i.push({type:"text",value:r}),i}function Pz(e){const t=e.spread;return null==t?e.children.length>1:t}function Oz(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(Rz(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Rz(t.slice(i),i>0,!1)),o.join("")}function Rz(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;9===t||32===t;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}const Bz={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=bz(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);void 0===s?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Lz(e,t);const i={src:bz(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)},image:function(e,t){const n={src:bz(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Lz(e,t);const i={href:bz(r.url||"")};null!==r.title&&void 0!==r.title&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)},link:function(e,t){const n={href:bz(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),i=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Pz(n[r])}return t}(n):Pz(t),o={},a=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const e=r[s];(i||0!==s||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||i?a.push(e):a.push(...e.children)}const l=r[r.length-1];l&&(i||"element"!==l.type||"p"!==l.tagName)&&a.push({type:"text",value:"\n"});const c={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){const n={},r=e.all(t);let i=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++i<r.length;){const e=r[i];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=zH(t.children[1]),a=GH(t.children[t.children.length-1]);o&&a&&(r.position={start:o,end:a}),i.push(r)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,i=0===(r?r.indexOf(t):1)?"th":"td",o=n&&"table"===n.type?n.align:void 0,a=o?o.length:t.children.length;let s=-1;const l=[];for(;++s<a;){const n=t.children[s],r={},a=o?o[s]:void 0;a&&(r.align=a);let c={type:"element",tagName:i,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),l.push(c)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){const n={type:"text",value:Oz(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:Yz,yaml:Yz,definition:Yz,footnoteDefinition:Yz};function Yz(){}const Nz={}.hasOwnProperty,Vz={};function Fz(e,t){e.position&&(t.position=function(e){const t=zH(e),n=GH(e);if(t&&n)return{start:t,end:n}}(e))}function jz(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;if("string"==typeof t)if("element"===n.type)n.tagName=t;else{n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}}"element"===n.type&&i&&Object.assign(n.properties,vz(i)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function Hz(e,t){const n=t.data||{},r=!("value"in t)||Nz.call(n,"hProperties")||Nz.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}function qz(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function Gz(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function zz(e,t){const n=function(e,t){const n=t||Vz,r=new Map,i=new Map,o=new Map,a={...Bz,...n.handlers},s={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const i=s.one(n[r],e);if(i){if(r&&"break"===n[r-1].type&&(Array.isArray(i)||"text"!==i.type||(i.value=Gz(i.value)),!Array.isArray(i)&&"element"===i.type)){const e=i.children[0];e&&"text"===e.type&&(e.value=Gz(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t},applyData:jz,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:function(e,t){const n=e.type,r=s.handlers[n];if(Nz.call(s.handlers,n)&&r)return r(s,e,t);if(s.options.passThrough&&s.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=vz(n);return r.children=s.all(e),r}return vz(e)}return(s.options.unknownHandler||Hz)(s,e,t)},options:n,patch:Fz,wrap:qz};return Iz(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),s}(e,t),r=n.one(e,void 0),i=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||wz,r=e.options.footnoteBackLabel||Ez,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const i=e.footnoteById.get(e.footnoteOrder[l]);if(!i)continue;const o=e.all(i),a=String(i.identifier).toUpperCase(),c=bz(a.toLowerCase());let u=0;const d=[],p=e.footnoteCounts.get(a);for(;void 0!==p&&++u<=p;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const h=o[o.length-1];if(h&&"element"===h.type&&"p"===h.tagName){const e=h.children[h.children.length-1];e&&"text"===e.type?e.value+=" ":h.children.push({type:"text",value:" "}),h.children.push(...d)}else o.push(...d);const f={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(o,!0)};e.patch(i,f),s.push(f)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...vz(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:"\n"},i),o}function Uz(e,t){return e&&"run"in e?async function(n,r){const i=zz(n,{file:r,...t});await e.run(i,r)}:function(n,r){return zz(n,{file:r,...e||t})}}function Wz(e){if(e)throw e}var Qz=i(7095);function Zz(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function Jz(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function i(o,...a){const s=e[++n];let l=-1;if(o)r(o);else{for(;++l<t.length;)null!==a[l]&&void 0!==a[l]||(a[l]=t[l]);t=a,s?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let a;r&&t.push(i);try{a=e.apply(this,t)}catch(e){if(r&&n)throw e;return i(e)}r||(a&&a.then&&"function"==typeof a.then?a.then(o,i):a instanceof Error?i(a):o(a))}function i(e,...r){n||(n=!0,t(e,...r))}function o(e){i(null,e)}}(s,i)(...a):r(null,...a)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}const Kz={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');Xz(e);let n,r=0,i=-1,o=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;o--;)if(47===e.codePointAt(o)){if(n){r=o+1;break}}else i<0&&(n=!0,i=o+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let a=-1,s=t.length-1;for(;o--;)if(47===e.codePointAt(o)){if(n){r=o+1;break}}else a<0&&(n=!0,a=o+1),s>-1&&(e.codePointAt(o)===t.codePointAt(s--)?s<0&&(i=o):(s=-1,i=a));r===i?i=a:i<0&&(i=e.length);return e.slice(r,i)},dirname:function(e){if(Xz(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){Xz(e);let t,n=e.length,r=-1,i=0,o=-1,a=0;for(;n--;){const s=e.codePointAt(n);if(47!==s)r<0&&(t=!0,r=n+1),46===s?o<0?o=n:1!==a&&(a=1):o>-1&&(a=-1);else if(t){i=n+1;break}}if(o<0||r<0||0===a||1===a&&o===r-1&&o===i+1)return"";return e.slice(o,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)Xz(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){Xz(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,i="",o=0,a=-1,s=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.codePointAt(l);else{if(47===n)break;n=47}if(47===n){if(a===l-1||1===s);else if(a!==l-1&&2===s){if(i.length<2||2!==o||46!==i.codePointAt(i.length-1)||46!==i.codePointAt(i.length-2))if(i.length>2){if(r=i.lastIndexOf("/"),r!==i.length-1){r<0?(i="",o=0):(i=i.slice(0,r),o=i.length-1-i.lastIndexOf("/")),a=l,s=0;continue}}else if(i.length>0){i="",o=0,a=l,s=0;continue}t&&(i=i.length>0?i+"/..":"..",o=2)}else i.length>0?i+="/"+e.slice(a+1,l):i=e.slice(a+1,l),o=l-a-1;a=l,s=0}else 46===n&&s>-1?s++:s=-1}return i}(e,!t);0!==n.length||t||(n=".");n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/");return t?"/"+n:n}(t)},sep:"/"};function Xz(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const $z={cwd:function(){return"/"}};function eU(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function tU(e){if("string"==typeof e)e=new URL(e);else if(!eU(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}const nU=["history","path","basename","stem","extname","dirname"];class rU{constructor(e){let t;t=e?eU(e)?{path:e}:"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":$z.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,r=-1;for(;++r<nU.length;){const e=nU[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)nU.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?Kz.basename(this.path):void 0}set basename(e){oU(e,"basename"),iU(e,"basename"),this.path=Kz.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?Kz.dirname(this.path):void 0}set dirname(e){aU(this.basename,"dirname"),this.path=Kz.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?Kz.extname(this.path):void 0}set extname(e){if(iU(e,"extname"),aU(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Kz.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){eU(e)&&(e=tU(e)),oU(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?Kz.basename(this.path,this.extname):void 0}set stem(e){oU(e,"stem"),iU(e,"stem"),this.path=Kz.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new KH(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){if(void 0===this.value)return"";if("string"==typeof this.value)return this.value;return new TextDecoder(e||void 0).decode(this.value)}}function iU(e,t){if(e&&e.includes(Kz.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Kz.sep+"`")}function oU(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function aU(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const sU=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},lU={}.hasOwnProperty;class cU extends sU{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Jz()}copy(){const e=new cU;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(Qz(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(hU("data",this.frozen),this.namespace[e]=t,this):lU.call(this.namespace,e)&&this.namespace[e]||void 0:e?(hU("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=t.call(e,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=gU(e),n=this.parser||this.Parser;return dU("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),dU("process",this.parser||this.Parser),pU("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){const o=gU(e),a=n.parse(o);function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}n.run(a,o,function(e,t,r){if(e||!t||!r)return s(e);const i=t,o=n.stringify(i,r);var a;"string"==typeof(a=o)||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(a)?r.value=o:r.result=o,s(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),dU("processSync",this.parser||this.Parser),pU("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,Wz(e),t=r}),mU("processSync","process",n),t}run(e,t,n){fU(e),this.freeze();const r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,o){const a=gU(t);r.run(e,a,function(t,r,a){const s=r||e;t?o(t):i?i(s):n(void 0,s,a)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){Wz(e),n=t,r=!0}),mU("runSync","run",r),n}stringify(e,t){this.freeze();const n=gU(t),r=this.compiler||this.Compiler;return pU("stringify",r),fU(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(hU("use",this.frozen),null==e);else if("function"==typeof e)s(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?a(e):o(e)}return this;function i(e){if("function"==typeof e)s(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;s(t,n)}else o(e)}}function o(e){if(!("plugins"in e)&&!("settings"in e))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(e.plugins),e.settings&&(r.settings=Qz(!0,r.settings,e.settings))}function a(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;){i(e[t])}}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(-1===i)n.push([e,...t]);else if(t.length>0){let[r,...o]=t;const a=n[i][1];Zz(a)&&Zz(r)&&(r=Qz(!0,a,r)),n[i]=[e,r,...o]}}}}const uU=(new cU).freeze();function dU(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function pU(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function hU(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function fU(e){if(!Zz(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function mU(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function gU(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new rU(e)}const yU=[],AU={allowDangerousHtml:!0},vU=/^(https?|ircs?|mailto|xmpp)$/i,bU=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function wU(e){const t=EU(e),n=kU(e);return CU(t.runSync(t.parse(n),n),e)}function EU(e){const t=e.rehypePlugins||yU,n=e.remarkPlugins||yU,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...AU}:AU;return uU().use(uz).use(n).use(Uz,r).use(t)}function kU(e){const t=e.children||"",n=new rU;return"string"==typeof t&&(n.value=t),n}function CU(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,a=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||_U;for(const e of bU)Object.hasOwn(t,e.from)&&rH((e.from,e.to&&e.to,e.id));return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:"root"===e.type?e.children:[e]}),Iz(e,function(e,t,i){if("raw"===e.type&&i&&"number"==typeof t)return a?i.children.splice(t,1):i.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in fq)if(Object.hasOwn(fq,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=fq[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=l(String(n||""),t,e))}}if("element"===e.type){let a=n?!n.includes(e.tagName):!!o&&o.includes(e.tagName);if(!a&&r&&"number"==typeof t&&(a=!r(e,t,i)),a&&i&&"number"==typeof t)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}),iq(e,{Fragment:yt.Fragment,components:i,ignoreInvalidStyle:!0,jsx:yt.jsx,jsxs:yt.jsxs,passKeys:!0,passNode:!0})}function _U(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return-1===t||-1!==i&&t>i||-1!==n&&t>n||-1!==r&&t>r||vU.test(e.slice(0,t))?e:""}function MU(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}function TU(e,t,n){const r=kz((n||{}).ignore||[]),i=function(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const e=n[r];t.push([SU(e[0]),DU(e[1])])}return t}(t);let o=-1;for(;++o<i.length;)xz(e,"text",a);function a(e,t){let n,a=-1;for(;++a<t.length;){const e=t[a],i=n?n.children:void 0;if(r(e,i?i.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){const n=t[t.length-1],r=i[o][0],a=i[o][1];let s=0;const l=n.children.indexOf(e);let c=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){const n=d.index,i={index:d.index,input:d.input,stack:[...t,e]};let o=a(...d,i);if("string"==typeof o&&(o=o.length>0?{type:"text",value:o}:void 0),!1===o?r.lastIndex=n+1:(s!==n&&u.push({type:"text",value:e.value.slice(s,n)}),Array.isArray(o)?u.push(...o):o&&u.push(o),s=n+d[0].length,c=!0),!r.global)break;d=r.exec(e.value)}c?(s<e.value.length&&u.push({type:"text",value:e.value.slice(s)}),n.children.splice(l,1,...u)):u=[e];return l+u.length}(e,t)}}function SU(e){return"string"==typeof e?new RegExp(function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e),"g"):e}function DU(e){return"function"==typeof e?e:function(){return e}}const xU="phrasing",IU=["autolink","link","image","label"];function LU(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function PU(e){this.config.enter.autolinkProtocol.call(this,e)}function OU(e){this.config.exit.autolinkProtocol.call(this,e)}function RU(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function BU(e){this.config.exit.autolinkEmail.call(this,e)}function YU(e){this.exit(e)}function NU(e){TU(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,VU],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,FU]],{ignore:["link","linkReference"]})}function VU(e,t,n,r,i){let o="";if(!jU(i))return!1;if(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!function(e){const t=e.split(".");if(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))return!1;return!0}(n))return!1;const a=function(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=MU(e,"(");let o=MU(e,")");for(;-1!==r&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:o+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function FU(e,t,n,r){return!(!jU(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function jU(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||Fq(n)||Vq(n))&&(!t||47!==n)}function HU(){this.buffer()}function qU(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function GU(){this.buffer()}function zU(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function UU(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=dG(this.sliceSerialize(e)).toLowerCase(),n.label=t}function WU(e){this.exit(e)}function QU(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=dG(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ZU(e){this.exit(e)}function JU(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const a=n.enter("footnoteReference"),s=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),s(),a(),o+=i.move("]"),o}function KU(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:function(e,n,r,i){const o=r.createTracker(i);let a=o.move("[^");const s=r.enter("footnoteDefinition"),l=r.enter("label");a+=o.move(r.safe(r.associationId(e),{before:a,after:"]"})),l(),a+=o.move("]:"),e.children&&e.children.length>0&&(o.shift(4),a+=o.move((t?"\n":" ")+r.indentLines(r.containerFlow(e,o.current()),t?$U:XU)));return s(),a},footnoteReference:JU},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}}function XU(e,t,n){return 0===t?e:$U(e,t,n)}function $U(e,t,n){return(n?"":" ")+e}JU.peek=function(){return"["};const eW=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function tW(e){this.enter({type:"delete",children:[]},e)}function nW(e){this.exit(e)}function rW(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),o(),a}function iW(e){return e.length}function oW(e){return null==e?"":String(e)}function aW(e){const t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:82===t||114===t?114:0}function sW(e,t,n){return">"+(n?"":" ")+e}function lW(e,t){return cW(e,t.inConstruct,!0)&&!cW(e,t.notInConstruct,!1)}function cW(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function uW(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if("\n"===n.unsafe[i].character&&lW(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return"\\\n"}function dW(e,t,n){return(n?"":" ")+e}function pW(e){const t=e.options.quote||'"';if('"'!==t&&"'"!==t)throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function hW(e){return"&#x"+e.toString(16).toUpperCase()+";"}function fW(e,t,n){const r=BG(e),i=BG(t);return void 0===r?void 0===i?"_"===n?{inside:!0,outside:!0}:{inside:!1,outside:!1}:1===i?{inside:!0,outside:!0}:{inside:!1,outside:!0}:1===r?void 0===i?{inside:!1,outside:!1}:1===i?{inside:!0,outside:!0}:{inside:!1,outside:!1}:void 0===i?{inside:!1,outside:!1}:1===i?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function mW(e,t,n,r){const i=function(e){const t=e.options.emphasis||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}(n),o=n.enter("emphasis"),a=n.createTracker(r),s=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const c=l.charCodeAt(0),u=fW(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=hW(c)+l.slice(1));const d=l.charCodeAt(l.length-1),p=fW(r.after.charCodeAt(0),d,i);p.inside&&(l=l.slice(0,-1)+hW(d));const h=a.move(i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:u.outside},s+l+h}function gW(e){return e.value||""}function yW(e,t,n,r){const i=pW(n),o='"'===i?"Quote":"Apostrophe",a=n.enter("image");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),c+=l.move(")"),a(),c}function AW(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const c=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,o(),"full"!==i&&c&&c===d?"shortcut"===i?l=l.slice(0,-1):l+=s.move("]"):l+=s.move(d+"]"),l}function vW(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const e=n.unsafe[o],t=n.compilePattern(e);let i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;10===r.charCodeAt(e)&&13===r.charCodeAt(e-1)&&e--,r=r.slice(0,e)+" "+r.slice(i.index+1)}}return i+r+i}function bW(e,t){const n=gq(e);return Boolean(!t.options.resourceLink&&e.url&&!e.title&&e.children&&1===e.children.length&&"text"===e.children[0].type&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}function wW(e,t,n,r){const i=pW(n),o='"'===i?"Quote":"Apostrophe",a=n.createTracker(r);let s,l;if(bW(e,n)){const t=n.stack;n.stack=[],s=n.enter("autolink");let r=a.move("<");return r+=a.move(n.containerPhrasing(e,{before:r,after:">",...a.current()})),r+=a.move(">"),s(),n.stack=t,r}s=n.enter("link"),l=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${o}`),c+=a.move(" "+i),c+=a.move(n.safe(e.title,{before:c,after:i,...a.current()})),c+=a.move(i),l()),c+=a.move(")"),s(),c}function EW(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,o(),"full"!==i&&c&&c===d?"shortcut"===i?l=l.slice(0,-1):l+=s.move("]"):l+=s.move(d+"]"),l}function kW(e){const t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function CW(e){const t=e.options.rule||"*";if("*"!==t&&"-"!==t&&"_"!==t)throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}rW.peek=function(){return"~"},mW.peek=function(e,t,n){return n.options.emphasis||"*"},gW.peek=function(){return"<"},yW.peek=function(){return"!"},AW.peek=function(){return"!"},vW.peek=function(){return"`"},wW.peek=function(e,t,n){return bW(e,n)?"<":"["},EW.peek=function(){return"["};const _W=kz(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function MW(e,t,n,r){const i=function(e){const t=e.options.strong||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}(n),o=n.enter("strong"),a=n.createTracker(r),s=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const c=l.charCodeAt(0),u=fW(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=hW(c)+l.slice(1));const d=l.charCodeAt(l.length-1),p=fW(r.after.charCodeAt(0),d,i);p.inside&&(l=l.slice(0,-1)+hW(d));const h=a.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:u.outside},s+l+h}MW.peek=function(e,t,n){return n.options.strong||"*"};const TW={blockquote:function(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const a=n.indentLines(n.containerFlow(e,o.current()),sW);return i(),a},break:uW,code:function(e,t,n,r){const i=function(e){const t=e.options.fence||"`";if("`"!==t&&"~"!==t)throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}(n),o=e.value||"",a="`"===i?"GraveAccent":"Tilde";if(function(e,t){return Boolean(!1===t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}(e,n)){const e=n.enter("codeIndented"),t=n.indentLines(o,dW);return e(),t}const s=n.createTracker(r),l=i.repeat(Math.max(function(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,a=0;if("string"!=typeof t)throw new TypeError("Expected substring");for(;-1!==r;)r===i?++o>a&&(a=o):o=1,i=r+t.length,r=n.indexOf(t,i);return a}(o,i)+1,3)),c=n.enter("codeFenced");let u=s.move(l);if(e.lang){const t=n.enter(`codeFencedLang${a}`);u+=s.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){const t=n.enter(`codeFencedMeta${a}`);u+=s.move(" "),u+=s.move(n.safe(e.meta,{before:u,after:"\n",encode:["`"],...s.current()})),t()}return u+=s.move("\n"),o&&(u+=s.move(o+"\n")),u+=s.move(l),c(),u},definition:function(e,t,n,r){const i=pW(n),o='"'===i?"Quote":"Apostrophe",a=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":"\n",...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),a(),c},emphasis:mW,hardBreak:uW,heading:function(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(function(e,t){let n=!1;return Iz(e,function(e){if("value"in e&&/\r?\n|\r/.test(e.value)||"break"===e.type)return n=!0,Dz}),Boolean((!e.depth||e.depth<3)&&gq(e)&&(t.options.setext||n))}(e,n)){const t=n.enter("headingSetext"),r=n.enter("phrasing"),a=n.containerPhrasing(e,{...o.current(),before:"\n",after:"\n"});return r(),t(),a+"\n"+(1===i?"=":"-").repeat(a.length-(Math.max(a.lastIndexOf("\r"),a.lastIndexOf("\n"))+1))}const a="#".repeat(i),s=n.enter("headingAtx"),l=n.enter("phrasing");o.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:"\n",...o.current()});return/^[\t ]/.test(c)&&(c=hW(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),s(),c},html:gW,image:yW,imageReference:AW,inlineCode:vW,link:wW,linkReference:EW,list:function(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?function(e){const t=e.options.bulletOrdered||".";if("."!==t&&")"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}(n):kW(n);const s=e.ordered?"."===a?")":".":function(e){const t=kW(e),n=e.options.bulletOther;if(!n)return"*"===t?"-":"*";if("*"!==n&&"+"!==n&&"-"!==n)throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}(n);let l=!(!t||!n.bulletLastUsed)&&a===n.bulletLastUsed;if(!e.ordered){const t=e.children?e.children[0]:void 0;if("*"!==a&&"-"!==a||!t||t.children&&t.children[0]||"list"!==n.stack[n.stack.length-1]||"listItem"!==n.stack[n.stack.length-2]||"list"!==n.stack[n.stack.length-3]||"listItem"!==n.stack[n.stack.length-4]||0!==n.indexStack[n.indexStack.length-1]||0!==n.indexStack[n.indexStack.length-2]||0!==n.indexStack[n.indexStack.length-3]||(l=!0),CW(n)===a&&t){let t=-1;for(;++t<e.children.length;){const n=e.children[t];if(n&&"listItem"===n.type&&n.children&&n.children[0]&&"thematicBreak"===n.children[0].type){l=!0;break}}}}l&&(a=s),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=o,i(),c},listItem:function(e,t,n,r){const i=function(e){const t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n);let o=n.bulletCurrent||kW(n);t&&"list"===t.type&&t.ordered&&(o=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+o);let a=o.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(a=4*Math.ceil(a/4));const s=n.createTracker(r);s.move(o+" ".repeat(a-o.length)),s.shift(a);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),function(e,t,n){if(t)return(n?"":" ".repeat(a))+e;return(n?o:o+" ".repeat(a-o.length))+e});return l(),c},paragraph:function(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),a=n.containerPhrasing(e,r);return o(),i(),a},root:function(e,t,n,r){const i=e.children.some(function(e){return _W(e)});return(i?n.containerPhrasing:n.containerFlow).call(n,e,r)},strong:MW,text:function(e,t,n,r){return n.safe(e.value,r)},thematicBreak:function(e,t,n){const r=(CW(n)+(n.options.ruleSpaces?" ":"")).repeat(function(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}(n));return n.options.ruleSpaces?r.slice(0,-1):r}};function SW(e){const t=e._align;this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function DW(e){this.exit(e),this.data.inTable=void 0}function xW(e){this.enter({type:"tableRow",children:[]},e)}function IW(e){this.exit(e)}function LW(e){this.enter({type:"tableCell",children:[]},e)}function PW(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,OW));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function OW(e,t){return"|"===t?t:e}function RW(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=TW.inlineCode(e,t,n);n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&"));return r},table:function(e,t,n,r){return s(function(e,t,n){const r=e.children;let i=-1;const o=[],a=t.enter("table");for(;++i<r.length;)o[i]=l(r[i],t,n);return a(),o}(e,n,r),e.align)},tableCell:a,tableRow:function(e,t,n,r){const i=l(e,n,r),o=s([i]);return o.slice(0,o.indexOf("\n"))}}};function a(e,t,n,r){const i=n.enter("tableCell"),a=n.enter("phrasing"),s=n.containerPhrasing(e,{...r,before:o,after:o});return a(),i(),s}function s(e,t){return function(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||iW,o=[],a=[],s=[],l=[];let c=0,u=-1;for(;++u<e.length;){const t=[],r=[];let o=-1;for(e[u].length>c&&(c=e[u].length);++o<e[u].length;){const a=oW(e[u][o]);if(!1!==n.alignDelimiters){const e=i(a);r[o]=e,(void 0===l[o]||e>l[o])&&(l[o]=e)}t.push(a)}a[u]=t,s[u]=r}let d=-1;if("object"==typeof r&&"length"in r)for(;++d<c;)o[d]=aW(r[d]);else{const e=aW(r);for(;++d<c;)o[d]=e}d=-1;const p=[],h=[];for(;++d<c;){const e=o[d];let t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let i=!1===n.alignDelimiters?1:Math.max(1,l[d]-t.length-r.length);const a=t+"-".repeat(i)+r;!1!==n.alignDelimiters&&(i=t.length+i+r.length,i>l[d]&&(l[d]=i),h[d]=i),p[d]=a}a.splice(1,0,p),s.splice(1,0,h),u=-1;const f=[];for(;++u<a.length;){const e=a[u],t=s[u];d=-1;const r=[];for(;++d<c;){const i=e[d]||"";let a="",s="";if(!1!==n.alignDelimiters){const e=l[d]-(t[d]||0),n=o[d];114===n?a=" ".repeat(e):99===n?e%2?(a=" ".repeat(e/2+.5),s=" ".repeat(e/2-.5)):(a=" ".repeat(e/2),s=a):s=" ".repeat(e)}!1===n.delimiterStart||d||r.push("|"),!1===n.padding||!1===n.alignDelimiters&&""===i||!1===n.delimiterStart&&!d||r.push(" "),!1!==n.alignDelimiters&&r.push(a),r.push(i),!1!==n.alignDelimiters&&r.push(s),!1!==n.padding&&r.push(" "),!1===n.delimiterEnd&&d===c-1||r.push("|")}f.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return f.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function l(e,t,n){const r=e.children;let i=-1;const o=[],s=t.enter("tableRow");for(;++i<r.length;)o[i]=a(r[i],0,t,n);return s(),o}}function BW(e){const t=this.stack[this.stack.length-2];t.type,t.checked="taskListCheckValueChecked"===e.type}function YW(e){const t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){const e=this.stack[this.stack.length-1];e.type;const n=e.children[0];if(n&&"text"===n.type){const r=t.children;let i,o=-1;for(;++o<r.length;){const e=r[o];if("paragraph"===e.type){i=e;break}}i===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function NW(e,t,n,r){const i=e.children[0],o="boolean"==typeof e.checked&&i&&"paragraph"===i.type,a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);o&&s.move(a);let l=TW.listItem(e,t,n,{...r,...s.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+a})),l}const VW={tokenize:function(e,t,n){let r=0;return function t(o){if((87===o||119===o)&&r<3)return r++,e.consume(o),t;if(46===o&&3===r)return e.consume(o),i;return n(o)};function i(e){return null===e?n(e):t(e)}},partial:!0},FW={tokenize:function(e,t,n){let r,i,o;return a;function a(t){return 46===t||95===t?e.check(HW,l,s)(t):null===t||Yq(t)||Fq(t)||45!==t&&Vq(t)?l(t):(o=!0,e.consume(t),a)}function s(t){return 95===t?r=!0:(i=r,r=void 0),e.consume(t),a}function l(e){return i||r||!o?n(e):t(e)}},partial:!0},jW={tokenize:function(e,t){let n=0,r=0;return i;function i(a){return 40===a?(n++,e.consume(a),i):41===a&&r<n?o(a):33===a||34===a||38===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||60===a||63===a||93===a||95===a||126===a?e.check(HW,t,o)(a):null===a||Yq(a)||Fq(a)?t(a):(e.consume(a),i)}function o(t){return 41===t&&r++,e.consume(t),i}},partial:!0},HW={tokenize:function(e,t,n){return r;function r(a){return 33===a||34===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||63===a||95===a||126===a?(e.consume(a),r):38===a?(e.consume(a),o):93===a?(e.consume(a),i):60===a||null===a||Yq(a)||Fq(a)?t(a):n(a)}function i(e){return null===e||40===e||91===e||Yq(e)||Fq(e)?t(e):r(e)}function o(e){return Dq(e)?a(e):n(e)}function a(t){return 59===t?(e.consume(t),r):Dq(t)?(e.consume(t),a):n(t)}},partial:!0},qW={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return xq(e)?n(e):t(e)}},partial:!0},GW={name:"wwwAutolink",tokenize:function(e,t,n){const r=this;return function(t){if(87!==t&&119!==t||!ZW.call(r,r.previous)||$W(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(VW,e.attempt(FW,e.attempt(jW,i),n),n)(t)};function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:ZW},zW={name:"protocolAutolink",tokenize:function(e,t,n){const r=this;let i="",o=!1;return function(t){if((72===t||104===t)&&JW.call(r,r.previous)&&!$W(r.events))return e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(t),e.consume(t),a;return n(t)};function a(t){if(Dq(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),a;if(58===t){const n=i.toLowerCase();if("http"===n||"https"===n)return e.consume(t),s}return n(t)}function s(t){return 47===t?(e.consume(t),o?l:(o=!0,s)):n(t)}function l(t){return null===t||Lq(t)||Yq(t)||Fq(t)||Vq(t)?n(t):e.attempt(FW,e.attempt(jW,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:JW},UW={name:"emailAutolink",tokenize:function(e,t,n){const r=this;let i,o;return function(t){if(!XW(t)||!KW.call(r,r.previous)||$W(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(t)};function a(t){return XW(t)?(e.consume(t),a):64===t?(e.consume(t),s):n(t)}function s(t){return 46===t?e.check(qW,c,l)(t):45===t||95===t||xq(t)?(o=!0,e.consume(t),s):c(t)}function l(t){return e.consume(t),i=!0,s}function c(a){return o&&i&&Dq(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(a)):n(a)}},previous:KW},WW={};let QW=48;for(;QW<123;)WW[QW]=UW,QW++,58===QW?QW=65:91===QW&&(QW=97);function ZW(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||Yq(e)}function JW(e){return!Dq(e)}function KW(e){return!(47===e||XW(e))}function XW(e){return 43===e||45===e||46===e||95===e||xq(e)}function $W(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}WW[43]=UW,WW[45]=UW,WW[46]=UW,WW[95]=UW,WW[72]=[UW,zW],WW[104]=[UW,zW],WW[87]=[UW,GW],WW[119]=[UW,GW];const eQ={tokenize:function(e,t,n){const r=this;return Hq(e,function(e){const i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function tQ(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const e=r.events[i][1];if("labelImage"===e.type){a=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(i){if(!a||!a._balanced)return n(i);const s=dG(r.sliceSerialize({start:a.end,end:r.now()}));if(94!==s.codePointAt(0)||!o.includes(s.slice(1)))return n(i);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(i),e.exit("gfmFootnoteCallLabelMarker"),t(i)}}function nQ(e,t){let n,r=e.length;for(;r--;)if("labelImage"===e[r][1].type&&"enter"===e[r][0]){n=e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[r+1],e[r+2],["enter",i,t],e[r+3],e[r+4],["enter",o,t],["exit",o,t],["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(r,e.length-r+1,...l),e}function rQ(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(s){if(a>999||93===s&&!o||null===s||91===s||Yq(s))return n(s);if(93===s){e.exit("chunkString");const o=e.exit("gfmFootnoteCallString");return i.includes(dG(r.sliceSerialize(o)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return Yq(s)||(o=!0),a++,e.consume(s),92===s?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),a++,l):l(t)}}function iQ(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a,s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(s>999||93===t&&!a||null===t||91===t||Yq(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return o=dG(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return Yq(t)||(a=!0),s++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i.includes(o)||i.push(o),Hq(e,p,"gfmFootnoteDefinitionWhitespace")):n(t)}function p(e){return t(e)}}function oQ(e,t,n){return e.check(Uq,t,e.attempt(eQ,t,n))}function aQ(e){e.exit("gfmFootnoteDefinition")}function sQ(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:function(e,n,r){const i=this.previous,o=this.events;let a=0;return function(t){if(126===i&&"characterEscape"!==o[o.length-1][1].type)return r(t);return e.enter("strikethroughSequenceTemporary"),s(t)};function s(o){const l=BG(i);if(126===o)return a>1?r(o):(e.consume(o),a++,s);if(a<2&&!t)return r(o);const c=e.exit("strikethroughSequenceTemporary"),u=BG(o);return c._open=!u||2===u&&Boolean(l),c._close=!l||2===l&&Boolean(u),n(o)}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";const i={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},o={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},a=[["enter",i,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",o,t]],s=t.parser.constructs.insideSpan.null;s&&vq(a,a.length,0,xG(s,e.slice(r+1,n),t)),vq(a,a.length,0,[["exit",o,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",i,t]]),vq(e,r-1,n-r+3,a),n=r+a.length-2;break}}n=-1;for(;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}};return null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}}class lQ{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let i=0;if(0===n&&0===r.length)return;for(;i<e.map.length;){if(e.map[i][0]===t)return e.map[i][1]+=n,void e.map[i][2].push(...r);i+=1}e.map.push([t,n,r])}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(const t of r)e.push(t);r=n.pop()}this.map.length=0}}function cQ(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if("enter"===i[0])"tableContent"===i[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===i[1].type){if("tableDelimiterMarker"===e[t-1][1].type){const e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===i[1].type)break}else"enter"===i[0]&&"tableDelimiterRow"===i[1].type&&(n=!0);t+=1}return r}function uQ(e,t,n){const r=this;let i,o=0,a=0;return function(e){let t=r.events.length-1;for(;t>-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const i=t>-1?r.events[t][1].type:null,o="tableHead"===i||"tableRow"===i?b:s;if(o===b&&r.parser.lazy[r.now().line])return n(e);return o(e)};function s(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){if(124===e)return l(e);return i=!0,a+=1,l(e)}(t)}function l(t){return null===t?n(t):Bq(t)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):Nq(t)?Hq(e,l,"whitespace")(t):(a+=1,i&&(i=!1,o+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),i=!0,l):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||Yq(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function d(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),i=!1,Nq(t)?Hq(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):p(t))}function p(t){return 45===t||58===t?f(t):124===t?(i=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),h):v(t)}function h(t){return Nq(t)?Hq(e,f,"whitespace")(t):f(t)}function f(t){return 58===t?(a+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):45===t?(a+=1,m(t)):null===t||Bq(t)?A(t):v(t)}function m(t){return 45===t?(e.enter("tableDelimiterFiller"),g(t)):v(t)}function g(t){return 45===t?(e.consume(t),g):58===t?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(t))}function y(t){return Nq(t)?Hq(e,A,"whitespace")(t):A(t)}function A(n){return 124===n?p(n):(null===n||Bq(n))&&i&&o===a?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):v(n)}function v(e){return n(e)}function b(t){return e.enter("tableRow"),w(t)}function w(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),w):null===n||Bq(n)?(e.exit("tableRow"),t(n)):Nq(n)?Hq(e,w,"whitespace")(n):(e.enter("data"),E(n))}function E(t){return null===t||124===t||Yq(t)?(e.exit("data"),w(t)):(e.consume(t),92===t?k:E)}function k(t){return 92===t||124===t?(e.consume(t),E):E(t)}}function dQ(e,t){let n,r,i,o=-1,a=!0,s=0,l=[0,0,0,0],c=[0,0,0,0],u=!1,d=0;const p=new lQ;for(;++o<e.length;){const h=e[o],f=h[1];"enter"===h[0]?"tableHead"===f.type?(u=!1,0!==d&&(hQ(p,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(o,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(a=!0,i=void 0,l=[0,0,0,0],c=[0,o+1,0,0],u&&(u=!1,r={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(o,0,[["enter",r,t]])),s="tableDelimiterRow"===f.type?2:r?3:1):!s||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type?"tableCellDivider"===f.type&&(a?a=!1:(0!==l[1]&&(c[0]=c[1],i=pQ(p,t,l,s,void 0,i)),l=c,c=[l[1],o,0,0])):(a=!1,0===c[2]&&(0!==l[1]&&(c[0]=c[1],i=pQ(p,t,l,s,void 0,i),l=[0,0,0,0]),c[2]=o)):"tableHead"===f.type?(u=!0,d=o):"tableRow"===f.type||"tableDelimiterRow"===f.type?(d=o,0!==l[1]?(c[0]=c[1],i=pQ(p,t,l,s,o,i)):0!==c[1]&&(i=pQ(p,t,c,s,o,i)),s=0):!s||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type||(c[3]=o)}for(0!==d&&hQ(p,t,d,n,r),p.consume(t.events),o=-1;++o<t.events.length;){const e=t.events[o];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=cQ(t.events,o))}return e}function pQ(e,t,n,r,i,o){const a=1===r?"tableHeader":2===r?"tableDelimiter":"tableData";0!==n[0]&&(o.end=Object.assign({},fQ(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const s=fQ(t.events,n[1]);if(o={type:a,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[["enter",o,t]]),0!==n[2]){const i=fQ(t.events,n[2]),o=fQ(t.events,n[3]),a={type:"tableContent",start:Object.assign({},i),end:Object.assign({},o)};if(e.add(n[2],0,[["enter",a,t]]),2!==r){const r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",a,t]])}return void 0!==i&&(o.end=Object.assign({},fQ(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function hQ(e,t,n,r,i){const o=[],a=fQ(t.events,n);i&&(i.end=Object.assign({},a),o.push(["exit",i,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function fQ(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const mQ={name:"tasklistCheck",tokenize:function(e,t,n){const r=this;return function(t){if(null!==r.previous||!r._gfmTasklistFirstContentOfListItem)return n(t);return e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i};function i(t){return Yq(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),o):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),o):n(t)}function o(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(t)}function a(r){return Bq(r)?t(r):Nq(r)?e.check({tokenize:gQ},t,n)(r):n(r)}}};function gQ(e,t,n){return Hq(e,function(e){return null===e?n(e):t(e)},"whitespace")}const yQ={};function AQ(e){const t=e||yQ,n=this.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),i=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),o=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(function(e){return Mq([{text:WW},{document:{91:{name:"gfmFootnoteDefinition",tokenize:iQ,continuation:{tokenize:oQ},exit:aQ}},text:{91:{name:"gfmFootnoteCall",tokenize:rQ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:tQ,resolveTo:nQ}}},sQ(e),{flow:{null:{name:"table",tokenize:uQ,resolveAll:dQ}}},{text:{91:mQ}}])}(t)),i.push([{transforms:[NU],enter:{literalAutolink:LU,literalAutolinkEmail:PU,literalAutolinkHttp:PU,literalAutolinkWww:PU},exit:{literalAutolink:YU,literalAutolinkEmail:BU,literalAutolinkHttp:OU,literalAutolinkWww:RU}},{enter:{gfmFootnoteCallString:HU,gfmFootnoteCall:qU,gfmFootnoteDefinitionLabelString:GU,gfmFootnoteDefinition:zU},exit:{gfmFootnoteCallString:UU,gfmFootnoteCall:WU,gfmFootnoteDefinitionLabelString:QU,gfmFootnoteDefinition:ZU}},{canContainEols:["delete"],enter:{strikethrough:tW},exit:{strikethrough:nW}},{enter:{table:SW,tableData:LW,tableHeader:LW,tableRow:xW},exit:{codeText:PW,table:DW,tableData:IW,tableHeader:IW,tableRow:IW}},{exit:{taskListCheckValueChecked:BW,taskListCheckValueUnchecked:BW,paragraph:YW}}]),o.push(function(e){return{extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:xU,notInConstruct:IU},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:xU,notInConstruct:IU},{character:":",before:"[ps]",after:"\\/",inConstruct:xU,notInConstruct:IU}]},KU(e),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:eW}],handlers:{delete:rW}},RW(e),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:NW}}]}}(t))}function vQ(){return vQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vQ.apply(null,arguments)}const bQ=Ye.div(({theme:e})=>({height:"100%",width:"100%",backgroundColor:e.white,display:"flex",flex:"1 0 0",flexDirection:"column",justifyContent:"space-between",alignItems:"center",padding:20,overflowY:"auto",overscrollBehavior:"contain"})),wQ=Ye.div(({theme:e})=>({":focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:8},".webchat-privacy-notice-markdown-container > p":{margin:0,whiteSpace:"pre-wrap"}})),EQ=Ye.div({display:"flex",alignItems:"center",flexDirection:"column",gap:16}),kQ=Ye(dj)(()=>({width:303})),CQ=e=>{const{privacyNotice:t,onAcceptTerms:n,isHomeScreenEnabled:i}=e,{text:o,submitButtonText:a,urlText:s,url:l}=t,c=(0,r.useMemo)(()=>Ex(o),[o]);return r.createElement(bQ,{className:"webchat-privacy-notice-root"},r.createElement(wQ,{className:"webchat-privacy-notice-message"},r.createElement(mm,{variant:"body-regular",style:{whiteSpace:"pre-wrap"}},r.createElement(wU,{components:{a:({node:e,...t})=>r.createElement("a",vQ({},t,{target:"_blank",rel:"noreferrer"}))},remarkPlugins:[AQ],className:"webchat-privacy-notice-markdown-container"},c))),r.createElement(EQ,{className:"webchat-privacy-notice-actions"},r.createElement(kQ,{className:"webchat-privacy-notice-accept-button",onClick:n},a),r.createElement(tH,{url:l||"https://www.cognigy.com/",target:"_blank",className:"webchat-privacy-policy-link",text:s||"Privacy policy"})))};var _Q,MQ=["title","titleId"];function TQ(){return TQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TQ.apply(null,arguments)}const SQ=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,MQ);return r.createElement("svg",TQ({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none","aria-hidden":"true",viewBox:"0 0 16 16","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,_Q||(_Q=r.createElement("path",{fill:"#1A1A1A",d:"M3.77 1v9.263l4.653 4.452a.981.981 0 0 0 1.154.17.93.93 0 0 0 .421-.42.8.8 0 0 0 .057-.566l-.861-3.636h5.36q.57 0 1.008-.422.438-.423.438-.973V7.62q0-.122-.032-.26a3 3 0 0 0-.073-.26l-2.292-5.22a1.5 1.5 0 0 0-.577-.626A1.56 1.56 0 0 0 12.182 1zm1.2 8.77V2.158h7.215q.084 0 .173.044a.3.3 0 0 1 .134.149L14.8 7.56v1.307q0 .104-.07.17a.25.25 0 0 1-.176.067H7.677l1.003 4.231zM1.445 1Q.85 1 .425 1.41A1.32 1.32 0 0 0 0 2.395v6.473q0 .575.425.985.424.41 1.021.41H3.77V9.105H1.446a.24.24 0 0 1-.177-.067.23.23 0 0 1-.069-.17V2.395q0-.104.07-.17a.24.24 0 0 1 .176-.067H3.77V1z"})))};var DQ,xQ=["title","titleId"];function IQ(){return IQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},IQ.apply(null,arguments)}const LQ=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,xQ);return r.createElement("svg",IQ({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none","aria-hidden":"true",viewBox:"0 0 16 16","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,DQ||(DQ=r.createElement("path",{fill:"#1A1A1A",d:"M3.77 15V5.737l4.653-4.452a.982.982 0 0 1 1.154-.17q.288.148.421.42a.8.8 0 0 1 .057.566l-.861 3.636h5.36q.57 0 1.008.422.438.423.438.973V8.38q0 .122-.032.26a3 3 0 0 1-.073.26l-2.292 5.22a1.5 1.5 0 0 1-.577.626 1.56 1.56 0 0 1-.844.255zm1.2-8.77v7.612h7.215a.4.4 0 0 0 .173-.044.3.3 0 0 0 .134-.149L14.8 8.44V7.132a.23.23 0 0 0-.07-.17.25.25 0 0 0-.176-.067H7.677L8.68 2.664zM1.445 15q-.597 0-1.021-.41A1.32 1.32 0 0 1 0 13.605V7.132q0-.575.425-.985.424-.41 1.021-.41H3.77v1.158H1.446a.24.24 0 0 0-.177.067.23.23 0 0 0-.069.17v6.473q0 .104.07.17a.24.24 0 0 0 .176.067H3.77V15z"})))};function PQ(){return PQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PQ.apply(null,arguments)}const OQ=Ye.div(({theme:e,disabled:t})=>({borderRadius:10,border:`1px solid var(--basics-black-60, ${e.black60})`,background:`var(--Basics-white, ${e.white})`,width:"100%",padding:12,"&:focus-within":{borderColor:"transparent",outline:`2px solid ${e.primaryColorFocus}`},borderColor:t?e.black80:e.black60})),RQ=Ye.textarea(({theme:e})=>({padding:"0 12px 0 0",width:"100%",height:"100%",border:"none",resize:"none",color:e.black10,fontFamily:"Figtree",fontSize:"0.875rem",fontWeight:400,lineHeight:"140%","&:focus":{outline:"none"},"&:disabled":{color:e.black60},"::-webkit-scrollbar":{width:2,height:2},"::-webkit-scrollbar-track":{backgroundColor:e.black95},"::-webkit-scrollbar-thumb":{backgroundColor:e.black60}})),BQ=Ye.div({position:"relative",display:"flex",flexDirection:"column",flexGrow:1}),YQ=(0,r.forwardRef)((e,t)=>{const{className:n,dataTest:i,label:o,isVisible:a,inputId:s,...l}=e,{disabled:c}=e;return r.createElement(OQ,{disabled:c},r.createElement(ON(),{maxWidth:575},e=>r.createElement(BQ,{className:`${n}-container`},r.createElement(VN,{inputId:s,isVisible:a,label:o,className:`${n}-label`,disabled:c}),r.createElement(RQ,PQ({},l,{id:s,"data-test":i,ref:t,className:`${n} ${c?"disabled":""}`.trim(),style:e?{fontSize:"1rem"}:void 0})))))});YQ.displayName="MultilineInput";const NQ=YQ,VQ=Ye.div({width:"100%",display:"flex",flexDirection:"column",padding:"20px 0",gap:24}),FQ=Ye.div({width:"100%",display:"flex",alignItems:"flex-start",gap:8}),jQ=Ye(LO)(({theme:e,selected:t})=>({background:t?e.primaryColor:e.black95,display:"flex",padding:"12px 16px",justifyContent:"center",alignItems:"center",gap:16,borderRadius:15,svg:{width:16,height:16},"&: focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2}})),HQ=Ye(LQ)(({theme:e,selected:t})=>({path:{fill:t?e.primaryContrastColor:e.black10}})),qQ=Ye(SQ)(({theme:e,selected:t})=>({path:{fill:t?e.primaryContrastColor:e.black10}})),GQ=Ye.div({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:16,alignSelf:"stretch"}),zQ=Ye(dj)(({theme:e})=>({width:"100%","&:disabled":{opacity:1},"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2}})),UQ=e=>{const{ratingTitleText:t,ratingCommentText:n,showRatingStatus:i,buttonText:o,ratingEventBannerText:a,onSendRating:s}=e,[l,c]=(0,r.useState)(null),[u,d]=(0,r.useState)(""),p=(0,r.useRef)(null),h=-1!==l&&1!==l,f=XB(e=>e.config.settings.customTranslations?.ariaLabels);return r.createElement(VQ,{className:"webchat-rating-widget-root"},r.createElement(mm,{variant:"title1-semibold",className:"webchat-rating-widget-title",margin:0},t),r.createElement(FQ,{className:"webchat-rating-widget-content-container"},r.createElement(jQ,{onClick:()=>c(1===l?null:1),className:"webchat-rating-widget-thumbs-up-button","aria-pressed":1===l,"aria-label":f?.thumbsUp??"Like",selected:1===l},r.createElement(HQ,{selected:1===l})),r.createElement(jQ,{onClick:()=>c(-1===l?null:-1),className:"webchat-rating-widget-thumbs-down-button","aria-pressed":-1===l,"aria-label":f?.thumbsDown??"Dislike",selected:-1===l},r.createElement(qQ,{selected:-1===l}))),r.createElement(GQ,null,r.createElement(NQ,{dataTest:"rating-input",value:u,disabled:null===l,onChange:e=>d(e.target.value),className:"webchat-rating-widget-comment-input-field",rows:4,ref:p,inputId:"webchatRatingInput",isVisible:!u,label:n}),r.createElement(zQ,{className:"webchat-rating-widget-send-button "+(h?"disabled":"active"),disabled:h,onClick:()=>{s({rating:l,comment:u,showRatingStatus:i}),setTimeout(()=>QR(a||"Your feedback was submitted"),500),c(null),d("")}},o||"Send feedback")))},WQ=Ye.div({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:24,alignSelf:"stretch",padding:"20px 0"}),QQ=Ye.div({display:"flex",width:"295px",flexDirection:"row",flexWrap:"wrap",alignItems:"flex-end",alignContent:"flex-end",gap:8}),ZQ=e=>{const{config:t,onSendActionButtonMessage:n,onEmitAnalytics:i}=e,{settings:o}=t,{chatOptions:a}=o,s=a?.quickReplyOptions.quickReplies;return r.createElement(WQ,{className:"webchat-chat-options-action-btns-root"},r.createElement(mm,{variant:"title1-semibold",margin:0,className:"webchat-chat-options-action-btns-title"},a?.quickReplyOptions?.sectionTitle||"People are also interested in"),r.createElement(QQ,{className:"webchat-chat-options-action-btns-wrapper"},r.createElement(xm,{showUrlIcon:!0,buttonClassName:"webchat-chat-options-action-button",containerClassName:"webchat-chat-options-action-button-container",payload:s,config:t,action:n,onEmitAnalytics:i})))},JQ=Ye.div(({theme:e})=>({alignItems:" center",justifyContent:"center",padding:"12px 0px",gap:24,width:"100%",display:"flex",backgroundColor:e.white,borderTop:`1px solid var(--basics-black-80, ${e.black80})`})),KQ=Ye.a(({theme:e})=>({textDecoration:"none",color:e.black10,"&:focus, &:hover":{outline:"none",color:e.primaryColor},"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2}})),XQ=Ye(mm)({lineHeight:"19.6px",wordWrap:"break-word",margin:0}),$Q=e=>{const{settings:t}=e,{chatOptions:n,customTranslations:i}=t,o=n?.footer?.items?.[0]?.title||"Imprint",a=n?.footer?.items?.[1]?.title||"Data Privacy",s=n?.footer?.items?.[0]?.url||"https://www.cognigy.com/legal-notice",l=n?.footer?.items?.[1]?.url||"https://www.cognigy.com/privacy-policy",c=i?.ariaLabels?.opensInNewTab||"Opens in new tab";return r.createElement(JQ,{className:"webchat-chat-options-footer"},r.createElement(KQ,{href:s,target:"_blank",id:"footer-text-1","aria-label":`${o}. ${c}`,className:"webchat-chat-options-footer-link"},r.createElement(XQ,{variant:"body-semibold",className:"webchat-chat-options-footer-link-text"},o)),n?.footer?.items?.[1]&&r.createElement(KQ,{href:l,target:"_blank",id:"footer-text-2","aria-label":`${a}. ${c}`},r.createElement(XQ,{variant:"body-semibold"},a)))},eZ=Ye.button(({theme:e,isActive:t,disabled:n})=>({display:"flex",alignItems:"center",padding:1,width:30,height:16,borderRadius:15,border:`1px solid ${e.black80}`,backgroundColor:e.white,cursor:n?"default":"pointer",transition:"background-color 0.2s ease-in-out","&.active":{backgroundColor:n?e.secondaryColorDisabled:e.secondaryColor,"&:hover":{backgroundColor:n?e.secondaryColorDisabled:e.secondaryColorHover}}})),tZ=Ye.div(({theme:e,isActive:t,disabled:n})=>({width:12,height:12,borderRadius:12,backgroundColor:n?e.secondaryColorDisabled:e.secondaryColor,cursor:n?"default":"pointer",transform:t?"translateX(14px)":"translateX(0px)",transition:"transform 0.2s ease-in-out, background-color 0.2s ease-in-out","&:hover":{backgroundColor:n?e.secondaryColorDisabled:e.secondaryColorHover},"&.hovered":{backgroundColor:n?e.secondaryColorDisabled:e.secondaryColorHover},"&.active":{backgroundColor:e.white}})),nZ=e=>{const{onClick:t,isActive:n,className:i,disabled:o}=e,[a,s]=r.useState(!1);return r.createElement(eZ,{className:$R()(i,"webchat-toggle-button-root",n&&"active"),onClick:t,isActive:n,disabled:o,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1)},r.createElement(tZ,{className:$R()("webchat-toggle-button-inner-circle",n&&"active",a&&"hovered"),onClick:t,isActive:n,disabled:o}))},rZ=Ye.div(()=>({alignSelf:"stretch",display:"flex",justifyContent:"space-between",alignItems:"center",height:50})),iZ=e=>{const{config:t,onToggle:n}=e,i=XB(e=>e.ui.ttsActive);return r.createElement(rZ,{className:"webchat-tts-option-root"},r.createElement(mm,{variant:"title1-semibold",margin:0,className:"webchat-chat-options-tts-option-label"},t.settings.chatOptions.labelTTSToggle||"Enable Text-to-Speech"),r.createElement(nZ,{onClick:n,className:"webchat-chat-options-tts-option-toggle",isActive:i}))};function oZ(e,t){return oZ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},oZ(e,t)}function aZ(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,oZ(e,t)}function sZ(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const lZ=!1,cZ=r.createContext(null);var uZ=function(e){return e.scrollTop},dZ="unmounted",pZ="exited",hZ="entering",fZ="entered",mZ="exiting",gZ=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var i,o=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?o?(i=pZ,r.appearStatus=hZ):i=fZ:i=t.unmountOnExit||t.mountOnEnter?dZ:pZ,r.state={status:i},r.nextCallback=null,r}aZ(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===dZ?{status:pZ}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==hZ&&n!==fZ&&(t=hZ):n!==hZ&&n!==fZ||(t=mZ)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===hZ){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:At.findDOMNode(this);n&&uZ(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===pZ&&this.setState({status:dZ})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[At.findDOMNode(this),r],o=i[0],a=i[1],s=this.getTimeouts(),l=r?s.appear:s.enter;!e&&!n||lZ?this.safeSetState({status:fZ},function(){t.props.onEntered(o)}):(this.props.onEnter(o,a),this.safeSetState({status:hZ},function(){t.props.onEntering(o,a),t.onTransitionEnd(l,function(){t.safeSetState({status:fZ},function(){t.props.onEntered(o,a)})})}))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:At.findDOMNode(this);t&&!lZ?(this.props.onExit(r),this.safeSetState({status:mZ},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:pZ},function(){e.props.onExited(r)})})})):this.safeSetState({status:pZ},function(){e.props.onExited(r)})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:At.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],o=i[0],a=i[1];this.props.addEndListener(o,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===dZ)return null;var t=this.props,n=t.children,i=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,j_(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return r.createElement(cZ.Provider,{value:null},"function"==typeof n?n(e,i):r.cloneElement(r.Children.only(n),i))},t}(r.Component);function yZ(){}gZ.contextType=cZ,gZ.propTypes={},gZ.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:yZ,onEntering:yZ,onEntered:yZ,onExit:yZ,onExiting:yZ,onExited:yZ},gZ.UNMOUNTED=dZ,gZ.EXITED=pZ,gZ.ENTERING=hZ,gZ.ENTERED=fZ,gZ.EXITING=mZ;const AZ=gZ;var vZ=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=sZ(n.className,r):n.setAttribute("class",sZ(n.className&&n.className.baseVal||"",r)));var n,r})},bZ=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1];t.removeClasses(i,"exit"),t.addClass(i,o?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1]?"appear":"enter";t.addClass(i,o,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1]?"appear":"enter";t.removeClasses(i,o),t.addClass(i,o,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,r="string"==typeof n,i=r?""+(r&&n?n+"-":"")+e:n[e];return{baseClassName:i,activeClassName:r?i+"-active":n[e+"Active"],doneClassName:r?i+"-done":n[e+"Done"]}},t}aZ(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var r=this.getClassNames(t)[n+"ClassName"],i=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&i&&(r+=" "+i),"active"===n&&e&&uZ(e),r&&(this.appliedClasses[t][n]=r,function(e,t){e&&t&&t.split(" ").forEach(function(t){return r=t,void((n=e).classList?n.classList.add(r):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)));var n,r})}(e,r))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],r=n.base,i=n.active,o=n.done;this.appliedClasses[t]={},r&&vZ(e,r),i&&vZ(e,i),o&&vZ(e,o)},n.render=function(){var e=this.props,t=(e.classNames,j_(e,["classNames"]));return r.createElement(AZ,s({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(r.Component);bZ.defaultProps={classNames:""},bZ.propTypes={};const wZ=bZ,EZ=Ye.div({position:"absolute",top:0,left:0,bottom:0,right:0,background:"rgba(0, 0, 0, 0.5)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:9999}),kZ=Ye.dialog(({theme:e})=>({padding:20,border:"none",borderRadius:16,width:"90%",backgroundColor:e.white,margin:"20px auto",zIndex:99999,"&.fade-enter":{opacity:0},"&.fade-enter-active":{opacity:1,transition:"opacity 150ms"}})),CZ=Ye.div({display:"flex",alignItems:"center",position:"relative","> h3":{margin:"auto",textAlign:"center"}}),_Z=Ye(LO)(({theme:e})=>({color:e.black10,borderRadius:4,position:"absolute",right:-4,"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2},"& svg":{fill:e.black10,width:14,height:14},padding:0})),MZ=Ye.div({marginBottom:20}),TZ=Ye.div({display:"flex",justifyContent:"space-between",gap:12,"> button":{width:"auto",padding:"0 16px"},"@media screen and (max-width: 576px)":{flexDirection:"column",gap:12,"> button":{width:"100%"}}}),SZ=Ye.div(()=>({padding:"12px 0px",margin:"0px -20px"})),DZ=Ye.div(({theme:e})=>({height:1,width:"100%",backgroundColor:e.black80})),xZ=({isOpen:e,onClose:t,title:n,footer:i,children:o})=>{const a=(0,r.useRef)(null),s=XB(e=>e.config.settings.customTranslations?.ariaLabels?.closeDialog)??"Close dialog",l=()=>{t(!1)};return(0,r.useEffect)(()=>{const t=e=>{"Escape"===e.key&&l();const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(n&&t){const{firstFocusable:t,lastFocusable:r}=HF(a.current),i=r===n;t===n&&e.shiftKey&&(e.preventDefault(),r.focus()),i&&!e.shiftKey&&(e.preventDefault(),t.focus())}};return e?document.addEventListener("keydown",t):document.removeEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}},[e,t]),r.createElement(r.Fragment,null,e&&r.createElement(EZ,{onClick:l}),r.createElement(wZ,{in:e,timeout:150,mountOnEnter:!0,unmountOnExit:!0,classNames:"fade"},r.createElement(kZ,{className:"webchat-modal-root",open:e,"aria-labelledby":"modal-title","aria-describedby":"modal-body",ref:a},r.createElement(CZ,{className:"webchat-modal-header"},r.createElement(mm,{id:"modal-title",variant:"title1-semibold",className:"webchat-modal-title"},n),r.createElement(_Z,{"aria-label":s,onClick:l,className:"webchat-modal-close-button"},r.createElement(BO,{"aria-hidden":!0,className:"webchat-modal-close-icon"}))),r.createElement(SZ,{className:"webchat-modal-divider-wrapper"},r.createElement(DZ,{className:"webchat-modal-divider"})),r.createElement(MZ,{id:"modal-body",className:"webchat-modal-body"},o),i?r.createElement(TZ,{className:"webchat-modal-footer"},i):null)))},IZ=Ye(ct)(({theme:e,background:t})=>({background:t||e.red30,color:zB(t||e.red30,e),"&:hover:not(:disabled)":{background:qB(t||e.red30)}})),LZ=Ye(pj)(({theme:e,background:t})=>({background:t||e.white,color:zB(t||e.white,e),marginRight:"auto"})),PZ=Ye(IZ)(()=>({marginLeft:"auto"})),OZ=e=>{const{isOpen:t,onClose:n,onConfirmDelete:i,title:o,children:a,cancelText:s,confirmText:l,cancelButtonBackground:c,confirmButtonBackground:u}=e;return r.createElement(xZ,{footer:r.createElement(r.Fragment,null,r.createElement(LZ,{className:"webchat-delete-confirmation-cancel-button",onClick:()=>n(!1),background:c,autoFocus:!0},s),r.createElement(PZ,{className:"webchat-delete-confirmation-confirm-button",onClick:i,background:u},l)),isOpen:t,onClose:n,title:o},a)},RZ=Ye.div({display:"flex",flexDirection:"column",alignItems:"flex-start","& > button":{width:"auto",padding:"0 16px"}}),BZ=Ye(IZ)``,YZ=e=>{const{config:t,onDeleteModalStateChange:n}=e,{userId:i,sessionId:o,channel:a}=TM(e=>e.options),s=kM(),[l,c]=r.useState(!1),u=r.useRef(null);return r.createElement(r.Fragment,null,r.createElement(RZ,{className:"webchat-delete-conversation-container"},r.createElement(mm,{variant:"title1-semibold",className:"webchat-delete-conversation-title"},t.settings.customTranslations?.delete_conversation??"Delete conversation"),r.createElement(BZ,{ref:u,className:"webchat-delete-conversation-button",background:t.settings.customColors?.deleteButtonColor,onClick:()=>{c(!0),n(!0)}},t.settings.customTranslations?.delete??"Delete")),r.createElement(OZ,{isOpen:l,onClose:()=>{c(!1),u.current?.focus()},onConfirmDelete:()=>{s((e=>({type:aI,sessionId:e}))(o)),s(WM()),s(_O());const t=bI({disableLocalStorage:e.config.settings.embeddingConfiguration?.disableLocalStorage??!1,useSessionStorage:e.config.settings.embeddingConfiguration?.useSessionStorage??!1});t&&Object.keys(t).forEach(n=>{const r=Lx({channel:a,userId:i,sessionId:o},{URLToken:e.config.URLToken});t.removeItem(r)}),c(!1),n(!1),u.current?.focus(),s(lT(!1))},title:t.settings.customTranslations?.delete_conversation??"Delete conversation",cancelText:t.settings.customTranslations?.cancel??"Cancel",confirmText:t.settings.customTranslations?.delete_anyway??"Delete anyway",cancelButtonBackground:t.settings.customColors?.cancelButtonColor,confirmButtonBackground:t.settings.customColors?.deleteButtonColor},r.createElement(mm,{variant:"body-regular",className:"webchat-delete-conversation-text"},t.settings.customTranslations?.delete_conversation_confirmation??"Are you sure you want to delete this conversation? This action cannot be undone.")))},NZ=Ye.div({width:"100%",height:"100%",display:"flex",flexDirection:"column"}),VZ=Ye.div({width:"100%",height:"100%",display:"flex",padding:"0 20px",flexDirection:"column",overflowY:"auto",overscrollBehavior:"contain"}),FZ=Ye.div({padding:"12px 0px"}),jZ=Ye.div(({theme:e})=>({height:1,width:"100%",backgroundColor:e.black80})),HZ=e=>{const{config:t,showOnlyRating:n,ratingTitleText:i,ratingCommentText:o,ratingSubmitButtonText:a,ratingEventBannerText:s,hasGivenRating:l,onSendRating:c,onEmitAnalytics:u,onSendActionButtonMessage:d,onDeleteModalStateChange:p}=e,{settings:h}=t,{chatOptions:f}=h,m=f.rating.enabled,g="always"===m||"once"===m&&!l||n,y=TM(e=>e.ui.ttsActive),A=kM(),v=!!f.enableDeleteConversation;return r.createElement(NZ,{className:"webchat-chat-options-root"},r.createElement(VZ,{className:"webchat-chat-options-container"},n?r.createElement(UQ,{ratingTitleText:i,ratingCommentText:o,onSendRating:c,showRatingStatus:n,ratingEventBannerText:s,buttonText:a}):r.createElement(r.Fragment,null,t.settings.chatOptions.quickReplyOptions.enabled&&r.createElement(r.Fragment,null,r.createElement(ZQ,{config:t,onSendActionButtonMessage:d,onEmitAnalytics:u}),r.createElement(FZ,null,r.createElement(jZ,null))),t.settings.chatOptions.showTTSToggle&&r.createElement(r.Fragment,null,r.createElement(iZ,{onToggle:()=>{A(ET(!y))},config:t}),r.createElement(FZ,null,r.createElement(jZ,null))),g&&r.createElement(r.Fragment,null,r.createElement(UQ,{ratingTitleText:i,ratingCommentText:o,onSendRating:c,showRatingStatus:n,ratingEventBannerText:s,buttonText:a}),r.createElement(FZ,null,r.createElement(jZ,null))),v&&r.createElement(YZ,{onDeleteModalStateChange:p,config:t}))),f.footer.enabled&&f.footer.items[0]&&r.createElement($Q,{settings:t.settings}))},qZ=Ye(mm)(({theme:e})=>({marginBottom:"var(--webchat-message-margin-block, 24px)",marginInline:"var(--webchat-message-margin-inline, 20px)",padding:"12px",textAlign:"center",color:e.black40,"& span":{display:"block"}})),GZ=e=>{const t=XB(e=>e.queueUpdates??{}),{handleScroll:n}=e;return(0,r.useEffect)(()=>{t?.isQueueActive&&n?.(void 0,!0)},[t?.isQueueActive]),t?.isQueueActive?r.createElement(qZ,{variant:"body-regular",id:"webchatQueueUpdates",className:"webchat-queue-updates",component:"div"},t?.alternativeText?r.createElement("span",null,t.alternativeText):r.createElement(r.Fragment,null,r.createElement("span",null,"Current queue position: ",r.createElement("strong",null,t?.position||"")),r.createElement("span",null,"Estimated waiting time:"," ",r.createElement("strong",null,(e=>{if(!e)return"";const t=e/1e3,n=e=>`${e} ${e>1?"minutes":"minute"}`;if(t<60)return`${t} seconds`;const r=Math.floor(t/60);if(r<60)return n(r);const i=Math.floor(t/3600),o=r-60*i;return`${i} ${i>1?"hours":"hour"}${o>0?` and ${n(o)}`:""}`})(t?.estimatedWaitTime))))):null};var zZ,UZ=["title","titleId"];function WZ(){return WZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},WZ.apply(null,arguments)}const QZ=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,UZ);return r.createElement("svg",WZ({xmlns:"http://www.w3.org/2000/svg",width:17,height:16,fill:"none","aria-hidden":"true",viewBox:"0 0 17 16","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,zZ||(zZ=r.createElement("path",{fill:"#1A1A1A",fillRule:"evenodd",d:"M4.596 2.322C4.932 1.548 5.732.25 7.333.25c1.744 0 2.536 1.53 2.828 2.292.222.58.256 1.174.256 1.678v6.613a1.917 1.917 0 1 1-3.834 0V4a.75.75 0 0 1 1.5 0v6.833a.417.417 0 1 0 .834 0V4.22c0-.454-.035-.825-.156-1.14-.276-.718-.728-1.33-1.428-1.33-.64 0-1.072.504-1.362 1.17-.18.414-.221.904-.221 1.505V11.5a2.75 2.75 0 1 0 5.5 0V4a.75.75 0 0 1 1.5 0v7.5a4.25 4.25 0 0 1-8.5 0V4.425c0-.63.034-1.387.346-2.103",clipRule:"evenodd"})))},ZZ=()=>({width:"100%",height:"100%",bottom:0}),JZ=Ye.div(ZZ,{display:"flex",flexDirection:"column",flexGrow:1,minHeight:0,padding:12}),KZ=Ye.div(()=>({height:"100%",alignItems:"center",justifyContent:"center",display:"flex",gap:8})),XZ=Ye.div(ZZ,{position:"absolute"}),$Z=Ye(mm)(({theme:e})=>({color:e.black10})),eJ=e=>{const t=(0,r.useRef)(null),n=kM(),{disableBranding:i,dropzoneText:o,layoutSettings:a}=e;return r.createElement(r.Fragment,null,r.createElement(JZ,null,r.createElement(KZ,{id:"dropzoneContent"},r.createElement(QZ,null),r.createElement($Z,{variant:"title1-regular",component:"span",className:"webchat-input-drag-and-drop-file-text"},o||"Drop to attach")),r.createElement(xY,{id:"cognigyDropZoneLogo",watermark:a?.watermark,watermarkText:a?.watermarkText,watermarkUrl:a?.watermarkUrl})),r.createElement(XZ,{ref:t,onDragOver:e=>{e.preventDefault()},onDragLeave:e=>{e.preventDefault(),n(Jx(!1))},onDropCapture:async e=>{if(e.preventDefault(),e.stopPropagation(),n(Jx(!1)),e.dataTransfer?.files){const t=Array.prototype.slice.call(e.dataTransfer?.files);n(TO(t))}}}))},tJ=Ye.div(({theme:e})=>({width:"335px",backgroundColor:e.backgroundEngagementMessage,padding:"16px",borderRadius:"15px",boxShadow:"0px 4px 6px 0px rgba(28, 28, 28, 0.20)",border:"1px solid rgba(26, 26, 26, 0.10)",cursor:"pointer",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"16px"})),nJ=Ye.div({position:"fixed",right:"20px",bottom:"84px",display:"flex",flexDirection:"column",alignItems:"flex-end",gap:"16px"}),rJ=Ye.div(()=>({display:"flex",alignSelf:"stretch",alignItems:"center",gap:"12px"})),iJ=Ye.div(()=>({display:"flex",justifyContent:"space-between",alignItems:"center",flex:"1 0 0"})),oJ=Ye(LO)(({theme:e})=>({padding:0,marginRight:-4,borderRadius:4,"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2},svg:{fill:e.textDark,width:16,height:16}})),aJ=Ye.div({".webchat-teaser-message-button-container":{display:"flex",width:315,justifyContent:"flex-end",alignItems:"center",alignContent:"center",gap:"8px",flexWrap:"wrap"}}),sJ=Ye(iY)(()=>({marginInline:0})),lJ=e=>{const{onClick:t,messageText:n,config:i,onEmitAnalytics:o,onSendActionButtonMessage:a,onHideTeaserMessage:s,wasOpen:l}=e,{teaserMessage:c}=i.settings,u=c.conversationStarters.starters,d=(0,PN.useMediaQuery)({query:"(min-width: 576px)"});return r.createElement(nJ,{className:"webchat-teaser-message-root"},r.createElement(tJ,{className:"webchat-teaser-message-bubble",onClick:()=>{t?.()},"aria-live":"polite"},r.createElement(rJ,{className:"webchat-teaser-message-header"},i?.settings?.layout?.logoUrl?r.createElement(sJ,{src:i?.settings?.layout?.logoUrl,className:"webchat-teaser-message-header-logo",alt:""}):r.createElement(nB,{title:"Cognigy.AI Logo",role:"img"}),r.createElement(iJ,null,r.createElement(mm,{variant:"title2-regular",className:"webchat-teaser-message-header-title",margin:0,id:"webchatHeaderTitle"},i.settings.layout.title||"Cognigy"),r.createElement(oJ,{className:"webchat-teaser-message-header-close-button",onClick:e=>{e.stopPropagation(),e.preventDefault(),s()},"aria-label":i.settings.customTranslations?.ariaLabels?.closeTeaserMessage??"Close teaser message"},r.createElement(BO,null)))),r.createElement("span",{className:"sr-only"},i.settings.customTranslations?.ariaLabels?.newMessagePreview??"New message preview"),r.createElement(mm,{variant:"body-regular",className:"webchat-unread-message-preview-text",margin:0},n)),!l&&c?.conversationStarters?.enabled&&r.createElement(aJ,{className:"webchat-teaser-message-action-buttons"},r.createElement(xm,{showUrlIcon:!0,buttonClassName:"webchat-teaser-message-button",containerClassName:"webchat-teaser-message-button-container",payload:u,config:i,action:(e,n,r)=>{a(e,n,r),t?.()},onEmitAnalytics:o,size:d?"large":"small"})))};const cJ=Ye.div(()=>({display:"flex",flexDirection:"column",height:"100%",width:"100%",animation:"fade-in-xapp .25s ease-out","@keyframes fade-in-xapp":{from:{transform:"scale(.875)",opacity:.25},to:{transform:"scale(1)",opacity:1}}})),uJ=Ye.iframe(()=>({appearance:"none",border:"none",height:"100%",width:"100%",animation:"fade-in-xapp-2 .325s ease-in","@keyframes fade-in-xapp-2":{from:{opacity:.87,transform:"scale(.95)",translateY:"-300px"},to:{transform:"scale(1)",translateY:0,opacity:1}}})),dJ=()=>{const e=XB(e=>e.xAppOverlay.currentUrl)||"",{closeOnSubmit:t,feedbackMessage:n,screenTitle:i,sendEventOnCloseIconClick:o,showCloseIcon:a}=function(e){const t=XB(t=>t.xAppOverlay.settingsByUrl?.[e]??{});return(0,r.useMemo)(()=>t,[t,e])}(e),s=kM(),l=r=>{if(!1!==e.startsWith(r.origin)&&"x-app-submit"===r.data.type){if(n){const{success:e=!1}=r?.data||{};s(zM({source:"user",data:{_plugin:{type:"x-app-submit",data:{success:e,text:n}}}}))}t&&s(dI())}};(0,r.useEffect)(()=>(window.addEventListener("message",l),()=>{window.removeEventListener("message",l)}),[t]);const c=i||a;return r.createElement(cJ,{tabIndex:0,role:"dialog","aria-modal":"true"},c&&r.createElement(aY,{title:i,hideBackButton:!0,onClose:a?()=>{o&&s(Mx({data:{type:"xAppClosed"}})),s(dI())}:void 0}),r.createElement(uJ,{src:e,allow:" accelerometer; ambient-light-sensor; autoplay; battery; bluetooth; camera; cross-origin-isolated; display-capture; document-domain; encrypted-media; execution-while-not-rendered; execution-while-out-of-viewport; fullscreen; gamepad; geolocation; gyroscope; hid; idle-detection; interest-cohort; local-fonts; magnetometer; microphone; midi; otp-credentials; payment; picture-in-picture; publickey-credentials-get; screen-wake-lock; serial; speaker-selection; usb; web-share; xr-spatial-tracking"}))};function pJ(e,t){return"bot"===e?t.botMessageColor||"#FFFFFF":"user"===e?t.userMessageColor||"#E8EBFF":null}const hJ=new Set,fJ={match:({text:e,source:t})=>"bot"===t||"engagement"===t&&!!e,component:e=>{if(!window||!window.speechSynthesis)return null;const t=e.message.timestamp+"";if(hJ.has(t))return null;hJ.add(t);const n=new SpeechSynthesisUtterance;return n.text=e.message.text||"",speechSynthesis.speak(n),null},options:{passthrough:!0},name:"SpeechOutput"},mJ=fJ,gJ=()=>"undefined"!=typeof window&&window.innerWidth<=575,yJ=/[*_~#`<>[\]()|]/g;const AJ=e=>{const{config:t,onOpenChange:n,isOpen:i}=e,{userId:o,channel:a}=TM(e=>e.options),s=kM();return r.createElement(r.Fragment,null,r.createElement(OZ,{isOpen:i,onClose:n,onConfirmDelete:()=>{s(iI({})),s(WM()),s(_O()),s({type:CI});const e=bI({disableLocalStorage:t.settings.embeddingConfiguration?.disableLocalStorage??!1,useSessionStorage:t.settings.embeddingConfiguration?.useSessionStorage??!1});e&&Object.keys(e).forEach(t=>{t.includes(o)&&t.includes("webchat-client")&&e.removeItem(t)}),n(!1,!0)},title:t.settings.customTranslations?.delete_all_conversations??"Delete all conversations",cancelText:t.settings.customTranslations?.cancel??"Cancel",confirmText:t.settings.customTranslations?.delete_anyway??"Delete anyway",cancelButtonBackground:t.settings.customColors?.cancelButtonColor,confirmButtonBackground:t.settings.customColors?.deleteButtonColor},r.createElement(mm,{variant:"body-regular",className:"webchat-delete-all-conversation-text"},t.settings.customTranslations?.delete_all_conversations_confirmation??"Are you sure you want to delete all previous conversations? This action cannot be undone.")))},vJ=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|[\uD83C-\uDBFF\uDC00-\uDFFF]|\uFE0F|\u200D)+/gu,"").replace(/<\/?[^>]+(>|$)/g,"").replace(/ /g," ").replace(/\s+/g," ").trim(),bJ=e=>{const t=document.querySelector(`[data-message-id="${e}"]`);return t?(e=>{const t=e=>{if(e.nodeType===Node.TEXT_NODE)return e.textContent??"";if(e.nodeType!==Node.ELEMENT_NODE)return"";const t=e;if(t.hasAttribute("aria-hidden")||"presentation"===t.getAttribute("role")||"none"===t.getAttribute("role")||t.hasAttribute("hidden")||t.hasAttribute("data-skip-live-region")||"none"===getComputedStyle(t).display||"hidden"===getComputedStyle(t).visibility)return"";const r={P:e=>n(e).trim()+"\n",LI:e=>n(e).trim()+". ",UL:n,OL:n};return["H1","H2","H3","H4","H5","H6"].forEach(e=>{r[e]=e=>n(e).trim()+".\n"}),r[t.tagName]?.(t)??n(t)},n=e=>Array.from(e.childNodes).map(t).join(""),r=t(e);return vJ(r)})(t):"A new message"},wJ=({liveContent:e})=>{const[t,n]=(0,r.useState)(null),i=XB(e=>e.messages.messageHistory),o=ft(i,["acceptPrivacyPolicy"]),a=(0,r.useRef)(new Set),s=XB(e=>e.config.settings.behavior?.progressiveMessageRendering);return(0,r.useEffect)(()=>{if(!o.length)return;const t=o.filter(e=>{const t=`webchatMessageId-${e.timestamp}`;return!a.current.has(t)});if(!t.length)return;const r=setTimeout(()=>{const r=t[0],i=`webchatMessageId-${r.timestamp}`,o=s&&(e=>null!==e&&"object"==typeof e&&"animationState"in e)(r)&&("start"===r.animationState||"animating"===r.animationState);if(o)return;if(a.current.add(i),e[i]===`IGNORE-${i}`)return void n(null);const l=e[i]||bJ(i),c=vJ(l||"A new message");n({id:i,text:c})},100);return()=>clearTimeout(r)},[o,e,s]),r.createElement("div",{"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"true",id:"webchatMessageContainerScreenReaderLiveRegion",className:"sr-only"},t&&r.createElement("div",{key:t.id},t.text))};function EJ(){return EJ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},EJ.apply(null,arguments)}const kJ=[(e=>(t,n,r)=>-2===t?n.split(r[0]).join(`${e} ${r[0]}`):n)("[data-cognigy-webchat-root]")];(()=>{const e=document.getElementsByTagName("html")[0].attributes.dir;e&&"rtl"===e.value&&kJ.push(uV.Ay)})();const CJ=kY({key:"cognigy-webchat",stylisPlugins:kJ}),_J=Ye(mm)(({theme:e})=>({display:"block",textAlign:"center",padding:"12px",color:e.black40})),MJ=Ye(mY)(({theme:e})=>({overflowY:"auto",flexGrow:1,minHeight:0,height:e.blockSize,overscrollBehavior:"contain"})),TJ=Ye.div({position:"relative",height:"100%",display:"flex",flexDirection:"column",overscrollBehavior:"contain"}),SJ=Ye.div(({theme:e})=>({height:"100%",zIndex:3,display:"flex",flexDirection:"column",backgroundColor:e.white,overflow:"auto",overscrollBehavior:"contain","&.slide-in-enter":{transform:"translateX(100%)"},"&.slide-in-enter-active":{transform:"translateX(0%)",transition:"transform 400ms ease-out"},"&.slide-in-exit":{transform:"translateX(0%)"},"&.slide-in-exit-active":{transform:"translateX(100%)",transition:"transform 400ms ease-out"},"&.slide-in-enter:dir(rtl)":{transform:"translateX(-100%)"},"&.slide-in-enter-active:dir(rtl)":{transform:"translateX(0%)",transition:"transform 400ms ease-out"},"&.slide-in-exit:dir(rtl)":{transform:"translateX(0%)"},"&.slide-in-exit-active:dir(rtl)":{transform:"translateX(-100%)",transition:"transform 400ms ease-out"}}));class DJ extends r.PureComponent{state={theme:WB(),messagePlugins:[],inputPlugins:[],hadConnection:!1,lastUnseenMessageText:"",wasOpen:!1,timedOut:!1,showDeleteAllConversationsModal:!1,deleteConversationsModalState:!1,liveContent:{},isMobile:!1};unreadTitleIndicatorInterval=null;originalTitle=window.document.title;titleType="original";hideNotifications=!0;visibilityCheckInitialized=!1;visibilityCheckCompleted=!1;engagementMessageTimeout=null;constructor(e){super(e),this.chatToggleButtonRef=r.createRef(),this.closeButtonInHeaderRef=r.createRef(),this.menuButtonInHeaderRef=r.createRef(),this.deleteButtonInHeaderRef=r.createRef(),this.startNewConversationButtonRef=r.createRef(),this.ratingButtonInHeaderRef=r.createRef(),this.webchatWindowRef=r.createRef(),this.homeScreenCloseButtonRef=r.createRef(),this.handleStartConversation=this.handleStartConversation.bind(this),this.handleResize=(0,dV.debounce)(this.handleResize.bind(this),200)}static getDerivedStateFromProps(e,t){const n=e?.config?.settings?.colors?.primaryColor,r=e?.config?.settings?.colors?.secondaryColor,i=e?.config?.settings?.colors?.chatInterfaceColor,o=e?.config?.settings?.widgetSettings?.sourceColorMapping,a=pJ(o?.bot,e?.config?.settings?.colors),s=pJ(o?.user,e?.config?.settings?.colors),l=pJ(o?.agent,e?.config?.settings?.colors),c="user"===o?.bot?"transparent":null,u="bot"===o?.user?t.theme.black80:null,d="user"===o?.agent?"transparent":null,p=a||e?.config?.settings?.colors?.botMessageColor,h=s||e?.config?.settings?.colors?.userMessageColor,f=e?.config?.settings?.colors?.textLinkColor;let m=!1;if(n&&n!==t.theme.primaryColor){document.documentElement.style.setProperty("--webchat-primary-color",n);const e=zB(n,t.theme);document.documentElement.style.setProperty("--webchat-primary-contrast-color",e),m=!0}if(t.theme.primaryColorFocus&&document.documentElement.style.setProperty("--webchat-primary-color-focus",t.theme.primaryColorFocus),t.theme.primaryColorHover&&document.documentElement.style.setProperty("--webchat-primary-color-hover",t.theme.primaryColorHover),r&&r!==t.theme.secondaryColor){document.documentElement.style.setProperty("--webchat-secondary-color",r);const e=zB(r,t.theme);document.documentElement.style.setProperty("--webchat-secondary-contrast-color",e),m=!0}if(i&&i!==t.theme.backgroundWebchat&&(document.documentElement.style.setProperty("--webchat-background-webchat",i),m=!0),p&&p!==t.theme.backgroundBotMessage&&!e?.config?.settings?.layout?.disableBotOutputBorder){document.documentElement.style.setProperty("--webchat-background-bot-message",p);const e=zB(p,t.theme);document.documentElement.style.setProperty("--webchat-bot-message-contrast-color",e),m=!0}if(h&&h!==t.theme.backgroundUserMessage){document.documentElement.style.setProperty("--webchat-background-user-message",h);const e=zB(h,t.theme);document.documentElement.style.setProperty("--webchat-user-message-contrast-color",e),m=!0}if(l){document.documentElement.style.setProperty("--webchat-background-agent-message",l);const e=zB(l,t.theme);document.documentElement.style.setProperty("--webchat-agent-message-contrast-color",e)}return c&&document.documentElement.style.setProperty("--webchat-border-bot-message",c),u&&document.documentElement.style.setProperty("--webchat-border-user-message",u),d&&document.documentElement.style.setProperty("--webchat-border-agent-message",d),f&&f!==t.theme.textLink&&(document.documentElement.style.setProperty("--webchat-text-link",f),m=!0),m?{...t,theme:WB({primaryColor:n,secondaryColor:r,backgroundWebchat:i,backgroundBotMessage:p,backgroundUserMessage:h,textLink:f})}:null}checkNotificationsHidden=async()=>{let e=!1;if(this.props.config.settings.embeddingConfiguration.awaitEndpointConfig&&!this.props.config.isConfigLoaded){const t=this.props.config.settings.embeddingConfiguration?.connectivity?.enabled&&this.props.config.settings.embeddingConfiguration?.connectivity?.timeout||1e3;let n=0;for(;!this.props.config.isConfigLoaded&&!e;)await new Promise(e=>setTimeout(e,50)),n+=50,n>=t&&(e=!0,this.setState({timedOut:!0}))}this.hideNotifications=sj(this.props.config.settings,e)||rj(this.props.config.settings)||ej(this.props.config.settings.businessHours)||lj(this.props.config.settings,e)||ij(this.props.config.settings)||tj(this.props.config.settings.businessHours)||aj(this.props.config.settings,e)||nj(this.props.config.settings)||$F(this.props.config.settings.businessHours)||!1};componentDidMount(){const e=[];this.props.ttsActive&&e.push(mJ),this.setState({inputPlugins:[...this.props.inputPlugins||[],cV],messagePlugins:[...this.props.messagePlugins||[],...e],isMobile:gJ()}),this.setupIconAnimationInterval(),window.addEventListener("resize",this.handleResize)}async componentDidUpdate(e,t){if(e.open!==this.props.open&&this.props.open){const e=this.webchatWindowRef?.current,t=this.chatToggleButtonRef?.current,{firstFocusable:n}=HF(e);document.activeElement===t&&n&&n.focus()}if(e.ttsActive!==this.props.ttsActive||e.inputPlugins!==this.props.inputPlugins||e.messagePlugins!==this.props.messagePlugins){const e=[];this.props.ttsActive&&e.push(mJ),this.setState({inputPlugins:[...this.props.inputPlugins||[],cV],messagePlugins:[...this.props.messagePlugins||[],...e]})}for(this?.props?.config?.settings?.colors?.primaryColor===e?.config?.settings?.colors?.primaryColor&&this?.props?.config?.settings?.colors?.secondaryColor===e?.config?.settings?.colors?.secondaryColor&&this?.props?.config?.settings?.colors?.chatInterfaceColor===e?.config?.settings?.colors?.chatInterfaceColor&&this?.props?.config?.settings?.colors?.botMessageColor===e?.config?.settings?.colors?.botMessageColor&&this?.props?.config?.settings?.colors?.userMessageColor===e?.config?.settings?.colors?.userMessageColor&&this?.props?.config?.settings?.colors?.textLinkColor===e?.config?.settings?.colors?.textLinkColor||this.setState({theme:WB({primaryColor:this?.props?.config?.settings?.colors?.primaryColor,secondaryColor:this?.props?.config?.settings?.colors?.secondaryColor,backgroundWebchat:this?.props?.config?.settings?.colors?.chatInterfaceColor,backgroundBotMessage:this?.props?.config?.settings?.colors?.botMessageColor,backgroundUserMessage:this?.props?.config?.settings?.colors?.userMessageColor,textLink:this?.props?.config?.settings?.colors?.textLinkColor})}),!t.hadConnection&&this.props.connected&&this.setState({hadConnection:!0}),this.visibilityCheckInitialized||(this.visibilityCheckInitialized=!0,await this.checkNotificationsHidden(),this.visibilityCheckCompleted=!0);!this.visibilityCheckCompleted;)await new Promise(e=>setTimeout(e,50));if(!this.hideNotifications&&e.unseenMessages!==this.props.unseenMessages||!e.config.settings.unreadMessages.enablePreview&&this.props.config.settings.unreadMessages.enablePreview){const{unseenMessages:e}=this.props;if(this.props.config.settings.unreadMessages.enablePreview||!this.state.wasOpen&&this.props.config.settings.teaserMessage.text){let e="";const t=zF(this.props.unseenMessages,e=>!!YT(e));t&&(e=YT(t)),this.props.config.settings.widgetSettings.disableTeaserMarkdownRemoval||(e=e.replace(yJ,"")),this.setState({lastUnseenMessageText:e})}e.length>0&&this.props.config.settings.unreadMessages.enableSound&&GF.play()}e.config.settings.unreadMessages.enablePreview&&!this.props.config.settings.unreadMessages.enablePreview&&this.setState({lastUnseenMessageText:""}),e?.config?.settings?.layout?.iconAnimationInterval===this.props?.config?.settings?.layout?.iconAnimationInterval&&e?.config?.settings?.layout?.iconAnimationSpeed===this.props?.config?.settings?.layout?.iconAnimationSpeed&&e?.config?.settings?.layout?.iconAnimation===this.props?.config?.settings?.layout?.iconAnimation||this.setupIconAnimationInterval(),this.hideNotifications||(this.props.config.settings.unreadMessages.enableIndicator&&this.initializeTitleIndicator(),this.initializeEngagementMessage(),this.props.open&&!this.state.wasOpen&&this.setState({wasOpen:!0}))}componentWillUnmount(){this.unreadTitleIndicatorInterval&&(clearInterval(this.unreadTitleIndicatorInterval),this.unreadTitleIndicatorInterval=null),this.engagementMessageTimeout&&(clearTimeout(this.engagementMessageTimeout),this.engagementMessageTimeout=null),this.iconAnimationIntervalHandle&&(clearInterval(this.iconAnimationIntervalHandle),this.iconAnimationIntervalHandle=null),window.removeEventListener("resize",this.handleResize)}handleResize(){const e=gJ();e!==this.state.isMobile&&this.setState({isMobile:e})}iconAnimationIntervalHandle=null;setupIconAnimationInterval(){this.iconAnimationIntervalHandle&&(clearInterval(this.iconAnimationIntervalHandle),this.iconAnimationIntervalHandle=null);const e=this.props?.config?.settings?.layout?.iconAnimation;if(!e||"string"==typeof e&&0===e.trim().length)return;const t=this.props.config?.settings?.layout?.iconAnimationInterval??5,n=1e3*Math.max(0,t);0!==n&&(this.iconAnimationIntervalHandle=setInterval(()=>{const e=this.chatToggleButtonRef?.current;if(!e)return;const t=e.querySelector(".iconAnimationContainer");t&&(t.classList.remove("optionActive"),t.getBoundingClientRect(),t.classList.add("optionActive"))},n))}triggerEngagementMessage=()=>{this.state.wasOpen||this.props.messages.length>0||this.props.onTriggerEngagementMessage()};initializeEngagementMessage=()=>{this.engagementMessageTimeout||this.props.config.settings.teaserMessage.text&&"number"==typeof this.props.config.settings.teaserMessage.teaserMessageDelay&&this.props.config.settings.teaserMessage.teaserMessageDelay>=0&&(this.engagementMessageTimeout=setTimeout(this.triggerEngagementMessage,this.props.config.settings.teaserMessage.teaserMessageDelay))};initializeTitleIndicator=async()=>{this.unreadTitleIndicatorInterval||this.hideNotifications||(this.unreadTitleIndicatorInterval=setInterval(this.toggleTitleIndicator,1e3))};toggleTitleIndicator=()=>{"unread"===this.titleType?(document.title=this.originalTitle,this.titleType="original"):this.props.unseenMessages.length>0&&(document.title=`(${this.props.unseenMessages.length}) ${1===this.props.unseenMessages.length?this.props.config.settings.unreadMessages.unreadMessageTitleText:this.props.config.settings.unreadMessages.unreadMessageTitleTextPlural}`,this.titleType="unread")};sendMessage=(...e)=>{this.props.onSendMessage(...e),null===this.props.lastScrolledPosition&&this.props.onSetLastScrolledPosition(0)};renderInput=()=>{const{inputPlugins:e}=this.state,{messages:t}=this.props;return Dj(t)?null:r.createElement(PY,{plugins:e,messages:this.props.messages,onSendMessage:this.sendMessage,config:this.props.config,onSetInputMode:this.props.onSetInputMode,inputMode:this.props.inputMode,webchatTheme:this.state.theme,onEmitAnalytics:this.props.onEmitAnalytics,theme:this.state.theme,sttActive:this.props.sttActive})};handleKeydown=e=>{const{enableFocusTrap:t}=this.props.config.settings.widgetSettings,{showDeleteAllConversationsModal:n,deleteConversationsModalState:r}=this.state,{open:i}=this.props,{target:o,key:a,shiftKey:s}=e,l=s&&"Tab"===a,c=!s&&"Tab"===a;if(t&&i&&!n&&!r){const t=this.webchatWindowRef?.current,{firstFocusable:n,lastFocusable:r}=HF(t),i=this.chatToggleButtonRef?.current;o!==i&&o!==n||!l?o!==i&&o!==r||!c||(e.preventDefault(),setTimeout(()=>{n?.focus()},0)):(e.preventDefault(),r?.focus())}};handleSendRating=({rating:e,comment:t,showRatingStatus:n})=>{this.props.onShowRatingScreen(!1),this.props.onSendMessage(void 0,{_cognigy:{controlCommands:[{type:"setRating",parameters:{rating:e,comment:t,showRatingStatus:n}}]}},void 0),this.props.onSetHasGivenRating()};handleSendActionButtonMessage=(e,t,n)=>{this.props.onSetShowHomeScreen(!1),this.props.onSetShowChatOptionsScreen(!1),this.props.config.settings.privacyNotice.enabled&&!this.props.hasAcceptedTerms?this.props.onSetStoredMessage({text:e,data:t,options:n}):(this.props.onSwitchSession(),this.props.onSendMessage(e,t,n))};handleSendActionButtonMessageExistingSession=(e,t,n)=>{this.props.onSetShowHomeScreen(!1),this.props.onSetShowChatOptionsScreen(!1),this.props.config.settings.privacyNotice.enabled&&!this.props.hasAcceptedTerms?this.props.onSetStoredMessage({text:e,data:t,options:n}):this.props.onSendMessage(e,t,n)};handleSendActionButtonMessageFromTeaser=(e,t,n)=>{this.props.onSetShowHomeScreen(!1),this.props.onSetShowChatOptionsScreen(!1),this.props.config.settings.privacyNotice.enabled&&!this.props.hasAcceptedTerms?this.props.onSetStoredMessage({text:e,data:t,options:n}):(this.props.onShowChatScreen(),this.props.onSendMessage(e,t,n))};handleStartConversation=()=>{this.props.onSetShowHomeScreen(!1),this.props.onSetShowChatOptionsScreen(!1);this.props.config.settings.privacyNotice.enabled&&!this.props.hasAcceptedTerms||this.props.onShowChatScreen()};handleFabClick=()=>{this.props.onToggle();!0===this.props.config.settings.homeScreen.enabled?this.setState({lastUnseenMessageText:""}):this.handleStartConversation()};openConversationFromTeaser=()=>{this.props.onToggle(),this.props.onSetShowHomeScreen(!1),this.props.onSetShowChatOptionsScreen(!1);this.props.config.settings.privacyNotice.enabled&&!this.props.hasAcceptedTerms?this.setState({lastUnseenMessageText:""}):this.props.onShowChatScreen()};render(){const{props:e,state:t}=this,{messages:n,unseenMessages:i,prevConversations:o,onSendMessage:a,onConnect:s,config:l,open:c,fullscreenMessage:u,typingIndicator:d,onEmitAnalytics:p,onSetInputMode:h,onSetFullscreenMessage:f,onDismissFullscreenMessage:m,onClose:g,onToggle:y,onSetScrollToPosition:A,onSetLastScrolledPosition:v,scrollToPosition:b,lastScrolledPosition:w,onTriggerEngagementMessage:E,webchatRootProps:k,webchatToggleProps:C,connected:_,reconnectionLimit:M,showRatingScreen:T,onShowRatingScreen:S,onSetShowHomeScreen:D,onSetHasGivenRating:x,onSetShowPrevConversations:I,onSetShowChatOptionsScreen:L,onShowChatScreen:P,onSwitchSession:O,requestRatingScreenTitle:R,customRatingTitle:B,customRatingCommentText:Y,requestRatingSubmitButtonText:N,requestRatingEventBannerText:V,requestRatingChatStatusBadgeText:F,onAcceptTerms:j,onSetStoredMessage:H,onSetFileList:q,onSetFileUploadError:G,onSetDropZoneVisible:z,isXAppOverlayOpen:U,openXAppOverlay:W,onSetMessageAnimated:Q,lastInputId:Z,...J}=e,{theme:K,hadConnection:X,lastUnseenMessageText:$,wasOpen:ee,isMobile:te}=t,{widgetSettings:{disableToggleButton:ne},behavior:{enableConnectionStatusIndicator:re}}=l.settings;if(!l.active&&!l.settings.embeddingConfiguration.connectivity.enabled||!l.isConfigLoaded&&l.settings.embeddingConfiguration.awaitEndpointConfig||l.isConfigLoaded&&l.settings.embeddingConfiguration.awaitEndpointConfig&&($F(l.settings.businessHours)||nj(l.settings)||aj(l.settings,t.timedOut)))return null;const ie=l.isConfigLoaded&&l.settings.embeddingConfiguration.awaitEndpointConfig&&(rj(l.settings)||ej(l.settings.businessHours)||sj(l.settings,t.timedOut)),oe=l.isConfigLoaded&&l.settings.embeddingConfiguration.awaitEndpointConfig&&(ij(l.settings)||tj(l.settings.businessHours)||lj(l.settings,t.timedOut)),ae=re&&!_&&X,se=()=>ie&&rj(this.props.config.settings)?this.props.config.settings.maintenance.text||"This chat is currently disabled due to maintenance":ie&&ej(this.props.config.settings.businessHours)?this.props.config.settings.maintenance.text||"This chat is disabled out of our business hours":ie&&sj(this.props.config.settings,this.state.timedOut)?this.props.config.settings.embeddingConfiguration.connectivity.text||"This chat is disabled due to connectivity issues":void 0,le=l.settings.customTranslations?.ariaLabels?.chatRegion??"Chat window";return r.createElement(r.Fragment,null,r.createElement(De,{theme:K},r.createElement(r.Fragment,null,r.createElement(nF,{enabled:c&&te,allowPinchZoom:!0},r.createElement(aF,EJ({"data-cognigy-webchat-root":!0},J,{className:"webchat-root","aria-label":le,role:"region",onKeyDown:this.handleKeydown}),r.createElement(_e,{value:CJ},c&&(!this.props.config.settings.embeddingConfiguration.awaitEndpointConfig||this.props.config.settings.embeddingConfiguration.awaitEndpointConfig&&this.props.config.isConfigLoaded)&&r.createElement(lY,EJ({"data-cognigy-webchat":!0},k,{className:"webchat",id:"webchatWindow",ref:this.webchatWindowRef,chatWindowWidth:this.props.config.settings.layout.chatWindowWidth}),u?this.renderFullscreenMessageLayout():this.renderRegularLayout(oe),r.createElement(VF,{isOpen:ae,onConnect:s,isPermanent:!!M,onClose:()=>{g(),this.chatToggleButtonRef.current?.focus()},config:l})),!ne&&r.createElement("div",null,$&&!c&&r.createElement(lJ,{messageText:$,onClick:this.openConversationFromTeaser,config:l,onEmitAnalytics:p,onSendActionButtonMessage:this.handleSendActionButtonMessageFromTeaser,onHideTeaserMessage:()=>{this.setState({lastUnseenMessageText:""}),this.chatToggleButtonRef.current?.focus()},wasOpen:ee}),ie?r.createElement("div",{title:se(),tabIndex:-1,"aria-disabled":!0},r.createElement(oj,EJ({"data-cognigy-webchat-toggle":!0},C,{type:"button",className:"webchat-toggle-button-disabled","aria-label":se(),ref:this.chatToggleButtonRef,id:"webchatWindowToggleButton",disabled:!0}),r.createElement(_F,{config:l}))):r.createElement(oF,EJ({"data-cognigy-webchat-toggle":!0,onClick:this.handleFabClick},C,{type:"button",className:$R()("webchat-toggle-button burst",l.settings?.layout?.iconAnimation),id:"webchatWindowToggleButton","aria-label":(()=>{if(c)return l.settings.customTranslations?.ariaLabels?.closeChat??"Close chat";const e=l.settings.customTranslations?.ariaLabels?.openChat??"Open chat",t=l.settings.customTranslations?.ariaLabels?.unreadMessageSingularText??"One unread message in chat. "+e,n=l.settings.customTranslations?.ariaLabels?.unreadMessagePluralText??"unread messages in chat. "+e;switch(i.length){case 0:return e;case 1:return t;default:return`${i.length} ${n}`}})(),ref:this.chatToggleButtonRef,style:{"--icon-burst-duration":`${Math.max(.2,1/Math.max(.1,l.settings?.layout?.iconAnimationSpeed||1))}s`}}),c?r.createElement(DF,null):r.createElement(_F,{config:l}),l.settings.unreadMessages.enableBadge?r.createElement(jF,{_content:i.length,className:"webchat-unread-message-badge","aria-label":`${i.length} ${l.settings.customTranslations?.ariaLabels?.unreadMessages??"unread messages"}`}):null))))))))}renderRegularLayout(e){const{currentSession:t,config:n,messages:i,scrollToPosition:o,lastScrolledPosition:a,onSetScrollToPosition:s,onSetLastScrolledPosition:l,showHomeScreen:c,onSetShowHomeScreen:u,showPrevConversations:d,onSetShowPrevConversations:p,showChatOptionsScreen:h,onSetShowChatOptionsScreen:f,requestRatingScreenTitle:m,customRatingTitle:g,customRatingCommentText:y,requestRatingSubmitButtonText:A,requestRatingEventBannerText:v,showRatingScreen:b,onShowRatingScreen:w,onShowChatScreen:E,onSwitchSession:k,onClose:C,onEmitAnalytics:_,onSendMessage:M,hasAcceptedTerms:T,onAcceptTerms:S,onSetStoredMessage:D,isDropZoneVisible:x,isXAppOverlayOpen:I,lastInputId:L}=this.props;let P="",O="";n.settings.maintenance.enabled&&"inform"===n.settings.maintenance.mode?(P=n.settings.maintenance.text||"This Webchat is disabled due to maintenance",O=n.settings.maintenance.title||""):n.settings.embeddingConfiguration.connectivity.enabled&&"inform"===n.settings.embeddingConfiguration.connectivity.mode?(P=n.settings.embeddingConfiguration.connectivity.text||"This Webchat is disabled due to connectivity issues",O=n.settings.embeddingConfiguration.connectivity.title||""):n.settings.businessHours.enabled&&"inform"===n.settings.businessHours.mode&&(P=n.settings.businessHours.text||"This Webchat is disabled out of business hours",O=n.settings.businessHours.title||"");const R=e&&P,B=R,Y=()=>{this.props.onMinimize?.(),this.chatToggleButtonRef?.current?.focus?.()},N=()=>{S(this.props?.options?.userId||""),E();this.props.onSendMessage("",{_cognigy:{controlCommands:[{type:"acceptPrivacyPolicy"}]}})},V=e=>{e.preventDefault(),e.stopPropagation(),n?.settings?.fileStorageSettings?.enabled&&this.props.onSetDropZoneVisible(!0)},F=n.settings.homeScreen.enabled,j=F&&c,H=!h&&!b&&!d&&!j&&!R&&(T||!n.settings.privacyNotice.enabled),q=n.settings.chatOptions.enabled&&H,G=H&&!F,z=!!((n.settings.privacyNotice.enabled&&this.props.hasAcceptedTerms||!n.settings.privacyNotice.enabled)&&n.settings.homeScreen.previousConversations.enableDeleteAllConversations&&d&&Object.keys(this.props.prevConversations).length),U=!H&&!c;return r.createElement(TJ,null,!I&&r.createElement(wZ,{in:!(j&&!R),timeout:500,classNames:"slide-in",mountOnEnter:!0,unmountOnExit:!0},!I&&r.createElement(aY,{onClose:()=>{u(!0),C(),this.chatToggleButtonRef?.current?.focus?.()},onMinimize:Y,onGoBack:R?void 0:()=>{h||b?(f(!1),w(!1),n.settings.widgetSettings.disableInputAutofocus&&this.closeButtonInHeaderRef?.current?.focus?.()):(p(!1),u(!0),setTimeout(()=>{this.homeScreenCloseButtonRef?.current?.focus?.()},450))},onSetShowChatOptionsScreen:()=>{f(!0)},isChatOptionsButtonVisible:q,isDeleteAllConversationsButtonVisible:z,onDeleteAllConversations:()=>{this.setState({showDeleteAllConversationsModal:!0})},logoUrl:h||b?void 0:n.settings.layout.logoUrl,title:R&&O?O:!T&&n.settings.privacyNotice.enabled?n.settings.privacyNotice.title||"Privacy notice":d?n.settings.homeScreen.previousConversations.title||"Previous conversations":h?n.settings.chatOptions.title||"Chat options":b?m||"Conversation rating":n.settings.layout.title?n.settings.layout.title:"Cognigy",closeButtonRef:this.closeButtonInHeaderRef,menuButtonRef:this.menuButtonInHeaderRef,deleteButtonRef:this.deleteButtonInHeaderRef,chatToggleButtonRef:this.chatToggleButtonRef,hideBackButton:G,showChatScreen:H,autoFocusScreenTitle:U,deleteIconColor:n.settings.customColors?.deleteAllConversationIconColor})),!B&&F&&r.createElement(wZ,{in:!c,timeout:500,classNames:"hidebackground"},r.createElement(kj,{showHomeScreen:c,closeButtonRef:this.homeScreenCloseButtonRef,onSetShowHomeScreen:u,onStartConversation:this.handleStartConversation,onSetShowPrevConversations:p,onClose:Y,config:n,onEmitAnalytics:_,onSendActionButtonMessage:this.handleSendActionButtonMessage})),r.createElement(wZ,{in:!(j&&!R),timeout:500,classNames:"slide-in",mountOnEnter:!0,unmountOnExit:!0},r.createElement(SJ,null,(()=>R?r.createElement($j,{message:P}):!T&&n.settings.privacyNotice.enabled?r.createElement(CQ,{privacyNotice:n.settings.privacyNotice,onAcceptTerms:N,isHomeScreenEnabled:F}):I?r.createElement(dJ,null):d?r.createElement(zj,{conversations:this.props.prevConversations,onSetShowPrevConversations:p,onSwitchSession:k,config:n,currentSession:t,startNewConversationButtonRef:this.startNewConversationButtonRef}):h||b?r.createElement(HZ,{config:n,ratingTitleText:g||n.settings.chatOptions.rating.title,ratingCommentText:y||n.settings.chatOptions.rating.commentPlaceholder,ratingSubmitButtonText:A||n.settings.chatOptions.rating.submitButtonText,ratingEventBannerText:v||n.settings.chatOptions.rating.eventBannerText,showOnlyRating:b,hasGivenRating:this.props.hasGivenRating,onSendRating:this.handleSendRating,onEmitAnalytics:_,onSendActionButtonMessage:this.handleSendActionButtonMessageExistingSession,onDeleteModalStateChange:e=>{this.setState({deleteConversationsModalState:e})}}):x?r.createElement(eJ,{layoutSettings:n.settings.layout,dropzoneText:n.settings.fileStorageSettings?.dropzoneText}):r.createElement(r.Fragment,null,r.createElement(MJ,{scrollBehavior:n.settings.behavior.scrollingBehavior,lastInputId:L,className:"webchat-chat-history",onDragEnter:V,id:"webchatChatHistory"},r.createElement("h3",{className:"sr-only",id:"webchatChatHistoryHeading"},n.settings.customTranslations?.ariaLabels?.chatHistory??"Chat history"),this.renderHistory()),r.createElement(wJ,{liveContent:this.state.liveContent}),r.createElement(GZ,null),this.renderInput()))(),r.createElement(AJ,{config:n,isOpen:this.state.showDeleteAllConversationsModal,onOpenChange:(e,t)=>{this.setState({showDeleteAllConversationsModal:e}),e||!this.deleteButtonInHeaderRef.current||t?this.startNewConversationButtonRef.current?.focus():this.deleteButtonInHeaderRef.current.focus()}}))))}renderFullscreenMessageLayout(){const{config:e,fullscreenMessage:t,onDismissFullscreenMessage:n,onEmitAnalytics:i}=this.props,{messagePlugins:o}=this.state;return r.createElement(_Y,{onSendMessage:this.sendMessage,config:e,plugins:o,onSetFullscreen:()=>{},onDismissFullscreen:n,message:t,webchatTheme:this.state.theme,onEmitAnalytics:i,action:this.sendMessage,theme:this.state.theme,onSetMessageAnimated:this.props.onSetMessageAnimated})}renderHistory(){const{messages:e,typingIndicator:t,config:n,onEmitAnalytics:i,openXAppOverlay:o,visibleOutputMessages:a}=this.props,{messagePlugins:s=[]}=this.state,{enableTypingIndicator:l,messageDelay:c,enableAIAgentNotice:u,AIAgentNoticeText:d,progressiveMessageRendering:p}=n.settings.behavior,h="remove"!==t&&"hide"!==t,f=Dj(e),m=ft(e,["acceptPrivacyPolicy"]),g=p?m.filter(e=>"bot"!==e.source&&"engagement"!==e.source||a.includes(e.id)):m,y=(e,t)=>{this.setState(n=>({liveContent:{...n.liveContent,[e]:t}}))};return r.createElement(r.Fragment,null,!1!==u&&r.createElement(_J,{variant:"body-regular",component:"div",className:"webchat-log-ai-agent-notice-text"},d||"You're now chatting with an AI Agent."),g.map((e,t)=>{const a=g.slice(t+1).some(e=>{const t="user"===e.source,n="string"==typeof e.text&&e.text.trim().length>0,r=!e?.data?._cognigy?.controlCommands,i=Array.isArray(e?.data?.attachments)&&e.data.attachments.length>0;return t&&r&&(n||i)});return r.createElement(gC,{key:e.id||JSON.stringify({message:e,index:t}),message:e,action:this.sendMessage,config:n,hasReply:a,isConversationEnded:f,onDismissFullscreen:()=>{},onEmitAnalytics:i,onSetFullscreen:()=>this.props.onSetFullscreenMessage(e),openXAppOverlay:o,plugins:s,prevMessage:g?.[t-1],theme:this.state.theme,onSetMessageAnimated:this.props.onSetMessageAnimated,onSetLiveRegionText:y,"data-message-id":`webchatMessageId-${e.timestamp}`})}),f&&r.createElement(iC,{text:"Conversation ended",className:"webchat-chip-conversation-ended"}),l&&r.createElement(JF,{active:h,delay:c,direction:n?.settings?.widgetSettings?.sourceDirectionMapping?.bot||"incoming",disableBorder:n?.settings?.layout?.disableBotOutputBorder}))}}const xJ=AM(e=>{const{messages:{messageHistory:t,visibleOutputMessages:n},unseenMessages:r,prevConversations:i,connection:{connected:o,reconnectionLimit:a},ui:{open:s,typing:l,inputMode:c,fullscreenMessage:u,showHomeScreen:d,showPrevConversations:p,showChatOptionsScreen:h,hasAcceptedTerms:f,ttsActive:m,lastInputId:g},config:y,options:{sessionId:A,userId:v},rating:{showRatingScreen:b,hasGivenRating:w,requestRatingScreenTitle:E,customRatingTitle:k,customRatingCommentText:C,requestRatingSubmitButtonText:_,requestRatingEventBannerText:M,requestRatingChatStatusBadgeText:T},input:{sttActive:S,isDropZoneVisible:D,fileList:x,fileUploadError:I},xAppOverlay:{open:L}}=e;return{currentSession:A,messages:t,visibleOutputMessages:n,unseenMessages:r,prevConversations:i,open:s,typingIndicator:l,inputMode:c,fullscreenMessage:u,config:y,connected:o,reconnectionLimit:a,showRatingScreen:b,hasGivenRating:w,requestRatingScreenTitle:E,customRatingTitle:k,customRatingCommentText:C,requestRatingSubmitButtonText:_,requestRatingEventBannerText:M,requestRatingChatStatusBadgeText:T,showHomeScreen:d,sttActive:S,isDropZoneVisible:D,fileList:x,fileUploadError:I,showPrevConversations:p,showChatOptionsScreen:h,hasAcceptedTerms:f,isXAppOverlayOpen:L,userId:v,ttsActive:m,lastInputId:g}},e=>({onSendMessage:(t,n,r)=>e(Mx({text:t,data:n},r)),onSetInputMode:t=>e((e=>({type:dT,inputMode:e}))(t)),onSetFullscreenMessage:t=>e(hT(t)),onDismissFullscreenMessage:()=>e(hT(void 0)),onClose:()=>e(nT(!1)),onMinimize:()=>e({type:rT}),onToggle:()=>e({type:"TOGGLE_OPEN"}),onTriggerEngagementMessage:()=>e({type:"TRIGGER_ENGAGEMENT_MESSAGE"}),onConnect:()=>e({type:"CONNECT"}),onShowRatingScreen:t=>e(MT(t)),onSetHasGivenRating:()=>e({type:TT}),onSetShowHomeScreen:t=>e(oT(t)),onSetShowPrevConversations:t=>e({type:aT,showPrevConversations:t}),onSetShowChatOptionsScreen:t=>e(lT(t)),onShowChatScreen:()=>e({type:"SHOW_CHAT_SCREEN"}),onSwitchSession:(t,n)=>e(_O(t,n)),onAcceptTerms:t=>e(AT(t)),onSetStoredMessage:t=>e(bT(t)),onSetDropZoneVisible:t=>e(Jx(t)),onSetFileList:t=>e(Xx(t)),onSetFileUploadError:t=>e(eI(t)),openXAppOverlay:t=>e(uI(t)),onSetMessageAnimated:(t,n)=>e(((e,t)=>({type:"SET_MESSAGE_ANIMATED",messageId:e,animationState:t}))(t,n))}),({fullscreenMessage:e,...t},n,r)=>{if(!e){const n=t.messages.slice(-1)[0],i=n?((e,t)=>n=>{const r=[];for(const i of e)if(i.match(n,t)&&(r.push(i),!i.options||!i.options.passthrough))break;return r})(r.messagePlugins||[],t.config)(n):[],o=i.slice(-1)[0];e=o&&(e=>e.options&&e.options.fullscreen)(o)?n:void 0}return{...t,...n,...r,fullscreenMessage:e}})(DJ);var IJ=i(8657),LJ=i(2166);function PJ(){return PJ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PJ.apply(null,arguments)}class OJ extends r.PureComponent{analytics=new IJ.EventEmitter;constructor(e){super(e);const{url:t,options:n,settings:r}=e,i=(e=>{const t=e.split("/");return t.splice(t.length-1,1),t.join("/")})(t),o=t.split("/").pop();const a={channel:n?.channel||"webchat3",...n},s=new LJ.SocketClient(i,o,a);this.client=s;const l=IO(this,t,r);this.store=l,this._handleOutput=gD(this.store)}UNSAFE_componentWillMount(){const{settings:e}=this.props,t=bI({disableLocalStorage:e?.embeddingConfiguration?.disableLocalStorage??!1,useSessionStorage:e?.embeddingConfiguration?.useSessionStorage??!1}),n=this.client.socketOptions.userId;AO(t,n)&&this.store.dispatch(AT(n)),this.store.dispatch({type:"LOAD_CONFIG"}),this.props.options?.sessionId&&this.store.dispatch({type:"SET_INITIAL_SESSION_ID",sessionId:this.props.options.sessionId}),this.props.options?.userId&&this.store.dispatch((e=>({type:"SET_USER_ID",userId:e}))(this.props.options?.userId))}componentWillUnmount(){this.client.disconnect()}registerAnalyticsService(e){this.analytics.on("analytics-event",e)}emitAnalytics=(e,t)=>{this.analytics.emit("analytics-event",{type:e,payload:t})};connect=async()=>{this.store.dispatch({type:"CONNECT"})};sendMessage=(e,t,n)=>{this.store.dispatch(Mx({text:e,data:t},n))};_open=()=>{const{settings:e}=this.store.getState().config,t=bI({disableLocalStorage:e?.embeddingConfiguration?.disableLocalStorage??!1,useSessionStorage:e?.embeddingConfiguration?.useSessionStorage??!1}),n=this.client.socketOptions.userId,r=!0===e?.homeScreen?.enabled,i=!(!0===e?.privacyNotice?.enabled)||AO(t,n);!r&&i&&(this.store.dispatch(oT(!1)),this.store.dispatch(lT(!1)),this.store.dispatch({type:"SHOW_CHAT_SCREEN"})),this.store.dispatch({type:"TOGGLE_OPEN"})};open=async()=>{const e=this.store.getState().config.settings.embeddingConfiguration?.connectivity?.enabled&&this.store.getState().config.settings.embeddingConfiguration?.connectivity?.timeout||1e3;let t=!1,n=0;for(;!this.store.getState().config.isConfigLoaded&&!t;)await new Promise(e=>setTimeout(e,50)),n+=50,n>=e&&(t=!0);this._open()};close=()=>{this.store.dispatch(nT(!1))};toggle=()=>{this.store.dispatch({type:"TOGGLE_OPEN"})};showNotification=e=>{QR(e)};startConversation=()=>{this.store.dispatch(oT(!1)),this.store.dispatch({type:"SHOW_CHAT_SCREEN"})};on=(e,t)=>{this.client.on(e,t)};onMessage=e=>{this.client.on("output",e)};updateSettings=e=>{this.store.dispatch({type:"UPDATE_SETTINGS",payload:e})};endSession=()=>{this.store.dispatch(_O()),this.store.dispatch(WM())};render(){const{url:e,options:t,messagePlugins:n=[],inputPlugins:i=[],...o}=this.props;return r.createElement(F_,{store:this.store},r.createElement(xJ,PJ({},o,{options:t,messagePlugins:n,inputPlugins:i,onEmitAnalytics:this.emitAnalytics})))}}window.initWebchat=async(e,t,n)=>{const i=((e=pt(),{React:t,styled:n})=>e.map(e=>"function"==typeof e?e({React:t,styled:n}):e).map(e=>"string"==typeof e.match?{...e,match:({data:t})=>t&&t._plugin&&t._plugin.type===e.match}:e))(pt(),{React:r,styled:Ye}),o=(window.cognigyWebchatInputPlugins||[]).map(e=>"function"==typeof e?e({React:r,styled:Ye}):e),s=t?.settings?.embeddingConfiguration?.disableLocalStorage??!1,l=bI({disableLocalStorage:s,useSessionStorage:t?.settings?.embeddingConfiguration?.useSessionStorage??!1});if((!t||!t.userId)&&l){let e;s||(e=l.getItem("userId")),e||(e=Ge(),s||l.setItem("userId",e)),t||(t={}),t.userId=e}let c={};t&&t.settings&&(c=t.settings),c.embeddingConfiguration={...c?.embeddingConfiguration,_endpointTokenUrl:e};const u=document.createElement("div");document.body.appendChild(u);let d=null;for((0,a.H)(u).render(r.createElement(OJ,{ref:e=>d=e,url:e,options:t,settings:c,messagePlugins:i,inputPlugins:o}));!d;)await new Promise(e=>setTimeout(e,500));return n?n(d):d},window.__COGNIGY_WEBCHAT={React:r}})()})();
|
|
650
|
+
`,UR=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:i,children:o,toasterId:a,containerStyle:s,containerClassName:l})=>{let{toasts:c,handlers:u}=CR(n,a);return r.createElement("div",{"data-rht-toaster":a||"",style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...s},className:l,onMouseEnter:u.startPause,onMouseLeave:u.endPause},c.map(n=>{let a=n.position||t,s=((e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:pR()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}})(a,u.calculateOffset(n,{reverseOrder:e,gutter:i,defaultPosition:t}));return r.createElement(GR,{id:n.id,key:n.id,onHeightUpdate:u.updateHeight,className:n.visible?zR:"",style:s},"custom"===n.type?uR(n.message,n):o?o(n):r.createElement(qR,{toast:n,position:a}))}))},WR=kR;function QR(e,t={}){WR(e,t)}const ZR=()=>{const e=r.useContext(Te);return r.createElement(UR,{gutter:1,toastOptions:{duration:1500,style:{backgroundColor:e.green10,borderRadius:0,boxShadow:"none",color:e.green,fontFamily:e.fontFamily,fontSize:14,fontWeight:600,lineHeight:1.3,maxWidth:"unset",paddingBlock:16,paddingInlineStart:20,width:"100%"}},containerStyle:{left:0,position:"relative",right:0,top:0,width:"100%"}})};var JR,KR,XR=i(4176),$R=i.n(XR),eB=["title","titleId"];function tB(){return tB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tB.apply(null,arguments)}const nB=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,eB);return r.createElement("svg",tB({xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",viewBox:"0 0 28 28","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,JR||(JR=r.createElement("rect",{width:28,height:28,fill:"#2455E6",rx:14})),KR||(KR=r.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"m11.084 10.61-4.12 9.865H4.2L9.705 7.3h2.758l5.506 13.176H15.21zM22.317 7.3v13.176h-2.899V7.3z",clipRule:"evenodd"})))};function rB(e){return rB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rB(e)}var iB=/^\s+/,oB=/\s+$/;function aB(e,t){if(t=t||{},(e=e||"")instanceof aB)return e;if(!(this instanceof aB))return new aB(e,t);var n=function(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,o=null,a=!1,s=!1;"string"==typeof e&&(e=function(e){e=e.replace(iB,"").replace(oB,"").toLowerCase();var t,n=!1;if(kB[e])e=kB[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=BB.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=BB.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=BB.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=BB.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=BB.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=BB.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=BB.hex8.exec(e))return{r:SB(t[1]),g:SB(t[2]),b:SB(t[3]),a:LB(t[4]),format:n?"name":"hex8"};if(t=BB.hex6.exec(e))return{r:SB(t[1]),g:SB(t[2]),b:SB(t[3]),format:n?"name":"hex"};if(t=BB.hex4.exec(e))return{r:SB(t[1]+""+t[1]),g:SB(t[2]+""+t[2]),b:SB(t[3]+""+t[3]),a:LB(t[4]+""+t[4]),format:n?"name":"hex8"};if(t=BB.hex3.exec(e))return{r:SB(t[1]+""+t[1]),g:SB(t[2]+""+t[2]),b:SB(t[3]+""+t[3]),format:n?"name":"hex"};return!1}(e));"object"==rB(e)&&(YB(e.r)&&YB(e.g)&&YB(e.b)?(t=function(e,t,n){return{r:255*MB(e,255),g:255*MB(t,255),b:255*MB(n,255)}}(e.r,e.g,e.b),a=!0,s="%"===String(e.r).substr(-1)?"prgb":"rgb"):YB(e.h)&&YB(e.s)&&YB(e.v)?(r=xB(e.s),i=xB(e.v),t=function(e,t,n){e=6*MB(e,360),t=MB(t,100),n=MB(n,100);var r=Math.floor(e),i=e-r,o=n*(1-t),a=n*(1-i*t),s=n*(1-(1-i)*t),l=r%6,c=[n,a,o,o,s,n][l],u=[s,n,n,a,o,o][l],d=[o,o,s,n,n,a][l];return{r:255*c,g:255*u,b:255*d}}(e.h,r,i),a=!0,s="hsv"):YB(e.h)&&YB(e.s)&&YB(e.l)&&(r=xB(e.s),o=xB(e.l),t=function(e,t,n){var r,i,o;function a(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=MB(e,360),t=MB(t,100),n=MB(n,100),0===t)r=i=o=n;else{var s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;r=a(l,s,e+1/3),i=a(l,s,e),o=a(l,s,e-1/3)}return{r:255*r,g:255*i,b:255*o}}(e.h,r,o),a=!0,s="hsl"),e.hasOwnProperty("a")&&(n=e.a));return n=_B(n),{ok:a,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function sB(e,t,n){e=MB(e,255),t=MB(t,255),n=MB(n,255);var r,i,o=Math.max(e,t,n),a=Math.min(e,t,n),s=(o+a)/2;if(o==a)r=i=0;else{var l=o-a;switch(i=s>.5?l/(2-o-a):l/(o+a),o){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return{h:r,s:i,l:s}}function lB(e,t,n){e=MB(e,255),t=MB(t,255),n=MB(n,255);var r,i,o=Math.max(e,t,n),a=Math.min(e,t,n),s=o,l=o-a;if(i=0===o?0:l/o,o==a)r=0;else{switch(o){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return{h:r,s:i,v:s}}function cB(e,t,n,r){var i=[DB(Math.round(e).toString(16)),DB(Math.round(t).toString(16)),DB(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function uB(e,t,n,r){return[DB(IB(r)),DB(Math.round(e).toString(16)),DB(Math.round(t).toString(16)),DB(Math.round(n).toString(16))].join("")}function dB(e,t){t=0===t?0:t||10;var n=aB(e).toHsl();return n.s-=t/100,n.s=TB(n.s),aB(n)}function pB(e,t){t=0===t?0:t||10;var n=aB(e).toHsl();return n.s+=t/100,n.s=TB(n.s),aB(n)}function hB(e){return aB(e).desaturate(100)}function fB(e,t){t=0===t?0:t||10;var n=aB(e).toHsl();return n.l+=t/100,n.l=TB(n.l),aB(n)}function mB(e,t){t=0===t?0:t||10;var n=aB(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),aB(n)}function gB(e,t){t=0===t?0:t||10;var n=aB(e).toHsl();return n.l-=t/100,n.l=TB(n.l),aB(n)}function yB(e,t){var n=aB(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,aB(n)}function AB(e){var t=aB(e).toHsl();return t.h=(t.h+180)%360,aB(t)}function vB(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=aB(e).toHsl(),r=[aB(e)],i=360/t,o=1;o<t;o++)r.push(aB({h:(n.h+o*i)%360,s:n.s,l:n.l}));return r}function bB(e){var t=aB(e).toHsl(),n=t.h;return[aB(e),aB({h:(n+72)%360,s:t.s,l:t.l}),aB({h:(n+216)%360,s:t.s,l:t.l})]}function wB(e,t,n){t=t||6,n=n||30;var r=aB(e).toHsl(),i=360/n,o=[aB(e)];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(aB(r));return o}function EB(e,t){t=t||6;for(var n=aB(e).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/t;t--;)a.push(aB({h:r,s:i,v:o})),o=(o+s)%1;return a}aB.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,t=r.g/255,n=r.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=_B(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=lB(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=lB(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=sB(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=sB(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return cB(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,r,i){var o=[DB(Math.round(e).toString(16)),DB(Math.round(t).toString(16)),DB(Math.round(n).toString(16)),DB(IB(r))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*MB(this._r,255))+"%",g:Math.round(100*MB(this._g,255))+"%",b:Math.round(100*MB(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*MB(this._r,255))+"%, "+Math.round(100*MB(this._g,255))+"%, "+Math.round(100*MB(this._b,255))+"%)":"rgba("+Math.round(100*MB(this._r,255))+"%, "+Math.round(100*MB(this._g,255))+"%, "+Math.round(100*MB(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(CB[cB(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+uB(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var i=aB(e);n="#"+uB(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return aB(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(fB,arguments)},brighten:function(){return this._applyModification(mB,arguments)},darken:function(){return this._applyModification(gB,arguments)},desaturate:function(){return this._applyModification(dB,arguments)},saturate:function(){return this._applyModification(pB,arguments)},greyscale:function(){return this._applyModification(hB,arguments)},spin:function(){return this._applyModification(yB,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(wB,arguments)},complement:function(){return this._applyCombination(AB,arguments)},monochromatic:function(){return this._applyCombination(EB,arguments)},splitcomplement:function(){return this._applyCombination(bB,arguments)},triad:function(){return this._applyCombination(vB,[3])},tetrad:function(){return this._applyCombination(vB,[4])}},aB.fromRatio=function(e,t){if("object"==rB(e)){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]="a"===r?e[r]:xB(e[r]));e=n}return aB(e,t)},aB.equals=function(e,t){return!(!e||!t)&&aB(e).toRgbString()==aB(t).toRgbString()},aB.random=function(){return aB.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},aB.mix=function(e,t,n){n=0===n?0:n||50;var r=aB(e).toRgb(),i=aB(t).toRgb(),o=n/100;return aB({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})},aB.readability=function(e,t){var n=aB(e),r=aB(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},aB.isReadable=function(e,t,n){var r,i,o=aB.readability(e,t);switch(i=!1,(r=function(e){var t,n;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==n&&"large"!==n&&(n="small");return{level:t,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},aB.mostReadable=function(e,t,n){var r,i,o,a,s=null,l=0;i=(n=n||{}).includeFallbackColors,o=n.level,a=n.size;for(var c=0;c<t.length;c++)(r=aB.readability(e,t[c]))>l&&(l=r,s=aB(t[c]));return aB.isReadable(e,s,{level:o,size:a})||!i?s:(n.includeFallbackColors=!1,aB.mostReadable(e,["#fff","#000"],n))};var kB=aB.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},CB=aB.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(kB);function _B(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function MB(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function TB(e){return Math.min(1,Math.max(0,e))}function SB(e){return parseInt(e,16)}function DB(e){return 1==e.length?"0"+e:""+e}function xB(e){return e<=1&&(e=100*e+"%"),e}function IB(e){return Math.round(255*parseFloat(e)).toString(16)}function LB(e){return SB(e)/255}var PB,OB,RB,BB=(OB="[\\s|\\(]+("+(PB="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+PB+")[,|\\s]+("+PB+")\\s*\\)?",RB="[\\s|\\(]+("+PB+")[,|\\s]+("+PB+")[,|\\s]+("+PB+")[,|\\s]+("+PB+")\\s*\\)?",{CSS_UNIT:new RegExp(PB),rgb:new RegExp("rgb"+OB),rgba:new RegExp("rgba"+RB),hsl:new RegExp("hsl"+OB),hsla:new RegExp("hsla"+RB),hsv:new RegExp("hsv"+OB),hsva:new RegExp("hsva"+RB),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function YB(e){return!!BB.CSS_UNIT.exec(e)}const NB=new Map,VB=e=>{if(!NB.has(e)){const t=aB.readability(e,"#000000"),n=aB.readability(e,"#FFFFFF");NB.set(e,{contrastWithBlack:t,contrastWithWhite:n})}const{contrastWithBlack:t,contrastWithWhite:n}=NB.get(e);return t>n},FB=e=>(VB(e)?aB(e).lighten():aB(e).darken()).toHslString(),jB=e=>(VB(e)?aB(e).darken():aB(e).lighten()).toHslString(),HB=e=>{const t=aB(e);return`linear-gradient(185deg, ${t.clone().brighten(4)}, ${t.clone()})`},qB=e=>{const t=aB(e).toHsl();return t.l>.92?(t.l=Math.max(0,t.l-.08),aB(t).toHslString()):t.l<.12?(t.l=Math.min(1,t.l+.18),aB(t).toHslString()):(VB(e)?t.l=Math.min(1,t.l+.08):t.l=Math.max(0,t.l-.08),aB(t).toHslString())},GB=e=>{const t=aB(e).toHsl();return t.l=.9,aB(t).toHslString()},zB=(e,t)=>{const n=t.textDark||"#1A1A1A",r=t.textLight||"#FFFFFF",i=aB.readability(e,r),o=aB.readability(e,n);if(i>=4.5||o>=4.5)return i>o?r:n;return aB.readability(e,"#FFFFFF")>aB.readability(e,"#000000")?"#FFFFFF":"#000000"},UB=(e,t)=>{let n=e,r=aB.readability(e,t);const i=(e,i)=>{let o=e;for(let e=0;e<20;e++){o=i(o);const e=aB.readability(o,t);if(e>=4.5)return o;e>r&&(r=e,n=o)}return n};return n=i(e,e=>aB(e).darken(5).toHexString()),n=i(e,e=>aB(e).lighten(5).toHexString()),n},WB=(e={})=>{const t=document?.documentElement?.dir,n=document?.body?.dir;let r="radial-gradient(204.5% 136.79% at 0.53% 95.79%, #EDECF9 0%, #BFBAFF 31.77%, #2152E3 65.63%, #05309E 100%)";("rtl"===t||"rtl"===n)&&(r="radial-gradient(at right 95.79%, hsl(225, 80%, 32%) 0%, #2455E6 34.37%, hsl(225, 80%, 72%) 68.23%, hsl(225, 79%, 92%) 100%)");const i="#1A1A1A",o="#FFFFFF",a=i,s=o;return e.primaryColor&&"#2455E6"!==e.primaryColor&&!e.backgroundHome&&(r=aB(e.primaryColor).isLight()?`radial-gradient(204.5% 136.79% at 0.53% 95.79%, ${aB(e.primaryColor).lighten(20).toHslString()} 0%, ${e.primaryColor} 31.77%, ${aB(e.primaryColor).darken(20).toHslString()} 65.63%, ${aB(e.primaryColor).darken(40).toHslString()} 100%)`:`radial-gradient(204.5% 136.79% at 0.53% 95.79%, ${aB(e.primaryColor).lighten(40).toHslString()} 0%, ${aB(e.primaryColor).lighten(20).toHslString()} 31.77%, ${e.primaryColor} 65.63%, ${aB(e.primaryColor).darken(20).toHslString()} 100%)`),e.primaryColor||(e.primaryColor="#2455E6"),e.primaryColorHover||(e.primaryColorHover=qB(e.primaryColor)),e.primaryColorDisabled||(e.primaryColorDisabled=GB(e.primaryColor)),e.primaryContrastColor||(e.primaryContrastColor=zB(e.primaryColor,e)),e.primaryColorFocus||(e.primaryColorFocus=UB(e.primaryColor,e.white||"#FFFFFF")),e.secondaryColor||(e.secondaryColor="#1A1A1A"),e.secondaryColorHover||(e.secondaryColorHover=qB(e.secondaryColor)),e.secondaryColorDisabled||(e.secondaryColorDisabled=GB(e.secondaryColor)),e.secondaryContrastColor||(e.secondaryContrastColor=zB(e.secondaryColor,e)),e.backgroundHome||(e.backgroundHome=r),e.backgroundWebchat||(e.backgroundWebchat="#FFFFFF"),e.backgroundBotMessage||(e.backgroundBotMessage="#FFFFFF"),e.backgroundUserMessage||(e.backgroundUserMessage="#E8EBFF"),e.backgroundEngagementMessage||(e.backgroundEngagementMessage="#FFFFFF"),e.textLink||(e.textLink="#6688ED"),e.textLinkHover||(e.textLinkHover="#1947D2"),e.textLinkDisabled||(e.textLinkDisabled="#D1DCFA"),e.black10||(e.black10=i),e.black20||(e.black20="#333333"),e.black40||(e.black40="#666666"),e.black50||(e.black50="#808080"),e.black60||(e.black60="#999999"),e.black80||(e.black80="#CCCCCC"),e.black95||(e.black95="#F2F2F2"),e.white||(e.white=o),e.textDark||(e.textDark=a),e.textLight||(e.textLight=s),e.green||(e.green="#009918"),e.green10||(e.green10="#E5F5E8"),e.red||(e.red="#FF0000"),e.red10||(e.red10="#FFE5E5"),e.red20||(e.red20="#E55050"),e.red30||(e.red30="#E02E2E"),e.red40||(e.red40="#B22F2F"),e.primaryWeakColor||(e.primaryWeakColor=jB(e.primaryColor)),e.primaryStrongColor||(e.primaryStrongColor=FB(e.primaryColor)),e.primaryGradient||(e.primaryGradient=HB(e.primaryColor)),e.primaryStrongGradient||(e.primaryStrongGradient=HB(e.primaryStrongColor)),e.shadow||(e.shadow="0 5px 18px 0 rgba(151, 124, 156, 0.2), 0 5px 32px 0 rgba(203, 195, 212, 0.2), 0 8px 58px 0 rgba(216, 212, 221, 0.1)"),e.messageShadow||(e.messageShadow="0 5px 9px 0 rgba(151,124,156,0.1), 0 5px 16px 0 rgba(203,195,212,0.1), 0 8px 20px 0 rgba(216,212,221,0.1)"),e.greyColor||(e.greyColor="#e6e6e6"),e.greyWeakColor||(e.greyWeakColor=jB(e.greyColor)),e.greyStrongColor||(e.greyStrongColor=FB(e.greyColor)),e.greyContrastColor||(e.greyContrastColor=zB(e.greyColor,e)),e.unitSize||(e.unitSize=8),e.blockSize||(e.blockSize=7*e.unitSize),e.cornerSize||(e.cornerSize=e.unitSize/2),e.fontFamily||(e.fontFamily="Figtree, sans-serif"),e};var QB,ZB=["title","titleId"];function JB(){return JB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},JB.apply(null,arguments)}const KB=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,ZB);return r.createElement("svg",JB({xmlns:"http://www.w3.org/2000/svg",width:20,height:22,fill:"none","aria-hidden":"true",viewBox:"0 0 20 22","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,QB||(QB=r.createElement("path",{fill:"#252525",d:"M1 5V4a1 1 0 0 0-1 1zm18 0h1a1 1 0 0 0-1-1zm0 3v1a1 1 0 0 0 1-1zM1 8H0a1 1 0 0 0 1 1zm8 4a1 1 0 1 0-2 0zm-2 5a1 1 0 1 0 2 0zm6-5a1 1 0 1 0-2 0zm-2 5a1 1 0 1 0 2 0zM1 6h6V4H1zm7-1V2H6v3zm0-3h4V0H8zm4 0v3h2V2zm1 4h6V4h-6zm5-1v3h2V5zm1 2h-2v2h2zm-3 1v11h2V8zm-1 12H5v2h10zM4 19V8H2v11zM3 7H1v2h2zM2 8V5H0v3zm1 1h14V7H3zm4 3v5h2v-5zm4 0v5h2v-5zm2-8H7v2h6zM5 20a1 1 0 0 1-1-1H2a3 3 0 0 0 3 3zm11-1a1 1 0 0 1-1 1v2a3 3 0 0 0 3-3zM12 2h2a2 2 0 0 0-2-2zM8 2V0a2 2 0 0 0-2 2z"})))},XB=TM;function $B(){return $B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$B.apply(null,arguments)}const eY=Ye.div(({theme:e})=>({alignItems:"center",borderBottom:`1px solid ${e.black80}`,backgroundColor:e.backgroundWebchat,position:"relative",color:zB(e.backgroundWebchat,e),display:"flex",flexShrink:0,fontSize:18,fontWeight:600,lineHeight:1.3,margin:0,padding:"20px 16px",resize:"vertical",textAlign:"center",zIndex:3,"& .webchat-header-logo-name-container":{alignItems:"center",display:"flex",flexDirection:"row",height:28,marginInline:"auto",gap:8,"& .webchat-header-logo":{borderRadius:"50%",width:28,height:28},"& .webchat-header-cognigy-logo":{borderRadius:"50%",width:28,height:28}},"&.slide-in-enter":{transform:"translateY(-100%)"},"&.slide-in-enter-active":{transform:"translateY(0%)",transition:"transform 400ms ease-out"},"&.slide-in-exit":{transform:"translateY(0%)"},"&.slide-in-exit-active":{transform:"translateY(-100%)",transition:"transform 400ms ease-out"}})),tY=Ye.div(()=>({display:"flex",gap:24})),nY=Ye.div(()=>({display:"flex",alignItems:"flex-start",gap:16})),rY=Ye(LO)(({theme:e,iconColor:t})=>({color:zB(e.backgroundWebchat,e),borderRadius:4,"&:focus-visible":{outline:`2px solid ${UB(e.primaryColor,e.backgroundWebchat)}`,outlineOffset:2},"& svg":{fill:t||zB(e.backgroundWebchat,e),width:16,height:16,"& path, & circle":{fill:t||zB(e.backgroundWebchat,e)}},padding:0})),iY=Ye.img(()=>({borderRadius:"50%",fontSize:12,width:28,height:28,marginInline:8})),oY=Ye(mm)(({theme:e})=>({"&:focus-visible":{outline:`2px solid ${UB(e.primaryColor,e.backgroundWebchat)}`,outlineOffset:2}})),aY=e=>{const{logoUrl:t,title:n,onClose:i,onMinimize:o,onGoBack:a,onSetShowChatOptionsScreen:s,closeButtonRef:l,menuButtonRef:c,chatToggleButtonRef:u,isChatOptionsButtonVisible:d,hideBackButton:p,showChatScreen:h,autoFocusScreenTitle:f,onDeleteAllConversations:m,...g}=e,y=XB(e=>e.config.settings.customTranslations?.ariaLabels),A=XB(e=>e.config.settings),v=r.useRef(null);return(0,r.useEffect)(()=>{if(f){const e=setTimeout(()=>{const e=v.current;e?.focus()},200);return()=>clearTimeout(e)}},[f]),r.createElement(r.Fragment,null,r.createElement(eY,$B({},g,{className:"webchat-header-bar"}),a&&!p&&r.createElement(tY,{style:{width:d?64:24}},r.createElement(rY,{"data-header-back-button":!0,onClick:a,className:"webchat-header-back-button cc-rtl-flip","aria-label":y?.goBack??"Go back",ref:l},r.createElement(GO,null))),r.createElement("div",{className:$R()("webchat-header-logo-name-container")},h&&(t?r.createElement(iY,{src:t,className:$R()("webchat-header-logo"),alt:""}):r.createElement(nB,{title:"Cognigy.AI Logo",role:"img",className:$R()("webchat-header-cognigy-logo")})),r.createElement(oY,{ref:v,variant:"h2-semibold",id:"webchatHeaderTitle",className:"webchat-header-title",margin:0,tabIndex:-1},n)),r.createElement(nY,null,g.isDeleteAllConversationsButtonVisible&&r.createElement(rY,{"data-header-delete-all-conversations-button":!0,onClick:m,"aria-label":y?.deleteAllConversations??"Delete all conversations",className:"webchat-header-delete-all-conversations-button",iconColor:g.deleteIconColor,tabIndex:0,ref:g.deleteButtonRef},r.createElement(KB,null)),d&&r.createElement(rY,{"data-header-menu-button":!0,onClick:()=>{s?.(!0)},"aria-label":y?.chatOptions??A.chatOptions.title,ref:c},r.createElement(QO,null)),o&&r.createElement(rY,{"data-header-minimize-button":!0,onClick:o,className:"webchat-header-minimize-button","aria-label":y?.minimizeChat??"Minimize chat"},r.createElement(FO,null)),i&&r.createElement(rY,{"data-header-close-button":!0,onClick:()=>{i?.(),u?.current?.focus?.()},className:"webchat-header-close-button","aria-label":y?.closeChat??"Close chat",ref:l},r.createElement(BO,null)))),r.createElement(ZR,null))},sY=Ye.div({}),lY=Ye(sY)(({theme:e,chatWindowWidth:t})=>{const n=t??460;return{display:"flex",flexDirection:"column",backgroundColor:e.backgroundWebchat,overflow:"hidden",fontSize:16,fontFamily:e.fontFamily,overscrollBehavior:"contain","@media screen and (min-width: 576px)":{width:n},[`@media screen and (min-width: 576px) and (max-width: ${n+40}px)`]:{width:"90%",right:"5%"}}}),cY=e=>{const[t,n]=(0,r.useState)(!0),[i,o]=(0,r.useState)(!1),a=(0,r.useRef)(0),s=(0,r.useRef)(null);return(0,r.useEffect)(()=>{const t=()=>{if(!e.current)return;const{scrollTop:t,scrollHeight:r,clientHeight:i}=e.current,a=r-t-i<=20;n(a),a&&o(!1)},r=()=>{if(!e.current)return;const n=e.current.scrollTop;n<a.current&&o(!0),a.current=n,s.current&&clearTimeout(s.current),s.current=setTimeout(t,150)},i=e.current;if(!i)return;i.addEventListener("scroll",r);const l=new ResizeObserver(r),c=new MutationObserver(r);return l.observe(i),c.observe(i,{childList:!0,subtree:!0}),t(),()=>{i.removeEventListener("scroll",r),l.disconnect(),c.disconnect(),s.current&&clearTimeout(s.current)}},[e]),{isAtBottom:t,userScrolledUp:i}};function uY(){return uY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uY.apply(null,arguments)}const dY=Ye.div(({theme:e})=>t=>({overflowY:"auto",flexGrow:1,minHeight:0,height:e.blockSize,outline:t.showFocusOutline?`2px auto ${e.primaryColorFocus}`:"none",outlineOffset:-1})),pY=Ye.div(({theme:e})=>({paddingBottom:2*e.unitSize,"&:focus":{outline:"none"}})),hY=Ye("button")(({theme:e})=>({position:"absolute",zIndex:10,bottom:"110px",left:"50%",transform:"translateX(-50%)",backgroundColor:e.primaryColor,color:e.primaryContrastColor,border:"none",borderRadius:"50%",width:"30px",height:"30px",cursor:"pointer",boxShadow:"0 2px 5px rgba(0,0,0,0.2)","&:hover":{backgroundColor:e.primaryStrongColor},"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2,boxShadow:"0 0 0 4px white"}}));const fY=({children:e,isAtBottom:t,onScrollToBottom:n})=>{const i=XB(e=>e.config.settings.customTranslations?.ariaLabels?.scrollToBottom),o=!1===XB(e=>e.config.settings.behavior.enableScrollButton),[a,s]=(0,r.useState)(0);return(0,r.useEffect)(()=>{const e=new MutationObserver(()=>{const t=document.querySelector(".webchat-input");t&&((e=>{const t=new ResizeObserver(e=>{for(const t of e)s(t.contentRect.height)});t.observe(e)})(t),e.disconnect())});return e.observe(document.body,{childList:!0,subtree:!0}),()=>e.disconnect()},[]),r.createElement("div",null,e,!t&&!o&&r.createElement(hY,{className:"webchat-scroll-to-bottom-button",onClick:n,"aria-label":i??"Scroll to the bottom of the chat",style:{bottom:`${a+50}px`}},"↓"))},mY=Ye(function({children:e,lastInputId:t,scrollBehavior:n,...i}){const o=(0,r.useRef)(null),a=(0,r.useRef)(null),[s,l]=(0,r.useState)(!1),[c,u]=(0,r.useState)(!1),{isAtBottom:d,userScrolledUp:p}=cY(a),h=(0,r.useRef)(t);(0,r.useEffect)(()=>{u(!1)},[t]),(0,r.useEffect)(()=>{const e=t!==h.current;if(h.current=t,e&&a.current)setTimeout(()=>{if(!a.current)return;const e=a.current.scrollHeight-a.current.clientHeight;f(e)},0);else if(!p&&a.current)if("alwaysScroll"===n||c){const e=a.current.scrollHeight-a.current.clientHeight;f(e)}else if(!c&&t){const e=document.getElementById(t);if(e){const t=e.offsetTop-a.current.offsetTop;t>a.current.scrollTop&&f(t)}}},[e,n,t]);const f=e=>{a.current&&a.current.scrollTo({top:e,behavior:"smooth"})};return r.createElement(dY,uY({ref:a},i,{showFocusOutline:s}),r.createElement(pY,{ref:o,id:"webchatChatHistoryWrapperLiveLogPanel",role:"region",tabIndex:(()=>{if(!a.current||!o.current)return!1;const e=a.current.clientHeight;return o.current.scrollHeight>e})()?0:-1,"aria-labelledby":"webchatChatHistoryHeading",onFocus:()=>{o.current===document.activeElement&&l(!0)},onBlur:()=>{l(!1)}},r.createElement(fY,{isAtBottom:d,onScrollToBottom:()=>{if(u(!0),a.current){const e=a.current?.scrollHeight-a.current?.clientHeight;f(e)}}},e)))})(({theme:e})=>({}));var gY=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t,n=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(n,t),this.tags.push(n)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var i=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(r);try{var o=105===e.charCodeAt(1)&&64===e.charCodeAt(0);i.insertRule(e,o?0:i.cssRules.length)}catch(e){0}}else r.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0},e}();const yY=function(e){function t(e,r,l,c,p){for(var h,f,m,g,b,E=0,k=0,C=0,_=0,M=0,L=0,O=m=h=0,B=0,Y=0,N=0,V=0,F=l.length,j=F-1,H="",q="",G="",z="";B<F;){if(f=l.charCodeAt(B),B===j&&0!==k+_+C+E&&(0!==k&&(f=47===k?10:47),_=C=E=0,F++,j++),0===k+_+C+E){if(B===j&&(0<Y&&(H=H.replace(d,"")),0<H.trim().length)){switch(f){case 32:case 9:case 59:case 13:case 10:break;default:H+=l.charAt(B)}f=59}switch(f){case 123:for(h=(H=H.trim()).charCodeAt(0),m=1,V=++B;B<F;){switch(f=l.charCodeAt(B)){case 123:m++;break;case 125:m--;break;case 47:switch(f=l.charCodeAt(B+1)){case 42:case 47:e:{for(O=B+1;O<j;++O)switch(l.charCodeAt(O)){case 47:if(42===f&&42===l.charCodeAt(O-1)&&B+2!==O){B=O+1;break e}break;case 10:if(47===f){B=O+1;break e}}B=O}}break;case 91:f++;case 40:f++;case 34:case 39:for(;B++<j&&l.charCodeAt(B)!==f;);}if(0===m)break;B++}if(m=l.substring(V,B),0===h&&(h=(H=H.replace(u,"").trim()).charCodeAt(0)),64===h){switch(0<Y&&(H=H.replace(d,"")),f=H.charCodeAt(1)){case 100:case 109:case 115:case 45:Y=r;break;default:Y=I}if(V=(m=t(r,Y,m,f,p+1)).length,0<P&&(b=s(3,m,Y=n(I,H,N),r,S,T,V,f,p,c),H=Y.join(""),void 0!==b&&0===(V=(m=b.trim()).length)&&(f=0,m="")),0<V)switch(f){case 115:H=H.replace(w,a);case 100:case 109:case 45:m=H+"{"+m+"}";break;case 107:m=(H=H.replace(y,"$1 $2"))+"{"+m+"}",m=1===x||2===x&&o("@"+m,3)?"@-webkit-"+m+"@"+m:"@"+m;break;default:m=H+m,112===c&&(q+=m,m="")}else m=""}else m=t(r,n(r,H,N),m,c,p+1);G+=m,m=N=Y=O=h=0,H="",f=l.charCodeAt(++B);break;case 125:case 59:if(1<(V=(H=(0<Y?H.replace(d,""):H).trim()).length))switch(0===O&&(h=H.charCodeAt(0),45===h||96<h&&123>h)&&(V=(H=H.replace(" ",":")).length),0<P&&void 0!==(b=s(1,H,r,e,S,T,q.length,c,p,c))&&0===(V=(H=b.trim()).length)&&(H="\0\0"),h=H.charCodeAt(0),f=H.charCodeAt(1),h){case 0:break;case 64:if(105===f||99===f){z+=H+l.charAt(B);break}default:58!==H.charCodeAt(V-1)&&(q+=i(H,h,f,H.charCodeAt(2)))}N=Y=O=h=0,H="",f=l.charCodeAt(++B)}}switch(f){case 13:case 10:47===k?k=0:0===1+h&&107!==c&&0<H.length&&(Y=1,H+="\0"),0<P*R&&s(0,H,r,e,S,T,q.length,c,p,c),T=1,S++;break;case 59:case 125:if(0===k+_+C+E){T++;break}default:switch(T++,g=l.charAt(B),f){case 9:case 32:if(0===_+E+k)switch(M){case 44:case 58:case 9:case 32:g="";break;default:32!==f&&(g=" ")}break;case 0:g="\\0";break;case 12:g="\\f";break;case 11:g="\\v";break;case 38:0===_+k+E&&(Y=N=1,g="\f"+g);break;case 108:if(0===_+k+E+D&&0<O)switch(B-O){case 2:112===M&&58===l.charCodeAt(B-3)&&(D=M);case 8:111===L&&(D=L)}break;case 58:0===_+k+E&&(O=B);break;case 44:0===k+C+_+E&&(Y=1,g+="\r");break;case 34:case 39:0===k&&(_=_===f?0:0===_?f:_);break;case 91:0===_+k+C&&E++;break;case 93:0===_+k+C&&E--;break;case 41:0===_+k+E&&C--;break;case 40:if(0===_+k+E){if(0===h)if(2*M+3*L==533);else h=1;C++}break;case 64:0===k+C+_+E+O+m&&(m=1);break;case 42:case 47:if(!(0<_+E+C))switch(k){case 0:switch(2*f+3*l.charCodeAt(B+1)){case 235:k=47;break;case 220:V=B,k=42}break;case 42:47===f&&42===M&&V+2!==B&&(33===l.charCodeAt(V+2)&&(q+=l.substring(V,B+1)),g="",k=0)}}0===k&&(H+=g)}L=M,M=f,B++}if(0<(V=q.length)){if(Y=r,0<P&&(void 0!==(b=s(2,q,Y,e,S,T,V,c,p,c))&&0===(q=b).length))return z+q+G;if(q=Y.join(",")+"{"+q+"}",0!==x*D){switch(2!==x||o(q,2)||(D=0),D){case 111:q=q.replace(v,":-moz-$1")+q;break;case 112:q=q.replace(A,"::-webkit-input-$1")+q.replace(A,"::-moz-$1")+q.replace(A,":-ms-input-$1")+q}D=0}}return z+q+G}function n(e,t,n){var i=t.trim().split(m);t=i;var o=i.length,a=e.length;switch(a){case 0:case 1:var s=0;for(e=0===a?"":e[0]+" ";s<o;++s)t[s]=r(e,t[s],n).trim();break;default:var l=s=0;for(t=[];s<o;++s)for(var c=0;c<a;++c)t[l++]=r(e[c]+" ",i[s],n).trim()}return t}function r(e,t,n){var r=t.charCodeAt(0);switch(33>r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(g,"$1"+e.trim());case 58:return e.trim()+t.replace(g,"$1"+e.trim());default:if(0<1*n&&0<t.indexOf("\f"))return t.replace(g,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function i(e,t,n,r){var a=e+";",s=2*t+3*n+4*r;if(944===s){e=a.indexOf(":",9)+1;var l=a.substring(e,a.length-1).trim();return l=a.substring(0,e).trim()+l+";",1===x||2===x&&o(l,1)?"-webkit-"+l+l:l}if(0===x||2===x&&!o(a,1))return a;switch(s){case 1015:return 97===a.charCodeAt(10)?"-webkit-"+a+a:a;case 951:return 116===a.charCodeAt(3)?"-webkit-"+a+a:a;case 963:return 110===a.charCodeAt(5)?"-webkit-"+a+a:a;case 1009:if(100!==a.charCodeAt(4))break;case 969:case 942:return"-webkit-"+a+a;case 978:return"-webkit-"+a+"-moz-"+a+a;case 1019:case 983:return"-webkit-"+a+"-moz-"+a+"-ms-"+a+a;case 883:if(45===a.charCodeAt(8))return"-webkit-"+a+a;if(0<a.indexOf("image-set(",11))return a.replace(M,"$1-webkit-$2")+a;break;case 932:if(45===a.charCodeAt(4))switch(a.charCodeAt(5)){case 103:return"-webkit-box-"+a.replace("-grow","")+"-webkit-"+a+"-ms-"+a.replace("grow","positive")+a;case 115:return"-webkit-"+a+"-ms-"+a.replace("shrink","negative")+a;case 98:return"-webkit-"+a+"-ms-"+a.replace("basis","preferred-size")+a}return"-webkit-"+a+"-ms-"+a+a;case 964:return"-webkit-"+a+"-ms-flex-"+a+a;case 1023:if(99!==a.charCodeAt(8))break;return"-webkit-box-pack"+(l=a.substring(a.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+a+"-ms-flex-pack"+l+a;case 1005:return h.test(a)?a.replace(p,":-webkit-")+a.replace(p,":-moz-")+a:a;case 1e3:switch(t=(l=a.substring(13).trim()).indexOf("-")+1,l.charCodeAt(0)+l.charCodeAt(t)){case 226:l=a.replace(b,"tb");break;case 232:l=a.replace(b,"tb-rl");break;case 220:l=a.replace(b,"lr");break;default:return a}return"-webkit-"+a+"-ms-"+l+a;case 1017:if(-1===a.indexOf("sticky",9))break;case 975:switch(t=(a=e).length-10,s=(l=(33===a.charCodeAt(t)?a.substring(0,t):a).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|l.charCodeAt(7))){case 203:if(111>l.charCodeAt(8))break;case 115:a=a.replace(l,"-webkit-"+l)+";"+a;break;case 207:case 102:a=a.replace(l,"-webkit-"+(102<s?"inline-":"")+"box")+";"+a.replace(l,"-webkit-"+l)+";"+a.replace(l,"-ms-"+l+"box")+";"+a}return a+";";case 938:if(45===a.charCodeAt(5))switch(a.charCodeAt(6)){case 105:return l=a.replace("-items",""),"-webkit-"+a+"-webkit-box-"+l+"-ms-flex-"+l+a;case 115:return"-webkit-"+a+"-ms-flex-item-"+a.replace(k,"")+a;default:return"-webkit-"+a+"-ms-flex-line-pack"+a.replace("align-content","").replace(k,"")+a}break;case 973:case 989:if(45!==a.charCodeAt(3)||122===a.charCodeAt(4))break;case 931:case 953:if(!0===_.test(e))return 115===(l=e.substring(e.indexOf(":")+1)).charCodeAt(0)?i(e.replace("stretch","fill-available"),t,n,r).replace(":fill-available",":stretch"):a.replace(l,"-webkit-"+l)+a.replace(l,"-moz-"+l.replace("fill-",""))+a;break;case 962:if(a="-webkit-"+a+(102===a.charCodeAt(5)?"-ms-"+a:"")+a,211===n+r&&105===a.charCodeAt(13)&&0<a.indexOf("transform",10))return a.substring(0,a.indexOf(";",27)+1).replace(f,"$1-webkit-$2")+a}return a}function o(e,t){var n=e.indexOf(1===t?":":"{"),r=e.substring(0,3!==t?n:10);return n=e.substring(n+1,e.length-1),O(2!==t?r:r.replace(C,"$1"),n,t)}function a(e,t){var n=i(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return n!==t+";"?n.replace(E," or ($1)").substring(4):"("+t+")"}function s(e,t,n,r,i,o,a,s,l,u){for(var d,p=0,h=t;p<P;++p)switch(d=L[p].call(c,e,h,n,r,i,o,a,s,l,u)){case void 0:case!1:case!0:case null:break;default:h=d}if(h!==t)return h}function l(e){return void 0!==(e=e.prefix)&&(O=null,e?"function"!=typeof e?x=1:(x=2,O=e):x=0),l}function c(e,n){var r=e;if(33>r.charCodeAt(0)&&(r=r.trim()),r=[r],0<P){var i=s(-1,n,r,r,S,T,0,0,0,0);void 0!==i&&"string"==typeof i&&(n=i)}var o=t(I,r,n,0,0);return 0<P&&(void 0!==(i=s(-2,o,r,r,S,T,o.length,0,0,0))&&(o=i)),D=0,T=S=1,o}var u=/^\0+/g,d=/[\0\r\f]/g,p=/: */g,h=/zoo|gra/,f=/([,: ])(transform)/g,m=/,\r+?/g,g=/([\t\r\n ])*\f?&/g,y=/@(k\w+)\s*(\S*)\s*/,A=/::(place)/g,v=/:(read-only)/g,b=/[svh]\w+-[tblr]{2}/,w=/\(\s*(.*)\s*\)/g,E=/([\s\S]*?);/g,k=/-self|flex-/g,C=/[^]*?(:[rp][el]a[\w-]+)[^]*/,_=/stretch|:\s*\w+\-(?:conte|avail)/,M=/([^-])(image-set\()/,T=1,S=1,D=0,x=1,I=[],L=[],P=0,O=null,R=0;return c.use=function e(t){switch(t){case void 0:case null:P=L.length=0;break;default:if("function"==typeof t)L[P++]=t;else if("object"==typeof t)for(var n=0,r=t.length;n<r;++n)e(t[n]);else R=0|!!t}return e},c.set=l,void 0!==e&&l(e),c};var AY="/*|*/",vY=AY+"}";function bY(e){e&&wY.current.insert(e+"}")}var wY={current:null},EY=function(e,t,n,r,i,o,a,s,l,c){switch(e){case 1:switch(t.charCodeAt(0)){case 64:return wY.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===s)return t+AY;break;case 3:switch(s){case 102:case 112:return wY.current.insert(n[0]+t),"";default:return t+(0===c?AY:"")}case-2:t.split(vY).forEach(bY)}};const kY=function(e){void 0===e&&(e={});var t,n=e.key||"css";void 0!==e.prefix&&(t={prefix:e.prefix});var r=new yY(t);var i,o={};i=e.container||document.head;var a,s=document.querySelectorAll("style[data-emotion-"+n+"]");Array.prototype.forEach.call(s,function(e){e.getAttribute("data-emotion-"+n).split(" ").forEach(function(e){o[e]=!0}),e.parentNode!==i&&i.appendChild(e)}),r.use(e.stylisPlugins)(EY),a=function(e,t,n,i){var o=t.name;wY.current=n,r(e,t.styles),i&&(l.inserted[o]=!0)};var l={key:n,sheet:new gY({key:n,container:i,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:o,registered:{},insert:a};return l};function CY(){return CY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},CY.apply(null,arguments)}const _Y=e=>r.createElement(gC,CY({},e,{isFullscreen:!0})),MY=Ye.a(({theme:e})=>({display:"flex",alignItems:"baseline",alignSelf:"center",width:"fit-content",height:12,color:e.textDark,textDecoration:"none","&:focus, &:hover":{outline:"none",color:e.primaryColorFocus},"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2}})),TY=Ye.div(()=>({})),SY=`https://www.cognigy.com/?utm_campaign=CognigyWebchatEmbedded&utm_medium=webchat&utm_term=webchat&utm_content=webchat&utm_source=${window.location.hostname}`,DY=e=>{const{id:t,watermark:n,watermarkText:i,watermarkUrl:o}=e,a=XB(e=>e.config.settings.customTranslations?.ariaLabels);return"none"===n?r.createElement(TY,null):r.createElement(MY,{href:o||SY,target:"_blank","aria-label":`${i}. ${a?.opensInNewTab??"Opens in new tab"}`,id:t??"cognigyBrandingLink"},r.createElement(mm,{variant:"copy-medium",component:"span",fontSize:"0.625rem",lineHeight:"120%"},"custom"===n&&i?i:"Powered by Cognigy.AI"))},xY=(0,r.memo)(DY,()=>!0),IY=Ye(at)({minHeight:"auto",height:40,"&>*":{flexShrink:0}}),LY=Ye.div(({theme:e})=>({borderTop:`1px solid ${e.black80}`,backgroundColor:e.white,display:"flex",flexDirection:"column",gap:12,padding:"12px 20px",borderBottom:"2px solid transparent",borderBottomLeftRadius:2*e.unitSize,borderBottomRightRadius:2*e.unitSize,transition:"border-bottom .2s ease-out",zIndex:11,"&.webchat-input-stt-active":{backgroundColor:e.backgroundUserMessage},"&.webchat-input-text-active":{borderBottomColor:e.primaryColorFocus}})),PY=({messages:e,config:t,onSendMessage:n,plugins:i,inputMode:o,onSetInputMode:a,webchatTheme:s,onEmitAnalytics:l,sttActive:c,...u})=>{const d=XB(e=>e.input.textActive),p=Object.keys(u).length>0?u:void 0,h=i.filter(e=>"rule"===e.type).find(n=>n.rule({messages:e,config:t}));if(h){const e=(e,t)=>l(`plugin/${h.name||"unknown"}/${e}`,t);return r.createElement(h.component,{config:t,onSendMessage:n,attributes:p,theme:s,onEmitAnalytics:e})}const f=i.filter(e=>"select"===e.type),m=f.find(e=>e.id===o),g=f.length>1&&r.createElement(IY,null,f.map(e=>r.createElement(LO,{key:e.id,className:e===m?"active":"",onClick:()=>a(e.id)},r.createElement(e.icon,null))));return r.createElement(LY,{className:$R()("webchat-input",c&&"webchat-input-stt-active",d&&"webchat-input-text-active")},g,m&&r.createElement(m.component,{config:t,onSendMessage:n,attributes:p,theme:s,onEmitAnalytics:(e,t)=>l(`plugin/${m&&m.name||"unknown"}/${e}`,t)}),r.createElement(xY,{watermark:t.settings.layout.watermark,watermarkText:t.settings.layout.watermarkText,watermarkUrl:t.settings.layout.watermarkUrl}))};var OY,RY,BY=["title","titleId"];function YY(){return YY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},YY.apply(null,arguments)}const NY=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,BY);return r.createElement("svg",YY({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,"aria-hidden":"true",viewBox:"0 0 24 24","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,OY||(OY=r.createElement("path",{d:"M20 5H4c-1.1 0-1.99.9-1.99 2L2 17c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m-9 3h2v2h-2zm0 3h2v2h-2zM8 8h2v2H8zm0 3h2v2H8zm-1 2H5v-2h2zm0-3H5V8h2zm9 7H8v-2h8zm0-4h-2v-2h2zm0-3h-2V8h2zm3 3h-2v-2h2zm0-3h-2V8h2z"})),RY||(RY=r.createElement("path",{fill:"none",d:"M0 0h24v24H0zm0 0h24v24H0z"})))};var VY,FY,jY=["title","titleId"];function HY(){return HY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},HY.apply(null,arguments)}const qY=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,jY);return r.createElement("svg",HY({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,"aria-hidden":"true",viewBox:"0 0 16 16","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,VY||(VY=r.createElement("g",{clipPath:"url(#a)"},r.createElement("path",{fillRule:"evenodd",d:"M15 8a.82.82 0 0 1-.38.696L3.481 15.745c-1.267.802-2.84-.414-2.41-1.863L2.815 8 1.072 2.118C.642.668 2.215-.547 3.482.255l11.137 7.05c.237.15.381.412.381.695m-10.737.82-1.64 5.533 8.743-5.533zm7.103-1.64H4.263l-1.64-5.533z",clipRule:"evenodd"}))),FY||(FY=r.createElement("defs",null,r.createElement("clipPath",{id:"a"},r.createElement("path",{fill:"#fff",d:"M0 0h16v16H0z"})))))};var GY,zY=["title","titleId"];function UY(){return UY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},UY.apply(null,arguments)}const WY=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,zY);return r.createElement("svg",UY({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,"aria-hidden":"true",viewBox:"0 0 16 16","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,GY||(GY=r.createElement("g",{fillRule:"evenodd",clipRule:"evenodd"},r.createElement("path",{d:"M8 0a3 3 0 0 0-3 3v5.5a3 3 0 1 0 6 0V3a3 3 0 0 0-3-3m0 1.5A1.5 1.5 0 0 0 6.5 3v5.5a1.5 1.5 0 1 0 3 0V3A1.5 1.5 0 0 0 8 1.5"}),r.createElement("path",{d:"M3.75 8a.75.75 0 0 0-1.5 0 5.75 5.75 0 0 0 5 5.701v.799H4A.75.75 0 0 0 4 16h8a.75.75 0 0 0 0-1.5H8.75v-.799c2.821-.367 5-2.78 5-5.701a.75.75 0 0 0-1.5 0 4.25 4.25 0 0 1-8.5 0"}))))};var QY,ZY,JY=["title","titleId"];function KY(){return KY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KY.apply(null,arguments)}const XY=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,JY);return r.createElement("svg",KY({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,"aria-hidden":"true",viewBox:"0 0 24 24","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,QY||(QY=r.createElement("path",{fill:"none",d:"M0 0h24v24H0z"})),ZY||(ZY=r.createElement("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"})))};var $Y,eN=["title","titleId"];function tN(){return tN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tN.apply(null,arguments)}const nN=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,eN);return r.createElement("svg",tN({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,"aria-hidden":"true",viewBox:"0 0 16 16","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,$Y||($Y=r.createElement("path",{fillRule:"evenodd",d:"M4.096 2.322C4.432 1.548 5.232.25 6.833.25c1.744 0 2.536 1.53 2.828 2.292.222.58.256 1.174.256 1.678v6.613a1.917 1.917 0 1 1-3.834 0V4a.75.75 0 0 1 1.5 0v6.833a.417.417 0 1 0 .834 0V4.22c0-.454-.035-.825-.156-1.14-.276-.718-.728-1.33-1.428-1.33-.64 0-1.072.504-1.362 1.17-.18.414-.221.904-.221 1.505V11.5a2.75 2.75 0 1 0 5.5 0V4a.75.75 0 0 1 1.5 0v7.5a4.25 4.25 0 0 1-8.5 0V4.425c0-.63.034-1.387.346-2.103",clipRule:"evenodd"})))};var rN=r.useLayoutEffect,iN=function(e,t){"function"!=typeof e?e.current=t:e(t)},oN={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},aN=function(e){Object.keys(oN).forEach(function(t){e.style.setProperty(t,oN[t],"important")})},sN=null,lN=function(e,t){var n=e.scrollHeight;return"border-box"===t.sizingStyle.boxSizing?n+t.borderSize:n-t.paddingSize};var cN=function(){},uN=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],dN=!!document.documentElement.currentStyle,pN=function(e){var t=window.getComputedStyle(e);if(null===t)return null;var n=function(e,t){return e.reduce(function(e,n){return e[n]=t[n],e},{})}(uN,t),r=n.boxSizing;return""===r?null:(dN&&"border-box"===r&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+"px"),{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)})};function hN(e,t,n){var i,o,a=(i=n,o=r.useRef(i),rN(function(){o.current=i}),o);r.useLayoutEffect(function(){var n=function(e){return a.current(e)};if(e)return e.addEventListener(t,n),function(){return e.removeEventListener(t,n)}},[])}var fN,mN,gN=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],yN=function(e,t){var n=e.cacheMeasurements,i=e.maxRows,o=e.minRows,a=e.onChange,l=void 0===a?cN:a,c=e.onHeightChange,u=void 0===c?cN:c,d=j_(e,gN),p=void 0!==d.value,h=r.useRef(null),f=function(e,t){var n=r.useRef();return r.useCallback(function(r){e.current=r,n.current&&iN(n.current,null),n.current=t,t&&iN(t,r)},[t])}(h,t),m=r.useRef(0),g=r.useRef(),y=function(){var e=h.current,t=n&&g.current?g.current:pN(e);if(t){g.current=t;var r=function(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=1/0),sN||((sN=document.createElement("textarea")).setAttribute("tabindex","-1"),sN.setAttribute("aria-hidden","true"),aN(sN)),null===sN.parentNode&&document.body.appendChild(sN);var i=e.paddingSize,o=e.borderSize,a=e.sizingStyle,s=a.boxSizing;Object.keys(a).forEach(function(e){var t=e;sN.style[t]=a[t]}),aN(sN),sN.value=t;var l=lN(sN,e);sN.value=t,l=lN(sN,e),sN.value="x";var c=sN.scrollHeight-i,u=c*n;"border-box"===s&&(u=u+i+o),l=Math.max(u,l);var d=c*r;return"border-box"===s&&(d=d+i+o),[l=Math.min(d,l),c]}(t,e.value||e.placeholder||"x",o,i),a=r[0],s=r[1];m.current!==a&&(m.current=a,e.style.setProperty("height",a+"px","important"),u(a,{rowHeight:s}))}};return r.useLayoutEffect(y),function(e,t){hN(document.body,"reset",function(n){e.current.form===n.target&&t(n)})}(h,function(){if(!p){var e=h.current.value;requestAnimationFrame(function(){var t=h.current;t&&e!==t.value&&y()})}}),function(e){hN(window,"resize",e)}(y),function(e){hN(document.fonts,"loadingdone",e)}(y),r.createElement("textarea",s({},d,{onChange:function(e){p||y(),l(e)},ref:f}))},AN=r.forwardRef(yN),vN=["title","titleId"];function bN(){return bN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bN.apply(null,arguments)}const wN=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,vN);return r.createElement("svg",bN({xmlns:"http://www.w3.org/2000/svg",width:10,height:11,fill:"none","aria-hidden":"true",viewBox:"0 0 10 11","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,fN||(fN=r.createElement("path",{fill:"#1A1A1A",fillRule:"evenodd",d:"M9.204 1.308a.625.625 0 0 1 0 .884L1.691 9.705a.625.625 0 0 1-.884-.884L8.32 1.308a.625.625 0 0 1 .884 0",clipRule:"evenodd"})),mN||(mN=r.createElement("path",{fill:"#1A1A1A",fillRule:"evenodd",d:"M9.204 9.705a.625.625 0 0 1-.884 0L.807 2.192a.625.625 0 1 1 .884-.884l7.513 7.513a.625.625 0 0 1 0 .884",clipRule:"evenodd"})))},EN=Ye.div(()=>({height:2,width:"100%",backgroundColor:"#e0e0de",borderRadius:50,position:"absolute",bottom:0,left:0})),kN=Ye.div(({theme:e,progressPercentage:t})=>({height:"100%",width:`${t}%`,backgroundColor:e.primaryColor,borderRadius:"inherit",textAlign:"right"}));class CN extends r.PureComponent{render(){const{progressPercentage:e}=this.props;return r.createElement(EN,null,r.createElement(kN,{progressPercentage:e}))}}const _N=CN,MN=Ye.div(({theme:e})=>({display:"flex",flexDirection:"row",overflowX:"auto",overflowY:"hidden",alignItems:"center",gap:12,"&::-webkit-scrollbar":{width:2,height:2,visibility:"hidden"},"&:hover":{"&::-webkit-scrollbar-track":{backgroundColor:e.black95},"&::-webkit-scrollbar-thumb":{backgroundColor:e.black60}}})),TN=Ye.div(({theme:e})=>({position:"relative",overflow:"hidden",borderRadius:15,height:33,backgroundColor:e.black95,"&:focus-within":{backgroundColor:e.black80}})),SN=Ye.div(()=>({display:"flex",alignItems:"center",justifyContent:"center",gap:12,padding:"0 12px 0 6px",height:"100%"})),DN=Ye(mm)(({hasUploadError:e,theme:t})=>({whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:e?t.red40:t.black10,alignSelf:"center"})),xN=Ye(mm)(({theme:e})=>({color:e.black40,alignSelf:"center",textWrap:"nowrap"})),IN=Ye(LO)(({theme:e})=>({padding:0,marginRight:-6,"& svg":{width:12,height:12},"&:focus, &:hover":{"& path":{fill:`${e.primaryColor} !important`,outline:"none"}}})),LN=()=>{const e=(0,r.useRef)([]),t=TM(e=>e.input.fileList),n=TM(e=>e.config.settings.customTranslations?.ariaLabels?.removeFileAttachment),i=kM(),o=e=>{i((e=>({type:tI,index:e}))(e))};return r.createElement(MN,null,t?.map((t,i)=>r.createElement(TN,{key:i,id:`filePreview${i}`},r.createElement(SN,null,r.createElement(IN,{onClick:()=>o(i),onFocus:()=>{e.current[i]&&e.current[i].scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})},"aria-label":`${n??"Remove file attachment"} ${i+1}`,ref:t=>{t&&(e.current[i]=t)}},r.createElement(wN,null)),r.createElement(DN,{component:"span",variant:"title2-regular",hasUploadError:t.hasUploadError},t.hasUploadError?t.uploadErrorReason:`${(e=>{const t=e.split(".");return t.length>1?`${t.slice(0,-1).join(".")}.`:e})(t.file.name)}${(e=>{const t=e.split(".");return t.length>1?t.pop():null})(t.file.name)}`),r.createElement(xN,{component:"span",variant:"title2-regular"},t.file.size>1e6?`${(t.file.size/1e6).toFixed(2)} MB`:`${(t.file.size/1e3).toFixed(2)} KB`)),t.progressPercentage&&100!==t.progressPercentage&&!t.hasUploadError&&r.createElement(_N,{progressPercentage:t.progressPercentage}))))};var PN=i(3546),ON=i.n(PN);const RN=Ye.div(({theme:e})=>({minHeight:0,flexGrow:1,maxHeight:3*e.blockSize,overflowY:"auto",overscrollBehavior:"contain",paddingBottom:e.unitSize,"&:focus":{outline:"none"},marginRight:"-20px"})),BN=Ye.div(({theme:e})=>({"> div":{flexDirection:"column"},paddingLeft:e.unitSize})),YN=({title:e,menuItems:t,onSelect:n})=>{const i=r.useRef(null),o=t.map(e=>({title:e.title,type:"postback",payload:e.payload}));return r.createElement(RN,{className:"webchat-input-persistent-menu",tabIndex:-1},r.createElement(mm,{variant:"body-semibold",component:"h3",marginTop:4,marginLeft:8},e),r.createElement(BN,{"aria-labelledby":"persistentMenuTitle",role:"menu",ref:i,onKeyDown:e=>{const{key:t,target:n}=e;let r=null;if(i.current){switch(t){case"ArrowUp":r=n.previousElementSibling||i.current.lastChild;break;case"ArrowDown":r=n.nextElementSibling||i.current.firstChild;break;case"Home":r=i.current.firstChild;break;case"End":r=i.current.lastChild}null!==r&&(r.focus(),e.preventDefault())}}},r.createElement(xm,{buttonClassName:"webchat-input-persistent-menu-item",containerClassName:"webchat-input-persistent-menu-item-container",payload:o,config:{},onEmitAnalytics:()=>{},action:e=>{const r=t.find(t=>t.payload===e);r&&n(r)}})))},NN=Ye.label(({theme:e,visible:t,disabled:n})=>({position:"absolute",left:0,top:0,color:n?e.black50:e.black10,fontSize:"0.875rem",fontWeight:400,lineHeight:"140%",pointerEvents:"none",opacity:t?1:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"})),VN=e=>{const{label:t,isVisible:n,inputId:i,className:o,disabled:a}=e;return r.createElement(NN,{htmlFor:i,visible:n,disabled:a,className:o},t)},FN=Ye.div({display:"flex",flexDirection:"column",gap:12}),jN=Ye.form(({persistentMenuOpen:e})=>({display:"flex",alignItems:e?"flex-end":"center",gap:12,marginBottom:0})),HN=Ye(AN)(({theme:e})=>({display:"block",flexGrow:1,alignSelf:"stretch",padding:"8px 2px",border:"none",boxSizing:"border-box",outline:"none",resize:"none",backgroundColor:"transparent",overscrollBehavior:"contain",fontSize:"0.875rem",fontStyle:"normal",fontWeight:400,lineHeight:"140%","::-webkit-scrollbar":{width:2,height:2},"::-webkit-scrollbar-track":{backgroundColor:e.black95},"::-webkit-scrollbar-thumb":{backgroundColor:e.black60}})),qN=Ye.button(({theme:e})=>({margin:0,padding:0,backgroundColor:"transparent",border:"none",borderRadius:4,fill:e.textDark,cursor:"pointer",outline:"none","&[disabled]":{fill:e.black60,cursor:"default"},"&:not(:disabled):hover":{fill:e.primaryColorFocus},"&:focus":{fill:e.primaryColorFocus},"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`}})),GN={padding:"8px",display:"flex",alignItems:"center",justifyContent:"center",minWidth:"32px",minHeight:"32px"},zN=Ye(qN)(({theme:e,open:t})=>({...GN,padding:"6px",fill:t?e.primaryColor:"initial"})),UN=Ye(qN)(()=>GN),WN=Ye(qN)(({theme:e})=>({...GN,position:"relative","&.webchat-input-button-speech-active":{fill:e.textLight}})),QN=Ye(WY)({position:"relative"}),ZN=Ye.div(({theme:e})=>({position:"absolute",backgroundColor:e.primaryColor,height:28,width:28,borderRadius:16})),JN=Ye.div(({theme:e})=>({position:"absolute",backgroundColor:e.primaryColor,opacity:.2,height:28,width:28,borderRadius:16,animation:"expanding 2s ease-in-out infinite","@keyframes expanding":{"from, to":{transform:"scale(1)"},"50%":{transform:"scale(1.3)"}}})),KN=Ye.input(()=>({display:"none"})),XN=Ye(qN)(()=>GN),$N=Ye.div({position:"relative",display:"flex",flexDirection:"column",flexGrow:1}),eV=Ye(VN)({padding:"8px 2px"}),tV=(e,t)=>e?t?e+" "+t:e:t;let nV=null;class rV extends r.PureComponent{constructor(e){super(e);const t=(()=>{try{return new SpeechRecognition}catch(e){}try{return new webkitSpeechRecognition}catch(e){}return null})();t&&(t.continuous=!0,t.interimResults=!0,t.onresult=this.handleSpeechResult,e.config.settings.widgetSettings.STTLanguage&&(t.lang=e.config.settings.widgetSettings.STTLanguage)),this.state={text:"",speechRecognition:t,speechResult:"",isFinalResult:!1,isMenuOpen:!1,selectionStart:0,selectionEnd:0}}inputRef=r.createRef();menuRef=r.createRef();fileInputRef=r.createRef();componentDidMount(){window.WebChatInputTextCallback=e=>{this.setState({text:e})},setTimeout(()=>{this.props.config.settings.widgetSettings.disableInputAutofocus||this.inputRef.current?.focus?.()},200)}componentDidUpdate(){const e=this.props.config.settings.widgetSettings.STTLanguage;this.state.speechRecognition&&e&&this.state.speechRecognition.lang!==e&&this.setState({speechRecognition:{...this.state.speechRecognition,lang:e}})}componentWillUnmount(){nV&&clearTimeout(nV)}handleSpeechResult=e=>{const t=e.results[e.resultIndex],{isFinal:n}=t,{transcript:r}=t[0];nV&&clearTimeout(nV),nV=setTimeout(()=>{this.handleCancelSpeech()},3e3),this.setState({speechResult:r,isFinalResult:n}),n&&this.setState({speechResult:"",text:tV(this.state.text,r)})};handleCancelSpeech=()=>{const{speechRecognition:e}=this.state;e.stop(),nV&&clearTimeout(nV),this.props.onSetSTTActive(!1),this.setState({speechResult:"",isFinalResult:!1}),this.inputRef.current&&this.inputRef.current.focus()};isSTTSupported(){return!!this.state.speechRecognition}toggleSTT=e=>{e.preventDefault();const{speechRecognition:t}=this.state,{sttActive:n,onSetSTTActive:r}=this.props;n?this.handleCancelSpeech():(t.start(),nV&&clearTimeout(nV),nV=setTimeout(()=>{this.handleCancelSpeech()},3e3)),r(!n)};handleChangeTextValue=e=>{this.setState({text:e.target.value}),this.props.onChange(e.target.value)};handleSubmit=e=>{e.preventDefault(),e.stopPropagation();const{text:t,speechResult:n}=this.state,{sttActive:r,fileList:i}=this.props;let o=t;if(r&&(t&&n&&(o=t+" "+n),this.handleCancelSpeech()),!t&&!i)return;const a=[];i.forEach(e=>{e.uploadFileMeta&&(e.hasUploadError||a.push(e.uploadFileMeta))});let s=null;a.length>0&&(s={attachments:a}),this.props.onSetFileList([]),this.setState({text:""},()=>{this.props.onSendMessage(o,s,{collate:!0}),this.inputRef.current&&this.inputRef.current.focus()})};handleInputKeyDown=e=>{"Enter"!==e.key||e.shiftKey||e?.nativeEvent?.isComposing||(e.preventDefault(),e.stopPropagation(),this.handleSubmit(e))};handleSelectFile=e=>{const t=e.target.files,n=Array.prototype.slice.call(t);this.props.onAddFilesToList(n),e.target.value=""};handleUploadFile=e=>{e.preventDefault(),this.fileInputRef.current?.click()};handleFocus=()=>{setTimeout(()=>{this.props.onSetTextActive(!0)},200)};handleBlur=e=>{setTimeout(()=>{this.props.onSetTextActive(!1)},200),this.setState({selectionStart:e.target.selectionStart,selectionEnd:e.target.selectionEnd})};togglePeristentMenu=()=>{this.setState(e=>({isMenuOpen:!e.isMenuOpen}),()=>{this.state.isMenuOpen||this.inputRef.current&&(this.inputRef.current?.setSelectionRange(this.state.selectionStart,this.state.selectionEnd),this.inputRef.current.focus())})};onSelectPersistentMenuItem=e=>{this.togglePeristentMenu(),this.props.onSendMessage(e.payload,null,{label:e.title})};render(){const{props:e,state:t}=this,{sttActive:n,fileUploadError:i,fileList:o}=e,{text:a,speechResult:s,isMenuOpen:l}=t,{layout:c,fileStorageSettings:u,widgetSettings:d,customTranslations:p}=e.config.settings,{disableInputAutocomplete:h,inputAutogrowMaxRows:f,enablePersistentMenu:m,persistentMenu:g}=c,y=m&&g?.menuItems.length>0,{disableInputAutofocus:A}=d,v=u?.enabled,b=0===o?.length;return r.createElement(r.Fragment,null,r.createElement(FN,null,r.createElement(jN,{onSubmit:this.handleSubmit,className:$R()("webchat-input-menu-form"),persistentMenuOpen:l},y&&r.createElement(zN,{onClick:this.togglePeristentMenu,"aria-label":p?.ariaLabels?.togglePersistentMenu??"Toggle chat input menu","aria-expanded":l,className:"webchat-input-persistent-menu-button",id:"webchatInputButtonMenu",open:l,type:"button"},r.createElement(XY,null)),l&&y?r.createElement(YN,{title:g.title,menuItems:g.menuItems,onSelect:this.onSelectPersistentMenuItem}):r.createElement(r.Fragment,null,v&&r.createElement(r.Fragment,null,r.createElement(KN,{ref:this.fileInputRef,type:"file",multiple:!0,onChange:this.handleSelectFile,"aria-hidden":"true"}),r.createElement(UN,{className:"webchat-input-button-add-attachments",onClick:this.handleUploadFile,"aria-label":p?.ariaLabels?.addAttachment??"Add attachments",id:"webchatInputMessageAttachFileButton"},r.createElement(nN,null))),r.createElement(ON(),{maxWidth:575},t=>{const n=!!tV(a,s);return r.createElement($N,{className:"webchat-input-message-container"},r.createElement(eV,{inputId:"webchatInputMessageInputInTextMode",isVisible:!n,label:e.config.settings.behavior.inputPlaceholder,className:"webchat-input-message-label"}),r.createElement(HN,{ref:this.inputRef,autoFocus:!A,value:tV(a,s),onChange:this.handleChangeTextValue,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyDown:this.handleInputKeyDown,className:"webchat-input-message-input",minRows:1,maxRows:f,autoComplete:h?"off":void 0,enterKeyHint:"send",spellCheck:!1,id:"webchatInputMessageInputInTextMode",style:t?{fontSize:"1rem"}:void 0}))}),e.config.settings.behavior.enableSTT&&r.createElement(WN,{className:$R()("webchat-input-button-speech",n&&"webchat-input-button-speech-active"),"aria-label":p?.ariaLabels?.speechToText??"Speech to text",id:"webchatInputMessageSpeechButton",onClick:this.toggleSTT,disabled:!this.isSTTSupported()},n&&r.createElement(r.Fragment,null,r.createElement(JN,{className:$R()("webchat-input-button-speech-background"),"aria-hidden":"true"}),r.createElement(ZN,{className:$R()("webchat-input-button-speech-background"),"aria-hidden":"true"})),r.createElement(QN,null)),r.createElement(XN,{disabled:""===this.state.text&&b||i,className:"webchat-input-button-send cc-rtl-flip","aria-label":p?.ariaLabels?.sendMessage??"Send message",id:"webchatInputMessageSendMessageButton"},r.createElement(qY,null)))),!b&&r.createElement(LN,null)))}}const iV=XS("input/content-updated");var oV=i(7120),aV=i.n(oV);function sV(){return sV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sV.apply(null,arguments)}const lV={name:"text-input",type:"select",id:"text",component:e=>{const t=TM(e=>e.input.sttActive),n=TM(e=>e.input.fileList),i=TM(e=>e.input.fileUploadError),o=kM(),a=(0,r.useCallback)(aV()(()=>{o(iV())},1e3),[]);return r.createElement(rV,sV({},e,{sttActive:t,onSetSTTActive:e=>o((e=>({type:Wx,active:e}))(e)),onSetTextActive:e=>o((e=>({type:Qx,active:e}))(e)),onChange:a,fileList:n,fileUploadError:i,onSetFileList:e=>o(Xx(e)),onAddFilesToList:e=>o(TO(e))}))},icon:NY},cV=lV;var uV=i(8538),dV=i(1281);var pV=function(){return pV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},pV.apply(this,arguments)};function hV(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}Object.create;function fV(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}Object.create;"function"==typeof SuppressedError&&SuppressedError;var mV="right-scroll-bar-position",gV="width-before-scroll-bar";function yV(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var AV="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,vV=new WeakMap;function bV(e,t){var n,i,o,a=(n=t||null,i=function(t){return e.forEach(function(e){return yV(e,t)})},(o=(0,r.useState)(function(){return{value:n,callback:i,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}})[0]).callback=i,o.facade);return AV(function(){var t=vV.get(a);if(t){var n=new Set(t),r=new Set(e),i=a.current;n.forEach(function(e){r.has(e)||yV(e,null)}),r.forEach(function(e){n.has(e)||yV(e,i)})}vV.set(a,e)},[e]),a}function wV(e){return e}function EV(e,t){void 0===t&&(t=wV);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var o=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(o)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}};return i}var kV=function(e){void 0===e&&(e={});var t=EV(null);return t.options=pV({async:!0,ssr:!1},e),t}(),CV=function(){},_V=r.forwardRef(function(e,t){var n=r.useRef(null),i=r.useState({onScrollCapture:CV,onWheelCapture:CV,onTouchMoveCapture:CV}),o=i[0],a=i[1],s=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,h=e.sideCar,f=e.noRelative,m=e.noIsolation,g=e.inert,y=e.allowPinchZoom,A=e.as,v=void 0===A?"div":A,b=e.gapMode,w=hV(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=h,k=bV([n,t]),C=pV(pV({},w),o);return r.createElement(r.Fragment,null,d&&r.createElement(E,{sideCar:kV,removeScrollBar:u,shards:p,noRelative:f,noIsolation:m,inert:g,setCallbacks:a,allowPinchZoom:!!y,lockRef:n,gapMode:b}),s?r.cloneElement(r.Children.only(l),pV(pV({},C),{ref:k})):r.createElement(v,pV({},C,{className:c,ref:k}),l))});_V.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},_V.classNames={fullWidth:gV,zeroRight:mV};var MV,TV=function(e){var t=e.sideCar,n=hV(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw new Error("Sidecar medium not found");return r.createElement(i,pV({},n))};TV.isSideCarExport=!0;function SV(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=MV||i.nc;return t&&e.setAttribute("nonce",t),e}var DV=function(){var e=0,t=null;return{add:function(n){var r,i;0==e&&(t=SV())&&(i=n,(r=t).styleSheet?r.styleSheet.cssText=i:r.appendChild(document.createTextNode(i)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},xV=function(){var e,t=(e=DV(),function(t,n){r.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},IV={left:0,top:0,right:0,gap:0},LV=function(e){return parseInt(e||"",10)||0},PV=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return IV;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],i=t["padding"===e?"paddingRight":"marginRight"];return[LV(n),LV(r),LV(i)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},OV=xV(),RV="data-scroll-locked",BV=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body[").concat(RV,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(i,"px;\n padding-top: ").concat(o,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(mV," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(gV," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(mV," .").concat(mV," {\n right: 0 ").concat(r,";\n }\n \n .").concat(gV," .").concat(gV," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(RV,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},YV=function(){var e=parseInt(document.body.getAttribute(RV)||"0",10);return isFinite(e)?e:0},NV=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,o=void 0===i?"margin":i;r.useEffect(function(){return document.body.setAttribute(RV,(YV()+1).toString()),function(){var e=YV()-1;e<=0?document.body.removeAttribute(RV):document.body.setAttribute(RV,e.toString())}},[]);var a=r.useMemo(function(){return PV(o)},[o]);return r.createElement(OV,{styles:BV(a,!t,o,n?"":"!important")})},VV=!1;if("undefined"!=typeof window)try{var FV=Object.defineProperty({},"passive",{get:function(){return VV=!0,!0}});window.addEventListener("test",FV,FV),window.removeEventListener("test",FV,FV)}catch(e){VV=!1}var jV=!!VV&&{passive:!1},HV=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},qV=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),GV(e,r)){var i=zV(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},GV=function(e,t){return"v"===e?function(e){return HV(e,"overflowY")}(t):function(e){return HV(e,"overflowX")}(t)},zV=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},UV=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},WV=function(e){return[e.deltaX,e.deltaY]},QV=function(e){return e&&"current"in e?e.current:e},ZV=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},JV=0,KV=[];function XV(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const $V=(eF=function(e){var t=r.useRef([]),n=r.useRef([0,0]),i=r.useRef(),o=r.useState(JV++)[0],a=r.useState(xV)[0],s=r.useRef(e);r.useEffect(function(){s.current=e},[e]),r.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=fV([e.lockRef.current],(e.shards||[]).map(QV),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=r.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var r,o=UV(e),a=n.current,l="deltaX"in e?e.deltaX:a[0]-o[0],c="deltaY"in e?e.deltaY:a[1]-o[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var p=window.getSelection(),h=p&&p.anchorNode;if(h&&(h===u||h.contains(u)))return!1;var f=qV(d,u);if(!f)return!0;if(f?r=d:(r="v"===d?"h":"v",f=qV(d,u)),!f)return!1;if(!i.current&&"changedTouches"in e&&(l||c)&&(i.current=r),!r)return!0;var m=i.current||r;return function(e,t,n,r,i){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),c=!1,u=a>0,d=0,p=0;do{if(!s)break;var h=zV(e,s),f=h[0],m=h[1]-h[2]-o*f;(f||m)&&GV(e,s)&&(d+=m,p+=f);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&a>d)||!u&&(i&&Math.abs(p)<1||!i&&-a>p))&&(c=!0),c}(m,t,e,"h"===m?l:c,!0)},[]),c=r.useCallback(function(e){var n=e;if(KV.length&&KV[KV.length-1]===a){var r="deltaY"in n?WV(n):UV(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var o=(s.current.shards||[]).map(QV).filter(Boolean).filter(function(e){return e.contains(n.target)});(o.length>0?l(n,o[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=r.useCallback(function(e,n,r,i){var o={name:e,delta:n,target:r,should:i,shadowParent:XV(r)};t.current.push(o),setTimeout(function(){t.current=t.current.filter(function(e){return e!==o})},1)},[]),d=r.useCallback(function(e){n.current=UV(e),i.current=void 0},[]),p=r.useCallback(function(t){u(t.type,WV(t),t.target,l(t,e.lockRef.current))},[]),h=r.useCallback(function(t){u(t.type,UV(t),t.target,l(t,e.lockRef.current))},[]);r.useEffect(function(){return KV.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,jV),document.addEventListener("touchmove",c,jV),document.addEventListener("touchstart",d,jV),function(){KV=KV.filter(function(e){return e!==a}),document.removeEventListener("wheel",c,jV),document.removeEventListener("touchmove",c,jV),document.removeEventListener("touchstart",d,jV)}},[]);var f=e.removeScrollBar,m=e.inert;return r.createElement(r.Fragment,null,m?r.createElement(a,{styles:ZV(o)}):null,f?r.createElement(NV,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},kV.useMedium(eF),TV);var eF,tF=r.forwardRef(function(e,t){return r.createElement(_V,pV({},e,{ref:t,sideCar:$V}))});tF.classNames=_V.classNames;const nF=tF;var rF=i(2070),iF={};iF.styleTagTransform=nt(),iF.setAttributes=Xe(),iF.insert=Je().bind(null,"head"),iF.domAPI=Qe(),iF.insertStyleElement=et();Ue()(rF.A,iF);rF.A&&rF.A.locals&&rF.A.locals;const oF=Ye(LO)(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",width:50,height:50,backgroundColor:e.primaryColor,backgroundImage:e.primaryGradient,color:e.primaryContrastColor,fill:e.primaryContrastColor,stroke:e.primaryContrastColor,overflow:"visible",boxShadow:e.shadow,borderRadius:"50%",marginTop:2*e.unitSize,"&.active, &:hover":{backgroundImage:e.primaryStrongGradient,fill:`${e.primaryContrastColor} !important`,stroke:`${e.primaryContrastColor}`,color:`${e.primaryContrastColor} !important`},"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2,boxShadow:`0 0 0 4px ${e.white}`},"&.burst, &.pulse, &.swing":{"--icon-burst-duration":"0.8s","--icon-bounce-amp":"10px","--icon-swing-deg":"12deg","--icon-pulse-scale":"1.08"},"&.burst.bounce .iconAnimationContainer.optionActive":{animationName:"bounceBurst",animationDuration:"var(--icon-burst-duration)",animationTimingFunction:"ease-in-out",animationIterationCount:1,animationFillMode:"both"},"&.burst.swing .iconAnimationContainer.optionActive":{animationName:"swingBurst",animationDuration:"var(--icon-burst-duration)",animationTimingFunction:"ease-in-out",animationIterationCount:1,animationFillMode:"both",transformOrigin:"left bottom"},"&.burst.pulse .iconAnimationContainer.optionActive":{animationName:"pulseBurst",animationDuration:"var(--icon-burst-duration)",animationTimingFunction:"ease-in-out",animationIterationCount:1,animationFillMode:"both"},"@keyframes bounceBurst":{"0%":{transform:"translateY(0)"},"30%":{transform:"translateY(calc(-1 * var(--icon-bounce-amp)))"},"50%":{transform:"translateY(calc(-0.2 * var(--icon-bounce-amp)))"},"70%":{transform:"translateY(calc(-0.6 * var(--icon-bounce-amp)))"},"100%":{transform:"translateY(0)"}},"@keyframes swingBurst":{"0%":{transform:"rotate(0deg)"},"40%":{transform:"rotate(var(--icon-swing-deg))"},"70%":{transform:"rotate(calc(-1 * var(--icon-swing-deg))"},"100%":{transform:"rotate(0deg)"}},"@keyframes pulseBurst":{"0%":{transform:"scale(1)",opacity:1},"50%":{transform:"scale(var(--icon-pulse-scale))",opacity:.9},"100%":{transform:"scale(1)",opacity:1}}})),aF=Ye.div({display:"flex",flexDirection:"column",alignItems:"flex-end"});var sF,lF=["title","titleId"];function cF(){return cF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cF.apply(null,arguments)}const uF=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,lF);return r.createElement("svg",cF({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,"aria-hidden":"true",viewBox:"0 -960 960 960","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,sF||(sF=r.createElement("path",{d:"M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240zm126-240h594v-480H160v525zm-46 0v-480z"})))};var dF,pF=["title","titleId"];function hF(){return hF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hF.apply(null,arguments)}const fF=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,pF);return r.createElement("svg",hF({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,"aria-hidden":"true",viewBox:"0 -960 960 960","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,dF||(dF=r.createElement("path",{fill:"inherit",d:"M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240zm126-240h594v-480H160v525zm-46 0v-480z"})))};var mF,gF,yF=["title","titleId"];function AF(){return AF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},AF.apply(null,arguments)}const vF=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,yF);return r.createElement("svg",AF({xmlns:"http://www.w3.org/2000/svg",width:30,height:30,fill:"none",viewBox:"0 0 44 44","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,mF||(mF=r.createElement("path",{stroke:"inherit",strokeLinecap:"round",strokeWidth:2,d:"M19.071 12.714H3.5a2 2 0 0 0-2 2v17.151a2 2 0 0 0 2 2h5.517v6.67l8.59-6.67h14.107a2 2 0 0 0 2-2v-4.508"})),gF||(gF=r.createElement("path",{stroke:"inherit",strokeLinejoin:"round",strokeWidth:2,d:"M36.155 15.826c1.903-1.904 5.023-2.76 6.345-2.76-1.85-.529-4.818-.508-6.853-2.792-2.034-2.284-2.02-4.759-2.284-6.345 0 1.057-.666 4.188-2.284 6.345-1.523 2.03-6.028 2.792-7.615 2.792 1.322 0 4.95.856 6.853 2.76 2.19 2.19 2.782 5.552 3.046 7.138.264-1.586.888-5.234 2.792-7.138ZM23.952 5.576c.732-.732 1.932-1.062 2.44-1.062-.71-.203-1.852-.195-2.635-1.073-.782-.879-.777-1.83-.878-2.44 0 .406-.257 1.61-.879 2.44-.586.78-2.318 1.073-2.929 1.073.509 0 1.904.33 2.636 1.062.842.842 1.07 2.135 1.172 2.745.101-.61.341-2.013 1.073-2.745Z"})))};var bF,wF=["title","titleId"];function EF(){return EF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},EF.apply(null,arguments)}const kF=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,wF);return r.createElement("svg",EF({xmlns:"http://www.w3.org/2000/svg",width:23,height:23,viewBox:"0 0 23 23","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,bF||(bF=r.createElement("path",{fill:"inherit",stroke:"transparent",d:"M21 11.375a9.625 9.625 0 1 0-18.08 4.603l.16.293-.076.324-.953 4.085 3.983-.99.336-.085.303.17A9.6 9.6 0 0 0 11.375 21 9.625 9.625 0 0 0 21 11.375Zm-8.458 1.458a.875.875 0 0 1 0 1.75H7.875a.875.875 0 1 1 0-1.75zm2.333-4.666a.875.875 0 0 1 0 1.75h-7a.875.875 0 1 1 0-1.75zm7.875 3.208c0 6.282-5.093 11.375-11.375 11.375-1.891 0-3.677-.463-5.248-1.282l-5.041 1.256a.875.875 0 0 1-1.063-1.047l1.203-5.161A11.3 11.3 0 0 1 0 11.375C0 5.093 5.093 0 11.375 0S22.75 5.093 22.75 11.375Z"})))},CF=Ye.span(({theme:e,src:t})=>{const n=`url("${String(t).replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`;return{display:"inline-block",width:20,height:20,backgroundColor:e.primaryContrastColor,WebkitMaskImage:n,maskImage:n,WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center",WebkitMaskSize:"contain",maskSize:"contain"}}),_F=({config:e})=>{const t=e.settings?.layout?.iconUrl??"default-1",n=e.settings?.layout?.iconAnimation||"",i={"--icon-burst-duration":`${Math.max(.2,1/Math.max(.1,e.settings?.layout?.iconAnimationSpeed||1))}s`};if("string"==typeof t&&t.startsWith("default-")){const e=Math.max(0,Number(t.replace("default-",""))-1),o=[fF,vF,kF][e]??uF;return r.createElement(o,{className:$R()("iconAnimationContainer",n),"aria-hidden":!0,style:i})}const o=/^data:image\/(svg\+xml|svg)/i.test(String(t)),a=String(t).trim().toLowerCase().endsWith(".svg");if(o||a)return r.createElement(CF,{src:String(t),"aria-hidden":!0,className:$R()("iconAnimationContainer",n),style:i});const s=/^data:image\/(png|x-png)/i.test(String(t)),l=String(t).trim().toLowerCase().endsWith(".png");return s||l?r.createElement("img",{src:String(t),alt:"","aria-hidden":!0,className:$R()("iconAnimationContainer",n),style:{width:20,height:20,display:"inline-block",...i}}):r.createElement(uF,{"aria-hidden":!0,className:$R()("iconAnimationContainer",n),style:i})};var MF,TF=["title","titleId"];function SF(){return SF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SF.apply(null,arguments)}const DF=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,TF);return r.createElement("svg",SF({xmlns:"http://www.w3.org/2000/svg",width:20,height:20,"aria-hidden":"true",viewBox:"0 0 20 20","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,MF||(MF=r.createElement("path",{fillRule:"evenodd",stroke:"transparent",d:"M1.687 5.302a1.25 1.25 0 0 1 1.762.135L10 13.08l6.551-7.643a1.25 1.25 0 1 1 1.898 1.627l-6.55 7.643a2.5 2.5 0 0 1-3.797 0L1.55 7.064a1.25 1.25 0 0 1 .136-1.762Z",clipRule:"evenodd"})))};var xF,IF,LF=i(7458),PF=i.n(LF),OF=["title","titleId"];function RF(){return RF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RF.apply(null,arguments)}const BF=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,OF);return r.createElement("svg",RF({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,"aria-hidden":"true",viewBox:"0 0 24 24","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,xF||(xF=r.createElement("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),IF||(IF=r.createElement("path",{fill:"none",d:"M0 0h24v24H0z"})))},YF=Ye.h2(({theme:e})=>({fontSize:"1.5rem",marginBlockStart:"-.25rem",fontWeight:600,boxSizing:"border-box",zIndex:4})),NF=Ye(LO)(({theme:e})=>({position:"absolute",right:15,top:17,borderRadius:4,"&:focus":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2}})),VF=e=>{const{isPermanent:t,onClose:n,onConnect:i,config:o,isOpen:a}=e,s=(0,r.useRef)(null);return(0,r.useEffect)(()=>{setTimeout(()=>s.current?.focus(),200)},[]),r.createElement(PF(),{isOpen:a,parentSelector:()=>document.querySelector("#webchatWindow"),onRequestClose:n,style:{overlay:{position:"absolute",zIndex:3,backgroundColor:"rgba(0, 0, 0, 0.5)"},content:{inset:50,display:"flex",flexDirection:"column",alignItems:"center",margin:"auto",justifyContent:"center"}}},r.createElement(NF,{autoFocus:!t,"data-disconnect-overlay-close-button":!0,onClick:n,ref:s,className:"webchat-header-close-button","aria-label":o.settings.customTranslations?.ariaLabels?.closeConnectionWarning??"Close connection lost overlay"},r.createElement(BF,{style:{fill:"#000"}})),r.createElement(YF,null,o.settings.customTranslations?.network_error??"Connection lost"),t?r.createElement(r.Fragment,null,navigator.onLine?r.createElement(ct,{autoFocus:!0,onClick:i,color:"primary",style:{margin:"auto"}},o.settings.customTranslations?.reconnect??"Reconnect"):r.createElement("div",null,o.settings.customTranslations?.no_network??"No network connection")):r.createElement("div",null,o.settings.customTranslations?.reconnecting??"Reconnecting..."))},FF=Ye.span(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",top:0,right:0,fontSize:3*e.unitSize/2,lineHeight:12,fontWeight:700,width:2*e.unitSize,height:2*e.unitSize,borderRadius:"50%",backgroundColor:"rgb(235, 15, 0)",color:"white",fontFamily:"sans-serif"})),jF=e=>{const{_content:t,...n}=e;let i=t;return 0===i?null:(i>99&&(i=99),r.createElement(FF,n,i))},HF=e=>{const t=e?.querySelectorAll('a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])'),n=t&&Array.from(t),r=n?.filter(e=>!e.hasAttribute("disabled")&&!e.getAttribute("aria-hidden"));return{firstFocusable:r&&r[0],lastFocusable:r&&r[r.length-1],focusable:r}},qF=i(1393).A,GF=new kx.A(qF),zF=(e,t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];if(t(r))return r}};var UF=i(2254),WF={};WF.styleTagTransform=nt(),WF.setAttributes=Xe(),WF.insert=Je().bind(null,"head"),WF.domAPI=Qe(),WF.insertStyleElement=et();Ue()(UF.A,WF);UF.A&&UF.A.locals&&UF.A.locals;const QF=Ye(e=>{const t=Dt(yC.typingIndicator,e.className,"webchat-typing-indicator",e.direction&&yC[e.direction],e.disableBorder&&yC.disableBorder);return(0,yt.jsxs)("div",{className:t,children:[(0,yt.jsx)("div",{className:yC.dot}),(0,yt.jsx)("div",{className:yC.dot}),(0,yt.jsx)("div",{className:yC.dot})]})})({marginBlock:0}),ZF=Ye(QF)({visibility:"hidden"}),JF=e=>{const{active:t,delay:n,direction:i,disableBorder:o}=e,a=(()=>{const e=(0,r.useRef)(!0);return(0,r.useEffect)(()=>()=>{e.current=!1},[]),e})(),[s,l]=(0,r.useState)(t);return(0,r.useEffect)(()=>{let e;return t?l(t):e=setTimeout(()=>{a.current&&l(!1)},n||500),()=>{e&&clearTimeout(e)}},[t]),s?r.createElement(QF,{direction:i,disableBorder:o}):r.createElement(ZF,null)},KF=e=>{if(e&&e.enabled){let t=!0;const n=XF(e.timeZone),r=e.times.filter(e=>e.weekDay===n.weekDay);for(let e=0;e<r.length;e++){const{0:i,1:o}=r[e].startTime.split(":"),{0:a,1:s}=r[e].endTime.split(":");(parseInt(i)<n.hour&&n.hour<parseInt(a)||parseInt(i)===n.hour&&n.minute>=parseInt(o)&&n.hour<parseInt(a)||parseInt(i)===n.hour&&n.minute>=parseInt(o)&&n.hour===parseInt(a)&&n.minute<parseInt(s)||parseInt(i)<n.hour&&n.hour===parseInt(a)&&n.minute<parseInt(s))&&(t=!1)}return t}return!1},XF=e=>{const t=(new Date).toLocaleString("en-US",{timeZone:e}),n=new Date(t).getDay(),r=new Date(t).getHours(),i=new Date(t).getMinutes();let o;switch(n){case 0:o="sunday";break;case 1:o="monday";break;case 2:o="tuesday";break;case 3:o="wednesday";break;case 4:o="thursday";break;case 5:o="friday";break;case 6:o="saturday"}return{weekDay:o,hour:r,minute:i}},$F=e=>!(!KF(e)||"hide"!==e.mode),ej=e=>!(!KF(e)||"disable"!==e.mode),tj=e=>!(!KF(e)||"inform"!==e.mode),nj=e=>!(!e.maintenance?.enabled||"hide"!==e.maintenance?.mode),rj=e=>!(!e.maintenance?.enabled||"disable"!==e.maintenance?.mode),ij=e=>!(!e.maintenance?.enabled||"inform"!==e.maintenance?.mode),oj=Ye(LO)(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",width:56,height:56,backgroundColor:e.greyColor,backgroundImage:e.greyColor,color:e.greyContrastColor,fill:e.greyContrastColor,overflow:"visible",boxShadow:e.shadow,borderRadius:"50%",marginTop:2*e.unitSize,"&.active, &:hover":{color:`${e.greyContrastColor} !important`,fill:`${e.greyContrastColor} !important`}})),aj=(e,t)=>!(!e.embeddingConfiguration?.connectivity?.enabled||"hide"!==e.embeddingConfiguration?.connectivity?.mode||!t),sj=(e,t)=>!(!e.embeddingConfiguration?.connectivity?.enabled||"disable"!==e.embeddingConfiguration?.connectivity?.mode||!t),lj=(e,t)=>!(!e.embeddingConfiguration?.connectivity?.enabled||"inform"!==e.embeddingConfiguration?.connectivity?.mode||!t);function cj(){return cj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cj.apply(null,arguments)}const uj=(0,r.forwardRef)((e,t)=>r.createElement(ct,cj({},e,{ref:t,color:"primary"}))),dj=uj,pj=Ye(ct)(({theme:e})=>({color:e.secondaryColor,backgroundColor:e.white,border:`1px solid ${e.secondaryColor}`,"&:disabled":{opacity:.4,cursor:"default",color:e.secondaryColorDisabled,borderColor:e.secondaryColorDisabled,backgroundColor:e.white},"&:hover:not(:disabled)":{color:e.secondaryColorHover,borderColor:e.secondaryColorHover,backgroundColor:e.white},"&:focus:not(:disabled)":{color:e.secondaryColorHover,borderColor:e.secondaryColorHover,backgroundColor:e.white},"&:active:not(:disabled)":{color:e.secondaryColorDisabled,borderColor:e.secondaryColorDisabled,backgroundColor:e.white}})),hj=Ye.div(({theme:e})=>({display:"flex",position:"absolute",top:0,flexDirection:"column",height:"100%",width:"100%",color:e.primaryContrastColor,fontSize:16,fontWeight:700,boxSizing:"border-box","& *":{boxSizing:"border-box"},"&.hidebackground-enter-done":{"& .webchat-homescreen-content":{backgroundImage:"none"}}})),fj=Ye.div(({theme:e,settings:t})=>{const n=t?.homeScreen?.background?.color||e.backgroundHome;let r="none";const i=t?.homeScreen?.background?.imageUrl;i&&(r=`url("${i}")`);return{background:`${r}, ${n}`,backgroundSize:"cover",backgroundPosition:"center center",flexGrow:1,display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",height:"100%",width:"100%",padding:"20px 20px 35px 20px"}}),mj=Ye.div(()=>({marginInline:-20,width:"calc(100% + 40px)"})),gj=Ye.div({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",marginBottom:20,height:28,"& .webchat-homescreen-header-logo":{borderRadius:"50%",width:28,height:28},"& .webchat-homescreen-header-cognigy-logo":{borderRadius:"50%",width:28,height:28}}),yj=Ye(LO)(({theme:e})=>({color:e.white,borderRadius:4,padding:0,margin:4,svg:{fill:e.white,width:16,height:16},"&.active, &:hover":{color:e.white,fill:e.white},"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2,boxShadow:`0 0 0 4px ${e.white}`}})),Aj=Ye(mm)(({theme:e})=>({color:e.textLight,fontWeight:700,margin:0})),vj=Ye.div({marginTop:"auto","> div":{flexDirection:"column"}}),bj=Ye.div(({theme:e})=>({alignSelf:"flex-end",display:"flex",flexDirection:"column",alignItems:" center",justifyContent:"center",width:"100%",padding:"20px 20px 12px 20px",backgroundColor:e.white})),wj=Ye(dj)(({theme:e})=>({marginBottom:16,flexGrow:1,"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2}})),Ej=Ye(pj)(({theme:e})=>({marginBottom:24,flexGrow:1,"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2}})),kj=e=>{const{config:t,showHomeScreen:n,closeButtonRef:i,onSetShowHomeScreen:o,onSetShowPrevConversations:a,onClose:s,onEmitAnalytics:l,onSendActionButtonMessage:c,onStartConversation:u}=e,d=(0,r.useRef)(null),{homeScreen:p}=t.settings,h=t.settings.homeScreen.conversationStarters.starters;return(0,r.useEffect)(()=>{if(d.current){const{firstFocusable:e}=HF(d.current);e.focus()}},[]),(0,r.useEffect)(()=>{const e=n?0:-1;if(d.current){const{focusable:t}=HF(d.current);t.forEach(t=>{t.setAttribute("tabindex",e.toString())})}},[n]),r.createElement(hj,{className:"webchat-homescreen-root","aria-hidden":!n,ref:d},r.createElement("h2",{className:"sr-only"},t.settings.customTranslations?.ariaLabels?.homeScreen??"Chat window home screen"),r.createElement(fj,{className:"webchat-homescreen-content",settings:t?.settings},r.createElement(gj,{className:"webchat-homescreen-header"},t?.settings?.layout?.logoUrl?r.createElement(iY,{src:t?.settings?.layout?.logoUrl,className:"webchat-homescreen-header-logo",alt:""}):r.createElement(nB,{className:"webchat-homescreen-header-cognigy-logo",role:"img",title:"Cognigy.AI Logo"}),r.createElement(yj,{ref:i,onClick:s,className:"webchat-homescreen-close-button","aria-label":t.settings.customTranslations?.ariaLabels?.closeChat??"Close chat",color:"primary"},r.createElement(BO,null))),r.createElement(mj,null,r.createElement(ZR,null)),r.createElement(Aj,{variant:"title1-semibold",component:"h3",className:"webchat-homescreen-title",id:"webchatHeaderTitle"},p.welcomeText||"Welcome to the Cognigy Webchat"),p?.conversationStarters?.enabled&&r.createElement(vj,{className:"webchat-homescreen-buttons"},r.createElement(xm,{size:"large",showUrlIcon:!0,buttonClassName:"webchat-homescreen-button",containerClassName:"webchat-homescreen-button-container",payload:h,config:t,action:n?c:void 0,onEmitAnalytics:l}))),r.createElement(bj,{className:"webchat-homescreen-actions"},r.createElement(wj,{onClick:u,className:"webchat-homescreen-send-button","data-test":"webchat-start-chat-button"},t.settings.homeScreen.startConversationButtonText||"Start conversation"),t.settings.homeScreen.previousConversations.enabled&&r.createElement(Ej,{onClick:()=>{o(!1),a(!0)},className:"webchat-homescreen-previous-conversation-button"},t.settings.homeScreen.previousConversations.buttonText||"Previous conversations"),r.createElement(xY,{id:"cognigyHomeScreenBranding",watermark:t?.settings?.layout?.watermark,watermarkText:t?.settings?.layout?.watermarkText,watermarkUrl:t?.settings?.layout?.watermarkUrl})))};var Cj,_j=["title","titleId"];function Mj(){return Mj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mj.apply(null,arguments)}const Tj=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,_j);return r.createElement("svg",Mj({xmlns:"http://www.w3.org/2000/svg",width:4,height:4,fill:"none","aria-hidden":"true",viewBox:"0 0 4 4","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,Cj||(Cj=r.createElement("circle",{cx:2,cy:2,r:2,fill:"#999"})))},Sj=e=>{const t=zF(e,e=>!!YT(e));if(t)return YT(t);const n=(e=>BT(e)?"":e?.data?._cognigy?._webchat?.message?.attachment?.type||"")(e[e.length-1]);switch(n){case"template":return"template...";case"image":return"image...";case"video":return"video...";case"audio":return"audio...";default:return"..."}},Dj=e=>{if(!Array.isArray(e)||0===e.length)return!1;const t=e[e.length-1]?.timestamp||Date.now(),n=Date.now();return Math.floor((n-t)/864e5)>=30},xj=Ye.div(({theme:e})=>({display:"flex",gap:"12px",height:"4.32rem",width:"100%",border:`1px solid ${e.black80}`,borderRadius:"10px",padding:"12px",cursor:"pointer",justifyContent:"space-between",alignItems:"center",":focus":{border:`2px solid ${e.primaryColorFocus}`,outline:"none"}})),Ij=Ye.div({display:"inline-flex",flexDirection:"row-reverse"}),Lj=Ye.div({display:"flex",flexDirection:"column",justifyContent:"space-between",width:"100%",height:"100%"}),Pj=Ye(mm)(({theme:e})=>({color:e.black10,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"290px"})),Oj=Ye(mm)(({theme:e})=>({color:e.black10,display:"flex",gap:"8px",alignItems:"center"})),Rj=Ye.span(()=>({})),Bj=Ye.span(({theme:e})=>({color:e.black40})),Yj=Ye.div(({theme:e})=>({svg:{transform:"rotate(180deg)"},"svg path":{fill:e.black10}})),Nj=Ye.img(({theme:e})=>({borderRadius:"50%",width:"28px",height:"28px",backgroundColor:e.primaryColor,boxSizing:"border-box",border:`2px solid ${e.white}`,overflow:"hidden",position:"relative",":not(:last-child)":{marginLeft:"-12px"}})),Vj=Ye(nB)(({theme:e})=>({borderRadius:"50%",width:"28px",height:"28px",boxSizing:"border-box",border:`2px solid ${e.white}`})),Fj=e=>{const{sessionId:t,conversation:n,config:i,index:o,switchSession:a}=e,s=n.messages,l=(e=>{const t=e.filter(e=>"user"!==e?.source);return[...new Set(t.map(e=>e?.avatarUrl))]})(s),c=()=>{a(t,n)},u=i.settings.customTranslations?.ariaLabels?.openConversation??"Open conversation";return r.createElement(xj,{className:"webchat-prev-conversations-item",onClick:c,onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key&&c()},tabIndex:0,role:"button","aria-label":`${u} ${o+1}`},r.createElement(Ij,null,l.length>0?l.map((e,t)=>e?r.createElement(Nj,{key:t,src:e,alt:""}):r.createElement(Vj,{title:"Cognigy.AI Logo",role:"img",key:t,className:"webchat-header-cognigy-logo"})):r.createElement(Vj,{title:"Cognigy.AI Logo"})),r.createElement(Lj,null,r.createElement(Pj,{variant:"body-regular",component:"div"},Sj(s)),r.createElement(Oj,{variant:"title2-regular",component:"div"},r.createElement(Rj,null,((e,t)=>{const n=[],r=e.some(e=>["bot","engagement"].includes(e?.source)),i=e.some(e=>"agent"===e?.source);return r&&n.push(t?.settings?.layout?.title||"Bot"),i&&n.push("Agent"),r||i?n.join(", "):"You"})(s,i)),r.createElement(Tj,null),r.createElement(Bj,{className:"webchat-prev-conversations-time"},(e=>{const t=e[e.length-1];if(!t?.timestamp)return"";const n=new Date(t.timestamp),r=new Date,i=e=>{const t=new Date(e);return t.setHours(0,0,0,0),t},o=i(n),a=i(r),s=Math.floor((a.getTime()-o.getTime())/864e5),l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});if(s>=0&&s<=1)return(c=l.format(-s,"day")).charAt(0).toUpperCase()+c.slice(1);var c;if(s>=2&&s<7)return l.format(-s,"day");const u=Math.floor(s/7);if(u<=4&&s<31)return l.format(-u,"week");let d=12*(r.getFullYear()-n.getFullYear())+(r.getMonth()-n.getMonth());if(r.getDate()<n.getDate()&&d--,d>0&&d<12)return l.format(-d,"month");const p=Math.floor(d/12);return p>0?l.format(-p,"year"):l.format(-Math.floor(d/12),"year")})(s)))),r.createElement(Yj,null,r.createElement(GO,{className:"cc-rtl-flip-invert"})))},jj=Ye.div(({theme:e})=>({height:"100%",width:"100%",fontSize:16,fontWeight:700,boxSizing:"border-box",backgroundColor:e.white,display:"flex",flexDirection:"column","& *":{boxSizing:"border-box"}})),Hj=Ye.div(({theme:e})=>({rowGap:"8px",display:"flex",flexDirection:"column",padding:"20px",overflowY:"auto",flexGrow:1,minHeight:0,height:e.blockSize,overscrollBehavior:"contain","&:focus":{outline:"none"}})),qj=Ye.div(({theme:e})=>({alignSelf:"flex-end",display:"flex",flexDirection:"column",alignItems:" center",justifyContent:"center",width:"100%",padding:"20px 20px 12px 20px",backgroundColor:e.white,borderTop:`1px solid var(--basics-black-80, ${e.black80})`})),Gj=Ye(dj)(({theme:e})=>({marginBottom:20,flexGrow:1,"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`}})),zj=e=>{const{conversations:t,config:n,onSetShowPrevConversations:i,onSwitchSession:o,currentSession:a,startNewConversationButtonRef:s}=e,l=(e=>{const t=Object.entries(e).sort(([,e],[,t])=>(t.messages[t.messages.length-1]?.timestamp||0)-(e.messages[e.messages.length-1]?.timestamp||0)).reduce((e,[t,n])=>({...e,[t]:n}),{});return t})(t),c=Object.keys(l),u=(0,r.useCallback)((e,t)=>{e&&e!==a&&o(e,t),i(!1)},[]);return r.createElement(jj,{className:"webchat-prev-conversations-root"},r.createElement(Hj,{className:"webchat-prev-conversations-content"},c.length>0&&c.map((e,t)=>r.createElement(Fj,{key:t,index:t,sessionId:e,switchSession:u,conversation:l[e],config:n}))),r.createElement(qj,{className:"webchat-prev-conversations-actions"},r.createElement(Gj,{onClick:()=>{o(),i(!1)},className:"webchat-prev-conversations-send-button","data-testid":"webchat-start-chat-button",ref:s},n.settings.homeScreen?.previousConversations?.startNewConversationButtonText??"Start new conversation"),r.createElement(xY,{id:"cognigyConversationListBranding",watermark:n?.settings?.layout?.watermark,watermarkText:n?.settings?.layout?.watermarkText,watermarkUrl:n?.settings?.layout?.watermarkUrl})))};var Uj,Wj,Qj=["title","titleId"];function Zj(){return Zj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zj.apply(null,arguments)}const Jj=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,Qj);return r.createElement("svg",Zj({xmlns:"http://www.w3.org/2000/svg",width:111,height:82,fill:"none","aria-hidden":"true",viewBox:"0 0 111 82","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,Uj||(Uj=r.createElement("path",{fill:"#F2F2F2",d:"M.5 27c0-8.284 6.716-15 15-15h80c8.284 0 15 6.716 15 15v40c0 8.284-6.716 15-15 15H.5z"})),Wj||(Wj=r.createElement("g",{stroke:"#999",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3},r.createElement("path",{d:"M29.48 18h12.606c.89 0 1.337 1.077.707 1.707L30.207 32.293c-.63.63-.184 1.707.707 1.707H44.5M52.5 41h9.586c.89 0 1.337 1.077.707 1.707l-8.586 8.586c-.63.63-.184 1.707.707 1.707H64.5M58.5 2h21.586c.89 0 1.337 1.077.707 1.707L60.207 24.293c-.63.63-.184 1.707.707 1.707H82.5"}))))},Kj=Ye.div(({theme:e})=>({height:"100%",width:"100%",backgroundColor:e.white,display:"flex",alignItems:"center",justifyContent:"center"})),Xj=Ye.div(()=>({display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:"24px",maxWidth:"295px",textAlign:"center"})),$j=e=>{const{message:t}=e;return r.createElement(Kj,{className:"webchat-information-message-root"},r.createElement(Xj,{className:"webchat-information-message-content"},r.createElement(Jj,null),r.createElement(mm,{variant:"title1-regular",style:{margin:0},component:"p"},t)))},eH=Ye.a(({theme:e})=>({display:"inline-flex",justifyContent:"center",alignItems:"center",gap:8,color:e.black10,backgroundColor:e.white,width:303,height:44,borderRadius:10,textDecoration:"none",svg:{transform:"rotate(180deg)",fill:e.black10},"& svg:dir(rtl)":{transform:"rotate(0deg)"},"&:disabled":{cursor:"default",color:e.black60,backgroundColor:e.white,svg:{fill:e.black60}},"&:hover:not(:disabled)":{color:e.black40,backgroundColor:e.white,svg:{fill:e.black40}},"&:focus:not(:disabled)":{color:e.black40,backgroundColor:e.white,svg:{fill:e.black40}},"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2},"&:active:not(:disabled)":{color:e.black40,backgroundColor:e.white,svg:{fill:e.black40}}})),tH=e=>{const{text:t,url:n,target:i,icon:o,className:a,rel:s}=e,l=XB(e=>e.config.settings.customTranslations?.ariaLabels),c="_blank"===i?`${t}. ${l?.opensInNewTab||"Opens in new tab"}`:void 0,u=s??("_blank"===i?"noopener noreferrer":void 0);return r.createElement(eH,{className:$R()("tertiary-button",a),href:n,target:i,"aria-label":c,rel:u},r.createElement(mm,{variant:"cta-semibold"},t),o||r.createElement(GO,null))};function nH(){}function rH(){}const iH=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oH=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,aH={};function sH(e,t){return((t||aH).jsx?oH:iH).test(e)}const lH=/[ \t\n\f\r]/g;function cH(e){return""===e.replace(lH,"")}class uH{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function dH(e,t){const n={},r={};for(const t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new uH(n,r,t)}function pH(e){return e.toLowerCase()}uH.prototype.normal={},uH.prototype.property={},uH.prototype.space=void 0;class hH{constructor(e,t){this.attribute=t,this.property=e}}hH.prototype.attribute="",hH.prototype.booleanish=!1,hH.prototype.boolean=!1,hH.prototype.commaOrSpaceSeparated=!1,hH.prototype.commaSeparated=!1,hH.prototype.defined=!1,hH.prototype.mustUseProperty=!1,hH.prototype.number=!1,hH.prototype.overloadedBoolean=!1,hH.prototype.property="",hH.prototype.spaceSeparated=!1,hH.prototype.space=void 0;let fH=0;const mH=EH(),gH=EH(),yH=EH(),AH=EH(),vH=EH(),bH=EH(),wH=EH();function EH(){return 2**++fH}const kH=Object.keys(t);class CH extends hH{constructor(e,n,r,i){let o=-1;if(super(e,n),_H(this,"space",i),"number"==typeof r)for(;++o<kH.length;){const e=kH[o];_H(this,kH[o],(r&t[e])===t[e])}}}function _H(e,t,n){n&&(e[t]=n)}function MH(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new CH(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[pH(r)]=r,n[pH(o.attribute)]=r}return new uH(t,n,e.space)}CH.prototype.defined=!0;const TH=MH({properties:{ariaActiveDescendant:null,ariaAtomic:gH,ariaAutoComplete:null,ariaBusy:gH,ariaChecked:gH,ariaColCount:AH,ariaColIndex:AH,ariaColSpan:AH,ariaControls:vH,ariaCurrent:null,ariaDescribedBy:vH,ariaDetails:null,ariaDisabled:gH,ariaDropEffect:vH,ariaErrorMessage:null,ariaExpanded:gH,ariaFlowTo:vH,ariaGrabbed:gH,ariaHasPopup:null,ariaHidden:gH,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:vH,ariaLevel:AH,ariaLive:null,ariaModal:gH,ariaMultiLine:gH,ariaMultiSelectable:gH,ariaOrientation:null,ariaOwns:vH,ariaPlaceholder:null,ariaPosInSet:AH,ariaPressed:gH,ariaReadOnly:gH,ariaRelevant:null,ariaRequired:gH,ariaRoleDescription:vH,ariaRowCount:AH,ariaRowIndex:AH,ariaRowSpan:AH,ariaSelected:gH,ariaSetSize:AH,ariaSort:null,ariaValueMax:AH,ariaValueMin:AH,ariaValueNow:AH,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function SH(e,t){return t in e?e[t]:t}function DH(e,t){return SH(e,t.toLowerCase())}const xH=MH({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:bH,acceptCharset:vH,accessKey:vH,action:null,allow:null,allowFullScreen:mH,allowPaymentRequest:mH,allowUserMedia:mH,alt:null,as:null,async:mH,autoCapitalize:null,autoComplete:vH,autoFocus:mH,autoPlay:mH,blocking:vH,capture:null,charSet:null,checked:mH,cite:null,className:vH,cols:AH,colSpan:null,content:null,contentEditable:gH,controls:mH,controlsList:vH,coords:AH|bH,crossOrigin:null,data:null,dateTime:null,decoding:null,default:mH,defer:mH,dir:null,dirName:null,disabled:mH,download:yH,draggable:gH,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:mH,formTarget:null,headers:vH,height:AH,hidden:yH,high:AH,href:null,hrefLang:null,htmlFor:vH,httpEquiv:vH,id:null,imageSizes:null,imageSrcSet:null,inert:mH,inputMode:null,integrity:null,is:null,isMap:mH,itemId:null,itemProp:vH,itemRef:vH,itemScope:mH,itemType:vH,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:mH,low:AH,manifest:null,max:null,maxLength:AH,media:null,method:null,min:null,minLength:AH,multiple:mH,muted:mH,name:null,nonce:null,noModule:mH,noValidate:mH,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:mH,optimum:AH,pattern:null,ping:vH,placeholder:null,playsInline:mH,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:mH,referrerPolicy:null,rel:vH,required:mH,reversed:mH,rows:AH,rowSpan:AH,sandbox:vH,scope:null,scoped:mH,seamless:mH,selected:mH,shadowRootClonable:mH,shadowRootDelegatesFocus:mH,shadowRootMode:null,shape:null,size:AH,sizes:null,slot:null,span:AH,spellCheck:gH,src:null,srcDoc:null,srcLang:null,srcSet:null,start:AH,step:null,style:null,tabIndex:AH,target:null,title:null,translate:null,type:null,typeMustMatch:mH,useMap:null,value:gH,width:AH,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:vH,axis:null,background:null,bgColor:null,border:AH,borderColor:null,bottomMargin:AH,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:mH,declare:mH,event:null,face:null,frame:null,frameBorder:null,hSpace:AH,leftMargin:AH,link:null,longDesc:null,lowSrc:null,marginHeight:AH,marginWidth:AH,noResize:mH,noHref:mH,noShade:mH,noWrap:mH,object:null,profile:null,prompt:null,rev:null,rightMargin:AH,rules:null,scheme:null,scrolling:gH,standby:null,summary:null,text:null,topMargin:AH,valueType:null,version:null,vAlign:null,vLink:null,vSpace:AH,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:mH,disableRemotePlayback:mH,prefix:null,property:null,results:AH,security:null,unselectable:null},space:"html",transform:DH}),IH=MH({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:wH,accentHeight:AH,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:AH,amplitude:AH,arabicForm:null,ascent:AH,attributeName:null,attributeType:null,azimuth:AH,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:AH,by:null,calcMode:null,capHeight:AH,className:vH,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:AH,diffuseConstant:AH,direction:null,display:null,dur:null,divisor:AH,dominantBaseline:null,download:mH,dx:null,dy:null,edgeMode:null,editable:null,elevation:AH,enableBackground:null,end:null,event:null,exponent:AH,externalResourcesRequired:null,fill:null,fillOpacity:AH,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:bH,g2:bH,glyphName:bH,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:AH,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:AH,horizOriginX:AH,horizOriginY:AH,id:null,ideographic:AH,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:AH,k:AH,k1:AH,k2:AH,k3:AH,k4:AH,kernelMatrix:wH,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:AH,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:AH,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:AH,overlineThickness:AH,paintOrder:null,panose1:null,path:null,pathLength:AH,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:vH,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:AH,pointsAtY:AH,pointsAtZ:AH,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:wH,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:wH,rev:wH,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:wH,requiredFeatures:wH,requiredFonts:wH,requiredFormats:wH,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:AH,specularExponent:AH,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:AH,strikethroughThickness:AH,string:null,stroke:null,strokeDashArray:wH,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:AH,strokeOpacity:AH,strokeWidth:null,style:null,surfaceScale:AH,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:wH,tabIndex:AH,tableValues:null,target:null,targetX:AH,targetY:AH,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:wH,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:AH,underlineThickness:AH,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:AH,values:null,vAlphabetic:AH,vMathematical:AH,vectorEffect:null,vHanging:AH,vIdeographic:AH,version:null,vertAdvY:AH,vertOriginX:AH,vertOriginY:AH,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:AH,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:SH}),LH=MH({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),PH=MH({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:DH}),OH=MH({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),RH=dH([TH,xH,LH,PH,OH],"html"),BH=dH([TH,IH,LH,PH,OH],"svg"),YH=/[A-Z]/g,NH=/-[a-z]/g,VH=/^data[-\w.:]+$/i;function FH(e){return"-"+e.toLowerCase()}function jH(e){return e.charAt(1).toUpperCase()}const HH={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var qH=i(5936);const GH=UH("end"),zH=UH("start");function UH(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function WH(e){return e&&"object"==typeof e?"position"in e||"type"in e?ZH(e.position):"start"in e||"end"in e?ZH(e):"line"in e||"column"in e?QH(e):"":""}function QH(e){return JH(e&&e.line)+":"+JH(e&&e.column)}function ZH(e){return QH(e&&e.start)+"-"+QH(e&&e.end)}function JH(e){return e&&"number"==typeof e?e:1}class KH extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},o=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(o=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){const e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=WH(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}KH.prototype.file="",KH.prototype.name="",KH.prototype.reason="",KH.prototype.message="",KH.prototype.stack="",KH.prototype.column=void 0,KH.prototype.line=void 0,KH.prototype.ancestors=void 0,KH.prototype.cause=void 0,KH.prototype.fatal=void 0,KH.prototype.place=void 0,KH.prototype.ruleId=void 0,KH.prototype.source=void 0;const XH={}.hasOwnProperty,$H=new Map,eq=/[A-Z]/g,tq=new Set(["table","tbody","thead","tfoot","tr"]),nq=new Set(["td","th"]),rq="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function iq(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return n;function n(n,r,i,o){const a=Array.isArray(i.children),s=zH(n);return t(r,i,o,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=function(e,t,n){return r;function r(e,r,i,o){const a=Array.isArray(i.children)?n:t;return o?a(r,i,o):a(r,i)}}(0,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?BH:RH,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},o=oq(i,e,void 0);return o&&"string"!=typeof o?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function oq(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let i=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(i=BH,e.schema=i);e.ancestors.push(t);const o=uq(e,t.tagName,!1),a=function(e,t){const n={};let r,i;for(i in t.properties)if("children"!==i&&XH.call(t.properties,i)){const o=cq(e,i,t.properties[i]);if(o){const[i,a]=o;e.tableCellAlignToStyle&&"align"===i&&"string"==typeof a&&nq.has(t.tagName)?r=a:n[i]=a}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let s=lq(e,t);tq.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&cH(t.value):cH(t));var t}));return aq(e,a,o,t),sq(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}dq(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let i=r;"svg"===t.name&&"html"===r.space&&(i=BH,e.schema=i);e.ancestors.push(t);const o=null===t.name?e.Fragment:uq(e,t.name,!0),a=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];nH(t.type);const i=t.expression;nH(i.type);const o=i.properties[0];nH(o.type),Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else dq(e,t.position);else{const i=r.name;let o;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];nH(t.type),o=e.evaluater.evaluateExpression(t.expression)}else dq(e,t.position);else o=null===r.value||r.value;n[i]=o}return n}(e,t),s=lq(e,t);return aq(e,a,o,t),sq(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);dq(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return sq(r,lq(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function aq(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function sq(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function lq(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:$H;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys){const e="element"===o.type?o.tagName:"mdxJsxFlowElement"===o.type||"mdxJsxTextElement"===o.type?o.name:void 0;if(e){const t=i.get(e)||0;a=e+"-"+t,i.set(e,t+1)}}const s=oq(e,o,a);void 0!==s&&n.push(s)}return n}function cq(e,t,n){const r=function(e,t){const n=pH(t);let r=t,i=hH;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&VH.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(NH,jH);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!NH.test(e)){let n=e.replace(YH,FH);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=CH}return new i(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e,t){const n=t||{};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}(n):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return qH(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const n=t,r=new KH("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=rq+"#cannot-parse-style-attribute",r}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)XH.call(e,n)&&(t[pq(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?HH[r.property]||r.property:r.attribute,n]}}function uq(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,i=-1;for(;++i<e.length;){const t=sH(e[i])?{type:"Identifier",name:e[i]}:{type:"Literal",value:e[i]};n=n?{type:"MemberExpression",object:n,property:t,computed:Boolean(i&&"Literal"===t.type),optional:!1}:t}r=n}else r=sH(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){const t=r.value;return XH.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);dq(e)}function dq(e,t){const n=new KH("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=rq+"#cannot-handle-mdx-estrees-without-createevaluater",n}function pq(e){let t=e.replace(eq,hq);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function hq(e){return"-"+e.toLowerCase()}const fq={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},mq={};function gq(e,t){const n=t||mq;return yq(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function yq(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Aq(e.children,t,n)}return Array.isArray(e)?Aq(e,t,n):""}function Aq(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=yq(e[i],t,n);return r.join("")}function vq(e,t,n,r){const i=e.length;let o,a=0;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function bq(e,t){return e.length>0?(vq(e,e.length,0,t),e):t}class wq{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=null==t?Number.POSITIVE_INFINITY:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&Eq(this.left,n),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Eq(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Eq(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);Eq(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Eq(this.left,t.reverse())}}}function Eq(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function kq(e){const t={};let n,r,i,o,a,s,l,c=-1;const u=new wq(e);for(;++c<u.length;){for(;c in t;)c=t[c];if(n=u.get(c),c&&"chunkFlow"===n[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&(s=n[1]._tokenizer.events,i=0,i<s.length&&"lineEndingBlank"===s[i][1].type&&(i+=2),i<s.length&&"content"===s[i][1].type))for(;++i<s.length&&"content"!==s[i][1].type;)"chunkText"===s[i][1].type&&(s[i][1]._isInFirstContentOfListItem=!0,i++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,Cq(u,c)),c=t[c],l=!0);else if(n[1]._container){for(i=c,r=void 0;i--;)if(o=u.get(i),"lineEnding"===o[1].type||"lineEndingBlank"===o[1].type)"enter"===o[0]&&(r&&(u.get(r)[1].type="lineEndingBlank"),o[1].type="lineEnding",r=i);else if("linePrefix"!==o[1].type&&"listItemIndent"!==o[1].type)break;r&&(n[1].end={...u.get(r)[1].start},a=u.slice(r,c),a.unshift(n),u.splice(r,c-r+1,a))}}return vq(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!l}function Cq(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],c={};let u,d,p=-1,h=n,f=0,m=0;const g=[m];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(u=r.sliceStream(h),h.next||u.push(null),d&&a.defineSkip(h.start),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=h,h=h.next}for(h=n;++p<s.length;)"exit"===s[p][0]&&"enter"===s[p-1][0]&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(m=p+1,g.push(m),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(a.events=[],h?(h._tokenizer=void 0,h.previous=void 0):g.pop(),p=g.length;p--;){const t=s.slice(g[p],g[p+1]),n=o.pop();l.push([n,n+t.length-1]),e.splice(n,2,t)}for(l.reverse(),p=-1;++p<l.length;)c[f+l[p][0]]=f+l[p][1],f+=l[p][1]-l[p][0]-1;return c}const _q={}.hasOwnProperty;function Mq(e){const t={};let n=-1;for(;++n<e.length;)Tq(t,e[n]);return t}function Tq(e,t){let n;for(n in t){const r=(_q.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){_q.call(r,o)||(r[o]=[]);const e=i[o];Sq(r[o],Array.isArray(e)?e:e?[e]:[])}}}function Sq(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);vq(e,0,0,r)}const Dq=jq(/[A-Za-z]/),xq=jq(/[\dA-Za-z]/),Iq=jq(/[#-'*+\--9=?A-Z^-~]/);function Lq(e){return null!==e&&(e<32||127===e)}const Pq=jq(/\d/),Oq=jq(/[\dA-Fa-f]/),Rq=jq(/[!-/:-@[-`{-~]/);function Bq(e){return null!==e&&e<-2}function Yq(e){return null!==e&&(e<0||32===e)}function Nq(e){return-2===e||-1===e||32===e}const Vq=jq(/\p{P}|\p{S}/u),Fq=jq(/\s/);function jq(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function Hq(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return function(r){if(Nq(r))return e.enter(n),a(r);return t(r)};function a(r){return Nq(r)&&o++<i?(e.consume(r),a):(e.exit(n),t(r))}}const qq={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Hq(e,t,"linePrefix")},function(t){return e.enter("paragraph"),r(t)});let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,i(t)}function i(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):Bq(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),i)}}};const Gq={tokenize:function(e){const t=this,n=[];let r,i,o,a=0;return s;function s(r){if(a<n.length){const i=n[a];return t.containerState=i[1],e.attempt(i[0].continuation,l,c)(r)}return c(r)}function l(e){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&A();const n=t.events.length;let i,o=n;for(;o--;)if("exit"===t.events[o][0]&&"chunkFlow"===t.events[o][1].type){i=t.events[o][1].end;break}y(a);let s=n;for(;s<t.events.length;)t.events[s][1].end={...i},s++;return vq(t.events,o+1,0,t.events.slice(n)),t.events.length=s,c(e)}return s(e)}function c(i){if(a===n.length){if(!r)return p(i);if(r.currentConstruct&&r.currentConstruct.concrete)return f(i);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(zq,u,d)(i)}function u(e){return r&&A(),y(a),p(e)}function d(e){return t.parser.lazy[t.now().line]=a!==n.length,o=t.now().offset,f(e)}function p(n){return t.containerState={},e.attempt(zq,h,f)(n)}function h(e){return a++,n.push([t.currentConstruct,t.containerState]),p(e)}function f(n){return null===n?(r&&A(),y(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:i}),m(n))}function m(n){return null===n?(g(e.exit("chunkFlow"),!0),y(0),void e.consume(n)):Bq(n)?(e.consume(n),g(e.exit("chunkFlow")),a=0,t.interrupt=void 0,s):(e.consume(n),m)}function g(e,n){const s=t.sliceStream(e);if(n&&s.push(null),e.previous=i,i&&(i.next=e),i=e,r.defineSkip(e.start),r.write(s),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<o&&(!r.events[e][1].end||r.events[e][1].end.offset>o))return;const n=t.events.length;let i,s,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(i){s=t.events[l][1].end;break}i=!0}for(y(a),e=n;e<t.events.length;)t.events[e][1].end={...s},e++;vq(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function y(r){let i=n.length;for(;i-- >r;){const r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function A(){r.write([null]),i=void 0,r=void 0,t.containerState._closeFlow=void 0}}},zq={tokenize:function(e,t,n){return Hq(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};const Uq={partial:!0,tokenize:function(e,t,n){return function(t){return Nq(t)?Hq(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||Bq(e)?t(e):n(e)}}};const Wq={resolve:function(e){return kq(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?i(t):Bq(t)?e.check(Qq,o,i)(t):(e.consume(t),r)}function i(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function o(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},Qq={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),Hq(e,i,"linePrefix")};function i(i){if(null===i||Bq(i))return n(i);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}};const Zq={tokenize:function(e){const t=this,n=e.attempt(Uq,function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,Hq(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Wq,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const Jq={resolveAll:eG()},Kq=$q("string"),Xq=$q("text");function $q(e){return{resolveAll:eG("text"===e?tG:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],i=t.attempt(r,o,a);return o;function o(e){return l(e)?i(e):a(e)}function a(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return l(e)?(t.exit("data"),i(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;const t=r[e];let i=-1;if(t)for(;++i<t.length;){const e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function eG(e){return function(t,n){let r,i=-1;for(;++i<=t.length;)void 0===r?t[i]&&"data"===t[i][1].type&&(r=i,i++):t[i]&&"data"===t[i][1].type||(i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),i=r+2),r=void 0);return e?e(t,n):t}}function tG(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],i=t.sliceStream(r);let o,a=i.length,s=-1,l=0;for(;a--;){const e=i[a];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)l++,s--;if(s)break;s=-1}else if(-2===e)o=!0,l++;else if(-1!==e){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const i={type:n===e.length||o||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,["enter",i,t],["exit",i,t]),n+=2)}n++}return e}const nG={name:"thematicBreak",tokenize:function(e,t,n){let r,i=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,o(e)}(t)};function o(o){return o===r?(e.enter("thematicBreakSequence"),a(o)):i>=3&&(null===o||Bq(o))?(e.exit("thematicBreak"),t(o)):n(o)}function a(t){return t===r?(e.consume(t),i++,a):(e.exit("thematicBreakSequence"),Nq(t)?Hq(e,o,"whitespace")(t):o(t))}}};const rG={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Uq,i,o);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Hq(e,t,"listItemIndent",r.containerState.size+1)(n)}function o(n){return r.containerState.furtherBlankLines||!Nq(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(oG,t,a)(n))}function a(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Hq(e,e.attempt(rG,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,a=0;return function(t){const i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:Pq(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(nG,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return Pq(t)&&++a<10?(e.consume(t),s):(!r.interrupt||a<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(Uq,r.interrupt?n:c,e.attempt(iG,d,u))}function c(e){return r.containerState.initialBlankLine=!0,o++,d(e)}function u(t){return Nq(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},iG={partial:!0,tokenize:function(e,t,n){const r=this;return Hq(e,function(e){const i=r.events[r.events.length-1];return!Nq(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},oG={partial:!0,tokenize:function(e,t,n){const r=this;return Hq(e,function(e){const i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}};const aG={continuation:{tokenize:function(e,t,n){const r=this;return function(t){if(Nq(t))return Hq(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t);return i(t)};function i(r){return e.attempt(aG,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),i}return n(t)};function i(n){return Nq(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};function sG(e,t,n,r,i,o,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){if(60===t)return e.enter(r),e.enter(i),e.enter(o),e.consume(t),e.exit(o),d;if(null===t||32===t||41===t||Lq(t))return n(t);return e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),f(t)};function d(n){return 62===n?(e.enter(o),e.consume(n),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(n))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||Bq(t)?n(t):(e.consume(t),92===t?h:p)}function h(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function f(i){return u||null!==i&&41!==i&&!Yq(i)?u<c&&40===i?(e.consume(i),u++,f):41===i?(e.consume(i),u--,f):null===i||32===i||40===i||Lq(i)?n(i):(e.consume(i),92===i?m:f):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(i))}function m(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function lG(e,t,n,r,i,o){const a=this;let s,l=0;return function(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(o),c};function c(d){return l>999||null===d||91===d||93===d&&!s||94===d&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):93===d?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):Bq(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||Bq(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),s||(s=!Nq(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function cG(e,t,n,r,i,o){let a;return function(t){if(34===t||39===t||40===t)return e.enter(r),e.enter(i),e.consume(t),e.exit(i),a=40===t?41:t,s;return n(t)};function s(n){return n===a?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(o),l(n))}function l(t){return t===a?(e.exit(o),s(a)):null===t?n(t):Bq(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),Hq(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===a||null===t||Bq(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===a||92===t?(e.consume(t),c):c(t)}}function uG(e,t){let n;return function r(i){if(Bq(i))return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r;if(Nq(i))return Hq(e,r,n?"linePrefix":"lineSuffix")(i);return t(i)}}function dG(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const pG={name:"definition",tokenize:function(e,t,n){const r=this;let i;return function(t){return e.enter("definition"),function(t){return lG.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function o(t){return i=dG(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return Yq(t)?uG(e,s)(t):s(t)}function s(t){return sG(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(hG,c,c)(t)}function c(t){return Nq(t)?Hq(e,u,"whitespace")(t):u(t)}function u(o){return null===o||Bq(o)?(e.exit("definition"),r.parser.defined.push(i),t(o)):n(o)}}},hG={partial:!0,tokenize:function(e,t,n){return function(t){return Yq(t)?uG(e,r)(t):n(t)};function r(t){return cG(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return Nq(t)?Hq(e,o,"whitespace")(t):o(t)}function o(e){return null===e||Bq(e)?t(e):n(e)}}};const fG={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),Hq(e,i,"linePrefix",5)(t)};function i(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return null===t?s(t):Bq(t)?e.attempt(mG,o,s)(t):(e.enter("codeFlowValue"),a(t))}function a(t){return null===t||Bq(t)?(e.exit("codeFlowValue"),o(t)):(e.consume(t),a)}function s(n){return e.exit("codeIndented"),t(n)}}},mG={partial:!0,tokenize:function(e,t,n){const r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Bq(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):Hq(e,o,"linePrefix",5)(t)}function o(e){const o=r.events[r.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(e):Bq(e)?i(e):n(e)}}};const gG={name:"headingAtx",resolve:function(e,t){let n,r,i=e.length-2,o=3;"whitespace"===e[o][1].type&&(o+=2);i-2>o&&"whitespace"===e[i][1].type&&(i-=2);"atxHeadingSequence"===e[i][1].type&&(o===i-1||i-4>o&&"whitespace"===e[i-2][1].type)&&(i-=o+1===i?2:4);i>o&&(n={type:"atxHeadingText",start:e[o][1].start,end:e[i][1].end},r={type:"chunkText",start:e[o][1].start,end:e[i][1].end,contentType:"text"},vq(e,o,i-o+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]]));return e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),i(t)}(t)};function i(t){return 35===t&&r++<6?(e.consume(t),i):null===t||Yq(t)?(e.exit("atxHeadingSequence"),o(t)):n(t)}function o(n){return 35===n?(e.enter("atxHeadingSequence"),a(n)):null===n||Bq(n)?(e.exit("atxHeading"),t(n)):Nq(n)?Hq(e,o,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function a(t){return 35===t?(e.consume(t),a):(e.exit("atxHeadingSequence"),o(t))}function s(t){return null===t||35===t||Yq(t)?(e.exit("atxHeadingText"),o(t)):(e.consume(t),s)}}};const yG={name:"setextUnderline",resolveTo:function(e,t){let n,r,i,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){n=o;break}"paragraph"===e[o][1].type&&(r=o)}else"content"===e[o][1].type&&e.splice(o,1),i||"definition"!==e[o][1].type||(i=o);const a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",a,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=a;return e.push(["exit",a,t]),e},tokenize:function(e,t,n){const r=this;let i;return function(t){let a,s=r.events.length;for(;s--;)if("lineEnding"!==r.events[s][1].type&&"linePrefix"!==r.events[s][1].type&&"content"!==r.events[s][1].type){a="paragraph"===r.events[s][1].type;break}if(!r.parser.lazy[r.now().line]&&(r.interrupt||a))return e.enter("setextHeadingLine"),i=t,function(t){return e.enter("setextHeadingLineSequence"),o(t)}(t);return n(t)};function o(t){return t===i?(e.consume(t),o):(e.exit("setextHeadingLineSequence"),Nq(t)?Hq(e,a,"lineSuffix")(t):a(t))}function a(r){return null===r||Bq(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const AG=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],vG=["pre","script","style","textarea"],bG={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},tokenize:function(e,t,n){const r=this;let i,o,a,s,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(s){return 33===s?(e.consume(s),u):47===s?(e.consume(s),o=!0,h):63===s?(e.consume(s),i=3,r.interrupt?t:O):Dq(s)?(e.consume(s),a=String.fromCharCode(s),f):n(s)}function u(o){return 45===o?(e.consume(o),i=2,d):91===o?(e.consume(o),i=5,s=0,p):Dq(o)?(e.consume(o),i=4,r.interrupt?t:O):n(o)}function d(i){return 45===i?(e.consume(i),r.interrupt?t:O):n(i)}function p(i){const o="CDATA[";return i===o.charCodeAt(s++)?(e.consume(i),6===s?r.interrupt?t:M:p):n(i)}function h(t){return Dq(t)?(e.consume(t),a=String.fromCharCode(t),f):n(t)}function f(s){if(null===s||47===s||62===s||Yq(s)){const l=47===s,c=a.toLowerCase();return l||o||!vG.includes(c)?AG.includes(a.toLowerCase())?(i=6,l?(e.consume(s),m):r.interrupt?t(s):M(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):o?g(s):y(s)):(i=1,r.interrupt?t(s):M(s))}return 45===s||xq(s)?(e.consume(s),a+=String.fromCharCode(s),f):n(s)}function m(i){return 62===i?(e.consume(i),r.interrupt?t:M):n(i)}function g(t){return Nq(t)?(e.consume(t),g):C(t)}function y(t){return 47===t?(e.consume(t),C):58===t||95===t||Dq(t)?(e.consume(t),A):Nq(t)?(e.consume(t),y):C(t)}function A(t){return 45===t||46===t||58===t||95===t||xq(t)?(e.consume(t),A):v(t)}function v(t){return 61===t?(e.consume(t),b):Nq(t)?(e.consume(t),v):y(t)}function b(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,w):Nq(t)?(e.consume(t),b):E(t)}function w(t){return t===l?(e.consume(t),l=null,k):null===t||Bq(t)?n(t):(e.consume(t),w)}function E(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||Yq(t)?v(t):(e.consume(t),E)}function k(e){return 47===e||62===e||Nq(e)?y(e):n(e)}function C(t){return 62===t?(e.consume(t),_):n(t)}function _(t){return null===t||Bq(t)?M(t):Nq(t)?(e.consume(t),_):n(t)}function M(t){return 45===t&&2===i?(e.consume(t),x):60===t&&1===i?(e.consume(t),I):62===t&&4===i?(e.consume(t),R):63===t&&3===i?(e.consume(t),O):93===t&&5===i?(e.consume(t),P):!Bq(t)||6!==i&&7!==i?null===t||Bq(t)?(e.exit("htmlFlowData"),T(t)):(e.consume(t),M):(e.exit("htmlFlowData"),e.check(wG,B,T)(t))}function T(t){return e.check(EG,S,B)(t)}function S(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),D}function D(t){return null===t||Bq(t)?T(t):(e.enter("htmlFlowData"),M(t))}function x(t){return 45===t?(e.consume(t),O):M(t)}function I(t){return 47===t?(e.consume(t),a="",L):M(t)}function L(t){if(62===t){const n=a.toLowerCase();return vG.includes(n)?(e.consume(t),R):M(t)}return Dq(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),L):M(t)}function P(t){return 93===t?(e.consume(t),O):M(t)}function O(t){return 62===t?(e.consume(t),R):45===t&&2===i?(e.consume(t),O):M(t)}function R(t){return null===t||Bq(t)?(e.exit("htmlFlowData"),B(t)):(e.consume(t),R)}function B(n){return e.exit("htmlFlow"),t(n)}}},wG={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(Uq,t,n)}}},EG={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(Bq(t))return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i;return n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}};const kG={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(null===t)return n(t);return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},CG={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,i={partial:!0,tokenize:function(e,t,n){let i=0;return a;function a(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l}function l(t){return e.enter("codeFencedFence"),Nq(t)?Hq(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):c(t)}function c(t){return t===o?(e.enter("codeFencedFenceSequence"),u(t)):n(t)}function u(t){return t===o?(i++,e.consume(t),u):i>=s?(e.exit("codeFencedFenceSequence"),Nq(t)?Hq(e,d,"whitespace")(t):d(t)):n(t)}function d(r){return null===r||Bq(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let o,a=0,s=0;return function(t){return function(t){const n=r.events[r.events.length-1];return a=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,o=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===o?(s++,e.consume(t),l):s<3?n(t):(e.exit("codeFencedFenceSequence"),Nq(t)?Hq(e,c,"whitespace")(t):c(t))}function c(n){return null===n||Bq(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(kG,h,A)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||Bq(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):Nq(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Hq(e,d,"whitespace")(t)):96===t&&t===o?n(t):(e.consume(t),u)}function d(t){return null===t||Bq(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(t))}function p(t){return null===t||Bq(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===o?n(t):(e.consume(t),p)}function h(t){return e.attempt(i,A,f)(t)}function f(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m}function m(t){return a>0&&Nq(t)?Hq(e,g,"linePrefix",a+1)(t):g(t)}function g(t){return null===t||Bq(t)?e.check(kG,h,A)(t):(e.enter("codeFlowValue"),y(t))}function y(t){return null===t||Bq(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),y)}function A(n){return e.exit("codeFenced"),t(n)}}};const _G=document.createElement("i");function MG(e){const t="&"+e+";";_G.innerHTML=t;const n=_G.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&(n!==t&&n)}const TG={name:"characterReference",tokenize:function(e,t,n){const r=this;let i,o,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),i=31,o=xq,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,o=Oq,c):(e.enter("characterReferenceValue"),i=7,o=Pq,c(t))}function c(s){if(59===s&&a){const i=e.exit("characterReferenceValue");return o!==xq||MG(r.sliceSerialize(i))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return o(s)&&a++<i?(e.consume(s),c):n(s)}}};const SG={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return Rq(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const DG={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Hq(e,t,"linePrefix")}}};function xG(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const IG={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){const e="labelImage"===r.type?4:2;r.type="data",t+=e}}e.length!==n.length&&vq(e,0,e.length,n);return e},resolveTo:function(e,t){let n,r,i,o,a=e.length,s=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(i){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(i=a);const l={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[i][1].end}},u={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[i-2][1].start}};return o=[["enter",l,t],["enter",c,t]],o=bq(o,e.slice(r+1,r+s+3)),o=bq(o,[["enter",u,t]]),o=bq(o,xG(t.parser.constructs.insideSpan.null,e.slice(r+s+4,i-3),t)),o=bq(o,[["exit",u,t],e[i-2],e[i-1],["exit",c,t]]),o=bq(o,e.slice(i+1)),o=bq(o,[["exit",l,t]]),vq(e,r,e.length,o),e},tokenize:function(e,t,n){const r=this;let i,o,a=r.events.length;for(;a--;)if(("labelImage"===r.events[a][1].type||"labelLink"===r.events[a][1].type)&&!r.events[a][1]._balanced){i=r.events[a][1];break}return function(t){if(!i)return n(t);if(i._inactive)return u(t);return o=r.parser.defined.includes(dG(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s};function s(t){return 40===t?e.attempt(LG,c,o?c:u)(t):91===t?e.attempt(PG,c,o?l:u)(t):o?c(t):u(t)}function l(t){return e.attempt(OG,c,u)(t)}function c(e){return t(e)}function u(e){return i._balanced=!0,n(e)}}},LG={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return Yq(t)?uG(e,i)(t):i(t)}function i(t){return 41===t?c(t):sG(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function o(t){return Yq(t)?uG(e,s)(t):c(t)}function a(e){return n(e)}function s(t){return 34===t||39===t||40===t?cG(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function l(t){return Yq(t)?uG(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},PG={tokenize:function(e,t,n){const r=this;return function(t){return lG.call(r,e,i,o,"reference","referenceMarker","referenceString")(t)};function i(e){return r.parser.defined.includes(dG(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}},OG={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}};const RG={name:"labelStartImage",resolveAll:IG.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),i};function i(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),o):n(t)}function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};function BG(e){return null===e||Yq(e)||Fq(e)?1:Vq(e)?2:void 0}const YG={name:"attention",resolveAll:function(e,t){let n,r,i,o,a,s,l,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close)for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const d={...e[n][1].end},p={...e[u][1].start};NG(d,-s),NG(p,s),o={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:p},i={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:s>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[n][1].end={...o.start},e[u][1].start={...a.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=bq(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=bq(l,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",i,t]]),l=bq(l,xG(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=bq(l,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=bq(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,vq(e,n-1,u-n+3,l),u=n+l.length-c-2;break}u=-1;for(;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=BG(r);let o;return function(t){return o=t,e.enter("attentionSequence"),a(t)};function a(s){if(s===o)return e.consume(s),a;const l=e.exit("attentionSequence"),c=BG(s),u=!c||2===c&&i||n.includes(s),d=!i||2===i&&c||n.includes(r);return l._open=Boolean(42===o?u:u&&(i||!d)),l._close=Boolean(42===o?d:d&&(c||!u)),t(s)}}};function NG(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const VG={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i};function i(t){return Dq(t)?(e.consume(t),o):64===t?n(t):l(t)}function o(e){return 43===e||45===e||46===e||xq(e)?(r=1,a(e)):l(e)}function a(t){return 58===t?(e.consume(t),r=0,s):(43===t||45===t||46===t||xq(t))&&r++<32?(e.consume(t),a):(r=0,l(t))}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||Lq(r)?n(r):(e.consume(r),s)}function l(t){return 64===t?(e.consume(t),c):Iq(t)?(e.consume(t),l):n(t)}function c(e){return xq(e)?u(e):n(e)}function u(n){return 46===n?(e.consume(n),r=0,c):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):d(n)}function d(t){if((45===t||xq(t))&&r++<63){const n=45===t?d:u;return e.consume(t),n}return n(t)}}};const FG={name:"htmlText",tokenize:function(e,t,n){const r=this;let i,o,a;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),b):63===t?(e.consume(t),A):Dq(t)?(e.consume(t),k):n(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),o=0,h):Dq(t)?(e.consume(t),y):n(t)}function c(t){return 45===t?(e.consume(t),p):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),d):Bq(t)?(a=u,L(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),p):u(t)}function p(e){return 62===e?I(e):45===e?d(e):u(e)}function h(t){const r="CDATA[";return t===r.charCodeAt(o++)?(e.consume(t),6===o?f:h):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),m):Bq(t)?(a=f,L(t)):(e.consume(t),f)}function m(t){return 93===t?(e.consume(t),g):f(t)}function g(t){return 62===t?I(t):93===t?(e.consume(t),g):f(t)}function y(t){return null===t||62===t?I(t):Bq(t)?(a=y,L(t)):(e.consume(t),y)}function A(t){return null===t?n(t):63===t?(e.consume(t),v):Bq(t)?(a=A,L(t)):(e.consume(t),A)}function v(e){return 62===e?I(e):A(e)}function b(t){return Dq(t)?(e.consume(t),w):n(t)}function w(t){return 45===t||xq(t)?(e.consume(t),w):E(t)}function E(t){return Bq(t)?(a=E,L(t)):Nq(t)?(e.consume(t),E):I(t)}function k(t){return 45===t||xq(t)?(e.consume(t),k):47===t||62===t||Yq(t)?C(t):n(t)}function C(t){return 47===t?(e.consume(t),I):58===t||95===t||Dq(t)?(e.consume(t),_):Bq(t)?(a=C,L(t)):Nq(t)?(e.consume(t),C):I(t)}function _(t){return 45===t||46===t||58===t||95===t||xq(t)?(e.consume(t),_):M(t)}function M(t){return 61===t?(e.consume(t),T):Bq(t)?(a=M,L(t)):Nq(t)?(e.consume(t),M):C(t)}function T(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),i=t,S):Bq(t)?(a=T,L(t)):Nq(t)?(e.consume(t),T):(e.consume(t),D)}function S(t){return t===i?(e.consume(t),i=void 0,x):null===t?n(t):Bq(t)?(a=S,L(t)):(e.consume(t),S)}function D(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||Yq(t)?C(t):(e.consume(t),D)}function x(e){return 47===e||62===e||Yq(e)?C(e):n(e)}function I(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function L(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),P}function P(t){return Nq(t)?Hq(e,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):O(t)}function O(t){return e.enter("htmlTextData"),a(t)}}};const jG={name:"labelStartLink",resolveAll:IG.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),i};function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const HG={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return Bq(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const qG={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,i=3;if(!("lineEnding"!==e[i][1].type&&"space"!==e[i][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=i;++t<r;)if("codeTextData"===e[t][1].type){e[i][1].type="codeTextPadding",e[r][1].type="codeTextPadding",i+=2,r-=2;break}t=i-1,r++;for(;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,i,o=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),a(t)};function a(t){return 96===t?(e.consume(t),o++,a):(e.exit("codeTextSequence"),s(t))}function s(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),s):96===t?(i=e.enter("codeTextSequence"),r=0,c(t)):Bq(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||Bq(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),l)}function c(n){return 96===n?(e.consume(n),r++,c):r===o?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(i.type="codeTextData",l(n))}}};const GG={42:rG,43:rG,45:rG,48:rG,49:rG,50:rG,51:rG,52:rG,53:rG,54:rG,55:rG,56:rG,57:rG,62:aG},zG={91:pG},UG={[-2]:fG,[-1]:fG,32:fG},WG={35:gG,42:nG,45:[yG,nG],60:bG,61:yG,95:nG,96:CG,126:CG},QG={38:TG,92:SG},ZG={[-5]:DG,[-4]:DG,[-3]:DG,33:RG,38:TG,42:YG,60:[VG,FG],91:jG,92:[HG,SG],93:IG,95:YG,96:qG},JG={null:[YG,Jq]},KG={null:[42,95]},XG={null:[]};function $G(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let a=[],s=[],l=!0;const c={attempt:A(function(e,t){v(e,t.from)}),check:A(y),consume:function(e){Bq(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,b()):-1!==e&&(r.column++,r.offset++);r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++));u.previous=e,l=!0},enter:function(e,t){const n=t||{};return n.type=e,n.start=f(),u.events.push(["enter",n,u]),s.push(n),n},exit:function(e){const t=s.pop();return t.end=f(),u.events.push(["exit",t,u]),t},interrupt:A(y,{interrupt:!0})},u={code:null,containerState:{},defineSkip:function(e){i[e.line]=e.column,b()},events:[],now:f,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if("string"==typeof o)a=o;else switch(o){case-5:a="\r";break;case-4:a="\n";break;case-3:a="\r\n";break;case-2:a=t?" ":"\t";break;case-1:if(!t&&i)continue;a=" ";break;default:a=String.fromCharCode(o)}i=-2===o,r.push(a)}return r.join("")}(h(e),t)},sliceStream:h,write:function(e){if(a=bq(a,e),m(),null!==a[a.length-1])return[];return v(t,0),u.events=xG(o,u.events,u),u.events}};let d,p=t.tokenize.call(u,c);return t.resolveAll&&o.push(t),u;function h(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const e=a[0];"string"==typeof e?a[0]=e.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}(a,e)}function f(){const{_bufferIndex:e,_index:t,line:n,column:i,offset:o}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:o}}function m(){let e;for(;r._index<a.length;){const t=a[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)g(t.charCodeAt(r._bufferIndex));else g(t)}}function g(e){l=void 0,d=e,p=p(e)}function y(e,t){t.restore()}function A(e,t){return function(n,i,o){let a,d,p,h;return Array.isArray(n)?m(n):"tokenize"in n?m([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return m([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function m(e){return a=e,d=0,0===e.length?o:g(e[d])}function g(e){return function(n){h=function(){const e=f(),t=u.previous,n=u.currentConstruct,i=u.events.length,o=Array.from(s);return{from:i,restore:a};function a(){r=e,u.previous=t,u.currentConstruct=n,u.events.length=i,s=o,b()}}(),p=e,e.partial||(u.currentConstruct=e);if(e.name&&u.parser.constructs.disable.null.includes(e.name))return A(n);return e.tokenize.call(t?Object.assign(Object.create(u),t):u,c,y,A)(n)}}function y(t){return l=!0,e(p,h),i}function A(e){return l=!0,h.restore(),++d<a.length?g(a[d]):o}}}function v(e,t){e.resolveAll&&!o.includes(e)&&o.push(e),e.resolve&&vq(u.events,t,u.events.length-t,e.resolve(u.events.slice(t),u)),e.resolveTo&&(u.events=e.resolveTo(u.events,u))}function b(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}const ez=/[\0\t\n\r]/g;function tz(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}const nz=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rz(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return tz(n.slice(t?2:1),t?16:10)}return MG(n)||e}const iz={}.hasOwnProperty;function oz(e,t,r){return t&&"object"==typeof t&&(r=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(te),autolinkProtocol:_,autolinkEmail:_,atxHeading:o(K),blockQuote:o(U),characterEscape:_,characterReference:_,codeFenced:o(W),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(W,a),codeText:o(Q,a),codeTextData:_,data:_,codeFlowValue:_,definition:o(Z),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(J),hardBreakEscape:o(X),hardBreakTrailing:o(X),htmlFlow:o($,a),htmlFlowData:_,htmlText:o($,a),htmlTextData:_,image:o(ee),label:a,link:o(te),listItem:o(re),listItemValue:p,listOrdered:o(ne,d),listUnordered:o(ne),paragraph:o(ie),reference:V,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(K),strong:o(oe),thematicBreak:o(se)},exit:{atxHeading:l(),atxHeadingSequence:w,autolink:l(),autolinkEmail:z,autolinkProtocol:G,blockQuote:l(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:j,characterReferenceMarkerNumeric:j,characterReferenceValue:H,characterReference:q,codeFenced:l(g),codeFencedFence:m,codeFencedFenceInfo:h,codeFencedFenceMeta:f,codeFlowValue:M,codeIndented:l(y),codeText:l(I),codeTextData:M,data:M,definition:l(),definitionDestinationString:b,definitionLabelString:A,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(S),hardBreakTrailing:l(S),htmlFlow:l(D),htmlFlowData:M,htmlText:l(x),htmlTextData:M,image:l(P),label:R,labelText:O,lineEnding:T,link:l(L),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:F,resourceDestinationString:B,resourceTitleString:Y,resource:N,setextHeading:l(C),setextHeadingLineSequence:k,setextHeadingText:E,strong:l(),thematicBreak:l()}};sz(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const o={stack:[r],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:u,data:n},l=[];let d=-1;for(;++d<e.length;)if("listOrdered"===e[d][1].type||"listUnordered"===e[d][1].type)if("enter"===e[d][0])l.push(d);else{d=i(e,l.pop(),d)}for(d=-1;++d<e.length;){const n=t[e[d][0]];iz.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},o),e[d][1])}if(o.tokenStack.length>0){const e=o.tokenStack[o.tokenStack.length-1];(e[1]||cz).call(o,void 0,e[0])}for(r.position={start:az(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:az(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r,i,o,a,s=t-1,l=-1,c=!1;for(;++s<=n;){const t=e[s];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,a=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||a||l||o||(o=s),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let a=s;for(i=void 0;a--;){const t=e[a];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;i&&(e[i][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",i=a}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}o&&(!i||o<i)&&(r._spread=!0),r.end=Object.assign({},i?e[i][1].start:t[1].end),e.splice(i||s,0,["exit",r,t[2]]),s++,n++}if("listItemPrefix"===t[1].type){const i={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=i,e.splice(s,0,["enter",i,t[2]]),s++,n++,o=void 0,a=!0}}}return e[t][1]._spread=c,n}function o(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:az(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),c.call(this,t)}}function c(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+WH({start:e.start,end:e.end})+"): it’s not open");if(r[0].type!==e.type)if(t)t.call(this,e,r[0]);else{(r[1]||cz).call(this,e,r[0])}n.position.end=az(e.end)}function u(){return gq(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function h(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function f(){const e=this.resume();this.stack[this.stack.length-1].meta=e}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}function A(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=dG(this.sliceSerialize(e)).toLowerCase()}function v(){const e=this.resume();this.stack[this.stack.length-1].title=e}function b(){const e=this.resume();this.stack[this.stack.length-1].url=e}function w(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function k(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function C(){this.data.setextHeadingSlurpLineEnding=void 0}function _(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];n&&"text"===n.type||(n=ae(),n.position={start:az(e.start),end:void 0},t.push(n)),this.stack.push(n)}function M(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=az(e.end)}function T(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=az(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(_.call(this,e),M.call(this,e))}function S(){this.data.atHardBreak=!0}function D(){const e=this.resume();this.stack[this.stack.length-1].value=e}function x(){const e=this.resume();this.stack[this.stack.length-1].value=e}function I(){const e=this.resume();this.stack[this.stack.length-1].value=e}function L(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function O(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(nz,rz)}(t),n.identifier=dG(t).toLowerCase()}function R(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t}function B(){const e=this.resume();this.stack[this.stack.length-1].url=e}function Y(){const e=this.resume();this.stack[this.stack.length-1].title=e}function N(){this.data.inReference=void 0}function V(){this.data.referenceType="collapsed"}function F(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=dG(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function j(e){this.data.characterReferenceType=e.type}function H(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;if(n)r=tz(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0;else{r=MG(t)}this.stack[this.stack.length-1].value+=r}function q(e){this.stack.pop().position.end=az(e.end)}function G(e){M.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function z(e){M.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function U(){return{type:"blockquote",children:[]}}function W(){return{type:"code",lang:null,meta:null,value:""}}function Q(){return{type:"inlineCode",value:""}}function Z(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function J(){return{type:"emphasis",children:[]}}function K(){return{type:"heading",depth:0,children:[]}}function X(){return{type:"break"}}function $(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function ie(){return{type:"paragraph",children:[]}}function oe(){return{type:"strong",children:[]}}function ae(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}(r)(function(e){for(;!kq(e););return e}(function(e){const t={constructs:Mq([n,...(e||{}).extensions||[]]),content:r(qq),defined:[],document:r(Gq),flow:r(Zq),lazy:{},string:r(Kq),text:r(Xq)};return t;function r(e){return function(n){return $G(t,e,n)}}}(r).document().write(function(){let e,t=1,n="",r=!0;return function(i,o,a){const s=[];let l,c,u,d,p;for(i=n+("string"==typeof i?i.toString():new TextDecoder(o||void 0).decode(i)),u=0,n="",r&&(65279===i.charCodeAt(0)&&u++,r=void 0);u<i.length;){if(ez.lastIndex=u,l=ez.exec(i),d=l&&void 0!==l.index?l.index:i.length,p=i.charCodeAt(d),!l){n=i.slice(u);break}if(10===p&&u===d&&e)s.push(-3),e=void 0;else switch(e&&(s.push(-5),e=void 0),u<d&&(s.push(i.slice(u,d)),t+=d-u),p){case 0:s.push(65533),t++;break;case 9:for(c=4*Math.ceil(t/4),s.push(-2);t++<c;)s.push(-1);break;case 10:s.push(-4),t=1;break;default:e=!0,t=1}u=d+1}return a&&(e&&s.push(-5),n&&s.push(n),s.push(null)),s}}()(e,t,!0))))}function az(e){return{line:e.line,column:e.column,offset:e.offset}}function sz(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?sz(e,r):lz(e,r)}}function lz(e,t){let n;for(n in t)if(iz.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function cz(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+WH({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+WH({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+WH({start:t.start,end:t.end})+") is still open")}function uz(e){const t=this;t.parser=function(n){return oz(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}const dz="object"==typeof self?self:globalThis,pz=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case 0:case-1:return n(a,i);case 1:{const e=n([],i);for(const t of a)e.push(r(t));return e}case 2:{const e=n({},i);for(const[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),i);case 4:{const{source:e,flags:t}=a;return n(new RegExp(e,t),i)}case 5:{const e=n(new Map,i);for(const[t,n]of a)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,i);for(const t of a)e.add(r(t));return e}case 7:{const{name:e,message:t}=a;return n(new dz[e](t),i)}case 8:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:e}=new Uint8Array(a);return n(new DataView(e),a)}}return n(new dz[o](a),i)};return r})(new Map,e)(0),hz="",{toString:fz}={},{keys:mz}=Object,gz=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=fz.call(e).slice(8,-1);switch(n){case"Array":return[1,hz];case"Object":return[2,hz];case"Date":return[3,hz];case"RegExp":return[4,hz];case"Map":return[5,hz];case"Set":return[6,hz];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},yz=([e,t])=>0===e&&("function"===t||"symbol"===t),Az=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const i=(e,t)=>{const i=r.push(e)-1;return n.set(t,i),i},o=r=>{if(n.has(r))return n.get(r);let[a,s]=gz(r);switch(a){case 0:{let t=r;switch(s){case"bigint":a=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);t=null;break;case"undefined":return i([-1],r)}return i([a,t],r)}case 1:{if(s){let e=r;return"DataView"===s?e=new Uint8Array(r.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(r)),i([s,[...e]],r)}const e=[],t=i([a,e],r);for(const t of r)e.push(o(t));return t}case 2:{if(s)switch(s){case"BigInt":return i([s,r.toString()],r);case"Boolean":case"Number":case"String":return i([s,r.valueOf()],r)}if(t&&"toJSON"in r)return o(r.toJSON());const n=[],l=i([a,n],r);for(const t of mz(r))!e&&yz(gz(r[t]))||n.push([o(t),o(r[t])]);return l}case 3:return i([a,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return i([a,{source:e,flags:t}],r)}case 5:{const t=[],n=i([a,t],r);for(const[n,i]of r)(e||!yz(gz(n))&&!yz(gz(i)))&&t.push([o(n),o(i)]);return n}case 6:{const t=[],n=i([a,t],r);for(const n of r)!e&&yz(gz(n))||t.push(o(n));return n}}const{message:l}=r;return i([a,{name:s,message:l}],r)};return o})(!(t||n),!!t,new Map,r)(e),r},vz="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?pz(Az(e,t)):structuredClone(e):(e,t)=>pz(Az(e,t));function bz(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(37===o&&xq(e.charCodeAt(n+1))&&xq(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const t=e.charCodeAt(n+1);o<56320&&t>56319&&t<57344?(a=String.fromCharCode(o,t),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function wz(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Ez(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const kz=function(e){if(null==e)return _z;if("function"==typeof e)return Cz(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=kz(e[n]);return Cz(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}(e):function(e){const t=e;return Cz(n);function n(n){const r=n;let i;for(i in e)if(r[i]!==t[i])return!1;return!0}}(e);if("string"==typeof e)return function(e){return Cz(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function Cz(e){return function(t,n,r){return Boolean(Mz(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function _z(){return!0}function Mz(e){return null!==e&&"object"==typeof e&&"type"in e}const Tz=[],Sz=!0,Dz=!1;function xz(e,t,n,r){let i;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):i=t;const o=kz(i),a=r?-1:1;!function e(i,s,l){const c=i&&"object"==typeof i?i:{};if("string"==typeof c.type){const e="string"==typeof c.tagName?c.tagName:"string"==typeof c.name?c.name:void 0;Object.defineProperty(u,"name",{value:"node ("+i.type+(e?"<"+e+">":"")+")"})}return u;function u(){let c,u,d,p=Tz;if((!t||o(i,s,l[l.length-1]||void 0))&&(p=function(e){if(Array.isArray(e))return e;if("number"==typeof e)return[Sz,e];return null==e?Tz:[e]}(n(i,l)),p[0]===Dz))return p;if("children"in i&&i.children){const t=i;if(t.children&&"skip"!==p[0])for(u=(r?t.children.length:-1)+a,d=l.concat(t);u>-1&&u<t.children.length;){const n=t.children[u];if(c=e(n,u,d)(),c[0]===Dz)return c;u="number"==typeof c[1]?c[1]:u+a}}return p}}(e,void 0,[])()}function Iz(e,t,n,r){let i,o,a;"function"==typeof t&&"function"!=typeof n?(o=void 0,a=t,i=n):(o=t,a=n,i=r),xz(e,o,function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return a(e,r,n)},i)}function Lz(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&"text"===o.type?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&"text"===a.type?a.value+=r:i.push({type:"text",value:r}),i}function Pz(e){const t=e.spread;return null==t?e.children.length>1:t}function Oz(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(Rz(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Rz(t.slice(i),i>0,!1)),o.join("")}function Rz(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;9===t||32===t;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}const Bz={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=bz(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);void 0===s?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Lz(e,t);const i={src:bz(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)},image:function(e,t){const n={src:bz(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Lz(e,t);const i={href:bz(r.url||"")};null!==r.title&&void 0!==r.title&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)},link:function(e,t){const n={href:bz(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),i=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Pz(n[r])}return t}(n):Pz(t),o={},a=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const e=r[s];(i||0!==s||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||i?a.push(e):a.push(...e.children)}const l=r[r.length-1];l&&(i||"element"!==l.type||"p"!==l.tagName)&&a.push({type:"text",value:"\n"});const c={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){const n={},r=e.all(t);let i=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++i<r.length;){const e=r[i];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=zH(t.children[1]),a=GH(t.children[t.children.length-1]);o&&a&&(r.position={start:o,end:a}),i.push(r)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,i=0===(r?r.indexOf(t):1)?"th":"td",o=n&&"table"===n.type?n.align:void 0,a=o?o.length:t.children.length;let s=-1;const l=[];for(;++s<a;){const n=t.children[s],r={},a=o?o[s]:void 0;a&&(r.align=a);let c={type:"element",tagName:i,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),l.push(c)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){const n={type:"text",value:Oz(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:Yz,yaml:Yz,definition:Yz,footnoteDefinition:Yz};function Yz(){}const Nz={}.hasOwnProperty,Vz={};function Fz(e,t){e.position&&(t.position=function(e){const t=zH(e),n=GH(e);if(t&&n)return{start:t,end:n}}(e))}function jz(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;if("string"==typeof t)if("element"===n.type)n.tagName=t;else{n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}}"element"===n.type&&i&&Object.assign(n.properties,vz(i)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function Hz(e,t){const n=t.data||{},r=!("value"in t)||Nz.call(n,"hProperties")||Nz.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}function qz(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function Gz(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function zz(e,t){const n=function(e,t){const n=t||Vz,r=new Map,i=new Map,o=new Map,a={...Bz,...n.handlers},s={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const i=s.one(n[r],e);if(i){if(r&&"break"===n[r-1].type&&(Array.isArray(i)||"text"!==i.type||(i.value=Gz(i.value)),!Array.isArray(i)&&"element"===i.type)){const e=i.children[0];e&&"text"===e.type&&(e.value=Gz(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t},applyData:jz,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:function(e,t){const n=e.type,r=s.handlers[n];if(Nz.call(s.handlers,n)&&r)return r(s,e,t);if(s.options.passThrough&&s.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=vz(n);return r.children=s.all(e),r}return vz(e)}return(s.options.unknownHandler||Hz)(s,e,t)},options:n,patch:Fz,wrap:qz};return Iz(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),s}(e,t),r=n.one(e,void 0),i=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||wz,r=e.options.footnoteBackLabel||Ez,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const i=e.footnoteById.get(e.footnoteOrder[l]);if(!i)continue;const o=e.all(i),a=String(i.identifier).toUpperCase(),c=bz(a.toLowerCase());let u=0;const d=[],p=e.footnoteCounts.get(a);for(;void 0!==p&&++u<=p;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const h=o[o.length-1];if(h&&"element"===h.type&&"p"===h.tagName){const e=h.children[h.children.length-1];e&&"text"===e.type?e.value+=" ":h.children.push({type:"text",value:" "}),h.children.push(...d)}else o.push(...d);const f={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(o,!0)};e.patch(i,f),s.push(f)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...vz(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:"\n"},i),o}function Uz(e,t){return e&&"run"in e?async function(n,r){const i=zz(n,{file:r,...t});await e.run(i,r)}:function(n,r){return zz(n,{file:r,...e||t})}}function Wz(e){if(e)throw e}var Qz=i(7095);function Zz(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function Jz(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function i(o,...a){const s=e[++n];let l=-1;if(o)r(o);else{for(;++l<t.length;)null!==a[l]&&void 0!==a[l]||(a[l]=t[l]);t=a,s?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let a;r&&t.push(i);try{a=e.apply(this,t)}catch(e){if(r&&n)throw e;return i(e)}r||(a&&a.then&&"function"==typeof a.then?a.then(o,i):a instanceof Error?i(a):o(a))}function i(e,...r){n||(n=!0,t(e,...r))}function o(e){i(null,e)}}(s,i)(...a):r(null,...a)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}const Kz={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');Xz(e);let n,r=0,i=-1,o=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;o--;)if(47===e.codePointAt(o)){if(n){r=o+1;break}}else i<0&&(n=!0,i=o+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let a=-1,s=t.length-1;for(;o--;)if(47===e.codePointAt(o)){if(n){r=o+1;break}}else a<0&&(n=!0,a=o+1),s>-1&&(e.codePointAt(o)===t.codePointAt(s--)?s<0&&(i=o):(s=-1,i=a));r===i?i=a:i<0&&(i=e.length);return e.slice(r,i)},dirname:function(e){if(Xz(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){Xz(e);let t,n=e.length,r=-1,i=0,o=-1,a=0;for(;n--;){const s=e.codePointAt(n);if(47!==s)r<0&&(t=!0,r=n+1),46===s?o<0?o=n:1!==a&&(a=1):o>-1&&(a=-1);else if(t){i=n+1;break}}if(o<0||r<0||0===a||1===a&&o===r-1&&o===i+1)return"";return e.slice(o,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)Xz(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){Xz(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,i="",o=0,a=-1,s=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.codePointAt(l);else{if(47===n)break;n=47}if(47===n){if(a===l-1||1===s);else if(a!==l-1&&2===s){if(i.length<2||2!==o||46!==i.codePointAt(i.length-1)||46!==i.codePointAt(i.length-2))if(i.length>2){if(r=i.lastIndexOf("/"),r!==i.length-1){r<0?(i="",o=0):(i=i.slice(0,r),o=i.length-1-i.lastIndexOf("/")),a=l,s=0;continue}}else if(i.length>0){i="",o=0,a=l,s=0;continue}t&&(i=i.length>0?i+"/..":"..",o=2)}else i.length>0?i+="/"+e.slice(a+1,l):i=e.slice(a+1,l),o=l-a-1;a=l,s=0}else 46===n&&s>-1?s++:s=-1}return i}(e,!t);0!==n.length||t||(n=".");n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/");return t?"/"+n:n}(t)},sep:"/"};function Xz(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const $z={cwd:function(){return"/"}};function eU(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function tU(e){if("string"==typeof e)e=new URL(e);else if(!eU(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}const nU=["history","path","basename","stem","extname","dirname"];class rU{constructor(e){let t;t=e?eU(e)?{path:e}:"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":$z.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,r=-1;for(;++r<nU.length;){const e=nU[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)nU.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?Kz.basename(this.path):void 0}set basename(e){oU(e,"basename"),iU(e,"basename"),this.path=Kz.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?Kz.dirname(this.path):void 0}set dirname(e){aU(this.basename,"dirname"),this.path=Kz.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?Kz.extname(this.path):void 0}set extname(e){if(iU(e,"extname"),aU(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Kz.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){eU(e)&&(e=tU(e)),oU(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?Kz.basename(this.path,this.extname):void 0}set stem(e){oU(e,"stem"),iU(e,"stem"),this.path=Kz.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new KH(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){if(void 0===this.value)return"";if("string"==typeof this.value)return this.value;return new TextDecoder(e||void 0).decode(this.value)}}function iU(e,t){if(e&&e.includes(Kz.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Kz.sep+"`")}function oU(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function aU(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const sU=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},lU={}.hasOwnProperty;class cU extends sU{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Jz()}copy(){const e=new cU;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(Qz(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(hU("data",this.frozen),this.namespace[e]=t,this):lU.call(this.namespace,e)&&this.namespace[e]||void 0:e?(hU("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=t.call(e,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=gU(e),n=this.parser||this.Parser;return dU("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),dU("process",this.parser||this.Parser),pU("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){const o=gU(e),a=n.parse(o);function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}n.run(a,o,function(e,t,r){if(e||!t||!r)return s(e);const i=t,o=n.stringify(i,r);var a;"string"==typeof(a=o)||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(a)?r.value=o:r.result=o,s(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),dU("processSync",this.parser||this.Parser),pU("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,Wz(e),t=r}),mU("processSync","process",n),t}run(e,t,n){fU(e),this.freeze();const r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,o){const a=gU(t);r.run(e,a,function(t,r,a){const s=r||e;t?o(t):i?i(s):n(void 0,s,a)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){Wz(e),n=t,r=!0}),mU("runSync","run",r),n}stringify(e,t){this.freeze();const n=gU(t),r=this.compiler||this.Compiler;return pU("stringify",r),fU(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(hU("use",this.frozen),null==e);else if("function"==typeof e)s(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?a(e):o(e)}return this;function i(e){if("function"==typeof e)s(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;s(t,n)}else o(e)}}function o(e){if(!("plugins"in e)&&!("settings"in e))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(e.plugins),e.settings&&(r.settings=Qz(!0,r.settings,e.settings))}function a(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;){i(e[t])}}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(-1===i)n.push([e,...t]);else if(t.length>0){let[r,...o]=t;const a=n[i][1];Zz(a)&&Zz(r)&&(r=Qz(!0,a,r)),n[i]=[e,r,...o]}}}}const uU=(new cU).freeze();function dU(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function pU(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function hU(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function fU(e){if(!Zz(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function mU(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function gU(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new rU(e)}const yU=[],AU={allowDangerousHtml:!0},vU=/^(https?|ircs?|mailto|xmpp)$/i,bU=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function wU(e){const t=EU(e),n=kU(e);return CU(t.runSync(t.parse(n),n),e)}function EU(e){const t=e.rehypePlugins||yU,n=e.remarkPlugins||yU,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...AU}:AU;return uU().use(uz).use(n).use(Uz,r).use(t)}function kU(e){const t=e.children||"",n=new rU;return"string"==typeof t&&(n.value=t),n}function CU(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,a=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||_U;for(const e of bU)Object.hasOwn(t,e.from)&&rH((e.from,e.to&&e.to,e.id));return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:"root"===e.type?e.children:[e]}),Iz(e,function(e,t,i){if("raw"===e.type&&i&&"number"==typeof t)return a?i.children.splice(t,1):i.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in fq)if(Object.hasOwn(fq,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=fq[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=l(String(n||""),t,e))}}if("element"===e.type){let a=n?!n.includes(e.tagName):!!o&&o.includes(e.tagName);if(!a&&r&&"number"==typeof t&&(a=!r(e,t,i)),a&&i&&"number"==typeof t)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}),iq(e,{Fragment:yt.Fragment,components:i,ignoreInvalidStyle:!0,jsx:yt.jsx,jsxs:yt.jsxs,passKeys:!0,passNode:!0})}function _U(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return-1===t||-1!==i&&t>i||-1!==n&&t>n||-1!==r&&t>r||vU.test(e.slice(0,t))?e:""}function MU(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}function TU(e,t,n){const r=kz((n||{}).ignore||[]),i=function(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const e=n[r];t.push([SU(e[0]),DU(e[1])])}return t}(t);let o=-1;for(;++o<i.length;)xz(e,"text",a);function a(e,t){let n,a=-1;for(;++a<t.length;){const e=t[a],i=n?n.children:void 0;if(r(e,i?i.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){const n=t[t.length-1],r=i[o][0],a=i[o][1];let s=0;const l=n.children.indexOf(e);let c=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){const n=d.index,i={index:d.index,input:d.input,stack:[...t,e]};let o=a(...d,i);if("string"==typeof o&&(o=o.length>0?{type:"text",value:o}:void 0),!1===o?r.lastIndex=n+1:(s!==n&&u.push({type:"text",value:e.value.slice(s,n)}),Array.isArray(o)?u.push(...o):o&&u.push(o),s=n+d[0].length,c=!0),!r.global)break;d=r.exec(e.value)}c?(s<e.value.length&&u.push({type:"text",value:e.value.slice(s)}),n.children.splice(l,1,...u)):u=[e];return l+u.length}(e,t)}}function SU(e){return"string"==typeof e?new RegExp(function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e),"g"):e}function DU(e){return"function"==typeof e?e:function(){return e}}const xU="phrasing",IU=["autolink","link","image","label"];function LU(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function PU(e){this.config.enter.autolinkProtocol.call(this,e)}function OU(e){this.config.exit.autolinkProtocol.call(this,e)}function RU(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function BU(e){this.config.exit.autolinkEmail.call(this,e)}function YU(e){this.exit(e)}function NU(e){TU(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,VU],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,FU]],{ignore:["link","linkReference"]})}function VU(e,t,n,r,i){let o="";if(!jU(i))return!1;if(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!function(e){const t=e.split(".");if(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))return!1;return!0}(n))return!1;const a=function(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=MU(e,"(");let o=MU(e,")");for(;-1!==r&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:o+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function FU(e,t,n,r){return!(!jU(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function jU(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||Fq(n)||Vq(n))&&(!t||47!==n)}function HU(){this.buffer()}function qU(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function GU(){this.buffer()}function zU(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function UU(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=dG(this.sliceSerialize(e)).toLowerCase(),n.label=t}function WU(e){this.exit(e)}function QU(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=dG(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ZU(e){this.exit(e)}function JU(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const a=n.enter("footnoteReference"),s=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),s(),a(),o+=i.move("]"),o}function KU(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:function(e,n,r,i){const o=r.createTracker(i);let a=o.move("[^");const s=r.enter("footnoteDefinition"),l=r.enter("label");a+=o.move(r.safe(r.associationId(e),{before:a,after:"]"})),l(),a+=o.move("]:"),e.children&&e.children.length>0&&(o.shift(4),a+=o.move((t?"\n":" ")+r.indentLines(r.containerFlow(e,o.current()),t?$U:XU)));return s(),a},footnoteReference:JU},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}}function XU(e,t,n){return 0===t?e:$U(e,t,n)}function $U(e,t,n){return(n?"":" ")+e}JU.peek=function(){return"["};const eW=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function tW(e){this.enter({type:"delete",children:[]},e)}function nW(e){this.exit(e)}function rW(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),o(),a}function iW(e){return e.length}function oW(e){return null==e?"":String(e)}function aW(e){const t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:82===t||114===t?114:0}function sW(e,t,n){return">"+(n?"":" ")+e}function lW(e,t){return cW(e,t.inConstruct,!0)&&!cW(e,t.notInConstruct,!1)}function cW(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function uW(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if("\n"===n.unsafe[i].character&&lW(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return"\\\n"}function dW(e,t,n){return(n?"":" ")+e}function pW(e){const t=e.options.quote||'"';if('"'!==t&&"'"!==t)throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function hW(e){return"&#x"+e.toString(16).toUpperCase()+";"}function fW(e,t,n){const r=BG(e),i=BG(t);return void 0===r?void 0===i?"_"===n?{inside:!0,outside:!0}:{inside:!1,outside:!1}:1===i?{inside:!0,outside:!0}:{inside:!1,outside:!0}:1===r?void 0===i?{inside:!1,outside:!1}:1===i?{inside:!0,outside:!0}:{inside:!1,outside:!1}:void 0===i?{inside:!1,outside:!1}:1===i?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function mW(e,t,n,r){const i=function(e){const t=e.options.emphasis||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}(n),o=n.enter("emphasis"),a=n.createTracker(r),s=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const c=l.charCodeAt(0),u=fW(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=hW(c)+l.slice(1));const d=l.charCodeAt(l.length-1),p=fW(r.after.charCodeAt(0),d,i);p.inside&&(l=l.slice(0,-1)+hW(d));const h=a.move(i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:u.outside},s+l+h}function gW(e){return e.value||""}function yW(e,t,n,r){const i=pW(n),o='"'===i?"Quote":"Apostrophe",a=n.enter("image");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),c+=l.move(")"),a(),c}function AW(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const c=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,o(),"full"!==i&&c&&c===d?"shortcut"===i?l=l.slice(0,-1):l+=s.move("]"):l+=s.move(d+"]"),l}function vW(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const e=n.unsafe[o],t=n.compilePattern(e);let i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;10===r.charCodeAt(e)&&13===r.charCodeAt(e-1)&&e--,r=r.slice(0,e)+" "+r.slice(i.index+1)}}return i+r+i}function bW(e,t){const n=gq(e);return Boolean(!t.options.resourceLink&&e.url&&!e.title&&e.children&&1===e.children.length&&"text"===e.children[0].type&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}function wW(e,t,n,r){const i=pW(n),o='"'===i?"Quote":"Apostrophe",a=n.createTracker(r);let s,l;if(bW(e,n)){const t=n.stack;n.stack=[],s=n.enter("autolink");let r=a.move("<");return r+=a.move(n.containerPhrasing(e,{before:r,after:">",...a.current()})),r+=a.move(">"),s(),n.stack=t,r}s=n.enter("link"),l=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${o}`),c+=a.move(" "+i),c+=a.move(n.safe(e.title,{before:c,after:i,...a.current()})),c+=a.move(i),l()),c+=a.move(")"),s(),c}function EW(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,o(),"full"!==i&&c&&c===d?"shortcut"===i?l=l.slice(0,-1):l+=s.move("]"):l+=s.move(d+"]"),l}function kW(e){const t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function CW(e){const t=e.options.rule||"*";if("*"!==t&&"-"!==t&&"_"!==t)throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}rW.peek=function(){return"~"},mW.peek=function(e,t,n){return n.options.emphasis||"*"},gW.peek=function(){return"<"},yW.peek=function(){return"!"},AW.peek=function(){return"!"},vW.peek=function(){return"`"},wW.peek=function(e,t,n){return bW(e,n)?"<":"["},EW.peek=function(){return"["};const _W=kz(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function MW(e,t,n,r){const i=function(e){const t=e.options.strong||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}(n),o=n.enter("strong"),a=n.createTracker(r),s=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const c=l.charCodeAt(0),u=fW(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=hW(c)+l.slice(1));const d=l.charCodeAt(l.length-1),p=fW(r.after.charCodeAt(0),d,i);p.inside&&(l=l.slice(0,-1)+hW(d));const h=a.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:u.outside},s+l+h}MW.peek=function(e,t,n){return n.options.strong||"*"};const TW={blockquote:function(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const a=n.indentLines(n.containerFlow(e,o.current()),sW);return i(),a},break:uW,code:function(e,t,n,r){const i=function(e){const t=e.options.fence||"`";if("`"!==t&&"~"!==t)throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}(n),o=e.value||"",a="`"===i?"GraveAccent":"Tilde";if(function(e,t){return Boolean(!1===t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}(e,n)){const e=n.enter("codeIndented"),t=n.indentLines(o,dW);return e(),t}const s=n.createTracker(r),l=i.repeat(Math.max(function(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,a=0;if("string"!=typeof t)throw new TypeError("Expected substring");for(;-1!==r;)r===i?++o>a&&(a=o):o=1,i=r+t.length,r=n.indexOf(t,i);return a}(o,i)+1,3)),c=n.enter("codeFenced");let u=s.move(l);if(e.lang){const t=n.enter(`codeFencedLang${a}`);u+=s.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){const t=n.enter(`codeFencedMeta${a}`);u+=s.move(" "),u+=s.move(n.safe(e.meta,{before:u,after:"\n",encode:["`"],...s.current()})),t()}return u+=s.move("\n"),o&&(u+=s.move(o+"\n")),u+=s.move(l),c(),u},definition:function(e,t,n,r){const i=pW(n),o='"'===i?"Quote":"Apostrophe",a=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":"\n",...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),a(),c},emphasis:mW,hardBreak:uW,heading:function(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(function(e,t){let n=!1;return Iz(e,function(e){if("value"in e&&/\r?\n|\r/.test(e.value)||"break"===e.type)return n=!0,Dz}),Boolean((!e.depth||e.depth<3)&&gq(e)&&(t.options.setext||n))}(e,n)){const t=n.enter("headingSetext"),r=n.enter("phrasing"),a=n.containerPhrasing(e,{...o.current(),before:"\n",after:"\n"});return r(),t(),a+"\n"+(1===i?"=":"-").repeat(a.length-(Math.max(a.lastIndexOf("\r"),a.lastIndexOf("\n"))+1))}const a="#".repeat(i),s=n.enter("headingAtx"),l=n.enter("phrasing");o.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:"\n",...o.current()});return/^[\t ]/.test(c)&&(c=hW(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),s(),c},html:gW,image:yW,imageReference:AW,inlineCode:vW,link:wW,linkReference:EW,list:function(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?function(e){const t=e.options.bulletOrdered||".";if("."!==t&&")"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}(n):kW(n);const s=e.ordered?"."===a?")":".":function(e){const t=kW(e),n=e.options.bulletOther;if(!n)return"*"===t?"-":"*";if("*"!==n&&"+"!==n&&"-"!==n)throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}(n);let l=!(!t||!n.bulletLastUsed)&&a===n.bulletLastUsed;if(!e.ordered){const t=e.children?e.children[0]:void 0;if("*"!==a&&"-"!==a||!t||t.children&&t.children[0]||"list"!==n.stack[n.stack.length-1]||"listItem"!==n.stack[n.stack.length-2]||"list"!==n.stack[n.stack.length-3]||"listItem"!==n.stack[n.stack.length-4]||0!==n.indexStack[n.indexStack.length-1]||0!==n.indexStack[n.indexStack.length-2]||0!==n.indexStack[n.indexStack.length-3]||(l=!0),CW(n)===a&&t){let t=-1;for(;++t<e.children.length;){const n=e.children[t];if(n&&"listItem"===n.type&&n.children&&n.children[0]&&"thematicBreak"===n.children[0].type){l=!0;break}}}}l&&(a=s),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=o,i(),c},listItem:function(e,t,n,r){const i=function(e){const t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n);let o=n.bulletCurrent||kW(n);t&&"list"===t.type&&t.ordered&&(o=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+o);let a=o.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(a=4*Math.ceil(a/4));const s=n.createTracker(r);s.move(o+" ".repeat(a-o.length)),s.shift(a);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),function(e,t,n){if(t)return(n?"":" ".repeat(a))+e;return(n?o:o+" ".repeat(a-o.length))+e});return l(),c},paragraph:function(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),a=n.containerPhrasing(e,r);return o(),i(),a},root:function(e,t,n,r){const i=e.children.some(function(e){return _W(e)});return(i?n.containerPhrasing:n.containerFlow).call(n,e,r)},strong:MW,text:function(e,t,n,r){return n.safe(e.value,r)},thematicBreak:function(e,t,n){const r=(CW(n)+(n.options.ruleSpaces?" ":"")).repeat(function(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}(n));return n.options.ruleSpaces?r.slice(0,-1):r}};function SW(e){const t=e._align;this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function DW(e){this.exit(e),this.data.inTable=void 0}function xW(e){this.enter({type:"tableRow",children:[]},e)}function IW(e){this.exit(e)}function LW(e){this.enter({type:"tableCell",children:[]},e)}function PW(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,OW));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function OW(e,t){return"|"===t?t:e}function RW(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=TW.inlineCode(e,t,n);n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&"));return r},table:function(e,t,n,r){return s(function(e,t,n){const r=e.children;let i=-1;const o=[],a=t.enter("table");for(;++i<r.length;)o[i]=l(r[i],t,n);return a(),o}(e,n,r),e.align)},tableCell:a,tableRow:function(e,t,n,r){const i=l(e,n,r),o=s([i]);return o.slice(0,o.indexOf("\n"))}}};function a(e,t,n,r){const i=n.enter("tableCell"),a=n.enter("phrasing"),s=n.containerPhrasing(e,{...r,before:o,after:o});return a(),i(),s}function s(e,t){return function(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||iW,o=[],a=[],s=[],l=[];let c=0,u=-1;for(;++u<e.length;){const t=[],r=[];let o=-1;for(e[u].length>c&&(c=e[u].length);++o<e[u].length;){const a=oW(e[u][o]);if(!1!==n.alignDelimiters){const e=i(a);r[o]=e,(void 0===l[o]||e>l[o])&&(l[o]=e)}t.push(a)}a[u]=t,s[u]=r}let d=-1;if("object"==typeof r&&"length"in r)for(;++d<c;)o[d]=aW(r[d]);else{const e=aW(r);for(;++d<c;)o[d]=e}d=-1;const p=[],h=[];for(;++d<c;){const e=o[d];let t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let i=!1===n.alignDelimiters?1:Math.max(1,l[d]-t.length-r.length);const a=t+"-".repeat(i)+r;!1!==n.alignDelimiters&&(i=t.length+i+r.length,i>l[d]&&(l[d]=i),h[d]=i),p[d]=a}a.splice(1,0,p),s.splice(1,0,h),u=-1;const f=[];for(;++u<a.length;){const e=a[u],t=s[u];d=-1;const r=[];for(;++d<c;){const i=e[d]||"";let a="",s="";if(!1!==n.alignDelimiters){const e=l[d]-(t[d]||0),n=o[d];114===n?a=" ".repeat(e):99===n?e%2?(a=" ".repeat(e/2+.5),s=" ".repeat(e/2-.5)):(a=" ".repeat(e/2),s=a):s=" ".repeat(e)}!1===n.delimiterStart||d||r.push("|"),!1===n.padding||!1===n.alignDelimiters&&""===i||!1===n.delimiterStart&&!d||r.push(" "),!1!==n.alignDelimiters&&r.push(a),r.push(i),!1!==n.alignDelimiters&&r.push(s),!1!==n.padding&&r.push(" "),!1===n.delimiterEnd&&d===c-1||r.push("|")}f.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return f.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function l(e,t,n){const r=e.children;let i=-1;const o=[],s=t.enter("tableRow");for(;++i<r.length;)o[i]=a(r[i],0,t,n);return s(),o}}function BW(e){const t=this.stack[this.stack.length-2];t.type,t.checked="taskListCheckValueChecked"===e.type}function YW(e){const t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){const e=this.stack[this.stack.length-1];e.type;const n=e.children[0];if(n&&"text"===n.type){const r=t.children;let i,o=-1;for(;++o<r.length;){const e=r[o];if("paragraph"===e.type){i=e;break}}i===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function NW(e,t,n,r){const i=e.children[0],o="boolean"==typeof e.checked&&i&&"paragraph"===i.type,a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);o&&s.move(a);let l=TW.listItem(e,t,n,{...r,...s.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+a})),l}const VW={tokenize:function(e,t,n){let r=0;return function t(o){if((87===o||119===o)&&r<3)return r++,e.consume(o),t;if(46===o&&3===r)return e.consume(o),i;return n(o)};function i(e){return null===e?n(e):t(e)}},partial:!0},FW={tokenize:function(e,t,n){let r,i,o;return a;function a(t){return 46===t||95===t?e.check(HW,l,s)(t):null===t||Yq(t)||Fq(t)||45!==t&&Vq(t)?l(t):(o=!0,e.consume(t),a)}function s(t){return 95===t?r=!0:(i=r,r=void 0),e.consume(t),a}function l(e){return i||r||!o?n(e):t(e)}},partial:!0},jW={tokenize:function(e,t){let n=0,r=0;return i;function i(a){return 40===a?(n++,e.consume(a),i):41===a&&r<n?o(a):33===a||34===a||38===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||60===a||63===a||93===a||95===a||126===a?e.check(HW,t,o)(a):null===a||Yq(a)||Fq(a)?t(a):(e.consume(a),i)}function o(t){return 41===t&&r++,e.consume(t),i}},partial:!0},HW={tokenize:function(e,t,n){return r;function r(a){return 33===a||34===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||63===a||95===a||126===a?(e.consume(a),r):38===a?(e.consume(a),o):93===a?(e.consume(a),i):60===a||null===a||Yq(a)||Fq(a)?t(a):n(a)}function i(e){return null===e||40===e||91===e||Yq(e)||Fq(e)?t(e):r(e)}function o(e){return Dq(e)?a(e):n(e)}function a(t){return 59===t?(e.consume(t),r):Dq(t)?(e.consume(t),a):n(t)}},partial:!0},qW={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return xq(e)?n(e):t(e)}},partial:!0},GW={name:"wwwAutolink",tokenize:function(e,t,n){const r=this;return function(t){if(87!==t&&119!==t||!ZW.call(r,r.previous)||$W(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(VW,e.attempt(FW,e.attempt(jW,i),n),n)(t)};function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:ZW},zW={name:"protocolAutolink",tokenize:function(e,t,n){const r=this;let i="",o=!1;return function(t){if((72===t||104===t)&&JW.call(r,r.previous)&&!$W(r.events))return e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(t),e.consume(t),a;return n(t)};function a(t){if(Dq(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),a;if(58===t){const n=i.toLowerCase();if("http"===n||"https"===n)return e.consume(t),s}return n(t)}function s(t){return 47===t?(e.consume(t),o?l:(o=!0,s)):n(t)}function l(t){return null===t||Lq(t)||Yq(t)||Fq(t)||Vq(t)?n(t):e.attempt(FW,e.attempt(jW,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:JW},UW={name:"emailAutolink",tokenize:function(e,t,n){const r=this;let i,o;return function(t){if(!XW(t)||!KW.call(r,r.previous)||$W(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(t)};function a(t){return XW(t)?(e.consume(t),a):64===t?(e.consume(t),s):n(t)}function s(t){return 46===t?e.check(qW,c,l)(t):45===t||95===t||xq(t)?(o=!0,e.consume(t),s):c(t)}function l(t){return e.consume(t),i=!0,s}function c(a){return o&&i&&Dq(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(a)):n(a)}},previous:KW},WW={};let QW=48;for(;QW<123;)WW[QW]=UW,QW++,58===QW?QW=65:91===QW&&(QW=97);function ZW(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||Yq(e)}function JW(e){return!Dq(e)}function KW(e){return!(47===e||XW(e))}function XW(e){return 43===e||45===e||46===e||95===e||xq(e)}function $W(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}WW[43]=UW,WW[45]=UW,WW[46]=UW,WW[95]=UW,WW[72]=[UW,zW],WW[104]=[UW,zW],WW[87]=[UW,GW],WW[119]=[UW,GW];const eQ={tokenize:function(e,t,n){const r=this;return Hq(e,function(e){const i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function tQ(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const e=r.events[i][1];if("labelImage"===e.type){a=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(i){if(!a||!a._balanced)return n(i);const s=dG(r.sliceSerialize({start:a.end,end:r.now()}));if(94!==s.codePointAt(0)||!o.includes(s.slice(1)))return n(i);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(i),e.exit("gfmFootnoteCallLabelMarker"),t(i)}}function nQ(e,t){let n,r=e.length;for(;r--;)if("labelImage"===e[r][1].type&&"enter"===e[r][0]){n=e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[r+1],e[r+2],["enter",i,t],e[r+3],e[r+4],["enter",o,t],["exit",o,t],["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(r,e.length-r+1,...l),e}function rQ(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(s){if(a>999||93===s&&!o||null===s||91===s||Yq(s))return n(s);if(93===s){e.exit("chunkString");const o=e.exit("gfmFootnoteCallString");return i.includes(dG(r.sliceSerialize(o)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return Yq(s)||(o=!0),a++,e.consume(s),92===s?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),a++,l):l(t)}}function iQ(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a,s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(s>999||93===t&&!a||null===t||91===t||Yq(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return o=dG(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return Yq(t)||(a=!0),s++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i.includes(o)||i.push(o),Hq(e,p,"gfmFootnoteDefinitionWhitespace")):n(t)}function p(e){return t(e)}}function oQ(e,t,n){return e.check(Uq,t,e.attempt(eQ,t,n))}function aQ(e){e.exit("gfmFootnoteDefinition")}function sQ(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:function(e,n,r){const i=this.previous,o=this.events;let a=0;return function(t){if(126===i&&"characterEscape"!==o[o.length-1][1].type)return r(t);return e.enter("strikethroughSequenceTemporary"),s(t)};function s(o){const l=BG(i);if(126===o)return a>1?r(o):(e.consume(o),a++,s);if(a<2&&!t)return r(o);const c=e.exit("strikethroughSequenceTemporary"),u=BG(o);return c._open=!u||2===u&&Boolean(l),c._close=!l||2===l&&Boolean(u),n(o)}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";const i={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},o={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},a=[["enter",i,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",o,t]],s=t.parser.constructs.insideSpan.null;s&&vq(a,a.length,0,xG(s,e.slice(r+1,n),t)),vq(a,a.length,0,[["exit",o,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",i,t]]),vq(e,r-1,n-r+3,a),n=r+a.length-2;break}}n=-1;for(;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}};return null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}}class lQ{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let i=0;if(0===n&&0===r.length)return;for(;i<e.map.length;){if(e.map[i][0]===t)return e.map[i][1]+=n,void e.map[i][2].push(...r);i+=1}e.map.push([t,n,r])}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(const t of r)e.push(t);r=n.pop()}this.map.length=0}}function cQ(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if("enter"===i[0])"tableContent"===i[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===i[1].type){if("tableDelimiterMarker"===e[t-1][1].type){const e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===i[1].type)break}else"enter"===i[0]&&"tableDelimiterRow"===i[1].type&&(n=!0);t+=1}return r}function uQ(e,t,n){const r=this;let i,o=0,a=0;return function(e){let t=r.events.length-1;for(;t>-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const i=t>-1?r.events[t][1].type:null,o="tableHead"===i||"tableRow"===i?b:s;if(o===b&&r.parser.lazy[r.now().line])return n(e);return o(e)};function s(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){if(124===e)return l(e);return i=!0,a+=1,l(e)}(t)}function l(t){return null===t?n(t):Bq(t)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):Nq(t)?Hq(e,l,"whitespace")(t):(a+=1,i&&(i=!1,o+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),i=!0,l):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||Yq(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function d(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),i=!1,Nq(t)?Hq(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):p(t))}function p(t){return 45===t||58===t?f(t):124===t?(i=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),h):v(t)}function h(t){return Nq(t)?Hq(e,f,"whitespace")(t):f(t)}function f(t){return 58===t?(a+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):45===t?(a+=1,m(t)):null===t||Bq(t)?A(t):v(t)}function m(t){return 45===t?(e.enter("tableDelimiterFiller"),g(t)):v(t)}function g(t){return 45===t?(e.consume(t),g):58===t?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(t))}function y(t){return Nq(t)?Hq(e,A,"whitespace")(t):A(t)}function A(n){return 124===n?p(n):(null===n||Bq(n))&&i&&o===a?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):v(n)}function v(e){return n(e)}function b(t){return e.enter("tableRow"),w(t)}function w(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),w):null===n||Bq(n)?(e.exit("tableRow"),t(n)):Nq(n)?Hq(e,w,"whitespace")(n):(e.enter("data"),E(n))}function E(t){return null===t||124===t||Yq(t)?(e.exit("data"),w(t)):(e.consume(t),92===t?k:E)}function k(t){return 92===t||124===t?(e.consume(t),E):E(t)}}function dQ(e,t){let n,r,i,o=-1,a=!0,s=0,l=[0,0,0,0],c=[0,0,0,0],u=!1,d=0;const p=new lQ;for(;++o<e.length;){const h=e[o],f=h[1];"enter"===h[0]?"tableHead"===f.type?(u=!1,0!==d&&(hQ(p,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(o,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(a=!0,i=void 0,l=[0,0,0,0],c=[0,o+1,0,0],u&&(u=!1,r={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(o,0,[["enter",r,t]])),s="tableDelimiterRow"===f.type?2:r?3:1):!s||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type?"tableCellDivider"===f.type&&(a?a=!1:(0!==l[1]&&(c[0]=c[1],i=pQ(p,t,l,s,void 0,i)),l=c,c=[l[1],o,0,0])):(a=!1,0===c[2]&&(0!==l[1]&&(c[0]=c[1],i=pQ(p,t,l,s,void 0,i),l=[0,0,0,0]),c[2]=o)):"tableHead"===f.type?(u=!0,d=o):"tableRow"===f.type||"tableDelimiterRow"===f.type?(d=o,0!==l[1]?(c[0]=c[1],i=pQ(p,t,l,s,o,i)):0!==c[1]&&(i=pQ(p,t,c,s,o,i)),s=0):!s||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type||(c[3]=o)}for(0!==d&&hQ(p,t,d,n,r),p.consume(t.events),o=-1;++o<t.events.length;){const e=t.events[o];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=cQ(t.events,o))}return e}function pQ(e,t,n,r,i,o){const a=1===r?"tableHeader":2===r?"tableDelimiter":"tableData";0!==n[0]&&(o.end=Object.assign({},fQ(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const s=fQ(t.events,n[1]);if(o={type:a,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[["enter",o,t]]),0!==n[2]){const i=fQ(t.events,n[2]),o=fQ(t.events,n[3]),a={type:"tableContent",start:Object.assign({},i),end:Object.assign({},o)};if(e.add(n[2],0,[["enter",a,t]]),2!==r){const r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",a,t]])}return void 0!==i&&(o.end=Object.assign({},fQ(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function hQ(e,t,n,r,i){const o=[],a=fQ(t.events,n);i&&(i.end=Object.assign({},a),o.push(["exit",i,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function fQ(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const mQ={name:"tasklistCheck",tokenize:function(e,t,n){const r=this;return function(t){if(null!==r.previous||!r._gfmTasklistFirstContentOfListItem)return n(t);return e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i};function i(t){return Yq(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),o):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),o):n(t)}function o(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(t)}function a(r){return Bq(r)?t(r):Nq(r)?e.check({tokenize:gQ},t,n)(r):n(r)}}};function gQ(e,t,n){return Hq(e,function(e){return null===e?n(e):t(e)},"whitespace")}const yQ={};function AQ(e){const t=e||yQ,n=this.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),i=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),o=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(function(e){return Mq([{text:WW},{document:{91:{name:"gfmFootnoteDefinition",tokenize:iQ,continuation:{tokenize:oQ},exit:aQ}},text:{91:{name:"gfmFootnoteCall",tokenize:rQ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:tQ,resolveTo:nQ}}},sQ(e),{flow:{null:{name:"table",tokenize:uQ,resolveAll:dQ}}},{text:{91:mQ}}])}(t)),i.push([{transforms:[NU],enter:{literalAutolink:LU,literalAutolinkEmail:PU,literalAutolinkHttp:PU,literalAutolinkWww:PU},exit:{literalAutolink:YU,literalAutolinkEmail:BU,literalAutolinkHttp:OU,literalAutolinkWww:RU}},{enter:{gfmFootnoteCallString:HU,gfmFootnoteCall:qU,gfmFootnoteDefinitionLabelString:GU,gfmFootnoteDefinition:zU},exit:{gfmFootnoteCallString:UU,gfmFootnoteCall:WU,gfmFootnoteDefinitionLabelString:QU,gfmFootnoteDefinition:ZU}},{canContainEols:["delete"],enter:{strikethrough:tW},exit:{strikethrough:nW}},{enter:{table:SW,tableData:LW,tableHeader:LW,tableRow:xW},exit:{codeText:PW,table:DW,tableData:IW,tableHeader:IW,tableRow:IW}},{exit:{taskListCheckValueChecked:BW,taskListCheckValueUnchecked:BW,paragraph:YW}}]),o.push(function(e){return{extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:xU,notInConstruct:IU},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:xU,notInConstruct:IU},{character:":",before:"[ps]",after:"\\/",inConstruct:xU,notInConstruct:IU}]},KU(e),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:eW}],handlers:{delete:rW}},RW(e),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:NW}}]}}(t))}function vQ(){return vQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vQ.apply(null,arguments)}const bQ=Ye.div(({theme:e})=>({height:"100%",width:"100%",backgroundColor:e.white,display:"flex",flex:"1 0 0",flexDirection:"column",justifyContent:"space-between",alignItems:"center",padding:20,overflowY:"auto",overscrollBehavior:"contain"})),wQ=Ye.div(({theme:e})=>({":focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:8},".webchat-privacy-notice-markdown-container > p":{margin:0,whiteSpace:"pre-wrap"}})),EQ=Ye.div({display:"flex",alignItems:"center",flexDirection:"column",gap:16}),kQ=Ye(dj)(()=>({width:303})),CQ=e=>{const{privacyNotice:t,onAcceptTerms:n,isHomeScreenEnabled:i}=e,{text:o,submitButtonText:a,urlText:s,url:l}=t,c=(0,r.useMemo)(()=>Ex(o),[o]);return r.createElement(bQ,{className:"webchat-privacy-notice-root"},r.createElement(wQ,{className:"webchat-privacy-notice-message"},r.createElement(mm,{variant:"body-regular",style:{whiteSpace:"pre-wrap"}},r.createElement(wU,{components:{a:({node:e,...t})=>r.createElement("a",vQ({},t,{target:"_blank",rel:"noreferrer"}))},remarkPlugins:[AQ],className:"webchat-privacy-notice-markdown-container"},c))),r.createElement(EQ,{className:"webchat-privacy-notice-actions"},r.createElement(kQ,{className:"webchat-privacy-notice-accept-button",onClick:n},a),r.createElement(tH,{url:l||"https://www.cognigy.com/",target:"_blank",className:"webchat-privacy-policy-link",text:s||"Privacy policy"})))};var _Q,MQ=["title","titleId"];function TQ(){return TQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TQ.apply(null,arguments)}const SQ=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,MQ);return r.createElement("svg",TQ({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none","aria-hidden":"true",viewBox:"0 0 16 16","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,_Q||(_Q=r.createElement("path",{fill:"#1A1A1A",d:"M3.77 1v9.263l4.653 4.452a.981.981 0 0 0 1.154.17.93.93 0 0 0 .421-.42.8.8 0 0 0 .057-.566l-.861-3.636h5.36q.57 0 1.008-.422.438-.423.438-.973V7.62q0-.122-.032-.26a3 3 0 0 0-.073-.26l-2.292-5.22a1.5 1.5 0 0 0-.577-.626A1.56 1.56 0 0 0 12.182 1zm1.2 8.77V2.158h7.215q.084 0 .173.044a.3.3 0 0 1 .134.149L14.8 7.56v1.307q0 .104-.07.17a.25.25 0 0 1-.176.067H7.677l1.003 4.231zM1.445 1Q.85 1 .425 1.41A1.32 1.32 0 0 0 0 2.395v6.473q0 .575.425.985.424.41 1.021.41H3.77V9.105H1.446a.24.24 0 0 1-.177-.067.23.23 0 0 1-.069-.17V2.395q0-.104.07-.17a.24.24 0 0 1 .176-.067H3.77V1z"})))};var DQ,xQ=["title","titleId"];function IQ(){return IQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},IQ.apply(null,arguments)}const LQ=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,xQ);return r.createElement("svg",IQ({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none","aria-hidden":"true",viewBox:"0 0 16 16","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,DQ||(DQ=r.createElement("path",{fill:"#1A1A1A",d:"M3.77 15V5.737l4.653-4.452a.982.982 0 0 1 1.154-.17q.288.148.421.42a.8.8 0 0 1 .057.566l-.861 3.636h5.36q.57 0 1.008.422.438.423.438.973V8.38q0 .122-.032.26a3 3 0 0 1-.073.26l-2.292 5.22a1.5 1.5 0 0 1-.577.626 1.56 1.56 0 0 1-.844.255zm1.2-8.77v7.612h7.215a.4.4 0 0 0 .173-.044.3.3 0 0 0 .134-.149L14.8 8.44V7.132a.23.23 0 0 0-.07-.17.25.25 0 0 0-.176-.067H7.677L8.68 2.664zM1.445 15q-.597 0-1.021-.41A1.32 1.32 0 0 1 0 13.605V7.132q0-.575.425-.985.424-.41 1.021-.41H3.77v1.158H1.446a.24.24 0 0 0-.177.067.23.23 0 0 0-.069.17v6.473q0 .104.07.17a.24.24 0 0 0 .176.067H3.77V15z"})))};function PQ(){return PQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PQ.apply(null,arguments)}const OQ=Ye.div(({theme:e,disabled:t})=>({borderRadius:10,border:`1px solid var(--basics-black-60, ${e.black60})`,background:`var(--Basics-white, ${e.white})`,width:"100%",padding:12,"&:focus-within":{borderColor:"transparent",outline:`2px solid ${e.primaryColorFocus}`},borderColor:t?e.black80:e.black60})),RQ=Ye.textarea(({theme:e})=>({padding:"0 12px 0 0",width:"100%",height:"100%",border:"none",resize:"none",color:e.black10,fontFamily:"Figtree",fontSize:"0.875rem",fontWeight:400,lineHeight:"140%","&:focus":{outline:"none"},"&:disabled":{color:e.black60},"::-webkit-scrollbar":{width:2,height:2},"::-webkit-scrollbar-track":{backgroundColor:e.black95},"::-webkit-scrollbar-thumb":{backgroundColor:e.black60}})),BQ=Ye.div({position:"relative",display:"flex",flexDirection:"column",flexGrow:1}),YQ=(0,r.forwardRef)((e,t)=>{const{className:n,dataTest:i,label:o,isVisible:a,inputId:s,...l}=e,{disabled:c}=e;return r.createElement(OQ,{disabled:c},r.createElement(ON(),{maxWidth:575},e=>r.createElement(BQ,{className:`${n}-container`},r.createElement(VN,{inputId:s,isVisible:a,label:o,className:`${n}-label`,disabled:c}),r.createElement(RQ,PQ({},l,{id:s,"data-test":i,ref:t,className:`${n} ${c?"disabled":""}`.trim(),style:e?{fontSize:"1rem"}:void 0})))))});YQ.displayName="MultilineInput";const NQ=YQ,VQ=Ye.div({width:"100%",display:"flex",flexDirection:"column",padding:"20px 0",gap:24}),FQ=Ye.div({width:"100%",display:"flex",alignItems:"flex-start",gap:8}),jQ=Ye(LO)(({theme:e,selected:t})=>({background:t?e.primaryColor:e.black95,display:"flex",padding:"12px 16px",justifyContent:"center",alignItems:"center",gap:16,borderRadius:15,svg:{width:16,height:16},"&: focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2}})),HQ=Ye(LQ)(({theme:e,selected:t})=>({path:{fill:t?e.primaryContrastColor:e.black10}})),qQ=Ye(SQ)(({theme:e,selected:t})=>({path:{fill:t?e.primaryContrastColor:e.black10}})),GQ=Ye.div({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:16,alignSelf:"stretch"}),zQ=Ye(dj)(({theme:e})=>({width:"100%","&:disabled":{opacity:1},"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2}})),UQ=e=>{const{ratingTitleText:t,ratingCommentText:n,showRatingStatus:i,buttonText:o,ratingEventBannerText:a,onSendRating:s}=e,[l,c]=(0,r.useState)(null),[u,d]=(0,r.useState)(""),p=(0,r.useRef)(null),h=-1!==l&&1!==l,f=XB(e=>e.config.settings.customTranslations?.ariaLabels);return r.createElement(VQ,{className:"webchat-rating-widget-root"},r.createElement(mm,{variant:"title1-semibold",className:"webchat-rating-widget-title",margin:0},t),r.createElement(FQ,{className:"webchat-rating-widget-content-container"},r.createElement(jQ,{onClick:()=>c(1===l?null:1),className:"webchat-rating-widget-thumbs-up-button","aria-pressed":1===l,"aria-label":f?.thumbsUp??"Like",selected:1===l},r.createElement(HQ,{selected:1===l})),r.createElement(jQ,{onClick:()=>c(-1===l?null:-1),className:"webchat-rating-widget-thumbs-down-button","aria-pressed":-1===l,"aria-label":f?.thumbsDown??"Dislike",selected:-1===l},r.createElement(qQ,{selected:-1===l}))),r.createElement(GQ,null,r.createElement(NQ,{dataTest:"rating-input",value:u,disabled:null===l,onChange:e=>d(e.target.value),className:"webchat-rating-widget-comment-input-field",rows:4,ref:p,inputId:"webchatRatingInput",isVisible:!u,label:n}),r.createElement(zQ,{className:"webchat-rating-widget-send-button "+(h?"disabled":"active"),disabled:h,onClick:()=>{s({rating:l,comment:u,showRatingStatus:i}),setTimeout(()=>QR(a||"Your feedback was submitted"),500),c(null),d("")}},o||"Send feedback")))},WQ=Ye.div({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:24,alignSelf:"stretch",padding:"20px 0"}),QQ=Ye.div({display:"flex",width:"295px",flexDirection:"row",flexWrap:"wrap",alignItems:"flex-end",alignContent:"flex-end",gap:8}),ZQ=e=>{const{config:t,onSendActionButtonMessage:n,onEmitAnalytics:i}=e,{settings:o}=t,{chatOptions:a}=o,s=a?.quickReplyOptions.quickReplies;return r.createElement(WQ,{className:"webchat-chat-options-action-btns-root"},r.createElement(mm,{variant:"title1-semibold",margin:0,className:"webchat-chat-options-action-btns-title"},a?.quickReplyOptions?.sectionTitle||"People are also interested in"),r.createElement(QQ,{className:"webchat-chat-options-action-btns-wrapper"},r.createElement(xm,{showUrlIcon:!0,buttonClassName:"webchat-chat-options-action-button",containerClassName:"webchat-chat-options-action-button-container",payload:s,config:t,action:n,onEmitAnalytics:i})))},JQ=Ye.div(({theme:e})=>({alignItems:" center",justifyContent:"center",padding:"12px 0px",gap:24,width:"100%",display:"flex",backgroundColor:e.white,borderTop:`1px solid var(--basics-black-80, ${e.black80})`})),KQ=Ye.a(({theme:e})=>({textDecoration:"none",color:e.black10,"&:focus, &:hover":{outline:"none",color:e.primaryColor},"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2}})),XQ=Ye(mm)({lineHeight:"19.6px",wordWrap:"break-word",margin:0}),$Q=e=>{const{settings:t}=e,{chatOptions:n,customTranslations:i}=t,o=n?.footer?.items?.[0]?.title||"Imprint",a=n?.footer?.items?.[1]?.title||"Data Privacy",s=n?.footer?.items?.[0]?.url||"https://www.cognigy.com/legal-notice",l=n?.footer?.items?.[1]?.url||"https://www.cognigy.com/privacy-policy",c=i?.ariaLabels?.opensInNewTab||"Opens in new tab";return r.createElement(JQ,{className:"webchat-chat-options-footer"},r.createElement(KQ,{href:s,target:"_blank",id:"footer-text-1","aria-label":`${o}. ${c}`,className:"webchat-chat-options-footer-link"},r.createElement(XQ,{variant:"body-semibold",className:"webchat-chat-options-footer-link-text"},o)),n?.footer?.items?.[1]&&r.createElement(KQ,{href:l,target:"_blank",id:"footer-text-2","aria-label":`${a}. ${c}`},r.createElement(XQ,{variant:"body-semibold"},a)))},eZ=Ye.button(({theme:e,isActive:t,disabled:n})=>({display:"flex",alignItems:"center",padding:1,width:30,height:16,borderRadius:15,border:`1px solid ${e.black80}`,backgroundColor:e.white,cursor:n?"default":"pointer",transition:"background-color 0.2s ease-in-out","&.active":{backgroundColor:n?e.secondaryColorDisabled:e.secondaryColor,"&:hover":{backgroundColor:n?e.secondaryColorDisabled:e.secondaryColorHover}}})),tZ=Ye.div(({theme:e,isActive:t,disabled:n})=>({width:12,height:12,borderRadius:12,backgroundColor:n?e.secondaryColorDisabled:e.secondaryColor,cursor:n?"default":"pointer",transform:t?"translateX(14px)":"translateX(0px)",transition:"transform 0.2s ease-in-out, background-color 0.2s ease-in-out","&:hover":{backgroundColor:n?e.secondaryColorDisabled:e.secondaryColorHover},"&.hovered":{backgroundColor:n?e.secondaryColorDisabled:e.secondaryColorHover},"&.active":{backgroundColor:e.white}})),nZ=e=>{const{onClick:t,isActive:n,className:i,disabled:o}=e,[a,s]=r.useState(!1);return r.createElement(eZ,{className:$R()(i,"webchat-toggle-button-root",n&&"active"),onClick:t,isActive:n,disabled:o,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1)},r.createElement(tZ,{className:$R()("webchat-toggle-button-inner-circle",n&&"active",a&&"hovered"),onClick:t,isActive:n,disabled:o}))},rZ=Ye.div(()=>({alignSelf:"stretch",display:"flex",justifyContent:"space-between",alignItems:"center",height:50})),iZ=e=>{const{config:t,onToggle:n}=e,i=XB(e=>e.ui.ttsActive);return r.createElement(rZ,{className:"webchat-tts-option-root"},r.createElement(mm,{variant:"title1-semibold",margin:0,className:"webchat-chat-options-tts-option-label"},t.settings.chatOptions.labelTTSToggle||"Enable Text-to-Speech"),r.createElement(nZ,{onClick:n,className:"webchat-chat-options-tts-option-toggle",isActive:i}))};function oZ(e,t){return oZ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},oZ(e,t)}function aZ(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,oZ(e,t)}function sZ(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const lZ=!1,cZ=r.createContext(null);var uZ=function(e){return e.scrollTop},dZ="unmounted",pZ="exited",hZ="entering",fZ="entered",mZ="exiting",gZ=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var i,o=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?o?(i=pZ,r.appearStatus=hZ):i=fZ:i=t.unmountOnExit||t.mountOnEnter?dZ:pZ,r.state={status:i},r.nextCallback=null,r}aZ(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===dZ?{status:pZ}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==hZ&&n!==fZ&&(t=hZ):n!==hZ&&n!==fZ||(t=mZ)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===hZ){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:At.findDOMNode(this);n&&uZ(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===pZ&&this.setState({status:dZ})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[At.findDOMNode(this),r],o=i[0],a=i[1],s=this.getTimeouts(),l=r?s.appear:s.enter;!e&&!n||lZ?this.safeSetState({status:fZ},function(){t.props.onEntered(o)}):(this.props.onEnter(o,a),this.safeSetState({status:hZ},function(){t.props.onEntering(o,a),t.onTransitionEnd(l,function(){t.safeSetState({status:fZ},function(){t.props.onEntered(o,a)})})}))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:At.findDOMNode(this);t&&!lZ?(this.props.onExit(r),this.safeSetState({status:mZ},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:pZ},function(){e.props.onExited(r)})})})):this.safeSetState({status:pZ},function(){e.props.onExited(r)})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:At.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],o=i[0],a=i[1];this.props.addEndListener(o,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===dZ)return null;var t=this.props,n=t.children,i=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,j_(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return r.createElement(cZ.Provider,{value:null},"function"==typeof n?n(e,i):r.cloneElement(r.Children.only(n),i))},t}(r.Component);function yZ(){}gZ.contextType=cZ,gZ.propTypes={},gZ.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:yZ,onEntering:yZ,onEntered:yZ,onExit:yZ,onExiting:yZ,onExited:yZ},gZ.UNMOUNTED=dZ,gZ.EXITED=pZ,gZ.ENTERING=hZ,gZ.ENTERED=fZ,gZ.EXITING=mZ;const AZ=gZ;var vZ=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=sZ(n.className,r):n.setAttribute("class",sZ(n.className&&n.className.baseVal||"",r)));var n,r})},bZ=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1];t.removeClasses(i,"exit"),t.addClass(i,o?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1]?"appear":"enter";t.addClass(i,o,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1]?"appear":"enter";t.removeClasses(i,o),t.addClass(i,o,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,r="string"==typeof n,i=r?""+(r&&n?n+"-":"")+e:n[e];return{baseClassName:i,activeClassName:r?i+"-active":n[e+"Active"],doneClassName:r?i+"-done":n[e+"Done"]}},t}aZ(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var r=this.getClassNames(t)[n+"ClassName"],i=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&i&&(r+=" "+i),"active"===n&&e&&uZ(e),r&&(this.appliedClasses[t][n]=r,function(e,t){e&&t&&t.split(" ").forEach(function(t){return r=t,void((n=e).classList?n.classList.add(r):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)));var n,r})}(e,r))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],r=n.base,i=n.active,o=n.done;this.appliedClasses[t]={},r&&vZ(e,r),i&&vZ(e,i),o&&vZ(e,o)},n.render=function(){var e=this.props,t=(e.classNames,j_(e,["classNames"]));return r.createElement(AZ,s({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(r.Component);bZ.defaultProps={classNames:""},bZ.propTypes={};const wZ=bZ,EZ=Ye.div({position:"absolute",top:0,left:0,bottom:0,right:0,background:"rgba(0, 0, 0, 0.5)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:9999}),kZ=Ye.dialog(({theme:e})=>({padding:20,border:"none",borderRadius:16,width:"90%",backgroundColor:e.white,margin:"20px auto",zIndex:99999,"&.fade-enter":{opacity:0},"&.fade-enter-active":{opacity:1,transition:"opacity 150ms"}})),CZ=Ye.div({display:"flex",alignItems:"center",position:"relative","> h3":{margin:"auto",textAlign:"center"}}),_Z=Ye(LO)(({theme:e})=>({color:e.black10,borderRadius:4,position:"absolute",right:-4,"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2},"& svg":{fill:e.black10,width:14,height:14},padding:0})),MZ=Ye.div({marginBottom:20}),TZ=Ye.div({display:"flex",justifyContent:"space-between",gap:12,"> button":{width:"auto",padding:"0 16px"},"@media screen and (max-width: 576px)":{flexDirection:"column",gap:12,"> button":{width:"100%"}}}),SZ=Ye.div(()=>({padding:"12px 0px",margin:"0px -20px"})),DZ=Ye.div(({theme:e})=>({height:1,width:"100%",backgroundColor:e.black80})),xZ=({isOpen:e,onClose:t,title:n,footer:i,children:o})=>{const a=(0,r.useRef)(null),s=XB(e=>e.config.settings.customTranslations?.ariaLabels?.closeDialog)??"Close dialog",l=()=>{t(!1)};return(0,r.useEffect)(()=>{const t=e=>{"Escape"===e.key&&l();const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(n&&t){const{firstFocusable:t,lastFocusable:r}=HF(a.current),i=r===n;t===n&&e.shiftKey&&(e.preventDefault(),r.focus()),i&&!e.shiftKey&&(e.preventDefault(),t.focus())}};return e?document.addEventListener("keydown",t):document.removeEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}},[e,t]),r.createElement(r.Fragment,null,e&&r.createElement(EZ,{onClick:l}),r.createElement(wZ,{in:e,timeout:150,mountOnEnter:!0,unmountOnExit:!0,classNames:"fade"},r.createElement(kZ,{className:"webchat-modal-root",open:e,"aria-labelledby":"modal-title","aria-describedby":"modal-body",ref:a},r.createElement(CZ,{className:"webchat-modal-header"},r.createElement(mm,{id:"modal-title",variant:"title1-semibold",className:"webchat-modal-title"},n),r.createElement(_Z,{"aria-label":s,onClick:l,className:"webchat-modal-close-button"},r.createElement(BO,{"aria-hidden":!0,className:"webchat-modal-close-icon"}))),r.createElement(SZ,{className:"webchat-modal-divider-wrapper"},r.createElement(DZ,{className:"webchat-modal-divider"})),r.createElement(MZ,{id:"modal-body",className:"webchat-modal-body"},o),i?r.createElement(TZ,{className:"webchat-modal-footer"},i):null)))},IZ=Ye(ct)(({theme:e,background:t})=>({background:t||e.red30,color:zB(t||e.red30,e),"&:hover:not(:disabled)":{background:qB(t||e.red30)}})),LZ=Ye(pj)(({theme:e,background:t})=>({background:t||e.white,color:zB(t||e.white,e),marginRight:"auto"})),PZ=Ye(IZ)(()=>({marginLeft:"auto"})),OZ=e=>{const{isOpen:t,onClose:n,onConfirmDelete:i,title:o,children:a,cancelText:s,confirmText:l,cancelButtonBackground:c,confirmButtonBackground:u}=e;return r.createElement(xZ,{footer:r.createElement(r.Fragment,null,r.createElement(LZ,{className:"webchat-delete-confirmation-cancel-button",onClick:()=>n(!1),background:c,autoFocus:!0},s),r.createElement(PZ,{className:"webchat-delete-confirmation-confirm-button",onClick:i,background:u},l)),isOpen:t,onClose:n,title:o},a)},RZ=Ye.div({display:"flex",flexDirection:"column",alignItems:"flex-start","& > button":{width:"auto",padding:"0 16px"}}),BZ=Ye(IZ)``,YZ=e=>{const{config:t,onDeleteModalStateChange:n}=e,{userId:i,sessionId:o,channel:a}=TM(e=>e.options),s=kM(),[l,c]=r.useState(!1),u=r.useRef(null);return r.createElement(r.Fragment,null,r.createElement(RZ,{className:"webchat-delete-conversation-container"},r.createElement(mm,{variant:"title1-semibold",className:"webchat-delete-conversation-title"},t.settings.customTranslations?.delete_conversation??"Delete conversation"),r.createElement(BZ,{ref:u,className:"webchat-delete-conversation-button",background:t.settings.customColors?.deleteButtonColor,onClick:()=>{c(!0),n(!0)}},t.settings.customTranslations?.delete??"Delete")),r.createElement(OZ,{isOpen:l,onClose:()=>{c(!1),u.current?.focus()},onConfirmDelete:()=>{s((e=>({type:aI,sessionId:e}))(o)),s(WM()),s(_O());const t=bI({disableLocalStorage:e.config.settings.embeddingConfiguration?.disableLocalStorage??!1,useSessionStorage:e.config.settings.embeddingConfiguration?.useSessionStorage??!1});t&&Object.keys(t).forEach(n=>{const r=Lx({channel:a,userId:i,sessionId:o},{URLToken:e.config.URLToken});t.removeItem(r)}),c(!1),n(!1),u.current?.focus(),s(lT(!1))},title:t.settings.customTranslations?.delete_conversation??"Delete conversation",cancelText:t.settings.customTranslations?.cancel??"Cancel",confirmText:t.settings.customTranslations?.delete_anyway??"Delete anyway",cancelButtonBackground:t.settings.customColors?.cancelButtonColor,confirmButtonBackground:t.settings.customColors?.deleteButtonColor},r.createElement(mm,{variant:"body-regular",className:"webchat-delete-conversation-text"},t.settings.customTranslations?.delete_conversation_confirmation??"Are you sure you want to delete this conversation? This action cannot be undone.")))},NZ=Ye.div({width:"100%",height:"100%",display:"flex",flexDirection:"column"}),VZ=Ye.div({width:"100%",height:"100%",display:"flex",padding:"0 20px",flexDirection:"column",overflowY:"auto",overscrollBehavior:"contain"}),FZ=Ye.div({padding:"12px 0px"}),jZ=Ye.div(({theme:e})=>({height:1,width:"100%",backgroundColor:e.black80})),HZ=e=>{const{config:t,showOnlyRating:n,ratingTitleText:i,ratingCommentText:o,ratingSubmitButtonText:a,ratingEventBannerText:s,hasGivenRating:l,onSendRating:c,onEmitAnalytics:u,onSendActionButtonMessage:d,onDeleteModalStateChange:p}=e,{settings:h}=t,{chatOptions:f}=h,m=f.rating.enabled,g="always"===m||"once"===m&&!l||n,y=TM(e=>e.ui.ttsActive),A=kM(),v=!!f.enableDeleteConversation;return r.createElement(NZ,{className:"webchat-chat-options-root"},r.createElement(VZ,{className:"webchat-chat-options-container"},n?r.createElement(UQ,{ratingTitleText:i,ratingCommentText:o,onSendRating:c,showRatingStatus:n,ratingEventBannerText:s,buttonText:a}):r.createElement(r.Fragment,null,t.settings.chatOptions.quickReplyOptions.enabled&&r.createElement(r.Fragment,null,r.createElement(ZQ,{config:t,onSendActionButtonMessage:d,onEmitAnalytics:u}),r.createElement(FZ,null,r.createElement(jZ,null))),t.settings.chatOptions.showTTSToggle&&r.createElement(r.Fragment,null,r.createElement(iZ,{onToggle:()=>{A(ET(!y))},config:t}),r.createElement(FZ,null,r.createElement(jZ,null))),g&&r.createElement(r.Fragment,null,r.createElement(UQ,{ratingTitleText:i,ratingCommentText:o,onSendRating:c,showRatingStatus:n,ratingEventBannerText:s,buttonText:a}),r.createElement(FZ,null,r.createElement(jZ,null))),v&&r.createElement(YZ,{onDeleteModalStateChange:p,config:t}))),f.footer.enabled&&f.footer.items[0]&&r.createElement($Q,{settings:t.settings}))},qZ=Ye(mm)(({theme:e})=>({marginBottom:"var(--webchat-message-margin-block, 24px)",marginInline:"var(--webchat-message-margin-inline, 20px)",padding:"12px",textAlign:"center",color:e.black40,"& span":{display:"block"}})),GZ=e=>{const t=XB(e=>e.queueUpdates??{}),{handleScroll:n}=e;return(0,r.useEffect)(()=>{t?.isQueueActive&&n?.(void 0,!0)},[t?.isQueueActive]),t?.isQueueActive?r.createElement(qZ,{variant:"body-regular",id:"webchatQueueUpdates",className:"webchat-queue-updates",component:"div"},t?.alternativeText?r.createElement("span",null,t.alternativeText):r.createElement(r.Fragment,null,r.createElement("span",null,"Current queue position: ",r.createElement("strong",null,t?.position||"")),r.createElement("span",null,"Estimated waiting time:"," ",r.createElement("strong",null,(e=>{if(!e)return"";const t=e/1e3,n=e=>`${e} ${e>1?"minutes":"minute"}`;if(t<60)return`${t} seconds`;const r=Math.floor(t/60);if(r<60)return n(r);const i=Math.floor(t/3600),o=r-60*i;return`${i} ${i>1?"hours":"hour"}${o>0?` and ${n(o)}`:""}`})(t?.estimatedWaitTime))))):null};var zZ,UZ=["title","titleId"];function WZ(){return WZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},WZ.apply(null,arguments)}const QZ=function(e){var t=e.title,n=e.titleId,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,UZ);return r.createElement("svg",WZ({xmlns:"http://www.w3.org/2000/svg",width:17,height:16,fill:"none","aria-hidden":"true",viewBox:"0 0 17 16","aria-labelledby":n},i),t?r.createElement("title",{id:n},t):null,zZ||(zZ=r.createElement("path",{fill:"#1A1A1A",fillRule:"evenodd",d:"M4.596 2.322C4.932 1.548 5.732.25 7.333.25c1.744 0 2.536 1.53 2.828 2.292.222.58.256 1.174.256 1.678v6.613a1.917 1.917 0 1 1-3.834 0V4a.75.75 0 0 1 1.5 0v6.833a.417.417 0 1 0 .834 0V4.22c0-.454-.035-.825-.156-1.14-.276-.718-.728-1.33-1.428-1.33-.64 0-1.072.504-1.362 1.17-.18.414-.221.904-.221 1.505V11.5a2.75 2.75 0 1 0 5.5 0V4a.75.75 0 0 1 1.5 0v7.5a4.25 4.25 0 0 1-8.5 0V4.425c0-.63.034-1.387.346-2.103",clipRule:"evenodd"})))},ZZ=()=>({width:"100%",height:"100%",bottom:0}),JZ=Ye.div(ZZ,{display:"flex",flexDirection:"column",flexGrow:1,minHeight:0,padding:12}),KZ=Ye.div(()=>({height:"100%",alignItems:"center",justifyContent:"center",display:"flex",gap:8})),XZ=Ye.div(ZZ,{position:"absolute"}),$Z=Ye(mm)(({theme:e})=>({color:e.black10})),eJ=e=>{const t=(0,r.useRef)(null),n=kM(),{disableBranding:i,dropzoneText:o,layoutSettings:a}=e;return r.createElement(r.Fragment,null,r.createElement(JZ,null,r.createElement(KZ,{id:"dropzoneContent"},r.createElement(QZ,null),r.createElement($Z,{variant:"title1-regular",component:"span",className:"webchat-input-drag-and-drop-file-text"},o||"Drop to attach")),r.createElement(xY,{id:"cognigyDropZoneLogo",watermark:a?.watermark,watermarkText:a?.watermarkText,watermarkUrl:a?.watermarkUrl})),r.createElement(XZ,{ref:t,onDragOver:e=>{e.preventDefault()},onDragLeave:e=>{e.preventDefault(),n(Jx(!1))},onDropCapture:async e=>{if(e.preventDefault(),e.stopPropagation(),n(Jx(!1)),e.dataTransfer?.files){const t=Array.prototype.slice.call(e.dataTransfer?.files);n(TO(t))}}}))},tJ=Ye.div(({theme:e})=>({width:"335px",backgroundColor:e.backgroundEngagementMessage,padding:"16px",borderRadius:"15px",boxShadow:"0px 4px 6px 0px rgba(28, 28, 28, 0.20)",border:"1px solid rgba(26, 26, 26, 0.10)",cursor:"pointer",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"16px"})),nJ=Ye.div({position:"fixed",right:"20px",bottom:"84px",display:"flex",flexDirection:"column",alignItems:"flex-end",gap:"16px"}),rJ=Ye.div(()=>({display:"flex",alignSelf:"stretch",alignItems:"center",gap:"12px"})),iJ=Ye.div(()=>({display:"flex",justifyContent:"space-between",alignItems:"center",flex:"1 0 0"})),oJ=Ye(LO)(({theme:e})=>({padding:0,marginRight:-4,borderRadius:4,"&:focus-visible":{outline:`2px solid ${e.primaryColorFocus}`,outlineOffset:2},svg:{fill:e.textDark,width:16,height:16}})),aJ=Ye.div({".webchat-teaser-message-button-container":{display:"flex",width:315,justifyContent:"flex-end",alignItems:"center",alignContent:"center",gap:"8px",flexWrap:"wrap"}}),sJ=Ye(iY)(()=>({marginInline:0})),lJ=e=>{const{onClick:t,messageText:n,config:i,onEmitAnalytics:o,onSendActionButtonMessage:a,onHideTeaserMessage:s,wasOpen:l}=e,{teaserMessage:c}=i.settings,u=c.conversationStarters.starters,d=(0,PN.useMediaQuery)({query:"(min-width: 576px)"});return r.createElement(nJ,{className:"webchat-teaser-message-root"},r.createElement(tJ,{className:"webchat-teaser-message-bubble",onClick:()=>{t?.()},"aria-live":"polite"},r.createElement(rJ,{className:"webchat-teaser-message-header"},i?.settings?.layout?.logoUrl?r.createElement(sJ,{src:i?.settings?.layout?.logoUrl,className:"webchat-teaser-message-header-logo",alt:""}):r.createElement(nB,{title:"Cognigy.AI Logo",role:"img"}),r.createElement(iJ,null,r.createElement(mm,{variant:"title2-regular",className:"webchat-teaser-message-header-title",margin:0,id:"webchatHeaderTitle"},i.settings.layout.title||"Cognigy"),r.createElement(oJ,{className:"webchat-teaser-message-header-close-button",onClick:e=>{e.stopPropagation(),e.preventDefault(),s()},"aria-label":i.settings.customTranslations?.ariaLabels?.closeTeaserMessage??"Close teaser message"},r.createElement(BO,null)))),r.createElement("span",{className:"sr-only"},i.settings.customTranslations?.ariaLabels?.newMessagePreview??"New message preview"),r.createElement(mm,{variant:"body-regular",className:"webchat-unread-message-preview-text",margin:0},n)),!l&&c?.conversationStarters?.enabled&&r.createElement(aJ,{className:"webchat-teaser-message-action-buttons"},r.createElement(xm,{showUrlIcon:!0,buttonClassName:"webchat-teaser-message-button",containerClassName:"webchat-teaser-message-button-container",payload:u,config:i,action:(e,n,r)=>{a(e,n,r),t?.()},onEmitAnalytics:o,size:d?"large":"small"})))};const cJ=Ye.div(()=>({display:"flex",flexDirection:"column",height:"100%",width:"100%",animation:"fade-in-xapp .25s ease-out","@keyframes fade-in-xapp":{from:{transform:"scale(.875)",opacity:.25},to:{transform:"scale(1)",opacity:1}}})),uJ=Ye.iframe(()=>({appearance:"none",border:"none",height:"100%",width:"100%",animation:"fade-in-xapp-2 .325s ease-in","@keyframes fade-in-xapp-2":{from:{opacity:.87,transform:"scale(.95)",translateY:"-300px"},to:{transform:"scale(1)",translateY:0,opacity:1}}})),dJ=()=>{const e=XB(e=>e.xAppOverlay.currentUrl)||"",{closeOnSubmit:t,feedbackMessage:n,screenTitle:i,sendEventOnCloseIconClick:o,showCloseIcon:a}=function(e){const t=XB(t=>t.xAppOverlay.settingsByUrl?.[e]??{});return(0,r.useMemo)(()=>t,[t,e])}(e),s=kM(),l=r=>{if(!1!==e.startsWith(r.origin)&&"x-app-submit"===r.data.type){if(n){const{success:e=!1}=r?.data||{};s(zM({source:"user",data:{_plugin:{type:"x-app-submit",data:{success:e,text:n}}}}))}t&&s(dI())}};(0,r.useEffect)(()=>(window.addEventListener("message",l),()=>{window.removeEventListener("message",l)}),[t]);const c=i||a;return r.createElement(cJ,{tabIndex:0,role:"dialog","aria-modal":"true"},c&&r.createElement(aY,{title:i,hideBackButton:!0,onClose:a?()=>{o&&s(Mx({data:{type:"xAppClosed"}})),s(dI())}:void 0}),r.createElement(uJ,{src:e,allow:" accelerometer; ambient-light-sensor; autoplay; battery; bluetooth; camera; cross-origin-isolated; display-capture; document-domain; encrypted-media; execution-while-not-rendered; execution-while-out-of-viewport; fullscreen; gamepad; geolocation; gyroscope; hid; idle-detection; interest-cohort; local-fonts; magnetometer; microphone; midi; otp-credentials; payment; picture-in-picture; publickey-credentials-get; screen-wake-lock; serial; speaker-selection; usb; web-share; xr-spatial-tracking"}))};function pJ(e,t){return"bot"===e?t.botMessageColor||"#FFFFFF":"user"===e?t.userMessageColor||"#E8EBFF":null}const hJ=new Set,fJ={match:({text:e,source:t})=>"bot"===t||"engagement"===t&&!!e,component:e=>{if(!window||!window.speechSynthesis)return null;const t=e.message.timestamp+"";if(hJ.has(t))return null;hJ.add(t);const n=new SpeechSynthesisUtterance;return n.text=e.message.text||"",speechSynthesis.speak(n),null},options:{passthrough:!0},name:"SpeechOutput"},mJ=fJ,gJ=()=>"undefined"!=typeof window&&window.innerWidth<=575,yJ=/[*_~#`<>[\]()|]/g;const AJ=e=>{const{config:t,onOpenChange:n,isOpen:i}=e,{userId:o,channel:a}=TM(e=>e.options),s=kM();return r.createElement(r.Fragment,null,r.createElement(OZ,{isOpen:i,onClose:n,onConfirmDelete:()=>{s(iI({})),s(WM()),s(_O()),s({type:CI});const e=bI({disableLocalStorage:t.settings.embeddingConfiguration?.disableLocalStorage??!1,useSessionStorage:t.settings.embeddingConfiguration?.useSessionStorage??!1});e&&Object.keys(e).forEach(t=>{t.includes(o)&&t.includes("webchat-client")&&e.removeItem(t)}),n(!1,!0)},title:t.settings.customTranslations?.delete_all_conversations??"Delete all conversations",cancelText:t.settings.customTranslations?.cancel??"Cancel",confirmText:t.settings.customTranslations?.delete_anyway??"Delete anyway",cancelButtonBackground:t.settings.customColors?.cancelButtonColor,confirmButtonBackground:t.settings.customColors?.deleteButtonColor},r.createElement(mm,{variant:"body-regular",className:"webchat-delete-all-conversation-text"},t.settings.customTranslations?.delete_all_conversations_confirmation??"Are you sure you want to delete all previous conversations? This action cannot be undone.")))},vJ=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|[\uD83C-\uDBFF\uDC00-\uDFFF]|\uFE0F|\u200D)+/gu,"").replace(/<\/?[^>]+(>|$)/g,"").replace(/ /g," ").replace(/\s+/g," ").trim(),bJ=e=>{const t=document.querySelector(`[data-message-id="${e}"]`);return t?(e=>{const t=e=>{if(e.nodeType===Node.TEXT_NODE)return e.textContent??"";if(e.nodeType!==Node.ELEMENT_NODE)return"";const t=e;if(t.hasAttribute("aria-hidden")||"presentation"===t.getAttribute("role")||"none"===t.getAttribute("role")||t.hasAttribute("hidden")||t.hasAttribute("data-skip-live-region")||"none"===getComputedStyle(t).display||"hidden"===getComputedStyle(t).visibility)return"";const r={P:e=>n(e).trim()+"\n",LI:e=>n(e).trim()+". ",UL:n,OL:n};return["H1","H2","H3","H4","H5","H6"].forEach(e=>{r[e]=e=>n(e).trim()+".\n"}),r[t.tagName]?.(t)??n(t)},n=e=>Array.from(e.childNodes).map(t).join(""),r=t(e);return vJ(r)})(t):null},wJ=({liveContent:e})=>{const[t,n]=(0,r.useState)(null),i=XB(e=>e.messages.messageHistory),o=ft(i,["acceptPrivacyPolicy"]),a=(0,r.useRef)(new Set),s=XB(e=>e.config.settings.behavior?.progressiveMessageRendering);return(0,r.useEffect)(()=>{if(!o.length)return;const t=o.filter(e=>{const t=`webchatMessageId-${e.timestamp}`;return!a.current.has(t)});if(!t.length)return;const r=e=>null!==e&&"object"==typeof e&&"animationState"in e,i=setTimeout(()=>{for(const i of t){const t=`webchatMessageId-${i.timestamp}`;if(s&&r(i)&&("start"===i.animationState||"animating"===i.animationState))return;if(e[t]===`IGNORE-${t}`){a.current.add(t);continue}const o=e[t],l=o?null:bJ(t);if(!(Boolean(o)||null!==l))continue;a.current.add(t);const c=vJ(o||l||"A new message");return void n({id:t,text:c})}},100);return()=>clearTimeout(i)},[o,e,s]),r.createElement("div",{"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"true",id:"webchatMessageContainerScreenReaderLiveRegion",className:"sr-only"},t&&r.createElement("div",{key:t.id},t.text))};function EJ(){return EJ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},EJ.apply(null,arguments)}const kJ=[(e=>(t,n,r)=>-2===t?n.split(r[0]).join(`${e} ${r[0]}`):n)("[data-cognigy-webchat-root]")];(()=>{const e=document.getElementsByTagName("html")[0].attributes.dir;e&&"rtl"===e.value&&kJ.push(uV.Ay)})();const CJ=kY({key:"cognigy-webchat",stylisPlugins:kJ}),_J=Ye(mm)(({theme:e})=>({display:"block",textAlign:"center",padding:"12px",color:e.black40})),MJ=Ye(mY)(({theme:e})=>({overflowY:"auto",flexGrow:1,minHeight:0,height:e.blockSize,overscrollBehavior:"contain"})),TJ=Ye.div({position:"relative",height:"100%",display:"flex",flexDirection:"column",overscrollBehavior:"contain"}),SJ=Ye.div(({theme:e})=>({height:"100%",zIndex:3,display:"flex",flexDirection:"column",backgroundColor:e.white,overflow:"auto",overscrollBehavior:"contain","&.slide-in-enter":{transform:"translateX(100%)"},"&.slide-in-enter-active":{transform:"translateX(0%)",transition:"transform 400ms ease-out"},"&.slide-in-exit":{transform:"translateX(0%)"},"&.slide-in-exit-active":{transform:"translateX(100%)",transition:"transform 400ms ease-out"},"&.slide-in-enter:dir(rtl)":{transform:"translateX(-100%)"},"&.slide-in-enter-active:dir(rtl)":{transform:"translateX(0%)",transition:"transform 400ms ease-out"},"&.slide-in-exit:dir(rtl)":{transform:"translateX(0%)"},"&.slide-in-exit-active:dir(rtl)":{transform:"translateX(-100%)",transition:"transform 400ms ease-out"}}));class DJ extends r.PureComponent{state={theme:WB(),messagePlugins:[],inputPlugins:[],hadConnection:!1,lastUnseenMessageText:"",wasOpen:!1,timedOut:!1,showDeleteAllConversationsModal:!1,deleteConversationsModalState:!1,liveContent:{},isMobile:!1};unreadTitleIndicatorInterval=null;originalTitle=window.document.title;titleType="original";hideNotifications=!0;visibilityCheckInitialized=!1;visibilityCheckCompleted=!1;engagementMessageTimeout=null;constructor(e){super(e),this.chatToggleButtonRef=r.createRef(),this.closeButtonInHeaderRef=r.createRef(),this.menuButtonInHeaderRef=r.createRef(),this.deleteButtonInHeaderRef=r.createRef(),this.startNewConversationButtonRef=r.createRef(),this.ratingButtonInHeaderRef=r.createRef(),this.webchatWindowRef=r.createRef(),this.homeScreenCloseButtonRef=r.createRef(),this.handleStartConversation=this.handleStartConversation.bind(this),this.handleResize=(0,dV.debounce)(this.handleResize.bind(this),200)}static getDerivedStateFromProps(e,t){const n=e?.config?.settings?.colors?.primaryColor,r=e?.config?.settings?.colors?.secondaryColor,i=e?.config?.settings?.colors?.chatInterfaceColor,o=e?.config?.settings?.widgetSettings?.sourceColorMapping,a=pJ(o?.bot,e?.config?.settings?.colors),s=pJ(o?.user,e?.config?.settings?.colors),l=pJ(o?.agent,e?.config?.settings?.colors),c="user"===o?.bot?"transparent":null,u="bot"===o?.user?t.theme.black80:null,d="user"===o?.agent?"transparent":null,p=a||e?.config?.settings?.colors?.botMessageColor,h=s||e?.config?.settings?.colors?.userMessageColor,f=e?.config?.settings?.colors?.textLinkColor;let m=!1;if(n&&n!==t.theme.primaryColor){document.documentElement.style.setProperty("--webchat-primary-color",n);const e=zB(n,t.theme);document.documentElement.style.setProperty("--webchat-primary-contrast-color",e),m=!0}if(t.theme.primaryColorFocus&&document.documentElement.style.setProperty("--webchat-primary-color-focus",t.theme.primaryColorFocus),t.theme.primaryColorHover&&document.documentElement.style.setProperty("--webchat-primary-color-hover",t.theme.primaryColorHover),r&&r!==t.theme.secondaryColor){document.documentElement.style.setProperty("--webchat-secondary-color",r);const e=zB(r,t.theme);document.documentElement.style.setProperty("--webchat-secondary-contrast-color",e),m=!0}if(i&&i!==t.theme.backgroundWebchat&&(document.documentElement.style.setProperty("--webchat-background-webchat",i),m=!0),p&&p!==t.theme.backgroundBotMessage&&!e?.config?.settings?.layout?.disableBotOutputBorder){document.documentElement.style.setProperty("--webchat-background-bot-message",p);const e=zB(p,t.theme);document.documentElement.style.setProperty("--webchat-bot-message-contrast-color",e),m=!0}if(h&&h!==t.theme.backgroundUserMessage){document.documentElement.style.setProperty("--webchat-background-user-message",h);const e=zB(h,t.theme);document.documentElement.style.setProperty("--webchat-user-message-contrast-color",e),m=!0}if(l){document.documentElement.style.setProperty("--webchat-background-agent-message",l);const e=zB(l,t.theme);document.documentElement.style.setProperty("--webchat-agent-message-contrast-color",e)}return c&&document.documentElement.style.setProperty("--webchat-border-bot-message",c),u&&document.documentElement.style.setProperty("--webchat-border-user-message",u),d&&document.documentElement.style.setProperty("--webchat-border-agent-message",d),f&&f!==t.theme.textLink&&(document.documentElement.style.setProperty("--webchat-text-link",f),m=!0),m?{...t,theme:WB({primaryColor:n,secondaryColor:r,backgroundWebchat:i,backgroundBotMessage:p,backgroundUserMessage:h,textLink:f})}:null}checkNotificationsHidden=async()=>{let e=!1;if(this.props.config.settings.embeddingConfiguration.awaitEndpointConfig&&!this.props.config.isConfigLoaded){const t=this.props.config.settings.embeddingConfiguration?.connectivity?.enabled&&this.props.config.settings.embeddingConfiguration?.connectivity?.timeout||1e3;let n=0;for(;!this.props.config.isConfigLoaded&&!e;)await new Promise(e=>setTimeout(e,50)),n+=50,n>=t&&(e=!0,this.setState({timedOut:!0}))}this.hideNotifications=sj(this.props.config.settings,e)||rj(this.props.config.settings)||ej(this.props.config.settings.businessHours)||lj(this.props.config.settings,e)||ij(this.props.config.settings)||tj(this.props.config.settings.businessHours)||aj(this.props.config.settings,e)||nj(this.props.config.settings)||$F(this.props.config.settings.businessHours)||!1};componentDidMount(){const e=[];this.props.ttsActive&&e.push(mJ),this.setState({inputPlugins:[...this.props.inputPlugins||[],cV],messagePlugins:[...this.props.messagePlugins||[],...e],isMobile:gJ()}),this.setupIconAnimationInterval(),window.addEventListener("resize",this.handleResize)}async componentDidUpdate(e,t){if(e.open!==this.props.open&&this.props.open){const e=this.webchatWindowRef?.current,t=this.chatToggleButtonRef?.current,{firstFocusable:n}=HF(e);document.activeElement===t&&n&&n.focus()}if(e.ttsActive!==this.props.ttsActive||e.inputPlugins!==this.props.inputPlugins||e.messagePlugins!==this.props.messagePlugins){const e=[];this.props.ttsActive&&e.push(mJ),this.setState({inputPlugins:[...this.props.inputPlugins||[],cV],messagePlugins:[...this.props.messagePlugins||[],...e]})}for(this?.props?.config?.settings?.colors?.primaryColor===e?.config?.settings?.colors?.primaryColor&&this?.props?.config?.settings?.colors?.secondaryColor===e?.config?.settings?.colors?.secondaryColor&&this?.props?.config?.settings?.colors?.chatInterfaceColor===e?.config?.settings?.colors?.chatInterfaceColor&&this?.props?.config?.settings?.colors?.botMessageColor===e?.config?.settings?.colors?.botMessageColor&&this?.props?.config?.settings?.colors?.userMessageColor===e?.config?.settings?.colors?.userMessageColor&&this?.props?.config?.settings?.colors?.textLinkColor===e?.config?.settings?.colors?.textLinkColor||this.setState({theme:WB({primaryColor:this?.props?.config?.settings?.colors?.primaryColor,secondaryColor:this?.props?.config?.settings?.colors?.secondaryColor,backgroundWebchat:this?.props?.config?.settings?.colors?.chatInterfaceColor,backgroundBotMessage:this?.props?.config?.settings?.colors?.botMessageColor,backgroundUserMessage:this?.props?.config?.settings?.colors?.userMessageColor,textLink:this?.props?.config?.settings?.colors?.textLinkColor})}),!t.hadConnection&&this.props.connected&&this.setState({hadConnection:!0}),this.visibilityCheckInitialized||(this.visibilityCheckInitialized=!0,await this.checkNotificationsHidden(),this.visibilityCheckCompleted=!0);!this.visibilityCheckCompleted;)await new Promise(e=>setTimeout(e,50));if(!this.hideNotifications&&e.unseenMessages!==this.props.unseenMessages||!e.config.settings.unreadMessages.enablePreview&&this.props.config.settings.unreadMessages.enablePreview){const{unseenMessages:e}=this.props;if(this.props.config.settings.unreadMessages.enablePreview||!this.state.wasOpen&&this.props.config.settings.teaserMessage.text){let e="";const t=zF(this.props.unseenMessages,e=>!!YT(e));t&&(e=YT(t)),this.props.config.settings.widgetSettings.disableTeaserMarkdownRemoval||(e=e.replace(yJ,"")),this.setState({lastUnseenMessageText:e})}e.length>0&&this.props.config.settings.unreadMessages.enableSound&&GF.play()}e.config.settings.unreadMessages.enablePreview&&!this.props.config.settings.unreadMessages.enablePreview&&this.setState({lastUnseenMessageText:""}),e?.config?.settings?.layout?.iconAnimationInterval===this.props?.config?.settings?.layout?.iconAnimationInterval&&e?.config?.settings?.layout?.iconAnimationSpeed===this.props?.config?.settings?.layout?.iconAnimationSpeed&&e?.config?.settings?.layout?.iconAnimation===this.props?.config?.settings?.layout?.iconAnimation||this.setupIconAnimationInterval(),this.hideNotifications||(this.props.config.settings.unreadMessages.enableIndicator&&this.initializeTitleIndicator(),this.initializeEngagementMessage(),this.props.open&&!this.state.wasOpen&&this.setState({wasOpen:!0}))}componentWillUnmount(){this.unreadTitleIndicatorInterval&&(clearInterval(this.unreadTitleIndicatorInterval),this.unreadTitleIndicatorInterval=null),this.engagementMessageTimeout&&(clearTimeout(this.engagementMessageTimeout),this.engagementMessageTimeout=null),this.iconAnimationIntervalHandle&&(clearInterval(this.iconAnimationIntervalHandle),this.iconAnimationIntervalHandle=null),window.removeEventListener("resize",this.handleResize)}handleResize(){const e=gJ();e!==this.state.isMobile&&this.setState({isMobile:e})}iconAnimationIntervalHandle=null;setupIconAnimationInterval(){this.iconAnimationIntervalHandle&&(clearInterval(this.iconAnimationIntervalHandle),this.iconAnimationIntervalHandle=null);const e=this.props?.config?.settings?.layout?.iconAnimation;if(!e||"string"==typeof e&&0===e.trim().length)return;const t=this.props.config?.settings?.layout?.iconAnimationInterval??5,n=1e3*Math.max(0,t);0!==n&&(this.iconAnimationIntervalHandle=setInterval(()=>{const e=this.chatToggleButtonRef?.current;if(!e)return;const t=e.querySelector(".iconAnimationContainer");t&&(t.classList.remove("optionActive"),t.getBoundingClientRect(),t.classList.add("optionActive"))},n))}triggerEngagementMessage=()=>{this.state.wasOpen||this.props.messages.length>0||this.props.onTriggerEngagementMessage()};initializeEngagementMessage=()=>{this.engagementMessageTimeout||this.props.config.settings.teaserMessage.text&&"number"==typeof this.props.config.settings.teaserMessage.teaserMessageDelay&&this.props.config.settings.teaserMessage.teaserMessageDelay>=0&&(this.engagementMessageTimeout=setTimeout(this.triggerEngagementMessage,this.props.config.settings.teaserMessage.teaserMessageDelay))};initializeTitleIndicator=async()=>{this.unreadTitleIndicatorInterval||this.hideNotifications||(this.unreadTitleIndicatorInterval=setInterval(this.toggleTitleIndicator,1e3))};toggleTitleIndicator=()=>{"unread"===this.titleType?(document.title=this.originalTitle,this.titleType="original"):this.props.unseenMessages.length>0&&(document.title=`(${this.props.unseenMessages.length}) ${1===this.props.unseenMessages.length?this.props.config.settings.unreadMessages.unreadMessageTitleText:this.props.config.settings.unreadMessages.unreadMessageTitleTextPlural}`,this.titleType="unread")};sendMessage=(...e)=>{this.props.onSendMessage(...e),null===this.props.lastScrolledPosition&&this.props.onSetLastScrolledPosition(0)};renderInput=()=>{const{inputPlugins:e}=this.state,{messages:t}=this.props;return Dj(t)?null:r.createElement(PY,{plugins:e,messages:this.props.messages,onSendMessage:this.sendMessage,config:this.props.config,onSetInputMode:this.props.onSetInputMode,inputMode:this.props.inputMode,webchatTheme:this.state.theme,onEmitAnalytics:this.props.onEmitAnalytics,theme:this.state.theme,sttActive:this.props.sttActive})};handleKeydown=e=>{const{enableFocusTrap:t}=this.props.config.settings.widgetSettings,{showDeleteAllConversationsModal:n,deleteConversationsModalState:r}=this.state,{open:i}=this.props,{target:o,key:a,shiftKey:s}=e,l=s&&"Tab"===a,c=!s&&"Tab"===a;if(t&&i&&!n&&!r){const t=this.webchatWindowRef?.current,{firstFocusable:n,lastFocusable:r}=HF(t),i=this.chatToggleButtonRef?.current;o!==i&&o!==n||!l?o!==i&&o!==r||!c||(e.preventDefault(),setTimeout(()=>{n?.focus()},0)):(e.preventDefault(),r?.focus())}};handleSendRating=({rating:e,comment:t,showRatingStatus:n})=>{this.props.onShowRatingScreen(!1),this.props.onSendMessage(void 0,{_cognigy:{controlCommands:[{type:"setRating",parameters:{rating:e,comment:t,showRatingStatus:n}}]}},void 0),this.props.onSetHasGivenRating()};handleSendActionButtonMessage=(e,t,n)=>{this.props.onSetShowHomeScreen(!1),this.props.onSetShowChatOptionsScreen(!1),this.props.config.settings.privacyNotice.enabled&&!this.props.hasAcceptedTerms?this.props.onSetStoredMessage({text:e,data:t,options:n}):(this.props.onSwitchSession(),this.props.onSendMessage(e,t,n))};handleSendActionButtonMessageExistingSession=(e,t,n)=>{this.props.onSetShowHomeScreen(!1),this.props.onSetShowChatOptionsScreen(!1),this.props.config.settings.privacyNotice.enabled&&!this.props.hasAcceptedTerms?this.props.onSetStoredMessage({text:e,data:t,options:n}):this.props.onSendMessage(e,t,n)};handleSendActionButtonMessageFromTeaser=(e,t,n)=>{this.props.onSetShowHomeScreen(!1),this.props.onSetShowChatOptionsScreen(!1),this.props.config.settings.privacyNotice.enabled&&!this.props.hasAcceptedTerms?this.props.onSetStoredMessage({text:e,data:t,options:n}):(this.props.onShowChatScreen(),this.props.onSendMessage(e,t,n))};handleStartConversation=()=>{this.props.onSetShowHomeScreen(!1),this.props.onSetShowChatOptionsScreen(!1);this.props.config.settings.privacyNotice.enabled&&!this.props.hasAcceptedTerms||this.props.onShowChatScreen()};handleFabClick=()=>{this.props.onToggle();!0===this.props.config.settings.homeScreen.enabled?this.setState({lastUnseenMessageText:""}):this.handleStartConversation()};openConversationFromTeaser=()=>{this.props.onToggle(),this.props.onSetShowHomeScreen(!1),this.props.onSetShowChatOptionsScreen(!1);this.props.config.settings.privacyNotice.enabled&&!this.props.hasAcceptedTerms?this.setState({lastUnseenMessageText:""}):this.props.onShowChatScreen()};emitCloseButtonAnalytics=()=>{this.props.onEmitAnalytics("webchat/close-button")};render(){const{props:e,state:t}=this,{messages:n,unseenMessages:i,prevConversations:o,onSendMessage:a,onConnect:s,config:l,open:c,fullscreenMessage:u,typingIndicator:d,onEmitAnalytics:p,onSetInputMode:h,onSetFullscreenMessage:f,onDismissFullscreenMessage:m,onClose:g,onToggle:y,onSetScrollToPosition:A,onSetLastScrolledPosition:v,scrollToPosition:b,lastScrolledPosition:w,onTriggerEngagementMessage:E,webchatRootProps:k,webchatToggleProps:C,connected:_,reconnectionLimit:M,showRatingScreen:T,onShowRatingScreen:S,onSetShowHomeScreen:D,onSetHasGivenRating:x,onSetShowPrevConversations:I,onSetShowChatOptionsScreen:L,onShowChatScreen:P,onSwitchSession:O,requestRatingScreenTitle:R,customRatingTitle:B,customRatingCommentText:Y,requestRatingSubmitButtonText:N,requestRatingEventBannerText:V,requestRatingChatStatusBadgeText:F,onAcceptTerms:j,onSetStoredMessage:H,onSetFileList:q,onSetFileUploadError:G,onSetDropZoneVisible:z,isXAppOverlayOpen:U,openXAppOverlay:W,onSetMessageAnimated:Q,lastInputId:Z,...J}=e,{theme:K,hadConnection:X,lastUnseenMessageText:$,wasOpen:ee,isMobile:te}=t,{widgetSettings:{disableToggleButton:ne,disableMobileScrollLock:re},behavior:{enableConnectionStatusIndicator:ie}}=l.settings;if(!l.active&&!l.settings.embeddingConfiguration.connectivity.enabled||!l.isConfigLoaded&&l.settings.embeddingConfiguration.awaitEndpointConfig||l.isConfigLoaded&&l.settings.embeddingConfiguration.awaitEndpointConfig&&($F(l.settings.businessHours)||nj(l.settings)||aj(l.settings,t.timedOut)))return null;const oe=l.isConfigLoaded&&l.settings.embeddingConfiguration.awaitEndpointConfig&&(rj(l.settings)||ej(l.settings.businessHours)||sj(l.settings,t.timedOut)),ae=l.isConfigLoaded&&l.settings.embeddingConfiguration.awaitEndpointConfig&&(ij(l.settings)||tj(l.settings.businessHours)||lj(l.settings,t.timedOut)),se=ie&&!_&&X,le=()=>oe&&rj(this.props.config.settings)?this.props.config.settings.maintenance.text||"This chat is currently disabled due to maintenance":oe&&ej(this.props.config.settings.businessHours)?this.props.config.settings.maintenance.text||"This chat is disabled out of our business hours":oe&&sj(this.props.config.settings,this.state.timedOut)?this.props.config.settings.embeddingConfiguration.connectivity.text||"This chat is disabled due to connectivity issues":void 0,ce=l.settings.customTranslations?.ariaLabels?.chatRegion??"Chat window";return r.createElement(r.Fragment,null,r.createElement(De,{theme:K},r.createElement(r.Fragment,null,r.createElement(nF,{enabled:c&&te&&!re,allowPinchZoom:!0},r.createElement(aF,EJ({"data-cognigy-webchat-root":!0},J,{className:"webchat-root","aria-label":ce,role:"region",onKeyDown:this.handleKeydown}),r.createElement(_e,{value:CJ},c&&(!this.props.config.settings.embeddingConfiguration.awaitEndpointConfig||this.props.config.settings.embeddingConfiguration.awaitEndpointConfig&&this.props.config.isConfigLoaded)&&r.createElement(lY,EJ({"data-cognigy-webchat":!0},k,{className:"webchat",id:"webchatWindow",ref:this.webchatWindowRef,chatWindowWidth:this.props.config.settings.layout.chatWindowWidth}),u?this.renderFullscreenMessageLayout():this.renderRegularLayout(ae),r.createElement(VF,{isOpen:se,onConnect:s,isPermanent:!!M,onClose:()=>{g(),this.emitCloseButtonAnalytics(),this.chatToggleButtonRef.current?.focus()},config:l})),!ne&&r.createElement("div",null,$&&!c&&r.createElement(lJ,{messageText:$,onClick:this.openConversationFromTeaser,config:l,onEmitAnalytics:p,onSendActionButtonMessage:this.handleSendActionButtonMessageFromTeaser,onHideTeaserMessage:()=>{this.setState({lastUnseenMessageText:""}),this.chatToggleButtonRef.current?.focus()},wasOpen:ee}),oe?r.createElement("div",{title:le(),tabIndex:-1,"aria-disabled":!0},r.createElement(oj,EJ({"data-cognigy-webchat-toggle":!0},C,{type:"button",className:"webchat-toggle-button-disabled","aria-label":le(),ref:this.chatToggleButtonRef,id:"webchatWindowToggleButton",disabled:!0}),r.createElement(_F,{config:l}))):r.createElement(oF,EJ({"data-cognigy-webchat-toggle":!0,onClick:this.handleFabClick},C,{type:"button",className:$R()("webchat-toggle-button burst",l.settings?.layout?.iconAnimation),id:"webchatWindowToggleButton","aria-label":(()=>{if(c)return l.settings.customTranslations?.ariaLabels?.closeChat??"Close chat";const e=l.settings.customTranslations?.ariaLabels?.openChat??"Open chat",t=l.settings.customTranslations?.ariaLabels?.unreadMessageSingularText??"One unread message in chat. "+e,n=l.settings.customTranslations?.ariaLabels?.unreadMessagePluralText??"unread messages in chat. "+e;switch(i.length){case 0:return e;case 1:return t;default:return`${i.length} ${n}`}})(),ref:this.chatToggleButtonRef,style:{"--icon-burst-duration":`${Math.max(.2,1/Math.max(.1,l.settings?.layout?.iconAnimationSpeed||1))}s`}}),c?r.createElement(DF,null):r.createElement(_F,{config:l}),l.settings.unreadMessages.enableBadge?r.createElement(jF,{_content:i.length,className:"webchat-unread-message-badge","aria-label":`${i.length} ${l.settings.customTranslations?.ariaLabels?.unreadMessages??"unread messages"}`}):null))))))))}renderRegularLayout(e){const{currentSession:t,config:n,messages:i,scrollToPosition:o,lastScrolledPosition:a,onSetScrollToPosition:s,onSetLastScrolledPosition:l,showHomeScreen:c,onSetShowHomeScreen:u,showPrevConversations:d,onSetShowPrevConversations:p,showChatOptionsScreen:h,onSetShowChatOptionsScreen:f,requestRatingScreenTitle:m,customRatingTitle:g,customRatingCommentText:y,requestRatingSubmitButtonText:A,requestRatingEventBannerText:v,showRatingScreen:b,onShowRatingScreen:w,onShowChatScreen:E,onSwitchSession:k,onClose:C,onEmitAnalytics:_,onSendMessage:M,hasAcceptedTerms:T,onAcceptTerms:S,onSetStoredMessage:D,isDropZoneVisible:x,isXAppOverlayOpen:I,lastInputId:L}=this.props;let P="",O="";n.settings.maintenance.enabled&&"inform"===n.settings.maintenance.mode?(P=n.settings.maintenance.text||"This Webchat is disabled due to maintenance",O=n.settings.maintenance.title||""):n.settings.embeddingConfiguration.connectivity.enabled&&"inform"===n.settings.embeddingConfiguration.connectivity.mode?(P=n.settings.embeddingConfiguration.connectivity.text||"This Webchat is disabled due to connectivity issues",O=n.settings.embeddingConfiguration.connectivity.title||""):n.settings.businessHours.enabled&&"inform"===n.settings.businessHours.mode&&(P=n.settings.businessHours.text||"This Webchat is disabled out of business hours",O=n.settings.businessHours.title||"");const R=e&&P,B=R,Y=()=>{this.props.onMinimize?.(),this.chatToggleButtonRef?.current?.focus?.()},N=()=>{S(this.props?.options?.userId||""),E();this.props.onSendMessage("",{_cognigy:{controlCommands:[{type:"acceptPrivacyPolicy"}]}})},V=e=>{e.preventDefault(),e.stopPropagation(),n?.settings?.fileStorageSettings?.enabled&&this.props.onSetDropZoneVisible(!0)},F=n.settings.homeScreen.enabled,j=F&&c,H=!h&&!b&&!d&&!j&&!R&&(T||!n.settings.privacyNotice.enabled),q=n.settings.chatOptions.enabled&&H,G=H&&!F,z=!!((n.settings.privacyNotice.enabled&&this.props.hasAcceptedTerms||!n.settings.privacyNotice.enabled)&&n.settings.homeScreen.previousConversations.enableDeleteAllConversations&&d&&Object.keys(this.props.prevConversations).length),U=!H&&!c;return r.createElement(TJ,null,!I&&r.createElement(wZ,{in:!(j&&!R),timeout:500,classNames:"slide-in",mountOnEnter:!0,unmountOnExit:!0},!I&&r.createElement(aY,{onClose:()=>{u(!0),C(),this.emitCloseButtonAnalytics(),this.chatToggleButtonRef?.current?.focus?.()},onMinimize:Y,onGoBack:R?void 0:()=>{h||b?(f(!1),w(!1),n.settings.widgetSettings.disableInputAutofocus&&this.closeButtonInHeaderRef?.current?.focus?.()):(p(!1),u(!0),setTimeout(()=>{this.homeScreenCloseButtonRef?.current?.focus?.()},450))},onSetShowChatOptionsScreen:()=>{f(!0)},isChatOptionsButtonVisible:q,isDeleteAllConversationsButtonVisible:z,onDeleteAllConversations:()=>{this.setState({showDeleteAllConversationsModal:!0})},logoUrl:h||b?void 0:n.settings.layout.logoUrl,title:R&&O?O:!T&&n.settings.privacyNotice.enabled?n.settings.privacyNotice.title||"Privacy notice":d?n.settings.homeScreen.previousConversations.title||"Previous conversations":h?n.settings.chatOptions.title||"Chat options":b?m||"Conversation rating":n.settings.layout.title?n.settings.layout.title:"Cognigy",closeButtonRef:this.closeButtonInHeaderRef,menuButtonRef:this.menuButtonInHeaderRef,deleteButtonRef:this.deleteButtonInHeaderRef,chatToggleButtonRef:this.chatToggleButtonRef,hideBackButton:G,showChatScreen:H,autoFocusScreenTitle:U,deleteIconColor:n.settings.customColors?.deleteAllConversationIconColor})),!B&&F&&r.createElement(wZ,{in:!c,timeout:500,classNames:"hidebackground"},r.createElement(kj,{showHomeScreen:c,closeButtonRef:this.homeScreenCloseButtonRef,onSetShowHomeScreen:u,onStartConversation:this.handleStartConversation,onSetShowPrevConversations:p,onClose:Y,config:n,onEmitAnalytics:_,onSendActionButtonMessage:this.handleSendActionButtonMessage})),r.createElement(wZ,{in:!(j&&!R),timeout:500,classNames:"slide-in",mountOnEnter:!0,unmountOnExit:!0},r.createElement(SJ,null,(()=>R?r.createElement($j,{message:P}):!T&&n.settings.privacyNotice.enabled?r.createElement(CQ,{privacyNotice:n.settings.privacyNotice,onAcceptTerms:N,isHomeScreenEnabled:F}):I?r.createElement(dJ,null):d?r.createElement(zj,{conversations:this.props.prevConversations,onSetShowPrevConversations:p,onSwitchSession:k,config:n,currentSession:t,startNewConversationButtonRef:this.startNewConversationButtonRef}):h||b?r.createElement(HZ,{config:n,ratingTitleText:g||n.settings.chatOptions.rating.title,ratingCommentText:y||n.settings.chatOptions.rating.commentPlaceholder,ratingSubmitButtonText:A||n.settings.chatOptions.rating.submitButtonText,ratingEventBannerText:v||n.settings.chatOptions.rating.eventBannerText,showOnlyRating:b,hasGivenRating:this.props.hasGivenRating,onSendRating:this.handleSendRating,onEmitAnalytics:_,onSendActionButtonMessage:this.handleSendActionButtonMessageExistingSession,onDeleteModalStateChange:e=>{this.setState({deleteConversationsModalState:e})}}):x?r.createElement(eJ,{layoutSettings:n.settings.layout,dropzoneText:n.settings.fileStorageSettings?.dropzoneText}):r.createElement(r.Fragment,null,r.createElement(MJ,{scrollBehavior:n.settings.behavior.scrollingBehavior,lastInputId:L,className:"webchat-chat-history",onDragEnter:V,id:"webchatChatHistory"},r.createElement("h3",{className:"sr-only",id:"webchatChatHistoryHeading"},n.settings.customTranslations?.ariaLabels?.chatHistory??"Chat history"),this.renderHistory()),r.createElement(wJ,{liveContent:this.state.liveContent}),r.createElement(GZ,null),this.renderInput()))(),r.createElement(AJ,{config:n,isOpen:this.state.showDeleteAllConversationsModal,onOpenChange:(e,t)=>{this.setState({showDeleteAllConversationsModal:e}),e||!this.deleteButtonInHeaderRef.current||t?this.startNewConversationButtonRef.current?.focus():this.deleteButtonInHeaderRef.current.focus()}}))))}renderFullscreenMessageLayout(){const{config:e,fullscreenMessage:t,onDismissFullscreenMessage:n,onEmitAnalytics:i}=this.props,{messagePlugins:o}=this.state;return r.createElement(_Y,{onSendMessage:this.sendMessage,config:e,plugins:o,onSetFullscreen:()=>{},onDismissFullscreen:n,message:t,webchatTheme:this.state.theme,onEmitAnalytics:i,action:this.sendMessage,theme:this.state.theme,onSetMessageAnimated:this.props.onSetMessageAnimated})}renderHistory(){const{messages:e,typingIndicator:t,config:n,onEmitAnalytics:i,openXAppOverlay:o,visibleOutputMessages:a}=this.props,{messagePlugins:s=[]}=this.state,{enableTypingIndicator:l,messageDelay:c,enableAIAgentNotice:u,AIAgentNoticeText:d,progressiveMessageRendering:p}=n.settings.behavior,h="remove"!==t&&"hide"!==t,f=Dj(e),m=ft(e,["acceptPrivacyPolicy"]),g=p?m.filter(e=>"bot"!==e.source&&"engagement"!==e.source||a.includes(e.id)):m,y=(e,t)=>{this.setState(n=>({liveContent:{...n.liveContent,[e]:t}}))};return r.createElement(r.Fragment,null,!1!==u&&r.createElement(_J,{variant:"body-regular",component:"div",className:"webchat-log-ai-agent-notice-text"},d||"You're now chatting with an AI Agent."),g.map((e,t)=>{const a=g.slice(t+1).some(e=>{const t="user"===e.source,n="string"==typeof e.text&&e.text.trim().length>0,r=!e?.data?._cognigy?.controlCommands,i=Array.isArray(e?.data?.attachments)&&e.data.attachments.length>0;return t&&r&&(n||i)});return r.createElement(gC,{key:e.id||JSON.stringify({message:e,index:t}),message:e,action:this.sendMessage,config:n,hasReply:a,isConversationEnded:f,onDismissFullscreen:()=>{},onEmitAnalytics:i,onSetFullscreen:()=>this.props.onSetFullscreenMessage(e),openXAppOverlay:o,plugins:s,prevMessage:g?.[t-1],theme:this.state.theme,onSetMessageAnimated:this.props.onSetMessageAnimated,onSetLiveRegionText:y,"data-message-id":`webchatMessageId-${e.timestamp}`})}),f&&r.createElement(iC,{text:"Conversation ended",className:"webchat-chip-conversation-ended"}),l&&r.createElement(JF,{active:h,delay:c,direction:n?.settings?.widgetSettings?.sourceDirectionMapping?.bot||"incoming",disableBorder:n?.settings?.layout?.disableBotOutputBorder}))}}const xJ=AM(e=>{const{messages:{messageHistory:t,visibleOutputMessages:n},unseenMessages:r,prevConversations:i,connection:{connected:o,reconnectionLimit:a},ui:{open:s,typing:l,inputMode:c,fullscreenMessage:u,showHomeScreen:d,showPrevConversations:p,showChatOptionsScreen:h,hasAcceptedTerms:f,ttsActive:m,lastInputId:g},config:y,options:{sessionId:A,userId:v},rating:{showRatingScreen:b,hasGivenRating:w,requestRatingScreenTitle:E,customRatingTitle:k,customRatingCommentText:C,requestRatingSubmitButtonText:_,requestRatingEventBannerText:M,requestRatingChatStatusBadgeText:T},input:{sttActive:S,isDropZoneVisible:D,fileList:x,fileUploadError:I},xAppOverlay:{open:L}}=e;return{currentSession:A,messages:t,visibleOutputMessages:n,unseenMessages:r,prevConversations:i,open:s,typingIndicator:l,inputMode:c,fullscreenMessage:u,config:y,connected:o,reconnectionLimit:a,showRatingScreen:b,hasGivenRating:w,requestRatingScreenTitle:E,customRatingTitle:k,customRatingCommentText:C,requestRatingSubmitButtonText:_,requestRatingEventBannerText:M,requestRatingChatStatusBadgeText:T,showHomeScreen:d,sttActive:S,isDropZoneVisible:D,fileList:x,fileUploadError:I,showPrevConversations:p,showChatOptionsScreen:h,hasAcceptedTerms:f,isXAppOverlayOpen:L,userId:v,ttsActive:m,lastInputId:g}},e=>({onSendMessage:(t,n,r)=>e(Mx({text:t,data:n},r)),onSetInputMode:t=>e((e=>({type:dT,inputMode:e}))(t)),onSetFullscreenMessage:t=>e(hT(t)),onDismissFullscreenMessage:()=>e(hT(void 0)),onClose:()=>e(nT(!1)),onMinimize:()=>e({type:rT}),onToggle:()=>e({type:"TOGGLE_OPEN"}),onTriggerEngagementMessage:()=>e({type:"TRIGGER_ENGAGEMENT_MESSAGE"}),onConnect:()=>e({type:"CONNECT"}),onShowRatingScreen:t=>e(MT(t)),onSetHasGivenRating:()=>e({type:TT}),onSetShowHomeScreen:t=>e(oT(t)),onSetShowPrevConversations:t=>e({type:aT,showPrevConversations:t}),onSetShowChatOptionsScreen:t=>e(lT(t)),onShowChatScreen:()=>e({type:"SHOW_CHAT_SCREEN"}),onSwitchSession:(t,n)=>e(_O(t,n)),onAcceptTerms:t=>e(AT(t)),onSetStoredMessage:t=>e(bT(t)),onSetDropZoneVisible:t=>e(Jx(t)),onSetFileList:t=>e(Xx(t)),onSetFileUploadError:t=>e(eI(t)),openXAppOverlay:t=>e(uI(t)),onSetMessageAnimated:(t,n)=>e(((e,t)=>({type:"SET_MESSAGE_ANIMATED",messageId:e,animationState:t}))(t,n))}),({fullscreenMessage:e,...t},n,r)=>{if(!e){const n=t.messages.slice(-1)[0],i=n?((e,t)=>n=>{const r=[];for(const i of e)if(i.match(n,t)&&(r.push(i),!i.options||!i.options.passthrough))break;return r})(r.messagePlugins||[],t.config)(n):[],o=i.slice(-1)[0];e=o&&(e=>e.options&&e.options.fullscreen)(o)?n:void 0}return{...t,...n,...r,fullscreenMessage:e}})(DJ);var IJ=i(8657),LJ=i(2166);function PJ(){return PJ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PJ.apply(null,arguments)}class OJ extends r.PureComponent{analytics=new IJ.EventEmitter;constructor(e){super(e);const{url:t,options:n,settings:r}=e,i=(e=>{const t=e.split("/");return t.splice(t.length-1,1),t.join("/")})(t),o=t.split("/").pop();const a={channel:n?.channel||"webchat3",...n},s=new LJ.SocketClient(i,o,a);this.client=s;const l=IO(this,t,r);this.store=l,this._handleOutput=gD(this.store)}UNSAFE_componentWillMount(){const{settings:e}=this.props,t=bI({disableLocalStorage:e?.embeddingConfiguration?.disableLocalStorage??!1,useSessionStorage:e?.embeddingConfiguration?.useSessionStorage??!1}),n=this.client.socketOptions.userId;AO(t,n)&&this.store.dispatch(AT(n)),this.store.dispatch({type:"LOAD_CONFIG"}),this.props.options?.sessionId&&this.store.dispatch({type:"SET_INITIAL_SESSION_ID",sessionId:this.props.options.sessionId}),this.props.options?.userId&&this.store.dispatch((e=>({type:"SET_USER_ID",userId:e}))(this.props.options?.userId))}componentWillUnmount(){this.client.disconnect()}registerAnalyticsService(e){this.analytics.on("analytics-event",e)}emitAnalytics=(e,t)=>{this.analytics.emit("analytics-event",{type:e,payload:t})};connect=async()=>{this.store.dispatch({type:"CONNECT"})};sendMessage=(e,t,n)=>{this.store.dispatch(Mx({text:e,data:t},n))};_open=()=>{const{settings:e}=this.store.getState().config,t=bI({disableLocalStorage:e?.embeddingConfiguration?.disableLocalStorage??!1,useSessionStorage:e?.embeddingConfiguration?.useSessionStorage??!1}),n=this.client.socketOptions.userId,r=!0===e?.homeScreen?.enabled,i=!(!0===e?.privacyNotice?.enabled)||AO(t,n);!r&&i&&(this.store.dispatch(oT(!1)),this.store.dispatch(lT(!1)),this.store.dispatch({type:"SHOW_CHAT_SCREEN"})),this.store.dispatch({type:"TOGGLE_OPEN"})};open=async()=>{const e=this.store.getState().config.settings.embeddingConfiguration?.connectivity?.enabled&&this.store.getState().config.settings.embeddingConfiguration?.connectivity?.timeout||1e3;let t=!1,n=0;for(;!this.store.getState().config.isConfigLoaded&&!t;)await new Promise(e=>setTimeout(e,50)),n+=50,n>=e&&(t=!0);this._open()};close=()=>{this.store.dispatch(nT(!1))};toggle=()=>{this.store.dispatch({type:"TOGGLE_OPEN"})};showNotification=e=>{QR(e)};startConversation=()=>{this.store.dispatch(oT(!1)),this.store.dispatch({type:"SHOW_CHAT_SCREEN"})};on=(e,t)=>{this.client.on(e,t)};onMessage=e=>{this.client.on("output",e)};updateSettings=e=>{this.store.dispatch({type:"UPDATE_SETTINGS",payload:e})};endSession=()=>{this.store.dispatch(_O()),this.store.dispatch(WM())};render(){const{url:e,options:t,messagePlugins:n=[],inputPlugins:i=[],...o}=this.props;return r.createElement(F_,{store:this.store},r.createElement(xJ,PJ({},o,{options:t,messagePlugins:n,inputPlugins:i,onEmitAnalytics:this.emitAnalytics})))}}window.initWebchat=async(e,t,n)=>{const i=((e=pt(),{React:t,styled:n})=>e.map(e=>"function"==typeof e?e({React:t,styled:n}):e).map(e=>"string"==typeof e.match?{...e,match:({data:t})=>t&&t._plugin&&t._plugin.type===e.match}:e))(pt(),{React:r,styled:Ye}),o=(window.cognigyWebchatInputPlugins||[]).map(e=>"function"==typeof e?e({React:r,styled:Ye}):e),s=t?.settings?.embeddingConfiguration?.disableLocalStorage??!1,l=bI({disableLocalStorage:s,useSessionStorage:t?.settings?.embeddingConfiguration?.useSessionStorage??!1});if((!t||!t.userId)&&l){let e;s||(e=l.getItem("userId")),e||(e=Ge(),s||l.setItem("userId",e)),t||(t={}),t.userId=e}let c={};t&&t.settings&&(c=t.settings),c.embeddingConfiguration={...c?.embeddingConfiguration,_endpointTokenUrl:e};const u=document.createElement("div");document.body.appendChild(u);let d=null;for((0,a.H)(u).render(r.createElement(OJ,{ref:e=>d=e,url:e,options:t,settings:c,messagePlugins:i,inputPlugins:o}));!d;)await new Promise(e=>setTimeout(e,500));return n?n(d):d},window.__COGNIGY_WEBCHAT={React:r}})()})();
|