amazon-quicksight-embedding-sdk
Advanced tools
Comparing version 2.5.0 to 2.6.0
/*! | ||
* amazon-quicksight-embedding-sdk v2.5.0 | ||
* amazon-quicksight-embedding-sdk v2.6.0 | ||
* git@github.com:awslabs/amazon-quicksight-embedding-sdk.git | ||
@@ -9,3 +9,3 @@ * https://github.com/awslabs/amazon-quicksight-embedding-sdk | ||
*/ | ||
"use strict";function e(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function r(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?e(Object(n),!0).forEach((function(e){u(r,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}function t(){t=function(){return r};var e,r={},n=Object.prototype,i=n.hasOwnProperty,o=Object.defineProperty||function(e,r,t){e[r]=t.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,r,t){return Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[r]}try{l({},"")}catch(e){l=function(e,r,t){return e[r]=t}}function f(e,r,t,n){var i=r&&r.prototype instanceof g?r:g,a=Object.create(i.prototype),s=new N(n||[]);return o(a,"_invoke",{value:R(e,t,s)}),a}function p(e,r,t){try{return{type:"normal",arg:e.call(r,t)}}catch(e){return{type:"throw",arg:e}}}r.wrap=f;var d="suspendedStart",h="suspendedYield",E="executing",v="completed",m={};function g(){}function O(){}function w(){}var _={};l(_,s,(function(){return this}));var x=Object.getPrototypeOf,I=x&&x(x(L([])));I&&I!==n&&i.call(I,s)&&(_=I);var y=w.prototype=g.prototype=Object.create(_);function S(e){["next","throw","return"].forEach((function(r){l(e,r,(function(e){return this._invoke(r,e)}))}))}function T(e,r){function t(n,o,a,s){var c=p(e[n],e,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&i.call(l,"__await")?r.resolve(l.__await).then((function(e){t("next",e,a,s)}),(function(e){t("throw",e,a,s)})):r.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return t("throw",e,a,s)}))}s(c.arg)}var n;o(this,"_invoke",{value:function(e,i){function o(){return new r((function(r,n){t(e,i,r,n)}))}return n=n?n.then(o,o):o()}})}function R(r,t,n){var i=d;return function(o,a){if(i===E)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var c=A(s,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===d)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=E;var u=p(r,t,n);if("normal"===u.type){if(i=n.done?v:h,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=v,n.method="throw",n.arg=u.arg)}}}function A(r,t){var n=t.method,i=r.iterator[n];if(i===e)return t.delegate=null,"throw"===n&&r.iterator.return&&(t.method="return",t.arg=e,A(r,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=p(i,r.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,m;var a=o.arg;return a?a.done?(t[r.resultName]=a.value,t.next=r.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,m):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,m)}function b(e){var r={tryLoc:e[0]};1 in e&&(r.catchLoc=e[1]),2 in e&&(r.finallyLoc=e[2],r.afterLoc=e[3]),this.tryEntries.push(r)}function C(e){var r=e.completion||{};r.type="normal",delete r.arg,e.completion=r}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(b,this),this.reset(!0)}function L(r){if(r||""===r){var t=r[s];if(t)return t.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var n=-1,o=function t(){for(;++n<r.length;)if(i.call(r,n))return t.value=r[n],t.done=!1,t;return t.value=e,t.done=!0,t};return o.next=o}}throw new TypeError(typeof r+" is not iterable")}return O.prototype=w,o(y,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:O,configurable:!0}),O.displayName=l(w,u,"GeneratorFunction"),r.isGeneratorFunction=function(e){var r="function"==typeof e&&e.constructor;return!!r&&(r===O||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,l(e,u,"GeneratorFunction")),e.prototype=Object.create(y),e},r.awrap=function(e){return{__await:e}},S(T.prototype),l(T.prototype,c,(function(){return this})),r.AsyncIterator=T,r.async=function(e,t,n,i,o){void 0===o&&(o=Promise);var a=new T(f(e,t,n,i),o);return r.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(y),l(y,u,"Generator"),l(y,s,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var r=Object(e),t=[];for(var n in r)t.push(n);return t.reverse(),function e(){for(;t.length;){var n=t.pop();if(n in r)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=L,N.prototype={constructor:N,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!r)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var t=this;function n(n,i){return s.type="throw",s.arg=r,t.next=n,i&&(t.method="next",t.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),u=i.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,r){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),m},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),C(t),m}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.tryLoc===e){var n=t.completion;if("throw"===n.type){var i=n.arg;C(t)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(r,t,n){return this.delegate={iterator:L(r),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=e),m}},r}function n(e){return n="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},n(e)}function i(e,r,t,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void t(e)}s.done?r(c):Promise.resolve(c).then(n,i)}function o(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var a=e.apply(r,t);function s(e){i(a,n,o,s,c,"next",e)}function c(e){i(a,n,o,s,c,"throw",e)}s(void 0)}))}}function a(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function s(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,g(n.key),n)}}function c(e,r,t){return r&&s(e.prototype,r),t&&s(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,r,t){return(r=g(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function l(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&p(e,r)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(e,r){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,r){return e.__proto__=r,e},p(e,r)}function d(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E(e){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=f(e);if(r){var i=f(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return function(e,r){if(r&&("object"==typeof r||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}(this,t)}}function v(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,i,o,a,s=[],c=!0,u=!1;try{if(o=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;c=!1}else for(;!(c=(n=o.call(t)).done)&&(s.push(n.value),s.length!==r);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return m(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return m(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function g(e){var r=function(e,r){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:String(r)}var O={CALLBACK_OPERATION_INVOKED:"CALLBACK_OPERATION_INVOKED",CONTENT_LOADED:"CONTENT_LOADED",EXPERIENCE_INITIALIZED:"EXPERIENCE_INITIALIZED",ERROR_OCCURRED:"ERROR_OCCURRED",SIZE_CHANGED:"SIZE_CHANGED",PARAMETERS_CHANGED:"PARAMETERS_CHANGED",SELECTED_SHEET_CHANGED:"SELECTED_SHEET_CHANGED",MODAL_OPENED:"MODAL_OPENED",Q_SEARCH_CLOSED:"Q_SEARCH_CLOSED",Q_SEARCH_OPENED:"Q_SEARCH_OPENED",Q_SEARCH_SIZE_CHANGED:"Q_SEARCH_SIZE_CHANGED",Q_SEARCH_ENTERED_FULLSCREEN:"Q_SEARCH_ENTERED_FULLSCREEN",Q_SEARCH_EXITED_FULLSCREEN:"Q_SEARCH_EXITED_FULLSCREEN"},w={FRAME_STARTED:"FRAME_STARTED",FRAME_MOUNTED:"FRAME_MOUNTED",FRAME_LOADED:"FRAME_LOADED",FRAME_REMOVED:"FRAME_REMOVED"},_={FRAME_NOT_CREATED:"FRAME_NOT_CREATED",NO_BODY:"NO_BODY",NO_CONTAINER:"NO_CONTAINER",INVALID_CONTAINER:"INVALID_CONTAINER",NO_URL:"NO_URL",INVALID_URL:"INVALID_URL",NO_FRAME_OPTIONS:"NO_FRAME_OPTIONS",INVALID_FRAME_OPTIONS:"INVALID_FRAME_OPTIONS"},x={UNRECOGNIZED_CONTENT_OPTIONS:"UNRECOGNIZED_CONTENT_OPTIONS",UNRECOGNIZED_FRAME_OPTIONS:"UNRECOGNIZED_FRAME_OPTIONS",UNRECOGNIZED_EVENT_TARGET:"UNRECOGNIZED_EVENT_TARGET"},I={SET_PARAMETERS:"SET_PARAMETERS",SET_SELECTED_SHEET_ID:"SET_SELECTED_SHEET_ID",SET_Q_SEARCH_QUESTION:"SET_Q_SEARCH_QUESTION",SET_VISUAL_ACTIONS:"SET_VISUAL_ACTIONS",SET_THEME:"SET_THEME",ADD_FILTER_GROUPS:"ADD_FILTER_GROUPS",UPDATE_FILTER_GROUPS:"UPDATE_FILTER_GROUPS",REMOVE_FILTER_GROUPS:"REMOVE_FILTER_GROUPS",ADD_VISUAL_ACTIONS:"ADD_VISUAL_ACTIONS",REMOVE_VISUAL_ACTIONS:"REMOVE_VISUAL_ACTIONS",SET_THEME_OVERRIDE:"SET_THEME_OVERRIDE"},y={GET_PARAMETERS:"GET_PARAMETERS",GET_SHEETS:"GET_SHEETS",GET_SHEET_VISUALS:"GET_SHEET_VISUALS",GET_VISUAL_ACTIONS:"GET_VISUAL_ACTIONS",GET_SELECTED_SHEET_ID:"GET_SELECTED_SHEET_ID",GET_FILTER_GROUPS_FOR_SHEET:"GET_FILTER_GROUPS_FOR_SHEET",GET_FILTER_GROUPS_FOR_VISUAL:"GET_FILTER_GROUPS_FOR_VISUAL"},S={ACKNOWLEDGE:"ACKNOWLEDGE",INITIATE_PRINT:"INITIATE_PRINT",NAVIGATE_TO_DASHBOARD:"NAVIGATE_TO_DASHBOARD",CLOSE_Q_SEARCH:"CLOSE_Q_SEARCH",UNDO:"UNDO",REDO:"REDO",RESET:"RESET",TOGGLE_BOOKMARKS_PANE:"TOGGLE_BOOKMARKS_PANE"},T=Object.freeze({__proto__:null,ErrorChangeEventName:_,GetterMessageEventName:y,InfoChangeEventName:w,InfoMessageEventName:O,InvokerMessageEventName:S,SetterMessageEventName:I,WarnChangeEventName:x}),R=r(r(r({},w),_),x),A=r(r(r(r({},O),I),y),S),b={ERROR:"ERROR",INFO:"INFO",WARN:"WARN"},C=Object.freeze({__proto__:null,ChangeEventLevel:b,ChangeEventName:R,MessageEventName:A}),N=Object.freeze({__proto__:null}),L=Object.freeze({__proto__:null}),D=Object.freeze({__proto__:null}),U=Object.freeze({__proto__:null}),M={CONSOLE:"CONSOLE",CONTEXT:"CONTEXT",CONTROL:"CONTROL",VISUAL:"VISUAL",DASHBOARD:"DASHBOARD",QSEARCH:"QSEARCH"},P=Object.freeze({__proto__:null,ExperienceType:M}),F=Object.freeze({__proto__:null}),k={NULL:null,OTHER_BUCKET:null},G={INTEGER:null,STRING:null,DECIMAL:null,DATETIME:null},V=Object.freeze({__proto__:null,CALCULATED_METRIC_COLUMN_TYPE:G,SPECIAL_DATAPOINT_VALUE_TYPES:k}),j=Object.freeze({__proto__:null}),H=Object.freeze({__proto__:null}),Q=Object.freeze({__proto__:null}),B=c((function e(r,t,n){a(this,e),this.eventName=r,this.message=t,this.data=n})),z=function(e){l(t,B);var r=E(t);function t(e,n,i,o){var s;return a(this,t),(s=r.call(this,e,i,o)).eventLevel=n,s}return c(t)}(),q=function(e){l(t,B);var r=E(t);function t(e,n,i){var o;return a(this,t),(o=r.call(this,e,n,i)).eventName=e,o}return c(t)}(),Z=function(e){l(t,q);var r=E(t);function t(e,n,i,o){var s;return a(this,t),(s=r.call(this,e,i,o)).eventTarget=n,s}return c(t)}(),K=function(e){l(t,Z);var r=E(t);function t(e,n,i,o,s,c,u){var l;return a(this,t),(l=r.call(this,e,n,c,u)).timestamp=o,l.version=s,l.eventId=i,l}return c(t)}(),W=c((function e(){a(this,e)})),X=c((function e(){a(this,e),u(this,"success",!0)})),Y=c((function e(r){a(this,e),u(this,"success",!1),this.errorCode=r.errorCode,this.error=r.error,this.message=r.message})),$=c((function e(r){a(this,e),u(this,"success",!0),this.message=r}));let J;const ee=new Uint8Array(16);function re(){if(!J&&(J="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!J))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return J(ee)}const te=[];for(let e=0;e<256;++e)te.push((e+256).toString(16).slice(1));var ne={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ie(e,r,t){if(ne.randomUUID&&!r&&!e)return ne.randomUUID();const n=(e=e||{}).random||(e.rng||re)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,r){t=t||0;for(let e=0;e<16;++e)r[t+e]=n[e];return r}return function(e,r=0){return te[e[r+0]]+te[e[r+1]]+te[e[r+2]]+te[e[r+3]]+"-"+te[e[r+4]]+te[e[r+5]]+"-"+te[e[r+6]]+te[e[r+7]]+"-"+te[e[r+8]]+te[e[r+9]]+"-"+te[e[r+10]]+te[e[r+11]]+te[e[r+12]]+te[e[r+13]]+te[e[r+14]]+te[e[r+15]]}(n)}var oe=c((function e(n,i,s,c){var l=this;a(this,e),u(this,"send",function(){var e=o(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l.experienceFrame&&l.internalExperience){e.next=2;break}throw new Error("Experience has not been initialized");case 2:return n=new Z(r.eventName,l.internalExperience,r.message,r.data),e.abrupt("return",l.experienceFrame.send(n));case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(this,"addEventListener",(function(e,r){return l.experienceFrame.addInternalEventListener(e,r)})),u(this,"setLogProvider",(function(e){return l.logger=e,l})),u(this,"getInternalExperienceInfo",(function(t){var n,i,o=-1;do{o++,n=r(r({},t),{},{contextId:l.controlOptions.contextId,discriminator:o}),i=e.getExperienceIdentifier(n)}while(l.experienceIdentifiers.has(i));return l.experienceIdentifiers.add(i),{experienceIdentifier:i,internalExperience:n}})),u(this,"transformContentOptions",(function(e,r){var t,n,i,o=Object.keys(r);Object.keys(r).length>0&&(null===(t=(n=l.frameOptions).onChange)||void 0===t||t.call(n,new z(R.UNRECOGNIZED_CONTENT_OPTIONS,b.WARN,"Experience content options contain unrecognized properties",{unrecognizedContentOptions:o}),{frame:null}),null===(i=l.logger)||void 0===i||i.warn("Experience content options contain unrecognized properties"));return e})),u(this,"validateFrameOptions",(function(){if(!l.frameOptions.url){var e,r,t="Url is required for the experience";throw null===(e=(r=l.frameOptions).onChange)||void 0===e||e.call(r,new z(R.NO_URL,b.ERROR,t),{frame:null}),new Error(t)}})),this.frameOptions=n,this.contentOptions=i,this.controlOptions=s,this.experienceIdentifiers=c,this.validateFrameOptions()}));u(oe,"getExperienceIdentifier",(function(e){if(e.experienceType===M.DASHBOARD)return[e.contextId,e.experienceType,e.dashboardId,e.discriminator].filter(Boolean).join("-");if(e.experienceType===M.VISUAL)return[e.contextId,e.experienceType,e.dashboardId,e.sheetId,e.visualId,e.discriminator].filter(Boolean).join("-");if([M.CONSOLE,M.CONTROL,M.CONTEXT,M.QSEARCH].includes(e.experienceType))return[e.contextId,e.experienceType,e.discriminator].filter(Boolean).join("-");throw new Error("Invalid experience unable to build experience identifier")}));const ae=2147483647,se={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ce=Math.floor,ue=String.fromCharCode;function le(e){throw new RangeError(se[e])}const fe=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},pe=function(e,r,t){let n=0;for(e=t?ce(e/700):e>>1,e+=ce(e/r);e>455;n+=36)e=ce(e/35);return ce(n+36*e/(e+38))},de=function(e){const r=[];e=function(e){const r=[];let t=0;const n=e.length;for(;t<n;){const i=e.charCodeAt(t++);if(i>=55296&&i<=56319&&t<n){const n=e.charCodeAt(t++);56320==(64512&n)?r.push(((1023&i)<<10)+(1023&n)+65536):(r.push(i),t--)}else r.push(i)}return r}(e);const t=e.length;let n=128,i=0,o=72;for(const t of e)t<128&&r.push(ue(t));const a=r.length;let s=a;for(a&&r.push("-");s<t;){let t=ae;for(const r of e)r>=n&&r<t&&(t=r);const c=s+1;t-n>ce((ae-i)/c)&&le("overflow"),i+=(t-n)*c,n=t;for(const t of e)if(t<n&&++i>ae&&le("overflow"),t===n){let e=i;for(let t=36;;t+=36){const n=t<=o?1:t>=o+26?26:t-o;if(e<n)break;const i=e-n,a=36-n;r.push(ue(fe(n+i%a,0))),e=ce(i/a)}r.push(ue(fe(e,0))),o=pe(i,c,s===a),i=0,++s}++i,++n}return r.join("")};var he=c((function e(r){var t=this;a(this,e),u(this,"classNames",[e.IFRAME_CLASS_NAME]),u(this,"getIframe",(function(){return t.iframe})),u(this,"createIframePlaceholder",(function(r){if(t.iframePlaceholder=document.createElement("div"),t.iframePlaceholder.id="".concat(t.iframeName,"-placeholder"),t.iframePlaceholder.style.width=t.width,t.iframePlaceholder.style.backgroundColor="rgba(0,0,0,.01)",t.iframePlaceholder.style.display="flex",t.iframePlaceholder.style.justifyContent="center",t.iframePlaceholder.style.alignItems="center",t.iframePlaceholder.className="".concat(e.IFRAME_CLASS_NAME,"-placeholder"),t.height.endsWith("px")&&(t.iframePlaceholder.style.height=t.height),r&&"boolean"!=typeof r)t.iframePlaceholder.appendChild(r);else{var n=t.createLoaderSVG();t.iframePlaceholder.appendChild(n)}t.container.appendChild(t.iframePlaceholder)})),u(this,"createIframe",(function(){var e=document.createElement("iframe");return e.className=t.classNames.join(" ").trim(),e.id=t.iframeName,e.name=t.iframeName,e.width=t.width,e.height=t.height,t.loading&&(e.loading=t.loading),e.style.border="0px",e.style.padding="0px",t.iframePlaceholder&&(e.style.opacity="0",e.style.position="absolute"),"0px"===t.width&&"0px"===t.height&&(e.style.position="absolute"),t.container.appendChild(e),t.payload?t.postRequest=t.createPostRequest({src:t.src,target:e.name,container:t.container,payload:t.payload}):e.src=t.src,e})),u(this,"onLoadLocal",(function(e){var r,n;t.iframePlaceholder&&(t.iframePlaceholder.remove(),t.iframe.style.position="",t.iframe.style.opacity="1",t.iframe.style.transition="opacity .5s ease-in-out"),null===(r=t.onLoad)||void 0===r||r.call(t,e),null===(n=t.postRequest)||void 0===n||n.remove()})),u(this,"createPostRequest",(function(e){var r=e.src,t=e.container,n=e.target,i=e.payload;if(!r)throw new Error("No source has been provided.");var o=document.createElement("form");return o.style.visibility="hidden",o.method="POST",o.action=r,o.target=n,o.name="".concat(n,"-form"),Object.keys(i).forEach((function(e){var r=document.createElement("input");r.type="hidden",r.name=e,r.value=i[e],o.appendChild(r)})),t.appendChild(o),null==o||o.submit(),{remove:function(){o.remove()}}})),u(this,"createSvgElement",(function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.entries(r).forEach((function(e){var r=v(e,2),t=r[0],n=r[1];return i.setAttribute(t,n)})),Object.entries(t).forEach((function(e){var r=v(e,2),t=r[0],n=r[1];return i.style.setProperty(t,n)})),n.forEach((function(e){return i.appendChild(e)})),i})),u(this,"createLoaderSVG",(function(){var e=[1,2,3].map((function(e){var r=t.createSvgElement("animate",{attributeName:"opacity",dur:"1s",values:"0;1;0",repeatCount:"indefinite",begin:"".concat(e/10)});return t.createSvgElement("circle",{fill:"#ccc",stroke:"none",cx:"".concat(20*e-14),cy:"50",r:"6"},void 0,[r])}));return t.createSvgElement("svg",{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100","enable-background":"new 0 0 0 0"},{width:"100px",height:"100px"},e)}));var n=r.id,i=r.src,o=r.width,s=void 0===o?"100%":o,c=r.height,l=void 0===c?"100%":c,f=r.container,p=r.onLoad,d=r.loading,h=r.withIframePlaceholder,E=r.payload,m=r.className;this.width=s,this.height=l,this.onLoad=p,this.iframeName=n,this.loading=d,m&&this.classNames.push(m),this.container=f,this.payload=E,this.src=i,h&&this.createIframePlaceholder(h),this.iframe=this.createIframe(),this.iframe.addEventListener("load",this.onLoadLocal)}));u(he,"IFRAME_CLASS_NAME","quicksight-embedding-iframe");var Ee="2.5.0",ve=c((function e(i,s,c,l,f,p,d){var h=this;a(this,e),u(this,"MESSAGE_RESPONSE_TIMEOUT",5e3),u(this,"iframe",null),u(this,"send",function(){var e=o(t().mark((function e(r){var n,i,o;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h.iframe){e.next=2;break}throw new Error("Cannot send ".concat(r.eventName,": No experience frame found"));case 2:if(i=ie(),o=new K(r.eventName,r.eventTarget,i,Date.now(),Ee,r.message,r.data),null===(n=h.iframe)||void 0===n||null===(n=n.contentWindow)||void 0===n||n.postMessage(o,h.url),r.eventName!==A.ACKNOWLEDGE){e.next=7;break}return e.abrupt("return",Promise.resolve(new X));case 7:return e.abrupt("return",new Promise((function(e,t){var n=function r(t){var n,o,a=t.data;(null==a?void 0:a.eventId)===i&&(window.removeEventListener("message",r),!0===(null===(n=a.message)||void 0===n?void 0:n.success)?e(new X):!1===(null===(o=a.message)||void 0===o?void 0:o.success)?e(new Y(a.message)):e(new $(a.message)))};window.addEventListener("message",n),setTimeout((function(){window.removeEventListener("message",n),t("".concat(r.eventName," timed out"))}),h.MESSAGE_RESPONSE_TIMEOUT)})));case 8:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(this,"buildParameterString",(function(e){return e&&"object"===n(e)?Object.entries(e).map((function(e){var r=v(e,2),t=r[0],n=r[1],i=Array.isArray(n)?n:[n],o=encodeURIComponent(t);return i.map(encodeURIComponent).map((function(e){return"p.".concat(o,"=").concat(e)})).join("&")})).join("&"):""})),u(this,"buildQueryString",(function(e){var t=Object.entries(e).reduce((function(e,t){var n=v(t,2),i=n[0],o=n[1];return null!=o?r(r({},e),{},u({},i,"".concat(o))):e}),{punyCodeEmbedOrigin:de("".concat(window.location.origin,"/")),sdkVersion:Ee});return new URLSearchParams(t).toString()})),u(this,"createExperienceIframe",(function(){h.onChange(new z(R.FRAME_STARTED,b.INFO,"Creating the frame",{experience:h.internalExperience}));try{h.setTimeoutInstance(),h.iframe=new he({id:h.experienceId,src:h.url,width:h.frameOptions.width,height:h.frameOptions.height,container:h.container,onLoad:h.onLoadHandler,withIframePlaceholder:h.frameOptions.withIframePlaceholder,className:h.frameOptions.className}).getIframe()}catch(e){throw h.onChange(new z(R.FRAME_NOT_CREATED,b.ERROR,"Failed to create the frame",{experience:h.internalExperience})),e}h.onChange(new z(R.FRAME_MOUNTED,b.INFO,"The frame mounted",{experience:h.internalExperience,frame:h.iframe}))})),u(this,"addInternalEventListener",(function(e,r){var t=function(t,n){t.eventName===e&&r(t,n)};return h.controlOptions.eventManager.addEventListener(h.experienceId,t,!0),{remove:function(){return h.controlOptions.eventManager.removeEventListener(h.experienceId,t)}}})),u(this,"validateBaseUrl",(function(e){if(!e)throw h.onChange(new z(R.NO_URL,b.ERROR,"Url is required for the experience",{experience:h.internalExperience})),new Error("Url is required for the experience");return e})),u(this,"setTimeoutInstance",(function(){h.timeoutInstance=setTimeout((function(){throw h.onChange(new z(R.FRAME_NOT_CREATED,b.ERROR,"Creating the frame timed out",{experience:h.internalExperience})),new Error("Creating the frame timed out")}),h.controlOptions.timeout)})),u(this,"onLoadHandler",o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h.timeoutInstance&&clearTimeout(h.timeoutInstance),h.onChange(new z(R.FRAME_LOADED,b.INFO,"The experience iframe loaded",{experience:h.internalExperience}));case 2:case"end":return e.stop()}}),e)})))),u(this,"getContainer",(function(e){if(!e){var r="Container is required for the experience";throw h.onChange(new z(R.NO_CONTAINER,b.ERROR,r,{experience:h.internalExperience})),new Error(r)}var t=null;if("string"==typeof e)try{t=document.querySelector(e)}catch(e){throw e instanceof Error&&h.onChange(new z(R.INVALID_CONTAINER,b.ERROR,e.message,{experience:h.internalExperience})),e}else"object"===n(e)&&e.nodeName&&(t=e);if(!t){var i="Invalid container '".concat(e,"' for the experience");throw h.onChange(new z(R.INVALID_CONTAINER,b.ERROR,i,{experience:h.internalExperience})),new Error(i)}return t})),u(this,"decorateOnChange",(function(e){return function(r){if(e){var t={frame:h.iframe};e(r,t)}}})),u(this,"decorateOnMessage",(function(e,r){return function(t){r&&h.iframe&&r(t,{frame:h.iframe}),e&&e(t,{frame:h.iframe})}})),u(this,"initializeMutationObserver",(function(){var e=new MutationObserver((function(r){r.some((function(e){return Array.from(e.removedNodes).some((function(e){return e===h.iframe||e===h.container}))}))&&(h.controlOptions.eventManager.cleanUpCallbacksForExperience(h.experienceId),e.disconnect(),h.iframe=null,h.onChange(new z(R.FRAME_REMOVED,b.INFO,"Frame removed from the DOM",{experience:h.internalExperience})))}));e.observe(document.body,{childList:!0,subtree:!0})})),this.frameOptions=i,this.contentOptions=c,this.onChange=this.decorateOnChange(i.onChange),this.onMessage=this.decorateOnMessage(c.onMessage,d),this.container=this.getContainer(i.container),this.internalExperience=f,this.controlOptions=s,this.transformedContentOptions=l,this.experienceId=p,this.url=this.validateBaseUrl(i.url),this.controlOptions.eventManager.addEventListener(this.experienceId,this.onMessage,!0),this.initializeMutationObserver()})),me=["parameters"],ge=function(e){l(n,ve);var t=E(n);function n(e,i,o,s,c,l,f){var p;return a(this,n),u(h(p=t.call(this,e,i,o,s,c,l,f)),"buildExperienceUrl",(function(e){var t=p.transformedContentOptions,n=t.parameters,i=d(t,me),o=p.internalExperience,a=o.contextId,s=o.discriminator;return[e,[p.buildQueryString(r(r({},i),{},{contextId:a,discriminator:s})),p.buildParameterString(n)].join("#")].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return c(n)}(),Oe=["fitToIframeWidth","locale","parameters","themeOptions","onMessage"],we=function(e){l(i,oe);var n=E(i);function i(e,s,c,l){var f;a(this,i),u(h(f=n.call(this,e,s,c,l)),"setParameters",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.SET_PARAMETERS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"reset",o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.RESET)));case 1:case"end":return e.stop()}}),e)})))),u(h(f),"addFilterGroups",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.ADD_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"updateFilterGroups",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.UPDATE_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"removeFilterGroups",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.REMOVE_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"getFilterGroups",o(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(A.GET_FILTER_GROUPS_FOR_VISUAL));case 2:if(r=e.sent,Array.isArray(null==r?void 0:r.message)){e.next=5;break}throw new Error("Failed to retrieve filter groups for the visual");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})))),u(h(f),"getActions",o(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(A.GET_VISUAL_ACTIONS));case 2:if(r=e.sent,Array.isArray(null==r?void 0:r.message)){e.next=5;break}throw new Error("Failed to retrieve the actions");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})))),u(h(f),"addActions",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.ADD_VISUAL_ACTIONS,{Actions:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"setActions",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.SET_VISUAL_ACTIONS,{Actions:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"removeActions",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.REMOVE_VISUAL_ACTIONS,{Actions:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"setTheme",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.SET_THEME,{ThemeArn:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"setThemeOverride",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.SET_THEME_OVERRIDE,{ThemeOverride:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"extractExperienceFromUrl",(function(e){var r,t,n=/^https:\/\/[^/]+\/embed\/[^/]+\/dashboards\/([\w-]+)\/sheets\/([\w-]+)\/visuals\/([\w-]+)(\?|$)/i.exec(e)||[];if(n.length<5)throw null===(r=(t=f.frameOptions).onChange)||void 0===r||r.call(t,new z(R.INVALID_URL,b.ERROR,"Invalid visual experience url",{url:e}),{frame:f.experienceFrame.iframe}),new Error("Invalid visual experience URL");return{experienceType:M.VISUAL,dashboardId:n[1],sheetId:n[2],visualId:n[3]}})),u(h(f),"interceptMessage",(function(e,r){var t,n,i;"SIZE_CHANGED"===e.eventName&&f.frameOptions.resizeHeightOnSizeChangedEvent&&(null==r||null===(t=r.frame)||void 0===t||null===(n=t.setAttribute)||void 0===n||n.call(t,"height","".concat(null===(i=e.message)||void 0===i?void 0:i.height,"px")))})),u(h(f),"transformVisualContentOptions",(function(e){var t=e.fitToIframeWidth,n=e.locale,i=e.parameters,o=e.themeOptions;e.onMessage;var a=d(e,Oe),s=f.transformContentOptions({fitToIframeWidth:null==t||t,locale:n},a);return Array.isArray(i)&&(s.parameters=i.reduce((function(e,t){return r(r({},e),{},u({},t.Name,t.Values))}),{})),null!=o&&o.themeArn&&(s.themeArn=o.themeArn),s})),f.experience=f.extractExperienceFromUrl(e.url);var p=f.getInternalExperienceInfo(f.experience),E=p.experienceIdentifier,v=p.internalExperience;return f.internalExperience=v,f.experienceId=E,f.experienceFrame=new ge(e,c,s,f.transformVisualContentOptions(s),v,E,f.interceptMessage),f}return c(i)}(),_e=function(e){l(n,ve);var t=E(n);function n(e,i,o,s,c,l,f){var p;return a(this,n),u(h(p=t.call(this,e,i,o,s,c,l,f)),"buildExperienceUrl",(function(e){var t=p.internalExperience,n=t.contextId,i=t.discriminator;return[e,p.buildQueryString(r(r({},p.transformedContentOptions),{},{contextId:n,discriminator:i}))].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return c(n)}(),xe=["locale","onMessage"],Ie=function(e){l(t,oe);var r=E(t);function t(e,n,i,o){var s;a(this,t),u(h(s=r.call(this,e,n,i,o)),"extractExperienceFromUrl",(function(e){var r,t;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/(start(\/(favorites|dashboards|analyses))?|dashboards\/[\w-]+|analyses\/[\w-]+)(\?|$)/i.exec(e)||[]).length<5)throw null===(r=(t=s.frameOptions).onChange)||void 0===r||r.call(t,new z(R.INVALID_URL,b.ERROR,"Invalid console experience url",{url:e}),{frame:s.experienceFrame.iframe}),new Error("Invalid console experience URL");return{experienceType:M.CONSOLE}})),s.experience=s.extractExperienceFromUrl(e.url);var c=s.getInternalExperienceInfo(s.experience),l=c.experienceIdentifier,f=c.internalExperience;s.internalExperience=f,s.experienceId=l;var p=n.locale;n.onMessage;var E=d(n,xe),v=s.transformContentOptions({locale:p},E);return s.experienceFrame=new _e(e,i,n,v,f,l),s}return c(t)}(),ye=["parameters"],Se=function(e){l(n,ve);var t=E(n);function n(e,i,o,s,c,l,f){var p;return a(this,n),u(h(p=t.call(this,e,i,o,s,c,l,f)),"buildExperienceUrl",(function(e){var t=p.transformedContentOptions,n=t.parameters,i=d(t,ye),o=p.internalExperience,a=o.contextId,s=o.discriminator;return[e,[p.buildQueryString(r(r({},i),{},{contextId:a,discriminator:s})),p.buildParameterString(n)].join("#")].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return c(n)}(),Te=["parameters","locale","attributionOptions","sheetOptions","toolbarOptions","themeOptions","onMessage"],Re=function(e){l(i,oe);var n=E(i);function i(e,s,c,l){var f;a(this,i),u(h(f=n.call(this,e,s,c,l)),"initiatePrint",o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.INITIATE_PRINT)));case 1:case"end":return e.stop()}}),e)})))),u(h(f),"undo",o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.UNDO)));case 1:case"end":return e.stop()}}),e)})))),u(h(f),"redo",o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.REDO)));case 1:case"end":return e.stop()}}),e)})))),u(h(f),"toggleBookmarksPane",o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.TOGGLE_BOOKMARKS_PANE)));case 1:case"end":return e.stop()}}),e)})))),u(h(f),"getParameters",o(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(A.GET_PARAMETERS));case 2:if(r=e.sent,Array.isArray(null==r?void 0:r.message)){e.next=5;break}throw new Error("Failed to retrieve the parameters");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})))),u(h(f),"getSheets",o(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(A.GET_SHEETS));case 2:if(r=e.sent,Array.isArray(null==r?void 0:r.message)){e.next=5;break}throw new Error("Failed to retrieve the sheets");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})))),u(h(f),"addFilterGroups",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.ADD_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"updateFilterGroups",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.UPDATE_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"removeFilterGroups",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.REMOVE_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"getFilterGroupsForSheet",function(){var e=o(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(A.GET_FILTER_GROUPS_FOR_SHEET,{SheetId:r}));case 2:if(n=e.sent,Array.isArray(null==n?void 0:n.message)){e.next=5;break}throw new Error("Failed to retrieve filter groups for the sheet");case 5:return e.abrupt("return",n.message);case 6:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"getFilterGroupsForVisual",function(){var e=o(t().mark((function e(r,n){var i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(A.GET_FILTER_GROUPS_FOR_VISUAL,{SheetId:r,VisualId:n}));case 2:if(i=e.sent,Array.isArray(null==i?void 0:i.message)){e.next=5;break}throw new Error("Failed to retrieve filter groups for the visual");case 5:return e.abrupt("return",i.message);case 6:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}()),u(h(f),"getVisualActions",function(){var e=o(t().mark((function e(r,n){var i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(A.GET_VISUAL_ACTIONS,{SheetId:r,VisualId:n}));case 2:if(i=e.sent,Array.isArray(null==i?void 0:i.message)){e.next=5;break}throw new Error("Failed to retrieve the visual actions");case 5:return e.abrupt("return",i.message);case 6:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}()),u(h(f),"addVisualActions",function(){var e=o(t().mark((function e(r,n,i){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.ADD_VISUAL_ACTIONS,{SheetId:r,VisualId:n,Actions:i})));case 1:case"end":return e.stop()}}),e)})));return function(r,t,n){return e.apply(this,arguments)}}()),u(h(f),"setVisualActions",function(){var e=o(t().mark((function e(r,n,i){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.SET_VISUAL_ACTIONS,{SheetId:r,VisualId:n,Actions:i})));case 1:case"end":return e.stop()}}),e)})));return function(r,t,n){return e.apply(this,arguments)}}()),u(h(f),"getSelectedSheetId",o(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(A.GET_SELECTED_SHEET_ID));case 2:if(null!=(r=e.sent)&&r.message){e.next=5;break}throw new Error("Failed to retrieve the selected sheet id");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})))),u(h(f),"setSelectedSheetId",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.SET_SELECTED_SHEET_ID,{SheetId:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"setTheme",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.SET_THEME,{ThemeArn:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"navigateToDashboard",function(){var e=o(t().mark((function e(r,n){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.NAVIGATE_TO_DASHBOARD,{DashboardId:r,Parameters:null==n?void 0:n.parameters})));case 1:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}()),u(h(f),"removeVisualActions",function(){var e=o(t().mark((function e(r,n,i){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.REMOVE_VISUAL_ACTIONS,{SheetId:r,VisualId:n,Actions:i})));case 1:case"end":return e.stop()}}),e)})));return function(r,t,n){return e.apply(this,arguments)}}()),u(h(f),"getSheetVisuals",function(){var e=o(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(A.GET_SHEET_VISUALS,{SheetId:r}));case 2:if(n=e.sent,Array.isArray(null==n?void 0:n.message)){e.next=5;break}throw new Error("Failed to retrieve the sheet visuals");case 5:return e.abrupt("return",n.message);case 6:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"setParameters",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.SET_PARAMETERS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"reset",o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.RESET)));case 1:case"end":return e.stop()}}),e)})))),u(h(f),"setThemeOverride",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.SET_THEME_OVERRIDE,{ThemeOverride:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"extractExperienceFromUrl",(function(e){var r,t,n=/^https:\/\/[^/]+\/embed\/[^/]+\/dashboards\/([\w-]+)(\?|$)/i.exec(e)||[];if(n.length<3)throw null===(r=(t=f.frameOptions).onChange)||void 0===r||r.call(t,new z(R.INVALID_URL,b.ERROR,"Invalid dashboard experience url",{url:e}),{frame:null}),new Error("Invalid dashboard experience URL");return{experienceType:M.DASHBOARD,dashboardId:n[1]}})),u(h(f),"interceptMessage",(function(e,r){var t,n,i;"SIZE_CHANGED"===e.eventName&&f.frameOptions.resizeHeightOnSizeChangedEvent&&(null==r||null===(t=r.frame)||void 0===t||null===(n=t.setAttribute)||void 0===n||n.call(t,"height","".concat(null==e||null===(i=e.message)||void 0===i?void 0:i.height,"px")))})),u(h(f),"transformDashboardContentOptions",(function(e){var t,n=e.parameters,i=e.locale,o=e.attributionOptions,a=e.sheetOptions,s=e.toolbarOptions,c=e.themeOptions;e.onMessage;var l=d(e,Te),p=f.transformContentOptions({locale:i},l);return Array.isArray(n)&&(p.parameters=n.reduce((function(e,t){return r(r({},e),{},u({},t.Name,t.Values))}),{})),!0!==(null==o?void 0:o.overlayContent)&&(p.footerPaddingEnabled=!0),(null!=s&&s.export||null!=s&&null!==(t=s.export)&&void 0!==t&&t.print)&&(p.printEnabled=!0),!0!==(null==s?void 0:s.undoRedo)&&(p.undoRedoDisabled=!0),!0!==(null==s?void 0:s.reset)&&(p.resetDisabled=!0),!0===(null==s?void 0:s.bookmarks)&&(p.showBookmarksIcon=!0),null!=a&&a.initialSheetId&&(p.sheetId=a.initialSheetId),"boolean"==typeof(null==a?void 0:a.singleSheet)&&(p.sheetTabsDisabled=a.singleSheet),null!=a&&a.emitSizeChangedEventOnSheetChange&&(p.resizeOnSheetChange=!0),null!=c&&c.themeArn&&(p.themeArn=c.themeArn),p})),f.experience=f.extractExperienceFromUrl(e.url);var p=f.getInternalExperienceInfo(f.experience),E=p.experienceIdentifier,v=p.internalExperience;return f.internalExperience=v,f.experienceId=E,f.experienceFrame=new Se(e,c,s,f.transformDashboardContentOptions(s),v,E,f.interceptMessage),f}return c(i)}(),Ae=function(e){l(n,ve);var t=E(n);function n(e,i,o,s,c,l,f){var p;return a(this,n),u(h(p=t.call(this,e,i,o,s,c,l,f)),"buildExperienceUrl",(function(e){var t=p.internalExperience,n=t.contextId,i=t.discriminator;return[e,p.buildQueryString(r(r({},p.transformedContentOptions),{},{contextId:n,discriminator:i}))].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return c(n)}(),be=["hideIcon","hideTopicName","theme","allowTopicSelection","onMessage"],Ce=function(e){l(i,oe);var r=E(i);function i(e,s,c,l){var f;a(this,i),u(h(f=r.call(this,e,s,c,l)),"close",(function(){return f.send(new q(A.CLOSE_Q_SEARCH))})),u(h(f),"setQuestion",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.SET_Q_SEARCH_QUESTION,{question:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"extractExperienceFromUrl",(function(e){var r,t;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/q\/search(\/|\?|$)/i.exec(e)||[]).length<2)throw null===(r=(t=f.frameOptions).onChange)||void 0===r||r.call(t,new z(R.INVALID_URL,b.ERROR,"Invalid q-search experience URL",{url:e}),{frame:f.experienceFrame.iframe}),new Error("Invalid q-search experience URL");return{experienceType:M.QSEARCH}})),u(h(f),"interceptMessage",(function(e,r){switch(e.eventName){case A.Q_SEARCH_OPENED:case A.Q_SEARCH_CLOSED:var t,o;if("object"===n(e.message))null==r||null===(t=r.frame)||void 0===t||t.style.setProperty("height","".concat(null==e||null===(o=e.message)||void 0===o?void 0:o.height,"px"));break;case A.CONTENT_LOADED:var a=function(e){var r;(null===(r=f.experienceFrame.iframe)||void 0===r||!r.contains(e.target))&&f.close()};window.addEventListener("click",a),f.controlOptions.eventManager.addEventListenerForCleanup(f.experienceId,(function(){return window.removeEventListener("click",a)}));break;case A.Q_SEARCH_ENTERED_FULLSCREEN:var s,c;if(!f.frameStyles&&null!=r&&r.frame)f.frameStyles={position:null===(s=r.frame)||void 0===s?void 0:s.style.position,top:null===(c=r.frame)||void 0===c?void 0:c.style.top,left:r.frame.style.left,zIndex:r.frame.style.zIndex,width:r.frame.style.width,height:r.frame.style.height},r.frame.style.position="fixed",r.frame.style.top="0px",r.frame.style.left="0px",r.frame.style.zIndex=i.MAX_Z_INDEX,r.frame.style.width="100vw",r.frame.style.height="100vh";break;case A.Q_SEARCH_EXITED_FULLSCREEN:f.frameStyles&&null!=r&&r.frame&&(r.frame.style.position=f.frameStyles.position,r.frame.style.top=f.frameStyles.top,r.frame.style.left=f.frameStyles.left,r.frame.style.zIndex=f.frameStyles.zIndex,r.frame.style.width=f.frameStyles.width,r.frame.style.height=f.frameStyles.height)}})),u(h(f),"transformQSearchContentOptions",(function(e){var r=e.hideIcon,t=e.hideTopicName,n=e.theme,i=e.allowTopicSelection;e.onMessage;var o=d(e,be),a=f.transformContentOptions({allowTopicSelection:i},o);return void 0!==r&&(a.qBarIconDisabled=r),void 0!==t&&(a.qBarTopicNameDisabled=t),void 0!==n&&(a.themeId=n),a})),f.experience=f.extractExperienceFromUrl(e.url);var p=f.getInternalExperienceInfo(f.experience),E=p.experienceIdentifier,v=p.internalExperience;return f.internalExperience=v,f.experienceId=E,f.experienceFrame=new Ae(e,c,s,f.transformQSearchContentOptions(s),v,E,f.interceptMessage),f}return c(i)}();u(Ce,"MAX_Z_INDEX","2147483647");var Ne=function(e){l(n,ve);var t=E(n);function n(e,i,o,s,c,l,f){var p;return a(this,n),u(h(p=t.call(this,e,i,o,s,c,l,f)),"buildExperienceUrl",(function(e){var t=p.internalExperience,n=t.contextId,i=t.discriminator;return[e,p.buildQueryString(r(r({},p.transformedContentOptions),{},{contextId:n,discriminator:i}))].join("?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return c(n)}(),Le=c((function e(t,n,i,o){var s=this;a(this,e),u(this,"experience",{experienceType:M.CONTROL}),u(this,"iframe",null),u(this,"send",(function(e){var r;return null===(r=s.internalSend)||void 0===r?void 0:r.call(s,e)})),u(this,"controlFrameMessageListener",(function(e){if(s.isMessageEvent(e.data)){var r=e.data;try{if(r.eventTarget){var t=oe.getExperienceIdentifier(r.eventTarget);s.eventManager.invokeEventListener(t,r)}s.sendAcknowledgment(r)}catch(e){var n,i;null===(n=s.onChange)||void 0===n||n.call(s,new z(R.UNRECOGNIZED_EVENT_TARGET,b.WARN,"Message with unrecognized event target received",{eventTarget:r.eventTarget}),{frame:s.iframe}),null===(i=s.logger)||void 0===i||i.warn("Message with unrecognized event target received")}}})),u(this,"setLogger",(function(e){return s.logger=e,s})),u(this,"initializeFrame",(function(){var r=s.getControlExperienceBaseUrl(),t=s.getControlExperienceId();s.onMessage&&s.eventManager.addEventListener(t,s.onMessage,!0);var n=new Ne({url:r,container:s.container,width:"0px",height:"0px",onChange:s.onChange},{eventManager:s.eventManager,contextId:s.internalExperience.contextId,timeout:e.FRAME_TIMEOUT,urlInfo:s.urlInfo},{onMessage:s.onMessage},{},s.internalExperience,t);s.internalSend=n.send,s.iframe=n.iframe,window.addEventListener("message",s.controlFrameMessageListener),s.eventManager.addEventListenerForCleanup(t,(function(){return window.removeEventListener("message",s.controlFrameMessageListener)}))})),u(this,"sendAcknowledgment",(function(e){var r,t,n=new Z(A.ACKNOWLEDGE,s.internalExperience,{eventName:e.eventName,eventTarget:e.eventTarget});(null===(r=(t=window).requestIdleCallback)||void 0===r?void 0:r.call(t,(function(){return s.send(n)})))||s.send(n)})),u(this,"getControlExperienceId",(function(){return[s.internalExperience.contextId,s.internalExperience.experienceType,s.internalExperience.discriminator].filter(Boolean).join("-")})),u(this,"getControlExperienceBaseUrl",(function(){var e=s.urlInfo,r=e.host,t=e.sessionId,n="".concat(r,"/embed/").concat(t,"/embedControl");return new URL(n).href})),u(this,"isMessageEvent",(function(e){return!!e&&!!e.eventTarget&&!!e.eventName})),this.container=t,this.eventManager=n.eventManager,this.urlInfo=n.urlInfo,this.internalExperience=r(r({},this.experience),{},{contextId:n.contextId,discriminator:0}),this.onMessage=o,this.onChange=i,this.initializeFrame()}));u(Le,"FRAME_TIMEOUT",6e4);var De=c((function e(){var r=this;a(this,e),u(this,"addEventListener",(function(e,t,n){if(!e)throw new Error("Experience identifier is required when calling addEventListener");if("function"!=typeof t)throw new Error("Invalid type provided for event listener");var i=r.eventListeners.get(e);return n&&r.addEventListenerForCleanup(e,(function(){return r.removeEventListener(e,t)})),i?(i.push(t),r):(r.eventListeners.set(e,[t]),r)})),u(this,"invokeEventListener",(function(e,t){var n=r.eventListeners.get(e);if(!n)throw new Error("Unable to find experience specific event listeners: ".concat(e));return n.forEach((function(e){e(t)})),r})),u(this,"removeEventListener",(function(e,t){var n=r.eventListeners.get(e);if(!n)throw new Error("Unable to find experience specific event listeners: ".concat(e));var i=n.filter((function(e){return e!==t}));return r.eventListeners.set(e,i),r})),u(this,"addEventListenerForCleanup",(function(e,t){var n,i=null!==(n=r.cleanUpCallbacks.get(e))&&void 0!==n?n:[];i.push(t),r.cleanUpCallbacks.set(e,i)})),u(this,"cleanUpCallbacksForExperience",(function(e){var t=r.cleanUpCallbacks.get(e);t&&(t.forEach((function(e){return e()})),r.cleanUpCallbacks.delete(e),r.eventListeners.set(e,[]))})),this.eventListeners=new Map,this.cleanUpCallbacks=new Map})),Ue=c((function e(){a(this,e),u(this,"log",console.log),u(this,"warn",console.warn),u(this,"error",console.error),u(this,"debug",console.debug),u(this,"info",console.info)})),Me=c((function e(r){var i=this;a(this,e),u(this,"embedVisual",function(){var e=o(t().mark((function e(r){var n,o,a=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},i.validateFrameOptions(r,"embedVisual"),o=i.buildControlOptions(r),e.abrupt("return",new we(r,n,o,i.experienceIdentifiers).setLogProvider(i.logger));case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(this,"embedDashboard",function(){var e=o(t().mark((function e(r){var n,o,a=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},i.validateFrameOptions(r,"embedDashboard"),o=i.buildControlOptions(r),e.abrupt("return",new Re(r,n,o,i.experienceIdentifiers).setLogProvider(i.logger));case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(this,"embedConsole",function(){var e=o(t().mark((function e(r){var n,o,a=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},i.validateFrameOptions(r,"embedConsole"),o=i.buildControlOptions(r),e.abrupt("return",new Ie(r,n,o,i.experienceIdentifiers).setLogProvider(i.logger));case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(this,"embedQSearchBar",function(){var e=o(t().mark((function e(r){var n,o,a=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},i.validateFrameOptions(r,"embedQSearchBar"),o=i.buildControlOptions(r),e.abrupt("return",new Ce(r,n,o,i.experienceIdentifiers).setLogProvider(i.logger));case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(this,"validateFrameOptions",(function(e,r){if(!e){var t="".concat(r," is called without frameOptions");throw i.onChange(new z(R.NO_FRAME_OPTIONS,b.ERROR,"".concat(r," is called without frameOptions"),{methodName:r}),{frame:null}),new Error(t)}if("object"!==n(e)||Array.isArray(e)){var o="".concat(r," is called with non-object frameOptions");throw i.onChange(new z(R.INVALID_FRAME_OPTIONS,b.ERROR,o,{methodName:r,frameOptionsType:Array.isArray(e)?"array":n(e)}),{frame:null}),new Error(o)}var a=["url","container","width","height","resizeHeightOnSizeChangedEvent","withIframePlaceholder","onChange","className"],s=Object.keys(e).filter((function(e){return!a.includes(e)}));if(s.length>0){var c,u,l="".concat(r," is called with unrecognized properties");null===(c=e.onChange)||void 0===c||c.call(e,new z(R.UNRECOGNIZED_FRAME_OPTIONS,b.WARN,l,{unrecognizedFrameOptions:s}),{frame:null}),null===(u=i.logger)||void 0===u||u.warn(l)}})),u(this,"buildControlOptions",(function(e){if(!i.controlOptions){if(!e.url)throw new Error("URL is missing in frame options, but is a required field");var r=i.getControlUrlInfo(e.url),t=new Le(i.getBodyElement(),{eventManager:i.eventManager,urlInfo:r,contextId:i.contextId},i.onChange).setLogger(i.logger);i.controlOptions={eventManager:i.eventManager,sendToControlFrame:t.send,contextId:i.contextId,timeout:Le.FRAME_TIMEOUT,urlInfo:r}}return i.controlOptions})),u(this,"onChange",(function(e,r){i.contextOnChange&&i.contextOnChange(e,r)})),u(this,"getControlUrlInfo",(function(e){var r=/^(https:\/\/[^/]+)\/(embedding|embed)\/([^/]+)\/[^?]+\?(.*)/i.exec(e)||[];if((null==r?void 0:r.length)<4)throw new Error('Invalid embedding url: "'.concat(e,'"'));return{sessionId:r[3],host:r[1],urlSearchParams:new URLSearchParams(r[4])}})),u(this,"getBodyElement",(function(){var e,r=null===(e=document.getElementsByTagName("body"))||void 0===e?void 0:e[0];if(!r){var t="could not locate <body> element in the page";throw i.onChange(new z(R.NO_BODY,b.ERROR,t),{frame:null}),new Error(t)}return r})),this.contextId=ie(),this.experienceIdentifiers=new Set,this.eventManager=new De,this.contextOnChange=r.onChange,this.logger=new Ue})),Pe=function(){var e=o(t().mark((function e(){var r,n=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>0&&void 0!==n[0]?n[0]:{},e.abrupt("return",new Me(r));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Fe=r(r(r(r(r(r(r(r(r(r(r(r({},U),T),C),N),L),D),P),F),V),H),j),Q);exports.BaseExperience=oe,exports.BaseExperienceFrame=ve,exports.CALCULATED_METRIC_COLUMN_TYPE=G,exports.ChangeEvent=z,exports.ChangeEventLevel=b,exports.ChangeEventName=R,exports.ConsoleExperience=Ie,exports.ConsoleExperienceFrame=_e,exports.ControlExperience=Le,exports.ControlExperienceFrame=Ne,exports.DashboardExperience=Re,exports.DashboardExperienceFrame=Se,exports.DataResponse=$,exports.DefaultLogger=Ue,exports.EmbeddingContext=Me,exports.EmbeddingEvent=B,exports.EmbeddingMessageEvent=q,exports.ErrorChangeEventName=_,exports.ErrorResponse=Y,exports.EventManager=De,exports.ExperienceType=M,exports.GetterMessageEventName=y,exports.Iframe=he,exports.InfoChangeEventName=w,exports.InfoMessageEventName=O,exports.InvokerMessageEventName=S,exports.MessageEventName=A,exports.PostMessageEvent=K,exports.QSE=Fe,exports.QSearchExperience=Ce,exports.QSearchExperienceFrame=Ae,exports.ResponseMessage=W,exports.SDK_VERSION=Ee,exports.SPECIAL_DATAPOINT_VALUE_TYPES=k,exports.SetterMessageEventName=I,exports.SuccessResponse=X,exports.TargetedMessageEvent=Z,exports.VisualExperience=we,exports.VisualExperienceFrame=ge,exports.WarnChangeEventName=x,exports.createEmbeddingContext=Pe; | ||
"use strict";function e(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function r(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?e(Object(n),!0).forEach((function(e){u(r,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}function t(){t=function(){return e};var e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,r,t){e[r]=t.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(e,r,t){return Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[r]}try{u({},"")}catch(e){u=function(e,r,t){return e[r]=t}}function l(e,r,t,n){var o=r&&r.prototype instanceof d?r:d,a=Object.create(o.prototype),s=new S(n||[]);return i(a,"_invoke",{value:I(e,t,s)}),a}function p(e,r,t){try{return{type:"normal",arg:e.call(r,t)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var f={};function d(){}function h(){}function E(){}var v={};u(v,a,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(R([])));g&&g!==r&&n.call(g,a)&&(v=g);var O=E.prototype=d.prototype=Object.create(v);function w(e){["next","throw","return"].forEach((function(r){u(e,r,(function(e){return this._invoke(r,e)}))}))}function _(e,r){function t(i,o,a,s){var c=p(e[i],e,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?r.resolve(l.__await).then((function(e){t("next",e,a,s)}),(function(e){t("throw",e,a,s)})):r.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return t("throw",e,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new r((function(r,i){t(e,n,r,i)}))}return o=o?o.then(i,i):i()}})}function I(e,r,t){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return A()}for(t.method=i,t.arg=o;;){var a=t.delegate;if(a){var s=x(a,t);if(s){if(s===f)continue;return s}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if("suspendedStart"===n)throw n="completed",t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);n="executing";var c=p(e,r,t);if("normal"===c.type){if(n=t.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:t.done}}"throw"===c.type&&(n="completed",t.method="throw",t.arg=c.arg)}}}function x(e,r){var t=r.method,n=e.iterator[t];if(void 0===n)return r.delegate=null,"throw"===t&&e.iterator.return&&(r.method="return",r.arg=void 0,x(e,r),"throw"===r.method)||"return"!==t&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+t+"' method")),f;var i=p(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,f;var o=i.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,f):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,f)}function y(e){var r={tryLoc:e[0]};1 in e&&(r.catchLoc=e[1]),2 in e&&(r.finallyLoc=e[2],r.afterLoc=e[3]),this.tryEntries.push(r)}function T(e){var r=e.completion||{};r.type="normal",delete r.arg,e.completion=r}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(y,this),this.reset(!0)}function R(e){if(e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var t=-1,i=function r(){for(;++t<e.length;)if(n.call(e,t))return r.value=e[t],r.done=!1,r;return r.value=void 0,r.done=!0,r};return i.next=i}}return{next:A}}function A(){return{value:void 0,done:!0}}return h.prototype=E,i(O,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:h,configurable:!0}),h.displayName=u(E,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var r="function"==typeof e&&e.constructor;return!!r&&(r===h||"GeneratorFunction"===(r.displayName||r.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,u(e,c,"GeneratorFunction")),e.prototype=Object.create(O),e},e.awrap=function(e){return{__await:e}},w(_.prototype),u(_.prototype,s,(function(){return this})),e.AsyncIterator=_,e.async=function(r,t,n,i,o){void 0===o&&(o=Promise);var a=new _(l(r,t,n,i),o);return e.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(O),u(O,c,"Generator"),u(O,a,(function(){return this})),u(O,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var r=Object(e),t=[];for(var n in r)t.push(n);return t.reverse(),function e(){for(;t.length;){var n=t.pop();if(n in r)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=R,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function t(t,n){return a.type="throw",a.arg=e,r.next=t,n&&(r.method="next",r.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(e,r){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),f},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),T(t),f}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.tryLoc===e){var n=t.completion;if("throw"===n.type){var i=n.arg;T(t)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,t){return this.delegate={iterator:R(e),resultName:r,nextLoc:t},"next"===this.method&&(this.arg=void 0),f}},e}function n(e){return n="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},n(e)}function i(e,r,t,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void t(e)}s.done?r(c):Promise.resolve(c).then(n,i)}function o(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var a=e.apply(r,t);function s(e){i(a,n,o,s,c,"next",e)}function c(e){i(a,n,o,s,c,"throw",e)}s(void 0)}))}}function a(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function s(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,g(n.key),n)}}function c(e,r,t){return r&&s(e.prototype,r),t&&s(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,r,t){return(r=g(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function l(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&f(e,r)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function f(e,r){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,r){return e.__proto__=r,e},f(e,r)}function d(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E(e){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=p(e);if(r){var i=p(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return function(e,r){if(r&&("object"==typeof r||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}(this,t)}}function v(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,i,o,a,s=[],c=!0,u=!1;try{if(o=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;c=!1}else for(;!(c=(n=o.call(t)).done)&&(s.push(n.value),s.length!==r);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return m(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return m(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function g(e){var r=function(e,r){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:String(r)}var O={CALLBACK_OPERATION_INVOKED:"CALLBACK_OPERATION_INVOKED",CONTENT_LOADED:"CONTENT_LOADED",EXPERIENCE_INITIALIZED:"EXPERIENCE_INITIALIZED",ERROR_OCCURRED:"ERROR_OCCURRED",SIZE_CHANGED:"SIZE_CHANGED",PARAMETERS_CHANGED:"PARAMETERS_CHANGED",SELECTED_SHEET_CHANGED:"SELECTED_SHEET_CHANGED",MODAL_OPENED:"MODAL_OPENED",Q_SEARCH_CLOSED:"Q_SEARCH_CLOSED",Q_SEARCH_OPENED:"Q_SEARCH_OPENED",Q_SEARCH_SIZE_CHANGED:"Q_SEARCH_SIZE_CHANGED",Q_SEARCH_ENTERED_FULLSCREEN:"Q_SEARCH_ENTERED_FULLSCREEN",Q_SEARCH_EXITED_FULLSCREEN:"Q_SEARCH_EXITED_FULLSCREEN"},w={FRAME_STARTED:"FRAME_STARTED",FRAME_MOUNTED:"FRAME_MOUNTED",FRAME_LOADED:"FRAME_LOADED",FRAME_REMOVED:"FRAME_REMOVED"},_={FRAME_NOT_CREATED:"FRAME_NOT_CREATED",NO_BODY:"NO_BODY",NO_CONTAINER:"NO_CONTAINER",INVALID_CONTAINER:"INVALID_CONTAINER",NO_URL:"NO_URL",INVALID_URL:"INVALID_URL",NO_FRAME_OPTIONS:"NO_FRAME_OPTIONS",INVALID_FRAME_OPTIONS:"INVALID_FRAME_OPTIONS"},I={UNRECOGNIZED_CONTENT_OPTIONS:"UNRECOGNIZED_CONTENT_OPTIONS",UNRECOGNIZED_FRAME_OPTIONS:"UNRECOGNIZED_FRAME_OPTIONS",UNRECOGNIZED_EVENT_TARGET:"UNRECOGNIZED_EVENT_TARGET"},x={SET_PARAMETERS:"SET_PARAMETERS",SET_SELECTED_SHEET_ID:"SET_SELECTED_SHEET_ID",SET_Q_SEARCH_QUESTION:"SET_Q_SEARCH_QUESTION",SET_VISUAL_ACTIONS:"SET_VISUAL_ACTIONS",SET_THEME:"SET_THEME",ADD_FILTER_GROUPS:"ADD_FILTER_GROUPS",UPDATE_FILTER_GROUPS:"UPDATE_FILTER_GROUPS",REMOVE_FILTER_GROUPS:"REMOVE_FILTER_GROUPS",ADD_VISUAL_ACTIONS:"ADD_VISUAL_ACTIONS",REMOVE_VISUAL_ACTIONS:"REMOVE_VISUAL_ACTIONS",SET_THEME_OVERRIDE:"SET_THEME_OVERRIDE",PRELOAD_THEMES:"PRELOAD_THEMES"},y={GET_PARAMETERS:"GET_PARAMETERS",GET_SHEETS:"GET_SHEETS",GET_SHEET_VISUALS:"GET_SHEET_VISUALS",GET_VISUAL_ACTIONS:"GET_VISUAL_ACTIONS",GET_SELECTED_SHEET_ID:"GET_SELECTED_SHEET_ID",GET_FILTER_GROUPS_FOR_SHEET:"GET_FILTER_GROUPS_FOR_SHEET",GET_FILTER_GROUPS_FOR_VISUAL:"GET_FILTER_GROUPS_FOR_VISUAL"},T={ACKNOWLEDGE:"ACKNOWLEDGE",INITIATE_PRINT:"INITIATE_PRINT",NAVIGATE_TO_DASHBOARD:"NAVIGATE_TO_DASHBOARD",CLOSE_Q_SEARCH:"CLOSE_Q_SEARCH",UNDO:"UNDO",REDO:"REDO",RESET:"RESET",TOGGLE_BOOKMARKS_PANE:"TOGGLE_BOOKMARKS_PANE"},S=Object.freeze({__proto__:null,ErrorChangeEventName:_,GetterMessageEventName:y,InfoChangeEventName:w,InfoMessageEventName:O,InvokerMessageEventName:T,SetterMessageEventName:x,WarnChangeEventName:I}),R=r(r(r({},w),_),I),A=r(r(r(r({},O),x),y),T),b={ERROR:"ERROR",INFO:"INFO",WARN:"WARN"},N=Object.freeze({__proto__:null,ChangeEventLevel:b,ChangeEventName:R,MessageEventName:A}),C=Object.freeze({__proto__:null}),L=Object.freeze({__proto__:null}),D=Object.freeze({__proto__:null}),M=Object.freeze({__proto__:null}),P={CONSOLE:"CONSOLE",CONTEXT:"CONTEXT",CONTROL:"CONTROL",VISUAL:"VISUAL",DASHBOARD:"DASHBOARD",QSEARCH:"QSEARCH"},U=Object.freeze({__proto__:null,ExperienceType:P}),F=Object.freeze({__proto__:null}),k={NULL:null,OTHER_BUCKET:null},G={INTEGER:null,STRING:null,DECIMAL:null,DATETIME:null},V=Object.freeze({__proto__:null,CALCULATED_METRIC_COLUMN_TYPE:G,SPECIAL_DATAPOINT_VALUE_TYPES:k}),j=Object.freeze({__proto__:null}),H=Object.freeze({__proto__:null}),Q=Object.freeze({__proto__:null}),B=c((function e(r,t,n){a(this,e),this.eventName=r,this.message=t,this.data=n})),z=function(e){l(t,B);var r=E(t);function t(e,n,i,o){var s;return a(this,t),(s=r.call(this,e,i,o)).eventLevel=n,s}return c(t)}(),Z=function(e){l(t,B);var r=E(t);function t(e,n,i){var o;return a(this,t),(o=r.call(this,e,n,i)).eventName=e,o}return c(t)}(),q=function(e){l(t,Z);var r=E(t);function t(e,n,i,o){var s;return a(this,t),(s=r.call(this,e,i,o)).eventTarget=n,s}return c(t)}(),K=function(e){l(t,q);var r=E(t);function t(e,n,i,o,s,c,u){var l;return a(this,t),(l=r.call(this,e,n,c,u)).timestamp=o,l.version=s,l.eventId=i,l}return c(t)}(),W=c((function e(){a(this,e)})),X=c((function e(){a(this,e),u(this,"success",!0)})),Y=c((function e(r){a(this,e),u(this,"success",!1),this.errorCode=r.errorCode,this.error=r.error,this.message=r.message})),$=c((function e(r){a(this,e),u(this,"success",!0),this.message=r}));let J;const ee=new Uint8Array(16);function re(){if(!J&&(J="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!J))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return J(ee)}const te=[];for(let e=0;e<256;++e)te.push((e+256).toString(16).slice(1));var ne={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ie(e,r,t){if(ne.randomUUID&&!r&&!e)return ne.randomUUID();const n=(e=e||{}).random||(e.rng||re)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,r){t=t||0;for(let e=0;e<16;++e)r[t+e]=n[e];return r}return function(e,r=0){return(te[e[r+0]]+te[e[r+1]]+te[e[r+2]]+te[e[r+3]]+"-"+te[e[r+4]]+te[e[r+5]]+"-"+te[e[r+6]]+te[e[r+7]]+"-"+te[e[r+8]]+te[e[r+9]]+"-"+te[e[r+10]]+te[e[r+11]]+te[e[r+12]]+te[e[r+13]]+te[e[r+14]]+te[e[r+15]]).toLowerCase()}(n)}var oe=c((function e(n,i,s,c){var l=this;a(this,e),u(this,"send",function(){var e=o(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l.experienceFrame&&l.internalExperience){e.next=2;break}throw new Error("Experience has not been initialized");case 2:return n=new q(r.eventName,l.internalExperience,r.message,r.data),e.abrupt("return",l.experienceFrame.send(n));case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(this,"addEventListener",(function(e,r){return l.experienceFrame.addInternalEventListener(e,r)})),u(this,"setLogProvider",(function(e){return l.logger=e,l})),u(this,"getInternalExperienceInfo",(function(t){var n,i,o=-1;do{o++,n=r(r({},t),{},{contextId:l.controlOptions.contextId,discriminator:o}),i=e.getExperienceIdentifier(n)}while(l.experienceIdentifiers.has(i));return l.experienceIdentifiers.add(i),{experienceIdentifier:i,internalExperience:n}})),u(this,"transformContentOptions",(function(e,r){var t,n,i,o=Object.keys(r);Object.keys(r).length>0&&(null===(t=(n=l.frameOptions).onChange)||void 0===t||t.call(n,new z(R.UNRECOGNIZED_CONTENT_OPTIONS,b.WARN,"Experience content options contain unrecognized properties",{unrecognizedContentOptions:o}),{frame:null}),null===(i=l.logger)||void 0===i||i.warn("Experience content options contain unrecognized properties"));return e})),u(this,"validateFrameOptions",(function(){if(!l.frameOptions.url){var e,r,t="Url is required for the experience";throw null===(e=(r=l.frameOptions).onChange)||void 0===e||e.call(r,new z(R.NO_URL,b.ERROR,t),{frame:null}),new Error(t)}})),this.frameOptions=n,this.contentOptions=i,this.controlOptions=s,this.experienceIdentifiers=c,this.validateFrameOptions()}));u(oe,"getExperienceIdentifier",(function(e){if(e.experienceType===P.DASHBOARD)return[e.contextId,e.experienceType,e.dashboardId,e.discriminator].filter(Boolean).join("-");if(e.experienceType===P.VISUAL)return[e.contextId,e.experienceType,e.dashboardId,e.sheetId,e.visualId,e.discriminator].filter(Boolean).join("-");if([P.CONSOLE,P.CONTROL,P.CONTEXT,P.QSEARCH].includes(e.experienceType))return[e.contextId,e.experienceType,e.discriminator].filter(Boolean).join("-");throw new Error("Invalid experience unable to build experience identifier")}));const ae=2147483647,se={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ce=Math.floor,ue=String.fromCharCode;function le(e){throw new RangeError(se[e])}const pe=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},fe=function(e,r,t){let n=0;for(e=t?ce(e/700):e>>1,e+=ce(e/r);e>455;n+=36)e=ce(e/35);return ce(n+36*e/(e+38))},de=function(e){const r=[];e=function(e){const r=[];let t=0;const n=e.length;for(;t<n;){const i=e.charCodeAt(t++);if(i>=55296&&i<=56319&&t<n){const n=e.charCodeAt(t++);56320==(64512&n)?r.push(((1023&i)<<10)+(1023&n)+65536):(r.push(i),t--)}else r.push(i)}return r}(e);const t=e.length;let n=128,i=0,o=72;for(const t of e)t<128&&r.push(ue(t));const a=r.length;let s=a;for(a&&r.push("-");s<t;){let t=ae;for(const r of e)r>=n&&r<t&&(t=r);const c=s+1;t-n>ce((ae-i)/c)&&le("overflow"),i+=(t-n)*c,n=t;for(const t of e)if(t<n&&++i>ae&&le("overflow"),t===n){let e=i;for(let t=36;;t+=36){const n=t<=o?1:t>=o+26?26:t-o;if(e<n)break;const i=e-n,a=36-n;r.push(ue(pe(n+i%a,0))),e=ce(i/a)}r.push(ue(pe(e,0))),o=fe(i,c,s===a),i=0,++s}++i,++n}return r.join("")};var he=c((function e(r){var t=this;a(this,e),u(this,"classNames",[e.IFRAME_CLASS_NAME]),u(this,"getIframe",(function(){return t.iframe})),u(this,"createIframePlaceholder",(function(r){if(t.iframePlaceholder=document.createElement("div"),t.iframePlaceholder.id="".concat(t.iframeName,"-placeholder"),t.iframePlaceholder.style.width=t.width,t.iframePlaceholder.style.backgroundColor="rgba(0,0,0,.01)",t.iframePlaceholder.style.display="flex",t.iframePlaceholder.style.justifyContent="center",t.iframePlaceholder.style.alignItems="center",t.iframePlaceholder.className="".concat(e.IFRAME_CLASS_NAME,"-placeholder"),t.height.endsWith("px")&&(t.iframePlaceholder.style.height=t.height),r&&"boolean"!=typeof r)t.iframePlaceholder.appendChild(r);else{var n=t.createLoaderSVG();t.iframePlaceholder.appendChild(n)}t.container.appendChild(t.iframePlaceholder)})),u(this,"createIframe",(function(){var e=document.createElement("iframe");return e.className=t.classNames.join(" ").trim(),e.id=t.iframeName,e.name=t.iframeName,e.width=t.width,e.height=t.height,t.loading&&(e.loading=t.loading),e.style.border="0px",e.style.padding="0px",t.iframePlaceholder&&(e.style.opacity="0",e.style.position="absolute"),"0px"===t.width&&"0px"===t.height&&(e.style.position="absolute"),t.container.appendChild(e),t.payload?t.postRequest=t.createPostRequest({src:t.src,target:e.name,container:t.container,payload:t.payload}):e.src=t.src,e})),u(this,"onLoadLocal",(function(e){var r,n;t.iframePlaceholder&&(t.iframePlaceholder.remove(),t.iframe.style.position="",t.iframe.style.opacity="1",t.iframe.style.transition="opacity .5s ease-in-out"),null===(r=t.onLoad)||void 0===r||r.call(t,e),null===(n=t.postRequest)||void 0===n||n.remove()})),u(this,"createPostRequest",(function(e){var r=e.src,t=e.container,n=e.target,i=e.payload;if(!r)throw new Error("No source has been provided.");var o=document.createElement("form");return o.style.visibility="hidden",o.method="POST",o.action=r,o.target=n,o.name="".concat(n,"-form"),Object.keys(i).forEach((function(e){var r=document.createElement("input");r.type="hidden",r.name=e,r.value=i[e],o.appendChild(r)})),t.appendChild(o),null==o||o.submit(),{remove:function(){o.remove()}}})),u(this,"createSvgElement",(function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.entries(r).forEach((function(e){var r=v(e,2),t=r[0],n=r[1];return i.setAttribute(t,n)})),Object.entries(t).forEach((function(e){var r=v(e,2),t=r[0],n=r[1];return i.style.setProperty(t,n)})),n.forEach((function(e){return i.appendChild(e)})),i})),u(this,"createLoaderSVG",(function(){var e=[1,2,3].map((function(e){var r=t.createSvgElement("animate",{attributeName:"opacity",dur:"1s",values:"0;1;0",repeatCount:"indefinite",begin:"".concat(e/10)});return t.createSvgElement("circle",{fill:"#ccc",stroke:"none",cx:"".concat(20*e-14),cy:"50",r:"6"},void 0,[r])}));return t.createSvgElement("svg",{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100","enable-background":"new 0 0 0 0"},{width:"100px",height:"100px"},e)}));var n=r.id,i=r.src,o=r.width,s=void 0===o?"100%":o,c=r.height,l=void 0===c?"100%":c,p=r.container,f=r.onLoad,d=r.loading,h=r.withIframePlaceholder,E=r.payload,m=r.className;this.width=s,this.height=l,this.onLoad=f,this.iframeName=n,this.loading=d,m&&this.classNames.push(m),this.container=p,this.payload=E,this.src=i,h&&this.createIframePlaceholder(h),this.iframe=this.createIframe(),this.iframe.addEventListener("load",this.onLoadLocal)}));u(he,"IFRAME_CLASS_NAME","quicksight-embedding-iframe");var Ee="2.6.0",ve=c((function e(i,s,c,l,p,f,d){var h=this;a(this,e),u(this,"MESSAGE_RESPONSE_TIMEOUT",5e3),u(this,"iframe",null),u(this,"send",function(){var e=o(t().mark((function e(r){var n,i,o;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h.iframe){e.next=2;break}throw new Error("Cannot send ".concat(r.eventName,": No experience frame found"));case 2:if(i=ie(),o=new K(r.eventName,r.eventTarget,i,Date.now(),Ee,r.message,r.data),null===(n=h.iframe)||void 0===n||null===(n=n.contentWindow)||void 0===n||n.postMessage(o,h.url),r.eventName!==A.ACKNOWLEDGE){e.next=7;break}return e.abrupt("return",Promise.resolve(new X));case 7:return e.abrupt("return",new Promise((function(e,t){var n=function r(t){var n,o,a=t.data;(null==a?void 0:a.eventId)===i&&(window.removeEventListener("message",r),!0===(null===(n=a.message)||void 0===n?void 0:n.success)?e(new X):!1===(null===(o=a.message)||void 0===o?void 0:o.success)?e(new Y(a.message)):e(new $(a.message)))};window.addEventListener("message",n),setTimeout((function(){window.removeEventListener("message",n),t("".concat(r.eventName," timed out"))}),h.MESSAGE_RESPONSE_TIMEOUT)})));case 8:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(this,"buildParameterString",(function(e){return e&&"object"===n(e)?Object.entries(e).map((function(e){var r=v(e,2),t=r[0],n=r[1],i=Array.isArray(n)?n:[n],o=encodeURIComponent(t);return i.map(encodeURIComponent).map((function(e){return"p.".concat(o,"=").concat(e)})).join("&")})).join("&"):""})),u(this,"buildQueryString",(function(e){var t=Object.entries(e).reduce((function(e,t){var n=v(t,2),i=n[0],o=n[1];return null!=o?r(r({},e),{},u({},i,"".concat(o))):e}),{punyCodeEmbedOrigin:de("".concat(window.location.origin,"/")),sdkVersion:Ee});return new URLSearchParams(t).toString()})),u(this,"createExperienceIframe",(function(){h.onChange(new z(R.FRAME_STARTED,b.INFO,"Creating the frame",{experience:h.internalExperience}));try{h.setTimeoutInstance(),h.iframe=new he({id:h.experienceId,src:h.url,width:h.frameOptions.width,height:h.frameOptions.height,container:h.container,onLoad:h.onLoadHandler,withIframePlaceholder:h.frameOptions.withIframePlaceholder,className:h.frameOptions.className}).getIframe()}catch(e){throw h.onChange(new z(R.FRAME_NOT_CREATED,b.ERROR,"Failed to create the frame",{experience:h.internalExperience})),e}h.onChange(new z(R.FRAME_MOUNTED,b.INFO,"The frame mounted",{experience:h.internalExperience,frame:h.iframe}))})),u(this,"addInternalEventListener",(function(e,r){var t=function(t,n){t.eventName===e&&r(t,n)};return h.controlOptions.eventManager.addEventListener(h.experienceId,t,!0),{remove:function(){return h.controlOptions.eventManager.removeEventListener(h.experienceId,t)}}})),u(this,"validateBaseUrl",(function(e){if(!e)throw h.onChange(new z(R.NO_URL,b.ERROR,"Url is required for the experience",{experience:h.internalExperience})),new Error("Url is required for the experience");return e})),u(this,"setTimeoutInstance",(function(){h.timeoutInstance=setTimeout((function(){throw h.onChange(new z(R.FRAME_NOT_CREATED,b.ERROR,"Creating the frame timed out",{experience:h.internalExperience})),new Error("Creating the frame timed out")}),h.controlOptions.timeout)})),u(this,"onLoadHandler",o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h.timeoutInstance&&clearTimeout(h.timeoutInstance),h.onChange(new z(R.FRAME_LOADED,b.INFO,"The experience iframe loaded",{experience:h.internalExperience}));case 2:case"end":return e.stop()}}),e)})))),u(this,"getContainer",(function(e){if(!e){var r="Container is required for the experience";throw h.onChange(new z(R.NO_CONTAINER,b.ERROR,r,{experience:h.internalExperience})),new Error(r)}var t=null;if("string"==typeof e)try{t=document.querySelector(e)}catch(e){throw e instanceof Error&&h.onChange(new z(R.INVALID_CONTAINER,b.ERROR,e.message,{experience:h.internalExperience})),e}else"object"===n(e)&&e.nodeName&&(t=e);if(!t){var i="Invalid container '".concat(e,"' for the experience");throw h.onChange(new z(R.INVALID_CONTAINER,b.ERROR,i,{experience:h.internalExperience})),new Error(i)}return t})),u(this,"decorateOnChange",(function(e){return function(r){if(e){var t={frame:h.iframe};e(r,t)}}})),u(this,"decorateOnMessage",(function(e,r){return function(t){r&&h.iframe&&r(t,{frame:h.iframe}),e&&e(t,{frame:h.iframe})}})),u(this,"initializeMutationObserver",(function(){var e=new MutationObserver((function(r){r.some((function(e){return Array.from(e.removedNodes).some((function(e){return e===h.iframe||e===h.container}))}))&&(h.controlOptions.eventManager.cleanUpCallbacksForExperience(h.experienceId),e.disconnect(),h.iframe=null,h.onChange(new z(R.FRAME_REMOVED,b.INFO,"Frame removed from the DOM",{experience:h.internalExperience})))}));e.observe(document.body,{childList:!0,subtree:!0})})),this.frameOptions=i,this.contentOptions=c,this.onChange=this.decorateOnChange(i.onChange),this.onMessage=this.decorateOnMessage(c.onMessage,d),this.container=this.getContainer(i.container),this.internalExperience=p,this.controlOptions=s,this.transformedContentOptions=l,this.experienceId=f,this.url=this.validateBaseUrl(i.url),this.controlOptions.eventManager.addEventListener(this.experienceId,this.onMessage,!0),this.initializeMutationObserver()})),me=["parameters"],ge=function(e){l(n,ve);var t=E(n);function n(e,i,o,s,c,l,p){var f;return a(this,n),u(h(f=t.call(this,e,i,o,s,c,l,p)),"buildExperienceUrl",(function(e){var t=f.transformedContentOptions,n=t.parameters,i=d(t,me),o=f.internalExperience,a=o.contextId,s=o.discriminator;return[e,[f.buildQueryString(r(r({},i),{},{contextId:a,discriminator:s})),f.buildParameterString(n)].join("#")].join(e.includes("?")?"&":"?")})),f.url=f.buildExperienceUrl(e.url),f.createExperienceIframe(),f}return c(n)}(),Oe=["fitToIframeWidth","locale","parameters","themeOptions","onMessage"],we=function(e){l(i,oe);var n=E(i);function i(e,s,c,l){var p;a(this,i),u(h(p=n.call(this,e,s,c,l)),"setParameters",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.SET_PARAMETERS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(p),"reset",o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.RESET)));case 1:case"end":return e.stop()}}),e)})))),u(h(p),"addFilterGroups",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.ADD_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(p),"updateFilterGroups",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.UPDATE_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(p),"removeFilterGroups",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.REMOVE_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(p),"getFilterGroups",o(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.send(new Z(A.GET_FILTER_GROUPS_FOR_VISUAL));case 2:if(r=e.sent,Array.isArray(null==r?void 0:r.message)){e.next=5;break}throw new Error("Failed to retrieve filter groups for the visual");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})))),u(h(p),"getActions",o(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.send(new Z(A.GET_VISUAL_ACTIONS));case 2:if(r=e.sent,Array.isArray(null==r?void 0:r.message)){e.next=5;break}throw new Error("Failed to retrieve the actions");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})))),u(h(p),"addActions",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.ADD_VISUAL_ACTIONS,{Actions:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(p),"setActions",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.SET_VISUAL_ACTIONS,{Actions:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(p),"removeActions",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.REMOVE_VISUAL_ACTIONS,{Actions:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(p),"setTheme",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.SET_THEME,{ThemeArn:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(p),"setThemeOverride",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.SET_THEME_OVERRIDE,{ThemeOverride:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(p),"setPreloadThemes",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.PRELOAD_THEMES,{PreloadThemes:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(p),"extractExperienceFromUrl",(function(e){var r,t,n=/^https:\/\/[^/]+\/embed\/[^/]+\/dashboards\/([\w-]+)\/sheets\/([\w-]+)\/visuals\/([\w-]+)(\?|$)/i.exec(e)||[];if(n.length<5)throw null===(r=(t=p.frameOptions).onChange)||void 0===r||r.call(t,new z(R.INVALID_URL,b.ERROR,"Invalid visual experience url",{url:e}),{frame:p.experienceFrame.iframe}),new Error("Invalid visual experience URL");return{experienceType:P.VISUAL,dashboardId:n[1],sheetId:n[2],visualId:n[3]}})),u(h(p),"interceptMessage",(function(e,r){var t,n,i,o,a;"SIZE_CHANGED"===e.eventName&&p.frameOptions.resizeHeightOnSizeChangedEvent&&(null==r||null===(i=r.frame)||void 0===i||null===(o=i.setAttribute)||void 0===o||o.call(i,"height","".concat(null===(a=e.message)||void 0===a?void 0:a.height,"px")));"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(t=p.contentOptions)&&void 0!==t&&null!==(t=t.themeOptions)&&void 0!==t&&t.themeOverride&&p.setThemeOverride(p.contentOptions.themeOptions.themeOverride),"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(n=p.contentOptions)&&void 0!==n&&null!==(n=n.themeOptions)&&void 0!==n&&n.preloadThemes&&p.setPreloadThemes(p.contentOptions.themeOptions.preloadThemes)})),u(h(p),"transformVisualContentOptions",(function(e){var t=e.fitToIframeWidth,n=e.locale,i=e.parameters,o=e.themeOptions;e.onMessage;var a=d(e,Oe),s=p.transformContentOptions({fitToIframeWidth:null==t||t,locale:n},a);return Array.isArray(i)&&(s.parameters=i.reduce((function(e,t){return r(r({},e),{},u({},t.Name,t.Values))}),{})),null!=o&&o.themeArn&&(s.themeArn=o.themeArn),s})),p.experience=p.extractExperienceFromUrl(e.url);var f=p.getInternalExperienceInfo(p.experience),E=f.experienceIdentifier,v=f.internalExperience;return p.internalExperience=v,p.experienceId=E,p.experienceFrame=new ge(e,c,s,p.transformVisualContentOptions(s),v,E,p.interceptMessage),p}return c(i)}(),_e=function(e){l(n,ve);var t=E(n);function n(e,i,o,s,c,l,p){var f;return a(this,n),u(h(f=t.call(this,e,i,o,s,c,l,p)),"buildExperienceUrl",(function(e){var t=f.internalExperience,n=t.contextId,i=t.discriminator;return[e,f.buildQueryString(r(r({},f.transformedContentOptions),{},{contextId:n,discriminator:i}))].join(e.includes("?")?"&":"?")})),f.url=f.buildExperienceUrl(e.url),f.createExperienceIframe(),f}return c(n)}(),Ie=["locale","onMessage"],xe=function(e){l(t,oe);var r=E(t);function t(e,n,i,o){var s;a(this,t),u(h(s=r.call(this,e,n,i,o)),"extractExperienceFromUrl",(function(e){var r,t;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/(start(\/(favorites|dashboards|analyses))?|dashboards\/[\w-]+|analyses\/[\w-]+)(\?|$)/i.exec(e)||[]).length<5)throw null===(r=(t=s.frameOptions).onChange)||void 0===r||r.call(t,new z(R.INVALID_URL,b.ERROR,"Invalid console experience url",{url:e}),{frame:s.experienceFrame.iframe}),new Error("Invalid console experience URL");return{experienceType:P.CONSOLE}})),s.experience=s.extractExperienceFromUrl(e.url);var c=s.getInternalExperienceInfo(s.experience),l=c.experienceIdentifier,p=c.internalExperience;s.internalExperience=p,s.experienceId=l;var f=n.locale;n.onMessage;var E=d(n,Ie),v=s.transformContentOptions({locale:f},E);return s.experienceFrame=new _e(e,i,n,v,p,l),s}return c(t)}(),ye=["parameters"],Te=function(e){l(n,ve);var t=E(n);function n(e,i,o,s,c,l,p){var f;return a(this,n),u(h(f=t.call(this,e,i,o,s,c,l,p)),"buildExperienceUrl",(function(e){var t=f.transformedContentOptions,n=t.parameters,i=d(t,ye),o=f.internalExperience,a=o.contextId,s=o.discriminator;return[e,[f.buildQueryString(r(r({},i),{},{contextId:a,discriminator:s})),f.buildParameterString(n)].join("#")].join(e.includes("?")?"&":"?")})),f.url=f.buildExperienceUrl(e.url),f.createExperienceIframe(),f}return c(n)}(),Se=["parameters","locale","attributionOptions","sheetOptions","toolbarOptions","themeOptions","onMessage"],Re=function(e){l(i,oe);var n=E(i);function i(e,s,c,l){var p;a(this,i),u(h(p=n.call(this,e,s,c,l)),"initiatePrint",o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.INITIATE_PRINT)));case 1:case"end":return e.stop()}}),e)})))),u(h(p),"undo",o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.UNDO)));case 1:case"end":return e.stop()}}),e)})))),u(h(p),"redo",o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.REDO)));case 1:case"end":return e.stop()}}),e)})))),u(h(p),"toggleBookmarksPane",o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.TOGGLE_BOOKMARKS_PANE)));case 1:case"end":return e.stop()}}),e)})))),u(h(p),"getParameters",o(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.send(new Z(A.GET_PARAMETERS));case 2:if(r=e.sent,Array.isArray(null==r?void 0:r.message)){e.next=5;break}throw new Error("Failed to retrieve the parameters");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})))),u(h(p),"getSheets",o(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.send(new Z(A.GET_SHEETS));case 2:if(r=e.sent,Array.isArray(null==r?void 0:r.message)){e.next=5;break}throw new Error("Failed to retrieve the sheets");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})))),u(h(p),"addFilterGroups",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.ADD_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(p),"updateFilterGroups",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.UPDATE_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(p),"removeFilterGroups",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.REMOVE_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(p),"getFilterGroupsForSheet",function(){var e=o(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.send(new Z(A.GET_FILTER_GROUPS_FOR_SHEET,{SheetId:r}));case 2:if(n=e.sent,Array.isArray(null==n?void 0:n.message)){e.next=5;break}throw new Error("Failed to retrieve filter groups for the sheet");case 5:return e.abrupt("return",n.message);case 6:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(p),"getFilterGroupsForVisual",function(){var e=o(t().mark((function e(r,n){var i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.send(new Z(A.GET_FILTER_GROUPS_FOR_VISUAL,{SheetId:r,VisualId:n}));case 2:if(i=e.sent,Array.isArray(null==i?void 0:i.message)){e.next=5;break}throw new Error("Failed to retrieve filter groups for the visual");case 5:return e.abrupt("return",i.message);case 6:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}()),u(h(p),"getVisualActions",function(){var e=o(t().mark((function e(r,n){var i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.send(new Z(A.GET_VISUAL_ACTIONS,{SheetId:r,VisualId:n}));case 2:if(i=e.sent,Array.isArray(null==i?void 0:i.message)){e.next=5;break}throw new Error("Failed to retrieve the visual actions");case 5:return e.abrupt("return",i.message);case 6:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}()),u(h(p),"addVisualActions",function(){var e=o(t().mark((function e(r,n,i){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.ADD_VISUAL_ACTIONS,{SheetId:r,VisualId:n,Actions:i})));case 1:case"end":return e.stop()}}),e)})));return function(r,t,n){return e.apply(this,arguments)}}()),u(h(p),"setVisualActions",function(){var e=o(t().mark((function e(r,n,i){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.SET_VISUAL_ACTIONS,{SheetId:r,VisualId:n,Actions:i})));case 1:case"end":return e.stop()}}),e)})));return function(r,t,n){return e.apply(this,arguments)}}()),u(h(p),"getSelectedSheetId",o(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.send(new Z(A.GET_SELECTED_SHEET_ID));case 2:if(null!=(r=e.sent)&&r.message){e.next=5;break}throw new Error("Failed to retrieve the selected sheet id");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})))),u(h(p),"setSelectedSheetId",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.SET_SELECTED_SHEET_ID,{SheetId:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(p),"setTheme",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.SET_THEME,{ThemeArn:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(p),"navigateToDashboard",function(){var e=o(t().mark((function e(r,n){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.NAVIGATE_TO_DASHBOARD,{DashboardId:r,Parameters:null==n?void 0:n.parameters})));case 1:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}()),u(h(p),"removeVisualActions",function(){var e=o(t().mark((function e(r,n,i){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.REMOVE_VISUAL_ACTIONS,{SheetId:r,VisualId:n,Actions:i})));case 1:case"end":return e.stop()}}),e)})));return function(r,t,n){return e.apply(this,arguments)}}()),u(h(p),"getSheetVisuals",function(){var e=o(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.send(new Z(A.GET_SHEET_VISUALS,{SheetId:r}));case 2:if(n=e.sent,Array.isArray(null==n?void 0:n.message)){e.next=5;break}throw new Error("Failed to retrieve the sheet visuals");case 5:return e.abrupt("return",n.message);case 6:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(p),"setParameters",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.SET_PARAMETERS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(p),"reset",o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.RESET)));case 1:case"end":return e.stop()}}),e)})))),u(h(p),"setThemeOverride",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.SET_THEME_OVERRIDE,{ThemeOverride:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(p),"setPreloadThemes",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.PRELOAD_THEMES,{PreloadThemes:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(p),"extractExperienceFromUrl",(function(e){var r,t,n=/^https:\/\/[^/]+\/embed\/[^/]+\/dashboards\/([\w-]+)(\?|$)/i.exec(e)||[];if(n.length<3)throw null===(r=(t=p.frameOptions).onChange)||void 0===r||r.call(t,new z(R.INVALID_URL,b.ERROR,"Invalid dashboard experience url",{url:e}),{frame:null}),new Error("Invalid dashboard experience URL");return{experienceType:P.DASHBOARD,dashboardId:n[1]}})),u(h(p),"interceptMessage",(function(e,r){var t,n,i,o,a;"SIZE_CHANGED"===e.eventName&&p.frameOptions.resizeHeightOnSizeChangedEvent&&(null==r||null===(i=r.frame)||void 0===i||null===(o=i.setAttribute)||void 0===o||o.call(i,"height","".concat(null==e||null===(a=e.message)||void 0===a?void 0:a.height,"px")));"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(t=p.contentOptions)&&void 0!==t&&null!==(t=t.themeOptions)&&void 0!==t&&t.themeOverride&&p.setThemeOverride(p.contentOptions.themeOptions.themeOverride),"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(n=p.contentOptions)&&void 0!==n&&null!==(n=n.themeOptions)&&void 0!==n&&n.preloadThemes&&p.setPreloadThemes(p.contentOptions.themeOptions.preloadThemes)})),u(h(p),"transformDashboardContentOptions",(function(e){var t,n=e.parameters,i=e.locale,o=e.attributionOptions,a=e.sheetOptions,s=e.toolbarOptions,c=e.themeOptions;e.onMessage;var l=d(e,Se),f=p.transformContentOptions({locale:i},l);return Array.isArray(n)&&(f.parameters=n.reduce((function(e,t){return r(r({},e),{},u({},t.Name,t.Values))}),{})),!0!==(null==o?void 0:o.overlayContent)&&(f.footerPaddingEnabled=!0),(null!=s&&s.export||null!=s&&null!==(t=s.export)&&void 0!==t&&t.print)&&(f.printEnabled=!0),!0!==(null==s?void 0:s.undoRedo)&&(f.undoRedoDisabled=!0),!0!==(null==s?void 0:s.reset)&&(f.resetDisabled=!0),!0===(null==s?void 0:s.bookmarks)&&(f.showBookmarksIcon=!0),null!=a&&a.initialSheetId&&(f.sheetId=a.initialSheetId),"boolean"==typeof(null==a?void 0:a.singleSheet)&&(f.sheetTabsDisabled=a.singleSheet),null!=a&&a.emitSizeChangedEventOnSheetChange&&(f.resizeOnSheetChange=!0),null!=c&&c.themeArn&&(f.themeArn=c.themeArn),f})),p.experience=p.extractExperienceFromUrl(e.url);var f=p.getInternalExperienceInfo(p.experience),E=f.experienceIdentifier,v=f.internalExperience;return p.internalExperience=v,p.experienceId=E,p.experienceFrame=new Te(e,c,s,p.transformDashboardContentOptions(s),v,E,p.interceptMessage),p}return c(i)}(),Ae=function(e){l(n,ve);var t=E(n);function n(e,i,o,s,c,l,p){var f;return a(this,n),u(h(f=t.call(this,e,i,o,s,c,l,p)),"buildExperienceUrl",(function(e){var t=f.internalExperience,n=t.contextId,i=t.discriminator;return[e,f.buildQueryString(r(r({},f.transformedContentOptions),{},{contextId:n,discriminator:i}))].join(e.includes("?")?"&":"?")})),f.url=f.buildExperienceUrl(e.url),f.createExperienceIframe(),f}return c(n)}(),be=["hideIcon","hideTopicName","theme","allowTopicSelection","onMessage"],Ne=function(e){l(i,oe);var r=E(i);function i(e,s,c,l){var p;a(this,i),u(h(p=r.call(this,e,s,c,l)),"close",(function(){return p.send(new Z(A.CLOSE_Q_SEARCH))})),u(h(p),"setQuestion",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.send(new Z(A.SET_Q_SEARCH_QUESTION,{question:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(p),"extractExperienceFromUrl",(function(e){var r,t;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/q\/search(\/|\?|$)/i.exec(e)||[]).length<2)throw null===(r=(t=p.frameOptions).onChange)||void 0===r||r.call(t,new z(R.INVALID_URL,b.ERROR,"Invalid q-search experience URL",{url:e}),{frame:p.experienceFrame.iframe}),new Error("Invalid q-search experience URL");return{experienceType:P.QSEARCH}})),u(h(p),"interceptMessage",(function(e,r){switch(e.eventName){case A.Q_SEARCH_OPENED:case A.Q_SEARCH_CLOSED:var t,o;if("object"===n(e.message))null==r||null===(t=r.frame)||void 0===t||t.style.setProperty("height","".concat(null==e||null===(o=e.message)||void 0===o?void 0:o.height,"px"));break;case A.CONTENT_LOADED:var a=function(e){var r;(null===(r=p.experienceFrame.iframe)||void 0===r||!r.contains(e.target))&&p.close()};window.addEventListener("click",a),p.controlOptions.eventManager.addEventListenerForCleanup(p.experienceId,(function(){return window.removeEventListener("click",a)}));break;case A.Q_SEARCH_ENTERED_FULLSCREEN:var s,c;if(!p.frameStyles&&null!=r&&r.frame)p.frameStyles={position:null===(s=r.frame)||void 0===s?void 0:s.style.position,top:null===(c=r.frame)||void 0===c?void 0:c.style.top,left:r.frame.style.left,zIndex:r.frame.style.zIndex,width:r.frame.style.width,height:r.frame.style.height},r.frame.style.position="fixed",r.frame.style.top="0px",r.frame.style.left="0px",r.frame.style.zIndex=i.MAX_Z_INDEX,r.frame.style.width="100vw",r.frame.style.height="100vh";break;case A.Q_SEARCH_EXITED_FULLSCREEN:p.frameStyles&&null!=r&&r.frame&&(r.frame.style.position=p.frameStyles.position,r.frame.style.top=p.frameStyles.top,r.frame.style.left=p.frameStyles.left,r.frame.style.zIndex=p.frameStyles.zIndex,r.frame.style.width=p.frameStyles.width,r.frame.style.height=p.frameStyles.height)}})),u(h(p),"transformQSearchContentOptions",(function(e){var r=e.hideIcon,t=e.hideTopicName,n=e.theme,i=e.allowTopicSelection;e.onMessage;var o=d(e,be),a=p.transformContentOptions({allowTopicSelection:i},o);return void 0!==r&&(a.qBarIconDisabled=r),void 0!==t&&(a.qBarTopicNameDisabled=t),void 0!==n&&(a.themeId=n),a})),p.experience=p.extractExperienceFromUrl(e.url);var f=p.getInternalExperienceInfo(p.experience),E=f.experienceIdentifier,v=f.internalExperience;return p.internalExperience=v,p.experienceId=E,p.experienceFrame=new Ae(e,c,s,p.transformQSearchContentOptions(s),v,E,p.interceptMessage),p}return c(i)}();u(Ne,"MAX_Z_INDEX","2147483647");var Ce=function(e){l(n,ve);var t=E(n);function n(e,i,o,s,c,l,p){var f;return a(this,n),u(h(f=t.call(this,e,i,o,s,c,l,p)),"buildExperienceUrl",(function(e){var t=f.internalExperience,n=t.contextId,i=t.discriminator;return[e,f.buildQueryString(r(r({},f.transformedContentOptions),{},{contextId:n,discriminator:i}))].join("?")})),f.url=f.buildExperienceUrl(e.url),f.createExperienceIframe(),f}return c(n)}(),Le=c((function e(t,n,i,o){var s=this;a(this,e),u(this,"experience",{experienceType:P.CONTROL}),u(this,"iframe",null),u(this,"send",(function(e){var r;return null===(r=s.internalSend)||void 0===r?void 0:r.call(s,e)})),u(this,"controlFrameMessageListener",(function(e){if(s.isMessageEvent(e.data)){var r=e.data;try{if(r.eventTarget){var t=oe.getExperienceIdentifier(r.eventTarget);s.eventManager.invokeEventListener(t,r)}s.sendAcknowledgment(r)}catch(e){var n,i;null===(n=s.onChange)||void 0===n||n.call(s,new z(R.UNRECOGNIZED_EVENT_TARGET,b.WARN,"Message with unrecognized event target received",{eventTarget:r.eventTarget}),{frame:s.iframe}),null===(i=s.logger)||void 0===i||i.warn("Message with unrecognized event target received")}}})),u(this,"setLogger",(function(e){return s.logger=e,s})),u(this,"initializeFrame",(function(){var r=s.getControlExperienceBaseUrl(),t=s.getControlExperienceId();s.onMessage&&s.eventManager.addEventListener(t,s.onMessage,!0);var n=new Ce({url:r,container:s.container,width:"0px",height:"0px",onChange:s.onChange},{eventManager:s.eventManager,contextId:s.internalExperience.contextId,timeout:e.FRAME_TIMEOUT,urlInfo:s.urlInfo},{onMessage:s.onMessage},{},s.internalExperience,t);s.internalSend=n.send,s.iframe=n.iframe,window.addEventListener("message",s.controlFrameMessageListener),s.eventManager.addEventListenerForCleanup(t,(function(){return window.removeEventListener("message",s.controlFrameMessageListener)}))})),u(this,"sendAcknowledgment",(function(e){var r,t,n=new q(A.ACKNOWLEDGE,s.internalExperience,{eventName:e.eventName,eventTarget:e.eventTarget});(null===(r=(t=window).requestIdleCallback)||void 0===r?void 0:r.call(t,(function(){return s.send(n)})))||s.send(n)})),u(this,"getControlExperienceId",(function(){return[s.internalExperience.contextId,s.internalExperience.experienceType,s.internalExperience.discriminator].filter(Boolean).join("-")})),u(this,"getControlExperienceBaseUrl",(function(){var e=s.urlInfo,r=e.host,t=e.sessionId,n="".concat(r,"/embed/").concat(t,"/embedControl");return new URL(n).href})),u(this,"isMessageEvent",(function(e){return!!e&&!!e.eventTarget&&!!e.eventName})),this.container=t,this.eventManager=n.eventManager,this.urlInfo=n.urlInfo,this.internalExperience=r(r({},this.experience),{},{contextId:n.contextId,discriminator:0}),this.onMessage=o,this.onChange=i,this.initializeFrame()}));u(Le,"FRAME_TIMEOUT",6e4);var De=c((function e(){var r=this;a(this,e),u(this,"addEventListener",(function(e,t,n){if(!e)throw new Error("Experience identifier is required when calling addEventListener");if("function"!=typeof t)throw new Error("Invalid type provided for event listener");var i=r.eventListeners.get(e);return n&&r.addEventListenerForCleanup(e,(function(){return r.removeEventListener(e,t)})),i?(i.push(t),r):(r.eventListeners.set(e,[t]),r)})),u(this,"invokeEventListener",(function(e,t){var n=r.eventListeners.get(e);if(!n)throw new Error("Unable to find experience specific event listeners: ".concat(e));return n.forEach((function(e){e(t)})),r})),u(this,"removeEventListener",(function(e,t){var n=r.eventListeners.get(e);if(!n)throw new Error("Unable to find experience specific event listeners: ".concat(e));var i=n.filter((function(e){return e!==t}));return r.eventListeners.set(e,i),r})),u(this,"addEventListenerForCleanup",(function(e,t){var n,i=null!==(n=r.cleanUpCallbacks.get(e))&&void 0!==n?n:[];i.push(t),r.cleanUpCallbacks.set(e,i)})),u(this,"cleanUpCallbacksForExperience",(function(e){var t=r.cleanUpCallbacks.get(e);t&&(t.forEach((function(e){return e()})),r.cleanUpCallbacks.delete(e),r.eventListeners.set(e,[]))})),this.eventListeners=new Map,this.cleanUpCallbacks=new Map})),Me=c((function e(){a(this,e),u(this,"log",console.log),u(this,"warn",console.warn),u(this,"error",console.error),u(this,"debug",console.debug),u(this,"info",console.info)})),Pe=c((function e(r){var i=this;a(this,e),u(this,"embedVisual",function(){var e=o(t().mark((function e(r){var n,o,a=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},i.validateFrameOptions(r,"embedVisual"),o=i.buildControlOptions(r),e.abrupt("return",new we(r,n,o,i.experienceIdentifiers).setLogProvider(i.logger));case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(this,"embedDashboard",function(){var e=o(t().mark((function e(r){var n,o,a=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},i.validateFrameOptions(r,"embedDashboard"),o=i.buildControlOptions(r),e.abrupt("return",new Re(r,n,o,i.experienceIdentifiers).setLogProvider(i.logger));case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(this,"embedConsole",function(){var e=o(t().mark((function e(r){var n,o,a=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},i.validateFrameOptions(r,"embedConsole"),o=i.buildControlOptions(r),e.abrupt("return",new xe(r,n,o,i.experienceIdentifiers).setLogProvider(i.logger));case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(this,"embedQSearchBar",function(){var e=o(t().mark((function e(r){var n,o,a=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},i.validateFrameOptions(r,"embedQSearchBar"),o=i.buildControlOptions(r),e.abrupt("return",new Ne(r,n,o,i.experienceIdentifiers).setLogProvider(i.logger));case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(this,"validateFrameOptions",(function(e,r){if(!e){var t="".concat(r," is called without frameOptions");throw i.onChange(new z(R.NO_FRAME_OPTIONS,b.ERROR,"".concat(r," is called without frameOptions"),{methodName:r}),{frame:null}),new Error(t)}if("object"!==n(e)||Array.isArray(e)){var o="".concat(r," is called with non-object frameOptions");throw i.onChange(new z(R.INVALID_FRAME_OPTIONS,b.ERROR,o,{methodName:r,frameOptionsType:Array.isArray(e)?"array":n(e)}),{frame:null}),new Error(o)}var a=["url","container","width","height","resizeHeightOnSizeChangedEvent","withIframePlaceholder","onChange","className"],s=Object.keys(e).filter((function(e){return!a.includes(e)}));if(s.length>0){var c,u,l="".concat(r," is called with unrecognized properties");null===(c=e.onChange)||void 0===c||c.call(e,new z(R.UNRECOGNIZED_FRAME_OPTIONS,b.WARN,l,{unrecognizedFrameOptions:s}),{frame:null}),null===(u=i.logger)||void 0===u||u.warn(l)}})),u(this,"buildControlOptions",(function(e){if(!i.controlOptions){if(!e.url)throw new Error("URL is missing in frame options, but is a required field");var r=i.getControlUrlInfo(e.url),t=new Le(i.getBodyElement(),{eventManager:i.eventManager,urlInfo:r,contextId:i.contextId},i.onChange).setLogger(i.logger);i.controlOptions={eventManager:i.eventManager,sendToControlFrame:t.send,contextId:i.contextId,timeout:Le.FRAME_TIMEOUT,urlInfo:r}}return i.controlOptions})),u(this,"onChange",(function(e,r){i.contextOnChange&&i.contextOnChange(e,r)})),u(this,"getControlUrlInfo",(function(e){var r=/^(https:\/\/[^/]+)\/(embedding|embed)\/([^/]+)\/[^?]+\?(.*)/i.exec(e)||[];if((null==r?void 0:r.length)<4)throw new Error('Invalid embedding url: "'.concat(e,'"'));return{sessionId:r[3],host:r[1],urlSearchParams:new URLSearchParams(r[4])}})),u(this,"getBodyElement",(function(){var e,r=null===(e=document.getElementsByTagName("body"))||void 0===e?void 0:e[0];if(!r){var t="could not locate <body> element in the page";throw i.onChange(new z(R.NO_BODY,b.ERROR,t),{frame:null}),new Error(t)}return r})),this.contextId=ie(),this.experienceIdentifiers=new Set,this.eventManager=new De,this.contextOnChange=r.onChange,this.logger=new Me})),Ue=function(){var e=o(t().mark((function e(){var r,n=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>0&&void 0!==n[0]?n[0]:{},e.abrupt("return",new Pe(r));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Fe=r(r(r(r(r(r(r(r(r(r(r(r({},M),S),N),C),L),D),U),F),V),H),j),Q);exports.BaseExperience=oe,exports.BaseExperienceFrame=ve,exports.CALCULATED_METRIC_COLUMN_TYPE=G,exports.ChangeEvent=z,exports.ChangeEventLevel=b,exports.ChangeEventName=R,exports.ConsoleExperience=xe,exports.ConsoleExperienceFrame=_e,exports.ControlExperience=Le,exports.ControlExperienceFrame=Ce,exports.DashboardExperience=Re,exports.DashboardExperienceFrame=Te,exports.DataResponse=$,exports.DefaultLogger=Me,exports.EmbeddingContext=Pe,exports.EmbeddingEvent=B,exports.EmbeddingMessageEvent=Z,exports.ErrorChangeEventName=_,exports.ErrorResponse=Y,exports.EventManager=De,exports.ExperienceType=P,exports.GetterMessageEventName=y,exports.Iframe=he,exports.InfoChangeEventName=w,exports.InfoMessageEventName=O,exports.InvokerMessageEventName=T,exports.MessageEventName=A,exports.PostMessageEvent=K,exports.QSE=Fe,exports.QSearchExperience=Ne,exports.QSearchExperienceFrame=Ae,exports.ResponseMessage=W,exports.SDK_VERSION=Ee,exports.SPECIAL_DATAPOINT_VALUE_TYPES=k,exports.SetterMessageEventName=x,exports.SuccessResponse=X,exports.TargetedMessageEvent=q,exports.VisualExperience=we,exports.VisualExperienceFrame=ge,exports.WarnChangeEventName=I,exports.createEmbeddingContext=Ue; | ||
//# sourceMappingURL=index.cjs.js.map |
@@ -241,2 +241,3 @@ /// <reference types="node" /> | ||
setThemeOverride: (themeOverride: ThemeConfiguration) => Promise<ResponseMessage>; | ||
setPreloadThemes: (preloadThemes: string[]) => Promise<ResponseMessage>; | ||
protected extractExperienceFromUrl: (url: string) => IDashboardExperience; | ||
@@ -698,2 +699,3 @@ private interceptMessage; | ||
readonly SET_THEME_OVERRIDE: "SET_THEME_OVERRIDE"; | ||
readonly PRELOAD_THEMES: "PRELOAD_THEMES"; | ||
readonly CALLBACK_OPERATION_INVOKED: "CALLBACK_OPERATION_INVOKED"; | ||
@@ -837,2 +839,3 @@ readonly CONTENT_LOADED: "CONTENT_LOADED"; | ||
readonly SET_THEME_OVERRIDE: "SET_THEME_OVERRIDE"; | ||
readonly PRELOAD_THEMES: "PRELOAD_THEMES"; | ||
readonly CALLBACK_OPERATION_INVOKED: "CALLBACK_OPERATION_INVOKED"; | ||
@@ -905,2 +908,3 @@ readonly CONTENT_LOADED: "CONTENT_LOADED"; | ||
readonly SET_THEME_OVERRIDE: "SET_THEME_OVERRIDE"; | ||
readonly PRELOAD_THEMES: "PRELOAD_THEMES"; | ||
}; | ||
@@ -960,3 +964,3 @@ GetterMessageEventName: { | ||
export declare const SDK_VERSION = "2.5.0"; | ||
export declare const SDK_VERSION = "2.6.0"; | ||
@@ -975,2 +979,3 @@ export declare const SetterMessageEventName: { | ||
readonly SET_THEME_OVERRIDE: "SET_THEME_OVERRIDE"; | ||
readonly PRELOAD_THEMES: "PRELOAD_THEMES"; | ||
}; | ||
@@ -986,3 +991,3 @@ | ||
sheetId?: string; | ||
}> | EmbeddingMessageEvent<typeof SetterMessageEventName.SET_THEME_OVERRIDE, ThemeConfiguration>; | ||
}> | EmbeddingMessageEvent<typeof SetterMessageEventName.PRELOAD_THEMES, string[]> | EmbeddingMessageEvent<typeof SetterMessageEventName.SET_THEME_OVERRIDE, ThemeConfiguration>; | ||
@@ -1014,8 +1019,8 @@ export declare interface Sheet { | ||
export declare type ThemeOptions = ThemeOptionsWithThemeArn; | ||
export declare type ThemeOptions = { | ||
themeArn?: string; | ||
themeOverride?: ThemeConfiguration; | ||
preloadThemes?: string[]; | ||
}; | ||
export declare interface ThemeOptionsWithThemeArn { | ||
themeArn: string; | ||
} | ||
export declare interface ToolbarOption { | ||
@@ -1048,2 +1053,3 @@ show?: true; | ||
themeArn?: string; | ||
themeOverride?: ThemeConfiguration; | ||
} | ||
@@ -1063,2 +1069,3 @@ | ||
themeArn?: string; | ||
themeOverride?: ThemeConfiguration; | ||
} | ||
@@ -1106,2 +1113,3 @@ | ||
setThemeOverride: (themeOverride: ThemeConfiguration) => Promise<ResponseMessage>; | ||
setPreloadThemes: (preloadThemes: string[]) => Promise<ResponseMessage>; | ||
protected extractExperienceFromUrl: (url: string) => IVisualExperience; | ||
@@ -1108,0 +1116,0 @@ private interceptMessage; |
/*! | ||
* amazon-quicksight-embedding-sdk v2.5.0 | ||
* amazon-quicksight-embedding-sdk v2.6.0 | ||
* git@github.com:awslabs/amazon-quicksight-embedding-sdk.git | ||
@@ -9,3 +9,3 @@ * https://github.com/awslabs/amazon-quicksight-embedding-sdk | ||
*/ | ||
function e(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function r(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?e(Object(n),!0).forEach((function(e){u(r,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}function t(){t=function(){return r};var e,r={},n=Object.prototype,i=n.hasOwnProperty,o=Object.defineProperty||function(e,r,t){e[r]=t.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,r,t){return Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[r]}try{l({},"")}catch(e){l=function(e,r,t){return e[r]=t}}function f(e,r,t,n){var i=r&&r.prototype instanceof g?r:g,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:R(e,t,s)}),a}function p(e,r,t){try{return{type:"normal",arg:e.call(r,t)}}catch(e){return{type:"throw",arg:e}}}r.wrap=f;var d="suspendedStart",h="suspendedYield",E="executing",v="completed",m={};function g(){}function O(){}function w(){}var _={};l(_,s,(function(){return this}));var I=Object.getPrototypeOf,y=I&&I(I(L([])));y&&y!==n&&i.call(y,s)&&(_=y);var x=w.prototype=g.prototype=Object.create(_);function S(e){["next","throw","return"].forEach((function(r){l(e,r,(function(e){return this._invoke(r,e)}))}))}function T(e,r){function t(n,o,a,s){var c=p(e[n],e,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&i.call(l,"__await")?r.resolve(l.__await).then((function(e){t("next",e,a,s)}),(function(e){t("throw",e,a,s)})):r.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return t("throw",e,a,s)}))}s(c.arg)}var n;o(this,"_invoke",{value:function(e,i){function o(){return new r((function(r,n){t(e,i,r,n)}))}return n=n?n.then(o,o):o()}})}function R(r,t,n){var i=d;return function(o,a){if(i===E)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var c=A(s,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===d)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=E;var u=p(r,t,n);if("normal"===u.type){if(i=n.done?v:h,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=v,n.method="throw",n.arg=u.arg)}}}function A(r,t){var n=t.method,i=r.iterator[n];if(i===e)return t.delegate=null,"throw"===n&&r.iterator.return&&(t.method="return",t.arg=e,A(r,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=p(i,r.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,m;var a=o.arg;return a?a.done?(t[r.resultName]=a.value,t.next=r.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,m):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,m)}function b(e){var r={tryLoc:e[0]};1 in e&&(r.catchLoc=e[1]),2 in e&&(r.finallyLoc=e[2],r.afterLoc=e[3]),this.tryEntries.push(r)}function N(e){var r=e.completion||{};r.type="normal",delete r.arg,e.completion=r}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(b,this),this.reset(!0)}function L(r){if(r||""===r){var t=r[s];if(t)return t.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var n=-1,o=function t(){for(;++n<r.length;)if(i.call(r,n))return t.value=r[n],t.done=!1,t;return t.value=e,t.done=!0,t};return o.next=o}}throw new TypeError(typeof r+" is not iterable")}return O.prototype=w,o(x,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:O,configurable:!0}),O.displayName=l(w,u,"GeneratorFunction"),r.isGeneratorFunction=function(e){var r="function"==typeof e&&e.constructor;return!!r&&(r===O||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,l(e,u,"GeneratorFunction")),e.prototype=Object.create(x),e},r.awrap=function(e){return{__await:e}},S(T.prototype),l(T.prototype,c,(function(){return this})),r.AsyncIterator=T,r.async=function(e,t,n,i,o){void 0===o&&(o=Promise);var a=new T(f(e,t,n,i),o);return r.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(x),l(x,u,"Generator"),l(x,s,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var r=Object(e),t=[];for(var n in r)t.push(n);return t.reverse(),function e(){for(;t.length;){var n=t.pop();if(n in r)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=L,C.prototype={constructor:C,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(N),!r)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var t=this;function n(n,i){return s.type="throw",s.arg=r,t.next=n,i&&(t.method="next",t.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),u=i.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,r){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),m},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),N(t),m}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.tryLoc===e){var n=t.completion;if("throw"===n.type){var i=n.arg;N(t)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(r,t,n){return this.delegate={iterator:L(r),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=e),m}},r}function n(e){return n="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},n(e)}function i(e,r,t,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void t(e)}s.done?r(c):Promise.resolve(c).then(n,i)}function o(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var a=e.apply(r,t);function s(e){i(a,n,o,s,c,"next",e)}function c(e){i(a,n,o,s,c,"throw",e)}s(void 0)}))}}function a(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function s(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,g(n.key),n)}}function c(e,r,t){return r&&s(e.prototype,r),t&&s(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,r,t){return(r=g(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function l(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&p(e,r)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(e,r){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,r){return e.__proto__=r,e},p(e,r)}function d(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E(e){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=f(e);if(r){var i=f(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return function(e,r){if(r&&("object"==typeof r||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}(this,t)}}function v(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,i,o,a,s=[],c=!0,u=!1;try{if(o=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;c=!1}else for(;!(c=(n=o.call(t)).done)&&(s.push(n.value),s.length!==r);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return m(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return m(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function g(e){var r=function(e,r){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:String(r)}var O={CALLBACK_OPERATION_INVOKED:"CALLBACK_OPERATION_INVOKED",CONTENT_LOADED:"CONTENT_LOADED",EXPERIENCE_INITIALIZED:"EXPERIENCE_INITIALIZED",ERROR_OCCURRED:"ERROR_OCCURRED",SIZE_CHANGED:"SIZE_CHANGED",PARAMETERS_CHANGED:"PARAMETERS_CHANGED",SELECTED_SHEET_CHANGED:"SELECTED_SHEET_CHANGED",MODAL_OPENED:"MODAL_OPENED",Q_SEARCH_CLOSED:"Q_SEARCH_CLOSED",Q_SEARCH_OPENED:"Q_SEARCH_OPENED",Q_SEARCH_SIZE_CHANGED:"Q_SEARCH_SIZE_CHANGED",Q_SEARCH_ENTERED_FULLSCREEN:"Q_SEARCH_ENTERED_FULLSCREEN",Q_SEARCH_EXITED_FULLSCREEN:"Q_SEARCH_EXITED_FULLSCREEN"},w={FRAME_STARTED:"FRAME_STARTED",FRAME_MOUNTED:"FRAME_MOUNTED",FRAME_LOADED:"FRAME_LOADED",FRAME_REMOVED:"FRAME_REMOVED"},_={FRAME_NOT_CREATED:"FRAME_NOT_CREATED",NO_BODY:"NO_BODY",NO_CONTAINER:"NO_CONTAINER",INVALID_CONTAINER:"INVALID_CONTAINER",NO_URL:"NO_URL",INVALID_URL:"INVALID_URL",NO_FRAME_OPTIONS:"NO_FRAME_OPTIONS",INVALID_FRAME_OPTIONS:"INVALID_FRAME_OPTIONS"},I={UNRECOGNIZED_CONTENT_OPTIONS:"UNRECOGNIZED_CONTENT_OPTIONS",UNRECOGNIZED_FRAME_OPTIONS:"UNRECOGNIZED_FRAME_OPTIONS",UNRECOGNIZED_EVENT_TARGET:"UNRECOGNIZED_EVENT_TARGET"},y={SET_PARAMETERS:"SET_PARAMETERS",SET_SELECTED_SHEET_ID:"SET_SELECTED_SHEET_ID",SET_Q_SEARCH_QUESTION:"SET_Q_SEARCH_QUESTION",SET_VISUAL_ACTIONS:"SET_VISUAL_ACTIONS",SET_THEME:"SET_THEME",ADD_FILTER_GROUPS:"ADD_FILTER_GROUPS",UPDATE_FILTER_GROUPS:"UPDATE_FILTER_GROUPS",REMOVE_FILTER_GROUPS:"REMOVE_FILTER_GROUPS",ADD_VISUAL_ACTIONS:"ADD_VISUAL_ACTIONS",REMOVE_VISUAL_ACTIONS:"REMOVE_VISUAL_ACTIONS",SET_THEME_OVERRIDE:"SET_THEME_OVERRIDE"},x={GET_PARAMETERS:"GET_PARAMETERS",GET_SHEETS:"GET_SHEETS",GET_SHEET_VISUALS:"GET_SHEET_VISUALS",GET_VISUAL_ACTIONS:"GET_VISUAL_ACTIONS",GET_SELECTED_SHEET_ID:"GET_SELECTED_SHEET_ID",GET_FILTER_GROUPS_FOR_SHEET:"GET_FILTER_GROUPS_FOR_SHEET",GET_FILTER_GROUPS_FOR_VISUAL:"GET_FILTER_GROUPS_FOR_VISUAL"},S={ACKNOWLEDGE:"ACKNOWLEDGE",INITIATE_PRINT:"INITIATE_PRINT",NAVIGATE_TO_DASHBOARD:"NAVIGATE_TO_DASHBOARD",CLOSE_Q_SEARCH:"CLOSE_Q_SEARCH",UNDO:"UNDO",REDO:"REDO",RESET:"RESET",TOGGLE_BOOKMARKS_PANE:"TOGGLE_BOOKMARKS_PANE"},T=Object.freeze({__proto__:null,ErrorChangeEventName:_,GetterMessageEventName:x,InfoChangeEventName:w,InfoMessageEventName:O,InvokerMessageEventName:S,SetterMessageEventName:y,WarnChangeEventName:I}),R=r(r(r({},w),_),I),A=r(r(r(r({},O),y),x),S),b={ERROR:"ERROR",INFO:"INFO",WARN:"WARN"},N=Object.freeze({__proto__:null,ChangeEventLevel:b,ChangeEventName:R,MessageEventName:A}),C=Object.freeze({__proto__:null}),L=Object.freeze({__proto__:null}),D=Object.freeze({__proto__:null}),U=Object.freeze({__proto__:null}),M={CONSOLE:"CONSOLE",CONTEXT:"CONTEXT",CONTROL:"CONTROL",VISUAL:"VISUAL",DASHBOARD:"DASHBOARD",QSEARCH:"QSEARCH"},P=Object.freeze({__proto__:null,ExperienceType:M}),F=Object.freeze({__proto__:null}),k={NULL:null,OTHER_BUCKET:null},G={INTEGER:null,STRING:null,DECIMAL:null,DATETIME:null},j=Object.freeze({__proto__:null,CALCULATED_METRIC_COLUMN_TYPE:G,SPECIAL_DATAPOINT_VALUE_TYPES:k}),V=Object.freeze({__proto__:null}),H=Object.freeze({__proto__:null}),Q=Object.freeze({__proto__:null}),z=c((function e(r,t,n){a(this,e),this.eventName=r,this.message=t,this.data=n})),B=function(e){l(t,z);var r=E(t);function t(e,n,i,o){var s;return a(this,t),(s=r.call(this,e,i,o)).eventLevel=n,s}return c(t)}(),q=function(e){l(t,z);var r=E(t);function t(e,n,i){var o;return a(this,t),(o=r.call(this,e,n,i)).eventName=e,o}return c(t)}(),Z=function(e){l(t,q);var r=E(t);function t(e,n,i,o){var s;return a(this,t),(s=r.call(this,e,i,o)).eventTarget=n,s}return c(t)}(),K=function(e){l(t,Z);var r=E(t);function t(e,n,i,o,s,c,u){var l;return a(this,t),(l=r.call(this,e,n,c,u)).timestamp=o,l.version=s,l.eventId=i,l}return c(t)}(),W=c((function e(){a(this,e)})),X=c((function e(){a(this,e),u(this,"success",!0)})),Y=c((function e(r){a(this,e),u(this,"success",!1),this.errorCode=r.errorCode,this.error=r.error,this.message=r.message})),$=c((function e(r){a(this,e),u(this,"success",!0),this.message=r}));let J;const ee=new Uint8Array(16);function re(){if(!J&&(J="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!J))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return J(ee)}const te=[];for(let e=0;e<256;++e)te.push((e+256).toString(16).slice(1));var ne={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ie(e,r,t){if(ne.randomUUID&&!r&&!e)return ne.randomUUID();const n=(e=e||{}).random||(e.rng||re)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,r){t=t||0;for(let e=0;e<16;++e)r[t+e]=n[e];return r}return function(e,r=0){return te[e[r+0]]+te[e[r+1]]+te[e[r+2]]+te[e[r+3]]+"-"+te[e[r+4]]+te[e[r+5]]+"-"+te[e[r+6]]+te[e[r+7]]+"-"+te[e[r+8]]+te[e[r+9]]+"-"+te[e[r+10]]+te[e[r+11]]+te[e[r+12]]+te[e[r+13]]+te[e[r+14]]+te[e[r+15]]}(n)}var oe=c((function e(n,i,s,c){var l=this;a(this,e),u(this,"send",function(){var e=o(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l.experienceFrame&&l.internalExperience){e.next=2;break}throw new Error("Experience has not been initialized");case 2:return n=new Z(r.eventName,l.internalExperience,r.message,r.data),e.abrupt("return",l.experienceFrame.send(n));case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(this,"addEventListener",(function(e,r){return l.experienceFrame.addInternalEventListener(e,r)})),u(this,"setLogProvider",(function(e){return l.logger=e,l})),u(this,"getInternalExperienceInfo",(function(t){var n,i,o=-1;do{o++,n=r(r({},t),{},{contextId:l.controlOptions.contextId,discriminator:o}),i=e.getExperienceIdentifier(n)}while(l.experienceIdentifiers.has(i));return l.experienceIdentifiers.add(i),{experienceIdentifier:i,internalExperience:n}})),u(this,"transformContentOptions",(function(e,r){var t,n,i,o=Object.keys(r);Object.keys(r).length>0&&(null===(t=(n=l.frameOptions).onChange)||void 0===t||t.call(n,new B(R.UNRECOGNIZED_CONTENT_OPTIONS,b.WARN,"Experience content options contain unrecognized properties",{unrecognizedContentOptions:o}),{frame:null}),null===(i=l.logger)||void 0===i||i.warn("Experience content options contain unrecognized properties"));return e})),u(this,"validateFrameOptions",(function(){if(!l.frameOptions.url){var e,r,t="Url is required for the experience";throw null===(e=(r=l.frameOptions).onChange)||void 0===e||e.call(r,new B(R.NO_URL,b.ERROR,t),{frame:null}),new Error(t)}})),this.frameOptions=n,this.contentOptions=i,this.controlOptions=s,this.experienceIdentifiers=c,this.validateFrameOptions()}));u(oe,"getExperienceIdentifier",(function(e){if(e.experienceType===M.DASHBOARD)return[e.contextId,e.experienceType,e.dashboardId,e.discriminator].filter(Boolean).join("-");if(e.experienceType===M.VISUAL)return[e.contextId,e.experienceType,e.dashboardId,e.sheetId,e.visualId,e.discriminator].filter(Boolean).join("-");if([M.CONSOLE,M.CONTROL,M.CONTEXT,M.QSEARCH].includes(e.experienceType))return[e.contextId,e.experienceType,e.discriminator].filter(Boolean).join("-");throw new Error("Invalid experience unable to build experience identifier")}));const ae=2147483647,se={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ce=Math.floor,ue=String.fromCharCode;function le(e){throw new RangeError(se[e])}const fe=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},pe=function(e,r,t){let n=0;for(e=t?ce(e/700):e>>1,e+=ce(e/r);e>455;n+=36)e=ce(e/35);return ce(n+36*e/(e+38))},de=function(e){const r=[];e=function(e){const r=[];let t=0;const n=e.length;for(;t<n;){const i=e.charCodeAt(t++);if(i>=55296&&i<=56319&&t<n){const n=e.charCodeAt(t++);56320==(64512&n)?r.push(((1023&i)<<10)+(1023&n)+65536):(r.push(i),t--)}else r.push(i)}return r}(e);const t=e.length;let n=128,i=0,o=72;for(const t of e)t<128&&r.push(ue(t));const a=r.length;let s=a;for(a&&r.push("-");s<t;){let t=ae;for(const r of e)r>=n&&r<t&&(t=r);const c=s+1;t-n>ce((ae-i)/c)&&le("overflow"),i+=(t-n)*c,n=t;for(const t of e)if(t<n&&++i>ae&&le("overflow"),t===n){let e=i;for(let t=36;;t+=36){const n=t<=o?1:t>=o+26?26:t-o;if(e<n)break;const i=e-n,a=36-n;r.push(ue(fe(n+i%a,0))),e=ce(i/a)}r.push(ue(fe(e,0))),o=pe(i,c,s===a),i=0,++s}++i,++n}return r.join("")};var he=c((function e(r){var t=this;a(this,e),u(this,"classNames",[e.IFRAME_CLASS_NAME]),u(this,"getIframe",(function(){return t.iframe})),u(this,"createIframePlaceholder",(function(r){if(t.iframePlaceholder=document.createElement("div"),t.iframePlaceholder.id="".concat(t.iframeName,"-placeholder"),t.iframePlaceholder.style.width=t.width,t.iframePlaceholder.style.backgroundColor="rgba(0,0,0,.01)",t.iframePlaceholder.style.display="flex",t.iframePlaceholder.style.justifyContent="center",t.iframePlaceholder.style.alignItems="center",t.iframePlaceholder.className="".concat(e.IFRAME_CLASS_NAME,"-placeholder"),t.height.endsWith("px")&&(t.iframePlaceholder.style.height=t.height),r&&"boolean"!=typeof r)t.iframePlaceholder.appendChild(r);else{var n=t.createLoaderSVG();t.iframePlaceholder.appendChild(n)}t.container.appendChild(t.iframePlaceholder)})),u(this,"createIframe",(function(){var e=document.createElement("iframe");return e.className=t.classNames.join(" ").trim(),e.id=t.iframeName,e.name=t.iframeName,e.width=t.width,e.height=t.height,t.loading&&(e.loading=t.loading),e.style.border="0px",e.style.padding="0px",t.iframePlaceholder&&(e.style.opacity="0",e.style.position="absolute"),"0px"===t.width&&"0px"===t.height&&(e.style.position="absolute"),t.container.appendChild(e),t.payload?t.postRequest=t.createPostRequest({src:t.src,target:e.name,container:t.container,payload:t.payload}):e.src=t.src,e})),u(this,"onLoadLocal",(function(e){var r,n;t.iframePlaceholder&&(t.iframePlaceholder.remove(),t.iframe.style.position="",t.iframe.style.opacity="1",t.iframe.style.transition="opacity .5s ease-in-out"),null===(r=t.onLoad)||void 0===r||r.call(t,e),null===(n=t.postRequest)||void 0===n||n.remove()})),u(this,"createPostRequest",(function(e){var r=e.src,t=e.container,n=e.target,i=e.payload;if(!r)throw new Error("No source has been provided.");var o=document.createElement("form");return o.style.visibility="hidden",o.method="POST",o.action=r,o.target=n,o.name="".concat(n,"-form"),Object.keys(i).forEach((function(e){var r=document.createElement("input");r.type="hidden",r.name=e,r.value=i[e],o.appendChild(r)})),t.appendChild(o),null==o||o.submit(),{remove:function(){o.remove()}}})),u(this,"createSvgElement",(function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.entries(r).forEach((function(e){var r=v(e,2),t=r[0],n=r[1];return i.setAttribute(t,n)})),Object.entries(t).forEach((function(e){var r=v(e,2),t=r[0],n=r[1];return i.style.setProperty(t,n)})),n.forEach((function(e){return i.appendChild(e)})),i})),u(this,"createLoaderSVG",(function(){var e=[1,2,3].map((function(e){var r=t.createSvgElement("animate",{attributeName:"opacity",dur:"1s",values:"0;1;0",repeatCount:"indefinite",begin:"".concat(e/10)});return t.createSvgElement("circle",{fill:"#ccc",stroke:"none",cx:"".concat(20*e-14),cy:"50",r:"6"},void 0,[r])}));return t.createSvgElement("svg",{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100","enable-background":"new 0 0 0 0"},{width:"100px",height:"100px"},e)}));var n=r.id,i=r.src,o=r.width,s=void 0===o?"100%":o,c=r.height,l=void 0===c?"100%":c,f=r.container,p=r.onLoad,d=r.loading,h=r.withIframePlaceholder,E=r.payload,m=r.className;this.width=s,this.height=l,this.onLoad=p,this.iframeName=n,this.loading=d,m&&this.classNames.push(m),this.container=f,this.payload=E,this.src=i,h&&this.createIframePlaceholder(h),this.iframe=this.createIframe(),this.iframe.addEventListener("load",this.onLoadLocal)}));u(he,"IFRAME_CLASS_NAME","quicksight-embedding-iframe");var Ee="2.5.0",ve=c((function e(i,s,c,l,f,p,d){var h=this;a(this,e),u(this,"MESSAGE_RESPONSE_TIMEOUT",5e3),u(this,"iframe",null),u(this,"send",function(){var e=o(t().mark((function e(r){var n,i,o;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h.iframe){e.next=2;break}throw new Error("Cannot send ".concat(r.eventName,": No experience frame found"));case 2:if(i=ie(),o=new K(r.eventName,r.eventTarget,i,Date.now(),Ee,r.message,r.data),null===(n=h.iframe)||void 0===n||null===(n=n.contentWindow)||void 0===n||n.postMessage(o,h.url),r.eventName!==A.ACKNOWLEDGE){e.next=7;break}return e.abrupt("return",Promise.resolve(new X));case 7:return e.abrupt("return",new Promise((function(e,t){var n=function r(t){var n,o,a=t.data;(null==a?void 0:a.eventId)===i&&(window.removeEventListener("message",r),!0===(null===(n=a.message)||void 0===n?void 0:n.success)?e(new X):!1===(null===(o=a.message)||void 0===o?void 0:o.success)?e(new Y(a.message)):e(new $(a.message)))};window.addEventListener("message",n),setTimeout((function(){window.removeEventListener("message",n),t("".concat(r.eventName," timed out"))}),h.MESSAGE_RESPONSE_TIMEOUT)})));case 8:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(this,"buildParameterString",(function(e){return e&&"object"===n(e)?Object.entries(e).map((function(e){var r=v(e,2),t=r[0],n=r[1],i=Array.isArray(n)?n:[n],o=encodeURIComponent(t);return i.map(encodeURIComponent).map((function(e){return"p.".concat(o,"=").concat(e)})).join("&")})).join("&"):""})),u(this,"buildQueryString",(function(e){var t=Object.entries(e).reduce((function(e,t){var n=v(t,2),i=n[0],o=n[1];return null!=o?r(r({},e),{},u({},i,"".concat(o))):e}),{punyCodeEmbedOrigin:de("".concat(window.location.origin,"/")),sdkVersion:Ee});return new URLSearchParams(t).toString()})),u(this,"createExperienceIframe",(function(){h.onChange(new B(R.FRAME_STARTED,b.INFO,"Creating the frame",{experience:h.internalExperience}));try{h.setTimeoutInstance(),h.iframe=new he({id:h.experienceId,src:h.url,width:h.frameOptions.width,height:h.frameOptions.height,container:h.container,onLoad:h.onLoadHandler,withIframePlaceholder:h.frameOptions.withIframePlaceholder,className:h.frameOptions.className}).getIframe()}catch(e){throw h.onChange(new B(R.FRAME_NOT_CREATED,b.ERROR,"Failed to create the frame",{experience:h.internalExperience})),e}h.onChange(new B(R.FRAME_MOUNTED,b.INFO,"The frame mounted",{experience:h.internalExperience,frame:h.iframe}))})),u(this,"addInternalEventListener",(function(e,r){var t=function(t,n){t.eventName===e&&r(t,n)};return h.controlOptions.eventManager.addEventListener(h.experienceId,t,!0),{remove:function(){return h.controlOptions.eventManager.removeEventListener(h.experienceId,t)}}})),u(this,"validateBaseUrl",(function(e){if(!e)throw h.onChange(new B(R.NO_URL,b.ERROR,"Url is required for the experience",{experience:h.internalExperience})),new Error("Url is required for the experience");return e})),u(this,"setTimeoutInstance",(function(){h.timeoutInstance=setTimeout((function(){throw h.onChange(new B(R.FRAME_NOT_CREATED,b.ERROR,"Creating the frame timed out",{experience:h.internalExperience})),new Error("Creating the frame timed out")}),h.controlOptions.timeout)})),u(this,"onLoadHandler",o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h.timeoutInstance&&clearTimeout(h.timeoutInstance),h.onChange(new B(R.FRAME_LOADED,b.INFO,"The experience iframe loaded",{experience:h.internalExperience}));case 2:case"end":return e.stop()}}),e)})))),u(this,"getContainer",(function(e){if(!e){var r="Container is required for the experience";throw h.onChange(new B(R.NO_CONTAINER,b.ERROR,r,{experience:h.internalExperience})),new Error(r)}var t=null;if("string"==typeof e)try{t=document.querySelector(e)}catch(e){throw e instanceof Error&&h.onChange(new B(R.INVALID_CONTAINER,b.ERROR,e.message,{experience:h.internalExperience})),e}else"object"===n(e)&&e.nodeName&&(t=e);if(!t){var i="Invalid container '".concat(e,"' for the experience");throw h.onChange(new B(R.INVALID_CONTAINER,b.ERROR,i,{experience:h.internalExperience})),new Error(i)}return t})),u(this,"decorateOnChange",(function(e){return function(r){if(e){var t={frame:h.iframe};e(r,t)}}})),u(this,"decorateOnMessage",(function(e,r){return function(t){r&&h.iframe&&r(t,{frame:h.iframe}),e&&e(t,{frame:h.iframe})}})),u(this,"initializeMutationObserver",(function(){var e=new MutationObserver((function(r){r.some((function(e){return Array.from(e.removedNodes).some((function(e){return e===h.iframe||e===h.container}))}))&&(h.controlOptions.eventManager.cleanUpCallbacksForExperience(h.experienceId),e.disconnect(),h.iframe=null,h.onChange(new B(R.FRAME_REMOVED,b.INFO,"Frame removed from the DOM",{experience:h.internalExperience})))}));e.observe(document.body,{childList:!0,subtree:!0})})),this.frameOptions=i,this.contentOptions=c,this.onChange=this.decorateOnChange(i.onChange),this.onMessage=this.decorateOnMessage(c.onMessage,d),this.container=this.getContainer(i.container),this.internalExperience=f,this.controlOptions=s,this.transformedContentOptions=l,this.experienceId=p,this.url=this.validateBaseUrl(i.url),this.controlOptions.eventManager.addEventListener(this.experienceId,this.onMessage,!0),this.initializeMutationObserver()})),me=["parameters"],ge=function(e){l(n,ve);var t=E(n);function n(e,i,o,s,c,l,f){var p;return a(this,n),u(h(p=t.call(this,e,i,o,s,c,l,f)),"buildExperienceUrl",(function(e){var t=p.transformedContentOptions,n=t.parameters,i=d(t,me),o=p.internalExperience,a=o.contextId,s=o.discriminator;return[e,[p.buildQueryString(r(r({},i),{},{contextId:a,discriminator:s})),p.buildParameterString(n)].join("#")].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return c(n)}(),Oe=["fitToIframeWidth","locale","parameters","themeOptions","onMessage"],we=function(e){l(i,oe);var n=E(i);function i(e,s,c,l){var f;a(this,i),u(h(f=n.call(this,e,s,c,l)),"setParameters",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.SET_PARAMETERS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"reset",o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.RESET)));case 1:case"end":return e.stop()}}),e)})))),u(h(f),"addFilterGroups",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.ADD_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"updateFilterGroups",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.UPDATE_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"removeFilterGroups",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.REMOVE_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"getFilterGroups",o(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(A.GET_FILTER_GROUPS_FOR_VISUAL));case 2:if(r=e.sent,Array.isArray(null==r?void 0:r.message)){e.next=5;break}throw new Error("Failed to retrieve filter groups for the visual");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})))),u(h(f),"getActions",o(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(A.GET_VISUAL_ACTIONS));case 2:if(r=e.sent,Array.isArray(null==r?void 0:r.message)){e.next=5;break}throw new Error("Failed to retrieve the actions");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})))),u(h(f),"addActions",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.ADD_VISUAL_ACTIONS,{Actions:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"setActions",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.SET_VISUAL_ACTIONS,{Actions:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"removeActions",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.REMOVE_VISUAL_ACTIONS,{Actions:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"setTheme",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.SET_THEME,{ThemeArn:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"setThemeOverride",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.SET_THEME_OVERRIDE,{ThemeOverride:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"extractExperienceFromUrl",(function(e){var r,t,n=/^https:\/\/[^/]+\/embed\/[^/]+\/dashboards\/([\w-]+)\/sheets\/([\w-]+)\/visuals\/([\w-]+)(\?|$)/i.exec(e)||[];if(n.length<5)throw null===(r=(t=f.frameOptions).onChange)||void 0===r||r.call(t,new B(R.INVALID_URL,b.ERROR,"Invalid visual experience url",{url:e}),{frame:f.experienceFrame.iframe}),new Error("Invalid visual experience URL");return{experienceType:M.VISUAL,dashboardId:n[1],sheetId:n[2],visualId:n[3]}})),u(h(f),"interceptMessage",(function(e,r){var t,n,i;"SIZE_CHANGED"===e.eventName&&f.frameOptions.resizeHeightOnSizeChangedEvent&&(null==r||null===(t=r.frame)||void 0===t||null===(n=t.setAttribute)||void 0===n||n.call(t,"height","".concat(null===(i=e.message)||void 0===i?void 0:i.height,"px")))})),u(h(f),"transformVisualContentOptions",(function(e){var t=e.fitToIframeWidth,n=e.locale,i=e.parameters,o=e.themeOptions;e.onMessage;var a=d(e,Oe),s=f.transformContentOptions({fitToIframeWidth:null==t||t,locale:n},a);return Array.isArray(i)&&(s.parameters=i.reduce((function(e,t){return r(r({},e),{},u({},t.Name,t.Values))}),{})),null!=o&&o.themeArn&&(s.themeArn=o.themeArn),s})),f.experience=f.extractExperienceFromUrl(e.url);var p=f.getInternalExperienceInfo(f.experience),E=p.experienceIdentifier,v=p.internalExperience;return f.internalExperience=v,f.experienceId=E,f.experienceFrame=new ge(e,c,s,f.transformVisualContentOptions(s),v,E,f.interceptMessage),f}return c(i)}(),_e=function(e){l(n,ve);var t=E(n);function n(e,i,o,s,c,l,f){var p;return a(this,n),u(h(p=t.call(this,e,i,o,s,c,l,f)),"buildExperienceUrl",(function(e){var t=p.internalExperience,n=t.contextId,i=t.discriminator;return[e,p.buildQueryString(r(r({},p.transformedContentOptions),{},{contextId:n,discriminator:i}))].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return c(n)}(),Ie=["locale","onMessage"],ye=function(e){l(t,oe);var r=E(t);function t(e,n,i,o){var s;a(this,t),u(h(s=r.call(this,e,n,i,o)),"extractExperienceFromUrl",(function(e){var r,t;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/(start(\/(favorites|dashboards|analyses))?|dashboards\/[\w-]+|analyses\/[\w-]+)(\?|$)/i.exec(e)||[]).length<5)throw null===(r=(t=s.frameOptions).onChange)||void 0===r||r.call(t,new B(R.INVALID_URL,b.ERROR,"Invalid console experience url",{url:e}),{frame:s.experienceFrame.iframe}),new Error("Invalid console experience URL");return{experienceType:M.CONSOLE}})),s.experience=s.extractExperienceFromUrl(e.url);var c=s.getInternalExperienceInfo(s.experience),l=c.experienceIdentifier,f=c.internalExperience;s.internalExperience=f,s.experienceId=l;var p=n.locale;n.onMessage;var E=d(n,Ie),v=s.transformContentOptions({locale:p},E);return s.experienceFrame=new _e(e,i,n,v,f,l),s}return c(t)}(),xe=["parameters"],Se=function(e){l(n,ve);var t=E(n);function n(e,i,o,s,c,l,f){var p;return a(this,n),u(h(p=t.call(this,e,i,o,s,c,l,f)),"buildExperienceUrl",(function(e){var t=p.transformedContentOptions,n=t.parameters,i=d(t,xe),o=p.internalExperience,a=o.contextId,s=o.discriminator;return[e,[p.buildQueryString(r(r({},i),{},{contextId:a,discriminator:s})),p.buildParameterString(n)].join("#")].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return c(n)}(),Te=["parameters","locale","attributionOptions","sheetOptions","toolbarOptions","themeOptions","onMessage"],Re=function(e){l(i,oe);var n=E(i);function i(e,s,c,l){var f;a(this,i),u(h(f=n.call(this,e,s,c,l)),"initiatePrint",o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.INITIATE_PRINT)));case 1:case"end":return e.stop()}}),e)})))),u(h(f),"undo",o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.UNDO)));case 1:case"end":return e.stop()}}),e)})))),u(h(f),"redo",o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.REDO)));case 1:case"end":return e.stop()}}),e)})))),u(h(f),"toggleBookmarksPane",o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.TOGGLE_BOOKMARKS_PANE)));case 1:case"end":return e.stop()}}),e)})))),u(h(f),"getParameters",o(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(A.GET_PARAMETERS));case 2:if(r=e.sent,Array.isArray(null==r?void 0:r.message)){e.next=5;break}throw new Error("Failed to retrieve the parameters");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})))),u(h(f),"getSheets",o(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(A.GET_SHEETS));case 2:if(r=e.sent,Array.isArray(null==r?void 0:r.message)){e.next=5;break}throw new Error("Failed to retrieve the sheets");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})))),u(h(f),"addFilterGroups",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.ADD_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"updateFilterGroups",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.UPDATE_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"removeFilterGroups",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.REMOVE_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"getFilterGroupsForSheet",function(){var e=o(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(A.GET_FILTER_GROUPS_FOR_SHEET,{SheetId:r}));case 2:if(n=e.sent,Array.isArray(null==n?void 0:n.message)){e.next=5;break}throw new Error("Failed to retrieve filter groups for the sheet");case 5:return e.abrupt("return",n.message);case 6:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"getFilterGroupsForVisual",function(){var e=o(t().mark((function e(r,n){var i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(A.GET_FILTER_GROUPS_FOR_VISUAL,{SheetId:r,VisualId:n}));case 2:if(i=e.sent,Array.isArray(null==i?void 0:i.message)){e.next=5;break}throw new Error("Failed to retrieve filter groups for the visual");case 5:return e.abrupt("return",i.message);case 6:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}()),u(h(f),"getVisualActions",function(){var e=o(t().mark((function e(r,n){var i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(A.GET_VISUAL_ACTIONS,{SheetId:r,VisualId:n}));case 2:if(i=e.sent,Array.isArray(null==i?void 0:i.message)){e.next=5;break}throw new Error("Failed to retrieve the visual actions");case 5:return e.abrupt("return",i.message);case 6:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}()),u(h(f),"addVisualActions",function(){var e=o(t().mark((function e(r,n,i){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.ADD_VISUAL_ACTIONS,{SheetId:r,VisualId:n,Actions:i})));case 1:case"end":return e.stop()}}),e)})));return function(r,t,n){return e.apply(this,arguments)}}()),u(h(f),"setVisualActions",function(){var e=o(t().mark((function e(r,n,i){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.SET_VISUAL_ACTIONS,{SheetId:r,VisualId:n,Actions:i})));case 1:case"end":return e.stop()}}),e)})));return function(r,t,n){return e.apply(this,arguments)}}()),u(h(f),"getSelectedSheetId",o(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(A.GET_SELECTED_SHEET_ID));case 2:if(null!=(r=e.sent)&&r.message){e.next=5;break}throw new Error("Failed to retrieve the selected sheet id");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})))),u(h(f),"setSelectedSheetId",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.SET_SELECTED_SHEET_ID,{SheetId:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"setTheme",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.SET_THEME,{ThemeArn:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"navigateToDashboard",function(){var e=o(t().mark((function e(r,n){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.NAVIGATE_TO_DASHBOARD,{DashboardId:r,Parameters:null==n?void 0:n.parameters})));case 1:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}()),u(h(f),"removeVisualActions",function(){var e=o(t().mark((function e(r,n,i){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.REMOVE_VISUAL_ACTIONS,{SheetId:r,VisualId:n,Actions:i})));case 1:case"end":return e.stop()}}),e)})));return function(r,t,n){return e.apply(this,arguments)}}()),u(h(f),"getSheetVisuals",function(){var e=o(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(A.GET_SHEET_VISUALS,{SheetId:r}));case 2:if(n=e.sent,Array.isArray(null==n?void 0:n.message)){e.next=5;break}throw new Error("Failed to retrieve the sheet visuals");case 5:return e.abrupt("return",n.message);case 6:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"setParameters",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.SET_PARAMETERS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"reset",o(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.RESET)));case 1:case"end":return e.stop()}}),e)})))),u(h(f),"setThemeOverride",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.SET_THEME_OVERRIDE,{ThemeOverride:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"extractExperienceFromUrl",(function(e){var r,t,n=/^https:\/\/[^/]+\/embed\/[^/]+\/dashboards\/([\w-]+)(\?|$)/i.exec(e)||[];if(n.length<3)throw null===(r=(t=f.frameOptions).onChange)||void 0===r||r.call(t,new B(R.INVALID_URL,b.ERROR,"Invalid dashboard experience url",{url:e}),{frame:null}),new Error("Invalid dashboard experience URL");return{experienceType:M.DASHBOARD,dashboardId:n[1]}})),u(h(f),"interceptMessage",(function(e,r){var t,n,i;"SIZE_CHANGED"===e.eventName&&f.frameOptions.resizeHeightOnSizeChangedEvent&&(null==r||null===(t=r.frame)||void 0===t||null===(n=t.setAttribute)||void 0===n||n.call(t,"height","".concat(null==e||null===(i=e.message)||void 0===i?void 0:i.height,"px")))})),u(h(f),"transformDashboardContentOptions",(function(e){var t,n=e.parameters,i=e.locale,o=e.attributionOptions,a=e.sheetOptions,s=e.toolbarOptions,c=e.themeOptions;e.onMessage;var l=d(e,Te),p=f.transformContentOptions({locale:i},l);return Array.isArray(n)&&(p.parameters=n.reduce((function(e,t){return r(r({},e),{},u({},t.Name,t.Values))}),{})),!0!==(null==o?void 0:o.overlayContent)&&(p.footerPaddingEnabled=!0),(null!=s&&s.export||null!=s&&null!==(t=s.export)&&void 0!==t&&t.print)&&(p.printEnabled=!0),!0!==(null==s?void 0:s.undoRedo)&&(p.undoRedoDisabled=!0),!0!==(null==s?void 0:s.reset)&&(p.resetDisabled=!0),!0===(null==s?void 0:s.bookmarks)&&(p.showBookmarksIcon=!0),null!=a&&a.initialSheetId&&(p.sheetId=a.initialSheetId),"boolean"==typeof(null==a?void 0:a.singleSheet)&&(p.sheetTabsDisabled=a.singleSheet),null!=a&&a.emitSizeChangedEventOnSheetChange&&(p.resizeOnSheetChange=!0),null!=c&&c.themeArn&&(p.themeArn=c.themeArn),p})),f.experience=f.extractExperienceFromUrl(e.url);var p=f.getInternalExperienceInfo(f.experience),E=p.experienceIdentifier,v=p.internalExperience;return f.internalExperience=v,f.experienceId=E,f.experienceFrame=new Se(e,c,s,f.transformDashboardContentOptions(s),v,E,f.interceptMessage),f}return c(i)}(),Ae=function(e){l(n,ve);var t=E(n);function n(e,i,o,s,c,l,f){var p;return a(this,n),u(h(p=t.call(this,e,i,o,s,c,l,f)),"buildExperienceUrl",(function(e){var t=p.internalExperience,n=t.contextId,i=t.discriminator;return[e,p.buildQueryString(r(r({},p.transformedContentOptions),{},{contextId:n,discriminator:i}))].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return c(n)}(),be=["hideIcon","hideTopicName","theme","allowTopicSelection","onMessage"],Ne=function(e){l(i,oe);var r=E(i);function i(e,s,c,l){var f;a(this,i),u(h(f=r.call(this,e,s,c,l)),"close",(function(){return f.send(new q(A.CLOSE_Q_SEARCH))})),u(h(f),"setQuestion",function(){var e=o(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(A.SET_Q_SEARCH_QUESTION,{question:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(h(f),"extractExperienceFromUrl",(function(e){var r,t;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/q\/search(\/|\?|$)/i.exec(e)||[]).length<2)throw null===(r=(t=f.frameOptions).onChange)||void 0===r||r.call(t,new B(R.INVALID_URL,b.ERROR,"Invalid q-search experience URL",{url:e}),{frame:f.experienceFrame.iframe}),new Error("Invalid q-search experience URL");return{experienceType:M.QSEARCH}})),u(h(f),"interceptMessage",(function(e,r){switch(e.eventName){case A.Q_SEARCH_OPENED:case A.Q_SEARCH_CLOSED:var t,o;if("object"===n(e.message))null==r||null===(t=r.frame)||void 0===t||t.style.setProperty("height","".concat(null==e||null===(o=e.message)||void 0===o?void 0:o.height,"px"));break;case A.CONTENT_LOADED:var a=function(e){var r;(null===(r=f.experienceFrame.iframe)||void 0===r||!r.contains(e.target))&&f.close()};window.addEventListener("click",a),f.controlOptions.eventManager.addEventListenerForCleanup(f.experienceId,(function(){return window.removeEventListener("click",a)}));break;case A.Q_SEARCH_ENTERED_FULLSCREEN:var s,c;if(!f.frameStyles&&null!=r&&r.frame)f.frameStyles={position:null===(s=r.frame)||void 0===s?void 0:s.style.position,top:null===(c=r.frame)||void 0===c?void 0:c.style.top,left:r.frame.style.left,zIndex:r.frame.style.zIndex,width:r.frame.style.width,height:r.frame.style.height},r.frame.style.position="fixed",r.frame.style.top="0px",r.frame.style.left="0px",r.frame.style.zIndex=i.MAX_Z_INDEX,r.frame.style.width="100vw",r.frame.style.height="100vh";break;case A.Q_SEARCH_EXITED_FULLSCREEN:f.frameStyles&&null!=r&&r.frame&&(r.frame.style.position=f.frameStyles.position,r.frame.style.top=f.frameStyles.top,r.frame.style.left=f.frameStyles.left,r.frame.style.zIndex=f.frameStyles.zIndex,r.frame.style.width=f.frameStyles.width,r.frame.style.height=f.frameStyles.height)}})),u(h(f),"transformQSearchContentOptions",(function(e){var r=e.hideIcon,t=e.hideTopicName,n=e.theme,i=e.allowTopicSelection;e.onMessage;var o=d(e,be),a=f.transformContentOptions({allowTopicSelection:i},o);return void 0!==r&&(a.qBarIconDisabled=r),void 0!==t&&(a.qBarTopicNameDisabled=t),void 0!==n&&(a.themeId=n),a})),f.experience=f.extractExperienceFromUrl(e.url);var p=f.getInternalExperienceInfo(f.experience),E=p.experienceIdentifier,v=p.internalExperience;return f.internalExperience=v,f.experienceId=E,f.experienceFrame=new Ae(e,c,s,f.transformQSearchContentOptions(s),v,E,f.interceptMessage),f}return c(i)}();u(Ne,"MAX_Z_INDEX","2147483647");var Ce=function(e){l(n,ve);var t=E(n);function n(e,i,o,s,c,l,f){var p;return a(this,n),u(h(p=t.call(this,e,i,o,s,c,l,f)),"buildExperienceUrl",(function(e){var t=p.internalExperience,n=t.contextId,i=t.discriminator;return[e,p.buildQueryString(r(r({},p.transformedContentOptions),{},{contextId:n,discriminator:i}))].join("?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return c(n)}(),Le=c((function e(t,n,i,o){var s=this;a(this,e),u(this,"experience",{experienceType:M.CONTROL}),u(this,"iframe",null),u(this,"send",(function(e){var r;return null===(r=s.internalSend)||void 0===r?void 0:r.call(s,e)})),u(this,"controlFrameMessageListener",(function(e){if(s.isMessageEvent(e.data)){var r=e.data;try{if(r.eventTarget){var t=oe.getExperienceIdentifier(r.eventTarget);s.eventManager.invokeEventListener(t,r)}s.sendAcknowledgment(r)}catch(e){var n,i;null===(n=s.onChange)||void 0===n||n.call(s,new B(R.UNRECOGNIZED_EVENT_TARGET,b.WARN,"Message with unrecognized event target received",{eventTarget:r.eventTarget}),{frame:s.iframe}),null===(i=s.logger)||void 0===i||i.warn("Message with unrecognized event target received")}}})),u(this,"setLogger",(function(e){return s.logger=e,s})),u(this,"initializeFrame",(function(){var r=s.getControlExperienceBaseUrl(),t=s.getControlExperienceId();s.onMessage&&s.eventManager.addEventListener(t,s.onMessage,!0);var n=new Ce({url:r,container:s.container,width:"0px",height:"0px",onChange:s.onChange},{eventManager:s.eventManager,contextId:s.internalExperience.contextId,timeout:e.FRAME_TIMEOUT,urlInfo:s.urlInfo},{onMessage:s.onMessage},{},s.internalExperience,t);s.internalSend=n.send,s.iframe=n.iframe,window.addEventListener("message",s.controlFrameMessageListener),s.eventManager.addEventListenerForCleanup(t,(function(){return window.removeEventListener("message",s.controlFrameMessageListener)}))})),u(this,"sendAcknowledgment",(function(e){var r,t,n=new Z(A.ACKNOWLEDGE,s.internalExperience,{eventName:e.eventName,eventTarget:e.eventTarget});(null===(r=(t=window).requestIdleCallback)||void 0===r?void 0:r.call(t,(function(){return s.send(n)})))||s.send(n)})),u(this,"getControlExperienceId",(function(){return[s.internalExperience.contextId,s.internalExperience.experienceType,s.internalExperience.discriminator].filter(Boolean).join("-")})),u(this,"getControlExperienceBaseUrl",(function(){var e=s.urlInfo,r=e.host,t=e.sessionId,n="".concat(r,"/embed/").concat(t,"/embedControl");return new URL(n).href})),u(this,"isMessageEvent",(function(e){return!!e&&!!e.eventTarget&&!!e.eventName})),this.container=t,this.eventManager=n.eventManager,this.urlInfo=n.urlInfo,this.internalExperience=r(r({},this.experience),{},{contextId:n.contextId,discriminator:0}),this.onMessage=o,this.onChange=i,this.initializeFrame()}));u(Le,"FRAME_TIMEOUT",6e4);var De=c((function e(){var r=this;a(this,e),u(this,"addEventListener",(function(e,t,n){if(!e)throw new Error("Experience identifier is required when calling addEventListener");if("function"!=typeof t)throw new Error("Invalid type provided for event listener");var i=r.eventListeners.get(e);return n&&r.addEventListenerForCleanup(e,(function(){return r.removeEventListener(e,t)})),i?(i.push(t),r):(r.eventListeners.set(e,[t]),r)})),u(this,"invokeEventListener",(function(e,t){var n=r.eventListeners.get(e);if(!n)throw new Error("Unable to find experience specific event listeners: ".concat(e));return n.forEach((function(e){e(t)})),r})),u(this,"removeEventListener",(function(e,t){var n=r.eventListeners.get(e);if(!n)throw new Error("Unable to find experience specific event listeners: ".concat(e));var i=n.filter((function(e){return e!==t}));return r.eventListeners.set(e,i),r})),u(this,"addEventListenerForCleanup",(function(e,t){var n,i=null!==(n=r.cleanUpCallbacks.get(e))&&void 0!==n?n:[];i.push(t),r.cleanUpCallbacks.set(e,i)})),u(this,"cleanUpCallbacksForExperience",(function(e){var t=r.cleanUpCallbacks.get(e);t&&(t.forEach((function(e){return e()})),r.cleanUpCallbacks.delete(e),r.eventListeners.set(e,[]))})),this.eventListeners=new Map,this.cleanUpCallbacks=new Map})),Ue=c((function e(){a(this,e),u(this,"log",console.log),u(this,"warn",console.warn),u(this,"error",console.error),u(this,"debug",console.debug),u(this,"info",console.info)})),Me=c((function e(r){var i=this;a(this,e),u(this,"embedVisual",function(){var e=o(t().mark((function e(r){var n,o,a=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},i.validateFrameOptions(r,"embedVisual"),o=i.buildControlOptions(r),e.abrupt("return",new we(r,n,o,i.experienceIdentifiers).setLogProvider(i.logger));case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(this,"embedDashboard",function(){var e=o(t().mark((function e(r){var n,o,a=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},i.validateFrameOptions(r,"embedDashboard"),o=i.buildControlOptions(r),e.abrupt("return",new Re(r,n,o,i.experienceIdentifiers).setLogProvider(i.logger));case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(this,"embedConsole",function(){var e=o(t().mark((function e(r){var n,o,a=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},i.validateFrameOptions(r,"embedConsole"),o=i.buildControlOptions(r),e.abrupt("return",new ye(r,n,o,i.experienceIdentifiers).setLogProvider(i.logger));case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(this,"embedQSearchBar",function(){var e=o(t().mark((function e(r){var n,o,a=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},i.validateFrameOptions(r,"embedQSearchBar"),o=i.buildControlOptions(r),e.abrupt("return",new Ne(r,n,o,i.experienceIdentifiers).setLogProvider(i.logger));case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),u(this,"validateFrameOptions",(function(e,r){if(!e){var t="".concat(r," is called without frameOptions");throw i.onChange(new B(R.NO_FRAME_OPTIONS,b.ERROR,"".concat(r," is called without frameOptions"),{methodName:r}),{frame:null}),new Error(t)}if("object"!==n(e)||Array.isArray(e)){var o="".concat(r," is called with non-object frameOptions");throw i.onChange(new B(R.INVALID_FRAME_OPTIONS,b.ERROR,o,{methodName:r,frameOptionsType:Array.isArray(e)?"array":n(e)}),{frame:null}),new Error(o)}var a=["url","container","width","height","resizeHeightOnSizeChangedEvent","withIframePlaceholder","onChange","className"],s=Object.keys(e).filter((function(e){return!a.includes(e)}));if(s.length>0){var c,u,l="".concat(r," is called with unrecognized properties");null===(c=e.onChange)||void 0===c||c.call(e,new B(R.UNRECOGNIZED_FRAME_OPTIONS,b.WARN,l,{unrecognizedFrameOptions:s}),{frame:null}),null===(u=i.logger)||void 0===u||u.warn(l)}})),u(this,"buildControlOptions",(function(e){if(!i.controlOptions){if(!e.url)throw new Error("URL is missing in frame options, but is a required field");var r=i.getControlUrlInfo(e.url),t=new Le(i.getBodyElement(),{eventManager:i.eventManager,urlInfo:r,contextId:i.contextId},i.onChange).setLogger(i.logger);i.controlOptions={eventManager:i.eventManager,sendToControlFrame:t.send,contextId:i.contextId,timeout:Le.FRAME_TIMEOUT,urlInfo:r}}return i.controlOptions})),u(this,"onChange",(function(e,r){i.contextOnChange&&i.contextOnChange(e,r)})),u(this,"getControlUrlInfo",(function(e){var r=/^(https:\/\/[^/]+)\/(embedding|embed)\/([^/]+)\/[^?]+\?(.*)/i.exec(e)||[];if((null==r?void 0:r.length)<4)throw new Error('Invalid embedding url: "'.concat(e,'"'));return{sessionId:r[3],host:r[1],urlSearchParams:new URLSearchParams(r[4])}})),u(this,"getBodyElement",(function(){var e,r=null===(e=document.getElementsByTagName("body"))||void 0===e?void 0:e[0];if(!r){var t="could not locate <body> element in the page";throw i.onChange(new B(R.NO_BODY,b.ERROR,t),{frame:null}),new Error(t)}return r})),this.contextId=ie(),this.experienceIdentifiers=new Set,this.eventManager=new De,this.contextOnChange=r.onChange,this.logger=new Ue})),Pe=function(){var e=o(t().mark((function e(){var r,n=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>0&&void 0!==n[0]?n[0]:{},e.abrupt("return",new Me(r));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Fe=r(r(r(r(r(r(r(r(r(r(r(r({},U),T),N),C),L),D),P),F),j),H),V),Q);export{oe as BaseExperience,ve as BaseExperienceFrame,G as CALCULATED_METRIC_COLUMN_TYPE,B as ChangeEvent,b as ChangeEventLevel,R as ChangeEventName,ye as ConsoleExperience,_e as ConsoleExperienceFrame,Le as ControlExperience,Ce as ControlExperienceFrame,Re as DashboardExperience,Se as DashboardExperienceFrame,$ as DataResponse,Ue as DefaultLogger,Me as EmbeddingContext,z as EmbeddingEvent,q as EmbeddingMessageEvent,_ as ErrorChangeEventName,Y as ErrorResponse,De as EventManager,M as ExperienceType,x as GetterMessageEventName,he as Iframe,w as InfoChangeEventName,O as InfoMessageEventName,S as InvokerMessageEventName,A as MessageEventName,K as PostMessageEvent,Fe as QSE,Ne as QSearchExperience,Ae as QSearchExperienceFrame,W as ResponseMessage,Ee as SDK_VERSION,k as SPECIAL_DATAPOINT_VALUE_TYPES,y as SetterMessageEventName,X as SuccessResponse,Z as TargetedMessageEvent,we as VisualExperience,ge as VisualExperienceFrame,I as WarnChangeEventName,Pe as createEmbeddingContext}; | ||
function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?e(Object(n),!0).forEach((function(e){u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(){r=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var o=t&&t.prototype instanceof d?t:d,a=Object.create(o.prototype),s=new S(n||[]);return i(a,"_invoke",{value:I(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var p={};function d(){}function h(){}function E(){}var v={};u(v,a,(function(){return this}));var m=Object.getPrototypeOf,O=m&&m(m(R([])));O&&O!==t&&n.call(O,a)&&(v=O);var g=E.prototype=d.prototype=Object.create(v);function w(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function r(i,o,a,s){var c=f(e[i],e,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function I(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return A()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=y(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=f(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function y(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,y(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var i=f(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,p;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function R(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:A}}function A(){return{value:void 0,done:!0}}return h.prototype=E,i(g,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:h,configurable:!0}),h.displayName=u(E,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,u(e,c,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},w(_.prototype),u(_.prototype,s,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new _(l(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(g),u(g,c,"Generator"),u(g,a,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=R,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:R(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}function n(e){return n="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},n(e)}function i(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function o(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function s(e){i(a,n,o,s,c,"next",e)}function c(e){i(a,n,o,s,c,"throw",e)}s(void 0)}))}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,O(n.key),n)}}function c(e,t,r){return t&&s(e.prototype,t),r&&s(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,t,r){return(t=O(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}function d(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=f(e);if(t){var i=f(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}(this,r)}}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],c=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function O(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var g={CALLBACK_OPERATION_INVOKED:"CALLBACK_OPERATION_INVOKED",CONTENT_LOADED:"CONTENT_LOADED",EXPERIENCE_INITIALIZED:"EXPERIENCE_INITIALIZED",ERROR_OCCURRED:"ERROR_OCCURRED",SIZE_CHANGED:"SIZE_CHANGED",PARAMETERS_CHANGED:"PARAMETERS_CHANGED",SELECTED_SHEET_CHANGED:"SELECTED_SHEET_CHANGED",MODAL_OPENED:"MODAL_OPENED",Q_SEARCH_CLOSED:"Q_SEARCH_CLOSED",Q_SEARCH_OPENED:"Q_SEARCH_OPENED",Q_SEARCH_SIZE_CHANGED:"Q_SEARCH_SIZE_CHANGED",Q_SEARCH_ENTERED_FULLSCREEN:"Q_SEARCH_ENTERED_FULLSCREEN",Q_SEARCH_EXITED_FULLSCREEN:"Q_SEARCH_EXITED_FULLSCREEN"},w={FRAME_STARTED:"FRAME_STARTED",FRAME_MOUNTED:"FRAME_MOUNTED",FRAME_LOADED:"FRAME_LOADED",FRAME_REMOVED:"FRAME_REMOVED"},_={FRAME_NOT_CREATED:"FRAME_NOT_CREATED",NO_BODY:"NO_BODY",NO_CONTAINER:"NO_CONTAINER",INVALID_CONTAINER:"INVALID_CONTAINER",NO_URL:"NO_URL",INVALID_URL:"INVALID_URL",NO_FRAME_OPTIONS:"NO_FRAME_OPTIONS",INVALID_FRAME_OPTIONS:"INVALID_FRAME_OPTIONS"},I={UNRECOGNIZED_CONTENT_OPTIONS:"UNRECOGNIZED_CONTENT_OPTIONS",UNRECOGNIZED_FRAME_OPTIONS:"UNRECOGNIZED_FRAME_OPTIONS",UNRECOGNIZED_EVENT_TARGET:"UNRECOGNIZED_EVENT_TARGET"},y={SET_PARAMETERS:"SET_PARAMETERS",SET_SELECTED_SHEET_ID:"SET_SELECTED_SHEET_ID",SET_Q_SEARCH_QUESTION:"SET_Q_SEARCH_QUESTION",SET_VISUAL_ACTIONS:"SET_VISUAL_ACTIONS",SET_THEME:"SET_THEME",ADD_FILTER_GROUPS:"ADD_FILTER_GROUPS",UPDATE_FILTER_GROUPS:"UPDATE_FILTER_GROUPS",REMOVE_FILTER_GROUPS:"REMOVE_FILTER_GROUPS",ADD_VISUAL_ACTIONS:"ADD_VISUAL_ACTIONS",REMOVE_VISUAL_ACTIONS:"REMOVE_VISUAL_ACTIONS",SET_THEME_OVERRIDE:"SET_THEME_OVERRIDE",PRELOAD_THEMES:"PRELOAD_THEMES"},x={GET_PARAMETERS:"GET_PARAMETERS",GET_SHEETS:"GET_SHEETS",GET_SHEET_VISUALS:"GET_SHEET_VISUALS",GET_VISUAL_ACTIONS:"GET_VISUAL_ACTIONS",GET_SELECTED_SHEET_ID:"GET_SELECTED_SHEET_ID",GET_FILTER_GROUPS_FOR_SHEET:"GET_FILTER_GROUPS_FOR_SHEET",GET_FILTER_GROUPS_FOR_VISUAL:"GET_FILTER_GROUPS_FOR_VISUAL"},T={ACKNOWLEDGE:"ACKNOWLEDGE",INITIATE_PRINT:"INITIATE_PRINT",NAVIGATE_TO_DASHBOARD:"NAVIGATE_TO_DASHBOARD",CLOSE_Q_SEARCH:"CLOSE_Q_SEARCH",UNDO:"UNDO",REDO:"REDO",RESET:"RESET",TOGGLE_BOOKMARKS_PANE:"TOGGLE_BOOKMARKS_PANE"},S=Object.freeze({__proto__:null,ErrorChangeEventName:_,GetterMessageEventName:x,InfoChangeEventName:w,InfoMessageEventName:g,InvokerMessageEventName:T,SetterMessageEventName:y,WarnChangeEventName:I}),R=t(t(t({},w),_),I),A=t(t(t(t({},g),y),x),T),b={ERROR:"ERROR",INFO:"INFO",WARN:"WARN"},N=Object.freeze({__proto__:null,ChangeEventLevel:b,ChangeEventName:R,MessageEventName:A}),C=Object.freeze({__proto__:null}),L=Object.freeze({__proto__:null}),D=Object.freeze({__proto__:null}),P=Object.freeze({__proto__:null}),U={CONSOLE:"CONSOLE",CONTEXT:"CONTEXT",CONTROL:"CONTROL",VISUAL:"VISUAL",DASHBOARD:"DASHBOARD",QSEARCH:"QSEARCH"},M=Object.freeze({__proto__:null,ExperienceType:U}),F=Object.freeze({__proto__:null}),k={NULL:null,OTHER_BUCKET:null},G={INTEGER:null,STRING:null,DECIMAL:null,DATETIME:null},j=Object.freeze({__proto__:null,CALCULATED_METRIC_COLUMN_TYPE:G,SPECIAL_DATAPOINT_VALUE_TYPES:k}),V=Object.freeze({__proto__:null}),H=Object.freeze({__proto__:null}),Q=Object.freeze({__proto__:null}),z=c((function e(t,r,n){a(this,e),this.eventName=t,this.message=r,this.data=n})),B=function(e){l(r,z);var t=E(r);function r(e,n,i,o){var s;return a(this,r),(s=t.call(this,e,i,o)).eventLevel=n,s}return c(r)}(),Z=function(e){l(r,z);var t=E(r);function r(e,n,i){var o;return a(this,r),(o=t.call(this,e,n,i)).eventName=e,o}return c(r)}(),q=function(e){l(r,Z);var t=E(r);function r(e,n,i,o){var s;return a(this,r),(s=t.call(this,e,i,o)).eventTarget=n,s}return c(r)}(),X=function(e){l(r,q);var t=E(r);function r(e,n,i,o,s,c,u){var l;return a(this,r),(l=t.call(this,e,n,c,u)).timestamp=o,l.version=s,l.eventId=i,l}return c(r)}(),K=c((function e(){a(this,e)})),W=c((function e(){a(this,e),u(this,"success",!0)})),Y=c((function e(t){a(this,e),u(this,"success",!1),this.errorCode=t.errorCode,this.error=t.error,this.message=t.message})),$=c((function e(t){a(this,e),u(this,"success",!0),this.message=t}));let J;const ee=new Uint8Array(16);function te(){if(!J&&(J="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!J))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return J(ee)}const re=[];for(let e=0;e<256;++e)re.push((e+256).toString(16).slice(1));var ne={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ie(e,t,r){if(ne.randomUUID&&!t&&!e)return ne.randomUUID();const n=(e=e||{}).random||(e.rng||te)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return function(e,t=0){return(re[e[t+0]]+re[e[t+1]]+re[e[t+2]]+re[e[t+3]]+"-"+re[e[t+4]]+re[e[t+5]]+"-"+re[e[t+6]]+re[e[t+7]]+"-"+re[e[t+8]]+re[e[t+9]]+"-"+re[e[t+10]]+re[e[t+11]]+re[e[t+12]]+re[e[t+13]]+re[e[t+14]]+re[e[t+15]]).toLowerCase()}(n)}var oe=c((function e(n,i,s,c){var l=this;a(this,e),u(this,"send",function(){var e=o(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l.experienceFrame&&l.internalExperience){e.next=2;break}throw new Error("Experience has not been initialized");case 2:return n=new q(t.eventName,l.internalExperience,t.message,t.data),e.abrupt("return",l.experienceFrame.send(n));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(this,"addEventListener",(function(e,t){return l.experienceFrame.addInternalEventListener(e,t)})),u(this,"setLogProvider",(function(e){return l.logger=e,l})),u(this,"getInternalExperienceInfo",(function(r){var n,i,o=-1;do{o++,n=t(t({},r),{},{contextId:l.controlOptions.contextId,discriminator:o}),i=e.getExperienceIdentifier(n)}while(l.experienceIdentifiers.has(i));return l.experienceIdentifiers.add(i),{experienceIdentifier:i,internalExperience:n}})),u(this,"transformContentOptions",(function(e,t){var r,n,i,o=Object.keys(t);Object.keys(t).length>0&&(null===(r=(n=l.frameOptions).onChange)||void 0===r||r.call(n,new B(R.UNRECOGNIZED_CONTENT_OPTIONS,b.WARN,"Experience content options contain unrecognized properties",{unrecognizedContentOptions:o}),{frame:null}),null===(i=l.logger)||void 0===i||i.warn("Experience content options contain unrecognized properties"));return e})),u(this,"validateFrameOptions",(function(){if(!l.frameOptions.url){var e,t,r="Url is required for the experience";throw null===(e=(t=l.frameOptions).onChange)||void 0===e||e.call(t,new B(R.NO_URL,b.ERROR,r),{frame:null}),new Error(r)}})),this.frameOptions=n,this.contentOptions=i,this.controlOptions=s,this.experienceIdentifiers=c,this.validateFrameOptions()}));u(oe,"getExperienceIdentifier",(function(e){if(e.experienceType===U.DASHBOARD)return[e.contextId,e.experienceType,e.dashboardId,e.discriminator].filter(Boolean).join("-");if(e.experienceType===U.VISUAL)return[e.contextId,e.experienceType,e.dashboardId,e.sheetId,e.visualId,e.discriminator].filter(Boolean).join("-");if([U.CONSOLE,U.CONTROL,U.CONTEXT,U.QSEARCH].includes(e.experienceType))return[e.contextId,e.experienceType,e.discriminator].filter(Boolean).join("-");throw new Error("Invalid experience unable to build experience identifier")}));const ae=2147483647,se={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ce=Math.floor,ue=String.fromCharCode;function le(e){throw new RangeError(se[e])}const fe=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},pe=function(e,t,r){let n=0;for(e=r?ce(e/700):e>>1,e+=ce(e/t);e>455;n+=36)e=ce(e/35);return ce(n+36*e/(e+38))},de=function(e){const t=[];e=function(e){const t=[];let r=0;const n=e.length;for(;r<n;){const i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){const n=e.charCodeAt(r++);56320==(64512&n)?t.push(((1023&i)<<10)+(1023&n)+65536):(t.push(i),r--)}else t.push(i)}return t}(e);const r=e.length;let n=128,i=0,o=72;for(const r of e)r<128&&t.push(ue(r));const a=t.length;let s=a;for(a&&t.push("-");s<r;){let r=ae;for(const t of e)t>=n&&t<r&&(r=t);const c=s+1;r-n>ce((ae-i)/c)&&le("overflow"),i+=(r-n)*c,n=r;for(const r of e)if(r<n&&++i>ae&&le("overflow"),r===n){let e=i;for(let r=36;;r+=36){const n=r<=o?1:r>=o+26?26:r-o;if(e<n)break;const i=e-n,a=36-n;t.push(ue(fe(n+i%a,0))),e=ce(i/a)}t.push(ue(fe(e,0))),o=pe(i,c,s===a),i=0,++s}++i,++n}return t.join("")};var he=c((function e(t){var r=this;a(this,e),u(this,"classNames",[e.IFRAME_CLASS_NAME]),u(this,"getIframe",(function(){return r.iframe})),u(this,"createIframePlaceholder",(function(t){if(r.iframePlaceholder=document.createElement("div"),r.iframePlaceholder.id="".concat(r.iframeName,"-placeholder"),r.iframePlaceholder.style.width=r.width,r.iframePlaceholder.style.backgroundColor="rgba(0,0,0,.01)",r.iframePlaceholder.style.display="flex",r.iframePlaceholder.style.justifyContent="center",r.iframePlaceholder.style.alignItems="center",r.iframePlaceholder.className="".concat(e.IFRAME_CLASS_NAME,"-placeholder"),r.height.endsWith("px")&&(r.iframePlaceholder.style.height=r.height),t&&"boolean"!=typeof t)r.iframePlaceholder.appendChild(t);else{var n=r.createLoaderSVG();r.iframePlaceholder.appendChild(n)}r.container.appendChild(r.iframePlaceholder)})),u(this,"createIframe",(function(){var e=document.createElement("iframe");return e.className=r.classNames.join(" ").trim(),e.id=r.iframeName,e.name=r.iframeName,e.width=r.width,e.height=r.height,r.loading&&(e.loading=r.loading),e.style.border="0px",e.style.padding="0px",r.iframePlaceholder&&(e.style.opacity="0",e.style.position="absolute"),"0px"===r.width&&"0px"===r.height&&(e.style.position="absolute"),r.container.appendChild(e),r.payload?r.postRequest=r.createPostRequest({src:r.src,target:e.name,container:r.container,payload:r.payload}):e.src=r.src,e})),u(this,"onLoadLocal",(function(e){var t,n;r.iframePlaceholder&&(r.iframePlaceholder.remove(),r.iframe.style.position="",r.iframe.style.opacity="1",r.iframe.style.transition="opacity .5s ease-in-out"),null===(t=r.onLoad)||void 0===t||t.call(r,e),null===(n=r.postRequest)||void 0===n||n.remove()})),u(this,"createPostRequest",(function(e){var t=e.src,r=e.container,n=e.target,i=e.payload;if(!t)throw new Error("No source has been provided.");var o=document.createElement("form");return o.style.visibility="hidden",o.method="POST",o.action=t,o.target=n,o.name="".concat(n,"-form"),Object.keys(i).forEach((function(e){var t=document.createElement("input");t.type="hidden",t.name=e,t.value=i[e],o.appendChild(t)})),r.appendChild(o),null==o||o.submit(),{remove:function(){o.remove()}}})),u(this,"createSvgElement",(function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.entries(t).forEach((function(e){var t=v(e,2),r=t[0],n=t[1];return i.setAttribute(r,n)})),Object.entries(r).forEach((function(e){var t=v(e,2),r=t[0],n=t[1];return i.style.setProperty(r,n)})),n.forEach((function(e){return i.appendChild(e)})),i})),u(this,"createLoaderSVG",(function(){var e=[1,2,3].map((function(e){var t=r.createSvgElement("animate",{attributeName:"opacity",dur:"1s",values:"0;1;0",repeatCount:"indefinite",begin:"".concat(e/10)});return r.createSvgElement("circle",{fill:"#ccc",stroke:"none",cx:"".concat(20*e-14),cy:"50",r:"6"},void 0,[t])}));return r.createSvgElement("svg",{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100","enable-background":"new 0 0 0 0"},{width:"100px",height:"100px"},e)}));var n=t.id,i=t.src,o=t.width,s=void 0===o?"100%":o,c=t.height,l=void 0===c?"100%":c,f=t.container,p=t.onLoad,d=t.loading,h=t.withIframePlaceholder,E=t.payload,m=t.className;this.width=s,this.height=l,this.onLoad=p,this.iframeName=n,this.loading=d,m&&this.classNames.push(m),this.container=f,this.payload=E,this.src=i,h&&this.createIframePlaceholder(h),this.iframe=this.createIframe(),this.iframe.addEventListener("load",this.onLoadLocal)}));u(he,"IFRAME_CLASS_NAME","quicksight-embedding-iframe");var Ee="2.6.0",ve=c((function e(i,s,c,l,f,p,d){var h=this;a(this,e),u(this,"MESSAGE_RESPONSE_TIMEOUT",5e3),u(this,"iframe",null),u(this,"send",function(){var e=o(r().mark((function e(t){var n,i,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h.iframe){e.next=2;break}throw new Error("Cannot send ".concat(t.eventName,": No experience frame found"));case 2:if(i=ie(),o=new X(t.eventName,t.eventTarget,i,Date.now(),Ee,t.message,t.data),null===(n=h.iframe)||void 0===n||null===(n=n.contentWindow)||void 0===n||n.postMessage(o,h.url),t.eventName!==A.ACKNOWLEDGE){e.next=7;break}return e.abrupt("return",Promise.resolve(new W));case 7:return e.abrupt("return",new Promise((function(e,r){var n=function t(r){var n,o,a=r.data;(null==a?void 0:a.eventId)===i&&(window.removeEventListener("message",t),!0===(null===(n=a.message)||void 0===n?void 0:n.success)?e(new W):!1===(null===(o=a.message)||void 0===o?void 0:o.success)?e(new Y(a.message)):e(new $(a.message)))};window.addEventListener("message",n),setTimeout((function(){window.removeEventListener("message",n),r("".concat(t.eventName," timed out"))}),h.MESSAGE_RESPONSE_TIMEOUT)})));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(this,"buildParameterString",(function(e){return e&&"object"===n(e)?Object.entries(e).map((function(e){var t=v(e,2),r=t[0],n=t[1],i=Array.isArray(n)?n:[n],o=encodeURIComponent(r);return i.map(encodeURIComponent).map((function(e){return"p.".concat(o,"=").concat(e)})).join("&")})).join("&"):""})),u(this,"buildQueryString",(function(e){var r=Object.entries(e).reduce((function(e,r){var n=v(r,2),i=n[0],o=n[1];return null!=o?t(t({},e),{},u({},i,"".concat(o))):e}),{punyCodeEmbedOrigin:de("".concat(window.location.origin,"/")),sdkVersion:Ee});return new URLSearchParams(r).toString()})),u(this,"createExperienceIframe",(function(){h.onChange(new B(R.FRAME_STARTED,b.INFO,"Creating the frame",{experience:h.internalExperience}));try{h.setTimeoutInstance(),h.iframe=new he({id:h.experienceId,src:h.url,width:h.frameOptions.width,height:h.frameOptions.height,container:h.container,onLoad:h.onLoadHandler,withIframePlaceholder:h.frameOptions.withIframePlaceholder,className:h.frameOptions.className}).getIframe()}catch(e){throw h.onChange(new B(R.FRAME_NOT_CREATED,b.ERROR,"Failed to create the frame",{experience:h.internalExperience})),e}h.onChange(new B(R.FRAME_MOUNTED,b.INFO,"The frame mounted",{experience:h.internalExperience,frame:h.iframe}))})),u(this,"addInternalEventListener",(function(e,t){var r=function(r,n){r.eventName===e&&t(r,n)};return h.controlOptions.eventManager.addEventListener(h.experienceId,r,!0),{remove:function(){return h.controlOptions.eventManager.removeEventListener(h.experienceId,r)}}})),u(this,"validateBaseUrl",(function(e){if(!e)throw h.onChange(new B(R.NO_URL,b.ERROR,"Url is required for the experience",{experience:h.internalExperience})),new Error("Url is required for the experience");return e})),u(this,"setTimeoutInstance",(function(){h.timeoutInstance=setTimeout((function(){throw h.onChange(new B(R.FRAME_NOT_CREATED,b.ERROR,"Creating the frame timed out",{experience:h.internalExperience})),new Error("Creating the frame timed out")}),h.controlOptions.timeout)})),u(this,"onLoadHandler",o(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h.timeoutInstance&&clearTimeout(h.timeoutInstance),h.onChange(new B(R.FRAME_LOADED,b.INFO,"The experience iframe loaded",{experience:h.internalExperience}));case 2:case"end":return e.stop()}}),e)})))),u(this,"getContainer",(function(e){if(!e){var t="Container is required for the experience";throw h.onChange(new B(R.NO_CONTAINER,b.ERROR,t,{experience:h.internalExperience})),new Error(t)}var r=null;if("string"==typeof e)try{r=document.querySelector(e)}catch(e){throw e instanceof Error&&h.onChange(new B(R.INVALID_CONTAINER,b.ERROR,e.message,{experience:h.internalExperience})),e}else"object"===n(e)&&e.nodeName&&(r=e);if(!r){var i="Invalid container '".concat(e,"' for the experience");throw h.onChange(new B(R.INVALID_CONTAINER,b.ERROR,i,{experience:h.internalExperience})),new Error(i)}return r})),u(this,"decorateOnChange",(function(e){return function(t){if(e){var r={frame:h.iframe};e(t,r)}}})),u(this,"decorateOnMessage",(function(e,t){return function(r){t&&h.iframe&&t(r,{frame:h.iframe}),e&&e(r,{frame:h.iframe})}})),u(this,"initializeMutationObserver",(function(){var e=new MutationObserver((function(t){t.some((function(e){return Array.from(e.removedNodes).some((function(e){return e===h.iframe||e===h.container}))}))&&(h.controlOptions.eventManager.cleanUpCallbacksForExperience(h.experienceId),e.disconnect(),h.iframe=null,h.onChange(new B(R.FRAME_REMOVED,b.INFO,"Frame removed from the DOM",{experience:h.internalExperience})))}));e.observe(document.body,{childList:!0,subtree:!0})})),this.frameOptions=i,this.contentOptions=c,this.onChange=this.decorateOnChange(i.onChange),this.onMessage=this.decorateOnMessage(c.onMessage,d),this.container=this.getContainer(i.container),this.internalExperience=f,this.controlOptions=s,this.transformedContentOptions=l,this.experienceId=p,this.url=this.validateBaseUrl(i.url),this.controlOptions.eventManager.addEventListener(this.experienceId,this.onMessage,!0),this.initializeMutationObserver()})),me=["parameters"],Oe=function(e){l(n,ve);var r=E(n);function n(e,i,o,s,c,l,f){var p;return a(this,n),u(h(p=r.call(this,e,i,o,s,c,l,f)),"buildExperienceUrl",(function(e){var r=p.transformedContentOptions,n=r.parameters,i=d(r,me),o=p.internalExperience,a=o.contextId,s=o.discriminator;return[e,[p.buildQueryString(t(t({},i),{},{contextId:a,discriminator:s})),p.buildParameterString(n)].join("#")].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return c(n)}(),ge=["fitToIframeWidth","locale","parameters","themeOptions","onMessage"],we=function(e){l(i,oe);var n=E(i);function i(e,s,c,l){var f;a(this,i),u(h(f=n.call(this,e,s,c,l)),"setParameters",function(){var e=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.SET_PARAMETERS,t)));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(h(f),"reset",o(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.RESET)));case 1:case"end":return e.stop()}}),e)})))),u(h(f),"addFilterGroups",function(){var e=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.ADD_FILTER_GROUPS,t)));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(h(f),"updateFilterGroups",function(){var e=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.UPDATE_FILTER_GROUPS,t)));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(h(f),"removeFilterGroups",function(){var e=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.REMOVE_FILTER_GROUPS,t)));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(h(f),"getFilterGroups",o(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new Z(A.GET_FILTER_GROUPS_FOR_VISUAL));case 2:if(t=e.sent,Array.isArray(null==t?void 0:t.message)){e.next=5;break}throw new Error("Failed to retrieve filter groups for the visual");case 5:return e.abrupt("return",t.message);case 6:case"end":return e.stop()}}),e)})))),u(h(f),"getActions",o(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new Z(A.GET_VISUAL_ACTIONS));case 2:if(t=e.sent,Array.isArray(null==t?void 0:t.message)){e.next=5;break}throw new Error("Failed to retrieve the actions");case 5:return e.abrupt("return",t.message);case 6:case"end":return e.stop()}}),e)})))),u(h(f),"addActions",function(){var e=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.ADD_VISUAL_ACTIONS,{Actions:t})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(h(f),"setActions",function(){var e=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.SET_VISUAL_ACTIONS,{Actions:t})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(h(f),"removeActions",function(){var e=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.REMOVE_VISUAL_ACTIONS,{Actions:t})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(h(f),"setTheme",function(){var e=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.SET_THEME,{ThemeArn:t})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(h(f),"setThemeOverride",function(){var e=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.SET_THEME_OVERRIDE,{ThemeOverride:t})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(h(f),"setPreloadThemes",function(){var e=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.PRELOAD_THEMES,{PreloadThemes:t})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(h(f),"extractExperienceFromUrl",(function(e){var t,r,n=/^https:\/\/[^/]+\/embed\/[^/]+\/dashboards\/([\w-]+)\/sheets\/([\w-]+)\/visuals\/([\w-]+)(\?|$)/i.exec(e)||[];if(n.length<5)throw null===(t=(r=f.frameOptions).onChange)||void 0===t||t.call(r,new B(R.INVALID_URL,b.ERROR,"Invalid visual experience url",{url:e}),{frame:f.experienceFrame.iframe}),new Error("Invalid visual experience URL");return{experienceType:U.VISUAL,dashboardId:n[1],sheetId:n[2],visualId:n[3]}})),u(h(f),"interceptMessage",(function(e,t){var r,n,i,o,a;"SIZE_CHANGED"===e.eventName&&f.frameOptions.resizeHeightOnSizeChangedEvent&&(null==t||null===(i=t.frame)||void 0===i||null===(o=i.setAttribute)||void 0===o||o.call(i,"height","".concat(null===(a=e.message)||void 0===a?void 0:a.height,"px")));"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(r=f.contentOptions)&&void 0!==r&&null!==(r=r.themeOptions)&&void 0!==r&&r.themeOverride&&f.setThemeOverride(f.contentOptions.themeOptions.themeOverride),"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(n=f.contentOptions)&&void 0!==n&&null!==(n=n.themeOptions)&&void 0!==n&&n.preloadThemes&&f.setPreloadThemes(f.contentOptions.themeOptions.preloadThemes)})),u(h(f),"transformVisualContentOptions",(function(e){var r=e.fitToIframeWidth,n=e.locale,i=e.parameters,o=e.themeOptions;e.onMessage;var a=d(e,ge),s=f.transformContentOptions({fitToIframeWidth:null==r||r,locale:n},a);return Array.isArray(i)&&(s.parameters=i.reduce((function(e,r){return t(t({},e),{},u({},r.Name,r.Values))}),{})),null!=o&&o.themeArn&&(s.themeArn=o.themeArn),s})),f.experience=f.extractExperienceFromUrl(e.url);var p=f.getInternalExperienceInfo(f.experience),E=p.experienceIdentifier,v=p.internalExperience;return f.internalExperience=v,f.experienceId=E,f.experienceFrame=new Oe(e,c,s,f.transformVisualContentOptions(s),v,E,f.interceptMessage),f}return c(i)}(),_e=function(e){l(n,ve);var r=E(n);function n(e,i,o,s,c,l,f){var p;return a(this,n),u(h(p=r.call(this,e,i,o,s,c,l,f)),"buildExperienceUrl",(function(e){var r=p.internalExperience,n=r.contextId,i=r.discriminator;return[e,p.buildQueryString(t(t({},p.transformedContentOptions),{},{contextId:n,discriminator:i}))].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return c(n)}(),Ie=["locale","onMessage"],ye=function(e){l(r,oe);var t=E(r);function r(e,n,i,o){var s;a(this,r),u(h(s=t.call(this,e,n,i,o)),"extractExperienceFromUrl",(function(e){var t,r;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/(start(\/(favorites|dashboards|analyses))?|dashboards\/[\w-]+|analyses\/[\w-]+)(\?|$)/i.exec(e)||[]).length<5)throw null===(t=(r=s.frameOptions).onChange)||void 0===t||t.call(r,new B(R.INVALID_URL,b.ERROR,"Invalid console experience url",{url:e}),{frame:s.experienceFrame.iframe}),new Error("Invalid console experience URL");return{experienceType:U.CONSOLE}})),s.experience=s.extractExperienceFromUrl(e.url);var c=s.getInternalExperienceInfo(s.experience),l=c.experienceIdentifier,f=c.internalExperience;s.internalExperience=f,s.experienceId=l;var p=n.locale;n.onMessage;var E=d(n,Ie),v=s.transformContentOptions({locale:p},E);return s.experienceFrame=new _e(e,i,n,v,f,l),s}return c(r)}(),xe=["parameters"],Te=function(e){l(n,ve);var r=E(n);function n(e,i,o,s,c,l,f){var p;return a(this,n),u(h(p=r.call(this,e,i,o,s,c,l,f)),"buildExperienceUrl",(function(e){var r=p.transformedContentOptions,n=r.parameters,i=d(r,xe),o=p.internalExperience,a=o.contextId,s=o.discriminator;return[e,[p.buildQueryString(t(t({},i),{},{contextId:a,discriminator:s})),p.buildParameterString(n)].join("#")].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return c(n)}(),Se=["parameters","locale","attributionOptions","sheetOptions","toolbarOptions","themeOptions","onMessage"],Re=function(e){l(i,oe);var n=E(i);function i(e,s,c,l){var f;a(this,i),u(h(f=n.call(this,e,s,c,l)),"initiatePrint",o(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.INITIATE_PRINT)));case 1:case"end":return e.stop()}}),e)})))),u(h(f),"undo",o(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.UNDO)));case 1:case"end":return e.stop()}}),e)})))),u(h(f),"redo",o(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.REDO)));case 1:case"end":return e.stop()}}),e)})))),u(h(f),"toggleBookmarksPane",o(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.TOGGLE_BOOKMARKS_PANE)));case 1:case"end":return e.stop()}}),e)})))),u(h(f),"getParameters",o(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new Z(A.GET_PARAMETERS));case 2:if(t=e.sent,Array.isArray(null==t?void 0:t.message)){e.next=5;break}throw new Error("Failed to retrieve the parameters");case 5:return e.abrupt("return",t.message);case 6:case"end":return e.stop()}}),e)})))),u(h(f),"getSheets",o(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new Z(A.GET_SHEETS));case 2:if(t=e.sent,Array.isArray(null==t?void 0:t.message)){e.next=5;break}throw new Error("Failed to retrieve the sheets");case 5:return e.abrupt("return",t.message);case 6:case"end":return e.stop()}}),e)})))),u(h(f),"addFilterGroups",function(){var e=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.ADD_FILTER_GROUPS,t)));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(h(f),"updateFilterGroups",function(){var e=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.UPDATE_FILTER_GROUPS,t)));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(h(f),"removeFilterGroups",function(){var e=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.REMOVE_FILTER_GROUPS,t)));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(h(f),"getFilterGroupsForSheet",function(){var e=o(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new Z(A.GET_FILTER_GROUPS_FOR_SHEET,{SheetId:t}));case 2:if(n=e.sent,Array.isArray(null==n?void 0:n.message)){e.next=5;break}throw new Error("Failed to retrieve filter groups for the sheet");case 5:return e.abrupt("return",n.message);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(h(f),"getFilterGroupsForVisual",function(){var e=o(r().mark((function e(t,n){var i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new Z(A.GET_FILTER_GROUPS_FOR_VISUAL,{SheetId:t,VisualId:n}));case 2:if(i=e.sent,Array.isArray(null==i?void 0:i.message)){e.next=5;break}throw new Error("Failed to retrieve filter groups for the visual");case 5:return e.abrupt("return",i.message);case 6:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()),u(h(f),"getVisualActions",function(){var e=o(r().mark((function e(t,n){var i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new Z(A.GET_VISUAL_ACTIONS,{SheetId:t,VisualId:n}));case 2:if(i=e.sent,Array.isArray(null==i?void 0:i.message)){e.next=5;break}throw new Error("Failed to retrieve the visual actions");case 5:return e.abrupt("return",i.message);case 6:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()),u(h(f),"addVisualActions",function(){var e=o(r().mark((function e(t,n,i){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.ADD_VISUAL_ACTIONS,{SheetId:t,VisualId:n,Actions:i})));case 1:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}()),u(h(f),"setVisualActions",function(){var e=o(r().mark((function e(t,n,i){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.SET_VISUAL_ACTIONS,{SheetId:t,VisualId:n,Actions:i})));case 1:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}()),u(h(f),"getSelectedSheetId",o(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new Z(A.GET_SELECTED_SHEET_ID));case 2:if(null!=(t=e.sent)&&t.message){e.next=5;break}throw new Error("Failed to retrieve the selected sheet id");case 5:return e.abrupt("return",t.message);case 6:case"end":return e.stop()}}),e)})))),u(h(f),"setSelectedSheetId",function(){var e=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.SET_SELECTED_SHEET_ID,{SheetId:t})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(h(f),"setTheme",function(){var e=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.SET_THEME,{ThemeArn:t})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(h(f),"navigateToDashboard",function(){var e=o(r().mark((function e(t,n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.NAVIGATE_TO_DASHBOARD,{DashboardId:t,Parameters:null==n?void 0:n.parameters})));case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()),u(h(f),"removeVisualActions",function(){var e=o(r().mark((function e(t,n,i){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.REMOVE_VISUAL_ACTIONS,{SheetId:t,VisualId:n,Actions:i})));case 1:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}()),u(h(f),"getSheetVisuals",function(){var e=o(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new Z(A.GET_SHEET_VISUALS,{SheetId:t}));case 2:if(n=e.sent,Array.isArray(null==n?void 0:n.message)){e.next=5;break}throw new Error("Failed to retrieve the sheet visuals");case 5:return e.abrupt("return",n.message);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(h(f),"setParameters",function(){var e=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.SET_PARAMETERS,t)));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(h(f),"reset",o(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.RESET)));case 1:case"end":return e.stop()}}),e)})))),u(h(f),"setThemeOverride",function(){var e=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.SET_THEME_OVERRIDE,{ThemeOverride:t})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(h(f),"setPreloadThemes",function(){var e=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.PRELOAD_THEMES,{PreloadThemes:t})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(h(f),"extractExperienceFromUrl",(function(e){var t,r,n=/^https:\/\/[^/]+\/embed\/[^/]+\/dashboards\/([\w-]+)(\?|$)/i.exec(e)||[];if(n.length<3)throw null===(t=(r=f.frameOptions).onChange)||void 0===t||t.call(r,new B(R.INVALID_URL,b.ERROR,"Invalid dashboard experience url",{url:e}),{frame:null}),new Error("Invalid dashboard experience URL");return{experienceType:U.DASHBOARD,dashboardId:n[1]}})),u(h(f),"interceptMessage",(function(e,t){var r,n,i,o,a;"SIZE_CHANGED"===e.eventName&&f.frameOptions.resizeHeightOnSizeChangedEvent&&(null==t||null===(i=t.frame)||void 0===i||null===(o=i.setAttribute)||void 0===o||o.call(i,"height","".concat(null==e||null===(a=e.message)||void 0===a?void 0:a.height,"px")));"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(r=f.contentOptions)&&void 0!==r&&null!==(r=r.themeOptions)&&void 0!==r&&r.themeOverride&&f.setThemeOverride(f.contentOptions.themeOptions.themeOverride),"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(n=f.contentOptions)&&void 0!==n&&null!==(n=n.themeOptions)&&void 0!==n&&n.preloadThemes&&f.setPreloadThemes(f.contentOptions.themeOptions.preloadThemes)})),u(h(f),"transformDashboardContentOptions",(function(e){var r,n=e.parameters,i=e.locale,o=e.attributionOptions,a=e.sheetOptions,s=e.toolbarOptions,c=e.themeOptions;e.onMessage;var l=d(e,Se),p=f.transformContentOptions({locale:i},l);return Array.isArray(n)&&(p.parameters=n.reduce((function(e,r){return t(t({},e),{},u({},r.Name,r.Values))}),{})),!0!==(null==o?void 0:o.overlayContent)&&(p.footerPaddingEnabled=!0),(null!=s&&s.export||null!=s&&null!==(r=s.export)&&void 0!==r&&r.print)&&(p.printEnabled=!0),!0!==(null==s?void 0:s.undoRedo)&&(p.undoRedoDisabled=!0),!0!==(null==s?void 0:s.reset)&&(p.resetDisabled=!0),!0===(null==s?void 0:s.bookmarks)&&(p.showBookmarksIcon=!0),null!=a&&a.initialSheetId&&(p.sheetId=a.initialSheetId),"boolean"==typeof(null==a?void 0:a.singleSheet)&&(p.sheetTabsDisabled=a.singleSheet),null!=a&&a.emitSizeChangedEventOnSheetChange&&(p.resizeOnSheetChange=!0),null!=c&&c.themeArn&&(p.themeArn=c.themeArn),p})),f.experience=f.extractExperienceFromUrl(e.url);var p=f.getInternalExperienceInfo(f.experience),E=p.experienceIdentifier,v=p.internalExperience;return f.internalExperience=v,f.experienceId=E,f.experienceFrame=new Te(e,c,s,f.transformDashboardContentOptions(s),v,E,f.interceptMessage),f}return c(i)}(),Ae=function(e){l(n,ve);var r=E(n);function n(e,i,o,s,c,l,f){var p;return a(this,n),u(h(p=r.call(this,e,i,o,s,c,l,f)),"buildExperienceUrl",(function(e){var r=p.internalExperience,n=r.contextId,i=r.discriminator;return[e,p.buildQueryString(t(t({},p.transformedContentOptions),{},{contextId:n,discriminator:i}))].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return c(n)}(),be=["hideIcon","hideTopicName","theme","allowTopicSelection","onMessage"],Ne=function(e){l(i,oe);var t=E(i);function i(e,s,c,l){var f;a(this,i),u(h(f=t.call(this,e,s,c,l)),"close",(function(){return f.send(new Z(A.CLOSE_Q_SEARCH))})),u(h(f),"setQuestion",function(){var e=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.SET_Q_SEARCH_QUESTION,{question:t})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(h(f),"extractExperienceFromUrl",(function(e){var t,r;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/q\/search(\/|\?|$)/i.exec(e)||[]).length<2)throw null===(t=(r=f.frameOptions).onChange)||void 0===t||t.call(r,new B(R.INVALID_URL,b.ERROR,"Invalid q-search experience URL",{url:e}),{frame:f.experienceFrame.iframe}),new Error("Invalid q-search experience URL");return{experienceType:U.QSEARCH}})),u(h(f),"interceptMessage",(function(e,t){switch(e.eventName){case A.Q_SEARCH_OPENED:case A.Q_SEARCH_CLOSED:var r,o;if("object"===n(e.message))null==t||null===(r=t.frame)||void 0===r||r.style.setProperty("height","".concat(null==e||null===(o=e.message)||void 0===o?void 0:o.height,"px"));break;case A.CONTENT_LOADED:var a=function(e){var t;(null===(t=f.experienceFrame.iframe)||void 0===t||!t.contains(e.target))&&f.close()};window.addEventListener("click",a),f.controlOptions.eventManager.addEventListenerForCleanup(f.experienceId,(function(){return window.removeEventListener("click",a)}));break;case A.Q_SEARCH_ENTERED_FULLSCREEN:var s,c;if(!f.frameStyles&&null!=t&&t.frame)f.frameStyles={position:null===(s=t.frame)||void 0===s?void 0:s.style.position,top:null===(c=t.frame)||void 0===c?void 0:c.style.top,left:t.frame.style.left,zIndex:t.frame.style.zIndex,width:t.frame.style.width,height:t.frame.style.height},t.frame.style.position="fixed",t.frame.style.top="0px",t.frame.style.left="0px",t.frame.style.zIndex=i.MAX_Z_INDEX,t.frame.style.width="100vw",t.frame.style.height="100vh";break;case A.Q_SEARCH_EXITED_FULLSCREEN:f.frameStyles&&null!=t&&t.frame&&(t.frame.style.position=f.frameStyles.position,t.frame.style.top=f.frameStyles.top,t.frame.style.left=f.frameStyles.left,t.frame.style.zIndex=f.frameStyles.zIndex,t.frame.style.width=f.frameStyles.width,t.frame.style.height=f.frameStyles.height)}})),u(h(f),"transformQSearchContentOptions",(function(e){var t=e.hideIcon,r=e.hideTopicName,n=e.theme,i=e.allowTopicSelection;e.onMessage;var o=d(e,be),a=f.transformContentOptions({allowTopicSelection:i},o);return void 0!==t&&(a.qBarIconDisabled=t),void 0!==r&&(a.qBarTopicNameDisabled=r),void 0!==n&&(a.themeId=n),a})),f.experience=f.extractExperienceFromUrl(e.url);var p=f.getInternalExperienceInfo(f.experience),E=p.experienceIdentifier,v=p.internalExperience;return f.internalExperience=v,f.experienceId=E,f.experienceFrame=new Ae(e,c,s,f.transformQSearchContentOptions(s),v,E,f.interceptMessage),f}return c(i)}();u(Ne,"MAX_Z_INDEX","2147483647");var Ce=function(e){l(n,ve);var r=E(n);function n(e,i,o,s,c,l,f){var p;return a(this,n),u(h(p=r.call(this,e,i,o,s,c,l,f)),"buildExperienceUrl",(function(e){var r=p.internalExperience,n=r.contextId,i=r.discriminator;return[e,p.buildQueryString(t(t({},p.transformedContentOptions),{},{contextId:n,discriminator:i}))].join("?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return c(n)}(),Le=c((function e(r,n,i,o){var s=this;a(this,e),u(this,"experience",{experienceType:U.CONTROL}),u(this,"iframe",null),u(this,"send",(function(e){var t;return null===(t=s.internalSend)||void 0===t?void 0:t.call(s,e)})),u(this,"controlFrameMessageListener",(function(e){if(s.isMessageEvent(e.data)){var t=e.data;try{if(t.eventTarget){var r=oe.getExperienceIdentifier(t.eventTarget);s.eventManager.invokeEventListener(r,t)}s.sendAcknowledgment(t)}catch(e){var n,i;null===(n=s.onChange)||void 0===n||n.call(s,new B(R.UNRECOGNIZED_EVENT_TARGET,b.WARN,"Message with unrecognized event target received",{eventTarget:t.eventTarget}),{frame:s.iframe}),null===(i=s.logger)||void 0===i||i.warn("Message with unrecognized event target received")}}})),u(this,"setLogger",(function(e){return s.logger=e,s})),u(this,"initializeFrame",(function(){var t=s.getControlExperienceBaseUrl(),r=s.getControlExperienceId();s.onMessage&&s.eventManager.addEventListener(r,s.onMessage,!0);var n=new Ce({url:t,container:s.container,width:"0px",height:"0px",onChange:s.onChange},{eventManager:s.eventManager,contextId:s.internalExperience.contextId,timeout:e.FRAME_TIMEOUT,urlInfo:s.urlInfo},{onMessage:s.onMessage},{},s.internalExperience,r);s.internalSend=n.send,s.iframe=n.iframe,window.addEventListener("message",s.controlFrameMessageListener),s.eventManager.addEventListenerForCleanup(r,(function(){return window.removeEventListener("message",s.controlFrameMessageListener)}))})),u(this,"sendAcknowledgment",(function(e){var t,r,n=new q(A.ACKNOWLEDGE,s.internalExperience,{eventName:e.eventName,eventTarget:e.eventTarget});(null===(t=(r=window).requestIdleCallback)||void 0===t?void 0:t.call(r,(function(){return s.send(n)})))||s.send(n)})),u(this,"getControlExperienceId",(function(){return[s.internalExperience.contextId,s.internalExperience.experienceType,s.internalExperience.discriminator].filter(Boolean).join("-")})),u(this,"getControlExperienceBaseUrl",(function(){var e=s.urlInfo,t=e.host,r=e.sessionId,n="".concat(t,"/embed/").concat(r,"/embedControl");return new URL(n).href})),u(this,"isMessageEvent",(function(e){return!!e&&!!e.eventTarget&&!!e.eventName})),this.container=r,this.eventManager=n.eventManager,this.urlInfo=n.urlInfo,this.internalExperience=t(t({},this.experience),{},{contextId:n.contextId,discriminator:0}),this.onMessage=o,this.onChange=i,this.initializeFrame()}));u(Le,"FRAME_TIMEOUT",6e4);var De=c((function e(){var t=this;a(this,e),u(this,"addEventListener",(function(e,r,n){if(!e)throw new Error("Experience identifier is required when calling addEventListener");if("function"!=typeof r)throw new Error("Invalid type provided for event listener");var i=t.eventListeners.get(e);return n&&t.addEventListenerForCleanup(e,(function(){return t.removeEventListener(e,r)})),i?(i.push(r),t):(t.eventListeners.set(e,[r]),t)})),u(this,"invokeEventListener",(function(e,r){var n=t.eventListeners.get(e);if(!n)throw new Error("Unable to find experience specific event listeners: ".concat(e));return n.forEach((function(e){e(r)})),t})),u(this,"removeEventListener",(function(e,r){var n=t.eventListeners.get(e);if(!n)throw new Error("Unable to find experience specific event listeners: ".concat(e));var i=n.filter((function(e){return e!==r}));return t.eventListeners.set(e,i),t})),u(this,"addEventListenerForCleanup",(function(e,r){var n,i=null!==(n=t.cleanUpCallbacks.get(e))&&void 0!==n?n:[];i.push(r),t.cleanUpCallbacks.set(e,i)})),u(this,"cleanUpCallbacksForExperience",(function(e){var r=t.cleanUpCallbacks.get(e);r&&(r.forEach((function(e){return e()})),t.cleanUpCallbacks.delete(e),t.eventListeners.set(e,[]))})),this.eventListeners=new Map,this.cleanUpCallbacks=new Map})),Pe=c((function e(){a(this,e),u(this,"log",console.log),u(this,"warn",console.warn),u(this,"error",console.error),u(this,"debug",console.debug),u(this,"info",console.info)})),Ue=c((function e(t){var i=this;a(this,e),u(this,"embedVisual",function(){var e=o(r().mark((function e(t){var n,o,a=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},i.validateFrameOptions(t,"embedVisual"),o=i.buildControlOptions(t),e.abrupt("return",new we(t,n,o,i.experienceIdentifiers).setLogProvider(i.logger));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(this,"embedDashboard",function(){var e=o(r().mark((function e(t){var n,o,a=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},i.validateFrameOptions(t,"embedDashboard"),o=i.buildControlOptions(t),e.abrupt("return",new Re(t,n,o,i.experienceIdentifiers).setLogProvider(i.logger));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(this,"embedConsole",function(){var e=o(r().mark((function e(t){var n,o,a=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},i.validateFrameOptions(t,"embedConsole"),o=i.buildControlOptions(t),e.abrupt("return",new ye(t,n,o,i.experienceIdentifiers).setLogProvider(i.logger));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(this,"embedQSearchBar",function(){var e=o(r().mark((function e(t){var n,o,a=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},i.validateFrameOptions(t,"embedQSearchBar"),o=i.buildControlOptions(t),e.abrupt("return",new Ne(t,n,o,i.experienceIdentifiers).setLogProvider(i.logger));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u(this,"validateFrameOptions",(function(e,t){if(!e){var r="".concat(t," is called without frameOptions");throw i.onChange(new B(R.NO_FRAME_OPTIONS,b.ERROR,"".concat(t," is called without frameOptions"),{methodName:t}),{frame:null}),new Error(r)}if("object"!==n(e)||Array.isArray(e)){var o="".concat(t," is called with non-object frameOptions");throw i.onChange(new B(R.INVALID_FRAME_OPTIONS,b.ERROR,o,{methodName:t,frameOptionsType:Array.isArray(e)?"array":n(e)}),{frame:null}),new Error(o)}var a=["url","container","width","height","resizeHeightOnSizeChangedEvent","withIframePlaceholder","onChange","className"],s=Object.keys(e).filter((function(e){return!a.includes(e)}));if(s.length>0){var c,u,l="".concat(t," is called with unrecognized properties");null===(c=e.onChange)||void 0===c||c.call(e,new B(R.UNRECOGNIZED_FRAME_OPTIONS,b.WARN,l,{unrecognizedFrameOptions:s}),{frame:null}),null===(u=i.logger)||void 0===u||u.warn(l)}})),u(this,"buildControlOptions",(function(e){if(!i.controlOptions){if(!e.url)throw new Error("URL is missing in frame options, but is a required field");var t=i.getControlUrlInfo(e.url),r=new Le(i.getBodyElement(),{eventManager:i.eventManager,urlInfo:t,contextId:i.contextId},i.onChange).setLogger(i.logger);i.controlOptions={eventManager:i.eventManager,sendToControlFrame:r.send,contextId:i.contextId,timeout:Le.FRAME_TIMEOUT,urlInfo:t}}return i.controlOptions})),u(this,"onChange",(function(e,t){i.contextOnChange&&i.contextOnChange(e,t)})),u(this,"getControlUrlInfo",(function(e){var t=/^(https:\/\/[^/]+)\/(embedding|embed)\/([^/]+)\/[^?]+\?(.*)/i.exec(e)||[];if((null==t?void 0:t.length)<4)throw new Error('Invalid embedding url: "'.concat(e,'"'));return{sessionId:t[3],host:t[1],urlSearchParams:new URLSearchParams(t[4])}})),u(this,"getBodyElement",(function(){var e,t=null===(e=document.getElementsByTagName("body"))||void 0===e?void 0:e[0];if(!t){var r="could not locate <body> element in the page";throw i.onChange(new B(R.NO_BODY,b.ERROR,r),{frame:null}),new Error(r)}return t})),this.contextId=ie(),this.experienceIdentifiers=new Set,this.eventManager=new De,this.contextOnChange=t.onChange,this.logger=new Pe})),Me=function(){var e=o(r().mark((function e(){var t,n=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},e.abrupt("return",new Ue(t));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Fe=t(t(t(t(t(t(t(t(t(t(t(t({},P),S),N),C),L),D),M),F),j),H),V),Q);export{oe as BaseExperience,ve as BaseExperienceFrame,G as CALCULATED_METRIC_COLUMN_TYPE,B as ChangeEvent,b as ChangeEventLevel,R as ChangeEventName,ye as ConsoleExperience,_e as ConsoleExperienceFrame,Le as ControlExperience,Ce as ControlExperienceFrame,Re as DashboardExperience,Te as DashboardExperienceFrame,$ as DataResponse,Pe as DefaultLogger,Ue as EmbeddingContext,z as EmbeddingEvent,Z as EmbeddingMessageEvent,_ as ErrorChangeEventName,Y as ErrorResponse,De as EventManager,U as ExperienceType,x as GetterMessageEventName,he as Iframe,w as InfoChangeEventName,g as InfoMessageEventName,T as InvokerMessageEventName,A as MessageEventName,X as PostMessageEvent,Fe as QSE,Ne as QSearchExperience,Ae as QSearchExperienceFrame,K as ResponseMessage,Ee as SDK_VERSION,k as SPECIAL_DATAPOINT_VALUE_TYPES,y as SetterMessageEventName,W as SuccessResponse,q as TargetedMessageEvent,we as VisualExperience,Oe as VisualExperienceFrame,I as WarnChangeEventName,Me as createEmbeddingContext}; | ||
//# sourceMappingURL=index.esm.js.map |
/*! | ||
* amazon-quicksight-embedding-sdk v2.5.0 | ||
* amazon-quicksight-embedding-sdk v2.6.0 | ||
* git@github.com:awslabs/amazon-quicksight-embedding-sdk.git | ||
@@ -9,3 +9,3 @@ * https://github.com/awslabs/amazon-quicksight-embedding-sdk | ||
*/ | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).QuickSightEmbedding={})}(this,(function(e){"use strict";function r(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function n(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?r(Object(t),!0).forEach((function(r){l(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):r(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function t(){t=function(){return r};var e,r={},n=Object.prototype,i=n.hasOwnProperty,o=Object.defineProperty||function(e,r,n){e[r]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,r,n){return Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[r]}try{l({},"")}catch(e){l=function(e,r,n){return e[r]=n}}function f(e,r,n,t){var i=r&&r.prototype instanceof g?r:g,a=Object.create(i.prototype),s=new N(t||[]);return o(a,"_invoke",{value:R(e,n,s)}),a}function p(e,r,n){try{return{type:"normal",arg:e.call(r,n)}}catch(e){return{type:"throw",arg:e}}}r.wrap=f;var d="suspendedStart",h="suspendedYield",E="executing",v="completed",m={};function g(){}function O(){}function w(){}var _={};l(_,s,(function(){return this}));var I=Object.getPrototypeOf,y=I&&I(I(L([])));y&&y!==n&&i.call(y,s)&&(_=y);var x=w.prototype=g.prototype=Object.create(_);function S(e){["next","throw","return"].forEach((function(r){l(e,r,(function(e){return this._invoke(r,e)}))}))}function T(e,r){function n(t,o,a,s){var c=p(e[t],e,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&i.call(l,"__await")?r.resolve(l.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):r.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var t;o(this,"_invoke",{value:function(e,i){function o(){return new r((function(r,t){n(e,i,r,t)}))}return t=t?t.then(o,o):o()}})}function R(r,n,t){var i=d;return function(o,a){if(i===E)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(t.method=o,t.arg=a;;){var s=t.delegate;if(s){var c=b(s,t);if(c){if(c===m)continue;return c}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if(i===d)throw i=v,t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);i=E;var u=p(r,n,t);if("normal"===u.type){if(i=t.done?v:h,u.arg===m)continue;return{value:u.arg,done:t.done}}"throw"===u.type&&(i=v,t.method="throw",t.arg=u.arg)}}}function b(r,n){var t=n.method,i=r.iterator[t];if(i===e)return n.delegate=null,"throw"===t&&r.iterator.return&&(n.method="return",n.arg=e,b(r,n),"throw"===n.method)||"return"!==t&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+t+"' method")),m;var o=p(i,r.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;var a=o.arg;return a?a.done?(n[r.resultName]=a.value,n.next=r.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function A(e){var r={tryLoc:e[0]};1 in e&&(r.catchLoc=e[1]),2 in e&&(r.finallyLoc=e[2],r.afterLoc=e[3]),this.tryEntries.push(r)}function C(e){var r=e.completion||{};r.type="normal",delete r.arg,e.completion=r}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function L(r){if(r||""===r){var n=r[s];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var t=-1,o=function n(){for(;++t<r.length;)if(i.call(r,t))return n.value=r[t],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(typeof r+" is not iterable")}return O.prototype=w,o(x,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:O,configurable:!0}),O.displayName=l(w,u,"GeneratorFunction"),r.isGeneratorFunction=function(e){var r="function"==typeof e&&e.constructor;return!!r&&(r===O||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,l(e,u,"GeneratorFunction")),e.prototype=Object.create(x),e},r.awrap=function(e){return{__await:e}},S(T.prototype),l(T.prototype,c,(function(){return this})),r.AsyncIterator=T,r.async=function(e,n,t,i,o){void 0===o&&(o=Promise);var a=new T(f(e,n,t,i),o);return r.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(x),l(x,u,"Generator"),l(x,s,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var r=Object(e),n=[];for(var t in r)n.push(t);return n.reverse(),function e(){for(;n.length;){var t=n.pop();if(t in r)return e.value=t,e.done=!1,e}return e.done=!0,e}},r.values=L,N.prototype={constructor:N,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!r)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function t(t,i){return s.type="throw",s.arg=r,n.next=t,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return t("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),u=i.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return t(a.catchLoc,!0);if(this.prev<a.finallyLoc)return t(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return t(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return t(a.finallyLoc)}}}},abrupt:function(e,r){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.tryLoc<=this.prev&&i.call(t,"finallyLoc")&&this.prev<t.finallyLoc){var o=t;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),m},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),m}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var t=n.completion;if("throw"===t.type){var i=t.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(r,n,t){return this.delegate={iterator:L(r),resultName:n,nextLoc:t},"next"===this.method&&(this.arg=e),m}},r}function i(e){return i="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},i(e)}function o(e,r,n,t,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?r(c):Promise.resolve(c).then(t,i)}function a(e){return function(){var r=this,n=arguments;return new Promise((function(t,i){var a=e.apply(r,n);function s(e){o(a,t,i,s,c,"next",e)}function c(e){o(a,t,i,s,c,"throw",e)}s(void 0)}))}}function s(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function c(e,r){for(var n=0;n<r.length;n++){var t=r[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,O(t.key),t)}}function u(e,r,n){return r&&c(e.prototype,r),n&&c(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,r,n){return(r=O(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function f(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&d(e,r)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function d(e,r){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,r){return e.__proto__=r,e},d(e,r)}function h(e,r){if(null==e)return{};var n,t,i=function(e,r){if(null==e)return{};var n,t,i={},o=Object.keys(e);for(t=0;t<o.length;t++)n=o[t],r.indexOf(n)>=0||(i[n]=e[n]);return i}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(t=0;t<o.length;t++)n=o[t],r.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,t=p(e);if(r){var i=p(this).constructor;n=Reflect.construct(t,arguments,i)}else n=t.apply(this,arguments);return function(e,r){if(r&&("object"==typeof r||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return E(e)}(this,n)}}function m(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var t,i,o,a,s=[],c=!0,u=!1;try{if(o=(n=n.call(e)).next,0===r){if(Object(n)!==n)return;c=!1}else for(;!(c=(t=o.call(n)).done)&&(s.push(t.value),s.length!==r);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return g(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=new Array(r);n<r;n++)t[n]=e[n];return t}function O(e){var r=function(e,r){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var t=n.call(e,r||"default");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:String(r)}var w={CALLBACK_OPERATION_INVOKED:"CALLBACK_OPERATION_INVOKED",CONTENT_LOADED:"CONTENT_LOADED",EXPERIENCE_INITIALIZED:"EXPERIENCE_INITIALIZED",ERROR_OCCURRED:"ERROR_OCCURRED",SIZE_CHANGED:"SIZE_CHANGED",PARAMETERS_CHANGED:"PARAMETERS_CHANGED",SELECTED_SHEET_CHANGED:"SELECTED_SHEET_CHANGED",MODAL_OPENED:"MODAL_OPENED",Q_SEARCH_CLOSED:"Q_SEARCH_CLOSED",Q_SEARCH_OPENED:"Q_SEARCH_OPENED",Q_SEARCH_SIZE_CHANGED:"Q_SEARCH_SIZE_CHANGED",Q_SEARCH_ENTERED_FULLSCREEN:"Q_SEARCH_ENTERED_FULLSCREEN",Q_SEARCH_EXITED_FULLSCREEN:"Q_SEARCH_EXITED_FULLSCREEN"},_={FRAME_STARTED:"FRAME_STARTED",FRAME_MOUNTED:"FRAME_MOUNTED",FRAME_LOADED:"FRAME_LOADED",FRAME_REMOVED:"FRAME_REMOVED"},I={FRAME_NOT_CREATED:"FRAME_NOT_CREATED",NO_BODY:"NO_BODY",NO_CONTAINER:"NO_CONTAINER",INVALID_CONTAINER:"INVALID_CONTAINER",NO_URL:"NO_URL",INVALID_URL:"INVALID_URL",NO_FRAME_OPTIONS:"NO_FRAME_OPTIONS",INVALID_FRAME_OPTIONS:"INVALID_FRAME_OPTIONS"},y={UNRECOGNIZED_CONTENT_OPTIONS:"UNRECOGNIZED_CONTENT_OPTIONS",UNRECOGNIZED_FRAME_OPTIONS:"UNRECOGNIZED_FRAME_OPTIONS",UNRECOGNIZED_EVENT_TARGET:"UNRECOGNIZED_EVENT_TARGET"},x={SET_PARAMETERS:"SET_PARAMETERS",SET_SELECTED_SHEET_ID:"SET_SELECTED_SHEET_ID",SET_Q_SEARCH_QUESTION:"SET_Q_SEARCH_QUESTION",SET_VISUAL_ACTIONS:"SET_VISUAL_ACTIONS",SET_THEME:"SET_THEME",ADD_FILTER_GROUPS:"ADD_FILTER_GROUPS",UPDATE_FILTER_GROUPS:"UPDATE_FILTER_GROUPS",REMOVE_FILTER_GROUPS:"REMOVE_FILTER_GROUPS",ADD_VISUAL_ACTIONS:"ADD_VISUAL_ACTIONS",REMOVE_VISUAL_ACTIONS:"REMOVE_VISUAL_ACTIONS",SET_THEME_OVERRIDE:"SET_THEME_OVERRIDE"},S={GET_PARAMETERS:"GET_PARAMETERS",GET_SHEETS:"GET_SHEETS",GET_SHEET_VISUALS:"GET_SHEET_VISUALS",GET_VISUAL_ACTIONS:"GET_VISUAL_ACTIONS",GET_SELECTED_SHEET_ID:"GET_SELECTED_SHEET_ID",GET_FILTER_GROUPS_FOR_SHEET:"GET_FILTER_GROUPS_FOR_SHEET",GET_FILTER_GROUPS_FOR_VISUAL:"GET_FILTER_GROUPS_FOR_VISUAL"},T={ACKNOWLEDGE:"ACKNOWLEDGE",INITIATE_PRINT:"INITIATE_PRINT",NAVIGATE_TO_DASHBOARD:"NAVIGATE_TO_DASHBOARD",CLOSE_Q_SEARCH:"CLOSE_Q_SEARCH",UNDO:"UNDO",REDO:"REDO",RESET:"RESET",TOGGLE_BOOKMARKS_PANE:"TOGGLE_BOOKMARKS_PANE"},R=Object.freeze({__proto__:null,ErrorChangeEventName:I,GetterMessageEventName:S,InfoChangeEventName:_,InfoMessageEventName:w,InvokerMessageEventName:T,SetterMessageEventName:x,WarnChangeEventName:y}),b=n(n(n({},_),I),y),A=n(n(n(n({},w),x),S),T),C={ERROR:"ERROR",INFO:"INFO",WARN:"WARN"},N=Object.freeze({__proto__:null,ChangeEventLevel:C,ChangeEventName:b,MessageEventName:A}),L=Object.freeze({__proto__:null}),D=Object.freeze({__proto__:null}),U=Object.freeze({__proto__:null}),M=Object.freeze({__proto__:null}),P={CONSOLE:"CONSOLE",CONTEXT:"CONTEXT",CONTROL:"CONTROL",VISUAL:"VISUAL",DASHBOARD:"DASHBOARD",QSEARCH:"QSEARCH"},F=Object.freeze({__proto__:null,ExperienceType:P}),k=Object.freeze({__proto__:null}),G={NULL:null,OTHER_BUCKET:null},V={INTEGER:null,STRING:null,DECIMAL:null,DATETIME:null},j=Object.freeze({__proto__:null,CALCULATED_METRIC_COLUMN_TYPE:V,SPECIAL_DATAPOINT_VALUE_TYPES:G}),H=Object.freeze({__proto__:null}),Q=Object.freeze({__proto__:null}),B=Object.freeze({__proto__:null}),z=u((function e(r,n,t){s(this,e),this.eventName=r,this.message=n,this.data=t})),q=function(e){f(n,e);var r=v(n);function n(e,t,i,o){var a;return s(this,n),(a=r.call(this,e,i,o)).eventLevel=t,a}return u(n)}(z),Z=function(e){f(n,e);var r=v(n);function n(e,t,i){var o;return s(this,n),(o=r.call(this,e,t,i)).eventName=e,o}return u(n)}(z),K=function(e){f(n,e);var r=v(n);function n(e,t,i,o){var a;return s(this,n),(a=r.call(this,e,i,o)).eventTarget=t,a}return u(n)}(Z),W=function(e){f(n,e);var r=v(n);function n(e,t,i,o,a,c,u){var l;return s(this,n),(l=r.call(this,e,t,c,u)).timestamp=o,l.version=a,l.eventId=i,l}return u(n)}(K),X=u((function e(){s(this,e)})),Y=u((function e(){s(this,e),l(this,"success",!0)})),$=u((function e(r){s(this,e),l(this,"success",!1),this.errorCode=r.errorCode,this.error=r.error,this.message=r.message})),J=u((function e(r){s(this,e),l(this,"success",!0),this.message=r}));let ee;const re=new Uint8Array(16);function ne(){if(!ee&&(ee="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ee))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ee(re)}const te=[];for(let e=0;e<256;++e)te.push((e+256).toString(16).slice(1));var ie={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function oe(e,r,n){if(ie.randomUUID&&!r&&!e)return ie.randomUUID();const t=(e=e||{}).random||(e.rng||ne)();if(t[6]=15&t[6]|64,t[8]=63&t[8]|128,r){n=n||0;for(let e=0;e<16;++e)r[n+e]=t[e];return r}return function(e,r=0){return te[e[r+0]]+te[e[r+1]]+te[e[r+2]]+te[e[r+3]]+"-"+te[e[r+4]]+te[e[r+5]]+"-"+te[e[r+6]]+te[e[r+7]]+"-"+te[e[r+8]]+te[e[r+9]]+"-"+te[e[r+10]]+te[e[r+11]]+te[e[r+12]]+te[e[r+13]]+te[e[r+14]]+te[e[r+15]]}(t)}var ae=u((function e(r,i,o,c){var u=this;s(this,e),l(this,"send",function(){var e=a(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u.experienceFrame&&u.internalExperience){e.next=2;break}throw new Error("Experience has not been initialized");case 2:return n=new K(r.eventName,u.internalExperience,r.message,r.data),e.abrupt("return",u.experienceFrame.send(n));case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(this,"addEventListener",(function(e,r){return u.experienceFrame.addInternalEventListener(e,r)})),l(this,"setLogProvider",(function(e){return u.logger=e,u})),l(this,"getInternalExperienceInfo",(function(r){var t,i,o=-1;do{o++,t=n(n({},r),{},{contextId:u.controlOptions.contextId,discriminator:o}),i=e.getExperienceIdentifier(t)}while(u.experienceIdentifiers.has(i));return u.experienceIdentifiers.add(i),{experienceIdentifier:i,internalExperience:t}})),l(this,"transformContentOptions",(function(e,r){var n,t,i,o=Object.keys(r);Object.keys(r).length>0&&(null===(n=(t=u.frameOptions).onChange)||void 0===n||n.call(t,new q(b.UNRECOGNIZED_CONTENT_OPTIONS,C.WARN,"Experience content options contain unrecognized properties",{unrecognizedContentOptions:o}),{frame:null}),null===(i=u.logger)||void 0===i||i.warn("Experience content options contain unrecognized properties"));return e})),l(this,"validateFrameOptions",(function(){if(!u.frameOptions.url){var e,r,n="Url is required for the experience";throw null===(e=(r=u.frameOptions).onChange)||void 0===e||e.call(r,new q(b.NO_URL,C.ERROR,n),{frame:null}),new Error(n)}})),this.frameOptions=r,this.contentOptions=i,this.controlOptions=o,this.experienceIdentifiers=c,this.validateFrameOptions()}));l(ae,"getExperienceIdentifier",(function(e){if(e.experienceType===P.DASHBOARD)return[e.contextId,e.experienceType,e.dashboardId,e.discriminator].filter(Boolean).join("-");if(e.experienceType===P.VISUAL)return[e.contextId,e.experienceType,e.dashboardId,e.sheetId,e.visualId,e.discriminator].filter(Boolean).join("-");if([P.CONSOLE,P.CONTROL,P.CONTEXT,P.QSEARCH].includes(e.experienceType))return[e.contextId,e.experienceType,e.discriminator].filter(Boolean).join("-");throw new Error("Invalid experience unable to build experience identifier")}));const se=2147483647,ce={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ue=Math.floor,le=String.fromCharCode;function fe(e){throw new RangeError(ce[e])}const pe=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},de=function(e,r,n){let t=0;for(e=n?ue(e/700):e>>1,e+=ue(e/r);e>455;t+=36)e=ue(e/35);return ue(t+36*e/(e+38))},he=function(e){const r=[];e=function(e){const r=[];let n=0;const t=e.length;for(;n<t;){const i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<t){const t=e.charCodeAt(n++);56320==(64512&t)?r.push(((1023&i)<<10)+(1023&t)+65536):(r.push(i),n--)}else r.push(i)}return r}(e);const n=e.length;let t=128,i=0,o=72;for(const n of e)n<128&&r.push(le(n));const a=r.length;let s=a;for(a&&r.push("-");s<n;){let n=se;for(const r of e)r>=t&&r<n&&(n=r);const c=s+1;n-t>ue((se-i)/c)&&fe("overflow"),i+=(n-t)*c,t=n;for(const n of e)if(n<t&&++i>se&&fe("overflow"),n===t){let e=i;for(let n=36;;n+=36){const t=n<=o?1:n>=o+26?26:n-o;if(e<t)break;const i=e-t,a=36-t;r.push(le(pe(t+i%a,0))),e=ue(i/a)}r.push(le(pe(e,0))),o=de(i,c,s===a),i=0,++s}++i,++t}return r.join("")};var Ee=u((function e(r){var n=this;s(this,e),l(this,"classNames",[e.IFRAME_CLASS_NAME]),l(this,"getIframe",(function(){return n.iframe})),l(this,"createIframePlaceholder",(function(r){if(n.iframePlaceholder=document.createElement("div"),n.iframePlaceholder.id="".concat(n.iframeName,"-placeholder"),n.iframePlaceholder.style.width=n.width,n.iframePlaceholder.style.backgroundColor="rgba(0,0,0,.01)",n.iframePlaceholder.style.display="flex",n.iframePlaceholder.style.justifyContent="center",n.iframePlaceholder.style.alignItems="center",n.iframePlaceholder.className="".concat(e.IFRAME_CLASS_NAME,"-placeholder"),n.height.endsWith("px")&&(n.iframePlaceholder.style.height=n.height),r&&"boolean"!=typeof r)n.iframePlaceholder.appendChild(r);else{var t=n.createLoaderSVG();n.iframePlaceholder.appendChild(t)}n.container.appendChild(n.iframePlaceholder)})),l(this,"createIframe",(function(){var e=document.createElement("iframe");return e.className=n.classNames.join(" ").trim(),e.id=n.iframeName,e.name=n.iframeName,e.width=n.width,e.height=n.height,n.loading&&(e.loading=n.loading),e.style.border="0px",e.style.padding="0px",n.iframePlaceholder&&(e.style.opacity="0",e.style.position="absolute"),"0px"===n.width&&"0px"===n.height&&(e.style.position="absolute"),n.container.appendChild(e),n.payload?n.postRequest=n.createPostRequest({src:n.src,target:e.name,container:n.container,payload:n.payload}):e.src=n.src,e})),l(this,"onLoadLocal",(function(e){var r,t;n.iframePlaceholder&&(n.iframePlaceholder.remove(),n.iframe.style.position="",n.iframe.style.opacity="1",n.iframe.style.transition="opacity .5s ease-in-out"),null===(r=n.onLoad)||void 0===r||r.call(n,e),null===(t=n.postRequest)||void 0===t||t.remove()})),l(this,"createPostRequest",(function(e){var r=e.src,n=e.container,t=e.target,i=e.payload;if(!r)throw new Error("No source has been provided.");var o=document.createElement("form");return o.style.visibility="hidden",o.method="POST",o.action=r,o.target=t,o.name="".concat(t,"-form"),Object.keys(i).forEach((function(e){var r=document.createElement("input");r.type="hidden",r.name=e,r.value=i[e],o.appendChild(r)})),n.appendChild(o),null==o||o.submit(),{remove:function(){o.remove()}}})),l(this,"createSvgElement",(function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.entries(r).forEach((function(e){var r=m(e,2),n=r[0],t=r[1];return i.setAttribute(n,t)})),Object.entries(n).forEach((function(e){var r=m(e,2),n=r[0],t=r[1];return i.style.setProperty(n,t)})),t.forEach((function(e){return i.appendChild(e)})),i})),l(this,"createLoaderSVG",(function(){var e=[1,2,3].map((function(e){var r=n.createSvgElement("animate",{attributeName:"opacity",dur:"1s",values:"0;1;0",repeatCount:"indefinite",begin:"".concat(e/10)});return n.createSvgElement("circle",{fill:"#ccc",stroke:"none",cx:"".concat(20*e-14),cy:"50",r:"6"},void 0,[r])}));return n.createSvgElement("svg",{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100","enable-background":"new 0 0 0 0"},{width:"100px",height:"100px"},e)}));var t=r.id,i=r.src,o=r.width,a=void 0===o?"100%":o,c=r.height,u=void 0===c?"100%":c,f=r.container,p=r.onLoad,d=r.loading,h=r.withIframePlaceholder,E=r.payload,v=r.className;this.width=a,this.height=u,this.onLoad=p,this.iframeName=t,this.loading=d,v&&this.classNames.push(v),this.container=f,this.payload=E,this.src=i,h&&this.createIframePlaceholder(h),this.iframe=this.createIframe(),this.iframe.addEventListener("load",this.onLoadLocal)}));l(Ee,"IFRAME_CLASS_NAME","quicksight-embedding-iframe");var ve="2.5.0",me=u((function e(r,o,c,u,f,p,d){var h=this;s(this,e),l(this,"MESSAGE_RESPONSE_TIMEOUT",5e3),l(this,"iframe",null),l(this,"send",function(){var e=a(t().mark((function e(r){var n,i,o;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h.iframe){e.next=2;break}throw new Error("Cannot send ".concat(r.eventName,": No experience frame found"));case 2:if(i=oe(),o=new W(r.eventName,r.eventTarget,i,Date.now(),ve,r.message,r.data),null===(n=h.iframe)||void 0===n||null===(n=n.contentWindow)||void 0===n||n.postMessage(o,h.url),r.eventName!==A.ACKNOWLEDGE){e.next=7;break}return e.abrupt("return",Promise.resolve(new Y));case 7:return e.abrupt("return",new Promise((function(e,n){var t=function r(n){var t,o,a=n.data;(null==a?void 0:a.eventId)===i&&(window.removeEventListener("message",r),!0===(null===(t=a.message)||void 0===t?void 0:t.success)?e(new Y):!1===(null===(o=a.message)||void 0===o?void 0:o.success)?e(new $(a.message)):e(new J(a.message)))};window.addEventListener("message",t),setTimeout((function(){window.removeEventListener("message",t),n("".concat(r.eventName," timed out"))}),h.MESSAGE_RESPONSE_TIMEOUT)})));case 8:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(this,"buildParameterString",(function(e){return e&&"object"===i(e)?Object.entries(e).map((function(e){var r=m(e,2),n=r[0],t=r[1],i=Array.isArray(t)?t:[t],o=encodeURIComponent(n);return i.map(encodeURIComponent).map((function(e){return"p.".concat(o,"=").concat(e)})).join("&")})).join("&"):""})),l(this,"buildQueryString",(function(e){var r=Object.entries(e).reduce((function(e,r){var t=m(r,2),i=t[0],o=t[1];return null!=o?n(n({},e),{},l({},i,"".concat(o))):e}),{punyCodeEmbedOrigin:he("".concat(window.location.origin,"/")),sdkVersion:ve});return new URLSearchParams(r).toString()})),l(this,"createExperienceIframe",(function(){h.onChange(new q(b.FRAME_STARTED,C.INFO,"Creating the frame",{experience:h.internalExperience}));try{h.setTimeoutInstance(),h.iframe=new Ee({id:h.experienceId,src:h.url,width:h.frameOptions.width,height:h.frameOptions.height,container:h.container,onLoad:h.onLoadHandler,withIframePlaceholder:h.frameOptions.withIframePlaceholder,className:h.frameOptions.className}).getIframe()}catch(e){throw h.onChange(new q(b.FRAME_NOT_CREATED,C.ERROR,"Failed to create the frame",{experience:h.internalExperience})),e}h.onChange(new q(b.FRAME_MOUNTED,C.INFO,"The frame mounted",{experience:h.internalExperience,frame:h.iframe}))})),l(this,"addInternalEventListener",(function(e,r){var n=function(n,t){n.eventName===e&&r(n,t)};return h.controlOptions.eventManager.addEventListener(h.experienceId,n,!0),{remove:function(){return h.controlOptions.eventManager.removeEventListener(h.experienceId,n)}}})),l(this,"validateBaseUrl",(function(e){if(!e)throw h.onChange(new q(b.NO_URL,C.ERROR,"Url is required for the experience",{experience:h.internalExperience})),new Error("Url is required for the experience");return e})),l(this,"setTimeoutInstance",(function(){h.timeoutInstance=setTimeout((function(){throw h.onChange(new q(b.FRAME_NOT_CREATED,C.ERROR,"Creating the frame timed out",{experience:h.internalExperience})),new Error("Creating the frame timed out")}),h.controlOptions.timeout)})),l(this,"onLoadHandler",a(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h.timeoutInstance&&clearTimeout(h.timeoutInstance),h.onChange(new q(b.FRAME_LOADED,C.INFO,"The experience iframe loaded",{experience:h.internalExperience}));case 2:case"end":return e.stop()}}),e)})))),l(this,"getContainer",(function(e){if(!e){var r="Container is required for the experience";throw h.onChange(new q(b.NO_CONTAINER,C.ERROR,r,{experience:h.internalExperience})),new Error(r)}var n=null;if("string"==typeof e)try{n=document.querySelector(e)}catch(e){throw e instanceof Error&&h.onChange(new q(b.INVALID_CONTAINER,C.ERROR,e.message,{experience:h.internalExperience})),e}else"object"===i(e)&&e.nodeName&&(n=e);if(!n){var t="Invalid container '".concat(e,"' for the experience");throw h.onChange(new q(b.INVALID_CONTAINER,C.ERROR,t,{experience:h.internalExperience})),new Error(t)}return n})),l(this,"decorateOnChange",(function(e){return function(r){if(e){var n={frame:h.iframe};e(r,n)}}})),l(this,"decorateOnMessage",(function(e,r){return function(n){r&&h.iframe&&r(n,{frame:h.iframe}),e&&e(n,{frame:h.iframe})}})),l(this,"initializeMutationObserver",(function(){var e=new MutationObserver((function(r){r.some((function(e){return Array.from(e.removedNodes).some((function(e){return e===h.iframe||e===h.container}))}))&&(h.controlOptions.eventManager.cleanUpCallbacksForExperience(h.experienceId),e.disconnect(),h.iframe=null,h.onChange(new q(b.FRAME_REMOVED,C.INFO,"Frame removed from the DOM",{experience:h.internalExperience})))}));e.observe(document.body,{childList:!0,subtree:!0})})),this.frameOptions=r,this.contentOptions=c,this.onChange=this.decorateOnChange(r.onChange),this.onMessage=this.decorateOnMessage(c.onMessage,d),this.container=this.getContainer(r.container),this.internalExperience=f,this.controlOptions=o,this.transformedContentOptions=u,this.experienceId=p,this.url=this.validateBaseUrl(r.url),this.controlOptions.eventManager.addEventListener(this.experienceId,this.onMessage,!0),this.initializeMutationObserver()})),ge=["parameters"],Oe=function(e){f(t,e);var r=v(t);function t(e,i,o,a,c,u,f){var p;return s(this,t),l(E(p=r.call(this,e,i,o,a,c,u,f)),"buildExperienceUrl",(function(e){var r=p.transformedContentOptions,t=r.parameters,i=h(r,ge),o=p.internalExperience,a=o.contextId,s=o.discriminator;return[e,[p.buildQueryString(n(n({},i),{},{contextId:a,discriminator:s})),p.buildParameterString(t)].join("#")].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return u(t)}(me),we=["fitToIframeWidth","locale","parameters","themeOptions","onMessage"],_e=function(e){f(i,e);var r=v(i);function i(e,o,c,u){var f;s(this,i),l(E(f=r.call(this,e,o,c,u)),"setParameters",function(){var e=a(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.SET_PARAMETERS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(E(f),"reset",a(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.RESET)));case 1:case"end":return e.stop()}}),e)})))),l(E(f),"addFilterGroups",function(){var e=a(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.ADD_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(E(f),"updateFilterGroups",function(){var e=a(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.UPDATE_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(E(f),"removeFilterGroups",function(){var e=a(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.REMOVE_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(E(f),"getFilterGroups",a(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new Z(A.GET_FILTER_GROUPS_FOR_VISUAL));case 2:if(r=e.sent,Array.isArray(null==r?void 0:r.message)){e.next=5;break}throw new Error("Failed to retrieve filter groups for the visual");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})))),l(E(f),"getActions",a(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new Z(A.GET_VISUAL_ACTIONS));case 2:if(r=e.sent,Array.isArray(null==r?void 0:r.message)){e.next=5;break}throw new Error("Failed to retrieve the actions");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})))),l(E(f),"addActions",function(){var e=a(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.ADD_VISUAL_ACTIONS,{Actions:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(E(f),"setActions",function(){var e=a(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.SET_VISUAL_ACTIONS,{Actions:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(E(f),"removeActions",function(){var e=a(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.REMOVE_VISUAL_ACTIONS,{Actions:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(E(f),"setTheme",function(){var e=a(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.SET_THEME,{ThemeArn:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(E(f),"setThemeOverride",function(){var e=a(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.SET_THEME_OVERRIDE,{ThemeOverride:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(E(f),"extractExperienceFromUrl",(function(e){var r,n,t=/^https:\/\/[^/]+\/embed\/[^/]+\/dashboards\/([\w-]+)\/sheets\/([\w-]+)\/visuals\/([\w-]+)(\?|$)/i.exec(e)||[];if(t.length<5)throw null===(r=(n=f.frameOptions).onChange)||void 0===r||r.call(n,new q(b.INVALID_URL,C.ERROR,"Invalid visual experience url",{url:e}),{frame:f.experienceFrame.iframe}),new Error("Invalid visual experience URL");return{experienceType:P.VISUAL,dashboardId:t[1],sheetId:t[2],visualId:t[3]}})),l(E(f),"interceptMessage",(function(e,r){var n,t,i;"SIZE_CHANGED"===e.eventName&&f.frameOptions.resizeHeightOnSizeChangedEvent&&(null==r||null===(n=r.frame)||void 0===n||null===(t=n.setAttribute)||void 0===t||t.call(n,"height","".concat(null===(i=e.message)||void 0===i?void 0:i.height,"px")))})),l(E(f),"transformVisualContentOptions",(function(e){var r=e.fitToIframeWidth,t=e.locale,i=e.parameters,o=e.themeOptions;e.onMessage;var a=h(e,we),s=f.transformContentOptions({fitToIframeWidth:null==r||r,locale:t},a);return Array.isArray(i)&&(s.parameters=i.reduce((function(e,r){return n(n({},e),{},l({},r.Name,r.Values))}),{})),null!=o&&o.themeArn&&(s.themeArn=o.themeArn),s})),f.experience=f.extractExperienceFromUrl(e.url);var p=f.getInternalExperienceInfo(f.experience),d=p.experienceIdentifier,v=p.internalExperience;return f.internalExperience=v,f.experienceId=d,f.experienceFrame=new Oe(e,c,o,f.transformVisualContentOptions(o),v,d,f.interceptMessage),f}return u(i)}(ae),Ie=function(e){f(t,e);var r=v(t);function t(e,i,o,a,c,u,f){var p;return s(this,t),l(E(p=r.call(this,e,i,o,a,c,u,f)),"buildExperienceUrl",(function(e){var r=p.internalExperience,t=r.contextId,i=r.discriminator;return[e,p.buildQueryString(n(n({},p.transformedContentOptions),{},{contextId:t,discriminator:i}))].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return u(t)}(me),ye=["locale","onMessage"],xe=function(e){f(n,e);var r=v(n);function n(e,t,i,o){var a;s(this,n),l(E(a=r.call(this,e,t,i,o)),"extractExperienceFromUrl",(function(e){var r,n;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/(start(\/(favorites|dashboards|analyses))?|dashboards\/[\w-]+|analyses\/[\w-]+)(\?|$)/i.exec(e)||[]).length<5)throw null===(r=(n=a.frameOptions).onChange)||void 0===r||r.call(n,new q(b.INVALID_URL,C.ERROR,"Invalid console experience url",{url:e}),{frame:a.experienceFrame.iframe}),new Error("Invalid console experience URL");return{experienceType:P.CONSOLE}})),a.experience=a.extractExperienceFromUrl(e.url);var c=a.getInternalExperienceInfo(a.experience),u=c.experienceIdentifier,f=c.internalExperience;a.internalExperience=f,a.experienceId=u;var p=t.locale;t.onMessage;var d=h(t,ye),v=a.transformContentOptions({locale:p},d);return a.experienceFrame=new Ie(e,i,t,v,f,u),a}return u(n)}(ae),Se=["parameters"],Te=function(e){f(t,e);var r=v(t);function t(e,i,o,a,c,u,f){var p;return s(this,t),l(E(p=r.call(this,e,i,o,a,c,u,f)),"buildExperienceUrl",(function(e){var r=p.transformedContentOptions,t=r.parameters,i=h(r,Se),o=p.internalExperience,a=o.contextId,s=o.discriminator;return[e,[p.buildQueryString(n(n({},i),{},{contextId:a,discriminator:s})),p.buildParameterString(t)].join("#")].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return u(t)}(me),Re=["parameters","locale","attributionOptions","sheetOptions","toolbarOptions","themeOptions","onMessage"],be=function(e){f(i,e);var r=v(i);function i(e,o,c,u){var f;s(this,i),l(E(f=r.call(this,e,o,c,u)),"initiatePrint",a(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.INITIATE_PRINT)));case 1:case"end":return e.stop()}}),e)})))),l(E(f),"undo",a(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.UNDO)));case 1:case"end":return e.stop()}}),e)})))),l(E(f),"redo",a(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.REDO)));case 1:case"end":return e.stop()}}),e)})))),l(E(f),"toggleBookmarksPane",a(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.TOGGLE_BOOKMARKS_PANE)));case 1:case"end":return e.stop()}}),e)})))),l(E(f),"getParameters",a(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new Z(A.GET_PARAMETERS));case 2:if(r=e.sent,Array.isArray(null==r?void 0:r.message)){e.next=5;break}throw new Error("Failed to retrieve the parameters");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})))),l(E(f),"getSheets",a(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new Z(A.GET_SHEETS));case 2:if(r=e.sent,Array.isArray(null==r?void 0:r.message)){e.next=5;break}throw new Error("Failed to retrieve the sheets");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})))),l(E(f),"addFilterGroups",function(){var e=a(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.ADD_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(E(f),"updateFilterGroups",function(){var e=a(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.UPDATE_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(E(f),"removeFilterGroups",function(){var e=a(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.REMOVE_FILTER_GROUPS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(E(f),"getFilterGroupsForSheet",function(){var e=a(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new Z(A.GET_FILTER_GROUPS_FOR_SHEET,{SheetId:r}));case 2:if(n=e.sent,Array.isArray(null==n?void 0:n.message)){e.next=5;break}throw new Error("Failed to retrieve filter groups for the sheet");case 5:return e.abrupt("return",n.message);case 6:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(E(f),"getFilterGroupsForVisual",function(){var e=a(t().mark((function e(r,n){var i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new Z(A.GET_FILTER_GROUPS_FOR_VISUAL,{SheetId:r,VisualId:n}));case 2:if(i=e.sent,Array.isArray(null==i?void 0:i.message)){e.next=5;break}throw new Error("Failed to retrieve filter groups for the visual");case 5:return e.abrupt("return",i.message);case 6:case"end":return e.stop()}}),e)})));return function(r,n){return e.apply(this,arguments)}}()),l(E(f),"getVisualActions",function(){var e=a(t().mark((function e(r,n){var i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new Z(A.GET_VISUAL_ACTIONS,{SheetId:r,VisualId:n}));case 2:if(i=e.sent,Array.isArray(null==i?void 0:i.message)){e.next=5;break}throw new Error("Failed to retrieve the visual actions");case 5:return e.abrupt("return",i.message);case 6:case"end":return e.stop()}}),e)})));return function(r,n){return e.apply(this,arguments)}}()),l(E(f),"addVisualActions",function(){var e=a(t().mark((function e(r,n,i){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.ADD_VISUAL_ACTIONS,{SheetId:r,VisualId:n,Actions:i})));case 1:case"end":return e.stop()}}),e)})));return function(r,n,t){return e.apply(this,arguments)}}()),l(E(f),"setVisualActions",function(){var e=a(t().mark((function e(r,n,i){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.SET_VISUAL_ACTIONS,{SheetId:r,VisualId:n,Actions:i})));case 1:case"end":return e.stop()}}),e)})));return function(r,n,t){return e.apply(this,arguments)}}()),l(E(f),"getSelectedSheetId",a(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new Z(A.GET_SELECTED_SHEET_ID));case 2:if(null!=(r=e.sent)&&r.message){e.next=5;break}throw new Error("Failed to retrieve the selected sheet id");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})))),l(E(f),"setSelectedSheetId",function(){var e=a(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.SET_SELECTED_SHEET_ID,{SheetId:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(E(f),"setTheme",function(){var e=a(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.SET_THEME,{ThemeArn:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(E(f),"navigateToDashboard",function(){var e=a(t().mark((function e(r,n){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.NAVIGATE_TO_DASHBOARD,{DashboardId:r,Parameters:null==n?void 0:n.parameters})));case 1:case"end":return e.stop()}}),e)})));return function(r,n){return e.apply(this,arguments)}}()),l(E(f),"removeVisualActions",function(){var e=a(t().mark((function e(r,n,i){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.REMOVE_VISUAL_ACTIONS,{SheetId:r,VisualId:n,Actions:i})));case 1:case"end":return e.stop()}}),e)})));return function(r,n,t){return e.apply(this,arguments)}}()),l(E(f),"getSheetVisuals",function(){var e=a(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new Z(A.GET_SHEET_VISUALS,{SheetId:r}));case 2:if(n=e.sent,Array.isArray(null==n?void 0:n.message)){e.next=5;break}throw new Error("Failed to retrieve the sheet visuals");case 5:return e.abrupt("return",n.message);case 6:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(E(f),"setParameters",function(){var e=a(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.SET_PARAMETERS,r)));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(E(f),"reset",a(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.RESET)));case 1:case"end":return e.stop()}}),e)})))),l(E(f),"setThemeOverride",function(){var e=a(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.SET_THEME_OVERRIDE,{ThemeOverride:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(E(f),"extractExperienceFromUrl",(function(e){var r,n,t=/^https:\/\/[^/]+\/embed\/[^/]+\/dashboards\/([\w-]+)(\?|$)/i.exec(e)||[];if(t.length<3)throw null===(r=(n=f.frameOptions).onChange)||void 0===r||r.call(n,new q(b.INVALID_URL,C.ERROR,"Invalid dashboard experience url",{url:e}),{frame:null}),new Error("Invalid dashboard experience URL");return{experienceType:P.DASHBOARD,dashboardId:t[1]}})),l(E(f),"interceptMessage",(function(e,r){var n,t,i;"SIZE_CHANGED"===e.eventName&&f.frameOptions.resizeHeightOnSizeChangedEvent&&(null==r||null===(n=r.frame)||void 0===n||null===(t=n.setAttribute)||void 0===t||t.call(n,"height","".concat(null==e||null===(i=e.message)||void 0===i?void 0:i.height,"px")))})),l(E(f),"transformDashboardContentOptions",(function(e){var r,t=e.parameters,i=e.locale,o=e.attributionOptions,a=e.sheetOptions,s=e.toolbarOptions,c=e.themeOptions;e.onMessage;var u=h(e,Re),p=f.transformContentOptions({locale:i},u);return Array.isArray(t)&&(p.parameters=t.reduce((function(e,r){return n(n({},e),{},l({},r.Name,r.Values))}),{})),!0!==(null==o?void 0:o.overlayContent)&&(p.footerPaddingEnabled=!0),(null!=s&&s.export||null!=s&&null!==(r=s.export)&&void 0!==r&&r.print)&&(p.printEnabled=!0),!0!==(null==s?void 0:s.undoRedo)&&(p.undoRedoDisabled=!0),!0!==(null==s?void 0:s.reset)&&(p.resetDisabled=!0),!0===(null==s?void 0:s.bookmarks)&&(p.showBookmarksIcon=!0),null!=a&&a.initialSheetId&&(p.sheetId=a.initialSheetId),"boolean"==typeof(null==a?void 0:a.singleSheet)&&(p.sheetTabsDisabled=a.singleSheet),null!=a&&a.emitSizeChangedEventOnSheetChange&&(p.resizeOnSheetChange=!0),null!=c&&c.themeArn&&(p.themeArn=c.themeArn),p})),f.experience=f.extractExperienceFromUrl(e.url);var p=f.getInternalExperienceInfo(f.experience),d=p.experienceIdentifier,v=p.internalExperience;return f.internalExperience=v,f.experienceId=d,f.experienceFrame=new Te(e,c,o,f.transformDashboardContentOptions(o),v,d,f.interceptMessage),f}return u(i)}(ae),Ae=function(e){f(t,e);var r=v(t);function t(e,i,o,a,c,u,f){var p;return s(this,t),l(E(p=r.call(this,e,i,o,a,c,u,f)),"buildExperienceUrl",(function(e){var r=p.internalExperience,t=r.contextId,i=r.discriminator;return[e,p.buildQueryString(n(n({},p.transformedContentOptions),{},{contextId:t,discriminator:i}))].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return u(t)}(me),Ce=["hideIcon","hideTopicName","theme","allowTopicSelection","onMessage"],Ne=function(e){f(n,e);var r=v(n);function n(e,o,c,u){var f;s(this,n),l(E(f=r.call(this,e,o,c,u)),"close",(function(){return f.send(new Z(A.CLOSE_Q_SEARCH))})),l(E(f),"setQuestion",function(){var e=a(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new Z(A.SET_Q_SEARCH_QUESTION,{question:r})));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(E(f),"extractExperienceFromUrl",(function(e){var r,n;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/q\/search(\/|\?|$)/i.exec(e)||[]).length<2)throw null===(r=(n=f.frameOptions).onChange)||void 0===r||r.call(n,new q(b.INVALID_URL,C.ERROR,"Invalid q-search experience URL",{url:e}),{frame:f.experienceFrame.iframe}),new Error("Invalid q-search experience URL");return{experienceType:P.QSEARCH}})),l(E(f),"interceptMessage",(function(e,r){switch(e.eventName){case A.Q_SEARCH_OPENED:case A.Q_SEARCH_CLOSED:var t,o;if("object"===i(e.message))null==r||null===(t=r.frame)||void 0===t||t.style.setProperty("height","".concat(null==e||null===(o=e.message)||void 0===o?void 0:o.height,"px"));break;case A.CONTENT_LOADED:var a=function(e){var r;(null===(r=f.experienceFrame.iframe)||void 0===r||!r.contains(e.target))&&f.close()};window.addEventListener("click",a),f.controlOptions.eventManager.addEventListenerForCleanup(f.experienceId,(function(){return window.removeEventListener("click",a)}));break;case A.Q_SEARCH_ENTERED_FULLSCREEN:var s,c;if(!f.frameStyles&&null!=r&&r.frame)f.frameStyles={position:null===(s=r.frame)||void 0===s?void 0:s.style.position,top:null===(c=r.frame)||void 0===c?void 0:c.style.top,left:r.frame.style.left,zIndex:r.frame.style.zIndex,width:r.frame.style.width,height:r.frame.style.height},r.frame.style.position="fixed",r.frame.style.top="0px",r.frame.style.left="0px",r.frame.style.zIndex=n.MAX_Z_INDEX,r.frame.style.width="100vw",r.frame.style.height="100vh";break;case A.Q_SEARCH_EXITED_FULLSCREEN:f.frameStyles&&null!=r&&r.frame&&(r.frame.style.position=f.frameStyles.position,r.frame.style.top=f.frameStyles.top,r.frame.style.left=f.frameStyles.left,r.frame.style.zIndex=f.frameStyles.zIndex,r.frame.style.width=f.frameStyles.width,r.frame.style.height=f.frameStyles.height)}})),l(E(f),"transformQSearchContentOptions",(function(e){var r=e.hideIcon,n=e.hideTopicName,t=e.theme,i=e.allowTopicSelection;e.onMessage;var o=h(e,Ce),a=f.transformContentOptions({allowTopicSelection:i},o);return void 0!==r&&(a.qBarIconDisabled=r),void 0!==n&&(a.qBarTopicNameDisabled=n),void 0!==t&&(a.themeId=t),a})),f.experience=f.extractExperienceFromUrl(e.url);var p=f.getInternalExperienceInfo(f.experience),d=p.experienceIdentifier,v=p.internalExperience;return f.internalExperience=v,f.experienceId=d,f.experienceFrame=new Ae(e,c,o,f.transformQSearchContentOptions(o),v,d,f.interceptMessage),f}return u(n)}(ae);l(Ne,"MAX_Z_INDEX","2147483647");var Le=function(e){f(t,e);var r=v(t);function t(e,i,o,a,c,u,f){var p;return s(this,t),l(E(p=r.call(this,e,i,o,a,c,u,f)),"buildExperienceUrl",(function(e){var r=p.internalExperience,t=r.contextId,i=r.discriminator;return[e,p.buildQueryString(n(n({},p.transformedContentOptions),{},{contextId:t,discriminator:i}))].join("?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return u(t)}(me),De=u((function e(r,t,i,o){var a=this;s(this,e),l(this,"experience",{experienceType:P.CONTROL}),l(this,"iframe",null),l(this,"send",(function(e){var r;return null===(r=a.internalSend)||void 0===r?void 0:r.call(a,e)})),l(this,"controlFrameMessageListener",(function(e){if(a.isMessageEvent(e.data)){var r=e.data;try{if(r.eventTarget){var n=ae.getExperienceIdentifier(r.eventTarget);a.eventManager.invokeEventListener(n,r)}a.sendAcknowledgment(r)}catch(e){var t,i;null===(t=a.onChange)||void 0===t||t.call(a,new q(b.UNRECOGNIZED_EVENT_TARGET,C.WARN,"Message with unrecognized event target received",{eventTarget:r.eventTarget}),{frame:a.iframe}),null===(i=a.logger)||void 0===i||i.warn("Message with unrecognized event target received")}}})),l(this,"setLogger",(function(e){return a.logger=e,a})),l(this,"initializeFrame",(function(){var r=a.getControlExperienceBaseUrl(),n=a.getControlExperienceId();a.onMessage&&a.eventManager.addEventListener(n,a.onMessage,!0);var t=new Le({url:r,container:a.container,width:"0px",height:"0px",onChange:a.onChange},{eventManager:a.eventManager,contextId:a.internalExperience.contextId,timeout:e.FRAME_TIMEOUT,urlInfo:a.urlInfo},{onMessage:a.onMessage},{},a.internalExperience,n);a.internalSend=t.send,a.iframe=t.iframe,window.addEventListener("message",a.controlFrameMessageListener),a.eventManager.addEventListenerForCleanup(n,(function(){return window.removeEventListener("message",a.controlFrameMessageListener)}))})),l(this,"sendAcknowledgment",(function(e){var r,n,t=new K(A.ACKNOWLEDGE,a.internalExperience,{eventName:e.eventName,eventTarget:e.eventTarget});(null===(r=(n=window).requestIdleCallback)||void 0===r?void 0:r.call(n,(function(){return a.send(t)})))||a.send(t)})),l(this,"getControlExperienceId",(function(){return[a.internalExperience.contextId,a.internalExperience.experienceType,a.internalExperience.discriminator].filter(Boolean).join("-")})),l(this,"getControlExperienceBaseUrl",(function(){var e=a.urlInfo,r=e.host,n=e.sessionId,t="".concat(r,"/embed/").concat(n,"/embedControl");return new URL(t).href})),l(this,"isMessageEvent",(function(e){return!!e&&!!e.eventTarget&&!!e.eventName})),this.container=r,this.eventManager=t.eventManager,this.urlInfo=t.urlInfo,this.internalExperience=n(n({},this.experience),{},{contextId:t.contextId,discriminator:0}),this.onMessage=o,this.onChange=i,this.initializeFrame()}));l(De,"FRAME_TIMEOUT",6e4);var Ue=u((function e(){var r=this;s(this,e),l(this,"addEventListener",(function(e,n,t){if(!e)throw new Error("Experience identifier is required when calling addEventListener");if("function"!=typeof n)throw new Error("Invalid type provided for event listener");var i=r.eventListeners.get(e);return t&&r.addEventListenerForCleanup(e,(function(){return r.removeEventListener(e,n)})),i?(i.push(n),r):(r.eventListeners.set(e,[n]),r)})),l(this,"invokeEventListener",(function(e,n){var t=r.eventListeners.get(e);if(!t)throw new Error("Unable to find experience specific event listeners: ".concat(e));return t.forEach((function(e){e(n)})),r})),l(this,"removeEventListener",(function(e,n){var t=r.eventListeners.get(e);if(!t)throw new Error("Unable to find experience specific event listeners: ".concat(e));var i=t.filter((function(e){return e!==n}));return r.eventListeners.set(e,i),r})),l(this,"addEventListenerForCleanup",(function(e,n){var t,i=null!==(t=r.cleanUpCallbacks.get(e))&&void 0!==t?t:[];i.push(n),r.cleanUpCallbacks.set(e,i)})),l(this,"cleanUpCallbacksForExperience",(function(e){var n=r.cleanUpCallbacks.get(e);n&&(n.forEach((function(e){return e()})),r.cleanUpCallbacks.delete(e),r.eventListeners.set(e,[]))})),this.eventListeners=new Map,this.cleanUpCallbacks=new Map})),Me=u((function e(){s(this,e),l(this,"log",console.log),l(this,"warn",console.warn),l(this,"error",console.error),l(this,"debug",console.debug),l(this,"info",console.info)})),Pe=u((function e(r){var n=this;s(this,e),l(this,"embedVisual",function(){var e=a(t().mark((function e(r){var i,o,a=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.length>1&&void 0!==a[1]?a[1]:{},n.validateFrameOptions(r,"embedVisual"),o=n.buildControlOptions(r),e.abrupt("return",new _e(r,i,o,n.experienceIdentifiers).setLogProvider(n.logger));case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(this,"embedDashboard",function(){var e=a(t().mark((function e(r){var i,o,a=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.length>1&&void 0!==a[1]?a[1]:{},n.validateFrameOptions(r,"embedDashboard"),o=n.buildControlOptions(r),e.abrupt("return",new be(r,i,o,n.experienceIdentifiers).setLogProvider(n.logger));case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(this,"embedConsole",function(){var e=a(t().mark((function e(r){var i,o,a=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.length>1&&void 0!==a[1]?a[1]:{},n.validateFrameOptions(r,"embedConsole"),o=n.buildControlOptions(r),e.abrupt("return",new xe(r,i,o,n.experienceIdentifiers).setLogProvider(n.logger));case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(this,"embedQSearchBar",function(){var e=a(t().mark((function e(r){var i,o,a=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.length>1&&void 0!==a[1]?a[1]:{},n.validateFrameOptions(r,"embedQSearchBar"),o=n.buildControlOptions(r),e.abrupt("return",new Ne(r,i,o,n.experienceIdentifiers).setLogProvider(n.logger));case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),l(this,"validateFrameOptions",(function(e,r){if(!e){var t="".concat(r," is called without frameOptions");throw n.onChange(new q(b.NO_FRAME_OPTIONS,C.ERROR,"".concat(r," is called without frameOptions"),{methodName:r}),{frame:null}),new Error(t)}if("object"!==i(e)||Array.isArray(e)){var o="".concat(r," is called with non-object frameOptions");throw n.onChange(new q(b.INVALID_FRAME_OPTIONS,C.ERROR,o,{methodName:r,frameOptionsType:Array.isArray(e)?"array":i(e)}),{frame:null}),new Error(o)}var a=["url","container","width","height","resizeHeightOnSizeChangedEvent","withIframePlaceholder","onChange","className"],s=Object.keys(e).filter((function(e){return!a.includes(e)}));if(s.length>0){var c,u,l="".concat(r," is called with unrecognized properties");null===(c=e.onChange)||void 0===c||c.call(e,new q(b.UNRECOGNIZED_FRAME_OPTIONS,C.WARN,l,{unrecognizedFrameOptions:s}),{frame:null}),null===(u=n.logger)||void 0===u||u.warn(l)}})),l(this,"buildControlOptions",(function(e){if(!n.controlOptions){if(!e.url)throw new Error("URL is missing in frame options, but is a required field");var r=n.getControlUrlInfo(e.url),t=new De(n.getBodyElement(),{eventManager:n.eventManager,urlInfo:r,contextId:n.contextId},n.onChange).setLogger(n.logger);n.controlOptions={eventManager:n.eventManager,sendToControlFrame:t.send,contextId:n.contextId,timeout:De.FRAME_TIMEOUT,urlInfo:r}}return n.controlOptions})),l(this,"onChange",(function(e,r){n.contextOnChange&&n.contextOnChange(e,r)})),l(this,"getControlUrlInfo",(function(e){var r=/^(https:\/\/[^/]+)\/(embedding|embed)\/([^/]+)\/[^?]+\?(.*)/i.exec(e)||[];if((null==r?void 0:r.length)<4)throw new Error('Invalid embedding url: "'.concat(e,'"'));return{sessionId:r[3],host:r[1],urlSearchParams:new URLSearchParams(r[4])}})),l(this,"getBodyElement",(function(){var e,r=null===(e=document.getElementsByTagName("body"))||void 0===e?void 0:e[0];if(!r){var t="could not locate <body> element in the page";throw n.onChange(new q(b.NO_BODY,C.ERROR,t),{frame:null}),new Error(t)}return r})),this.contextId=oe(),this.experienceIdentifiers=new Set,this.eventManager=new Ue,this.contextOnChange=r.onChange,this.logger=new Me})),Fe=function(){var e=a(t().mark((function e(){var r,n=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>0&&void 0!==n[0]?n[0]:{},e.abrupt("return",new Pe(r));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ke=n(n(n(n(n(n(n(n(n(n(n(n({},M),R),N),L),D),U),F),k),j),Q),H),B);e.BaseExperience=ae,e.BaseExperienceFrame=me,e.CALCULATED_METRIC_COLUMN_TYPE=V,e.ChangeEvent=q,e.ChangeEventLevel=C,e.ChangeEventName=b,e.ConsoleExperience=xe,e.ConsoleExperienceFrame=Ie,e.ControlExperience=De,e.ControlExperienceFrame=Le,e.DashboardExperience=be,e.DashboardExperienceFrame=Te,e.DataResponse=J,e.DefaultLogger=Me,e.EmbeddingContext=Pe,e.EmbeddingEvent=z,e.EmbeddingMessageEvent=Z,e.ErrorChangeEventName=I,e.ErrorResponse=$,e.EventManager=Ue,e.ExperienceType=P,e.GetterMessageEventName=S,e.Iframe=Ee,e.InfoChangeEventName=_,e.InfoMessageEventName=w,e.InvokerMessageEventName=T,e.MessageEventName=A,e.PostMessageEvent=W,e.QSE=ke,e.QSearchExperience=Ne,e.QSearchExperienceFrame=Ae,e.ResponseMessage=X,e.SDK_VERSION=ve,e.SPECIAL_DATAPOINT_VALUE_TYPES=G,e.SetterMessageEventName=x,e.SuccessResponse=Y,e.TargetedMessageEvent=K,e.VisualExperience=_e,e.VisualExperienceFrame=Oe,e.WarnChangeEventName=y,e.createEmbeddingContext=Fe})); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).QuickSightEmbedding={})}(this,(function(e){"use strict";function n(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function t(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(n){l(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}function r(){r=function(){return e};var e={},n=Object.prototype,t=n.hasOwnProperty,i=Object.defineProperty||function(e,n,t){e[n]=t.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(e,n,t){return Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[n]}try{u({},"")}catch(e){u=function(e,n,t){return e[n]=t}}function l(e,n,t,r){var o=n&&n.prototype instanceof d?n:d,a=Object.create(o.prototype),s=new S(r||[]);return i(a,"_invoke",{value:I(e,t,s)}),a}function f(e,n,t){try{return{type:"normal",arg:e.call(n,t)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var p={};function d(){}function h(){}function E(){}var v={};u(v,a,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(R([])));g&&g!==n&&t.call(g,a)&&(v=g);var O=E.prototype=d.prototype=Object.create(v);function w(e){["next","throw","return"].forEach((function(n){u(e,n,(function(e){return this._invoke(n,e)}))}))}function _(e,n){function r(i,o,a,s){var c=f(e[i],e,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&t.call(l,"__await")?n.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):n.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(e,t){function i(){return new n((function(n,i){r(e,t,n,i)}))}return o=o?o.then(i,i):i()}})}function I(e,n,t){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return A()}for(t.method=i,t.arg=o;;){var a=t.delegate;if(a){var s=y(a,t);if(s){if(s===p)continue;return s}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if("suspendedStart"===r)throw r="completed",t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);r="executing";var c=f(e,n,t);if("normal"===c.type){if(r=t.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:t.done}}"throw"===c.type&&(r="completed",t.method="throw",t.arg=c.arg)}}}function y(e,n){var t=n.method,r=e.iterator[t];if(void 0===r)return n.delegate=null,"throw"===t&&e.iterator.return&&(n.method="return",n.arg=void 0,y(e,n),"throw"===n.method)||"return"!==t&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+t+"' method")),p;var i=f(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,p;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,p):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}function x(e){var n={tryLoc:e[0]};1 in e&&(n.catchLoc=e[1]),2 in e&&(n.finallyLoc=e[2],n.afterLoc=e[3]),this.tryEntries.push(n)}function T(e){var n=e.completion||{};n.type="normal",delete n.arg,e.completion=n}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function R(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function n(){for(;++r<e.length;)if(t.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=void 0,n.done=!0,n};return i.next=i}}return{next:A}}function A(){return{value:void 0,done:!0}}return h.prototype=E,i(O,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:h,configurable:!0}),h.displayName=u(E,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var n="function"==typeof e&&e.constructor;return!!n&&(n===h||"GeneratorFunction"===(n.displayName||n.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,u(e,c,"GeneratorFunction")),e.prototype=Object.create(O),e},e.awrap=function(e){return{__await:e}},w(_.prototype),u(_.prototype,s,(function(){return this})),e.AsyncIterator=_,e.async=function(n,t,r,i,o){void 0===o&&(o=Promise);var a=new _(l(n,t,r,i),o);return e.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(O),u(O,c,"Generator"),u(O,a,(function(){return this})),u(O,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var n=Object(e),t=[];for(var r in n)t.push(r);return t.reverse(),function e(){for(;t.length;){var r=t.pop();if(r in n)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=R,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&t.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(t,r){return a.type="throw",a.arg=e,n.next=t,r&&(n.method="next",n.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=t.call(o,"catchLoc"),c=t.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,n){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&t.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=n&&n<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=n,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(a)},complete:function(e,n){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&n&&(this.next=n),p},finish:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),T(t),p}},catch:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.tryLoc===e){var r=t.completion;if("throw"===r.type){var i=r.arg;T(t)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,t){return this.delegate={iterator:R(e),resultName:n,nextLoc:t},"next"===this.method&&(this.arg=void 0),p}},e}function i(e){return i="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},i(e)}function o(e,n,t,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void t(e)}s.done?n(c):Promise.resolve(c).then(r,i)}function a(e){return function(){var n=this,t=arguments;return new Promise((function(r,i){var a=e.apply(n,t);function s(e){o(a,r,i,s,c,"next",e)}function c(e){o(a,r,i,s,c,"throw",e)}s(void 0)}))}}function s(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function c(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,O(r.key),r)}}function u(e,n,t){return n&&c(e.prototype,n),t&&c(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,n,t){return(n=O(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function f(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),n&&d(e,n)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function d(e,n){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,n){return e.__proto__=n,e},d(e,n)}function h(e,n){if(null==e)return{};var t,r,i=function(e,n){if(null==e)return{};var t,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,r=p(e);if(n){var i=p(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return function(e,n){if(n&&("object"==typeof n||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return E(e)}(this,t)}}function m(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,i,o,a,s=[],c=!0,u=!1;try{if(o=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;c=!1}else for(;!(c=(r=o.call(t)).done)&&(s.push(r.value),s.length!==n);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return g(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return g(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function O(e){var n=function(e,n){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:String(n)}var w={CALLBACK_OPERATION_INVOKED:"CALLBACK_OPERATION_INVOKED",CONTENT_LOADED:"CONTENT_LOADED",EXPERIENCE_INITIALIZED:"EXPERIENCE_INITIALIZED",ERROR_OCCURRED:"ERROR_OCCURRED",SIZE_CHANGED:"SIZE_CHANGED",PARAMETERS_CHANGED:"PARAMETERS_CHANGED",SELECTED_SHEET_CHANGED:"SELECTED_SHEET_CHANGED",MODAL_OPENED:"MODAL_OPENED",Q_SEARCH_CLOSED:"Q_SEARCH_CLOSED",Q_SEARCH_OPENED:"Q_SEARCH_OPENED",Q_SEARCH_SIZE_CHANGED:"Q_SEARCH_SIZE_CHANGED",Q_SEARCH_ENTERED_FULLSCREEN:"Q_SEARCH_ENTERED_FULLSCREEN",Q_SEARCH_EXITED_FULLSCREEN:"Q_SEARCH_EXITED_FULLSCREEN"},_={FRAME_STARTED:"FRAME_STARTED",FRAME_MOUNTED:"FRAME_MOUNTED",FRAME_LOADED:"FRAME_LOADED",FRAME_REMOVED:"FRAME_REMOVED"},I={FRAME_NOT_CREATED:"FRAME_NOT_CREATED",NO_BODY:"NO_BODY",NO_CONTAINER:"NO_CONTAINER",INVALID_CONTAINER:"INVALID_CONTAINER",NO_URL:"NO_URL",INVALID_URL:"INVALID_URL",NO_FRAME_OPTIONS:"NO_FRAME_OPTIONS",INVALID_FRAME_OPTIONS:"INVALID_FRAME_OPTIONS"},y={UNRECOGNIZED_CONTENT_OPTIONS:"UNRECOGNIZED_CONTENT_OPTIONS",UNRECOGNIZED_FRAME_OPTIONS:"UNRECOGNIZED_FRAME_OPTIONS",UNRECOGNIZED_EVENT_TARGET:"UNRECOGNIZED_EVENT_TARGET"},x={SET_PARAMETERS:"SET_PARAMETERS",SET_SELECTED_SHEET_ID:"SET_SELECTED_SHEET_ID",SET_Q_SEARCH_QUESTION:"SET_Q_SEARCH_QUESTION",SET_VISUAL_ACTIONS:"SET_VISUAL_ACTIONS",SET_THEME:"SET_THEME",ADD_FILTER_GROUPS:"ADD_FILTER_GROUPS",UPDATE_FILTER_GROUPS:"UPDATE_FILTER_GROUPS",REMOVE_FILTER_GROUPS:"REMOVE_FILTER_GROUPS",ADD_VISUAL_ACTIONS:"ADD_VISUAL_ACTIONS",REMOVE_VISUAL_ACTIONS:"REMOVE_VISUAL_ACTIONS",SET_THEME_OVERRIDE:"SET_THEME_OVERRIDE",PRELOAD_THEMES:"PRELOAD_THEMES"},T={GET_PARAMETERS:"GET_PARAMETERS",GET_SHEETS:"GET_SHEETS",GET_SHEET_VISUALS:"GET_SHEET_VISUALS",GET_VISUAL_ACTIONS:"GET_VISUAL_ACTIONS",GET_SELECTED_SHEET_ID:"GET_SELECTED_SHEET_ID",GET_FILTER_GROUPS_FOR_SHEET:"GET_FILTER_GROUPS_FOR_SHEET",GET_FILTER_GROUPS_FOR_VISUAL:"GET_FILTER_GROUPS_FOR_VISUAL"},S={ACKNOWLEDGE:"ACKNOWLEDGE",INITIATE_PRINT:"INITIATE_PRINT",NAVIGATE_TO_DASHBOARD:"NAVIGATE_TO_DASHBOARD",CLOSE_Q_SEARCH:"CLOSE_Q_SEARCH",UNDO:"UNDO",REDO:"REDO",RESET:"RESET",TOGGLE_BOOKMARKS_PANE:"TOGGLE_BOOKMARKS_PANE"},R=Object.freeze({__proto__:null,ErrorChangeEventName:I,GetterMessageEventName:T,InfoChangeEventName:_,InfoMessageEventName:w,InvokerMessageEventName:S,SetterMessageEventName:x,WarnChangeEventName:y}),A=t(t(t({},_),I),y),b=t(t(t(t({},w),x),T),S),N={ERROR:"ERROR",INFO:"INFO",WARN:"WARN"},C=Object.freeze({__proto__:null,ChangeEventLevel:N,ChangeEventName:A,MessageEventName:b}),L=Object.freeze({__proto__:null}),D=Object.freeze({__proto__:null}),M=Object.freeze({__proto__:null}),P=Object.freeze({__proto__:null}),U={CONSOLE:"CONSOLE",CONTEXT:"CONTEXT",CONTROL:"CONTROL",VISUAL:"VISUAL",DASHBOARD:"DASHBOARD",QSEARCH:"QSEARCH"},F=Object.freeze({__proto__:null,ExperienceType:U}),k=Object.freeze({__proto__:null}),G={NULL:null,OTHER_BUCKET:null},V={INTEGER:null,STRING:null,DECIMAL:null,DATETIME:null},j=Object.freeze({__proto__:null,CALCULATED_METRIC_COLUMN_TYPE:V,SPECIAL_DATAPOINT_VALUE_TYPES:G}),H=Object.freeze({__proto__:null}),Q=Object.freeze({__proto__:null}),B=Object.freeze({__proto__:null}),z=u((function e(n,t,r){s(this,e),this.eventName=n,this.message=t,this.data=r})),Z=function(e){f(t,e);var n=v(t);function t(e,r,i,o){var a;return s(this,t),(a=n.call(this,e,i,o)).eventLevel=r,a}return u(t)}(z),q=function(e){f(t,e);var n=v(t);function t(e,r,i){var o;return s(this,t),(o=n.call(this,e,r,i)).eventName=e,o}return u(t)}(z),K=function(e){f(t,e);var n=v(t);function t(e,r,i,o){var a;return s(this,t),(a=n.call(this,e,i,o)).eventTarget=r,a}return u(t)}(q),W=function(e){f(t,e);var n=v(t);function t(e,r,i,o,a,c,u){var l;return s(this,t),(l=n.call(this,e,r,c,u)).timestamp=o,l.version=a,l.eventId=i,l}return u(t)}(K),X=u((function e(){s(this,e)})),Y=u((function e(){s(this,e),l(this,"success",!0)})),$=u((function e(n){s(this,e),l(this,"success",!1),this.errorCode=n.errorCode,this.error=n.error,this.message=n.message})),J=u((function e(n){s(this,e),l(this,"success",!0),this.message=n}));let ee;const ne=new Uint8Array(16);function te(){if(!ee&&(ee="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ee))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ee(ne)}const re=[];for(let e=0;e<256;++e)re.push((e+256).toString(16).slice(1));var ie={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function oe(e,n,t){if(ie.randomUUID&&!n&&!e)return ie.randomUUID();const r=(e=e||{}).random||(e.rng||te)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,n){t=t||0;for(let e=0;e<16;++e)n[t+e]=r[e];return n}return function(e,n=0){return(re[e[n+0]]+re[e[n+1]]+re[e[n+2]]+re[e[n+3]]+"-"+re[e[n+4]]+re[e[n+5]]+"-"+re[e[n+6]]+re[e[n+7]]+"-"+re[e[n+8]]+re[e[n+9]]+"-"+re[e[n+10]]+re[e[n+11]]+re[e[n+12]]+re[e[n+13]]+re[e[n+14]]+re[e[n+15]]).toLowerCase()}(r)}var ae=u((function e(n,i,o,c){var u=this;s(this,e),l(this,"send",function(){var e=a(r().mark((function e(n){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u.experienceFrame&&u.internalExperience){e.next=2;break}throw new Error("Experience has not been initialized");case 2:return t=new K(n.eventName,u.internalExperience,n.message,n.data),e.abrupt("return",u.experienceFrame.send(t));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(this,"addEventListener",(function(e,n){return u.experienceFrame.addInternalEventListener(e,n)})),l(this,"setLogProvider",(function(e){return u.logger=e,u})),l(this,"getInternalExperienceInfo",(function(n){var r,i,o=-1;do{o++,r=t(t({},n),{},{contextId:u.controlOptions.contextId,discriminator:o}),i=e.getExperienceIdentifier(r)}while(u.experienceIdentifiers.has(i));return u.experienceIdentifiers.add(i),{experienceIdentifier:i,internalExperience:r}})),l(this,"transformContentOptions",(function(e,n){var t,r,i,o=Object.keys(n);Object.keys(n).length>0&&(null===(t=(r=u.frameOptions).onChange)||void 0===t||t.call(r,new Z(A.UNRECOGNIZED_CONTENT_OPTIONS,N.WARN,"Experience content options contain unrecognized properties",{unrecognizedContentOptions:o}),{frame:null}),null===(i=u.logger)||void 0===i||i.warn("Experience content options contain unrecognized properties"));return e})),l(this,"validateFrameOptions",(function(){if(!u.frameOptions.url){var e,n,t="Url is required for the experience";throw null===(e=(n=u.frameOptions).onChange)||void 0===e||e.call(n,new Z(A.NO_URL,N.ERROR,t),{frame:null}),new Error(t)}})),this.frameOptions=n,this.contentOptions=i,this.controlOptions=o,this.experienceIdentifiers=c,this.validateFrameOptions()}));l(ae,"getExperienceIdentifier",(function(e){if(e.experienceType===U.DASHBOARD)return[e.contextId,e.experienceType,e.dashboardId,e.discriminator].filter(Boolean).join("-");if(e.experienceType===U.VISUAL)return[e.contextId,e.experienceType,e.dashboardId,e.sheetId,e.visualId,e.discriminator].filter(Boolean).join("-");if([U.CONSOLE,U.CONTROL,U.CONTEXT,U.QSEARCH].includes(e.experienceType))return[e.contextId,e.experienceType,e.discriminator].filter(Boolean).join("-");throw new Error("Invalid experience unable to build experience identifier")}));const se=2147483647,ce={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ue=Math.floor,le=String.fromCharCode;function fe(e){throw new RangeError(ce[e])}const pe=function(e,n){return e+22+75*(e<26)-((0!=n)<<5)},de=function(e,n,t){let r=0;for(e=t?ue(e/700):e>>1,e+=ue(e/n);e>455;r+=36)e=ue(e/35);return ue(r+36*e/(e+38))},he=function(e){const n=[];e=function(e){const n=[];let t=0;const r=e.length;for(;t<r;){const i=e.charCodeAt(t++);if(i>=55296&&i<=56319&&t<r){const r=e.charCodeAt(t++);56320==(64512&r)?n.push(((1023&i)<<10)+(1023&r)+65536):(n.push(i),t--)}else n.push(i)}return n}(e);const t=e.length;let r=128,i=0,o=72;for(const t of e)t<128&&n.push(le(t));const a=n.length;let s=a;for(a&&n.push("-");s<t;){let t=se;for(const n of e)n>=r&&n<t&&(t=n);const c=s+1;t-r>ue((se-i)/c)&&fe("overflow"),i+=(t-r)*c,r=t;for(const t of e)if(t<r&&++i>se&&fe("overflow"),t===r){let e=i;for(let t=36;;t+=36){const r=t<=o?1:t>=o+26?26:t-o;if(e<r)break;const i=e-r,a=36-r;n.push(le(pe(r+i%a,0))),e=ue(i/a)}n.push(le(pe(e,0))),o=de(i,c,s===a),i=0,++s}++i,++r}return n.join("")};var Ee=u((function e(n){var t=this;s(this,e),l(this,"classNames",[e.IFRAME_CLASS_NAME]),l(this,"getIframe",(function(){return t.iframe})),l(this,"createIframePlaceholder",(function(n){if(t.iframePlaceholder=document.createElement("div"),t.iframePlaceholder.id="".concat(t.iframeName,"-placeholder"),t.iframePlaceholder.style.width=t.width,t.iframePlaceholder.style.backgroundColor="rgba(0,0,0,.01)",t.iframePlaceholder.style.display="flex",t.iframePlaceholder.style.justifyContent="center",t.iframePlaceholder.style.alignItems="center",t.iframePlaceholder.className="".concat(e.IFRAME_CLASS_NAME,"-placeholder"),t.height.endsWith("px")&&(t.iframePlaceholder.style.height=t.height),n&&"boolean"!=typeof n)t.iframePlaceholder.appendChild(n);else{var r=t.createLoaderSVG();t.iframePlaceholder.appendChild(r)}t.container.appendChild(t.iframePlaceholder)})),l(this,"createIframe",(function(){var e=document.createElement("iframe");return e.className=t.classNames.join(" ").trim(),e.id=t.iframeName,e.name=t.iframeName,e.width=t.width,e.height=t.height,t.loading&&(e.loading=t.loading),e.style.border="0px",e.style.padding="0px",t.iframePlaceholder&&(e.style.opacity="0",e.style.position="absolute"),"0px"===t.width&&"0px"===t.height&&(e.style.position="absolute"),t.container.appendChild(e),t.payload?t.postRequest=t.createPostRequest({src:t.src,target:e.name,container:t.container,payload:t.payload}):e.src=t.src,e})),l(this,"onLoadLocal",(function(e){var n,r;t.iframePlaceholder&&(t.iframePlaceholder.remove(),t.iframe.style.position="",t.iframe.style.opacity="1",t.iframe.style.transition="opacity .5s ease-in-out"),null===(n=t.onLoad)||void 0===n||n.call(t,e),null===(r=t.postRequest)||void 0===r||r.remove()})),l(this,"createPostRequest",(function(e){var n=e.src,t=e.container,r=e.target,i=e.payload;if(!n)throw new Error("No source has been provided.");var o=document.createElement("form");return o.style.visibility="hidden",o.method="POST",o.action=n,o.target=r,o.name="".concat(r,"-form"),Object.keys(i).forEach((function(e){var n=document.createElement("input");n.type="hidden",n.name=e,n.value=i[e],o.appendChild(n)})),t.appendChild(o),null==o||o.submit(),{remove:function(){o.remove()}}})),l(this,"createSvgElement",(function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.entries(n).forEach((function(e){var n=m(e,2),t=n[0],r=n[1];return i.setAttribute(t,r)})),Object.entries(t).forEach((function(e){var n=m(e,2),t=n[0],r=n[1];return i.style.setProperty(t,r)})),r.forEach((function(e){return i.appendChild(e)})),i})),l(this,"createLoaderSVG",(function(){var e=[1,2,3].map((function(e){var n=t.createSvgElement("animate",{attributeName:"opacity",dur:"1s",values:"0;1;0",repeatCount:"indefinite",begin:"".concat(e/10)});return t.createSvgElement("circle",{fill:"#ccc",stroke:"none",cx:"".concat(20*e-14),cy:"50",r:"6"},void 0,[n])}));return t.createSvgElement("svg",{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100","enable-background":"new 0 0 0 0"},{width:"100px",height:"100px"},e)}));var r=n.id,i=n.src,o=n.width,a=void 0===o?"100%":o,c=n.height,u=void 0===c?"100%":c,f=n.container,p=n.onLoad,d=n.loading,h=n.withIframePlaceholder,E=n.payload,v=n.className;this.width=a,this.height=u,this.onLoad=p,this.iframeName=r,this.loading=d,v&&this.classNames.push(v),this.container=f,this.payload=E,this.src=i,h&&this.createIframePlaceholder(h),this.iframe=this.createIframe(),this.iframe.addEventListener("load",this.onLoadLocal)}));l(Ee,"IFRAME_CLASS_NAME","quicksight-embedding-iframe");var ve="2.6.0",me=u((function e(n,o,c,u,f,p,d){var h=this;s(this,e),l(this,"MESSAGE_RESPONSE_TIMEOUT",5e3),l(this,"iframe",null),l(this,"send",function(){var e=a(r().mark((function e(n){var t,i,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h.iframe){e.next=2;break}throw new Error("Cannot send ".concat(n.eventName,": No experience frame found"));case 2:if(i=oe(),o=new W(n.eventName,n.eventTarget,i,Date.now(),ve,n.message,n.data),null===(t=h.iframe)||void 0===t||null===(t=t.contentWindow)||void 0===t||t.postMessage(o,h.url),n.eventName!==b.ACKNOWLEDGE){e.next=7;break}return e.abrupt("return",Promise.resolve(new Y));case 7:return e.abrupt("return",new Promise((function(e,t){var r=function n(t){var r,o,a=t.data;(null==a?void 0:a.eventId)===i&&(window.removeEventListener("message",n),!0===(null===(r=a.message)||void 0===r?void 0:r.success)?e(new Y):!1===(null===(o=a.message)||void 0===o?void 0:o.success)?e(new $(a.message)):e(new J(a.message)))};window.addEventListener("message",r),setTimeout((function(){window.removeEventListener("message",r),t("".concat(n.eventName," timed out"))}),h.MESSAGE_RESPONSE_TIMEOUT)})));case 8:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(this,"buildParameterString",(function(e){return e&&"object"===i(e)?Object.entries(e).map((function(e){var n=m(e,2),t=n[0],r=n[1],i=Array.isArray(r)?r:[r],o=encodeURIComponent(t);return i.map(encodeURIComponent).map((function(e){return"p.".concat(o,"=").concat(e)})).join("&")})).join("&"):""})),l(this,"buildQueryString",(function(e){var n=Object.entries(e).reduce((function(e,n){var r=m(n,2),i=r[0],o=r[1];return null!=o?t(t({},e),{},l({},i,"".concat(o))):e}),{punyCodeEmbedOrigin:he("".concat(window.location.origin,"/")),sdkVersion:ve});return new URLSearchParams(n).toString()})),l(this,"createExperienceIframe",(function(){h.onChange(new Z(A.FRAME_STARTED,N.INFO,"Creating the frame",{experience:h.internalExperience}));try{h.setTimeoutInstance(),h.iframe=new Ee({id:h.experienceId,src:h.url,width:h.frameOptions.width,height:h.frameOptions.height,container:h.container,onLoad:h.onLoadHandler,withIframePlaceholder:h.frameOptions.withIframePlaceholder,className:h.frameOptions.className}).getIframe()}catch(e){throw h.onChange(new Z(A.FRAME_NOT_CREATED,N.ERROR,"Failed to create the frame",{experience:h.internalExperience})),e}h.onChange(new Z(A.FRAME_MOUNTED,N.INFO,"The frame mounted",{experience:h.internalExperience,frame:h.iframe}))})),l(this,"addInternalEventListener",(function(e,n){var t=function(t,r){t.eventName===e&&n(t,r)};return h.controlOptions.eventManager.addEventListener(h.experienceId,t,!0),{remove:function(){return h.controlOptions.eventManager.removeEventListener(h.experienceId,t)}}})),l(this,"validateBaseUrl",(function(e){if(!e)throw h.onChange(new Z(A.NO_URL,N.ERROR,"Url is required for the experience",{experience:h.internalExperience})),new Error("Url is required for the experience");return e})),l(this,"setTimeoutInstance",(function(){h.timeoutInstance=setTimeout((function(){throw h.onChange(new Z(A.FRAME_NOT_CREATED,N.ERROR,"Creating the frame timed out",{experience:h.internalExperience})),new Error("Creating the frame timed out")}),h.controlOptions.timeout)})),l(this,"onLoadHandler",a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h.timeoutInstance&&clearTimeout(h.timeoutInstance),h.onChange(new Z(A.FRAME_LOADED,N.INFO,"The experience iframe loaded",{experience:h.internalExperience}));case 2:case"end":return e.stop()}}),e)})))),l(this,"getContainer",(function(e){if(!e){var n="Container is required for the experience";throw h.onChange(new Z(A.NO_CONTAINER,N.ERROR,n,{experience:h.internalExperience})),new Error(n)}var t=null;if("string"==typeof e)try{t=document.querySelector(e)}catch(e){throw e instanceof Error&&h.onChange(new Z(A.INVALID_CONTAINER,N.ERROR,e.message,{experience:h.internalExperience})),e}else"object"===i(e)&&e.nodeName&&(t=e);if(!t){var r="Invalid container '".concat(e,"' for the experience");throw h.onChange(new Z(A.INVALID_CONTAINER,N.ERROR,r,{experience:h.internalExperience})),new Error(r)}return t})),l(this,"decorateOnChange",(function(e){return function(n){if(e){var t={frame:h.iframe};e(n,t)}}})),l(this,"decorateOnMessage",(function(e,n){return function(t){n&&h.iframe&&n(t,{frame:h.iframe}),e&&e(t,{frame:h.iframe})}})),l(this,"initializeMutationObserver",(function(){var e=new MutationObserver((function(n){n.some((function(e){return Array.from(e.removedNodes).some((function(e){return e===h.iframe||e===h.container}))}))&&(h.controlOptions.eventManager.cleanUpCallbacksForExperience(h.experienceId),e.disconnect(),h.iframe=null,h.onChange(new Z(A.FRAME_REMOVED,N.INFO,"Frame removed from the DOM",{experience:h.internalExperience})))}));e.observe(document.body,{childList:!0,subtree:!0})})),this.frameOptions=n,this.contentOptions=c,this.onChange=this.decorateOnChange(n.onChange),this.onMessage=this.decorateOnMessage(c.onMessage,d),this.container=this.getContainer(n.container),this.internalExperience=f,this.controlOptions=o,this.transformedContentOptions=u,this.experienceId=p,this.url=this.validateBaseUrl(n.url),this.controlOptions.eventManager.addEventListener(this.experienceId,this.onMessage,!0),this.initializeMutationObserver()})),ge=["parameters"],Oe=function(e){f(r,e);var n=v(r);function r(e,i,o,a,c,u,f){var p;return s(this,r),l(E(p=n.call(this,e,i,o,a,c,u,f)),"buildExperienceUrl",(function(e){var n=p.transformedContentOptions,r=n.parameters,i=h(n,ge),o=p.internalExperience,a=o.contextId,s=o.discriminator;return[e,[p.buildQueryString(t(t({},i),{},{contextId:a,discriminator:s})),p.buildParameterString(r)].join("#")].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return u(r)}(me),we=["fitToIframeWidth","locale","parameters","themeOptions","onMessage"],_e=function(e){f(i,e);var n=v(i);function i(e,o,c,u){var f;s(this,i),l(E(f=n.call(this,e,o,c,u)),"setParameters",function(){var e=a(r().mark((function e(n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.SET_PARAMETERS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(E(f),"reset",a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.RESET)));case 1:case"end":return e.stop()}}),e)})))),l(E(f),"addFilterGroups",function(){var e=a(r().mark((function e(n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.ADD_FILTER_GROUPS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(E(f),"updateFilterGroups",function(){var e=a(r().mark((function e(n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.UPDATE_FILTER_GROUPS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(E(f),"removeFilterGroups",function(){var e=a(r().mark((function e(n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.REMOVE_FILTER_GROUPS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(E(f),"getFilterGroups",a(r().mark((function e(){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(b.GET_FILTER_GROUPS_FOR_VISUAL));case 2:if(n=e.sent,Array.isArray(null==n?void 0:n.message)){e.next=5;break}throw new Error("Failed to retrieve filter groups for the visual");case 5:return e.abrupt("return",n.message);case 6:case"end":return e.stop()}}),e)})))),l(E(f),"getActions",a(r().mark((function e(){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(b.GET_VISUAL_ACTIONS));case 2:if(n=e.sent,Array.isArray(null==n?void 0:n.message)){e.next=5;break}throw new Error("Failed to retrieve the actions");case 5:return e.abrupt("return",n.message);case 6:case"end":return e.stop()}}),e)})))),l(E(f),"addActions",function(){var e=a(r().mark((function e(n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.ADD_VISUAL_ACTIONS,{Actions:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(E(f),"setActions",function(){var e=a(r().mark((function e(n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.SET_VISUAL_ACTIONS,{Actions:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(E(f),"removeActions",function(){var e=a(r().mark((function e(n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.REMOVE_VISUAL_ACTIONS,{Actions:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(E(f),"setTheme",function(){var e=a(r().mark((function e(n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.SET_THEME,{ThemeArn:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(E(f),"setThemeOverride",function(){var e=a(r().mark((function e(n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.SET_THEME_OVERRIDE,{ThemeOverride:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(E(f),"setPreloadThemes",function(){var e=a(r().mark((function e(n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.PRELOAD_THEMES,{PreloadThemes:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(E(f),"extractExperienceFromUrl",(function(e){var n,t,r=/^https:\/\/[^/]+\/embed\/[^/]+\/dashboards\/([\w-]+)\/sheets\/([\w-]+)\/visuals\/([\w-]+)(\?|$)/i.exec(e)||[];if(r.length<5)throw null===(n=(t=f.frameOptions).onChange)||void 0===n||n.call(t,new Z(A.INVALID_URL,N.ERROR,"Invalid visual experience url",{url:e}),{frame:f.experienceFrame.iframe}),new Error("Invalid visual experience URL");return{experienceType:U.VISUAL,dashboardId:r[1],sheetId:r[2],visualId:r[3]}})),l(E(f),"interceptMessage",(function(e,n){var t,r,i,o,a;"SIZE_CHANGED"===e.eventName&&f.frameOptions.resizeHeightOnSizeChangedEvent&&(null==n||null===(i=n.frame)||void 0===i||null===(o=i.setAttribute)||void 0===o||o.call(i,"height","".concat(null===(a=e.message)||void 0===a?void 0:a.height,"px")));"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(t=f.contentOptions)&&void 0!==t&&null!==(t=t.themeOptions)&&void 0!==t&&t.themeOverride&&f.setThemeOverride(f.contentOptions.themeOptions.themeOverride),"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(r=f.contentOptions)&&void 0!==r&&null!==(r=r.themeOptions)&&void 0!==r&&r.preloadThemes&&f.setPreloadThemes(f.contentOptions.themeOptions.preloadThemes)})),l(E(f),"transformVisualContentOptions",(function(e){var n=e.fitToIframeWidth,r=e.locale,i=e.parameters,o=e.themeOptions;e.onMessage;var a=h(e,we),s=f.transformContentOptions({fitToIframeWidth:null==n||n,locale:r},a);return Array.isArray(i)&&(s.parameters=i.reduce((function(e,n){return t(t({},e),{},l({},n.Name,n.Values))}),{})),null!=o&&o.themeArn&&(s.themeArn=o.themeArn),s})),f.experience=f.extractExperienceFromUrl(e.url);var p=f.getInternalExperienceInfo(f.experience),d=p.experienceIdentifier,v=p.internalExperience;return f.internalExperience=v,f.experienceId=d,f.experienceFrame=new Oe(e,c,o,f.transformVisualContentOptions(o),v,d,f.interceptMessage),f}return u(i)}(ae),Ie=function(e){f(r,e);var n=v(r);function r(e,i,o,a,c,u,f){var p;return s(this,r),l(E(p=n.call(this,e,i,o,a,c,u,f)),"buildExperienceUrl",(function(e){var n=p.internalExperience,r=n.contextId,i=n.discriminator;return[e,p.buildQueryString(t(t({},p.transformedContentOptions),{},{contextId:r,discriminator:i}))].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return u(r)}(me),ye=["locale","onMessage"],xe=function(e){f(t,e);var n=v(t);function t(e,r,i,o){var a;s(this,t),l(E(a=n.call(this,e,r,i,o)),"extractExperienceFromUrl",(function(e){var n,t;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/(start(\/(favorites|dashboards|analyses))?|dashboards\/[\w-]+|analyses\/[\w-]+)(\?|$)/i.exec(e)||[]).length<5)throw null===(n=(t=a.frameOptions).onChange)||void 0===n||n.call(t,new Z(A.INVALID_URL,N.ERROR,"Invalid console experience url",{url:e}),{frame:a.experienceFrame.iframe}),new Error("Invalid console experience URL");return{experienceType:U.CONSOLE}})),a.experience=a.extractExperienceFromUrl(e.url);var c=a.getInternalExperienceInfo(a.experience),u=c.experienceIdentifier,f=c.internalExperience;a.internalExperience=f,a.experienceId=u;var p=r.locale;r.onMessage;var d=h(r,ye),v=a.transformContentOptions({locale:p},d);return a.experienceFrame=new Ie(e,i,r,v,f,u),a}return u(t)}(ae),Te=["parameters"],Se=function(e){f(r,e);var n=v(r);function r(e,i,o,a,c,u,f){var p;return s(this,r),l(E(p=n.call(this,e,i,o,a,c,u,f)),"buildExperienceUrl",(function(e){var n=p.transformedContentOptions,r=n.parameters,i=h(n,Te),o=p.internalExperience,a=o.contextId,s=o.discriminator;return[e,[p.buildQueryString(t(t({},i),{},{contextId:a,discriminator:s})),p.buildParameterString(r)].join("#")].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return u(r)}(me),Re=["parameters","locale","attributionOptions","sheetOptions","toolbarOptions","themeOptions","onMessage"],Ae=function(e){f(i,e);var n=v(i);function i(e,o,c,u){var f;s(this,i),l(E(f=n.call(this,e,o,c,u)),"initiatePrint",a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.INITIATE_PRINT)));case 1:case"end":return e.stop()}}),e)})))),l(E(f),"undo",a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.UNDO)));case 1:case"end":return e.stop()}}),e)})))),l(E(f),"redo",a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.REDO)));case 1:case"end":return e.stop()}}),e)})))),l(E(f),"toggleBookmarksPane",a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.TOGGLE_BOOKMARKS_PANE)));case 1:case"end":return e.stop()}}),e)})))),l(E(f),"getParameters",a(r().mark((function e(){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(b.GET_PARAMETERS));case 2:if(n=e.sent,Array.isArray(null==n?void 0:n.message)){e.next=5;break}throw new Error("Failed to retrieve the parameters");case 5:return e.abrupt("return",n.message);case 6:case"end":return e.stop()}}),e)})))),l(E(f),"getSheets",a(r().mark((function e(){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(b.GET_SHEETS));case 2:if(n=e.sent,Array.isArray(null==n?void 0:n.message)){e.next=5;break}throw new Error("Failed to retrieve the sheets");case 5:return e.abrupt("return",n.message);case 6:case"end":return e.stop()}}),e)})))),l(E(f),"addFilterGroups",function(){var e=a(r().mark((function e(n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.ADD_FILTER_GROUPS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(E(f),"updateFilterGroups",function(){var e=a(r().mark((function e(n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.UPDATE_FILTER_GROUPS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(E(f),"removeFilterGroups",function(){var e=a(r().mark((function e(n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.REMOVE_FILTER_GROUPS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(E(f),"getFilterGroupsForSheet",function(){var e=a(r().mark((function e(n){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(b.GET_FILTER_GROUPS_FOR_SHEET,{SheetId:n}));case 2:if(t=e.sent,Array.isArray(null==t?void 0:t.message)){e.next=5;break}throw new Error("Failed to retrieve filter groups for the sheet");case 5:return e.abrupt("return",t.message);case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(E(f),"getFilterGroupsForVisual",function(){var e=a(r().mark((function e(n,t){var i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(b.GET_FILTER_GROUPS_FOR_VISUAL,{SheetId:n,VisualId:t}));case 2:if(i=e.sent,Array.isArray(null==i?void 0:i.message)){e.next=5;break}throw new Error("Failed to retrieve filter groups for the visual");case 5:return e.abrupt("return",i.message);case 6:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}()),l(E(f),"getVisualActions",function(){var e=a(r().mark((function e(n,t){var i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(b.GET_VISUAL_ACTIONS,{SheetId:n,VisualId:t}));case 2:if(i=e.sent,Array.isArray(null==i?void 0:i.message)){e.next=5;break}throw new Error("Failed to retrieve the visual actions");case 5:return e.abrupt("return",i.message);case 6:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}()),l(E(f),"addVisualActions",function(){var e=a(r().mark((function e(n,t,i){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.ADD_VISUAL_ACTIONS,{SheetId:n,VisualId:t,Actions:i})));case 1:case"end":return e.stop()}}),e)})));return function(n,t,r){return e.apply(this,arguments)}}()),l(E(f),"setVisualActions",function(){var e=a(r().mark((function e(n,t,i){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.SET_VISUAL_ACTIONS,{SheetId:n,VisualId:t,Actions:i})));case 1:case"end":return e.stop()}}),e)})));return function(n,t,r){return e.apply(this,arguments)}}()),l(E(f),"getSelectedSheetId",a(r().mark((function e(){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(b.GET_SELECTED_SHEET_ID));case 2:if(null!=(n=e.sent)&&n.message){e.next=5;break}throw new Error("Failed to retrieve the selected sheet id");case 5:return e.abrupt("return",n.message);case 6:case"end":return e.stop()}}),e)})))),l(E(f),"setSelectedSheetId",function(){var e=a(r().mark((function e(n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.SET_SELECTED_SHEET_ID,{SheetId:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(E(f),"setTheme",function(){var e=a(r().mark((function e(n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.SET_THEME,{ThemeArn:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(E(f),"navigateToDashboard",function(){var e=a(r().mark((function e(n,t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.NAVIGATE_TO_DASHBOARD,{DashboardId:n,Parameters:null==t?void 0:t.parameters})));case 1:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}()),l(E(f),"removeVisualActions",function(){var e=a(r().mark((function e(n,t,i){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.REMOVE_VISUAL_ACTIONS,{SheetId:n,VisualId:t,Actions:i})));case 1:case"end":return e.stop()}}),e)})));return function(n,t,r){return e.apply(this,arguments)}}()),l(E(f),"getSheetVisuals",function(){var e=a(r().mark((function e(n){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.send(new q(b.GET_SHEET_VISUALS,{SheetId:n}));case 2:if(t=e.sent,Array.isArray(null==t?void 0:t.message)){e.next=5;break}throw new Error("Failed to retrieve the sheet visuals");case 5:return e.abrupt("return",t.message);case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(E(f),"setParameters",function(){var e=a(r().mark((function e(n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.SET_PARAMETERS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(E(f),"reset",a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.RESET)));case 1:case"end":return e.stop()}}),e)})))),l(E(f),"setThemeOverride",function(){var e=a(r().mark((function e(n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.SET_THEME_OVERRIDE,{ThemeOverride:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(E(f),"setPreloadThemes",function(){var e=a(r().mark((function e(n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.PRELOAD_THEMES,{PreloadThemes:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(E(f),"extractExperienceFromUrl",(function(e){var n,t,r=/^https:\/\/[^/]+\/embed\/[^/]+\/dashboards\/([\w-]+)(\?|$)/i.exec(e)||[];if(r.length<3)throw null===(n=(t=f.frameOptions).onChange)||void 0===n||n.call(t,new Z(A.INVALID_URL,N.ERROR,"Invalid dashboard experience url",{url:e}),{frame:null}),new Error("Invalid dashboard experience URL");return{experienceType:U.DASHBOARD,dashboardId:r[1]}})),l(E(f),"interceptMessage",(function(e,n){var t,r,i,o,a;"SIZE_CHANGED"===e.eventName&&f.frameOptions.resizeHeightOnSizeChangedEvent&&(null==n||null===(i=n.frame)||void 0===i||null===(o=i.setAttribute)||void 0===o||o.call(i,"height","".concat(null==e||null===(a=e.message)||void 0===a?void 0:a.height,"px")));"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(t=f.contentOptions)&&void 0!==t&&null!==(t=t.themeOptions)&&void 0!==t&&t.themeOverride&&f.setThemeOverride(f.contentOptions.themeOptions.themeOverride),"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(r=f.contentOptions)&&void 0!==r&&null!==(r=r.themeOptions)&&void 0!==r&&r.preloadThemes&&f.setPreloadThemes(f.contentOptions.themeOptions.preloadThemes)})),l(E(f),"transformDashboardContentOptions",(function(e){var n,r=e.parameters,i=e.locale,o=e.attributionOptions,a=e.sheetOptions,s=e.toolbarOptions,c=e.themeOptions;e.onMessage;var u=h(e,Re),p=f.transformContentOptions({locale:i},u);return Array.isArray(r)&&(p.parameters=r.reduce((function(e,n){return t(t({},e),{},l({},n.Name,n.Values))}),{})),!0!==(null==o?void 0:o.overlayContent)&&(p.footerPaddingEnabled=!0),(null!=s&&s.export||null!=s&&null!==(n=s.export)&&void 0!==n&&n.print)&&(p.printEnabled=!0),!0!==(null==s?void 0:s.undoRedo)&&(p.undoRedoDisabled=!0),!0!==(null==s?void 0:s.reset)&&(p.resetDisabled=!0),!0===(null==s?void 0:s.bookmarks)&&(p.showBookmarksIcon=!0),null!=a&&a.initialSheetId&&(p.sheetId=a.initialSheetId),"boolean"==typeof(null==a?void 0:a.singleSheet)&&(p.sheetTabsDisabled=a.singleSheet),null!=a&&a.emitSizeChangedEventOnSheetChange&&(p.resizeOnSheetChange=!0),null!=c&&c.themeArn&&(p.themeArn=c.themeArn),p})),f.experience=f.extractExperienceFromUrl(e.url);var p=f.getInternalExperienceInfo(f.experience),d=p.experienceIdentifier,v=p.internalExperience;return f.internalExperience=v,f.experienceId=d,f.experienceFrame=new Se(e,c,o,f.transformDashboardContentOptions(o),v,d,f.interceptMessage),f}return u(i)}(ae),be=function(e){f(r,e);var n=v(r);function r(e,i,o,a,c,u,f){var p;return s(this,r),l(E(p=n.call(this,e,i,o,a,c,u,f)),"buildExperienceUrl",(function(e){var n=p.internalExperience,r=n.contextId,i=n.discriminator;return[e,p.buildQueryString(t(t({},p.transformedContentOptions),{},{contextId:r,discriminator:i}))].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return u(r)}(me),Ne=["hideIcon","hideTopicName","theme","allowTopicSelection","onMessage"],Ce=function(e){f(t,e);var n=v(t);function t(e,o,c,u){var f;s(this,t),l(E(f=n.call(this,e,o,c,u)),"close",(function(){return f.send(new q(b.CLOSE_Q_SEARCH))})),l(E(f),"setQuestion",function(){var e=a(r().mark((function e(n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.send(new q(b.SET_Q_SEARCH_QUESTION,{question:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(E(f),"extractExperienceFromUrl",(function(e){var n,t;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/q\/search(\/|\?|$)/i.exec(e)||[]).length<2)throw null===(n=(t=f.frameOptions).onChange)||void 0===n||n.call(t,new Z(A.INVALID_URL,N.ERROR,"Invalid q-search experience URL",{url:e}),{frame:f.experienceFrame.iframe}),new Error("Invalid q-search experience URL");return{experienceType:U.QSEARCH}})),l(E(f),"interceptMessage",(function(e,n){switch(e.eventName){case b.Q_SEARCH_OPENED:case b.Q_SEARCH_CLOSED:var r,o;if("object"===i(e.message))null==n||null===(r=n.frame)||void 0===r||r.style.setProperty("height","".concat(null==e||null===(o=e.message)||void 0===o?void 0:o.height,"px"));break;case b.CONTENT_LOADED:var a=function(e){var n;(null===(n=f.experienceFrame.iframe)||void 0===n||!n.contains(e.target))&&f.close()};window.addEventListener("click",a),f.controlOptions.eventManager.addEventListenerForCleanup(f.experienceId,(function(){return window.removeEventListener("click",a)}));break;case b.Q_SEARCH_ENTERED_FULLSCREEN:var s,c;if(!f.frameStyles&&null!=n&&n.frame)f.frameStyles={position:null===(s=n.frame)||void 0===s?void 0:s.style.position,top:null===(c=n.frame)||void 0===c?void 0:c.style.top,left:n.frame.style.left,zIndex:n.frame.style.zIndex,width:n.frame.style.width,height:n.frame.style.height},n.frame.style.position="fixed",n.frame.style.top="0px",n.frame.style.left="0px",n.frame.style.zIndex=t.MAX_Z_INDEX,n.frame.style.width="100vw",n.frame.style.height="100vh";break;case b.Q_SEARCH_EXITED_FULLSCREEN:f.frameStyles&&null!=n&&n.frame&&(n.frame.style.position=f.frameStyles.position,n.frame.style.top=f.frameStyles.top,n.frame.style.left=f.frameStyles.left,n.frame.style.zIndex=f.frameStyles.zIndex,n.frame.style.width=f.frameStyles.width,n.frame.style.height=f.frameStyles.height)}})),l(E(f),"transformQSearchContentOptions",(function(e){var n=e.hideIcon,t=e.hideTopicName,r=e.theme,i=e.allowTopicSelection;e.onMessage;var o=h(e,Ne),a=f.transformContentOptions({allowTopicSelection:i},o);return void 0!==n&&(a.qBarIconDisabled=n),void 0!==t&&(a.qBarTopicNameDisabled=t),void 0!==r&&(a.themeId=r),a})),f.experience=f.extractExperienceFromUrl(e.url);var p=f.getInternalExperienceInfo(f.experience),d=p.experienceIdentifier,v=p.internalExperience;return f.internalExperience=v,f.experienceId=d,f.experienceFrame=new be(e,c,o,f.transformQSearchContentOptions(o),v,d,f.interceptMessage),f}return u(t)}(ae);l(Ce,"MAX_Z_INDEX","2147483647");var Le=function(e){f(r,e);var n=v(r);function r(e,i,o,a,c,u,f){var p;return s(this,r),l(E(p=n.call(this,e,i,o,a,c,u,f)),"buildExperienceUrl",(function(e){var n=p.internalExperience,r=n.contextId,i=n.discriminator;return[e,p.buildQueryString(t(t({},p.transformedContentOptions),{},{contextId:r,discriminator:i}))].join("?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return u(r)}(me),De=u((function e(n,r,i,o){var a=this;s(this,e),l(this,"experience",{experienceType:U.CONTROL}),l(this,"iframe",null),l(this,"send",(function(e){var n;return null===(n=a.internalSend)||void 0===n?void 0:n.call(a,e)})),l(this,"controlFrameMessageListener",(function(e){if(a.isMessageEvent(e.data)){var n=e.data;try{if(n.eventTarget){var t=ae.getExperienceIdentifier(n.eventTarget);a.eventManager.invokeEventListener(t,n)}a.sendAcknowledgment(n)}catch(e){var r,i;null===(r=a.onChange)||void 0===r||r.call(a,new Z(A.UNRECOGNIZED_EVENT_TARGET,N.WARN,"Message with unrecognized event target received",{eventTarget:n.eventTarget}),{frame:a.iframe}),null===(i=a.logger)||void 0===i||i.warn("Message with unrecognized event target received")}}})),l(this,"setLogger",(function(e){return a.logger=e,a})),l(this,"initializeFrame",(function(){var n=a.getControlExperienceBaseUrl(),t=a.getControlExperienceId();a.onMessage&&a.eventManager.addEventListener(t,a.onMessage,!0);var r=new Le({url:n,container:a.container,width:"0px",height:"0px",onChange:a.onChange},{eventManager:a.eventManager,contextId:a.internalExperience.contextId,timeout:e.FRAME_TIMEOUT,urlInfo:a.urlInfo},{onMessage:a.onMessage},{},a.internalExperience,t);a.internalSend=r.send,a.iframe=r.iframe,window.addEventListener("message",a.controlFrameMessageListener),a.eventManager.addEventListenerForCleanup(t,(function(){return window.removeEventListener("message",a.controlFrameMessageListener)}))})),l(this,"sendAcknowledgment",(function(e){var n,t,r=new K(b.ACKNOWLEDGE,a.internalExperience,{eventName:e.eventName,eventTarget:e.eventTarget});(null===(n=(t=window).requestIdleCallback)||void 0===n?void 0:n.call(t,(function(){return a.send(r)})))||a.send(r)})),l(this,"getControlExperienceId",(function(){return[a.internalExperience.contextId,a.internalExperience.experienceType,a.internalExperience.discriminator].filter(Boolean).join("-")})),l(this,"getControlExperienceBaseUrl",(function(){var e=a.urlInfo,n=e.host,t=e.sessionId,r="".concat(n,"/embed/").concat(t,"/embedControl");return new URL(r).href})),l(this,"isMessageEvent",(function(e){return!!e&&!!e.eventTarget&&!!e.eventName})),this.container=n,this.eventManager=r.eventManager,this.urlInfo=r.urlInfo,this.internalExperience=t(t({},this.experience),{},{contextId:r.contextId,discriminator:0}),this.onMessage=o,this.onChange=i,this.initializeFrame()}));l(De,"FRAME_TIMEOUT",6e4);var Me=u((function e(){var n=this;s(this,e),l(this,"addEventListener",(function(e,t,r){if(!e)throw new Error("Experience identifier is required when calling addEventListener");if("function"!=typeof t)throw new Error("Invalid type provided for event listener");var i=n.eventListeners.get(e);return r&&n.addEventListenerForCleanup(e,(function(){return n.removeEventListener(e,t)})),i?(i.push(t),n):(n.eventListeners.set(e,[t]),n)})),l(this,"invokeEventListener",(function(e,t){var r=n.eventListeners.get(e);if(!r)throw new Error("Unable to find experience specific event listeners: ".concat(e));return r.forEach((function(e){e(t)})),n})),l(this,"removeEventListener",(function(e,t){var r=n.eventListeners.get(e);if(!r)throw new Error("Unable to find experience specific event listeners: ".concat(e));var i=r.filter((function(e){return e!==t}));return n.eventListeners.set(e,i),n})),l(this,"addEventListenerForCleanup",(function(e,t){var r,i=null!==(r=n.cleanUpCallbacks.get(e))&&void 0!==r?r:[];i.push(t),n.cleanUpCallbacks.set(e,i)})),l(this,"cleanUpCallbacksForExperience",(function(e){var t=n.cleanUpCallbacks.get(e);t&&(t.forEach((function(e){return e()})),n.cleanUpCallbacks.delete(e),n.eventListeners.set(e,[]))})),this.eventListeners=new Map,this.cleanUpCallbacks=new Map})),Pe=u((function e(){s(this,e),l(this,"log",console.log),l(this,"warn",console.warn),l(this,"error",console.error),l(this,"debug",console.debug),l(this,"info",console.info)})),Ue=u((function e(n){var t=this;s(this,e),l(this,"embedVisual",function(){var e=a(r().mark((function e(n){var i,o,a=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.length>1&&void 0!==a[1]?a[1]:{},t.validateFrameOptions(n,"embedVisual"),o=t.buildControlOptions(n),e.abrupt("return",new _e(n,i,o,t.experienceIdentifiers).setLogProvider(t.logger));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(this,"embedDashboard",function(){var e=a(r().mark((function e(n){var i,o,a=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.length>1&&void 0!==a[1]?a[1]:{},t.validateFrameOptions(n,"embedDashboard"),o=t.buildControlOptions(n),e.abrupt("return",new Ae(n,i,o,t.experienceIdentifiers).setLogProvider(t.logger));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(this,"embedConsole",function(){var e=a(r().mark((function e(n){var i,o,a=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.length>1&&void 0!==a[1]?a[1]:{},t.validateFrameOptions(n,"embedConsole"),o=t.buildControlOptions(n),e.abrupt("return",new xe(n,i,o,t.experienceIdentifiers).setLogProvider(t.logger));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(this,"embedQSearchBar",function(){var e=a(r().mark((function e(n){var i,o,a=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.length>1&&void 0!==a[1]?a[1]:{},t.validateFrameOptions(n,"embedQSearchBar"),o=t.buildControlOptions(n),e.abrupt("return",new Ce(n,i,o,t.experienceIdentifiers).setLogProvider(t.logger));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),l(this,"validateFrameOptions",(function(e,n){if(!e){var r="".concat(n," is called without frameOptions");throw t.onChange(new Z(A.NO_FRAME_OPTIONS,N.ERROR,"".concat(n," is called without frameOptions"),{methodName:n}),{frame:null}),new Error(r)}if("object"!==i(e)||Array.isArray(e)){var o="".concat(n," is called with non-object frameOptions");throw t.onChange(new Z(A.INVALID_FRAME_OPTIONS,N.ERROR,o,{methodName:n,frameOptionsType:Array.isArray(e)?"array":i(e)}),{frame:null}),new Error(o)}var a=["url","container","width","height","resizeHeightOnSizeChangedEvent","withIframePlaceholder","onChange","className"],s=Object.keys(e).filter((function(e){return!a.includes(e)}));if(s.length>0){var c,u,l="".concat(n," is called with unrecognized properties");null===(c=e.onChange)||void 0===c||c.call(e,new Z(A.UNRECOGNIZED_FRAME_OPTIONS,N.WARN,l,{unrecognizedFrameOptions:s}),{frame:null}),null===(u=t.logger)||void 0===u||u.warn(l)}})),l(this,"buildControlOptions",(function(e){if(!t.controlOptions){if(!e.url)throw new Error("URL is missing in frame options, but is a required field");var n=t.getControlUrlInfo(e.url),r=new De(t.getBodyElement(),{eventManager:t.eventManager,urlInfo:n,contextId:t.contextId},t.onChange).setLogger(t.logger);t.controlOptions={eventManager:t.eventManager,sendToControlFrame:r.send,contextId:t.contextId,timeout:De.FRAME_TIMEOUT,urlInfo:n}}return t.controlOptions})),l(this,"onChange",(function(e,n){t.contextOnChange&&t.contextOnChange(e,n)})),l(this,"getControlUrlInfo",(function(e){var n=/^(https:\/\/[^/]+)\/(embedding|embed)\/([^/]+)\/[^?]+\?(.*)/i.exec(e)||[];if((null==n?void 0:n.length)<4)throw new Error('Invalid embedding url: "'.concat(e,'"'));return{sessionId:n[3],host:n[1],urlSearchParams:new URLSearchParams(n[4])}})),l(this,"getBodyElement",(function(){var e,n=null===(e=document.getElementsByTagName("body"))||void 0===e?void 0:e[0];if(!n){var r="could not locate <body> element in the page";throw t.onChange(new Z(A.NO_BODY,N.ERROR,r),{frame:null}),new Error(r)}return n})),this.contextId=oe(),this.experienceIdentifiers=new Set,this.eventManager=new Me,this.contextOnChange=n.onChange,this.logger=new Pe})),Fe=function(){var e=a(r().mark((function e(){var n,t=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.length>0&&void 0!==t[0]?t[0]:{},e.abrupt("return",new Ue(n));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ke=t(t(t(t(t(t(t(t(t(t(t(t({},P),R),C),L),D),M),F),k),j),Q),H),B);e.BaseExperience=ae,e.BaseExperienceFrame=me,e.CALCULATED_METRIC_COLUMN_TYPE=V,e.ChangeEvent=Z,e.ChangeEventLevel=N,e.ChangeEventName=A,e.ConsoleExperience=xe,e.ConsoleExperienceFrame=Ie,e.ControlExperience=De,e.ControlExperienceFrame=Le,e.DashboardExperience=Ae,e.DashboardExperienceFrame=Se,e.DataResponse=J,e.DefaultLogger=Pe,e.EmbeddingContext=Ue,e.EmbeddingEvent=z,e.EmbeddingMessageEvent=q,e.ErrorChangeEventName=I,e.ErrorResponse=$,e.EventManager=Me,e.ExperienceType=U,e.GetterMessageEventName=T,e.Iframe=Ee,e.InfoChangeEventName=_,e.InfoMessageEventName=w,e.InvokerMessageEventName=S,e.MessageEventName=b,e.PostMessageEvent=W,e.QSE=ke,e.QSearchExperience=Ce,e.QSearchExperienceFrame=be,e.ResponseMessage=X,e.SDK_VERSION=ve,e.SPECIAL_DATAPOINT_VALUE_TYPES=G,e.SetterMessageEventName=x,e.SuccessResponse=Y,e.TargetedMessageEvent=K,e.VisualExperience=_e,e.VisualExperienceFrame=Oe,e.WarnChangeEventName=y,e.createEmbeddingContext=Fe})); | ||
//# sourceMappingURL=quicksight-embedding-js-sdk.min.js.map |
@@ -8,5 +8,5 @@ // This file is read by tools that parse documentation comments conforming to the TSDoc standard. | ||
"packageName": "@microsoft/api-extractor", | ||
"packageVersion": "7.38.3" | ||
"packageVersion": "7.37.0" | ||
} | ||
] | ||
} |
{ | ||
"name": "amazon-quicksight-embedding-sdk", | ||
"version": "2.5.0", | ||
"version": "2.6.0", | ||
"description": "JS SDK for embedding Amazon QuickSight", | ||
@@ -58,3 +58,3 @@ "keywords": [ | ||
"@rollup/plugin-typescript": "^11.1.3", | ||
"@testing-library/jest-dom": "^5.16.5", | ||
"@testing-library/jest-dom": "^6.2.0", | ||
"@types/jest": "^29.5.5", | ||
@@ -61,0 +61,0 @@ "@types/node": "^18.11.15", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
904164
0
100
1737
1761
11