Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

amazon-quicksight-embedding-sdk

Package Overview
Dependencies
Maintainers
9
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amazon-quicksight-embedding-sdk - npm Package Compare versions

Comparing version 1.0.11 to 1.0.12

.github/embedding-test/JSSDK.code-workspace

18

dist/embed.js

@@ -11,2 +11,4 @@ "use strict";

var _EmbeddableDashboard = _interopRequireDefault(require("./EmbeddableDashboard"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

@@ -24,6 +26,4 @@

function embedDashboard(options) {
var dashboard = new _EmbeddableObject["default"](options);
var container = dashboard.getContainer();
setTimeout(attachToDom.bind(null, dashboard.iframe, container), 0);
return dashboard;
var dashboard = new _EmbeddableDashboard["default"](options);
return embedObject(dashboard);
}

@@ -40,6 +40,10 @@ /**

var embeddedSession = new _EmbeddableObject["default"](options);
var container = embeddedSession.getContainer();
setTimeout(attachToDom.bind(null, embeddedSession.iframe, container), 0);
return embeddedSession;
return embedObject(embeddedSession);
}
function embedObject(embeddableObject) {
var container = embeddableObject.getContainer();
setTimeout(attachToDom.bind(null, embeddableObject.iframe, container), 0);
return embeddableObject;
}
/**

@@ -46,0 +50,0 @@ * Create a iframe and attach it to parent element.

@@ -31,2 +31,6 @@ "use strict";

* @property {Function} loadCallback - callback when visualization data load complete
* @property {Function} parametersChangeCallback - callback when parameters change occurs
* @property {Function} getActiveParametersCallback - callback to get active parameter values
* @property {Function} getSheetsCallback - callback to get sheet details
* @property {Function} selectedSheetChangeCallback - callback when current sheet is changed
* @property {Object} parameters

@@ -42,3 +46,3 @@ * @property {string} width - width of the iframe

/**
* Embeddable Object (session or dashboard) class.
* Embeddable Object class.
* @class

@@ -66,3 +70,5 @@ * @name EmbeddableObject

errorCallback = options.errorCallback,
loadCallback = options.loadCallback;
loadCallback = options.loadCallback,
parametersChangeCallback = options.parametersChangeCallback,
selectedSheetChangeCallback = options.selectedSheetChangeCallback;
this.url = url;

@@ -93,2 +99,10 @@

if (typeof parametersChangeCallback === 'function') {
this.on(_constants.CLIENT_FACING_EVENT_NAMES.parametersChange, parametersChangeCallback);
}
if (typeof selectedSheetChangeCallback === 'function') {
this.on(_constants.CLIENT_FACING_EVENT_NAMES.selectedSheetChange, selectedSheetChangeCallback);
}
window.addEventListener('message', function (event) {

@@ -105,2 +119,4 @@ if (!event) {

this.getParameters = this.getParameters.bind(this);
this.getActiveParameterValues = this.getActiveParameterValues.bind(this);
this.getSheets = this.getSheets.bind(this);
this.getDefaultEmbeddingVisualType = this.getDefaultEmbeddingVisualType.bind(this);

@@ -129,2 +145,34 @@ this.getUrl = this.getUrl.bind(this);

}, {
key: "getActiveParameterValues",
value: function getActiveParameterValues(callback) {
if (typeof callback !== 'function') {
return;
}
if (this.getActiveParametersCallback) {
this.off(_constants.CLIENT_FACING_EVENT_NAMES.GET_ACTIVE_PARAMETER_VALUES, this.getActiveParametersCallback);
}
this.getActiveParametersCallback = callback;
this.on(_constants.CLIENT_FACING_EVENT_NAMES.GET_ACTIVE_PARAMETER_VALUES, callback);
var event = (0, _constructEvent["default"])(_constants.OUT_GOING_POST_MESSAGE_EVENT_NAMES.GET_ACTIVE_PARAMETER_VALUES, {});
this.iframe.contentWindow.postMessage(event, this.url);
}
}, {
key: "getSheets",
value: function getSheets(callback) {
if (typeof callback !== 'function') {
return;
}
if (this.getSheetsCallback) {
this.off(_constants.CLIENT_FACING_EVENT_NAMES.GET_SHEETS, this.getSheetsCallback);
}
this.getSheetsCallback = callback;
this.on(_constants.CLIENT_FACING_EVENT_NAMES.GET_SHEETS, callback);
var event = (0, _constructEvent["default"])(_constants.OUT_GOING_POST_MESSAGE_EVENT_NAMES.GET_SHEETS, {});
this.iframe.contentWindow.postMessage(event, this.url);
}
}, {
key: "handleMessageEvent",

@@ -213,3 +261,5 @@ value: function handleMessageEvent(event, options) {

locale = options.locale,
footerPaddingEnabled = options.footerPaddingEnabled;
footerPaddingEnabled = options.footerPaddingEnabled,
printEnabled = options.printEnabled,
sheetTabsDisabled = options.sheetTabsDisabled;

@@ -222,2 +272,10 @@ var src = url + '&punyCodeEmbedOrigin=' + _punycode["default"].encode(window.location.origin + '/');

if (printEnabled) {
src = src + "&printEnabled=" + String(printEnabled);
}
if (sheetTabsDisabled) {
src = src + "&sheetTabsDisabled=" + String(sheetTabsDisabled);
}
if (footerPaddingEnabled) {

@@ -224,0 +282,0 @@ src = src + '&footerPaddingEnabled=' + String(footerPaddingEnabled);

@@ -12,3 +12,7 @@ "use strict";

UPDATE_PARAMETER_VALUES: 'updateParameterValues',
DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS: 'updateDefaultEmbeddingVisualType'
DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS: 'updateDefaultEmbeddingVisualType',
NAVIGATE_TO_DASHBOARD: 'navigateToDashboard',
GET_ACTIVE_PARAMETER_VALUES: 'getActiveParameterValues',
NAVIGATE_TO_SHEET: 'navigateToSheet',
GET_SHEETS: 'getSheets'
};

@@ -27,4 +31,8 @@ exports.OUT_GOING_POST_MESSAGE_EVENT_NAMES = OUT_GOING_POST_MESSAGE_EVENT_NAMES;

error: 'error',
parametersChange: 'parametersChange',
selectedSheetChange: 'selectedSheetChange',
RESIZE_EVENT: 'resize',
SHOW_MODAL_EVENT: 'SHOW_MODAL_EVENT'
SHOW_MODAL_EVENT: 'SHOW_MODAL_EVENT',
GET_ACTIVE_PARAMETER_VALUES: 'GET_ACTIVE_PARAMETER_VALUES',
GET_SHEETS: 'GET_SHEETS'
};

@@ -31,0 +39,0 @@ exports.CLIENT_FACING_EVENT_NAMES = CLIENT_FACING_EVENT_NAMES;

@@ -89,2 +89,14 @@ /******/ (function(modules) { // webpackBootstrap

/***/ "./dist/EmbeddableDashboard.js":
/*!*************************************!*\
!*** ./dist/EmbeddableDashboard.js ***!
\*************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _constructEvent = _interopRequireDefault(__webpack_require__(/*! ./lib/constructEvent */ \"./dist/lib/constructEvent.js\"));\n\nvar _EmbeddableObject2 = _interopRequireDefault(__webpack_require__(/*! ./EmbeddableObject */ \"./dist/EmbeddableObject.js\"));\n\nvar _constants = __webpack_require__(/*! ./lib/constants */ \"./dist/lib/constants.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n/**\n * Embeddable dashboard object.\n * @name EmbeddableDashboard\n * @param {EmbeddingOptions} options - options set by customers to embed the session or dashboard.\n */\nvar EmbeddableDashboard = /*#__PURE__*/function (_EmbeddableObject) {\n _inherits(EmbeddableDashboard, _EmbeddableObject);\n\n var _super = _createSuper(EmbeddableDashboard);\n\n function EmbeddableDashboard(options) {\n _classCallCheck(this, EmbeddableDashboard);\n\n return _super.call(this, options);\n }\n /**\n * Navigates to new dashboard given options with dashboard Id.\n * Options must contain dashboard Id the user wants to navigate to.\n * @param {*} options \n */\n\n\n _createClass(EmbeddableDashboard, [{\n key: \"navigateToDashboard\",\n value: function navigateToDashboard(options) {\n if (!options.dashboardId) {\n throw new Error('dashboardId is required');\n }\n\n var eventName = _constants.OUT_GOING_POST_MESSAGE_EVENT_NAMES.NAVIGATE_TO_DASHBOARD;\n var payload = options;\n var event = (0, _constructEvent[\"default\"])(eventName, payload);\n this.iframe.contentWindow.postMessage(event, this.url);\n }\n /**\n * Navigates to given sheet within dashboard\n * @param {String} sheetId\n */\n\n }, {\n key: \"navigateToSheet\",\n value: function navigateToSheet(sheetId) {\n var eventName = _constants.OUT_GOING_POST_MESSAGE_EVENT_NAMES.NAVIGATE_TO_SHEET;\n var payload = {\n sheetId: sheetId\n };\n var event = (0, _constructEvent[\"default\"])(eventName, payload);\n this.iframe.contentWindow.postMessage(event, this.url);\n }\n }]);\n\n return EmbeddableDashboard;\n}(_EmbeddableObject2[\"default\"]);\n\nvar _default = EmbeddableDashboard;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack:///./dist/EmbeddableDashboard.js?");
/***/ }),
/***/ "./dist/EmbeddableObject.js":

@@ -98,3 +110,3 @@ /*!**********************************!*\

"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _eventify = _interopRequireDefault(__webpack_require__(/*! ./lib/eventify */ \"./dist/lib/eventify.js\"));\n\nvar _constructEvent = _interopRequireDefault(__webpack_require__(/*! ./lib/constructEvent */ \"./dist/lib/constructEvent.js\"));\n\nvar _constants = __webpack_require__(/*! ./lib/constants */ \"./dist/lib/constants.js\");\n\nvar _punycode = _interopRequireDefault(__webpack_require__(/*! punycode */ \"./node_modules/node-libs-browser/node_modules/punycode/punycode.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * Embedding options.\n * @typedef {Object} EmbeddingOptions\n * @property {string} url - url of the session or dashboard to embed\n * @property {HTMLElement | string} container - parent html element or query selector string\n * @property {Function} errorCallback - callback when error occurs\n * @property {Function} loadCallback - callback when visualization data load complete\n * @property {Object} parameters\n * @property {string} width - width of the iframe\n * @property {string} height - height of the iframe\n * @property {string} loadingHeight - when height is set to be \"AutoFit\",\n * loadingHeight is used before actual height is received\n * @property {string} scrolling\n * @property {string} locale\n */\n\n/**\n * Embeddable Object (session or dashboard) class.\n * @class\n * @name EmbeddableObject\n * @param {EmbeddingOptions} options - options set by customers to embed the session or dashboard.\n */\nvar EmbeddableObject = /*#__PURE__*/function () {\n /* eslint-disable complexity */\n function EmbeddableObject(options) {\n _classCallCheck(this, EmbeddableObject);\n\n if (!options) {\n throw new Error('options is required');\n }\n\n if (!options.url) {\n throw new Error('url is required');\n }\n\n var url = options.url,\n container = options.container,\n parameters = options.parameters,\n defaultEmbeddingVisualType = options.defaultEmbeddingVisualType,\n errorCallback = options.errorCallback,\n loadCallback = options.loadCallback;\n this.url = url;\n\n if (container instanceof HTMLElement) {\n this.container = container;\n } else if (typeof container === 'string') {\n this.container = document.querySelector(container);\n }\n\n if (!this.container) {\n throw new Error('can\\'t find valid container');\n }\n\n this.parameters = parameters;\n this.defaultEmbeddingVisualType = defaultEmbeddingVisualType;\n this.iframe = createIframe(options);\n (0, _eventify[\"default\"])(this);\n\n if (typeof errorCallback === 'function') {\n this.on(_constants.CLIENT_FACING_EVENT_NAMES.error, errorCallback);\n }\n\n if (typeof loadCallback === 'function') {\n this.on(_constants.CLIENT_FACING_EVENT_NAMES.load, loadCallback);\n }\n\n window.addEventListener('message', function (event) {\n if (!event) {\n return;\n }\n\n if (event.source === (this.iframe && this.iframe.contentWindow)) {\n this.handleMessageEvent(event, options);\n }\n }.bind(this), false);\n this.getContainer = this.getContainer.bind(this);\n this.getParameters = this.getParameters.bind(this);\n this.getDefaultEmbeddingVisualType = this.getDefaultEmbeddingVisualType.bind(this);\n this.getUrl = this.getUrl.bind(this);\n this.handleMessageEvent = this.handleMessageEvent.bind(this);\n this.setParameters = this.setParameters.bind(this);\n this.setDefaultEmbeddingVisualType = this.setDefaultEmbeddingVisualType.bind(this);\n }\n\n _createClass(EmbeddableObject, [{\n key: \"getUrl\",\n value: function getUrl() {\n return this.url;\n }\n }, {\n key: \"getContainer\",\n value: function getContainer() {\n return this.container;\n }\n }, {\n key: \"getParameters\",\n value: function getParameters() {\n return this.parameters;\n }\n }, {\n key: \"handleMessageEvent\",\n value: function handleMessageEvent(event, options) {\n var _event$data = event.data,\n eventName = _event$data.eventName,\n payload = _event$data.payload;\n this.trigger(_constants.CLIENT_FACING_EVENT_NAMES[eventName], payload);\n\n if (eventName === _constants.IN_COMING_POST_MESSAGE_EVENT_NAMES.RESIZE_EVENT) {\n var height = options.height;\n\n if (height === _constants.DASHBOARD_SIZE_OPTIONS.AUTO_FIT) {\n this.iframe.height = payload.height;\n }\n }\n }\n }, {\n key: \"getDefaultEmbeddingVisualType\",\n value: function getDefaultEmbeddingVisualType() {\n return this.defaultEmbeddingVisualType;\n }\n }, {\n key: \"setParameters\",\n value: function setParameters(parameters) {\n var eventName = _constants.OUT_GOING_POST_MESSAGE_EVENT_NAMES.UPDATE_PARAMETER_VALUES;\n var payload = {\n parameters: parameters\n };\n var event = (0, _constructEvent[\"default\"])(eventName, payload);\n this.iframe.contentWindow.postMessage(event, this.url);\n }\n }, {\n key: \"setDefaultEmbeddingVisualType\",\n value: function setDefaultEmbeddingVisualType(defaultEmbeddingVisualType) {\n var event = this.generateDefaultEmbeddingVisualTypeEvent(defaultEmbeddingVisualType);\n this.iframe.contentWindow.postMessage(event, this.url);\n }\n }, {\n key: \"generateDefaultEmbeddingVisualTypeEvent\",\n value: function generateDefaultEmbeddingVisualTypeEvent(defaultEmbeddingVisualType) {\n var eventName = _constants.OUT_GOING_POST_MESSAGE_EVENT_NAMES.DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS;\n\n if (defaultEmbeddingVisualType == null || !(defaultEmbeddingVisualType in _constants.DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS)) {\n defaultEmbeddingVisualType = _constants.DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS.AUTO_GRAPH;\n }\n\n var payload = {\n defaultEmbeddingVisualType: defaultEmbeddingVisualType\n };\n return (0, _constructEvent[\"default\"])(eventName, payload);\n }\n }]);\n\n return EmbeddableObject;\n}();\n\nfunction createIframe(options) {\n var width = options.width,\n height = options.height;\n var loadingHeight = options.loadingHeight,\n url = options.url,\n scrolling = options.scrolling,\n className = options.className;\n\n if (height === _constants.DASHBOARD_SIZE_OPTIONS.AUTO_FIT) {\n height = loadingHeight;\n }\n\n var iframe = document.createElement('iframe');\n iframe.className = ['quicksight-embedding-iframe', className].join(' ').trim();\n iframe.width = width || '100%';\n iframe.height = height || '100%';\n iframe.scrolling = scrolling || 'no';\n iframe.onload = sendInitialPostMessage.bind(null, iframe, url);\n iframe.src = getIframeSrc(options);\n iframe.style.border = '0px';\n iframe.style.padding = '0px';\n return iframe;\n}\n\nfunction getIframeSrc(options) {\n var url = options.url,\n parameters = options.parameters,\n locale = options.locale,\n footerPaddingEnabled = options.footerPaddingEnabled;\n\n var src = url + '&punyCodeEmbedOrigin=' + _punycode[\"default\"].encode(window.location.origin + '/');\n\n if (locale) {\n src = src + '&locale=' + locale;\n }\n\n if (footerPaddingEnabled) {\n src = src + '&footerPaddingEnabled=' + String(footerPaddingEnabled);\n }\n\n if (parameters) {\n return useParameterValuesInUrl(src, parameters);\n }\n\n return src;\n}\n/**\n * Use parameter values in url.\n * @function\n * @name useParameterValuesInUrl\n * @param {string} url - url of the session or dashboard to embed.\n * @param {Object} parameters\n */\n\n\nfunction useParameterValuesInUrl(url, parameters) {\n var parameterNames = Object.keys(parameters);\n var parameterStrings = parameterNames.map(function (name) {\n var value = parameters[name];\n var values = [].concat(value);\n var encodedName = encodeURIComponent(name);\n return values.map(function (paramValue) {\n return encodeURIComponent(paramValue);\n }).map(function (encodedValue) {\n return \"p.\".concat(encodedName, \"=\").concat(encodedValue);\n }).join('&');\n });\n return \"\".concat(url, \"#\").concat(parameterStrings.join('&'));\n}\n\nfunction sendInitialPostMessage(iframe, domain) {\n if (iframe.contentWindow === null) {\n setTimeout(sendInitialPostMessage.bind(null, iframe, domain), 100);\n }\n\n var eventName = _constants.OUT_GOING_POST_MESSAGE_EVENT_NAMES.ESTABLISH_MESSAGE_CHANNEL;\n var event = (0, _constructEvent[\"default\"])(eventName); // wait until iframe.contentWindow exists and send message to iframe window\n\n iframe.contentWindow.postMessage(event, domain);\n}\n\nvar _default = EmbeddableObject;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack:///./dist/EmbeddableObject.js?");
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _eventify = _interopRequireDefault(__webpack_require__(/*! ./lib/eventify */ \"./dist/lib/eventify.js\"));\n\nvar _constructEvent = _interopRequireDefault(__webpack_require__(/*! ./lib/constructEvent */ \"./dist/lib/constructEvent.js\"));\n\nvar _constants = __webpack_require__(/*! ./lib/constants */ \"./dist/lib/constants.js\");\n\nvar _punycode = _interopRequireDefault(__webpack_require__(/*! punycode */ \"./node_modules/node-libs-browser/node_modules/punycode/punycode.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * Embedding options.\n * @typedef {Object} EmbeddingOptions\n * @property {string} url - url of the session or dashboard to embed\n * @property {HTMLElement | string} container - parent html element or query selector string\n * @property {Function} errorCallback - callback when error occurs\n * @property {Function} loadCallback - callback when visualization data load complete\n * @property {Function} parametersChangeCallback - callback when parameters change occurs\n * @property {Function} getActiveParametersCallback - callback to get active parameter values\n * @property {Function} getSheetsCallback - callback to get sheet details\n * @property {Function} selectedSheetChangeCallback - callback when current sheet is changed\n * @property {Object} parameters\n * @property {string} width - width of the iframe\n * @property {string} height - height of the iframe\n * @property {string} loadingHeight - when height is set to be \"AutoFit\",\n * loadingHeight is used before actual height is received\n * @property {string} scrolling\n * @property {string} locale\n */\n\n/**\n * Embeddable Object class.\n * @class\n * @name EmbeddableObject\n * @param {EmbeddingOptions} options - options set by customers to embed the session or dashboard.\n */\nvar EmbeddableObject = /*#__PURE__*/function () {\n /* eslint-disable complexity */\n function EmbeddableObject(options) {\n _classCallCheck(this, EmbeddableObject);\n\n if (!options) {\n throw new Error('options is required');\n }\n\n if (!options.url) {\n throw new Error('url is required');\n }\n\n var url = options.url,\n container = options.container,\n parameters = options.parameters,\n defaultEmbeddingVisualType = options.defaultEmbeddingVisualType,\n errorCallback = options.errorCallback,\n loadCallback = options.loadCallback,\n parametersChangeCallback = options.parametersChangeCallback,\n selectedSheetChangeCallback = options.selectedSheetChangeCallback;\n this.url = url;\n\n if (container instanceof HTMLElement) {\n this.container = container;\n } else if (typeof container === 'string') {\n this.container = document.querySelector(container);\n }\n\n if (!this.container) {\n throw new Error('can\\'t find valid container');\n }\n\n this.parameters = parameters;\n this.defaultEmbeddingVisualType = defaultEmbeddingVisualType;\n this.iframe = createIframe(options);\n (0, _eventify[\"default\"])(this);\n\n if (typeof errorCallback === 'function') {\n this.on(_constants.CLIENT_FACING_EVENT_NAMES.error, errorCallback);\n }\n\n if (typeof loadCallback === 'function') {\n this.on(_constants.CLIENT_FACING_EVENT_NAMES.load, loadCallback);\n }\n\n if (typeof parametersChangeCallback === 'function') {\n this.on(_constants.CLIENT_FACING_EVENT_NAMES.parametersChange, parametersChangeCallback);\n }\n\n if (typeof selectedSheetChangeCallback === 'function') {\n this.on(_constants.CLIENT_FACING_EVENT_NAMES.selectedSheetChange, selectedSheetChangeCallback);\n }\n\n window.addEventListener('message', function (event) {\n if (!event) {\n return;\n }\n\n if (event.source === (this.iframe && this.iframe.contentWindow)) {\n this.handleMessageEvent(event, options);\n }\n }.bind(this), false);\n this.getContainer = this.getContainer.bind(this);\n this.getParameters = this.getParameters.bind(this);\n this.getActiveParameterValues = this.getActiveParameterValues.bind(this);\n this.getSheets = this.getSheets.bind(this);\n this.getDefaultEmbeddingVisualType = this.getDefaultEmbeddingVisualType.bind(this);\n this.getUrl = this.getUrl.bind(this);\n this.handleMessageEvent = this.handleMessageEvent.bind(this);\n this.setParameters = this.setParameters.bind(this);\n this.setDefaultEmbeddingVisualType = this.setDefaultEmbeddingVisualType.bind(this);\n }\n\n _createClass(EmbeddableObject, [{\n key: \"getUrl\",\n value: function getUrl() {\n return this.url;\n }\n }, {\n key: \"getContainer\",\n value: function getContainer() {\n return this.container;\n }\n }, {\n key: \"getParameters\",\n value: function getParameters() {\n return this.parameters;\n }\n }, {\n key: \"getActiveParameterValues\",\n value: function getActiveParameterValues(callback) {\n if (typeof callback !== 'function') {\n return;\n }\n\n if (this.getActiveParametersCallback) {\n this.off(_constants.CLIENT_FACING_EVENT_NAMES.GET_ACTIVE_PARAMETER_VALUES, this.getActiveParametersCallback);\n }\n\n this.getActiveParametersCallback = callback;\n this.on(_constants.CLIENT_FACING_EVENT_NAMES.GET_ACTIVE_PARAMETER_VALUES, callback);\n var event = (0, _constructEvent[\"default\"])(_constants.OUT_GOING_POST_MESSAGE_EVENT_NAMES.GET_ACTIVE_PARAMETER_VALUES, {});\n this.iframe.contentWindow.postMessage(event, this.url);\n }\n }, {\n key: \"getSheets\",\n value: function getSheets(callback) {\n if (typeof callback !== 'function') {\n return;\n }\n\n if (this.getSheetsCallback) {\n this.off(_constants.CLIENT_FACING_EVENT_NAMES.GET_SHEETS, this.getSheetsCallback);\n }\n\n this.getSheetsCallback = callback;\n this.on(_constants.CLIENT_FACING_EVENT_NAMES.GET_SHEETS, callback);\n var event = (0, _constructEvent[\"default\"])(_constants.OUT_GOING_POST_MESSAGE_EVENT_NAMES.GET_SHEETS, {});\n this.iframe.contentWindow.postMessage(event, this.url);\n }\n }, {\n key: \"handleMessageEvent\",\n value: function handleMessageEvent(event, options) {\n var _event$data = event.data,\n eventName = _event$data.eventName,\n payload = _event$data.payload;\n this.trigger(_constants.CLIENT_FACING_EVENT_NAMES[eventName], payload);\n\n if (eventName === _constants.IN_COMING_POST_MESSAGE_EVENT_NAMES.RESIZE_EVENT) {\n var height = options.height;\n\n if (height === _constants.DASHBOARD_SIZE_OPTIONS.AUTO_FIT) {\n this.iframe.height = payload.height;\n }\n }\n }\n }, {\n key: \"getDefaultEmbeddingVisualType\",\n value: function getDefaultEmbeddingVisualType() {\n return this.defaultEmbeddingVisualType;\n }\n }, {\n key: \"setParameters\",\n value: function setParameters(parameters) {\n var eventName = _constants.OUT_GOING_POST_MESSAGE_EVENT_NAMES.UPDATE_PARAMETER_VALUES;\n var payload = {\n parameters: parameters\n };\n var event = (0, _constructEvent[\"default\"])(eventName, payload);\n this.iframe.contentWindow.postMessage(event, this.url);\n }\n }, {\n key: \"setDefaultEmbeddingVisualType\",\n value: function setDefaultEmbeddingVisualType(defaultEmbeddingVisualType) {\n var event = this.generateDefaultEmbeddingVisualTypeEvent(defaultEmbeddingVisualType);\n this.iframe.contentWindow.postMessage(event, this.url);\n }\n }, {\n key: \"generateDefaultEmbeddingVisualTypeEvent\",\n value: function generateDefaultEmbeddingVisualTypeEvent(defaultEmbeddingVisualType) {\n var eventName = _constants.OUT_GOING_POST_MESSAGE_EVENT_NAMES.DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS;\n\n if (defaultEmbeddingVisualType == null || !(defaultEmbeddingVisualType in _constants.DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS)) {\n defaultEmbeddingVisualType = _constants.DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS.AUTO_GRAPH;\n }\n\n var payload = {\n defaultEmbeddingVisualType: defaultEmbeddingVisualType\n };\n return (0, _constructEvent[\"default\"])(eventName, payload);\n }\n }]);\n\n return EmbeddableObject;\n}();\n\nfunction createIframe(options) {\n var width = options.width,\n height = options.height;\n var loadingHeight = options.loadingHeight,\n url = options.url,\n scrolling = options.scrolling,\n className = options.className;\n\n if (height === _constants.DASHBOARD_SIZE_OPTIONS.AUTO_FIT) {\n height = loadingHeight;\n }\n\n var iframe = document.createElement('iframe');\n iframe.className = ['quicksight-embedding-iframe', className].join(' ').trim();\n iframe.width = width || '100%';\n iframe.height = height || '100%';\n iframe.scrolling = scrolling || 'no';\n iframe.onload = sendInitialPostMessage.bind(null, iframe, url);\n iframe.src = getIframeSrc(options);\n iframe.style.border = '0px';\n iframe.style.padding = '0px';\n return iframe;\n}\n\nfunction getIframeSrc(options) {\n var url = options.url,\n parameters = options.parameters,\n locale = options.locale,\n footerPaddingEnabled = options.footerPaddingEnabled,\n printEnabled = options.printEnabled,\n sheetTabsDisabled = options.sheetTabsDisabled;\n\n var src = url + '&punyCodeEmbedOrigin=' + _punycode[\"default\"].encode(window.location.origin + '/');\n\n if (locale) {\n src = src + '&locale=' + locale;\n }\n\n if (printEnabled) {\n src = src + \"&printEnabled=\" + String(printEnabled);\n }\n\n if (sheetTabsDisabled) {\n src = src + \"&sheetTabsDisabled=\" + String(sheetTabsDisabled);\n }\n\n if (footerPaddingEnabled) {\n src = src + '&footerPaddingEnabled=' + String(footerPaddingEnabled);\n }\n\n if (parameters) {\n return useParameterValuesInUrl(src, parameters);\n }\n\n return src;\n}\n/**\n * Use parameter values in url.\n * @function\n * @name useParameterValuesInUrl\n * @param {string} url - url of the session or dashboard to embed.\n * @param {Object} parameters\n */\n\n\nfunction useParameterValuesInUrl(url, parameters) {\n var parameterNames = Object.keys(parameters);\n var parameterStrings = parameterNames.map(function (name) {\n var value = parameters[name];\n var values = [].concat(value);\n var encodedName = encodeURIComponent(name);\n return values.map(function (paramValue) {\n return encodeURIComponent(paramValue);\n }).map(function (encodedValue) {\n return \"p.\".concat(encodedName, \"=\").concat(encodedValue);\n }).join('&');\n });\n return \"\".concat(url, \"#\").concat(parameterStrings.join('&'));\n}\n\nfunction sendInitialPostMessage(iframe, domain) {\n if (iframe.contentWindow === null) {\n setTimeout(sendInitialPostMessage.bind(null, iframe, domain), 100);\n }\n\n var eventName = _constants.OUT_GOING_POST_MESSAGE_EVENT_NAMES.ESTABLISH_MESSAGE_CHANNEL;\n var event = (0, _constructEvent[\"default\"])(eventName); // wait until iframe.contentWindow exists and send message to iframe window\n\n iframe.contentWindow.postMessage(event, domain);\n}\n\nvar _default = EmbeddableObject;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack:///./dist/EmbeddableObject.js?");

@@ -111,3 +123,3 @@ /***/ }),

