UNPKG

@smuthyam/amazon-quicksight-embedding-sdk

Version:
9 lines 60.6 kB
/*! * @smuthyam/amazon-quicksight-embedding-sdk v2.6.2 * git@github.com:awslabs/amazon-quicksight-embedding-sdk.git * https://github.com/awslabs/amazon-quicksight-embedding-sdk * * Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ !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,r){return n=E(n),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 g(e)}(e,t()?Reflect.construct(n,r||[],E(e).constructor):n.apply(e,r))}function t(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(t=function(){return!!e})()}function r(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 i(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?r(Object(t),!0).forEach((function(n){d(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):r(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function o(){o=function(){return n};var e,n={},t=Object.prototype,r=t.hasOwnProperty,i=Object.defineProperty||function(e,n,t){e[n]=t.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,n,t){return Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[n]}try{l({},"")}catch(e){l=function(e,n,t){return e[n]=t}}function f(e,n,t,r){var o=n&&n.prototype instanceof g?n:g,a=Object.create(o.prototype),s=new C(r||[]);return i(a,"_invoke",{value:A(e,t,s)}),a}function p(e,n,t){try{return{type:"normal",arg:e.call(n,t)}}catch(e){return{type:"throw",arg:e}}}n.wrap=f;var d="suspendedStart",h="suspendedYield",E="executing",m="completed",v={};function g(){}function O(){}function w(){}var _={};l(_,s,(function(){return this}));var I=Object.getPrototypeOf,x=I&&I(I(L([])));x&&x!==t&&r.call(x,s)&&(_=x);var y=w.prototype=g.prototype=Object.create(_);function T(e){["next","throw","return"].forEach((function(n){l(e,n,(function(e){return this._invoke(n,e)}))}))}function S(e,n){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&&r.call(l,"__await")?n.resolve(l.__await).then((function(e){t("next",e,a,s)}),(function(e){t("throw",e,a,s)})):n.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,r){function i(){return new n((function(n,i){t(e,r,n,i)}))}return o=o?o.then(i,i):i()}})}function A(n,t,r){var i=d;return function(o,a){if(i===E)throw new Error("Generator is already running");if(i===m){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=b(s,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=E;var u=p(n,t,r);if("normal"===u.type){if(i=r.done?m:h,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=m,r.method="throw",r.arg=u.arg)}}}function b(n,t){var r=t.method,i=n.iterator[r];if(i===e)return t.delegate=null,"throw"===r&&n.iterator.return&&(t.method="return",t.arg=e,b(n,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var o=p(i,n.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,v;var a=o.arg;return a?a.done?(t[n.resultName]=a.value,t.next=n.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,v):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,v)}function R(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 N(e){var n=e.completion||{};n.type="normal",delete n.arg,e.completion=n}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function L(n){if(n||""===n){var t=n[s];if(t)return t.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,o=function t(){for(;++i<n.length;)if(r.call(n,i))return t.value=n[i],t.done=!1,t;return t.value=e,t.done=!0,t};return o.next=o}}throw new TypeError(typeof n+" is not iterable")}return O.prototype=w,i(y,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:O,configurable:!0}),O.displayName=l(w,u,"GeneratorFunction"),n.isGeneratorFunction=function(e){var n="function"==typeof e&&e.constructor;return!!n&&(n===O||"GeneratorFunction"===(n.displayName||n.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,l(e,u,"GeneratorFunction")),e.prototype=Object.create(y),e},n.awrap=function(e){return{__await:e}},T(S.prototype),l(S.prototype,c,(function(){return this})),n.AsyncIterator=S,n.async=function(e,t,r,i,o){void 0===o&&(o=Promise);var a=new S(f(e,t,r,i),o);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},T(y),l(y,u,"Generator"),l(y,s,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),n.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}},n.values=L,C.prototype={constructor:C,reset:function(n){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),!n)for(var t in this)"t"===t.charAt(0)&&r.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(n){if(this.done)throw n;var t=this;function i(r,i){return s.type="throw",s.arg=n,t.next=r,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 i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,n){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc<=this.prev&&r.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,v):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),v},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),N(t),v}},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;N(t)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(n,t,r){return this.delegate={iterator:L(n),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=e),v}},n}function a(e){var n=function(e,n){if("object"!=typeof e||!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)}function s(e){return s="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},s(e)}function c(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 u(e){return function(){var n=this,t=arguments;return new Promise((function(r,i){var o=e.apply(n,t);function a(e){c(o,r,i,a,s,"next",e)}function s(e){c(o,r,i,a,s,"throw",e)}a(void 0)}))}}function l(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function f(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,a(r.key),r)}}function p(e,n,t){return n&&f(e.prototype,n),t&&f(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e,n,t){return(n=a(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function h(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&&m(e,n)}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function m(e,n){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,n){return e.__proto__=n,e},m(e,n)}function v(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 g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function O(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 w(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 w(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 w(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}var _={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"},I={FRAME_STARTED:"FRAME_STARTED",FRAME_MOUNTED:"FRAME_MOUNTED",FRAME_LOADED:"FRAME_LOADED",FRAME_REMOVED:"FRAME_REMOVED"},x={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"},T={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"},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"},A={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"},b=Object.freeze({__proto__:null,ErrorChangeEventName:x,GetterMessageEventName:S,InfoChangeEventName:I,InfoMessageEventName:_,InvokerMessageEventName:A,SetterMessageEventName:T,WarnChangeEventName:y}),R=i(i(i({},I),x),y),N=i(i(i(i({},_),T),S),A),C={ERROR:"ERROR",INFO:"INFO",WARN:"WARN"},L=Object.freeze({__proto__:null,ChangeEventLevel:C,ChangeEventName:R,MessageEventName:N}),D=Object.freeze({__proto__:null}),M=Object.freeze({__proto__:null}),P=Object.freeze({__proto__:null}),U=Object.freeze({__proto__:null}),F={CONSOLE:"CONSOLE",CONTEXT:"CONTEXT",CONTROL:"CONTROL",VISUAL:"VISUAL",DASHBOARD:"DASHBOARD",QSEARCH:"QSEARCH"},k=Object.freeze({__proto__:null,ExperienceType:F}),G=Object.freeze({__proto__:null}),j={NULL:null,OTHER_BUCKET:null},V={INTEGER:null,STRING:null,DECIMAL:null,DATETIME:null},H=Object.freeze({__proto__:null,CALCULATED_METRIC_COLUMN_TYPE:V,SPECIAL_DATAPOINT_VALUE_TYPES:j}),Q=Object.freeze({__proto__:null}),B=Object.freeze({__proto__:null}),z=Object.freeze({__proto__:null}),Z=p((function e(n,t,r){l(this,e),this.eventName=n,this.message=t,this.data=r})),q=function(e){function t(e,r,i,o){var a;return l(this,t),(a=n(this,t,[e,i,o])).eventLevel=r,a}return h(t,e),p(t)}(Z),K=function(e){function t(e,r,i){var o;return l(this,t),(o=n(this,t,[e,r,i])).eventName=e,o}return h(t,e),p(t)}(Z),W=function(e){function t(e,r,i,o){var a;return l(this,t),(a=n(this,t,[e,i,o])).eventTarget=r,a}return h(t,e),p(t)}(K),X=function(e){function t(e,r,i,o,a,s,c){var u;return l(this,t),(u=n(this,t,[e,r,s,c])).timestamp=o,u.version=a,u.eventId=i,u}return h(t,e),p(t)}(W),Y=p((function e(){l(this,e)})),$=p((function e(){l(this,e),d(this,"success",!0)})),J=p((function e(n){l(this,e),d(this,"success",!1),this.errorCode=n.errorCode,this.error=n.error,this.message=n.message})),ee=p((function e(n){l(this,e),d(this,"success",!0),this.message=n}));let ne;const te=new Uint8Array(16);function re(){if(!ne&&(ne="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ne))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ne(te)}const ie=[];for(let e=0;e<256;++e)ie.push((e+256).toString(16).slice(1));var oe={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ae(e,n,t){if(oe.randomUUID&&!n&&!e)return oe.randomUUID();const r=(e=e||{}).random||(e.rng||re)();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 ie[e[n+0]]+ie[e[n+1]]+ie[e[n+2]]+ie[e[n+3]]+"-"+ie[e[n+4]]+ie[e[n+5]]+"-"+ie[e[n+6]]+ie[e[n+7]]+"-"+ie[e[n+8]]+ie[e[n+9]]+"-"+ie[e[n+10]]+ie[e[n+11]]+ie[e[n+12]]+ie[e[n+13]]+ie[e[n+14]]+ie[e[n+15]]}(r)}var se=p((function e(n,t,r,a){var s=this;l(this,e),d(this,"send",function(){var e=u(o().mark((function e(n){var t;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s.experienceFrame&&s.internalExperience){e.next=2;break}throw new Error("Experience has not been initialized");case 2:return t=new W(n.eventName,s.internalExperience,n.message,n.data),e.abrupt("return",s.experienceFrame.send(t));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),d(this,"addEventListener",(function(e,n){return s.experienceFrame.addInternalEventListener(e,n)})),d(this,"setLogProvider",(function(e){return s.logger=e,s})),d(this,"getInternalExperienceInfo",(function(n){var t,r,o=-1;do{o++,t=i(i({},n),{},{contextId:s.controlOptions.contextId,discriminator:o}),r=e.getExperienceIdentifier(t)}while(s.experienceIdentifiers.has(r));return s.experienceIdentifiers.add(r),{experienceIdentifier:r,internalExperience:t}})),d(this,"transformContentOptions",(function(e,n){var t,r,i,o=Object.keys(n);Object.keys(n).length>0&&(null===(t=(r=s.frameOptions).onChange)||void 0===t||t.call(r,new q(R.UNRECOGNIZED_CONTENT_OPTIONS,C.WARN,"Experience content options contain unrecognized properties",{unrecognizedContentOptions:o}),{frame:null}),null===(i=s.logger)||void 0===i||i.warn("Experience content options contain unrecognized properties"));return e})),d(this,"validateFrameOptions",(function(){if(!s.frameOptions.url){var e,n,t="Url is required for the experience";throw null===(e=(n=s.frameOptions).onChange)||void 0===e||e.call(n,new q(R.NO_URL,C.ERROR,t),{frame:null}),new Error(t)}})),this.frameOptions=n,this.contentOptions=t,this.controlOptions=r,this.experienceIdentifiers=a,this.validateFrameOptions()}));d(se,"getExperienceIdentifier",(function(e){if(e.experienceType===F.DASHBOARD)return[e.contextId,e.experienceType,e.dashboardId,e.discriminator].filter(Boolean).join("-");if(e.experienceType===F.VISUAL)return[e.contextId,e.experienceType,e.dashboardId,e.sheetId,e.visualId,e.discriminator].filter(Boolean).join("-");if([F.CONSOLE,F.CONTROL,F.CONTEXT,F.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 ce=2147483647,ue={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},le=Math.floor,fe=String.fromCharCode;function pe(e){throw new RangeError(ue[e])}const de=function(e,n){return e+22+75*(e<26)-((0!=n)<<5)},he=function(e,n,t){let r=0;for(e=t?le(e/700):e>>1,e+=le(e/n);e>455;r+=36)e=le(e/35);return le(r+36*e/(e+38))},Ee=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(fe(t));const a=n.length;let s=a;for(a&&n.push("-");s<t;){let t=ce;for(const n of e)n>=r&&n<t&&(t=n);const c=s+1;t-r>le((ce-i)/c)&&pe("overflow"),i+=(t-r)*c,r=t;for(const t of e)if(t<r&&++i>ce&&pe("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(fe(de(r+i%a,0))),e=le(i/a)}n.push(fe(de(e,0))),o=he(i,c,s===a),i=0,++s}++i,++r}return n.join("")};var me=p((function e(n){var t=this;l(this,e),d(this,"classNames",[e.IFRAME_CLASS_NAME]),d(this,"getIframe",(function(){return t.iframe})),d(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)})),d(this,"createIframe",(function(e){var n=document.createElement("iframe");return n.className=t.classNames.join(" ").trim(),n.id=t.iframeName,n.name=t.iframeName,n.width=t.width,n.height=t.height,t.loading&&(n.loading=t.loading),n.style.border="0px",n.style.padding="0px",t.iframePlaceholder&&(n.style.opacity="0",n.style.position="absolute"),"0px"===t.width&&"0px"===t.height&&(n.style.position="absolute"),null!=e&&e.length&&n.sandbox.add(e.join(", ")),t.container.appendChild(n),t.payload?t.postRequest=t.createPostRequest({src:t.src,target:n.name,container:t.container,payload:t.payload}):n.src=t.src,n})),d(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()})),d(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()}}})),d(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=O(e,2),t=n[0],r=n[1];return i.setAttribute(t,r)})),Object.entries(t).forEach((function(e){var n=O(e,2),t=n[0],r=n[1];return i.style.setProperty(t,r)})),r.forEach((function(e){return i.appendChild(e)})),i})),d(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,s=n.height,c=void 0===s?"100%":s,u=n.container,f=n.onLoad,p=n.loading,h=n.withIframePlaceholder,E=n.payload,m=n.className,v=n.sandboxAttributes;this.width=a,this.height=c,this.onLoad=f,this.iframeName=r,this.loading=p,m&&this.classNames.push(m),this.container=u,this.payload=E,this.src=i,h&&this.createIframePlaceholder(h),this.iframe=this.createIframe(v),this.iframe.addEventListener("load",this.onLoadLocal)}));d(me,"IFRAME_CLASS_NAME","quicksight-embedding-iframe");var ve="2.6.0",ge=p((function e(n,t,r,a,c,f,p){var h=this;l(this,e),d(this,"MESSAGE_RESPONSE_TIMEOUT",5e3),d(this,"iframe",null),d(this,"send",function(){var e=u(o().mark((function e(n){var t,r,i;return o().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(r=ae(),i=new X(n.eventName,n.eventTarget,r,Date.now(),ve,n.message,n.data),null===(t=h.iframe)||void 0===t||null===(t=t.contentWindow)||void 0===t||t.postMessage(i,h.url),n.eventName!==N.ACKNOWLEDGE){e.next=7;break}return e.abrupt("return",Promise.resolve(new $));case 7:return e.abrupt("return",new Promise((function(e,t){var i=function n(t){var i,o,a=t.data;(null==a?void 0:a.eventId)===r&&(window.removeEventListener("message",n),!0===(null===(i=a.message)||void 0===i?void 0:i.success)?e(new $):!1===(null===(o=a.message)||void 0===o?void 0:o.success)?e(new J(a.message)):e(new ee(a.message)))};window.addEventListener("message",i),setTimeout((function(){window.removeEventListener("message",i),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)}}()),d(this,"buildParameterString",(function(e){return e&&"object"===s(e)?Object.entries(e).map((function(e){var n=O(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("&"):""})),d(this,"buildQueryString",(function(e){var n=Object.entries(e).reduce((function(e,n){var t=O(n,2),r=t[0],o=t[1];return null!=o?i(i({},e),{},d({},r,"".concat(o))):e}),{punyCodeEmbedOrigin:Ee("".concat(window.location.origin,"/")),sdkVersion:ve});return new URLSearchParams(n).toString()})),d(this,"createExperienceIframe",(function(){h.onChange(new q(R.FRAME_STARTED,C.INFO,"Creating the frame",{experience:h.internalExperience}));try{h.setTimeoutInstance(),h.iframe=new me({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(R.FRAME_NOT_CREATED,C.ERROR,"Failed to create the frame",{experience:h.internalExperience})),e}h.onChange(new q(R.FRAME_MOUNTED,C.INFO,"The frame mounted",{experience:h.internalExperience,frame:h.iframe}))})),d(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)}}})),d(this,"validateBaseUrl",(function(e){if(!e)throw h.onChange(new q(R.NO_URL,C.ERROR,"Url is required for the experience",{experience:h.internalExperience})),new Error("Url is required for the experience");return e})),d(this,"setTimeoutInstance",(function(){h.timeoutInstance=setTimeout((function(){throw h.onChange(new q(R.FRAME_NOT_CREATED,C.ERROR,"Creating the frame timed out",{experience:h.internalExperience})),new Error("Creating the frame timed out")}),h.controlOptions.timeout)})),d(this,"onLoadHandler",u(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h.timeoutInstance&&clearTimeout(h.timeoutInstance),h.onChange(new q(R.FRAME_LOADED,C.INFO,"The experience iframe loaded",{experience:h.internalExperience}));case 2:case"end":return e.stop()}}),e)})))),d(this,"getContainer",(function(e){if(!e){var n="Container is required for the experience";throw h.onChange(new q(R.NO_CONTAINER,C.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 q(R.INVALID_CONTAINER,C.ERROR,e.message,{experience:h.internalExperience})),e}else"object"===s(e)&&e.nodeName&&(t=e);if(!t){var r="Invalid container '".concat(e,"' for the experience");throw h.onChange(new q(R.INVALID_CONTAINER,C.ERROR,r,{experience:h.internalExperience})),new Error(r)}return t})),d(this,"decorateOnChange",(function(e){return function(n){if(e){var t={frame:h.iframe};e(n,t)}}})),d(this,"decorateOnMessage",(function(e,n){return function(t){n&&h.iframe&&n(t,{frame:h.iframe}),e&&e(t,{frame:h.iframe})}})),d(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 q(R.FRAME_REMOVED,C.INFO,"Frame removed from the DOM",{experience:h.internalExperience})))}));e.observe(document.body,{childList:!0,subtree:!0})})),this.frameOptions=n,this.contentOptions=r,this.onChange=this.decorateOnChange(n.onChange),this.onMessage=this.decorateOnMessage(r.onMessage,p),this.container=this.getContainer(n.container),this.internalExperience=c,this.controlOptions=t,this.transformedContentOptions=a,this.experienceId=f,this.url=this.validateBaseUrl(n.url),this.controlOptions.eventManager.addEventListener(this.experienceId,this.onMessage,!0),this.initializeMutationObserver()})),Oe=["parameters"],we=function(e){function t(e,r,o,a,s,c,u){var f;return l(this,t),d(g(f=n(this,t,[e,r,o,a,s,c,u])),"buildExperienceUrl",(function(e){var n=f.transformedContentOptions,t=n.parameters,r=v(n,Oe),o=f.internalExperience,a=o.contextId,s=o.discriminator;return[e,[f.buildQueryString(i(i({},r),{},{contextId:a,discriminator:s})),f.buildParameterString(t)].join("#")].join(e.includes("?")?"&":"?")})),f.url=f.buildExperienceUrl(e.url),f.createExperienceIframe(),f}return h(t,e),p(t)}(ge),_e=["fitToIframeWidth","locale","parameters","themeOptions","onMessage"],Ie=function(e){function t(e,r,a,s){var c;l(this,t),d(g(c=n(this,t,[e,r,a,s])),"setParameters",function(){var e=u(o().mark((function e(n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.SET_PARAMETERS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),d(g(c),"reset",u(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.RESET)));case 1:case"end":return e.stop()}}),e)})))),d(g(c),"addFilterGroups",function(){var e=u(o().mark((function e(n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.ADD_FILTER_GROUPS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),d(g(c),"updateFilterGroups",function(){var e=u(o().mark((function e(n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.UPDATE_FILTER_GROUPS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),d(g(c),"removeFilterGroups",function(){var e=u(o().mark((function e(n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.REMOVE_FILTER_GROUPS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),d(g(c),"getFilterGroups",u(o().mark((function e(){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.send(new K(N.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)})))),d(g(c),"getActions",u(o().mark((function e(){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.send(new K(N.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)})))),d(g(c),"addActions",function(){var e=u(o().mark((function e(n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.ADD_VISUAL_ACTIONS,{Actions:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),d(g(c),"setActions",function(){var e=u(o().mark((function e(n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.SET_VISUAL_ACTIONS,{Actions:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),d(g(c),"removeActions",function(){var e=u(o().mark((function e(n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.REMOVE_VISUAL_ACTIONS,{Actions:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),d(g(c),"setTheme",function(){var e=u(o().mark((function e(n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.SET_THEME,{ThemeArn:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),d(g(c),"setThemeOverride",function(){var e=u(o().mark((function e(n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.SET_THEME_OVERRIDE,{ThemeOverride:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),d(g(c),"setPreloadThemes",function(){var e=u(o().mark((function e(n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.PRELOAD_THEMES,{PreloadThemes:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),d(g(c),"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=c.frameOptions).onChange)||void 0===n||n.call(t,new q(R.INVALID_URL,C.ERROR,"Invalid visual experience url",{url:e}),{frame:c.experienceFrame.iframe}),new Error("Invalid visual experience URL");return{experienceType:F.VISUAL,dashboardId:r[1],sheetId:r[2],visualId:r[3]}})),d(g(c),"interceptMessage",(function(e,n){var t,r,i,o,a;"SIZE_CHANGED"===e.eventName&&c.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=c.contentOptions)&&void 0!==t&&null!==(t=t.themeOptions)&&void 0!==t&&t.themeOverride&&c.setThemeOverride(c.contentOptions.themeOptions.themeOverride),"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(r=c.contentOptions)&&void 0!==r&&null!==(r=r.themeOptions)&&void 0!==r&&r.preloadThemes&&c.setPreloadThemes(c.contentOptions.themeOptions.preloadThemes)})),d(g(c),"transformVisualContentOptions",(function(e){var n=e.fitToIframeWidth,t=e.locale,r=e.parameters,o=e.themeOptions;e.onMessage;var a=v(e,_e),s=c.transformContentOptions({fitToIframeWidth:null==n||n,locale:t},a);return Array.isArray(r)&&(s.parameters=r.reduce((function(e,n){return i(i({},e),{},d({},n.Name,n.Values))}),{})),null!=o&&o.themeArn&&(s.themeArn=o.themeArn),s})),c.experience=c.extractExperienceFromUrl(e.url);var f=c.getInternalExperienceInfo(c.experience),p=f.experienceIdentifier,h=f.internalExperience;return c.internalExperience=h,c.experienceId=p,c.experienceFrame=new we(e,a,r,c.transformVisualContentOptions(r),h,p,c.interceptMessage),c}return h(t,e),p(t)}(se),xe=function(e){function t(e,r,o,a,s,c,u){var f;return l(this,t),d(g(f=n(this,t,[e,r,o,a,s,c,u])),"buildExperienceUrl",(function(e){var n=f.internalExperience,t=n.contextId,r=n.discriminator;return[e,f.buildQueryString(i(i({},f.transformedContentOptions),{},{contextId:t,discriminator:r}))].join(e.includes("?")?"&":"?")})),f.url=f.buildExperienceUrl(e.url),f.createExperienceIframe(),f}return h(t,e),p(t)}(ge),ye=["locale","onMessage"],Te=function(e){function t(e,r,i,o){var a;l(this,t),d(g(a=n(this,t,[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 q(R.INVALID_URL,C.ERROR,"Invalid console experience url",{url:e}),{frame:a.experienceFrame.iframe}),new Error("Invalid console experience URL");return{experienceType:F.CONSOLE}})),a.experience=a.extractExperienceFromUrl(e.url);var s=a.getInternalExperienceInfo(a.experience),c=s.experienceIdentifier,u=s.internalExperience;a.internalExperience=u,a.experienceId=c;var f=r.locale;r.onMessage;var p=v(r,ye),h=a.transformContentOptions({locale:f},p);return a.experienceFrame=new xe(e,i,r,h,u,c),a}return h(t,e),p(t)}(se),Se=["parameters"],Ae=function(e){function t(e,r,o,a,s,c,u){var f;return l(this,t),d(g(f=n(this,t,[e,r,o,a,s,c,u])),"buildExperienceUrl",(function(e){var n=f.transformedContentOptions,t=n.parameters,r=v(n,Se),o=f.internalExperience,a=o.contextId,s=o.discriminator;return[e,[f.buildQueryString(i(i({},r),{},{contextId:a,discriminator:s})),f.buildParameterString(t)].join("#")].join(e.includes("?")?"&":"?")})),f.url=f.buildExperienceUrl(e.url),f.createExperienceIframe(),f}return h(t,e),p(t)}(ge),be=["parameters","locale","attributionOptions","sheetOptions","toolbarOptions","themeOptions","onMessage"],Re=function(e){function t(e,r,a,s){var c;l(this,t),d(g(c=n(this,t,[e,r,a,s])),"initiatePrint",u(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.INITIATE_PRINT)));case 1:case"end":return e.stop()}}),e)})))),d(g(c),"undo",u(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.UNDO)));case 1:case"end":return e.stop()}}),e)})))),d(g(c),"redo",u(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.REDO)));case 1:case"end":return e.stop()}}),e)})))),d(g(c),"toggleBookmarksPane",u(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.TOGGLE_BOOKMARKS_PANE)));case 1:case"end":return e.stop()}}),e)})))),d(g(c),"getParameters",u(o().mark((function e(){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.send(new K(N.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)})))),d(g(c),"getSheets",u(o().mark((function e(){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.send(new K(N.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)})))),d(g(c),"addFilterGroups",function(){var e=u(o().mark((function e(n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.ADD_FILTER_GROUPS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),d(g(c),"updateFilterGroups",function(){var e=u(o().mark((function e(n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.UPDATE_FILTER_GROUPS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),d(g(c),"removeFilterGroups",function(){var e=u(o().mark((function e(n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.REMOVE_FILTER_GROUPS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),d(g(c),"getFilterGroupsForSheet",function(){var e=u(o().mark((function e(n){var t;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.send(new K(N.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)}}()),d(g(c),"getFilterGroupsForVisual",function(){var e=u(o().mark((function e(n,t){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.send(new K(N.GET_FILTER_GROUPS_FOR_VISUAL,{SheetId:n,VisualId:t}));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)})));return function(n,t){return e.apply(this,arguments)}}()),d(g(c),"getVisualActions",function(){var e=u(o().mark((function e(n,t){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.send(new K(N.GET_VISUAL_ACTIONS,{SheetId:n,VisualId:t}));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 visual actions");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}()),d(g(c),"addVisualActions",function(){var e=u(o().mark((function e(n,t,r){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.ADD_VISUAL_ACTIONS,{SheetId:n,VisualId:t,Actions:r})));case 1:case"end":return e.stop()}}),e)})));return function(n,t,r){return e.apply(this,arguments)}}()),d(g(c),"setVisualActions",function(){var e=u(o().mark((function e(n,t,r){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.SET_VISUAL_ACTIONS,{SheetId:n,VisualId:t,Actions:r})));case 1:case"end":return e.stop()}}),e)})));return function(n,t,r){return e.apply(this,arguments)}}()),d(g(c),"getSelectedSheetId",u(o().mark((function e(){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.send(new K(N.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)})))),d(g(c),"setSelectedSheetId",function(){var e=u(o().mark((function e(n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.SET_SELECTED_SHEET_ID,{SheetId:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),d(g(c),"setTheme",function(){var e=u(o().mark((function e(n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.SET_THEME,{ThemeArn:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),d(g(c),"navigateToDashboard",function(){var e=u(o().mark((function e(n,t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.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)}}()),d(g(c),"removeVisualActions",function(){var e=u(o().mark((function e(n,t,r){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.REMOVE_VISUAL_ACTIONS,{SheetId:n,VisualId:t,Actions:r})));case 1:case"end":return e.stop()}}),e)})));return function(n,t,r){return e.apply(this,arguments)}}()),d(g(c),"getSheetVisuals",function(){var e=u(o().mark((function e(n){var t;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.send(new K(N.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)}}()),d(g(c),"setParameters",function(){var e=u(o().mark((function e(n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.SET_PARAMETERS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),d(g(c),"reset",u(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.RESET)));case 1:case"end":return e.stop()}}),e)})))),d(g(c),"setThemeOverride",function(){var e=u(o().mark((function e(n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.SET_THEME_OVERRIDE,{ThemeOverride:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),d(g(c),"setPreloadThemes",function(){var e=u(o().mark((function e(n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.PRELOAD_THEMES,{PreloadThemes:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),d(g(c),"extractExperienceFromUrl",(function(e){var n,t,r=/^https:\/\/[^/]+\/embed\/[^/]+\/dashboards\/([\w-]+)(\?|$)/i.exec(e)||[];if(r.length<3)throw null===(n=(t=c.frameOptions).onChange)||void 0===n||n.call(t,new q(R.INVALID_URL,C.ERROR,"Invalid dashboard experience url",{url:e}),{frame:null}),new Error("Invalid dashboard experience URL");return{experienceType:F.DASHBOARD,dashboardId:r[1]}})),d(g(c),"interceptMessage",(function(e,n){var t,r,i,o,a;"SIZE_CHANGED"===e.eventName&&c.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=c.contentOptions)&&void 0!==t&&null!==(t=t.themeOptions)&&void 0!==t&&t.themeOverride&&c.setThemeOverride(c.contentOptions.themeOptions.themeOverride),"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(r=c.contentOptions)&&void 0!==r&&null!==(r=r.themeOptions)&&void 0!==r&&r.preloadThemes&&c.setPreloadThemes(c.contentOptions.themeOptions.preloadThemes)})),d(g(c),"transformDashboardContentOptions",(function(e){var n,t=e.parameters,r=e.locale,o=e.attributionOptions,a=e.sheetOptions,s=e.toolbarOptions,u=e.themeOptions;e.onMessage;var l=v(e,be),f=c.transformContentOptions({locale:r},l);return Array.isArray(t)&&(f.parameters=t.reduce((function(e,n){return i(i({},e),{},d({},n.Name,n.Values))}),{})),!0!==(null==o?void 0:o.overlayContent)&&(f.footerPaddingEnabled=!0),(null!=s&&s.export||null!=s&&null!==(n=s.export)&&void 0!==n&&n.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!=u&&u.themeArn&&(f.themeArn=u.themeArn),f})),c.experience=c.extractExperienceFromUrl(e.url);var f=c.getInternalExperienceInfo(c.experience),p=f.experienceIdentifier,h=f.internalExperience;return c.internalExperience=h,c.experienceId=p,c.experienceFrame=new Ae(e,a,r,c.transformDashboardContentOptions(r),h,p,c.interceptMessage),c}return h(t,e),p(t)}(se),Ne=function(e){function t(e,r,o,a,s,c,u){var f;return l(this,t),d(g(f=n(this,t,[e,r,o,a,s,c,u])),"buildExperienceUrl",(function(e){var n=f.internalExperience,t=n.contextId,r=n.discriminator;return[e,f.buildQueryString(i(i({},f.transformedContentOptions),{},{contextId:t,discriminator:r}))].join(e.includes("?")?"&":"?")})),f.url=f.buildExperienceUrl(e.url),f.createExperienceIframe(),f}return h(t,e),p(t)}(ge),Ce=["hideIcon","hideTopicName","theme","allowTopicSelection","onMessage"],Le=function(e){function t(e,r,i,a){var c;l(this,t),d(g(c=n(this,t,[e,r,i,a])),"close",(function(){return c.send(new K(N.CLOSE_Q_SEARCH))})),d(g(c),"setQuestion",function(){var e=u(o().mark((function e(n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.send(new K(N.SET_Q_SEARCH_QUESTION,{question:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),d(g(c),"extractExperienceFromUrl",(function(e){var n,t;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/q\/search(\/|\?|$)/i.exec(e)||[]).length<2)throw null===(n=(t=c.frameOptions).onChange)||void 0===n||n.call(t,new q(R.INVALID_URL,C.ERROR,"Invalid q-search experience URL",{url:e}),{frame:c.experienceFrame.iframe}),new Error("Invalid q-search experience URL");return{experienceType:F.QSEARCH}})),d(g(c),"interceptMessage",(function(e,n){switch(e.eventName){case N.Q_SEARCH_OPENED:case N.Q_SEARCH_CLOSED:var r,i;if("object"===s(e.message))null==n||null===(r=n.frame)||void 0===r||r.style.setProperty("height","".concat(null==e||null===(i=e.message)||void 0===i?void 0:i.height,"px"));break;case N.CONTENT_LOADED:var o=function(e){var n;(null===(n=c.experienceFrame.iframe)||void 0===n||!n.contains(e.target))&&c.close()};window.addEventListener("click",o),c.controlOptions.eventManager.addEventListenerForCleanup(c.experienceId,(function(){return window.removeEventListener("click",o)}));break;case N.Q_SEARCH_ENTERED_FULLSCREEN:var a,u;if(!c.frameStyles&&null!=n&&n.frame)c.frameStyles={position:null===(a=n.frame)||void 0===a?void 0:a.style.position,top:null===(u=n.frame)||void 0===u?void 0:u.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.he