UNPKG

@sassoftware/va-report-components

Version:

The SAS Visual Analytics SDK is a set of JavaScript APIs and web components that enable SAS Visual Analytics report content to be easily embedded in a third-party application or web page.

1,679 lines (1,570 loc) 11.1 MB
import e, { createElement as t, Fragment as o, useState as s, useEffect as a, useMemo as r, useCallback as n, createContext as l, useContext as c, useRef as i, useSyncExternalStore as d, useLayoutEffect as h, forwardRef as m, useReducer as u, lazy as p, memo as v, useImperativeHandle as g, Suspense as f, cloneElement as M, Children as z, isValidElement as x, createRef as y, PureComponent as C, Component as b } from "react"; import { createRoot as S } from "react-dom/client"; import { __extends as w, __assign as V, __awaiter as N, __generator as H, __rest as L } from "tslib"; import { BehaviorSubject as T, ReplaySubject as I, Subject as A, combineLatest as D, asyncScheduler as R, using as k, throwError as E, fromEventPattern as F, of as O, merge as B, animationFrameScheduler as _, EMPTY as P, from as j, concat as U, AsyncSubject as G, firstValueFrom as W } from "rxjs"; import { takeUntil as Z, filter as K, take as Y, distinctUntilChanged as Q, skip as J, debounceTime as X, map as q, mergeMap as $, withLatestFrom as ee, tap as te, ignoreElements as oe, publish as se, delay as ae, switchMap as re, concatMap as ne, first as le, shareReplay as ce, share as ie, mergeMapTo as de, finalize as he, startWith as me, endWith as ue, skipWhile as pe, last as ve, find as ge, scan as fe, distinct as Me, groupBy as ze, toArray as xe } from "rxjs/operators"; import ye from "i18next"; import { useTranslation as Ce, initReactI18next as be } from "react-i18next"; import Se, { createPortal as we } from "react-dom"; import Ve, { FreeFocusInside as Ne, AutoFocusInside as He, MoveFocusInside as Le } from "react-focus-lock"; import Te from "classnames"; import { MotionConfig as Ie, AnimatePresence as Ae, motion as De, useMotionValue as Re, useDragControls as ke, useAnimate as Ee } from "framer-motion"; import { hsl as Fe, parseToHsl as Oe, opacify as Be, transparentize as _e, rgba as Pe, toColorString as je, hslToColorString as Ue, grayscale as Ge, mix as We, parseToRgb as Ze, rgb as Ke, getContrast as Ye, lighten as Qe, darken as Je } from "polished"; import { jsx as Xe, jsxs as qe } from "react/jsx-runtime"; import $e from "axios"; import { createSelector as et, defaultMemoize as tt } from "reselect"; import { b as ot, a as st, c as at, d as rt, e as nt, f as lt, g as ct, h as it, i as dt, j as ht, k as mt, l as ut, m as pt, n as vt, o as gt, p as ft, q as Mt, r as zt, s as xt, t as yt, u as Ct, v as bt, w as St, x as wt, y as Vt, z as Nt, A as Ht, B as Lt, C as Tt, D as It, E as At, F as Dt, G as Rt, H as kt, I as Et, J as Ft, K as Ot, L as Bt, M as _t, N as Pt, O as jt, P as Ut, Q as Gt, R as Wt, S as Zt, T as Kt, U as Yt, V as Qt, W as Jt, X as Xt, Y as qt, Z as $t, _ as eo, $ as to, a0 as oo, a1 as so } from "./i18n/nova_i18n.mjs"; import { usePopper as ao } from "react-popper"; import "@popperjs/core"; import ro from "memoize-one"; import "handlebars"; import { z as no } from "zod"; import { useCallback as lo } from "use-memo-one"; import { useQuery as co, QueryClient as io } from "@tanstack/react-query"; import ho from "react-cropper"; import { ofType as mo, createEpicMiddleware as uo, combineEpics as po } from "redux-observable"; import { combineReducers as vo, createStore as go, applyMiddleware as fo, bindActionCreators as Mo } from "redux"; import { composeWithDevTools as zo } from "@redux-devtools/extension"; import { connect as xo, shallowEqual as yo } from "react-redux"; let Co; let bo = new Map; function So() { return Co; } async function wo(e) { const t = await (e?.importType === "mobile" ? import("./chunk2.mjs").then((e => ({ type: "mobile", ...e }))) : import("./chunk7.mjs").then((e => ({ type: "dynamic", ...e })))); if (e?.initialize) { await (e?.initialize(t)); } Co = t; if (bo) { for (const e of bo.values()) { e(); } } bo = undefined; } function Vo(e, t) { bo?.set(e, t); } function No(e) { bo?.delete(e); } let Ho = 0; function Lo() { return `vaReportComponentContainer${Ho++}`; } class To extends HTMLElement { constructor(...e) { super(...e); this._validationTimerId = 0; this._root = void 0; this._needsUnmount = false; this._connected = false; this._render = () => { if (this._needsUnmount) { this._root?.unmount(); this._root = undefined; this._needsUnmount = false; } if (this._connected && !this._root) { this._root = S(this); } const e = this._getRenderer(); if (!e) { if (this._root) { this._root.render(t(o)); } return; } const s = this._root && this.getRenderProps(); clearTimeout(this._validationTimerId); this._validationTimerId = 0; if (s) { this._root.render(t(e, s)); } else if (this._root) { this._root.render(t(o)); } }; } _getConnected() { return this._connected; } _invalidateProps() { if (this._getConnected()) { this._queueRender(); } } _queueRender() { if (this._validationTimerId === 0) { this._validationTimerId = window.setTimeout((() => { this._validationTimerId = 0; this._render(); }), 0); } } connectedCallback() { this._connected = true; this._queueRender(); } disconnectedCallback() { this._connected = false; this._needsUnmount = true; this._queueRender(); } attributeChangedCallback(e, t, o) { this._invalidateProps(); } static get observedAttributes() { return []; } } function Io(e) { if (!e) { return; } switch (e.toLowerCase()) { case "guest": return "guest"; case "credentials": return "credentials"; } } class Ao extends To { constructor(...e) { super(...e); this._elementKey = Lo(); this._stateRetained = false; this._initialized = false; this._menuItemProvider = void 0; this._contextKey = void 0; this._refHandle = void 0; this._isHandleValid = false; this._handle = void 0; this._handlePromise = void 0; this._handlePromiseCallbacks = void 0; this._setRef = e => { this._handle = e; if (e) { this._acceptHandlePromise(); } }; } _acceptHandlePromise() { this._isHandleValid = true; if (this._handle) { this._handlePromiseCallbacks?.accept(this._handle); this._handlePromiseCallbacks = undefined; } else { console.warn("_acceptHandlePromise called when no report handle was available"); } } _invalidateHandleRequests(e) { this._isHandleValid = false; this._handlePromiseCallbacks?.reject(e); this._handlePromiseCallbacks = undefined; this._handlePromise = undefined; } getReportHandle() { if (!this._handlePromise) { this._handlePromise = this._handle && this._isHandleValid ? Promise.resolve(this._handle) : new Promise(((e, t) => { this._handlePromiseCallbacks = { accept: e, reject: t }; })); } return this._handlePromise; } _getContextKey(e) { return "url" in e ? `${e.url}:${e.reportUri}:${this._elementKey}` : `${e.packageUri}:${this._elementKey}`; } _invalidateProps() { let e = undefined; const t = this.getRenderProps(); if (t) { e = this._getContextKey(t); } if (this._contextKey !== e) { this._refHandle = undefined; this._invalidateHandleRequests("An element attribute was changed and the handle request has been cancelled"); } this._contextKey = e; super._invalidateProps(); } static get observedAttributes() { return [ ...super.observedAttributes, "url", "reporturi", "authenticationtype", "packageuri", "popoverrootid", "restrictviewportgestures" ]; } attributeChangedCallback(e, t, o) { super.attributeChangedCallback(e, t, o); if (e === "authenticationType" && this.hasAttribute("authenticationType") && !Io(o)) { console.warn(`Invalid AuthenticationType: ${o}`); } } connectedCallback() { Vo(this, (() => { if (this._initialized) { return; } this._initialized = true; this._initializeWithImports(); })); super.connectedCallback(); } disconnectedCallback() { if (!this.preserveStateOnUnmount) { this._invalidateHandleRequests("The element was removed from the DOM and the handle request has been cancelled"); } if (this._stateRetained) { No(this); } super.disconnectedCallback(); } _initializeWithImports() { super._invalidateProps(); const e = this._stateRetained; this._stateRetained = false; this.preserveStateOnUnmount = e; } get preserveStateOnUnmount() { return this._stateRetained; } set preserveStateOnUnmount(e) { if (this._stateRetained === !!e) { return; } if (!this._stateRetained && !this._getConnected()) { No(this); } const {extendStoreLifetime: t, releaseStoreLifetime: o} = this._getDynamicImports() ?? {}; this._stateRetained = !!e; if (this._stateRetained) { t?.(this._elementKey); } else { o?.(this._elementKey); if (!this._getConnected()) { this._invalidateHandleRequests("preserveStateOnUnmount was set to false while the element was removed from the DOM"); } } } _getDynamicImports() { const e = So(); if (e?.type === "dynamic") { return e; } return; } getCommonProps() { if (!this._refHandle) { this._refHandle = e => this._setRef(e); } const e = { elementKey: this._elementKey, ref: this._refHandle, menuItemProvider: this._menuItemProvider, popoverRootId: this.popoverRootId ?? undefined, restrictViewportGestures: this.restrictViewportGestures }; if (this.reportUri && this.url) { return { ...e, authenticationType: this.authenticationType, reportUri: this.reportUri, url: this.url }; } else if (this.packageUri) { return { ...e, packageUri: this.packageUri }; } return null; } get url() { return this.getAttribute("url"); } set url(e) { if (e && typeof e === "string") { this.setAttribute("url", e); } else { this.removeAttribute("url"); } } get packageUri() { return this.getAttribute("packageUri"); } set packageUri(e) { if (e && typeof e === "string") { this.setAttribute("packageUri", e); } else { this.removeAttribute("packageUri"); } } get reportUri() { return this.getAttribute("reportUri"); } set reportUri(e) { if (e && typeof e === "string") { this.setAttribute("reportUri", e); } else { this.removeAttribute("reportUri"); } } get authenticationType() { return Io(this.getAttribute("authenticationType")) || "credentials"; } set authenticationType(e) { if (e) { if (typeof e !== "string" || !Io(e)) { console.warn(`Invalid AuthenticationType: ${e}`); this.removeAttribute("authenticationType"); } else { this.setAttribute("authenticationType", e.toLowerCase()); } } else { this.removeAttribute("authenticationType"); } } get popoverRootId() { return this.getAttribute("popoverRootId"); } set popoverRootId(e) { if (e && typeof e === "string") { this.setAttribute("popoverRootId", e); } else { this.removeAttribute("popoverRootId"); } } get restrictViewportGestures() { const e = this.getAttribute("restrictViewportGestures"); if (!e) { return undefined; } const t = e.toLowerCase(); if (t === "true") { return true; } else if (t === "false") { return false; } return undefined; } set restrictViewportGestures(e) { if (typeof e === "boolean") { this.setAttribute("restrictViewportGestures", e.toString()); return; } else if (!e) { this.removeAttribute("restrictViewportGestures"); } else { console.warn(`Invalid value for restrictViewportGestures: ${e}`); this.removeAttribute("restrictViewportGestures"); } } _resetElementKey() { this._invalidateProps(); const e = this._elementKey; this._elementKey = Lo(); if (this._stateRetained) { const t = this._getDynamicImports(); t?.extendStoreLifetime?.(this._elementKey); setTimeout((() => t?.releaseStoreLifetime?.(e)), 0); } } set menuItemProvider(e) { e = e ?? undefined; if (e === this._menuItemProvider) { return; } this._invalidateProps(); this._menuItemProvider = e; } get menuItemProvider() { return this._menuItemProvider; } } function Do(e) { if (e && typeof e === "string") { const t = e.toLocaleLowerCase(); return [ "true", "false", "auto" ].indexOf(t) > -1; } return true; } class Ro extends Ao { constructor(...e) { super(...e); this._graphCSS = void 0; this._themeOverrides = null; this._unprocessedOverrides = void 0; } _getRenderer() { return So()?.SASReport; } static get observedAttributes() { return [ ...super.observedAttributes, "hidenavigation" ]; } attributeChangedCallback(e, t, o) { super.attributeChangedCallback(e, t, o); if (e === "hideNavigation" && this.hasAttribute("hideNavigation") && !Do(o)) { console.warn(`Invalid value for hideNavigation: ${o}`); } } _initializeWithImports() { super._initializeWithImports(); if (this._unprocessedOverrides) { this.unsafe_setCustomReportTheme(this._unprocessedOverrides); this._unprocessedOverrides = undefined; } } getRenderProps() { const e = this.getCommonProps(); return e && { ...e, hideNavigation: this.hideNavigation, themeOverrides: this._themeOverrides || undefined, graphCSS: this._graphCSS }; } get hideNavigation() { if (!this.hasAttribute("hideNavigation")) return "auto"; const e = this.getAttribute("hideNavigation"); if (typeof e === "string") { switch (e.toLocaleLowerCase()) { case "true": case "": return true; case "false": return false; case "auto": default: return "auto"; } } return true; } set hideNavigation(e) { if (typeof e === "string") { if (!Do(e)) { console.warn(`Invalid value for hideNavigation: ${e}`); this.removeAttribute("hideNavigation"); } else { this.setAttribute("hideNavigation", e); } } else if (typeof e === "boolean") { this.setAttribute("hideNavigation", e.toString()); return; } else if (!e) { this.removeAttribute("hideNavigation"); } else { console.warn(`Invalid value for hideNavigation: ${e}`); this.removeAttribute("hideNavigation"); } } unsafe_setCustomReportTheme(e) { const t = So(); if (!t) { this._unprocessedOverrides = e; return; } if (t.type === "mobile") { console.error("customReportThemes not supported in this render mode."); return; } let o; if (typeof e === "object" && e !== null) { const s = e; const a = { baseThemeId: "light", styleData: {} }; if (typeof s.baseThemeId === "string") { a.baseThemeId = s.baseThemeId; } else { console.error("Objects passed to unsafe_setCustomReportTheme must have a string for the baseThemeId property"); } if (typeof s.styleData === "object" && s.styleData !== null) { a.styleData = s.styleData; } else { console.error("Objects passed to unsafe_setCustomReportTheme must have an object for the styleData property"); } o = t.convertThemeServiceResponseToThemeParameterOverrides(a); } else if (e === null || e === undefined) { o = null; } else { o = null; console.error("Invalid value passed to unsafe_setCustomReportTheme: " + e); } if (this._themeOverrides === o) { return; } this._themeOverrides = o; this._invalidateProps(); } unsafe_setGraphCSS(e) { let t; if (typeof e === "string") { t = e; } else if (e === null || e === undefined) { t = undefined; } else { t = undefined; console.error("Invalid value passed to unsafe_setGraphCSS: " + e); } if (this._graphCSS === t) { return; } this._graphCSS = t; this._resetElementKey(); this._invalidateProps(); } } function ko(e) { if (e && typeof e === "string") { const t = e.toLocaleLowerCase(); return [ "true", "false" ].indexOf(t) > -1; } return true; } class Eo extends Ao { constructor(...e) { super(...e); this._objectHandlePromise = void 0; this._rejectObjectHandleCallback = void 0; } _getRenderer() { return So()?.SASReportObject; } static get observedAttributes() { return [ ...super.observedAttributes, "objectname", "reportcontextkey", "hideloadimage" ]; } _getContextKey(e) { return "url" in e ? `${e.url}:${e.reportUri}:${e.reportContextKey}:${e.objectName}` : `${e.packageUri}:${e.reportContextKey}:${e.objectName}`; } getRenderProps() { const e = this.getCommonProps(); if (e && this.objectName) { return { ...e, objectName: this.objectName, reportContextKey: this.reportContextKey, hideLoadImage: this.hideLoadImage }; } else { return null; } } get objectName() { return this.getAttribute("objectName"); } set objectName(e) { if (e && typeof e === "string") { this.setAttribute("objectName", e); } else { this.removeAttribute("objectName"); } } get reportContextKey() { return this.getAttribute("reportContextKey") || undefined; } set reportContextKey(e) { if (e && typeof e === "string") { this.setAttribute("reportContextKey", e); } else { this.removeAttribute("reportContextKey"); } } get hideLoadImage() { if (!this.hasAttribute("hideLoadImage")) return false; const e = this.getAttribute("hideLoadImage"); if (typeof e === "string") { switch (e.toLocaleLowerCase()) { case "true": case "": return true; case "false": return false; default: return false; } } return true; } set hideLoadImage(e) { if (typeof e === "string") { if (!ko(e)) { console.warn(`Invalid value for hideLoadImage: ${e}`); this.removeAttribute("hideLoadImage"); } else { this.setAttribute("hideLoadImage", e); } } else if (typeof e === "boolean") { this.setAttribute("hideLoadImage", e.toString()); return; } else if (!e) { this.removeAttribute("hideLoadImage"); } else { console.warn(`Invalid value for hideLoadImage: ${e}`); this.removeAttribute("hideLoadImage"); } } _invalidateHandleRequests(e) { super._invalidateHandleRequests(e); this._rejectObjectHandleCallback?.(e); this._rejectObjectHandleCallback = undefined; this._objectHandlePromise = undefined; } getObjectHandle() { const e = this.objectName; if (!e) { return Promise.reject("Cannot get an ObjectHandle before setting objectName"); } if (!this._objectHandlePromise) { this._objectHandlePromise = Promise.race([ this.getReportHandle().then((t => t.getObjectHandle(e))), new Promise(((e, t) => { this._rejectObjectHandleCallback = t; })) ]); } return this._objectHandlePromise; } } class Fo extends Ao { _getRenderer() { return So()?.SASReportPage; } static get observedAttributes() { return [ ...super.observedAttributes, "pagename", "pageindex", "reportcontextkey" ]; } _getContextKey(e) { if (!e.reportContextKey) { return super._getContextKey(e); } return "url" in e ? `${e.url}:${e.reportUri}:${e.reportContextKey}` : `${e.packageUri}:${e.reportContextKey}`; } getRenderProps() { const e = this.getCommonProps(); if (!e) { return null; } const t = this.pageIndex; if (this.pageName) { return { ...e, pageName: this.pageName, reportContextKey: this.reportContextKey }; } else if (t !== null) { return { ...e, pageIndex: t, reportContextKey: this.reportContextKey }; } return null; } get pageName() { return this.getAttribute("pageName"); } set pageName(e) { if (e && typeof e === "string") { this.setAttribute("pageName", e); } else { this.removeAttribute("pageName"); } } get pageIndex() { const e = this.getAttribute("pageIndex"); return Oo(e); } set pageIndex(e) { const t = Oo(e); if (t !== null) { this.setAttribute("pageIndex", t.toString()); } else { this.removeAttribute("pageIndex"); } } get reportContextKey() { return this.getAttribute("reportContextKey") || undefined; } set reportContextKey(e) { if (e && typeof e === "string") { this.setAttribute("reportContextKey", e); } else { this.removeAttribute("reportContextKey"); } } } function Oo(e) { if (typeof e === "string" && /^\d+$/.test(e)) { return Number(e); } else if (typeof e === "number" && e >= 0 && Number.isSafeInteger(e)) { return Math.abs(e); } else { return null; } } function Bo(e) { wo(e); if (!customElements.get("sas-report")) { customElements.define("sas-report", Ro); } if (!customElements.get("sas-report-object")) { customElements.define("sas-report-object", Eo); } if (!customElements.get("sas-report-page")) { customElements.define("sas-report-page", Fo); } } function _o() { _o = Object.assign ? Object.assign.bind() : function(e) { for (var t = 1; t < arguments.length; t++) { var o = arguments[t]; for (var s in o) { if (Object.prototype.hasOwnProperty.call(o, s)) { e[s] = o[s]; } } } return e; }; return _o.apply(this, arguments); } function Po(e, t, o, s) { if (!o) return; Object.defineProperty(e, t, { enumerable: o.enumerable, configurable: o.configurable, writable: o.writable, value: o.initializer ? o.initializer.call(s) : void 0 }); } function jo(e, t, o, s, a) { var r = {}; Object.keys(s).forEach((function(e) { r[e] = s[e]; })); r.enumerable = !!r.enumerable; r.configurable = !!r.configurable; if ("value" in r || r.initializer) { r.writable = true; } r = o.slice().reverse().reduce((function(o, s) { return s(e, t, o) || o; }), r); if (a && r.initializer !== void 0) { r.value = r.initializer ? r.initializer.call(a) : void 0; r.initializer = undefined; } if (r.initializer === void 0) { Object.defineProperty(e, t, r); r = null; } return r; } var Uo = globalThis; Uo.sas = Uo.sas || {}; sas.ltjs = sas.ltjs || {}; sas.ltjslib = sas.ltjslib || {}; sas.ltjslib.ltjs = sas.ltjslib.ltjs || {}; var Go = sas.ltjs; var Wo = sas.ltjslib.ltjs; var Zo = /sas\/ltjs\/([^\/]+).*\/([^\/]+)/; function Ko(e) { var t = e.match(Zo); if (t && t.length === 3) { var o = t[1]; var s = t[2]; return "".concat(o, "::").concat(s); } throw new Error("Unexpected LTJS module path structure: ".concat(e)); } var Yo = function() { function e() { this._typeMap = new Map; this._moduleMap = new Map; } e.prototype.initFromModuleTypeMap = function(e) { var t = e.length; for (var o = 0; o < t; o++) { var s = e[o]; if (s) { var a = s[0], r = s[1]; var n = Ko(a); this._typeMap.set(o, { typeId: o, moduleName: n, modulePath: a, parentTypeId: r }); } } }; e.prototype.getTypeEntry = function(e) { return this._typeMap.get(e); }; e.prototype.addClassToModuleMap = function(e, t) { this._moduleMap.set(e, t); }; e.prototype.getModuleByName = function(e) { return this._moduleMap.get(e); }; return e; }(); var Qo = [ 1, 2, 4, 8, 16, 32, 64, 128 ]; function Jo(e) { if (e) { for (var t = 0, o = e.length; t < o; t++) { e[t] = e[t] >>> 0; } } return e; } function Xo(e) { if (e) { for (var t = 0, o = e.length; t < o; t++) { e[t] = !!e[t]; } } return e; } var qo = function() { function e(e) { var t = this; this.wasmCrashed = false; this.abortCallbacks = []; this._module = e; this.runtime.onAborts.push(this.onAbort.bind(this)); if (!this._module.onAbort) { this._module.onAbort = function() { for (var e = 0, o = t.runtime.onAborts; e < o.length; e++) { var s = o[e]; s(); } }; } } Object.defineProperty(e.prototype, "runtime", { get: function() { if (!this.module._ltjsRuntime) { var e = { ltjsInitialized: false, wrappersInitialized: false, wrapperInitFunctions: [], platformInitialized: false, onPlatformInitialized: [], onReadyFunctions: [], initializeWrappers: function() { e.wrappersInitialized = true; for (var t = 0, o = e.wrapperInitFunctions; t < o.length; t++) { var s = o[t]; s(); } e.wrapperInitFunctions.length = 0; }, executeRunWhenInitializedCallbacks: function() { e.ltjsInitialized = true; for (var t = 0, o = e.onReadyFunctions; t < o.length; t++) { var s = o[t]; s(); } e.onReadyFunctions.length = 0; }, onAborts: [], typeMapAvailable: false, typeMapInitializers: [], initializedTypemap: function() { e.typeMapAvailable = true; for (var t = 0, o = e.typeMapInitializers; t < o.length; t++) { var s = o[t]; s(); } e.typeMapInitializers = []; }, activeVisualizationManagers: new Set, themeOverrideCallbacks: new Set, dispatchBridgeMap: new Map }; this.module._ltjsRuntime = e; } return this.module._ltjsRuntime; }, enumerable: false, configurable: true }); Object.defineProperty(e.prototype, "module", { get: function() { return this._module; }, enumerable: false, configurable: true }); e.prototype.onAbort = function() { this.wasmCrashed = true; for (var e = 0, t = this.abortCallbacks; e < t.length; e++) { var o = t[e]; o(); } this.abortCallbacks = []; }; e.prototype.addAbortCallback = function(e) { if (this.wasmCrashed) { e(); } else { this.abortCallbacks.push(e); } }; e.prototype.removeAbortCallback = function(e) { this.abortCallbacks = this.abortCallbacks.filter((function(t) { return t !== e; })); }; Object.defineProperty(e.prototype, "exports", { get: function() { return this._module.exports; }, enumerable: false, configurable: true }); e.prototype.getStringContentsOfFile = function(e) { return this._module.getStringContentsOfFile(e); }; e.prototype.writeNLSBundleToFS = function(e, t) { return this._module.writeNLSBundleToFS(e, t); }; e.prototype.setInstantiateWasmCallback = function(e) { this._module.instantiateWasm = e; }; e.prototype.setMemoryInitializerRequest = function(e) { this._module.memoryInitializerRequest = e; }; e.prototype.setUseAsm = function() { this._module.wasmJSMethod = "asmjs"; }; e.prototype.removeBlockingDependency = function(e) { if (this._module.removeBlockingDependency) { this._module.removeBlockingDependency(e); } }; Object.defineProperty(e.prototype, "deps", { set: function(e) { this._module.deps = e; }, enumerable: false, configurable: true }); Object.defineProperty(e.prototype, "libraryLoadingCompleted", { set: function(e) { this._module.libraryLoadingCompleted = e; }, enumerable: false, configurable: true }); Object.defineProperty(e.prototype, "onRuntimeInitialized", { set: function(e) { this._module.onRuntimeInitialized = e; }, enumerable: false, configurable: true }); Object.defineProperty(e.prototype, "ltjsRuntimeInitialized", { set: function(e) { this._module.ltjsRuntimeInitialized = e; }, enumerable: false, configurable: true }); e.prototype.setIsShuttingDown = function(e) { if (this._module.setIsShuttingDown) { this._module.setIsShuttingDown(e); } }; e.prototype.getTypeId = function(e) { return this._module._ltjs_commons_Closet_getTypeID(e); }; e.prototype.commitStagedObject = function(e) { return this._module._ltjs_commons_Closet_commitStagedObject(e); }; e.prototype.discardStagedObject = function(e) { this._module._ltjs_commons_Closet_discardStagedObject(e); }; e.prototype.getStagedVectorSize = function(e) { return this._module._ltjs_commons_Closet_getStagedVectorSize(e); }; e.prototype.stageObjectAt = function(e) { return this._module._ltjs_commons_Closet_stageObjectAt(e); }; e.prototype.discardStagedVector = function(e) { this._module._ltjs_commons_Closet_discardStagedVector(e); }; e.prototype._copyValuesIntoCloset = function(e, t, o, s, a) { if (a === void 0) { a = false; } if (!e || !o || !s) { return 0; } var r = e.length; var n = this._module._malloc(r * t); if (a) { for (var l = 0; l < r; ++l) { var c = NaN; var i = e[l]; if (typeof i === "number") { c = i; } else if (!isNaN(i)) { var d = parseFloat(i); if (!isNaN(d)) { c = d; } } this._module.setValue(n + l * t, c, o); } } else { for (var l = 0; l < r; ++l) { this._module.setValue(n + l * t, e[l], o); } } var h = s(r, n); this._module._free(n); return h; }; e.prototype._copyValuesFromCloset = function(e, t, o, s) { if (s === 0) { return []; } if (!t || e <= 0 || o === 0 || s < 0) { return null; } var a = []; for (var r = 0; r < s; ++r) { a[r] = this._module.getValue(o + r * e, t); } return a; }; e.prototype.convertStringToC = function(e) { if (typeof e !== "string") { return 0; } var t = this._module.stringToNewUTF8(e); var o = this._module._ltjs_commons_Closet_createString(t); this._module._free(t); return o; }; e.prototype.convertStringFromC = function(e) { if (!e) { return null; } var t = this._module._ltjs_commons_Closet_getCString(e); return this._module.UTF8ToString(t); }; e.prototype.convertStringArrayToC = function(e) { if (!e) { return 0; } var t = []; for (var o = 0, s = e.length; o < s; ++o) { var a = this.convertStringToC(e[o]); if (a < 0) { console.error("Conversion error for: " + e[o]); } t[o] = a; } return this.convertIntArrayToC(t); }; e.prototype.convertStringArrayFromC = function(e) { var t = this.convertIntArrayFromC(e); if (!t) { return null; } var o = []; var s = t ? t.length : 0; for (var a = 0; a < s; ++a) { o[a] = this.convertStringFromC(t[a]); } this._module._ltjs_commons_Closet_releaseAllPrimitives(e); return o; }; e.prototype.convertIntArrayToC = function(e) { if (!e) { return 0; } return this._copyValuesIntoCloset(e, 4, "i32", this._module._ltjs_commons_Closet_createIntVector, true); }; e.prototype.convertIntArrayFromC = function(e) { if (!e) { return null; } return this._copyValuesFromCloset(4, "i32", this._module._ltjs_commons_Closet_getAddressOfIntVector(e), this._module._ltjs_commons_Closet_getSizeOfIntVector(e)); }; e.prototype.convertIntMVectorFromC = function(e) { if (!e) { return null; } return this._copyValuesFromCloset(4, "i32", this._module._ltjs_commons_Closet_getAddressOfIntMVector(e), this._module._ltjs_commons_Closet_getSizeOfIntMVector(e)); }; e.prototype.convertUnsignedArrayToC = function(e) { if (!e) { return 0; } return this._copyValuesIntoCloset(e, 4, "i32", this._module._ltjs_commons_Closet_createUnsignedVector, true); }; e.prototype.convertUnsignedArrayFromC = function(e) { if (!e) { return null; } return Jo(this._copyValuesFromCloset(4, "i32", this._module._ltjs_commons_Closet_getAddressOfUnsignedVector(e), this._module._ltjs_commons_Closet_getSizeOfUnsignedVector(e))); }; e.prototype.convertUnsignedMVectorFromC = function(e) { if (!e) { return null; } return Jo(this._copyValuesFromCloset(4, "i32", this._module._ltjs_commons_Closet_getAddressOfUnsignedMVector(e), this._module._ltjs_commons_Closet_getSizeOfUnsignedMVector(e))); }; e.prototype.convertDoubleArrayToC = function(e) { if (!e) { return 0; } return this._copyValuesIntoCloset(e, 8, "double", this._module._ltjs_commons_Closet_createDoubleVector, true); }; e.prototype.convertDoubleArrayFromC = function(e) { if (!e) { return null; } return this._copyValuesFromCloset(8, "double", this._module._ltjs_commons_Closet_getAddressOfDoubleVector(e), this._module._ltjs_commons_Closet_getSizeOfDoubleVector(e)); }; e.prototype.convertDoubleMVectorFromC = function(e) { if (!e) { return null; } return this._copyValuesFromCloset(8, "double", this._module._ltjs_commons_Closet_getAddressOfDoubleMVector(e), this._module._ltjs_commons_Closet_getSizeOfDoubleMVector(e)); }; e.prototype.convertFloatArrayToC = function(e) { if (!e) { return 0; } return this._copyValuesIntoCloset(e, 4, "float", this._module._ltjs_commons_Closet_createFloatVector, true); }; e.prototype.convertFloatArrayFromC = function(e) { if (!e) { return null; } return this._copyValuesFromCloset(4, "float", this._module._ltjs_commons_Closet_getAddressOfFloatVector(e), this._module._ltjs_commons_Closet_getSizeOfFloatVector(e)); }; e.prototype.convertFloatMVectorFromC = function(e) { if (!e) { return null; } return this._copyValuesFromCloset(4, "float", this._module._ltjs_commons_Closet_getAddressOfFloatMVector(e), this._module._ltjs_commons_Closet_getSizeOfFloatMVector(e)); }; e.prototype.convertBoolArrayToC = function(e) { e = Xo(e); if (!e) { return 0; } return this._copyValuesIntoCloset(e, 1, "i8", this._module._ltjs_commons_Closet_createBoolVector); }; e.prototype.convertBoolArrayFromC = function(e) { if (!e) { return null; } var t = this._module._ltjs_commons_Closet_getBoolVectorAsBitset(e); var o = this._module._ltjs_commons_Closet_getAddressOfBitset(t); var s = this._module._ltjs_commons_PrimitiveCloset_getSizeOfBoolVector(e); var a = this.convertBitsetToBoolArray(o, s); this._module._ltjs_commons_Closet_releasePrimitive(t); return a; }; e.prototype.convertBoolMVectorFromC = function(e) { if (!e) { return null; } var t = this._module._ltjs_commons_Closet_getBoolMVectorAsBitset(e); var o = this._module._ltjs_commons_Closet_getAddressOfBitset(t); var s = this._module._ltjs_commons_PrimitiveCloset_getSizeOfBoolMVector(e); var a = this.convertBitsetToBoolArray(o, s); this._module._ltjs_commons_Closet_releasePrimitive(t); return a; }; e.prototype.convertBitsetToBoolArray = function(e, t) { if (t === 0) { return []; } var o = this._module.HEAP8; if (!o || e === 0 || t < 0) { return null; } var s = []; for (var a = 0; a < t; ++a) { var r = o[e + Math.floor(a / 8)]; s[a] = !!(r & Qo[a % 8]); } return s; }; e.prototype.convertObjectToC = function(e) { return e ? e.getClosetAddress() : 0; }; e.prototype.convertObjectArrayToC = function(e) { if (!e) { return 0; } var t = []; for (var o = 0, s = e.length; o < s; ++o) { t[o] = this.convertObjectToC(e[o]); } return this.convertIntArrayToC(t); }; e.prototype.convertGeometryArrayFromC = function(e) { var t = this.convertIntArrayFromC(e); if (!t) { return null; } var o = []; for (var s = 0, a = t.length; s < a; ++s) { o[s] = this.convertFloatArrayFromC(t[s]); } this.releaseAllPrimitives(e); return o; }; e.prototype.convertGeometryArrayToC = function(e) { if (!e) { return 0; } var t = []; for (var o = 0, s = e.length; o < s; ++o) { t[o] = this.convertFloatArrayToC(e[o]); } return this.convertIntArrayToC(t); }; e.prototype.getWrappableClosetSize = function() { return this._module._ltjs_commons_Closet_getWrappableClosetSize(); }; e.prototype.getPrimitiveClosetSize = function() { return this._module._ltjs_commons_Closet_getPrimitiveClosetSize(); }; e.prototype.releaseWrappable = function(e) { this._module._ltjs_commons_Closet_releaseWrappable(e); }; e.prototype.releasePrimitive = function(e) { this._module._ltjs_commons_Closet_releasePrimitive(e); }; e.prototype.releaseAllPrimitives = function(e) { this._module._ltjs_commons_Closet_releaseAllPrimitives(e); }; e.prototype.releaseAllWrappables = function(e) { var t = this.convertIntArrayToC(e); this._module._ltjs_commons_Closet_releaseAllWrappables(t); }; e.prototype.getClosetKey = function(e) { return this._module._ltjs_commons_Closet_getAddress(e); }; e.prototype.closetObjectsEqual = function(e, t) { return this._module._ltjs_commons_Closet_equals(e, t); }; return e; }(); var $o = new qo(Wo); var es = $o; var ts = []; var os; var ss = 0; var as = []; var rs = new Map; var ns = new Yo; if (es.runtime.typeMapAvailable) { ns.initFromModuleTypeMap(Wo.typeMap); } else { es.runtime.typeMapInitializers.push((function() { ns.initFromModuleTypeMap(Wo.typeMap); })); } function ls() { ss--; if (ss <= 0) { $o.runtime.executeRunWhenInitializedCallbacks(); } } function cs() { $o.runtime.initializeWrappers(); var e = as.concat($o.runtime.onPlatformInitialized); $o.runtime.platformInitialized = true; $o.runtime.onPlatformInitialized = []; as.length = 0; ss = e.length; for (var t = 0, o = e; t < o.length; t++) { var s = o[t]; s(ls); } if (ss <= 0) { $o.runtime.executeRunWhenInitializedCallbacks(); } } function is() { if (!ds()) { return; } if ($o.removeBlockingDependency) { $o.removeBlockingDependency("librariesLoaded"); } $o.libraryLoadingCompleted = true; } function ds() { var e = sas.ltjs.loaderRuntime; var t = sas.ltjs.runtime; return !e || t === e; } function hs(e, t) { if (e && ts.indexOf(e) < 0) { ts.push(e); } if (sas.ltjs.registerDependency) { sas.ltjs.registerDependency(e); } rs.set(e, t); } function ms() { return ts; } function us() { var e = []; for (var t = 0, o = ts; t < o.length; t++) { var s = o[t]; var a = rs.get(s); if (a) { e = e.concat(a); } } return e; } function ps(e) { if (gs()) { e(); } else { $o.runtime.onReadyFunctions.push(e); } } function vs() { if (gs()) { return Promise.resolve(); } else { if (!os) { os = new Promise((function(e) { $o.runtime.onReadyFunctions.push(e); })); } return os; } } function gs() { return $o.runtime.ltjsInitialized || fs(); } function fs() { return !!sas.ltjs.jest && sas.ltjs.jest.isInitialized; } function Ms(e, t) { if (t === void 0) { t = false; } if ($o.runtime.platformInitialized || fs()) { e(); } else if (t) { as.push(e); } else { $o.runtime.onPlatformInitialized.push(e); } } function zs(e) { if ($o.runtime.wrappersInitialized || fs()) { e(); } else { $o.runtime.wrapperInitFunctions.push(e); } } function xs(e) { var t = ns.getModuleByName(e); if (t === undefined) { throw new Error("Module is not defined for name: ".concat(e)); } return t; } function ys(e, t) { if (t && t.default) { return t.default; } return xs(e); } function Cs(e) { return function(e) { w(t, e); function t() { return e !== null && e.apply(this, arguments) || this; } return t; }(e); } function bs(e, t) { var o = ns.getModuleByName(e); if (!o) { o = Cs(t); ns.addClassToModuleMap(e, o); } return o; } function Ss(e, t, o) { var s = o; for (var a = 0, r = t; a < r.length; a++) { var n = r[a]; s = bs(n, s); } return bs(e, s); } function ws() { ns.initFromModuleTypeMap(Wo.typeMap); } var Vs = Object.freeze({ __proto__: null, _ltjsModule: es, createModule: Ss, currentRuntimeIsLoaderRuntime: ds, getRegisteredModules: ms, getRegisteredPortablePackages: us, initialize: cs, initializeWrapper: zs, isInitialized: gs, ltjsModule: $o, moduleLookup: xs, moduleLookupAsDefault: ys, registerModule: hs, reinitializeTypemap: ws, runWhenInitialized: ps, runWhenPlatformInitialized: Ms, setupLtjsEnvironment: is, typeMap: ns, whenInitialized: vs }); function Ns(e) { if (!e) { return 0; } if (!Array.isArray(e)) { return e.getClosetAddress(); } return e.map(Ns); } function Hs(e) { if (!e) { return 0; } if (!Array.isArray(e)) { return $o.getClosetKey(e.getClosetAddress()); } return e.map(Hs); } var Ls; (function(e) { e[e["IE"] = 1] = "IE"; e[e["EDGE"] = 2] = "EDGE"; e[e["FIREFOX"] = 3] = "FIREFOX"; e[e["CHROME"] = 4] = "CHROME"; e[e["SAFARI"] = 5] = "SAFARI"; e[e["UNKNOWN"] = 6] = "UNKNOWN"; })(Ls || (Ls = {})); function Ts(e) { if (/Edge\/[\w\.]*/.test(e)) { return Ls.EDGE; } else if (/Chrome\/[\w\.]*/.test(e)) { return Ls.CHROME; } else if (/Firefox\/[\w\.]*/.test(e)) { return Ls.FIREFOX; } else if (/Safari\/[\w\.]*/.test(e)) { return Ls.SAFARI; } else if (/MSIE /.test(e) || /Trident\//.test(e)) { return Ls.IE; } return Ls.UNKNOWN; } var Is = null; function As() { if (Is === null) { Is = Ts(window.navigator.userAgent); } return Is; } var Ds = sas.ltjs.isOpenUI; var Rs; var ks; function Es(e) { if (Fs(e)) { if (Ds) { return sas.hc.ui.core.util.getProxyUrl(e, false); } if (Os(e)) { return e; } } if (e.startsWith("http://") || e.startsWith("https://")) { return e; } if (e.startsWith("./resources/")) { e = e.substring(12); } else if (e.startsWith("/resources/")) { e = e.substring(11); } if (e.startsWith("/")) { e = e.substring(1); } if (sas.ltjs.getResourceUrl) { var t = sas.ltjs.getResourceUrl(e); if (t) { return t; } } var o; if (Ds) { o = jQuery.sap.getResourcePath(e, ""); if (e.endsWith("/") && !o.endsWith("/")) { o += "/"; } return o; } if (!sas.ltjs.resourceUrl) { console.warn('sas.ltjs.resourceUrl not configured, defaulting to "/"'); sas.ltjs.resourceUrl = "/"; } return "".concat(sas.ltjs.resourceUrl).concat(sas.ltjs.resourceUrl.endsWith("/") ? "" : "/").concat(e); } function Fs(e) { if (sas.ltjs.node) { return false; } if (Ds) { return sas.hc.ui.core.util.isUrlCrossDomain(e); } if (!Rs) { Rs = document.createElement("a"); } try { Rs.href = e; } catch (t) { console.warn("Failed to parse url: ", e); return true; } if (!Rs.protocol) { return false; } if (Rs.protocol !== location.protocol || Rs.hostname !== location.hostname) { return true; } var t = Rs.port === "80" || Rs.port === "443" ? "" : Rs.port; if (t !== null && t !== location.port || t === null && location.port !== "") { return true; } return false; } function Os(e) { try { new URL(e); return true; } cat