"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.embedDashboard = embedDashboard;\nexports.embedSession = embedSession;\n\nvar _EmbeddableObject = _interopRequireDefault(__webpack_require__(/*! ./EmbeddableObject */ \"./dist/EmbeddableObject.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Embed a dashboard.\n * @function\n * @name embedDashboard\n * @param {EmbeddingOptions} options - options set by customers to embed the dashboard.\n */\nfunction embedDashboard(options) {\n var dashboard = new _EmbeddableObject[\"default\"](options);\n var container = dashboard.getContainer();\n setTimeout(attachToDom.bind(null, dashboard.iframe, container), 0);\n return dashboard;\n}\n/**\n * Embed a session.\n * @function\n * @name embedSession\n * @param {EmbeddingOptions} options - options set by customers to embed the session.\n */\n\n\nfunction embedSession(options) {\n var embeddedSession = new _EmbeddableObject[\"default\"](options);\n var container = embeddedSession.getContainer();\n setTimeout(attachToDom.bind(null, embeddedSession.iframe, container), 0);\n return embeddedSession;\n}\n/**\n * Create a iframe and attach it to parent element.\n * @function\n * @name attachToDom\n * @param {HTMLIFrameElement} iframe\n * @param {string} url - url of the dashboard to embed with parameter values appended.\n * @param {HTMLElement} container - parent html element.\n */\n\n\nfunction attachToDom(iframe, container) {\n if (!iframe) {\n throw new Error('iFrame is required');\n }\n\n if (!container) {\n throw new Error('container of iFrame is required');\n }\n\n container.appendChild(iframe);\n}\n\n//# sourceURL=webpack:///./dist/embed.js?");
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.embedDashboard = embedDashboard;\nexports.embedSession = embedSession;\n\nvar _EmbeddableObject = _interopRequireDefault(__webpack_require__(/*! ./EmbeddableObject */ \"./dist/EmbeddableObject.js\"));\n\nvar _EmbeddableDashboard = _interopRequireDefault(__webpack_require__(/*! ./EmbeddableDashboard */ \"./dist/EmbeddableDashboard.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Embed a dashboard.\n * @function\n * @name embedDashboard\n * @param {EmbeddingOptions} options - options set by customers to embed the dashboard.\n */\nfunction embedDashboard(options) {\n var dashboard = new _EmbeddableDashboard[\"default\"](options);\n return embedObject(dashboard);\n}\n/**\n * Embed a session.\n * @function\n * @name embedSession\n * @param {EmbeddingOptions} options - options set by customers to embed the session.\n */\n\n\nfunction embedSession(options) {\n var embeddedSession = new _EmbeddableObject[\"default\"](options);\n return embedObject(embeddedSession);\n}\n\nfunction embedObject(embeddableObject) {\n var container = embeddableObject.getContainer();\n setTimeout(attachToDom.bind(null, embeddableObject.iframe, container), 0);\n return embeddableObject;\n}\n/**\n * Create a iframe and attach it to parent element.\n * @function\n * @name attachToDom\n * @param {HTMLIFrameElement} iframe\n * @param {string} url - url of the dashboard to embed with parameter values appended.\n * @param {HTMLElement} container - parent html element.\n */\n\n\nfunction attachToDom(iframe, container) {\n if (!iframe) {\n throw new Error('iFrame is required');\n }\n\n if (!container) {\n throw new Error('container of iFrame is required');\n }\n\n container.appendChild(iframe);\n}\n\n//# sourceURL=webpack:///./dist/embed.js?");

@@ -147,3 +159,3 @@ /***/ }),

"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS = exports.DASHBOARD_SIZE_OPTIONS = exports.CLIENT_FACING_EVENT_NAMES = exports.IN_COMING_POST_MESSAGE_EVENT_NAMES = exports.OUT_GOING_POST_MESSAGE_EVENT_NAMES = void 0;\n// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nvar OUT_GOING_POST_MESSAGE_EVENT_NAMES = {\n ESTABLISH_MESSAGE_CHANNEL: 'establishMessageChannel',\n UPDATE_PARAMETER_VALUES: 'updateParameterValues',\n DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS: 'updateDefaultEmbeddingVisualType'\n};\nexports.OUT_GOING_POST_MESSAGE_EVENT_NAMES = OUT_GOING_POST_MESSAGE_EVENT_NAMES;\nvar IN_COMING_POST_MESSAGE_EVENT_NAMES = {\n LOAD: 'load',\n ERROR: 'error',\n RESIZE_EVENT: 'RESIZE_EVENT',\n SHOW_MODAL_EVENT: 'SHOW_MODAL_EVENT'\n}; // this is a mapping of event names we use internally to the event names we expose to clients\n\nexports.IN_COMING_POST_MESSAGE_EVENT_NAMES = IN_COMING_POST_MESSAGE_EVENT_NAMES;\nvar CLIENT_FACING_EVENT_NAMES = {\n load: 'load',\n error: 'error',\n RESIZE_EVENT: 'resize',\n SHOW_MODAL_EVENT: 'SHOW_MODAL_EVENT'\n};\nexports.CLIENT_FACING_EVENT_NAMES = CLIENT_FACING_EVENT_NAMES;\nvar DASHBOARD_SIZE_OPTIONS = {\n AUTO_FIT: 'AutoFit'\n};\nexports.DASHBOARD_SIZE_OPTIONS = DASHBOARD_SIZE_OPTIONS;\nvar DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS = {\n AUTO_GRAPH: 'AUTO_GRAPH',\n TABLE: 'TABLE'\n};\nexports.DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS = DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS;\n\n//# sourceURL=webpack:///./dist/lib/constants.js?");
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS = exports.DASHBOARD_SIZE_OPTIONS = exports.CLIENT_FACING_EVENT_NAMES = exports.IN_COMING_POST_MESSAGE_EVENT_NAMES = exports.OUT_GOING_POST_MESSAGE_EVENT_NAMES = void 0;\n// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nvar OUT_GOING_POST_MESSAGE_EVENT_NAMES = {\n ESTABLISH_MESSAGE_CHANNEL: 'establishMessageChannel',\n UPDATE_PARAMETER_VALUES: 'updateParameterValues',\n DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS: 'updateDefaultEmbeddingVisualType',\n NAVIGATE_TO_DASHBOARD: 'navigateToDashboard',\n GET_ACTIVE_PARAMETER_VALUES: 'getActiveParameterValues',\n NAVIGATE_TO_SHEET: 'navigateToSheet',\n GET_SHEETS: 'getSheets'\n};\nexports.OUT_GOING_POST_MESSAGE_EVENT_NAMES = OUT_GOING_POST_MESSAGE_EVENT_NAMES;\nvar IN_COMING_POST_MESSAGE_EVENT_NAMES = {\n LOAD: 'load',\n ERROR: 'error',\n RESIZE_EVENT: 'RESIZE_EVENT',\n SHOW_MODAL_EVENT: 'SHOW_MODAL_EVENT'\n}; // this is a mapping of event names we use internally to the event names we expose to clients\n\nexports.IN_COMING_POST_MESSAGE_EVENT_NAMES = IN_COMING_POST_MESSAGE_EVENT_NAMES;\nvar CLIENT_FACING_EVENT_NAMES = {\n load: 'load',\n error: 'error',\n parametersChange: 'parametersChange',\n selectedSheetChange: 'selectedSheetChange',\n RESIZE_EVENT: 'resize',\n SHOW_MODAL_EVENT: 'SHOW_MODAL_EVENT',\n GET_ACTIVE_PARAMETER_VALUES: 'GET_ACTIVE_PARAMETER_VALUES',\n GET_SHEETS: 'GET_SHEETS'\n};\nexports.CLIENT_FACING_EVENT_NAMES = CLIENT_FACING_EVENT_NAMES;\nvar DASHBOARD_SIZE_OPTIONS = {\n AUTO_FIT: 'AutoFit'\n};\nexports.DASHBOARD_SIZE_OPTIONS = DASHBOARD_SIZE_OPTIONS;\nvar DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS = {\n AUTO_GRAPH: 'AUTO_GRAPH',\n TABLE: 'TABLE'\n};\nexports.DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS = DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS;\n\n//# sourceURL=webpack:///./dist/lib/constants.js?");

@@ -150,0 +162,0 @@ /***/ }),

@@ -1,1 +0,1 @@

!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS=t.DASHBOARD_SIZE_OPTIONS=t.CLIENT_FACING_EVENT_NAMES=t.IN_COMING_POST_MESSAGE_EVENT_NAMES=t.OUT_GOING_POST_MESSAGE_EVENT_NAMES=void 0;t.OUT_GOING_POST_MESSAGE_EVENT_NAMES={ESTABLISH_MESSAGE_CHANNEL:"establishMessageChannel",UPDATE_PARAMETER_VALUES:"updateParameterValues",DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS:"updateDefaultEmbeddingVisualType"};t.IN_COMING_POST_MESSAGE_EVENT_NAMES={LOAD:"load",ERROR:"error",RESIZE_EVENT:"RESIZE_EVENT",SHOW_MODAL_EVENT:"SHOW_MODAL_EVENT"};t.CLIENT_FACING_EVENT_NAMES={load:"load",error:"error",RESIZE_EVENT:"resize",SHOW_MODAL_EVENT:"SHOW_MODAL_EVENT"};t.DASHBOARD_SIZE_OPTIONS={AUTO_FIT:"AutoFit"};t.DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS={AUTO_GRAPH:"AUTO_GRAPH",TABLE:"TABLE"}},function(e,t,n){(function(t){e.exports=t.QuickSightEmbedding=n(3)}).call(this,n(0))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"embedDashboard",{enumerable:!0,get:function(){return r.embedDashboard}}),Object.defineProperty(t,"embedSession",{enumerable:!0,get:function(){return r.embedSession}});var r=n(4)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.embedDashboard=function(e){var t=new i.default(e),n=t.getContainer();return setTimeout(o.bind(null,t.iframe,n),0),t},t.embedSession=function(e){var t=new i.default(e),n=t.getContainer();return setTimeout(o.bind(null,t.iframe,n),0),t};var r,i=(r=n(5))&&r.__esModule?r:{default:r};function o(e,t){if(!e)throw new Error("iFrame is required");if(!t)throw new Error("container of iFrame is required");t.appendChild(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=u(n(6)),i=u(n(7)),o=n(1),a=u(n(8));function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t){null===e.contentWindow&&setTimeout(s.bind(null,e,t),100);var n=o.OUT_GOING_POST_MESSAGE_EVENT_NAMES.ESTABLISH_MESSAGE_CHANNEL,r=(0,i.default)(n);e.contentWindow.postMessage(r,t)}var f=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw new Error("options is required");if(!t.url)throw new Error("url is required");var n=t.url,i=t.container,u=t.parameters,l=t.defaultEmbeddingVisualType,f=t.errorCallback,c=t.loadCallback;if(this.url=n,i instanceof HTMLElement?this.container=i:"string"==typeof i&&(this.container=document.querySelector(i)),!this.container)throw new Error("can't find valid container");this.parameters=u,this.defaultEmbeddingVisualType=l,this.iframe=function(e){var t=e.width,n=e.height,r=e.loadingHeight,i=e.url,u=e.scrolling,l=e.className;n===o.DASHBOARD_SIZE_OPTIONS.AUTO_FIT&&(n=r);var f=document.createElement("iframe");return f.className=["quicksight-embedding-iframe",l].join(" ").trim(),f.width=t||"100%",f.height=n||"100%",f.scrolling=u||"no",f.onload=s.bind(null,f,i),f.src=function(e){var t=e.url,n=e.parameters,r=e.locale,i=e.footerPaddingEnabled,o=t+"&punyCodeEmbedOrigin="+a.default.encode(window.location.origin+"/");r&&(o=o+"&locale="+r);i&&(o=o+"&footerPaddingEnabled="+String(i));if(n)return function(e,t){var n=Object.keys(t).map((function(e){var n=t[e],r=[].concat(n),i=encodeURIComponent(e);return r.map((function(e){return encodeURIComponent(e)})).map((function(e){return"p.".concat(i,"=").concat(e)})).join("&")}));return"".concat(e,"#").concat(n.join("&"))}(o,n);return o}(e),f.style.border="0px",f.style.padding="0px",f}(t),(0,r.default)(this),"function"==typeof f&&this.on(o.CLIENT_FACING_EVENT_NAMES.error,f),"function"==typeof c&&this.on(o.CLIENT_FACING_EVENT_NAMES.load,c),window.addEventListener("message",function(e){e&&e.source===(this.iframe&&this.iframe.contentWindow)&&this.handleMessageEvent(e,t)}.bind(this),!1),this.getContainer=this.getContainer.bind(this),this.getParameters=this.getParameters.bind(this),this.getDefaultEmbeddingVisualType=this.getDefaultEmbeddingVisualType.bind(this),this.getUrl=this.getUrl.bind(this),this.handleMessageEvent=this.handleMessageEvent.bind(this),this.setParameters=this.setParameters.bind(this),this.setDefaultEmbeddingVisualType=this.setDefaultEmbeddingVisualType.bind(this)}var t,n,u;return t=e,(n=[{key:"getUrl",value:function(){return this.url}},{key:"getContainer",value:function(){return this.container}},{key:"getParameters",value:function(){return this.parameters}},{key:"handleMessageEvent",value:function(e,t){var n=e.data,r=n.eventName,i=n.payload;this.trigger(o.CLIENT_FACING_EVENT_NAMES[r],i),r===o.IN_COMING_POST_MESSAGE_EVENT_NAMES.RESIZE_EVENT&&t.height===o.DASHBOARD_SIZE_OPTIONS.AUTO_FIT&&(this.iframe.height=i.height)}},{key:"getDefaultEmbeddingVisualType",value:function(){return this.defaultEmbeddingVisualType}},{key:"setParameters",value:function(e){var t=o.OUT_GOING_POST_MESSAGE_EVENT_NAMES.UPDATE_PARAMETER_VALUES,n={parameters:e},r=(0,i.default)(t,n);this.iframe.contentWindow.postMessage(r,this.url)}},{key:"setDefaultEmbeddingVisualType",value:function(e){var t=this.generateDefaultEmbeddingVisualTypeEvent(e);this.iframe.contentWindow.postMessage(t,this.url)}},{key:"generateDefaultEmbeddingVisualTypeEvent",value:function(e){var t=o.OUT_GOING_POST_MESSAGE_EVENT_NAMES.DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS;null!=e&&e in o.DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS||(e=o.DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS.AUTO_GRAPH);var n={defaultEmbeddingVisualType:e};return(0,i.default)(t,n)}}])&&l(t.prototype,n),u&&l(t,u),e}();t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e||(e={});!function(e){["on","trigger","off"].forEach((function(t){if(t in e)throw new Error("Cannot eventify object that has `"+t+"()` method on it")}))}(e);var t=new Map;return e.on=function(e,n){var r=t.get(e);r||(r=new Set,t.set(e,r));r.add(n)},e.off=function(n,r){if(!r)return t.delete(n),e;var i=t.get(n);if(!i)return e;return i.delete(r),e},e.trigger=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var o=t.get(e);o&&o.forEach((function(e){return e.apply(null,r)}))},e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!Object.keys(r.OUT_GOING_POST_MESSAGE_EVENT_NAMES).some((function(t){return r.OUT_GOING_POST_MESSAGE_EVENT_NAMES[t]===e})))throw new Error("Unexpected eventName");return{eventName:e,clientType:"EMBEDDING",payload:t}};var r=n(1)},function(e,t,n){(function(e,r){var i;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(o){t&&t.nodeType,e&&e.nodeType;var a="object"==typeof r&&r;a.global!==a&&a.window!==a&&a.self;var u,l=2147483647,s=/^xn--/,f=/[^\x20-\x7E]/,c=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},E=Math.floor,_=String.fromCharCode;function h(e){throw new RangeError(d[e])}function p(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function T(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+p((e=e.replace(c,".")).split("."),t).join(".")}function S(e){for(var t,n,r=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(n=e.charCodeAt(i++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--):r.push(t);return r}function g(e){return p(e,(function(e){var t="";return e>65535&&(t+=_((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=_(e)})).join("")}function O(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function A(e,t,n){var r=0;for(e=n?E(e/700):e>>1,e+=E(e/t);e>455;r+=36)e=E(e/35);return E(r+36*e/(e+38))}function v(e){var t,n,r,i,o,a,u,s,f,c,d,_=[],p=e.length,T=0,S=128,O=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&h("not-basic"),_.push(e.charCodeAt(r));for(i=n>0?n+1:0;i<p;){for(o=T,a=1,u=36;i>=p&&h("invalid-input"),((s=(d=e.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||s>E((l-T)/a))&&h("overflow"),T+=s*a,!(s<(f=u<=O?1:u>=O+26?26:u-O));u+=36)a>E(l/(c=36-f))&&h("overflow"),a*=c;O=A(T-o,t=_.length+1,0==o),E(T/t)>l-S&&h("overflow"),S+=E(T/t),T%=t,_.splice(T++,0,S)}return g(_)}function N(e){var t,n,r,i,o,a,u,s,f,c,d,p,T,g,v,N=[];for(p=(e=S(e)).length,t=128,n=0,o=72,a=0;a<p;++a)(d=e[a])<128&&N.push(_(d));for(r=i=N.length,i&&N.push("-");r<p;){for(u=l,a=0;a<p;++a)(d=e[a])>=t&&d<u&&(u=d);for(u-t>E((l-n)/(T=r+1))&&h("overflow"),n+=(u-t)*T,t=u,a=0;a<p;++a)if((d=e[a])<t&&++n>l&&h("overflow"),d==t){for(s=n,f=36;!(s<(c=f<=o?1:f>=o+26?26:f-o));f+=36)v=s-c,g=36-c,N.push(_(O(c+v%g,0))),s=E(v/g);N.push(_(O(s,0))),o=A(n,T,r==i),n=0,++r}++n,++t}return N.join("")}u={version:"1.4.1",ucs2:{decode:S,encode:g},decode:v,encode:N,toASCII:function(e){return T(e,(function(e){return f.test(e)?"xn--"+N(e):e}))},toUnicode:function(e){return T(e,(function(e){return s.test(e)?v(e.slice(4).toLowerCase()):e}))}},void 0===(i=function(){return u}.call(t,n,t,e))||(e.exports=i)}()}).call(this,n(9)(e),n(0))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}}]);
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS=t.DASHBOARD_SIZE_OPTIONS=t.CLIENT_FACING_EVENT_NAMES=t.IN_COMING_POST_MESSAGE_EVENT_NAMES=t.OUT_GOING_POST_MESSAGE_EVENT_NAMES=void 0;t.OUT_GOING_POST_MESSAGE_EVENT_NAMES={ESTABLISH_MESSAGE_CHANNEL:"establishMessageChannel",UPDATE_PARAMETER_VALUES:"updateParameterValues",DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS:"updateDefaultEmbeddingVisualType",NAVIGATE_TO_DASHBOARD:"navigateToDashboard",GET_ACTIVE_PARAMETER_VALUES:"getActiveParameterValues",NAVIGATE_TO_SHEET:"navigateToSheet",GET_SHEETS:"getSheets"};t.IN_COMING_POST_MESSAGE_EVENT_NAMES={LOAD:"load",ERROR:"error",RESIZE_EVENT:"RESIZE_EVENT",SHOW_MODAL_EVENT:"SHOW_MODAL_EVENT"};t.CLIENT_FACING_EVENT_NAMES={load:"load",error:"error",parametersChange:"parametersChange",selectedSheetChange:"selectedSheetChange",RESIZE_EVENT:"resize",SHOW_MODAL_EVENT:"SHOW_MODAL_EVENT",GET_ACTIVE_PARAMETER_VALUES:"GET_ACTIVE_PARAMETER_VALUES",GET_SHEETS:"GET_SHEETS"};t.DASHBOARD_SIZE_OPTIONS={AUTO_FIT:"AutoFit"};t.DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS={AUTO_GRAPH:"AUTO_GRAPH",TABLE:"TABLE"}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=u(n(7)),i=u(n(3)),o=n(0),a=u(n(8));function u(e){return e&&e.__esModule?e:{default:e}}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t){null===e.contentWindow&&setTimeout(l.bind(null,e,t),100);var n=o.OUT_GOING_POST_MESSAGE_EVENT_NAMES.ESTABLISH_MESSAGE_CHANNEL,r=(0,i.default)(n);e.contentWindow.postMessage(r,t)}var c=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw new Error("options is required");if(!t.url)throw new Error("url is required");var n=t.url,i=t.container,u=t.parameters,s=t.defaultEmbeddingVisualType,c=t.errorCallback,f=t.loadCallback,E=t.parametersChangeCallback,d=t.selectedSheetChangeCallback;if(this.url=n,i instanceof HTMLElement?this.container=i:"string"==typeof i&&(this.container=document.querySelector(i)),!this.container)throw new Error("can't find valid container");this.parameters=u,this.defaultEmbeddingVisualType=s,this.iframe=function(e){var t=e.width,n=e.height,r=e.loadingHeight,i=e.url,u=e.scrolling,s=e.className;n===o.DASHBOARD_SIZE_OPTIONS.AUTO_FIT&&(n=r);var c=document.createElement("iframe");return c.className=["quicksight-embedding-iframe",s].join(" ").trim(),c.width=t||"100%",c.height=n||"100%",c.scrolling=u||"no",c.onload=l.bind(null,c,i),c.src=function(e){var t=e.url,n=e.parameters,r=e.locale,i=e.footerPaddingEnabled,o=e.printEnabled,u=e.sheetTabsDisabled,s=t+"&punyCodeEmbedOrigin="+a.default.encode(window.location.origin+"/");r&&(s=s+"&locale="+r);o&&(s=s+"&printEnabled="+String(o));u&&(s=s+"&sheetTabsDisabled="+String(u));i&&(s=s+"&footerPaddingEnabled="+String(i));if(n)return function(e,t){var n=Object.keys(t).map((function(e){var n=t[e],r=[].concat(n),i=encodeURIComponent(e);return r.map((function(e){return encodeURIComponent(e)})).map((function(e){return"p.".concat(i,"=").concat(e)})).join("&")}));return"".concat(e,"#").concat(n.join("&"))}(s,n);return s}(e),c.style.border="0px",c.style.padding="0px",c}(t),(0,r.default)(this),"function"==typeof c&&this.on(o.CLIENT_FACING_EVENT_NAMES.error,c),"function"==typeof f&&this.on(o.CLIENT_FACING_EVENT_NAMES.load,f),"function"==typeof E&&this.on(o.CLIENT_FACING_EVENT_NAMES.parametersChange,E),"function"==typeof d&&this.on(o.CLIENT_FACING_EVENT_NAMES.selectedSheetChange,d),window.addEventListener("message",function(e){e&&e.source===(this.iframe&&this.iframe.contentWindow)&&this.handleMessageEvent(e,t)}.bind(this),!1),this.getContainer=this.getContainer.bind(this),this.getParameters=this.getParameters.bind(this),this.getActiveParameterValues=this.getActiveParameterValues.bind(this),this.getSheets=this.getSheets.bind(this),this.getDefaultEmbeddingVisualType=this.getDefaultEmbeddingVisualType.bind(this),this.getUrl=this.getUrl.bind(this),this.handleMessageEvent=this.handleMessageEvent.bind(this),this.setParameters=this.setParameters.bind(this),this.setDefaultEmbeddingVisualType=this.setDefaultEmbeddingVisualType.bind(this)}var t,n,u;return t=e,(n=[{key:"getUrl",value:function(){return this.url}},{key:"getContainer",value:function(){return this.container}},{key:"getParameters",value:function(){return this.parameters}},{key:"getActiveParameterValues",value:function(e){if("function"==typeof e){this.getActiveParametersCallback&&this.off(o.CLIENT_FACING_EVENT_NAMES.GET_ACTIVE_PARAMETER_VALUES,this.getActiveParametersCallback),this.getActiveParametersCallback=e,this.on(o.CLIENT_FACING_EVENT_NAMES.GET_ACTIVE_PARAMETER_VALUES,e);var t=(0,i.default)(o.OUT_GOING_POST_MESSAGE_EVENT_NAMES.GET_ACTIVE_PARAMETER_VALUES,{});this.iframe.contentWindow.postMessage(t,this.url)}}},{key:"getSheets",value:function(e){if("function"==typeof e){this.getSheetsCallback&&this.off(o.CLIENT_FACING_EVENT_NAMES.GET_SHEETS,this.getSheetsCallback),this.getSheetsCallback=e,this.on(o.CLIENT_FACING_EVENT_NAMES.GET_SHEETS,e);var t=(0,i.default)(o.OUT_GOING_POST_MESSAGE_EVENT_NAMES.GET_SHEETS,{});this.iframe.contentWindow.postMessage(t,this.url)}}},{key:"handleMessageEvent",value:function(e,t){var n=e.data,r=n.eventName,i=n.payload;this.trigger(o.CLIENT_FACING_EVENT_NAMES[r],i),r===o.IN_COMING_POST_MESSAGE_EVENT_NAMES.RESIZE_EVENT&&t.height===o.DASHBOARD_SIZE_OPTIONS.AUTO_FIT&&(this.iframe.height=i.height)}},{key:"getDefaultEmbeddingVisualType",value:function(){return this.defaultEmbeddingVisualType}},{key:"setParameters",value:function(e){var t=o.OUT_GOING_POST_MESSAGE_EVENT_NAMES.UPDATE_PARAMETER_VALUES,n={parameters:e},r=(0,i.default)(t,n);this.iframe.contentWindow.postMessage(r,this.url)}},{key:"setDefaultEmbeddingVisualType",value:function(e){var t=this.generateDefaultEmbeddingVisualTypeEvent(e);this.iframe.contentWindow.postMessage(t,this.url)}},{key:"generateDefaultEmbeddingVisualTypeEvent",value:function(e){var t=o.OUT_GOING_POST_MESSAGE_EVENT_NAMES.DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS;null!=e&&e in o.DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS||(e=o.DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS.AUTO_GRAPH);var n={defaultEmbeddingVisualType:e};return(0,i.default)(t,n)}}])&&s(t.prototype,n),u&&s(t,u),e}();t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!Object.keys(r.OUT_GOING_POST_MESSAGE_EVENT_NAMES).some((function(t){return r.OUT_GOING_POST_MESSAGE_EVENT_NAMES[t]===e})))throw new Error("Unexpected eventName");return{eventName:e,clientType:"EMBEDDING",payload:t}};var r=n(0)},function(e,t,n){(function(t){e.exports=t.QuickSightEmbedding=n(5)}).call(this,n(1))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"embedDashboard",{enumerable:!0,get:function(){return r.embedDashboard}}),Object.defineProperty(t,"embedSession",{enumerable:!0,get:function(){return r.embedSession}});var r=n(6)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.embedDashboard=function(e){return a(new i.default(e))},t.embedSession=function(e){return a(new r.default(e))};var r=o(n(2)),i=o(n(10));function o(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=e.getContainer();return setTimeout(u.bind(null,e.iframe,t),0),e}function u(e,t){if(!e)throw new Error("iFrame is required");if(!t)throw new Error("container of iFrame is required");t.appendChild(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e||(e={});!function(e){["on","trigger","off"].forEach((function(t){if(t in e)throw new Error("Cannot eventify object that has `"+t+"()` method on it")}))}(e);var t=new Map;return e.on=function(e,n){var r=t.get(e);r||(r=new Set,t.set(e,r));r.add(n)},e.off=function(n,r){if(!r)return t.delete(n),e;var i=t.get(n);if(!i)return e;return i.delete(r),e},e.trigger=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var o=t.get(e);o&&o.forEach((function(e){return e.apply(null,r)}))},e}},function(e,t,n){(function(e,r){var i;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(o){t&&t.nodeType,e&&e.nodeType;var a="object"==typeof r&&r;a.global!==a&&a.window!==a&&a.self;var u,s=2147483647,l=/^xn--/,c=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,E={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,_=String.fromCharCode;function h(e){throw new RangeError(E[e])}function T(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function S(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+T((e=e.replace(f,".")).split("."),t).join(".")}function p(e){for(var t,n,r=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(n=e.charCodeAt(i++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--):r.push(t);return r}function A(e){return T(e,(function(e){var t="";return e>65535&&(t+=_((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=_(e)})).join("")}function g(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function b(e,t,n){var r=0;for(e=n?d(e/700):e>>1,e+=d(e/t);e>455;r+=36)e=d(e/35);return d(r+36*e/(e+38))}function N(e){var t,n,r,i,o,a,u,l,c,f,E,_=[],T=e.length,S=0,p=128,g=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&h("not-basic"),_.push(e.charCodeAt(r));for(i=n>0?n+1:0;i<T;){for(o=S,a=1,u=36;i>=T&&h("invalid-input"),((l=(E=e.charCodeAt(i++))-48<10?E-22:E-65<26?E-65:E-97<26?E-97:36)>=36||l>d((s-S)/a))&&h("overflow"),S+=l*a,!(l<(c=u<=g?1:u>=g+26?26:u-g));u+=36)a>d(s/(f=36-c))&&h("overflow"),a*=f;g=b(S-o,t=_.length+1,0==o),d(S/t)>s-p&&h("overflow"),p+=d(S/t),S%=t,_.splice(S++,0,p)}return A(_)}function O(e){var t,n,r,i,o,a,u,l,c,f,E,T,S,A,N,O=[];for(T=(e=p(e)).length,t=128,n=0,o=72,a=0;a<T;++a)(E=e[a])<128&&O.push(_(E));for(r=i=O.length,i&&O.push("-");r<T;){for(u=s,a=0;a<T;++a)(E=e[a])>=t&&E<u&&(u=E);for(u-t>d((s-n)/(S=r+1))&&h("overflow"),n+=(u-t)*S,t=u,a=0;a<T;++a)if((E=e[a])<t&&++n>s&&h("overflow"),E==t){for(l=n,c=36;!(l<(f=c<=o?1:c>=o+26?26:c-o));c+=36)N=l-f,A=36-f,O.push(_(g(f+N%A,0))),l=d(N/A);O.push(_(g(l,0))),o=b(n,S,r==i),n=0,++r}++n,++t}return O.join("")}u={version:"1.4.1",ucs2:{decode:p,encode:A},decode:N,encode:O,toASCII:function(e){return S(e,(function(e){return c.test(e)?"xn--"+O(e):e}))},toUnicode:function(e){return S(e,(function(e){return l.test(e)?N(e.slice(4).toLowerCase()):e}))}},void 0===(i=function(){return u}.call(t,n,t,e))||(e.exports=i)}()}).call(this,n(9)(e),n(1))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(3)),i=a(n(2)),o=n(0);function a(e){return e&&e.__esModule?e:{default:e}}function u(e){return(u="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})(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=E(e);if(t){var i=E(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f(this,n)}}function f(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var d=function(e){!function(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}}),t&&l(e,t)}(u,e);var t,n,i,a=c(u);function u(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),a.call(this,e)}return t=u,(n=[{key:"navigateToDashboard",value:function(e){if(!e.dashboardId)throw new Error("dashboardId is required");var t=o.OUT_GOING_POST_MESSAGE_EVENT_NAMES.NAVIGATE_TO_DASHBOARD,n=e,i=(0,r.default)(t,n);this.iframe.contentWindow.postMessage(i,this.url)}},{key:"navigateToSheet",value:function(e){var t=o.OUT_GOING_POST_MESSAGE_EVENT_NAMES.NAVIGATE_TO_SHEET,n={sheetId:e},i=(0,r.default)(t,n);this.iframe.contentWindow.postMessage(i,this.url)}}])&&s(t.prototype,n),i&&s(t,i),u}(i.default);t.default=d}]);
{
"name": "amazon-quicksight-embedding-sdk",
"description": "JS SDK for embedding Amazon QuickSight",
"version": "1.0.11",
"version": "1.0.12",
"main": "dist/index.js",

@@ -40,2 +40,3 @@ "homepage": "https://github.com/awslabs/amazon-quicksight-embedding-sdk",

"mocha": "^7.1.2",
"sinon": "^9.0.2",
"webpack": "^4.25.1",

@@ -42,0 +43,0 @@ "webpack-cli": "^3.3.6"

@@ -31,3 +31,3 @@ # Amazon QuickSight Embedding SDK

```html
<script src="https://unpkg.com/amazon-quicksight-embedding-sdk@1.0.11/dist/quicksight-embedding-js-sdk.min.js"></script>
<script src="https://unpkg.com/amazon-quicksight-embedding-sdk@1.0.12/dist/quicksight-embedding-js-sdk.min.js"></script>
```

@@ -88,2 +88,4 @@ *OR*

footerPaddingEnabled: true,
sheetTabsDisabled: false, // use this option to enable or disable sheet tab controls in dashboard embedding
printEnabled: false, // use this option to enable or disable print option for dashboard embedding
defaultEmbeddingVisualType: TABLE // this option only applies to experience embedding and will not be used for dashboard embedding

@@ -205,2 +207,9 @@ };

#### PrintEnabled element (optional)
The `printEnabled` element can be used to enable or disable print option for dashboard embedding. The default value is `false`. And, if both undoRedo and reset options are disabled, the navbar and print option wont be shown anyways, even if printEnabled is true.
#### SheetTabsDisabled element (optional)
**This is currently only supported for dashboard embedding.**
The `sheetTabsDisabled` element can be used to enable or disable sheet tab controls in dashboard embedding. The default value is `false`.
### Step 3: Create the QuickSight session object

@@ -220,2 +229,4 @@

### Step 4: Setup load callback (optional)

@@ -292,3 +303,80 @@ **This is currently only supported for dashboard embedding.**

### Step 7: Navigate to different dashboard (optional)
#### Dashboard embedding
To navigate to a different dashboard, use dashboard.navigateToDashboard(options). The input parameter options should contain the dashboardId that you want to navigate to, and also the parameters for that dashboard, for example:
```javascript
var options = {
dashboardId: "37a99f75-8230-4409-ac52-e45c652cc21e",
parameters: {
country: [
"United States"
]
}
};
dashboard.navigateToDashboard(options);
```
This function is only supported for embedded dashboards.
### Step 8: Navigate to sheet (optional)
**This is currently only supported for dashboard embedding.**
If you want to navigate from one sheet to another programmatically, with the Amazon quicksight dashboard, use the below method:
```javascript
dashboard.navigateToSheet(sheetId);
```
### Step 9: Setup parameters change callback (optional)
**This is currently only supported for dashboard embedding.**
If you want your application to get notified and respond when the parameters in Amazon QuickSight dashboard changes, use the parameter change callback. Choose one of the following:
- Use options:
```javascript
parametersChangeCallback: yourParametersChangeCallback,
```
- Or, register the "parametersChange" event on the returned dashboard object:
```javascript
dashboard.on("parametersChange", yourParametersChangeCallback);
```
### Step 10: Setup selected sheet change callback (optional)
**This is currently only supported for dashboard embedding.**
If you want your application to get notified and respond when the selected sheet in Amazon QuickSight dashboard changes, use the selected sheet change callback. Choose one of the following:
- Use options:
```javascript
selectedSheetChangeCallback: yourSelectedSheetChangeCallback,
```
- Or, register the "selectedSheetChange" event on the returned dashboard object:
```javascript
dashboard.on("selectedSheetChange", yourSelectedSheetChangeCallback);
```
### Step 11: Get active parameter values (optional)
**This is currently only supported for dashboard embedding.**
If you want to get the active parameter values, from Amazon Quicksight dashboard in ad-hoc manner, use the below method with a callback:
```javascript
dashboard.getActiveParameterValues(yourCallback);
```
The callback is needed since the process of getting active parameter values is asynchronous, even for ad-hoc fetches.
### Step 12: Get sheets (optional)
**This is currently only supported for dashboard embedding.**
If you want to get the current set of sheets, from Amazon Quicksight dashboard in ad-hoc manner, use the below method with a callback:
```javascript
dashboard.getSheets(yourCallback);
```
The callback is needed since the process of getting sheets is asynchronous, even for ad-hoc fetches.
## Troubleshooting

@@ -308,3 +396,3 @@ 1. Make sure the URL you provide in options is not encoded. You should avoid using an encoded URL because it breaks the authcode in the URL by changing it. Also, check that the URL sent in the response from the server side is not encoded.

<title>Basic Embed</title>
<script src="https://unpkg.com/amazon-quicksight-embedding-sdk@1.0.11/dist/quicksight-embedding-js-sdk.min.js"></script>
<script src="https://unpkg.com/amazon-quicksight-embedding-sdk@1.0.12/dist/quicksight-embedding-js-sdk.min.js"></script>
<script type="text/javascript">

@@ -367,3 +455,3 @@ var dashboard

<title>QuickSight Console Embedding</title>
<script src="https://unpkg.com/amazon-quicksight-embedding-sdk@1.0.11/dist/quicksight-embedding-js-sdk.min.js"></script>
<script src="https://unpkg.com/amazon-quicksight-embedding-sdk@1.0.12/dist/quicksight-embedding-js-sdk.min.js"></script>
<script type="text/javascript">

@@ -416,2 +504,12 @@ var session

## Change Log
**1.0.12**
* `navigateToDashboard` function for switching to another authorized dashboard without submitting a new URL
* `navigateToSheet` function for switching to another sheet on an already embedded dashboard
* `parametersChangeCallback` option to receive a callback when changing parameters in dashboard
* `selectedSheetChangeCallback` option to receive a callback when sheet is successfully changed on the embedded dashboard
* `getSheets` function to get list of sheets on currently rendered dashboard in ad-hoc manner
* `getActiveParameterValues` function to get currently applied parameters in ad-hoc manner
* `printEnabled` option to add a Print button for embedded dashboard
* `sheetTabsDisabled` option to disable tabs display on a multi-sheet embedded dashboard
**1.0.11**

@@ -418,0 +516,0 @@ * Fixed dashboard embedding issue in IE11

@@ -6,2 +6,3 @@ // @flow

import EmbeddableObject from './EmbeddableObject';
import EmbeddableDashboard from './EmbeddableDashboard';
import type {EmbeddingOptions} from './lib/types';

@@ -16,6 +17,4 @@

function embedDashboard(options: EmbeddingOptions): EmbeddableObject {
const dashboard = new EmbeddableObject(options);
const container = dashboard.getContainer();
setTimeout(attachToDom.bind(null, dashboard.iframe, container), 0);
return dashboard;
const dashboard = new EmbeddableDashboard(options);
return embedObject(dashboard);
}

@@ -31,7 +30,11 @@

const embeddedSession = new EmbeddableObject(options);
const container = embeddedSession.getContainer();
setTimeout(attachToDom.bind(null, embeddedSession.iframe, container), 0);
return embeddedSession;
return embedObject(embeddedSession);
}
function embedObject(embeddableObject: EmbeddableObject) {
const container = embeddableObject.getContainer();
setTimeout(attachToDom.bind(null, embeddableObject.iframe, container), 0);
return embeddableObject;
}
/**

@@ -38,0 +41,0 @@ * Create a iframe and attach it to parent element.

@@ -24,2 +24,6 @@ // @flow

* @property {Function} loadCallback - callback when visualization data load complete
* @property {Function} parametersChangeCallback - callback when parameters change occurs
* @property {Function} getActiveParametersCallback - callback to get active parameter values
* @property {Function} getSheetsCallback - callback to get sheet details
* @property {Function} selectedSheetChangeCallback - callback when current sheet is changed
* @property {Object} parameters

@@ -35,3 +39,3 @@ * @property {string} width - width of the iframe

/**
* Embeddable Object (session or dashboard) class.
* Embeddable Object class.
* @class

@@ -46,2 +50,4 @@ * @name EmbeddableObject

defaultEmbeddingVisualType: ?string;
getActiveParametersCallback: ?Function;
getSheetsCallback: ?Function;
on: Function;

@@ -68,3 +74,5 @@ off: Function;

errorCallback,
loadCallback
loadCallback,
parametersChangeCallback,
selectedSheetChangeCallback
} = options;

@@ -99,2 +107,10 @@

if (typeof parametersChangeCallback === 'function') {
this.on(CLIENT_FACING_EVENT_NAMES.parametersChange, parametersChangeCallback);
}
if (typeof selectedSheetChangeCallback === 'function') {
this.on(CLIENT_FACING_EVENT_NAMES.selectedSheetChange, selectedSheetChangeCallback);
}
window.addEventListener('message', (function(event) {

@@ -111,2 +127,4 @@ if (!event) {

(this: any).getParameters = this.getParameters.bind(this);
(this: any).getActiveParameterValues = this.getActiveParameterValues.bind(this);
(this: any).getSheets = this.getSheets.bind(this);
(this: any).getDefaultEmbeddingVisualType = this.getDefaultEmbeddingVisualType.bind(this);

@@ -131,2 +149,30 @@ (this: any).getUrl = this.getUrl.bind(this);

getActiveParameterValues(callback: Function) {
if (typeof callback !== 'function') {
return;
}
if (this.getActiveParametersCallback) {
this.off(CLIENT_FACING_EVENT_NAMES.GET_ACTIVE_PARAMETER_VALUES, this.getActiveParametersCallback);
}
this.getActiveParametersCallback = callback;
this.on(CLIENT_FACING_EVENT_NAMES.GET_ACTIVE_PARAMETER_VALUES, callback);
const event = constructEvent(OUT_GOING_POST_MESSAGE_EVENT_NAMES.GET_ACTIVE_PARAMETER_VALUES, {});
this.iframe.contentWindow.postMessage(event, this.url);
}
getSheets(callback: Function) {
if (typeof callback !== 'function') {
return;
}
if (this.getSheetsCallback) {
this.off(CLIENT_FACING_EVENT_NAMES.GET_SHEETS, this.getSheetsCallback);
}
this.getSheetsCallback = callback;
this.on(CLIENT_FACING_EVENT_NAMES.GET_SHEETS, callback);
const event = constructEvent(OUT_GOING_POST_MESSAGE_EVENT_NAMES.GET_SHEETS, {});
this.iframe.contentWindow.postMessage(event, this.url);
}
handleMessageEvent(event: Object, options: EmbeddingOptions): void {

@@ -190,3 +236,10 @@ const {eventName, payload} = event.data;

function getIframeSrc(options): string {
const {url, parameters, locale, footerPaddingEnabled} = options;
const {
url,
parameters,
locale,
footerPaddingEnabled,
printEnabled,
sheetTabsDisabled,
} = options;
let src = url + '&punyCodeEmbedOrigin=' + punycode.encode(window.location.origin + '/');

@@ -198,2 +251,10 @@

if (printEnabled) {
src = src + "&printEnabled=" + String(printEnabled);
}
if (sheetTabsDisabled) {
src = src + "&sheetTabsDisabled=" + String(sheetTabsDisabled);
}
if (footerPaddingEnabled) {

@@ -200,0 +261,0 @@ src = src + '&footerPaddingEnabled=' + String(footerPaddingEnabled);

@@ -9,2 +9,6 @@ // @flow

DEFAULT_EMBEDDING_VISUAL_TYPE_OPTIONS: 'updateDefaultEmbeddingVisualType',
NAVIGATE_TO_DASHBOARD: 'navigateToDashboard',
GET_ACTIVE_PARAMETER_VALUES: 'getActiveParameterValues',
NAVIGATE_TO_SHEET: 'navigateToSheet',
GET_SHEETS: 'getSheets'
};

@@ -23,4 +27,8 @@

error: 'error',
parametersChange: 'parametersChange',
selectedSheetChange: 'selectedSheetChange',
RESIZE_EVENT: 'resize',
SHOW_MODAL_EVENT: 'SHOW_MODAL_EVENT'
SHOW_MODAL_EVENT: 'SHOW_MODAL_EVENT',
GET_ACTIVE_PARAMETER_VALUES: 'GET_ACTIVE_PARAMETER_VALUES',
GET_SHEETS: 'GET_SHEETS'
};

@@ -35,2 +43,2 @@

TABLE: 'TABLE',
};
};

@@ -10,3 +10,7 @@ // @flow

loadCallback: ?Function,
parametersChangeCallback: ?Function,
selectedSheetChangeCallback: ?Function,
parameters: ?Object,
printEnabled: ?boolean,
sheetTabsDisabled: ?boolean,
defaultEmbeddingVisualType: ?string,

@@ -13,0 +17,0 @@ width: ?string,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc