From 4df1950e03806223ee1bfb5f404dcc6bb3bfcd2f Mon Sep 17 00:00:00 2001 From: Bushstar Date: Thu, 29 Jan 2026 15:16:26 +0000 Subject: [PATCH] chore: remove temp files --- java/demo/.gitignore | 2 + java/demo/frontend/generated/index.ts | 32 - .../generated/jar-resources/Flow.d.ts | 74 - .../frontend/generated/jar-resources/Flow.js | 324 ---- .../generated/jar-resources/Flow.js.map | 1 - .../jar-resources/FlowBootstrap.d.ts | 1 - .../generated/jar-resources/FlowBootstrap.js | 262 --- .../generated/jar-resources/FlowClient.d.ts | 1 - .../generated/jar-resources/FlowClient.js | 1101 ------------ .../generated/jar-resources/License.d.ts | 14 - .../generated/jar-resources/License.js | 110 -- .../generated/jar-resources/License.js.map | 1 - .../jar-resources/comboBoxConnector.js | 284 ---- .../jar-resources/confirmDialogConnector.js | 40 - .../jar-resources/contextMenuConnector.js | 117 -- .../contextMenuTargetConnector.js | 70 - .../jar-resources/copy-to-clipboard.js | 150 -- .../jar-resources/datepickerConnector.js | 159 -- .../jar-resources/dialogConnector.js | 38 - .../jar-resources/dndConnector-es6.js | 1 - .../generated/jar-resources/dndConnector.js | 110 -- .../jar-resources/flow-component-renderer.js | 155 -- .../generated/jar-resources/gridConnector.js | 1187 ------------- .../generated/jar-resources/index.d.ts | 1 - .../frontend/generated/jar-resources/index.js | 2 - .../generated/jar-resources/index.js.map | 1 - .../jar-resources/ironListConnector.js | 166 -- .../generated/jar-resources/ironListStyles.js | 12 - .../generated/jar-resources/lit-renderer.ts | 108 -- .../jar-resources/loginOverlayConnector.js | 40 - .../generated/jar-resources/lumo-includes.ts | 9 - .../jar-resources/material-includes.ts | 9 - .../jar-resources/menubarConnector.js | 111 -- .../jar-resources/messageListConnector.js | 41 - .../jar-resources/notificationConnector.js | 38 - .../jar-resources/selectConnector.js | 36 - .../generated/jar-resources/tooltip.ts | 11 - .../jar-resources/vaadin-big-decimal-field.js | 77 - .../jar-resources/vaadin-dev-tools.d.ts | 119 -- .../jar-resources/vaadin-dev-tools.js | 1477 ----------------- .../jar-resources/vaadin-dev-tools.js.map | 1 - .../vaadin-grid-flow-selection-column.js | 156 -- .../vaadin-time-picker/helpers.js | 183 -- .../vaadin-time-picker/timepickerConnector.js | 178 -- .../jar-resources/virtualListConnector.js | 130 -- .../frontend/generated/vaadin-featureflags.ts | 11 - java/demo/frontend/generated/vaadin.ts | 5 - java/demo/frontend/generated/vite-devmode.ts | 31 - java/demo/vite.generated.ts | 639 ------- 49 files changed, 2 insertions(+), 7824 deletions(-) create mode 100644 java/demo/.gitignore delete mode 100644 java/demo/frontend/generated/index.ts delete mode 100644 java/demo/frontend/generated/jar-resources/Flow.d.ts delete mode 100644 java/demo/frontend/generated/jar-resources/Flow.js delete mode 100644 java/demo/frontend/generated/jar-resources/Flow.js.map delete mode 100644 java/demo/frontend/generated/jar-resources/FlowBootstrap.d.ts delete mode 100644 java/demo/frontend/generated/jar-resources/FlowBootstrap.js delete mode 100644 java/demo/frontend/generated/jar-resources/FlowClient.d.ts delete mode 100644 java/demo/frontend/generated/jar-resources/FlowClient.js delete mode 100644 java/demo/frontend/generated/jar-resources/License.d.ts delete mode 100644 java/demo/frontend/generated/jar-resources/License.js delete mode 100644 java/demo/frontend/generated/jar-resources/License.js.map delete mode 100644 java/demo/frontend/generated/jar-resources/comboBoxConnector.js delete mode 100644 java/demo/frontend/generated/jar-resources/confirmDialogConnector.js delete mode 100644 java/demo/frontend/generated/jar-resources/contextMenuConnector.js delete mode 100644 java/demo/frontend/generated/jar-resources/contextMenuTargetConnector.js delete mode 100644 java/demo/frontend/generated/jar-resources/copy-to-clipboard.js delete mode 100644 java/demo/frontend/generated/jar-resources/datepickerConnector.js delete mode 100644 java/demo/frontend/generated/jar-resources/dialogConnector.js delete mode 100644 java/demo/frontend/generated/jar-resources/dndConnector-es6.js delete mode 100644 java/demo/frontend/generated/jar-resources/dndConnector.js delete mode 100644 java/demo/frontend/generated/jar-resources/flow-component-renderer.js delete mode 100644 java/demo/frontend/generated/jar-resources/gridConnector.js delete mode 100644 java/demo/frontend/generated/jar-resources/index.d.ts delete mode 100644 java/demo/frontend/generated/jar-resources/index.js delete mode 100644 java/demo/frontend/generated/jar-resources/index.js.map delete mode 100644 java/demo/frontend/generated/jar-resources/ironListConnector.js delete mode 100644 java/demo/frontend/generated/jar-resources/ironListStyles.js delete mode 100644 java/demo/frontend/generated/jar-resources/lit-renderer.ts delete mode 100644 java/demo/frontend/generated/jar-resources/loginOverlayConnector.js delete mode 100644 java/demo/frontend/generated/jar-resources/lumo-includes.ts delete mode 100644 java/demo/frontend/generated/jar-resources/material-includes.ts delete mode 100644 java/demo/frontend/generated/jar-resources/menubarConnector.js delete mode 100644 java/demo/frontend/generated/jar-resources/messageListConnector.js delete mode 100644 java/demo/frontend/generated/jar-resources/notificationConnector.js delete mode 100644 java/demo/frontend/generated/jar-resources/selectConnector.js delete mode 100644 java/demo/frontend/generated/jar-resources/tooltip.ts delete mode 100644 java/demo/frontend/generated/jar-resources/vaadin-big-decimal-field.js delete mode 100644 java/demo/frontend/generated/jar-resources/vaadin-dev-tools.d.ts delete mode 100644 java/demo/frontend/generated/jar-resources/vaadin-dev-tools.js delete mode 100644 java/demo/frontend/generated/jar-resources/vaadin-dev-tools.js.map delete mode 100644 java/demo/frontend/generated/jar-resources/vaadin-grid-flow-selection-column.js delete mode 100644 java/demo/frontend/generated/jar-resources/vaadin-time-picker/helpers.js delete mode 100644 java/demo/frontend/generated/jar-resources/vaadin-time-picker/timepickerConnector.js delete mode 100644 java/demo/frontend/generated/jar-resources/virtualListConnector.js delete mode 100644 java/demo/frontend/generated/vaadin-featureflags.ts delete mode 100644 java/demo/frontend/generated/vaadin.ts delete mode 100644 java/demo/frontend/generated/vite-devmode.ts delete mode 100644 java/demo/vite.generated.ts diff --git a/java/demo/.gitignore b/java/demo/.gitignore new file mode 100644 index 000000000..76f6769a1 --- /dev/null +++ b/java/demo/.gitignore @@ -0,0 +1,2 @@ +frontend/generated/ +vite.generated.ts diff --git a/java/demo/frontend/generated/index.ts b/java/demo/frontend/generated/index.ts deleted file mode 100644 index c20aa03f7..000000000 --- a/java/demo/frontend/generated/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -/****************************************************************************** - * This file is auto-generated by Vaadin. - * If you want to customize the entry point, you can copy this file or create - * your own `index.ts` in your frontend directory. - * By default, the `index.ts` file should be in `./frontend/` folder. - * - * NOTE: - * - You need to restart the dev-server after adding the new `index.ts` file. - * After that, all modifications to `index.ts` are recompiled automatically. - * - `index.js` is also supported if you don't want to use TypeScript. - ******************************************************************************/ - -// import Vaadin client-router to handle client-side and server-side navigation -import { Router } from '@vaadin/router'; - -// import Flow module to enable navigation to Vaadin server-side views -import { Flow } from 'Frontend/generated/jar-resources/Flow.js'; - -const { serverSideRoutes } = new Flow({ - imports: () => import('../../target/frontend/generated-flow-imports.js') -}); - -const routes = [ - // for client-side, place routes below (more info https://vaadin.com/docs/v15/flow/typescript/creating-routes.html) - - // for server-side, the next magic line sends all unmatched routes: - ...serverSideRoutes // IMPORTANT: this must be the last entry in the array -]; - -// Vaadin router needs an outlet in the index.html page to display views -const router = new Router(document.querySelector('#outlet')); -router.setRoutes(routes); diff --git a/java/demo/frontend/generated/jar-resources/Flow.d.ts b/java/demo/frontend/generated/jar-resources/Flow.d.ts deleted file mode 100644 index efbbbe845..000000000 --- a/java/demo/frontend/generated/jar-resources/Flow.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -export interface FlowConfig { - imports?: () => void; -} -interface AppConfig { - productionMode: boolean; - appId: string; - uidl: any; - clientRouting: boolean; -} -interface AppInitResponse { - appConfig: AppConfig; - pushScript?: string; -} -interface Router { - render: (ctx: NavigationParameters, shouldUpdateHistory: boolean) => Promise; -} -interface HTMLRouterContainer extends HTMLElement { - onBeforeEnter?: (ctx: NavigationParameters, cmd: PreventAndRedirectCommands, router: Router) => void | Promise; - onBeforeLeave?: (ctx: NavigationParameters, cmd: PreventCommands, router: Router) => void | Promise; - serverConnected?: (cancel: boolean, url?: NavigationParameters) => void; -} -interface FlowRoute { - action: (params: NavigationParameters) => Promise; - path: string; -} -export interface NavigationParameters { - pathname: string; - search: string; -} -export interface PreventCommands { - prevent: () => any; -} -export interface PreventAndRedirectCommands extends PreventCommands { - redirect: (route: string) => any; -} -/** - * Client API for flow UI operations. - */ -export declare class Flow { - config: FlowConfig; - response?: AppInitResponse; - pathname: string; - container: HTMLRouterContainer; - private isActive; - private baseRegex; - private appShellTitle; - constructor(config?: FlowConfig); - /** - * Return a `route` object for vaadin-router in an one-element array. - * - * The `FlowRoute` object `path` property handles any route, - * and the `action` returns the flow container without updating the content, - * delaying the actual Flow server call to the `onBeforeEnter` phase. - * - * This is a specific API for its use with `vaadin-router`. - */ - get serverSideRoutes(): [FlowRoute]; - loadingStarted(): void; - loadingFinished(): void; - private get action(); - private flowLeave; - private flowNavigate; - private getFlowRoutePath; - private getFlowRouteQuery; - private flowInit; - private loadScript; - private injectAppIdScript; - private flowInitClient; - private flowInitUi; - private addConnectionIndicator; - private offlineStubAction; - private isFlowClientLoaded; -} -export {}; diff --git a/java/demo/frontend/generated/jar-resources/Flow.js b/java/demo/frontend/generated/jar-resources/Flow.js deleted file mode 100644 index 66ab4ae11..000000000 --- a/java/demo/frontend/generated/jar-resources/Flow.js +++ /dev/null @@ -1,324 +0,0 @@ -import { ConnectionIndicator, ConnectionState } from '@vaadin/common-frontend'; -class FlowUiInitializationError extends Error { -} -// flow uses body for keeping references -const flowRoot = window.document.body; -const $wnd = window; -/** - * Client API for flow UI operations. - */ -export class Flow { - constructor(config) { - this.response = undefined; - this.pathname = ''; - // flag used to inform Testbench whether a server route is in progress - this.isActive = false; - this.baseRegex = /^\//; - flowRoot.$ = flowRoot.$ || []; - this.config = config || {}; - // TB checks for the existence of window.Vaadin.Flow in order - // to consider that TB needs to wait for `initFlow()`. - $wnd.Vaadin = $wnd.Vaadin || {}; - $wnd.Vaadin.Flow = $wnd.Vaadin.Flow || {}; - $wnd.Vaadin.Flow.clients = { - TypeScript: { - isActive: () => this.isActive - } - }; - // Regular expression used to remove the app-context - const elm = document.head.querySelector('base'); - this.baseRegex = new RegExp(`^${ - // IE11 does not support document.baseURI - (document.baseURI || (elm && elm.href) || '/').replace(/^https?:\/\/[^/]+/i, '')}`); - this.appShellTitle = document.title; - // Put a vaadin-connection-indicator in the dom - this.addConnectionIndicator(); - } - /** - * Return a `route` object for vaadin-router in an one-element array. - * - * The `FlowRoute` object `path` property handles any route, - * and the `action` returns the flow container without updating the content, - * delaying the actual Flow server call to the `onBeforeEnter` phase. - * - * This is a specific API for its use with `vaadin-router`. - */ - get serverSideRoutes() { - return [ - { - path: '(.*)', - action: this.action - } - ]; - } - loadingStarted() { - // Make Testbench know that server request is in progress - this.isActive = true; - $wnd.Vaadin.connectionState.loadingStarted(); - } - loadingFinished() { - // Make Testbench know that server request has finished - this.isActive = false; - $wnd.Vaadin.connectionState.loadingFinished(); - } - get action() { - // Return a function which is bound to the flow instance, thus we can use - // the syntax `...serverSideRoutes` in vaadin-router. - return async (params) => { - // Store last action pathname so as we can check it in events - this.pathname = params.pathname; - if ($wnd.Vaadin.connectionState.online) { - try { - await this.flowInit(); - } - catch (error) { - if (error instanceof FlowUiInitializationError) { - // error initializing Flow: assume connection lost - $wnd.Vaadin.connectionState.state = ConnectionState.CONNECTION_LOST; - return this.offlineStubAction(); - } - else { - throw error; - } - } - } - else { - // insert an offline stub - return this.offlineStubAction(); - } - // When an action happens, navigation will be resolved `onBeforeEnter` - this.container.onBeforeEnter = (ctx, cmd) => this.flowNavigate(ctx, cmd); - // For covering the 'server -> client' use case - this.container.onBeforeLeave = (ctx, cmd) => this.flowLeave(ctx, cmd); - return this.container; - }; - } - // Send a remote call to `JavaScriptBootstrapUI` to check - // whether navigation has to be cancelled. - async flowLeave(ctx, cmd) { - // server -> server, viewing offline stub, or browser is offline - const { connectionState } = $wnd.Vaadin; - if (this.pathname === ctx.pathname || !this.isFlowClientLoaded() || connectionState.offline) { - return Promise.resolve({}); - } - // 'server -> client' - return new Promise((resolve) => { - this.loadingStarted(); - // The callback to run from server side to cancel navigation - this.container.serverConnected = (cancel) => { - resolve(cmd && cancel ? cmd.prevent() : {}); - this.loadingFinished(); - }; - // Call server side to check whether we can leave the view - flowRoot.$server.leaveNavigation(this.getFlowRoutePath(ctx), this.getFlowRouteQuery(ctx)); - }); - } - // Send the remote call to `JavaScriptBootstrapUI` to render the flow - // route specified by the context - async flowNavigate(ctx, cmd) { - if (this.response) { - return new Promise((resolve) => { - this.loadingStarted(); - // The callback to run from server side once the view is ready - this.container.serverConnected = (cancel, redirectContext) => { - if (cmd && cancel) { - resolve(cmd.prevent()); - } - else if (cmd && cmd.redirect && redirectContext) { - resolve(cmd.redirect(redirectContext.pathname)); - } - else { - this.container.style.display = ''; - resolve(this.container); - } - this.loadingFinished(); - }; - // Call server side to navigate to the given route - flowRoot.$server.connectClient(this.container.localName, this.container.id, this.getFlowRoutePath(ctx), this.getFlowRouteQuery(ctx), this.appShellTitle, history.state); - }); - } - else { - // No server response => offline or erroneous connection - return Promise.resolve(this.container); - } - } - getFlowRoutePath(context) { - return decodeURIComponent(context.pathname).replace(this.baseRegex, ''); - } - getFlowRouteQuery(context) { - return (context.search && context.search.substring(1)) || ''; - } - // import flow client modules and initialize UI in server side. - async flowInit(serverSideRouting = false) { - // Do not start flow twice - if (!this.isFlowClientLoaded()) { - // show flow progress indicator - this.loadingStarted(); - // Initialize server side UI - this.response = await this.flowInitUi(serverSideRouting); - // Enable or disable server side routing - this.response.appConfig.clientRouting = !serverSideRouting; - const { pushScript, appConfig } = this.response; - if (typeof pushScript === 'string') { - await this.loadScript(pushScript); - } - const { appId } = appConfig; - // Load bootstrap script with server side parameters - const bootstrapMod = await import('./FlowBootstrap'); - await bootstrapMod.init(this.response); - // Load custom modules defined by user - if (typeof this.config.imports === 'function') { - this.injectAppIdScript(appId); - await this.config.imports(); - } - // Load flow-client module - const clientMod = await import('./FlowClient'); - await this.flowInitClient(clientMod); - if (!serverSideRouting) { - // we use a custom tag for the flow app container - const tag = `flow-container-${appId.toLowerCase()}`; - this.container = document.createElement(tag); - flowRoot.$[appId] = this.container; - this.container.id = appId; - } - // hide flow progress indicator - this.loadingFinished(); - } - // It might be that components created from server expect that their content has been rendered. - // Appending eagerly the container we avoid these kind of errors. - // Note that the client router will move this container to the outlet if the navigation succeed - if (this.container && !this.container.isConnected) { - this.container.style.display = 'none'; - document.body.appendChild(this.container); - } - return this.response; - } - async loadScript(url) { - return new Promise((resolve, reject) => { - const script = document.createElement('script'); - script.onload = () => resolve(); - script.onerror = reject; - script.src = url; - document.body.appendChild(script); - }); - } - injectAppIdScript(appId) { - const appIdWithoutHashCode = appId.substring(0, appId.lastIndexOf('-')); - const scriptAppId = document.createElement('script'); - scriptAppId.type = 'module'; - scriptAppId.setAttribute('data-app-id', appIdWithoutHashCode); - document.body.append(scriptAppId); - } - // After the flow-client javascript module has been loaded, this initializes flow UI - // in the browser. - async flowInitClient(clientMod) { - clientMod.init(); - // client init is async, we need to loop until initialized - return new Promise((resolve) => { - const intervalId = setInterval(() => { - // client `isActive() == true` while initializing or processing - const initializing = Object.keys($wnd.Vaadin.Flow.clients) - .filter((key) => key !== 'TypeScript') - .reduce((prev, id) => prev || $wnd.Vaadin.Flow.clients[id].isActive(), false); - if (!initializing) { - clearInterval(intervalId); - resolve(); - } - }, 5); - }); - } - // Returns the `appConfig` object - async flowInitUi(serverSideRouting) { - // appConfig was sent in the index.html request - const initial = $wnd.Vaadin && $wnd.Vaadin.TypeScript && $wnd.Vaadin.TypeScript.initial; - if (initial) { - $wnd.Vaadin.TypeScript.initial = undefined; - return Promise.resolve(initial); - } - // send a request to the `JavaScriptBootstrapHandler` - return new Promise((resolve, reject) => { - const xhr = new XMLHttpRequest(); - const httpRequest = xhr; - const serverRoutingParam = serverSideRouting ? '&serverSideRouting' : ''; - const requestPath = `?v-r=init&location=${encodeURIComponent(this.getFlowRoutePath(location))}&query=${encodeURIComponent(this.getFlowRouteQuery(location))}${serverRoutingParam}`; - httpRequest.open('GET', requestPath); - httpRequest.onerror = () => reject(new FlowUiInitializationError(`Invalid server response when initializing Flow UI. - ${httpRequest.status} - ${httpRequest.responseText}`)); - httpRequest.onload = () => { - const contentType = httpRequest.getResponseHeader('content-type'); - if (contentType && contentType.indexOf('application/json') !== -1) { - resolve(JSON.parse(httpRequest.responseText)); - } - else { - httpRequest.onerror(); - } - }; - httpRequest.send(); - }); - } - // Create shared connection state store and connection indicator - addConnectionIndicator() { - // add connection indicator to DOM - ConnectionIndicator.create(); - // Listen to browser online/offline events and update the loading indicator accordingly. - // Note: if flow-client is loaded, it instead handles the state transitions. - $wnd.addEventListener('online', () => { - if (!this.isFlowClientLoaded()) { - // Send an HTTP HEAD request for sw.js to verify server reachability. - // We do not expect sw.js to be cached, so the request goes to the - // server rather than being served from local cache. - // Require network-level failure to revert the state to CONNECTION_LOST - // (HTTP error code is ok since it still verifies server's presence). - $wnd.Vaadin.connectionState.state = ConnectionState.RECONNECTING; - const http = new XMLHttpRequest(); - http.open('HEAD', 'sw.js'); - http.onload = () => { - $wnd.Vaadin.connectionState.state = ConnectionState.CONNECTED; - }; - http.onerror = () => { - $wnd.Vaadin.connectionState.state = ConnectionState.CONNECTION_LOST; - }; - // Postpone request to reduce potential net::ERR_INTERNET_DISCONNECTED - // errors that sometimes occurs even if browser says it is online - setTimeout(() => http.send(), 50); - } - }); - $wnd.addEventListener('offline', () => { - if (!this.isFlowClientLoaded()) { - $wnd.Vaadin.connectionState.state = ConnectionState.CONNECTION_LOST; - } - }); - } - async offlineStubAction() { - const offlineStub = document.createElement('iframe'); - const offlineStubPath = './offline-stub.html'; - offlineStub.setAttribute('src', offlineStubPath); - offlineStub.setAttribute('style', 'width: 100%; height: 100%; border: 0'); - this.response = undefined; - let onlineListener; - const removeOfflineStubAndOnlineListener = () => { - if (onlineListener !== undefined) { - $wnd.Vaadin.connectionState.removeStateChangeListener(onlineListener); - onlineListener = undefined; - } - }; - offlineStub.onBeforeEnter = (ctx, _cmds, router) => { - onlineListener = () => { - if ($wnd.Vaadin.connectionState.online) { - removeOfflineStubAndOnlineListener(); - router.render(ctx, false); - } - }; - $wnd.Vaadin.connectionState.addStateChangeListener(onlineListener); - }; - offlineStub.onBeforeLeave = (_ctx, _cmds, _router) => { - removeOfflineStubAndOnlineListener(); - }; - return offlineStub; - } - isFlowClientLoaded() { - return this.response !== undefined; - } -} -//# sourceMappingURL=Flow.js.map \ No newline at end of file diff --git a/java/demo/frontend/generated/jar-resources/Flow.js.map b/java/demo/frontend/generated/jar-resources/Flow.js.map deleted file mode 100644 index bbd8ef2a0..000000000 --- a/java/demo/frontend/generated/jar-resources/Flow.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Flow.js","sourceRoot":"","sources":["../../../../src/main/frontend/Flow.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,eAAe,EAGhB,MAAM,yBAAyB,CAAC;AAMjC,MAAM,yBAA0B,SAAQ,KAAK;CAAG;AA+ChD,wCAAwC;AACxC,MAAM,QAAQ,GAAa,MAAM,CAAC,QAAQ,CAAC,IAAW,CAAC;AACvD,MAAM,IAAI,GAAG,MAME,CAAC;AAEhB;;GAEG;AACH,MAAM,OAAO,IAAI;IAaf,YAAY,MAAmB;QAX/B,aAAQ,GAAqB,SAAS,CAAC;QACvC,aAAQ,GAAG,EAAE,CAAC;QAId,sEAAsE;QAC9D,aAAQ,GAAG,KAAK,CAAC;QAEjB,cAAS,GAAG,KAAK,CAAC;QAIxB,QAAQ,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;QAE3B,6DAA6D;QAC7D,sDAAsD;QACtD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;QAChC,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;QAC1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CAAC;YACF,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,sBAAsB,CAAC,cAAc,CAAC,CAAC;QACrE,CAAC,CAAC;QACF,WAAW,CAAC,aAAa,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YACnD,kCAAkC,EAAE,CAAC;QACvC,CAAC,CAAC;QACF,OAAO,WAAW,CAAC;IACrB,CAAC;IAEO,kBAAkB;QACxB,OAAO,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC;IACrC,CAAC;CACF","sourcesContent":["import {\n ConnectionIndicator,\n ConnectionState,\n ConnectionStateChangeListener,\n ConnectionStateStore\n} from '@vaadin/common-frontend';\n\nexport interface FlowConfig {\n imports?: () => void;\n}\n\nclass FlowUiInitializationError extends Error {}\n\ninterface AppConfig {\n productionMode: boolean;\n appId: string;\n uidl: any;\n clientRouting: boolean;\n}\n\ninterface AppInitResponse {\n appConfig: AppConfig;\n pushScript?: string;\n}\n\ninterface Router {\n render: (ctx: NavigationParameters, shouldUpdateHistory: boolean) => Promise;\n}\n\ninterface HTMLRouterContainer extends HTMLElement {\n onBeforeEnter?: (ctx: NavigationParameters, cmd: PreventAndRedirectCommands, router: Router) => void | Promise;\n onBeforeLeave?: (ctx: NavigationParameters, cmd: PreventCommands, router: Router) => void | Promise;\n serverConnected?: (cancel: boolean, url?: NavigationParameters) => void;\n}\n\ninterface FlowRoute {\n action: (params: NavigationParameters) => Promise;\n path: string;\n}\n\ninterface FlowRoot {\n $: any;\n $server: any;\n}\n\nexport interface NavigationParameters {\n pathname: string;\n search: string;\n}\n\nexport interface PreventCommands {\n prevent: () => any;\n}\n\nexport interface PreventAndRedirectCommands extends PreventCommands {\n redirect: (route: string) => any;\n}\n\n// flow uses body for keeping references\nconst flowRoot: FlowRoot = window.document.body as any;\nconst $wnd = window as any as {\n Vaadin: {\n Flow: any;\n TypeScript: any;\n connectionState: ConnectionStateStore;\n };\n} & EventTarget;\n\n/**\n * Client API for flow UI operations.\n */\nexport class Flow {\n config: FlowConfig;\n response?: AppInitResponse = undefined;\n pathname = '';\n\n container!: HTMLRouterContainer;\n\n // flag used to inform Testbench whether a server route is in progress\n private isActive = false;\n\n private baseRegex = /^\\//;\n private appShellTitle: string;\n\n constructor(config?: FlowConfig) {\n flowRoot.$ = flowRoot.$ || [];\n this.config = config || {};\n\n // TB checks for the existence of window.Vaadin.Flow in order\n // to consider that TB needs to wait for `initFlow()`.\n $wnd.Vaadin = $wnd.Vaadin || {};\n $wnd.Vaadin.Flow = $wnd.Vaadin.Flow || {};\n $wnd.Vaadin.Flow.clients = {\n TypeScript: {\n isActive: () => this.isActive\n }\n };\n\n // Regular expression used to remove the app-context\n const elm = document.head.querySelector('base');\n this.baseRegex = new RegExp(\n `^${\n // IE11 does not support document.baseURI\n (document.baseURI || (elm && elm.href) || '/').replace(/^https?:\\/\\/[^/]+/i, '')\n }`\n );\n this.appShellTitle = document.title;\n // Put a vaadin-connection-indicator in the dom\n this.addConnectionIndicator();\n }\n\n /**\n * Return a `route` object for vaadin-router in an one-element array.\n *\n * The `FlowRoute` object `path` property handles any route,\n * and the `action` returns the flow container without updating the content,\n * delaying the actual Flow server call to the `onBeforeEnter` phase.\n *\n * This is a specific API for its use with `vaadin-router`.\n */\n get serverSideRoutes(): [FlowRoute] {\n return [\n {\n path: '(.*)',\n action: this.action\n }\n ];\n }\n\n loadingStarted() {\n // Make Testbench know that server request is in progress\n this.isActive = true;\n $wnd.Vaadin.connectionState.loadingStarted();\n }\n\n loadingFinished() {\n // Make Testbench know that server request has finished\n this.isActive = false;\n $wnd.Vaadin.connectionState.loadingFinished();\n }\n\n private get action(): (params: NavigationParameters) => Promise {\n // Return a function which is bound to the flow instance, thus we can use\n // the syntax `...serverSideRoutes` in vaadin-router.\n return async (params: NavigationParameters) => {\n // Store last action pathname so as we can check it in events\n this.pathname = params.pathname;\n\n if ($wnd.Vaadin.connectionState.online) {\n try {\n await this.flowInit();\n } catch (error) {\n if (error instanceof FlowUiInitializationError) {\n // error initializing Flow: assume connection lost\n $wnd.Vaadin.connectionState.state = ConnectionState.CONNECTION_LOST;\n return this.offlineStubAction();\n } else {\n throw error;\n }\n }\n } else {\n // insert an offline stub\n return this.offlineStubAction();\n }\n\n // When an action happens, navigation will be resolved `onBeforeEnter`\n this.container.onBeforeEnter = (ctx, cmd) => this.flowNavigate(ctx, cmd);\n // For covering the 'server -> client' use case\n this.container.onBeforeLeave = (ctx, cmd) => this.flowLeave(ctx, cmd);\n return this.container;\n };\n }\n\n // Send a remote call to `JavaScriptBootstrapUI` to check\n // whether navigation has to be cancelled.\n private async flowLeave(ctx: NavigationParameters, cmd?: PreventCommands): Promise {\n // server -> server, viewing offline stub, or browser is offline\n const { connectionState } = $wnd.Vaadin;\n if (this.pathname === ctx.pathname || !this.isFlowClientLoaded() || connectionState.offline) {\n return Promise.resolve({});\n }\n // 'server -> client'\n return new Promise((resolve) => {\n this.loadingStarted();\n // The callback to run from server side to cancel navigation\n this.container.serverConnected = (cancel) => {\n resolve(cmd && cancel ? cmd.prevent() : {});\n this.loadingFinished();\n };\n\n // Call server side to check whether we can leave the view\n flowRoot.$server.leaveNavigation(this.getFlowRoutePath(ctx), this.getFlowRouteQuery(ctx));\n });\n }\n\n // Send the remote call to `JavaScriptBootstrapUI` to render the flow\n // route specified by the context\n private async flowNavigate(ctx: NavigationParameters, cmd?: PreventAndRedirectCommands): Promise {\n if (this.response) {\n return new Promise((resolve) => {\n this.loadingStarted();\n // The callback to run from server side once the view is ready\n this.container.serverConnected = (cancel, redirectContext?: NavigationParameters) => {\n if (cmd && cancel) {\n resolve(cmd.prevent());\n } else if (cmd && cmd.redirect && redirectContext) {\n resolve(cmd.redirect(redirectContext.pathname));\n } else {\n this.container.style.display = '';\n resolve(this.container);\n }\n this.loadingFinished();\n };\n\n // Call server side to navigate to the given route\n flowRoot.$server.connectClient(\n this.container.localName,\n this.container.id,\n this.getFlowRoutePath(ctx),\n this.getFlowRouteQuery(ctx),\n this.appShellTitle,\n history.state\n );\n });\n } else {\n // No server response => offline or erroneous connection\n return Promise.resolve(this.container);\n }\n }\n\n private getFlowRoutePath(context: NavigationParameters | Location): string {\n return decodeURIComponent(context.pathname).replace(this.baseRegex, '');\n }\n private getFlowRouteQuery(context: NavigationParameters | Location): string {\n return (context.search && context.search.substring(1)) || '';\n }\n\n // import flow client modules and initialize UI in server side.\n private async flowInit(serverSideRouting = false): Promise {\n // Do not start flow twice\n if (!this.isFlowClientLoaded()) {\n // show flow progress indicator\n this.loadingStarted();\n\n // Initialize server side UI\n this.response = await this.flowInitUi(serverSideRouting);\n\n // Enable or disable server side routing\n this.response.appConfig.clientRouting = !serverSideRouting;\n\n const { pushScript, appConfig } = this.response;\n\n if (typeof pushScript === 'string') {\n await this.loadScript(pushScript);\n }\n const { appId } = appConfig;\n\n // Load bootstrap script with server side parameters\n const bootstrapMod = await import('./FlowBootstrap');\n await bootstrapMod.init(this.response);\n\n // Load custom modules defined by user\n if (typeof this.config.imports === 'function') {\n this.injectAppIdScript(appId);\n await this.config.imports();\n }\n\n // Load flow-client module\n const clientMod = await import('./FlowClient');\n await this.flowInitClient(clientMod);\n\n if (!serverSideRouting) {\n // we use a custom tag for the flow app container\n const tag = `flow-container-${appId.toLowerCase()}`;\n this.container = document.createElement(tag);\n flowRoot.$[appId] = this.container;\n this.container.id = appId;\n }\n\n // hide flow progress indicator\n this.loadingFinished();\n }\n\n // It might be that components created from server expect that their content has been rendered.\n // Appending eagerly the container we avoid these kind of errors.\n // Note that the client router will move this container to the outlet if the navigation succeed\n if (this.container && !this.container.isConnected) {\n this.container.style.display = 'none';\n document.body.appendChild(this.container);\n }\n return this.response!;\n }\n\n private async loadScript(url: string): Promise {\n return new Promise((resolve, reject) => {\n const script = document.createElement('script');\n script.onload = () => resolve();\n script.onerror = reject;\n script.src = url;\n document.body.appendChild(script);\n });\n }\n\n private injectAppIdScript(appId: string) {\n const appIdWithoutHashCode = appId.substring(0, appId.lastIndexOf('-'));\n const scriptAppId = document.createElement('script');\n scriptAppId.type = 'module';\n scriptAppId.setAttribute('data-app-id', appIdWithoutHashCode);\n document.body.append(scriptAppId);\n }\n\n // After the flow-client javascript module has been loaded, this initializes flow UI\n // in the browser.\n private async flowInitClient(clientMod: any): Promise {\n clientMod.init();\n // client init is async, we need to loop until initialized\n return new Promise((resolve) => {\n const intervalId = setInterval(() => {\n // client `isActive() == true` while initializing or processing\n const initializing = Object.keys($wnd.Vaadin.Flow.clients)\n .filter((key) => key !== 'TypeScript')\n .reduce((prev, id) => prev || $wnd.Vaadin.Flow.clients[id].isActive(), false);\n if (!initializing) {\n clearInterval(intervalId);\n resolve();\n }\n }, 5);\n });\n }\n\n // Returns the `appConfig` object\n private async flowInitUi(serverSideRouting: boolean): Promise {\n // appConfig was sent in the index.html request\n const initial = $wnd.Vaadin && $wnd.Vaadin.TypeScript && $wnd.Vaadin.TypeScript.initial;\n if (initial) {\n $wnd.Vaadin.TypeScript.initial = undefined;\n return Promise.resolve(initial);\n }\n\n // send a request to the `JavaScriptBootstrapHandler`\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n const httpRequest = xhr as any;\n const serverRoutingParam = serverSideRouting ? '&serverSideRouting' : '';\n const requestPath = `?v-r=init&location=${encodeURIComponent(\n this.getFlowRoutePath(location)\n )}&query=${encodeURIComponent(this.getFlowRouteQuery(location))}${serverRoutingParam}`;\n\n httpRequest.open('GET', requestPath);\n\n httpRequest.onerror = () =>\n reject(\n new FlowUiInitializationError(\n `Invalid server response when initializing Flow UI.\n ${httpRequest.status}\n ${httpRequest.responseText}`\n )\n );\n\n httpRequest.onload = () => {\n const contentType = httpRequest.getResponseHeader('content-type');\n if (contentType && contentType.indexOf('application/json') !== -1) {\n resolve(JSON.parse(httpRequest.responseText));\n } else {\n httpRequest.onerror();\n }\n };\n httpRequest.send();\n });\n }\n\n // Create shared connection state store and connection indicator\n private addConnectionIndicator() {\n // add connection indicator to DOM\n ConnectionIndicator.create();\n\n // Listen to browser online/offline events and update the loading indicator accordingly.\n // Note: if flow-client is loaded, it instead handles the state transitions.\n $wnd.addEventListener('online', () => {\n if (!this.isFlowClientLoaded()) {\n // Send an HTTP HEAD request for sw.js to verify server reachability.\n // We do not expect sw.js to be cached, so the request goes to the\n // server rather than being served from local cache.\n // Require network-level failure to revert the state to CONNECTION_LOST\n // (HTTP error code is ok since it still verifies server's presence).\n $wnd.Vaadin.connectionState.state = ConnectionState.RECONNECTING;\n const http = new XMLHttpRequest();\n http.open('HEAD', 'sw.js');\n http.onload = () => {\n $wnd.Vaadin.connectionState.state = ConnectionState.CONNECTED;\n };\n http.onerror = () => {\n $wnd.Vaadin.connectionState.state = ConnectionState.CONNECTION_LOST;\n };\n // Postpone request to reduce potential net::ERR_INTERNET_DISCONNECTED\n // errors that sometimes occurs even if browser says it is online\n setTimeout(() => http.send(), 50);\n }\n });\n $wnd.addEventListener('offline', () => {\n if (!this.isFlowClientLoaded()) {\n $wnd.Vaadin.connectionState.state = ConnectionState.CONNECTION_LOST;\n }\n });\n }\n\n private async offlineStubAction() {\n const offlineStub = document.createElement('iframe') as HTMLRouterContainer;\n const offlineStubPath = './offline-stub.html';\n offlineStub.setAttribute('src', offlineStubPath);\n offlineStub.setAttribute('style', 'width: 100%; height: 100%; border: 0');\n this.response = undefined;\n\n let onlineListener: ConnectionStateChangeListener | undefined;\n const removeOfflineStubAndOnlineListener = () => {\n if (onlineListener !== undefined) {\n $wnd.Vaadin.connectionState.removeStateChangeListener(onlineListener);\n onlineListener = undefined;\n }\n };\n\n offlineStub.onBeforeEnter = (ctx, _cmds, router) => {\n onlineListener = () => {\n if ($wnd.Vaadin.connectionState.online) {\n removeOfflineStubAndOnlineListener();\n router.render(ctx, false);\n }\n };\n $wnd.Vaadin.connectionState.addStateChangeListener(onlineListener);\n };\n offlineStub.onBeforeLeave = (_ctx, _cmds, _router) => {\n removeOfflineStubAndOnlineListener();\n };\n return offlineStub;\n }\n\n private isFlowClientLoaded(): boolean {\n return this.response !== undefined;\n }\n}\n"]} \ No newline at end of file diff --git a/java/demo/frontend/generated/jar-resources/FlowBootstrap.d.ts b/java/demo/frontend/generated/jar-resources/FlowBootstrap.d.ts deleted file mode 100644 index 0398d5762..000000000 --- a/java/demo/frontend/generated/jar-resources/FlowBootstrap.d.ts +++ /dev/null @@ -1 +0,0 @@ -export const init: (appInitResponse: any) => void; diff --git a/java/demo/frontend/generated/jar-resources/FlowBootstrap.js b/java/demo/frontend/generated/jar-resources/FlowBootstrap.js deleted file mode 100644 index a8d948545..000000000 --- a/java/demo/frontend/generated/jar-resources/FlowBootstrap.js +++ /dev/null @@ -1,262 +0,0 @@ -/* This is a copy of the regular `BootstrapHandler.js` in the flow-server - module, but with the following modifications: - - The main function is exported as an ES module for lazy initialization. - - Application configuration is passed as a parameter instead of using - replacement placeholders as in the regular bootstrapping. - - It reuses `Vaadin.Flow.clients` if exists. - - Fixed lint errors. - */ -const init = function (appInitResponse) { - window.Vaadin = window.Vaadin || {}; - window.Vaadin.Flow = window.Vaadin.Flow || {}; - - var apps = {}; - var widgetsets = {}; - - var log; - if (typeof window.console === undefined || !window.location.search.match(/[&?]debug(&|$)/)) { - /* If no console.log present, just use a no-op */ - log = function () {}; - } else if (typeof window.console.log === 'function') { - /* If it's a function, use it with apply */ - log = function () { - window.console.log.apply(window.console, arguments); - }; - } else { - /* In IE, its a native function for which apply is not defined, but it works - without a proper 'this' reference */ - log = window.console.log; - } - - var isInitializedInDom = function (appId) { - var appDiv = document.getElementById(appId); - if (!appDiv) { - return false; - } - for (var i = 0; i < appDiv.childElementCount; i++) { - var className = appDiv.childNodes[i].className; - /* If the app div contains a child with the class - 'v-app-loading' we have only received the HTML - but not yet started the widget set - (UIConnector removes the v-app-loading div). */ - if (className && className.indexOf('v-app-loading') != -1) { - return false; - } - } - return true; - }; - - /* - * Needed for Testbench compatibility, but prevents any Vaadin 7 app from - * bootstrapping unless the legacy vaadinBootstrap.js file is loaded before - * this script. - */ - window.Vaadin = window.Vaadin || {}; - window.Vaadin.Flow = window.Vaadin.Flow || {}; - - /* - * Needed for wrapping custom javascript functionality in the components (i.e. connectors) - */ - window.Vaadin.Flow.tryCatchWrapper = function (originalFunction, component) { - return function () { - try { - // eslint-disable-next-line - const result = originalFunction.apply(this, arguments); - return result; - } catch (error) { - console.error( - `There seems to be an error in ${component}: -${error.message} -Please submit an issue to https://github.com/vaadin/flow-components/issues/new/choose` - ); - } - }; - }; - - if (!window.Vaadin.Flow.initApplication) { - window.Vaadin.Flow.clients = window.Vaadin.Flow.clients || {}; - - window.Vaadin.Flow.initApplication = function (appId, config) { - var testbenchId = appId.replace(/-\d+$/, ''); - - if (apps[appId]) { - if ( - window.Vaadin && - window.Vaadin.Flow && - window.Vaadin.Flow.clients && - window.Vaadin.Flow.clients[testbenchId] && - window.Vaadin.Flow.clients[testbenchId].initializing - ) { - throw new Error('Application ' + appId + ' is already being initialized'); - } - if (isInitializedInDom(appId)) { - throw new Error('Application ' + appId + ' already initialized'); - } - } - - log('init application', appId, config); - - window.Vaadin.Flow.clients[testbenchId] = { - isActive: function () { - return true; - }, - initializing: true, - productionMode: mode - }; - - var getConfig = function (name) { - var value = config[name]; - return value; - }; - - /* Export public data */ - var app = { - getConfig: getConfig - }; - apps[appId] = app; - - if (!window.name) { - window.name = appId + '-' + Math.random(); - } - - var widgetset = 'client'; - widgetsets[widgetset] = { - pendingApps: [] - }; - if (widgetsets[widgetset].callback) { - log('Starting from bootstrap', appId); - widgetsets[widgetset].callback(appId); - } else { - log('Setting pending startup', appId); - widgetsets[widgetset].pendingApps.push(appId); - } - - return app; - }; - window.Vaadin.Flow.getAppIds = function () { - var ids = []; - for (var id in apps) { - if (Object.prototype.hasOwnProperty.call(apps, id)) { - ids.push(id); - } - } - return ids; - }; - window.Vaadin.Flow.getApp = function (appId) { - return apps[appId]; - }; - window.Vaadin.Flow.registerWidgetset = function (widgetset, callback) { - log('Widgetset registered', widgetset); - var ws = widgetsets[widgetset]; - if (ws && ws.pendingApps) { - ws.callback = callback; - for (var i = 0; i < ws.pendingApps.length; i++) { - var appId = ws.pendingApps[i]; - log('Starting from register widgetset', appId); - callback(appId); - } - ws.pendingApps = null; - } - }; - window.Vaadin.Flow.getBrowserDetailsParameters = function () { - var params = {}; - - /* Screen height and width */ - params['v-sh'] = window.screen.height; - params['v-sw'] = window.screen.width; - /* Browser window dimensions */ - params['v-wh'] = window.innerHeight; - params['v-ww'] = window.innerWidth; - /* Body element dimensions */ - params['v-bh'] = document.body.clientHeight; - params['v-bw'] = document.body.clientWidth; - - /* Current time */ - var date = new Date(); - params['v-curdate'] = date.getTime(); - - /* Current timezone offset (including DST shift) */ - var tzo1 = date.getTimezoneOffset(); - - /* Compare the current tz offset with the first offset from the end - of the year that differs --- if less that, we are in DST, otherwise - we are in normal time */ - var dstDiff = 0; - var rawTzo = tzo1; - for (var m = 12; m > 0; m--) { - date.setUTCMonth(m); - var tzo2 = date.getTimezoneOffset(); - if (tzo1 != tzo2) { - dstDiff = tzo1 > tzo2 ? tzo1 - tzo2 : tzo2 - tzo1; - rawTzo = tzo1 > tzo2 ? tzo1 : tzo2; - break; - } - } - - /* Time zone offset */ - params['v-tzo'] = tzo1; - - /* DST difference */ - params['v-dstd'] = dstDiff; - - /* Time zone offset without DST */ - params['v-rtzo'] = rawTzo; - - /* DST in effect? */ - params['v-dston'] = tzo1 != rawTzo; - - /* Time zone id (if available) */ - try { - params['v-tzid'] = Intl.DateTimeFormat().resolvedOptions().timeZone; - } catch (err) { - params['v-tzid'] = ''; - } - - /* Window name */ - if (window.name) { - params['v-wn'] = window.name; - } - - /* Detect touch device support */ - var supportsTouch = false; - try { - document.createEvent('TouchEvent'); - supportsTouch = true; - } catch (e) { - /* Chrome and IE10 touch detection */ - supportsTouch = 'ontouchstart' in window || typeof navigator.msMaxTouchPoints !== 'undefined'; - } - params['v-td'] = supportsTouch; - - /* Device Pixel Ratio */ - params['v-pr'] = window.devicePixelRatio; - - if (navigator.platform) { - params['v-np'] = navigator.platform; - } - - /* Stringify each value (they are parsed on the server side) */ - Object.keys(params).forEach(function (key) { - var value = params[key]; - if (typeof value !== 'undefined') { - params[key] = value.toString(); - } - }); - return params; - }; - } - - log('Flow bootstrap loaded'); - if (appInitResponse.appConfig.productionMode && typeof window.__gwtStatsEvent != 'function') { - window.Vaadin.Flow.gwtStatsEvents = []; - window.__gwtStatsEvent = function (event) { - window.Vaadin.Flow.gwtStatsEvents.push(event); - return true; - }; - } - var config = appInitResponse.appConfig; - var mode = appInitResponse.appConfig.productionMode; - window.Vaadin.Flow.initApplication(config.appId, config); -}; - -export { init }; diff --git a/java/demo/frontend/generated/jar-resources/FlowClient.d.ts b/java/demo/frontend/generated/jar-resources/FlowClient.d.ts deleted file mode 100644 index 7b21f9085..000000000 --- a/java/demo/frontend/generated/jar-resources/FlowClient.d.ts +++ /dev/null @@ -1 +0,0 @@ -export const init: () => void; diff --git a/java/demo/frontend/generated/jar-resources/FlowClient.js b/java/demo/frontend/generated/jar-resources/FlowClient.js deleted file mode 100644 index d158aa3a4..000000000 --- a/java/demo/frontend/generated/jar-resources/FlowClient.js +++ /dev/null @@ -1,1101 +0,0 @@ -export function init() { -function client(){var Jb='',Kb=0,Lb='gwt.codesvr=',Mb='gwt.hosted=',Nb='gwt.hybrid',Ob='client',Pb='#',Qb='?',Rb='/',Sb=1,Tb='img',Ub='clear.cache.gif',Vb='baseUrl',Wb='script',Xb='client.nocache.js',Yb='base',Zb='//',$b='meta',_b='name',ac='gwt:property',bc='content',cc='=',dc='gwt:onPropertyErrorFn',ec='Bad handler "',fc='" for "gwt:onPropertyErrorFn"',gc='gwt:onLoadErrorFn',hc='" for "gwt:onLoadErrorFn"',ic='user.agent',jc='webkit',kc='safari',lc='msie',mc=10,nc=11,oc='ie10',pc=9,qc='ie9',rc=8,sc='ie8',tc='gecko',uc='gecko1_8',vc=2,wc=3,xc=4,yc='Single-script hosted mode not yet implemented. See issue ',zc='http://code.google.com/p/google-web-toolkit/issues/detail?id=2079',Ac='EC03A171F4D51CC301EF01449491173F',Bc=':1',Cc=':',Dc='DOMContentLoaded',Ec=50;var l=Jb,m=Kb,n=Lb,o=Mb,p=Nb,q=Ob,r=Pb,s=Qb,t=Rb,u=Sb,v=Tb,w=Ub,A=Vb,B=Wb,C=Xb,D=Yb,F=Zb,G=$b,H=_b,I=ac,J=bc,K=cc,L=dc,M=ec,N=fc,O=gc,P=hc,Q=ic,R=jc,S=kc,T=lc,U=mc,V=nc,W=oc,X=pc,Y=qc,Z=rc,$=sc,_=tc,ab=uc,bb=vc,cb=wc,db=xc,eb=yc,fb=zc,gb=Ac,hb=Bc,ib=Cc,jb=Dc,kb=Ec;var lb=window,mb=document,nb,ob,pb=l,qb={},rb=[],sb=[],tb=[],ub=m,vb,wb;if(!lb.__gwt_stylesLoaded){lb.__gwt_stylesLoaded={}}if(!lb.__gwt_scriptsLoaded){lb.__gwt_scriptsLoaded={}}function xb(){var b=false;try{var c=lb.location.search;return (c.indexOf(n)!=-1||(c.indexOf(o)!=-1||lb.external&&lb.external.gwtOnLoad))&&c.indexOf(p)==-1}catch(a){}xb=function(){return b};return b} -function yb(){if(nb&&ob){nb(vb,q,pb,ub)}} -function zb(){function e(a){var b=a.lastIndexOf(r);if(b==-1){b=a.length}var c=a.indexOf(s);if(c==-1){c=a.length}var d=a.lastIndexOf(t,Math.min(c,b));return d>=m?a.substring(m,d+u):l} -function f(a){if(a.match(/^\w+:\/\//)){}else{var b=mb.createElement(v);b.src=a+w;a=e(b.src)}return a} -function g(){var a=Cb(A);if(a!=null){return a}return l} -function h(){var a=mb.getElementsByTagName(B);for(var b=m;bm){return a[a.length-u].href}return l} -function j(){var a=mb.location;return a.href==a.protocol+F+a.host+a.pathname+a.search+a.hash} -var k=g();if(k==l){k=h()}if(k==l){k=i()}if(k==l&&j()){k=e(mb.location.href)}k=f(k);return k} -function Ab(){var b=document.getElementsByTagName(G);for(var c=m,d=b.length;c=m){f=g.substring(m,i);h=g.substring(i+u)}else{f=g;h=l}qb[f]=h}}else if(f==L){g=e.getAttribute(J);if(g){try{wb=eval(g)}catch(a){alert(M+g+N)}}}else if(f==O){g=e.getAttribute(J);if(g){try{vb=eval(g)}catch(a){alert(M+g+P)}}}}}} -var Bb=function(a,b){return b in rb[a]};var Cb=function(a){var b=qb[a];return b==null?null:b};function Db(a,b){var c=tb;for(var d=m,e=a.length-u;d=U&&b=X&&b=Z&&b=V}())return ab;return S};rb[Q]={'gecko1_8':m,'ie10':u,'ie8':bb,'ie9':cb,'safari':db};client.onScriptLoad=function(a){client=null;nb=a;yb()};if(xb()){alert(eb+fb);return}zb();Ab();try{var Fb;Db([ab],gb);Db([S],gb+hb);Fb=tb[Eb(Q)];var Gb=Fb.indexOf(ib);if(Gb!=-1){ub=Number(Fb.substring(Gb+u))}}catch(a){return}var Hb;function Ib(){if(!ob){ob=true;yb();if(mb.removeEventListener){mb.removeEventListener(jb,Ib,false)}if(Hb){clearInterval(Hb)}}} -if(mb.addEventListener){mb.addEventListener(jb,function(){Ib()},false)}var Hb=setInterval(function(){if(/loaded|complete/.test(mb.readyState)){Ib()}},kb)} -client();(function () {var $gwt_version = "2.9.0";var $wnd = window;var $doc = $wnd.document;var $moduleName, $moduleBase;var $stats = $wnd.__gwtStatsEvent ? function(a) {$wnd.__gwtStatsEvent(a)} : null;var $strongName = 'EC03A171F4D51CC301EF01449491173F';function I(){} -function Ik(){} -function Ek(){} -function Gk(){} -function fj(){} -function bj(){} -function lj(){} -function Pj(){} -function Yj(){} -function nc(){} -function uc(){} -function ul(){} -function zl(){} -function El(){} -function Gl(){} -function Ql(){} -function Qo(){} -function Zo(){} -function Zm(){} -function _m(){} -function bn(){} -function Ln(){} -function Nn(){} -function Nt(){} -function Gt(){} -function Kt(){} -function Jq(){} -function Pr(){} -function Rr(){} -function Tr(){} -function Vr(){} -function ts(){} -function xs(){} -function hu(){} -function Yu(){} -function bw(){} -function fw(){} -function uw(){} -function uE(){} -function dy(){} -function Dy(){} -function Fy(){} -function rz(){} -function vz(){} -function CA(){} -function kB(){} -function qC(){} -function _F(){} -function eH(){} -function pH(){} -function rH(){} -function tH(){} -function KH(){} -function hA(){eA()} -function T(a){S=a;Jb()} -function zj(a,b){a.b=b} -function Bj(a,b){a.d=b} -function Cj(a,b){a.e=b} -function Dj(a,b){a.f=b} -function Ej(a,b){a.g=b} -function Fj(a,b){a.h=b} -function Gj(a,b){a.i=b} -function Ij(a,b){a.k=b} -function Jj(a,b){a.l=b} -function Kj(a,b){a.m=b} -function Lj(a,b){a.n=b} -function Mj(a,b){a.o=b} -function Nj(a,b){a.p=b} -function Oj(a,b){a.q=b} -function ns(a,b){a.g=b} -function qu(a,b){a.b=b} -function JH(a,b){a.a=b} -function bc(a){this.a=a} -function dc(a){this.a=a} -function pk(a){this.a=a} -function rk(a){this.a=a} -function sl(a){this.a=a} -function xl(a){this.a=a} -function Cl(a){this.a=a} -function Kl(a){this.a=a} -function Ml(a){this.a=a} -function Ol(a){this.a=a} -function Sl(a){this.a=a} -function Ul(a){this.a=a} -function xm(a){this.a=a} -function dn(a){this.a=a} -function hn(a){this.a=a} -function un(a){this.a=a} -function Bn(a){this.a=a} -function Dn(a){this.a=a} -function Fn(a){this.a=a} -function Pn(a){this.a=a} -function An(a){this.c=a} -function lo(a){this.a=a} -function oo(a){this.a=a} -function po(a){this.a=a} -function vo(a){this.a=a} -function Bo(a){this.a=a} -function Lo(a){this.a=a} -function No(a){this.a=a} -function So(a){this.a=a} -function Uo(a){this.a=a} -function Wo(a){this.a=a} -function $o(a){this.a=a} -function ep(a){this.a=a} -function yp(a){this.a=a} -function Qp(a){this.a=a} -function sq(a){this.a=a} -function Hq(a){this.a=a} -function Lq(a){this.a=a} -function Nq(a){this.a=a} -function zq(a){this.b=a} -function zs(a){this.a=a} -function Gs(a){this.a=a} -function Is(a){this.a=a} -function Us(a){this.a=a} -function Ys(a){this.a=a} -function ur(a){this.a=a} -function wr(a){this.a=a} -function yr(a){this.a=a} -function Hr(a){this.a=a} -function Kr(a){this.a=a} -function ft(a){this.a=a} -function nt(a){this.a=a} -function pt(a){this.a=a} -function rt(a){this.a=a} -function tt(a){this.a=a} -function vt(a){this.a=a} -function wt(a){this.a=a} -function Et(a){this.a=a} -function Yt(a){this.a=a} -function fu(a){this.a=a} -function ju(a){this.a=a} -function uu(a){this.a=a} -function wu(a){this.a=a} -function Ku(a){this.a=a} -function Qu(a){this.a=a} -function Wu(a){this.a=a} -function ru(a){this.c=a} -function Ts(a){this.c=a} -function fv(a){this.a=a} -function hv(a){this.a=a} -function Bv(a){this.a=a} -function Fv(a){this.a=a} -function Fw(a){this.a=a} -function dw(a){this.a=a} -function Gw(a){this.a=a} -function Iw(a){this.a=a} -function Mw(a){this.a=a} -function Ow(a){this.a=a} -function Tw(a){this.a=a} -function Jy(a){this.a=a} -function Ly(a){this.a=a} -function Zy(a){this.a=a} -function Iy(a){this.b=a} -function bz(a){this.a=a} -function fz(a){this.a=a} -function tz(a){this.a=a} -function zz(a){this.a=a} -function Bz(a){this.a=a} -function Fz(a){this.a=a} -function Mz(a){this.a=a} -function Oz(a){this.a=a} -function Qz(a){this.a=a} -function Sz(a){this.a=a} -function Uz(a){this.a=a} -function _z(a){this.a=a} -function bA(a){this.a=a} -function tA(a){this.a=a} -function wA(a){this.a=a} -function EA(a){this.a=a} -function GA(a){this.e=a} -function iB(a){this.a=a} -function mB(a){this.a=a} -function oB(a){this.a=a} -function KB(a){this.a=a} -function ZB(a){this.a=a} -function _B(a){this.a=a} -function bC(a){this.a=a} -function mC(a){this.a=a} -function oC(a){this.a=a} -function EC(a){this.a=a} -function dD(a){this.a=a} -function qE(a){this.a=a} -function sE(a){this.a=a} -function vE(a){this.a=a} -function lF(a){this.a=a} -function JG(a){this.a=a} -function jG(a){this.b=a} -function wG(a){this.c=a} -function NH(a){this.a=a} -function kk(a){throw a} -function Ui(a){return a.e} -function UA(a,b){Wv(b,a)} -function Ix(a,b){_x(b,a)} -function Ox(a,b){$x(b,a)} -function Sx(a,b){Ex(b,a)} -function yv(a,b){b.kb(a)} -function XD(b,a){b.log(a)} -function YD(b,a){b.warn(a)} -function RD(b,a){b.data=a} -function At(a,b){NC(a.a,b)} -function BC(a){bB(a.a,a.b)} -function R(){this.a=xb()} -function wj(){this.a=++vj} -function Yk(){this.d=null} -function gj(){Hp();Lp()} -function Hp(){Hp=bj;Gp=[]} -function eA(){eA=bj;dA=rA()} -function kb(){ab.call(this)} -function BE(){ab.call(this)} -function zE(){kb.call(this)} -function sF(){kb.call(this)} -function DG(){kb.call(this)} -function Zp(a,b){a.push(b)} -function Z(a,b){a.e=b;W(a,b)} -function Hj(a,b){a.j=b;gk=!b} -function VD(b,a){b.debug(a)} -function WD(b,a){b.error(a)} -function Zr(a){a.i||$r(a.a)} -function Yb(a){return a.H()} -function Ym(a){return Dm(a)} -function Q(a){return xb()-a.a} -function hc(a){gc();fc.J(a)} -function Ns(a){Ms(a)&&Qs(a)} -function mk(a){S=a;!!a&&Jb()} -function pm(a,b){a.a.add(b.d)} -function Wm(a,b,c){a.set(b,c)} -function cB(a,b,c){a.Ub(c,b)} -function om(a,b,c){jm(a,c,b)} -function ty(a,b){b.forEach(a)} -function _D(b,a){b.replace(a)} -function MD(b,a){b.display=a} -function ol(a){fl();this.a=a} -function fB(a){eB.call(this,a)} -function HB(a){eB.call(this,a)} -function WB(a){eB.call(this,a)} -function pE(a){lb.call(this,a)} -function xE(a){lb.call(this,a)} -function yE(a){xE.call(this,a)} -function jF(a){lb.call(this,a)} -function kF(a){lb.call(this,a)} -function tF(a){nb.call(this,a)} -function uF(a){lb.call(this,a)} -function wF(a){jF.call(this,a)} -function UF(){vE.call(this,'')} -function VF(){vE.call(this,'')} -function XF(a){xE.call(this,a)} -function bG(a){lb.call(this,a)} -function GE(a){return WH(a),a} -function gF(a){return WH(a),a} -function Wc(a,b){return $c(a,b)} -function nE(b,a){return a in b} -function LE(a){KE(a);return a.i} -function Wz(a){Ux(a.b,a.a,a.c)} -function EH(a,b,c){b.ib($F(c))} -function Zn(a,b){a.d?_n(b):pl()} -function lv(a,b){a.c.forEach(b)} -function xc(a,b){return UE(a,b)} -function rr(a,b){return a.a>b.a} -function $F(a){return Ic(a,5).e} -function mE(a){return Object(a)} -function ml(a,b){++el;b.eb(a,bl)} -function Rm(a,b){wC(new sn(b,a))} -function Lx(a,b){wC(new _y(b,a))} -function Mx(a,b){wC(new dz(b,a))} -function py(a,b,c){kC(fy(a,c,b))} -function ZG(a,b,c){b.ib(a.a[c])} -function OG(a,b){while(a.mc(b));} -function oH(a,b){Ic(a,106).dc(b)} -function yH(a,b){uH(a);a.a.lc(b)} -function iC(a,b){a.e||a.c.add(b)} -function hj(b,a){return b.exec(a)} -function pb(){pb=bj;ob=new I} -function Qb(){Qb=bj;Pb=new Zo} -function au(){au=bj;_t=new hu} -function LA(){LA=bj;KA=new kB} -function ZF(){ZF=bj;YF=new uE} -function Db(){Db=bj;!!(gc(),fc)} -function Xi(){Vi==null&&(Vi=[])} -function cF(){lb.call(this,null)} -function Ob(){yb!=0&&(yb=0);Cb=-1} -function Cu(){this.a=new $wnd.Map} -function UC(){this.c=new $wnd.Map} -function PA(a){dB(a.a);return a.g} -function TA(a){dB(a.a);return a.c} -function MA(a,b){return $A(a.a,b)} -function MB(a,b){return $A(a.a,b)} -function yB(a,b){return $A(a.a,b)} -function sy(a,b){return Wl(a.b,b)} -function gm(a,b){return Nc(a.b[b])} -function Qx(a,b){return qx(b.a,a)} -function Ub(a){return !!a.b||!!a.g} -function $j(a,b){this.b=a;this.a=b} -function fn(a,b){this.b=a;this.a=b} -function kn(a,b){this.a=a;this.b=b} -function mn(a,b){this.a=a;this.b=b} -function on(a,b){this.a=a;this.b=b} -function qn(a,b){this.a=a;this.b=b} -function sn(a,b){this.a=a;this.b=b} -function so(a,b){this.a=a;this.b=b} -function Il(a,b){this.a=a;this.b=b} -function cm(a,b){this.a=a;this.b=b} -function em(a,b){this.a=a;this.b=b} -function tm(a,b){this.a=a;this.b=b} -function vm(a,b){this.a=a;this.b=b} -function Cs(a,b){this.a=a;this.b=b} -function Es(a,b){this.a=a;this.b=b} -function xo(a,b){this.b=a;this.a=b} -function zo(a,b){this.b=a;this.a=b} -function Xr(a,b){this.b=a;this.a=b} -function yu(a,b){this.b=a;this.a=b} -function ip(a,b){this.b=a;this.c=b} -function Mu(a,b){this.a=a;this.b=b} -function Ou(a,b){this.a=a;this.b=b} -function zv(a,b){this.a=a;this.b=b} -function Dv(a,b){this.a=a;this.b=b} -function Hv(a,b){this.a=a;this.b=b} -function Ny(a,b){this.b=a;this.a=b} -function Py(a,b){this.b=a;this.a=b} -function Vy(a,b){this.b=a;this.a=b} -function _y(a,b){this.b=a;this.a=b} -function dz(a,b){this.b=a;this.a=b} -function nz(a,b){this.a=a;this.b=b} -function pz(a,b){this.a=a;this.b=b} -function Hz(a,b){this.a=a;this.b=b} -function Zz(a,b){this.a=a;this.b=b} -function lA(a,b){this.a=a;this.b=b} -function qB(a,b){this.a=a;this.b=b} -function xB(a,b){this.d=a;this.e=b} -function nA(a,b){this.b=a;this.a=b} -function dC(a,b){this.a=a;this.b=b} -function CC(a,b){this.a=a;this.b=b} -function FC(a,b){this.a=a;this.b=b} -function Fq(a,b){ip.call(this,a,b)} -function sp(a,b){ip.call(this,a,b)} -function vD(a,b){ip.call(this,a,b)} -function DD(a,b){ip.call(this,a,b)} -function lH(a,b){ip.call(this,a,b)} -function nH(a,b){this.a=a;this.b=b} -function HH(a,b){this.a=a;this.b=b} -function OH(a,b){this.b=a;this.a=b} -function bE(c,a,b){c.setItem(a,b)} -function QH(a,b,c){a.splice(b,0,c)} -function Rt(a,b,c,d){Qt(a,b.d,c,d)} -function Kx(a,b,c){Yx(a,b);zx(c.e)} -function _q(a,b){Tq(a,(qr(),or),b)} -function VC(a){OC(a.a,a.d,a.c,a.b)} -function Nb(a){$wnd.clearTimeout(a)} -function nj(a){$wnd.clearTimeout(a)} -function dE(b,a){b.clearTimeout(a)} -function cE(b,a){b.clearInterval(a)} -function dx(b,a){Yw();delete b[a]} -function gA(a,b){lC(b);dA.delete(a)} -function LF(a,b){return a.substr(b)} -function xp(a,b){return vp(b,wp(a))} -function hF(a){return ad((WH(a),a))} -function Yc(a){return typeof a===mI} -function H(a,b){return _c(a)===_c(b)} -function _c(a){return a==null?null:a} -function bd(a){ZH(a==null);return a} -function pA(a){a.length=0;return a} -function RF(a,b){a.a+=''+b;return a} -function SF(a,b){a.a+=''+b;return a} -function TF(a,b){a.a+=''+b;return a} -function CH(a,b,c){oH(b,c);return b} -function gr(a,b){Tq(a,(qr(),pr),b.a)} -function nm(a,b){return a.a.has(b.d)} -function EF(a,b){return a.indexOf(b)} -function aE(b,a){return b.getItem(a)} -function jE(a){return a&&a.valueOf()} -function lE(a){return a&&a.valueOf()} -function FG(a){return a!=null?O(a):0} -function mj(a){$wnd.clearInterval(a)} -function U(a){a.h=zc(mi,pI,31,0,0,1)} -function hk(a){gk&&VD($wnd.console,a)} -function jk(a){gk&&WD($wnd.console,a)} -function nk(a){gk&&XD($wnd.console,a)} -function ok(a){gk&&YD($wnd.console,a)} -function Fo(a){gk&&WD($wnd.console,a)} -function Fr(a){this.a=a;lj.call(this)} -function vs(a){this.a=a;lj.call(this)} -function dt(a){this.a=a;lj.call(this)} -function Dt(a){this.a=new UC;this.c=a} -function ww(){ww=bj;vw=new $wnd.Map} -function Yw(){Yw=bj;Xw=new $wnd.Map} -function HG(){HG=bj;GG=new JG(null)} -function FE(){FE=bj;DE=false;EE=true} -function Xq(a){!!a.b&&er(a,(qr(),nr))} -function ar(a){!!a.b&&er(a,(qr(),or))} -function jr(a){!!a.b&&er(a,(qr(),pr))} -function jl(a){Yo((Qb(),Pb),new Ol(a))} -function bm(a,b){Ic(tk(a,ze),29).ab(b)} -function bB(a,b){return a.a.delete(b)} -function qv(a,b){return a.h.delete(b)} -function sv(a,b){return a.b.delete(b)} -function qy(a,b,c){return fy(a,c.a,b)} -function MH(a,b,c){return CH(a.a,b,c)} -function DH(a,b,c){JH(a,MH(b,a.a,c))} -function Px(a,b){var c;c=qx(b,a);kC(c)} -function ry(a,b){return Jm(a.b.root,b)} -function rA(){return new $wnd.WeakMap} -function QF(a){return a==null?sI:ej(a)} -function as(a){return xJ in a?a[xJ]:-1} -function is(a){Yo((Qb(),Pb),new Is(a))} -function xn(a){Yo((Qb(),Pb),new Fn(a))} -function Pp(a){Yo((Qb(),Pb),new Qp(a))} -function cq(a){Yo((Qb(),Pb),new sq(a))} -function wy(a){Yo((Qb(),Pb),new Uz(a))} -function WF(a){vE.call(this,(WH(a),a))} -function ab(){U(this);V(this);this.F()} -function qG(){this.a=zc(ji,pI,1,0,5,1)} -function fI(){fI=bj;cI=new I;eI=new I} -function TH(a){if(!a){throw Ui(new zE)}} -function UH(a){if(!a){throw Ui(new DG)}} -function ZH(a){if(!a){throw Ui(new cF)}} -function at(a){if(a.a){ij(a.a);a.a=null}} -function AB(a,b){dB(a.a);a.c.forEach(b)} -function NB(a,b){dB(a.a);a.b.forEach(b)} -function jC(a){if(a.d||a.e){return}hC(a)} -function OD(a,b,c,d){return GD(a,b,c,d)} -function FF(a,b,c){return a.indexOf(b,c)} -function GF(a,b){return a.lastIndexOf(b)} -function PD(a,b){return a.appendChild(b)} -function QD(b,a){return b.appendChild(a)} -function IG(a,b){return a.a!=null?a.a:b} -function Sc(a,b){return a!=null&&Hc(a,b)} -function tb(a){return a==null?null:a.name} -function bI(a){return a.$H||(a.$H=++aI)} -function Jn(a){return ''+Kn(Hn.pb()-a,3)} -function Uc(a){return typeof a==='number'} -function Xc(a){return typeof a==='string'} -function MF(a,b,c){return a.substr(b,c-b)} -function ql(a,b,c){fl();return a.set(c,b)} -function ZD(d,a,b,c){d.pushState(a,b,c)} -function ND(d,a,b,c){d.setProperty(a,b,c)} -function Zu(a,b){GD(b,kJ,new fv(a),false)} -function $s(a,b){b.a.b==(rp(),qp)&&at(a)} -function KE(a){if(a.i!=null){return}YE(a)} -function Kc(a){ZH(a==null||Uc(a));return a} -function Jc(a){ZH(a==null||Tc(a));return a} -function Lc(a){ZH(a==null||Yc(a));return a} -function Pc(a){ZH(a==null||Xc(a));return a} -function rl(a){fl();el==0?a.I():dl.push(a)} -function Pk(a){a.f=[];a.g=[];a.a=0;a.b=xb()} -function dB(a){var b;b=sC;!!b&&fC(b,a.b)} -function hp(a){return a.b!=null?a.b:''+a.c} -function Tc(a){return typeof a==='boolean'} -function SD(b,a){return b.createElement(a)} -function kc(a){gc();return parseInt(a)||-1} -function $D(d,a,b,c){d.replaceState(a,b,c)} -function Jz(a,b){uy(a.a,a.c,a.d,a.b,Pc(b))} -function Ho(a,b){Io(a,b,Ic(tk(a.a,ud),9).n)} -function sB(a,b){GA.call(this,a);this.a=b} -function BH(a,b){wH.call(this,a);this.a=b} -function eB(a){this.a=new $wnd.Set;this.b=a} -function im(){this.a=new $wnd.Map;this.b=[]} -function wC(a){tC==null&&(tC=[]);tC.push(a)} -function xC(a){vC==null&&(vC=[]);vC.push(a)} -function sb(a){return a==null?null:a.message} -function $c(a,b){return a&&b&&a instanceof b} -function HF(a,b,c){return a.lastIndexOf(b,c)} -function qj(a,b){return $wnd.setInterval(a,b)} -function rj(a,b){return $wnd.setTimeout(a,b)} -function HE(a,b){return WH(a),_c(a)===_c(b)} -function CF(a,b){return WH(a),_c(a)===_c(b)} -function Eb(a,b,c){return a.apply(b,c);var d} -function Xb(a,b){a.b=Zb(a.b,[b,false]);Vb(a)} -function Ar(a,b){b.a.b==(rp(),qp)&&Dr(a,-1)} -function cp(){this.b=(rp(),op);this.a=new UC} -function Do(a,b,c){this.a=a;this.b=b;this.c=c} -function uq(a,b,c){this.a=a;this.c=b;this.b=c} -function zw(a,b,c){this.a=a;this.c=b;this.g=c} -function Vw(a,b,c){this.b=a;this.a=b;this.c=c} -function Ty(a,b,c){this.b=a;this.c=b;this.a=c} -function Ry(a,b,c){this.c=a;this.b=b;this.a=c} -function Xy(a,b,c){this.a=a;this.b=b;this.c=c} -function hz(a,b,c){this.a=a;this.b=b;this.c=c} -function jz(a,b,c){this.a=a;this.b=b;this.c=c} -function lz(a,b,c){this.a=a;this.b=b;this.c=c} -function xz(a,b,c){this.c=a;this.b=b;this.a=c} -function Dz(a,b,c){this.b=a;this.a=b;this.c=c} -function Xz(a,b,c){this.b=a;this.a=b;this.c=c} -function sr(a,b,c){ip.call(this,a,b);this.a=c} -function Nr(a,b,c){a.ib(pF(QA(Ic(c.e,14),b)))} -function mt(a,b,c){a.set(c,(dB(b.a),Pc(b.g)))} -function xk(a,b,c){wk(a,b,c._());a.b.set(b,c)} -function Ic(a,b){ZH(a==null||Hc(a,b));return a} -function Oc(a,b){ZH(a==null||$c(a,b));return a} -function gE(a){if(a==null){return 0}return +a} -function jv(a,b){a.b.add(b);return new Hv(a,b)} -function kv(a,b){a.h.add(b);return new Dv(a,b)} -function WA(a,b){a.d=true;NA(a,b);xC(new mB(a))} -function lC(a){a.e=true;hC(a);a.c.clear();gC(a)} -function Bw(a){a.b?cE($wnd,a.c):dE($wnd,a.c)} -function MG(a){HG();return !a?GG:new JG(WH(a))} -function oj(a,b){return jI(function(){a.M(b)})} -function Qw(a,b){return Rw(new Tw(a),b,19,true)} -function sm(a,b,c){return a.set(c,(dB(b.a),b.g))} -function LD(b,a){return b.getPropertyValue(a)} -function Kp(a){return $wnd.Vaadin.Flow.getApp(a)} -function lb(a){U(this);this.g=a;V(this);this.F()} -function eu(a){au();this.c=[];this.a=_t;this.d=a} -function ou(a,b){this.a=a;this.b=b;lj.call(this)} -function lr(a,b){this.a=a;this.b=b;lj.call(this)} -function mG(a,b){a.a[a.a.length]=b;return true} -function nG(a,b){VH(b,a.a.length);return a.a[b]} -function RE(a,b){var c;c=OE(a,b);c.e=2;return c} -function Ws(a,b){var c;c=ad(gF(Kc(b.a)));_s(a,c)} -function MC(a,b,c,d){var e;e=QC(a,b,c);e.push(d)} -function KC(a,b){a.a==null&&(a.a=[]);a.a.push(b)} -function uk(a,b,c){a.a.delete(c);a.a.set(c,b._())} -function JD(a,b,c,d){a.removeEventListener(b,c,d)} -function KD(b,a){return b.getPropertyPriority(a)} -function Bc(a){return Array.isArray(a)&&a.pc===fj} -function Rc(a){return !Array.isArray(a)&&a.pc===fj} -function Vc(a){return a!=null&&Zc(a)&&!(a.pc===fj)} -function BG(a){return new BH(null,AG(a,a.length))} -function AG(a,b){return PG(b,a.length),new $G(a,b)} -function nl(a){++el;Zn(Ic(tk(a.a,we),57),new Gl)} -function Su(a){a.a=yt(Ic(tk(a.d,Gf),13),new Wu(a))} -function sj(a){a.onreadystatechange=function(){}} -function ik(a){$wnd.setTimeout(function(){a.N()},0)} -function Lv(a,b){var c;c=b;return Ic(a.a.get(c),6)} -function PE(a,b,c){var d;d=OE(a,b);aF(c,d);return d} -function OE(a,b){var c;c=new ME;c.f=a;c.d=b;return c} -function Zb(a,b){!a&&(a=[]);a[a.length]=b;return a} -function fl(){fl=bj;dl=[];bl=new ul;cl=new zl} -function rF(){rF=bj;qF=zc(ei,pI,27,256,0,1)} -function iI(){if(dI==256){cI=eI;eI=new I;dI=0}++dI} -function WH(a){if(a==null){throw Ui(new sF)}return a} -function Mc(a){ZH(a==null||Array.isArray(a));return a} -function zx(a){var b;b=a.a;tv(a,null);tv(a,b);tw(a)} -function UG(a,b){WH(b);while(a.c=0){a.a=new dt(a);kj(a.a,b)}} -function wH(a){if(!a){this.b=null;new qG}else{this.b=a}} -function Kz(a,b,c,d){this.a=a;this.c=b;this.d=c;this.b=d} -function ZC(a,b,c,d){this.a=a;this.d=b;this.c=c;this.b=d} -function As(a,b,c,d){this.a=a;this.d=b;this.b=c;this.c=d} -function TD(a,b,c,d){this.b=a;this.c=b;this.a=c;this.d=d} -function $G(a,b){this.c=0;this.d=b;this.b=17488;this.a=a} -function bt(a){this.b=a;ap(Ic(tk(a,Ke),11),new ft(this))} -function Ut(a,b){var c;c=Ic(tk(a.a,Of),36);bu(c,b);du(c)} -function Tv(a,b,c,d){Ov(a,b)&&Rt(Ic(tk(a.c,Kf),28),b,c,d)} -function Sq(a,b){Jo(Ic(tk(a.c,Fe),22),'',b,'',null,null)} -function Io(a,b,c){Jo(a,c.caption,c.message,b,c.url,null)} -function Cc(a,b,c){TH(c==null||wc(a,c));return a[b]=c} -function Nc(a){ZH(a==null||Zc(a)&&!(a.pc===fj));return a} -function V(a){if(a.j){a.e!==qI&&a.F();a.h=null}return a} -function WC(a,b,c){this.a=a;this.d=b;this.c=null;this.b=c} -function XC(a,b,c){this.a=a;this.d=b;this.c=null;this.b=c} -function zC(a,b){var c;c=sC;sC=a;try{b.I()}finally{sC=c}} -function $(a,b){var c;c=LE(a.nc);return b==null?c:c+': '+b} -function BF(a,b){YH(b,a.length);return a.charCodeAt(b)} -function Xm(a,b,c,d,e){a.splice.apply(a,[b,c,d].concat(e))} -function Mk(a,b,c){Xk(Dc(xc(cd,1),pI,90,15,[b,c]));VC(a.e)} -function tp(){rp();return Dc(xc(Je,1),pI,60,0,[op,pp,qp])} -function tr(){qr();return Dc(xc(Xe,1),pI,63,0,[nr,or,pr])} -function ED(){CD();return Dc(xc(Ih,1),pI,43,0,[AD,zD,BD])} -function mH(){kH();return Dc(xc(Gi,1),pI,48,0,[hH,iH,jH])} -function xH(a,b){var c;return AH(a,new qG,(c=new NH(b),c))} -function XH(a,b){if(a<0||a>b){throw Ui(new xE(tK+a+uK+b))}} -function Kw(a,b){vA(b).forEach(cj(Ow.prototype.ib,Ow,[a]))} -function rv(a,b){_c(b.U(a))===_c((FE(),EE))&&a.b.delete(b)} -function ho(a,b,c){this.a=a;this.c=b;this.b=c;lj.call(this)} -function jo(a,b,c){this.a=a;this.c=b;this.b=c;lj.call(this)} -function fo(a,b,c){this.b=a;this.d=b;this.c=c;this.a=new R} -function fE(c,a,b){return c.setTimeout(jI(a.Yb).bind(a),b)} -function eE(c,a,b){return c.setInterval(jI(a.Yb).bind(a),b)} -function Qc(a){return a.nc||Array.isArray(a)&&xc(fd,1)||fd} -function BA(a){if(!zA){return a}return $wnd.Polymer.dom(a)} -function WE(a){if(a.cc()){return null}var b=a.h;return $i[b]} -function Km(a){var b;b=a.f;while(!!b&&!b.a){b=b.f}return b} -function gc(){gc=bj;var a,b;b=!mc();a=new uc;fc=b?new nc:a} -function ID(a,b){Rc(a)?a.nb(b):(a.handleEvent(b),undefined)} -function VH(a,b){if(a<0||a>=b){throw Ui(new xE(tK+a+uK+b))}} -function YH(a,b){if(a<0||a>=b){throw Ui(new XF(tK+a+uK+b))}} -function Or(a){ek('applyDefaultTheme',(FE(),a?true:false))} -function $r(a){a&&a.afterServerUpdate&&a.afterServerUpdate()} -function hq(a){$wnd.vaadinPush.atmosphere.unsubscribeUrl(a)} -function Tx(a,b,c){return a.push(OA(OB(ov(b.e,1),c),b.b[c]))} -function yA(a,b,c,d){return a.splice.apply(a,[b,c].concat(d))} -function OC(a,b,c,d){a.b>0?KC(a,new ZC(a,b,c,d)):PC(a,b,c,d)} -function NA(a,b){if(!a.b&&a.c&&EG(b,a.g)){return}XA(a,b,true)} -function cu(a){a.a=_t;if(!a.b){return}Qs(Ic(tk(a.d,uf),19))} -function UE(a,b){var c=a.a=a.a||[];return c[b]||(c[b]=a.Zb(b))} -function Hw(a,b){vA(b).forEach(cj(Mw.prototype.ib,Mw,[a.a]))} -function dj(a){function b(){} -;b.prototype=a||{};return new b} -function QE(a,b,c,d){var e;e=OE(a,b);aF(c,e);e.e=d?8:0;return e} -function Lk(a){var b;b={};b[GI]=mE(a.a);b[HI]=mE(a.b);return b} -function AC(a){this.a=a;this.b=[];this.c=new $wnd.Set;hC(this)} -function AE(a,b){U(this);this.f=b;this.g=a;V(this);this.F()} -function rb(a){pb();nb.call(this,a);this.a='';this.b=a;this.a=''} -function Cp(a){a?($wnd.location=a):$wnd.location.reload(false)} -function jq(){return $wnd.vaadinPush&&$wnd.vaadinPush.atmosphere} -function xq(a,b,c){return MF(a.b,b,$wnd.Math.min(a.b.length,c))} -function aD(a,b,c,d){return cD(new $wnd.XMLHttpRequest,a,b,c,d)} -function wD(){uD();return Dc(xc(Hh,1),pI,44,0,[tD,rD,sD,qD])} -function Gq(){Eq();return Dc(xc(Qe,1),pI,52,0,[Bq,Aq,Dq,Cq])} -function hD(a){if(a.length>2){lD(a[0],'OS major');lD(a[1],hK)}} -function VA(a){if(a.c){a.d=true;XA(a,null,false);xC(new oB(a))}} -function vG(a){UH(a.a-1} -function ad(a){return Math.max(Math.min(a,2147483647),-2147483648)|0} -function yD(){yD=bj;xD=jp((uD(),Dc(xc(Hh,1),pI,44,0,[tD,rD,sD,qD])))} -function Zq(a){Dr(Ic(tk(a.c,df),56),Ic(tk(a.c,ud),9).f);Tq(a,(qr(),nr),null)} -function M(a){return Xc(a)?pi:Uc(a)?Zh:Tc(a)?Wh:Rc(a)?a.nc:Bc(a)?a.nc:Qc(a)} -function RH(a,b){return yc(b)!=10&&Dc(M(b),b.oc,b.__elementTypeId$,yc(b),a),a} -function Ep(a,b,c){c==null?BA(a).removeAttribute(b):BA(a).setAttribute(b,c)} -function PC(a,b,c,d){var e,f;e=RC(a,b,c);f=qA(e,d);f&&e.length==0&&TC(a,b,c)} -function hw(a,b){var c,d,e;e=ad(lE(a[SJ]));d=ov(b,e);c=a['key'];return OB(d,c)} -function AH(a,b,c){var d;uH(a);d=new KH;d.a=b;a.a.lc(new OH(d,c));return d.a} -function zc(a,b,c,d,e,f){var g;g=Ac(e,d);e!=10&&Dc(xc(a,f),b,c,e,g);return g} -function CB(a,b,c,d){var e,f;e=d;f=yA(a.c,b,c,e);aB(a.a,new IA(a,b,f,d,false))} -function pv(a,b,c,d){var e;e=c.Xb();!!e&&(b[Kv(a.g,ad((WH(d),d)))]=e,undefined)} -function oG(a,b,c){for(;ca||a>b){throw Ui(new yE('fromIndex: 0, toIndex: '+a+', length: '+b))}} -function xF(a,b,c){if(a==null){debugger;throw Ui(new BE)}this.a=yI;this.d=a;this.b=b;this.c=c} -function Vv(a,b,c,d,e){if(!Jv(a,b)){debugger;throw Ui(new BE)}Tt(Ic(tk(a.c,Kf),28),b,c,d,e)} -function Uv(a,b,c,d,e,f){if(!Jv(a,b)){debugger;throw Ui(new BE)}St(Ic(tk(a.c,Kf),28),b,c,d,e,f)} -function Hx(a,b,c,d){var e,f,g;g=c[LJ];e="path='"+wb(g)+"'";f=new nz(a,g);yx(a,b,d,f,null,e)} -function Qv(a,b){var c;if(b!=a.e){c=b.a;!!c&&(Yw(),!!c[RJ])&&cx((Yw(),c[RJ]));Yv(a,b);b.f=null}} -function Xx(a,b){var c;c=Ic(b.d.get(a),45);b.d.delete(a);if(!c){debugger;throw Ui(new BE)}c.Jb()} -function rx(a,b,c,d){var e;e=ov(d,a);NB(e,cj(Ny.prototype.eb,Ny,[b,c]));return MB(e,new Py(b,c))} -function Vp(c,a){var b=c.getConfig(a);if(b===null||b===undefined){return null}else{return b+''}} -function Up(c,a){var b=c.getConfig(a);if(b===null||b===undefined){return null}else{return pF(b)}} -function nu(b){if(b.readyState!=1){return false}try{b.send();return true}catch(a){return false}} -function du(a){if(_t!=a.a||a.c.length==0){return}a.b=true;a.a=new fu(a);Yo((Qb(),Pb),new ju(a))} -function Vb(a){if(!a.i){a.i=true;!a.f&&(a.f=new bc(a));_b(a.f,1);!a.h&&(a.h=new dc(a));_b(a.h,50)}} -function Sj(a,b){if(!b){Ns(Ic(tk(a.a,uf),19))}else{Ct(Ic(tk(a.a,Gf),13));ds(Ic(tk(a.a,sf),20),b)}} -function $q(a,b,c){_p(b)&&zt(Ic(tk(a.c,Gf),13));dr(c)||Uq(a,'Invalid JSON from server: '+c,null)} -function Dr(a,b){gk&&XD($wnd.console,'Setting heartbeat interval to '+b+'sec.');a.a=b;Br(a)} -function HC(b,c,d){return jI(function(){var a=Array.prototype.slice.call(arguments);d.Fb(b,c,a)})} -function _b(b,c){Qb();function d(){var a=jI(Yb)(b);a&&$wnd.setTimeout(d,c)} -$wnd.setTimeout(d,c)} -function _v(a,b){var c;if(Sc(a,30)){c=Ic(a,30);ad((WH(b),b))==2?BB(c,(dB(c.a),c.c.length)):zB(c)}} -function Ti(a){var b;if(Sc(a,5)){return a}b=a&&a.__java$exception;if(!b){b=new rb(a);hc(b)}return b} -function vp(a,b){var c;if(a==null){return null}c=up('context://',b,a);c=up('base://','',c);return c} -function HD(b){var c=b.handler;if(!c){c=jI(function(a){ID(b,a)});c.listener=b;b.handler=c}return c} -function iE(c){return $wnd.JSON.stringify(c,function(a,b){if(a=='$H'){return undefined}return b},0)} -function fs(a,b){if(b==-1){return true}if(b==a.f+1){return true}if(a.f==-1){return true}return false} -function pD(a,b,c){var d,e;b<0?(e=0):(e=b);c<0||c>a.length?(d=a.length):(d=c);return a.substr(e,d-e)} -function Wn(a,b){var c,d;c=new oo(a);d=new $wnd.Function(a);eo(a,new vo(d),new xo(b,c),new zo(b,c))} -function ll(a,b){var c;c=new $wnd.Map;b.forEach(cj(Il.prototype.eb,Il,[a,c]));c.size==0||rl(new Ml(c))} -function Aj(a,b){var c;c='/'.length;if(!CF(b.substr(b.length-c,c),'/')){debugger;throw Ui(new BE)}a.c=b} -function Hu(a,b){var c;c=!!b.a&&!HE((FE(),DE),PA(OB(ov(b,0),KJ)));if(!c||!b.f){return c}return Hu(a,b.f)} -function jx(a,b){var c;if(b.d.has(a)){debugger;throw Ui(new BE)}c=OD(b.b,a,new Fz(b),false);b.d.set(a,c)} -function Qt(a,b,c,d){var e;e={};e[RI]=FJ;e[GJ]=Object(b);e[FJ]=c;!!d&&(e['data']=d,undefined);Ut(a,e)} -function Dc(a,b,c,d,e){e.nc=a;e.oc=b;e.pc=fj;e.__elementTypeId$=c;e.__elementTypeCategory$=d;return e} -function By(a,b,c,d){if(d==null){!!c&&(delete c['for'],undefined)}else{!c&&(c={});c['for']=d}Tv(a.g,a,b,c)} -function bq(a,b,c){DF(b,'true')||DF(b,'false')?(a.a[c]=DF(b,'true'),undefined):(a.a[c]=b,undefined)} -function br(a,b){gk&&($wnd.console.log('Reopening push connection'),undefined);_p(b)&&Tq(a,(qr(),or),null)} -function cr(a,b){Jo(Ic(tk(a.c,Fe),22),'',b+' could not be loaded. Push will not work.','',null,null)} -function Bt(a){var b,c;c=Ic(tk(a.c,Ke),11).b==(rp(),qp);b=a.b||Ic(tk(a.c,Of),36).b;(c||!b)&&fk('connected')} -function Y(a){var b,c,d,e;for(b=(a.h==null&&(a.h=(gc(),e=fc.K(a),ic(e))),a.h),c=0,d=b.length;c-129&&a<128){b=a+128;c=(rF(),qF)[b];!c&&(c=qF[b]=new lF(a));return c}return new lF(a)} -function Pv(a){var b,c;if(!a.c.has(0)){return true}c=ov(a,0);b=Jc(PA(OB(c,'visible')));return !HE((FE(),DE),b)} -function ux(a){var b,c;b=nv(a.e,24);for(c=0;c<(dB(b.a),b.c.length);c++){kx(a,Ic(b.c[c],6))}return yB(b,new bz(a))} -function Mv(a,b){var c,d,e;e=vA(a.a);for(c=0;c0){c=Ic(a.b.splice(0,1)[0],14);qm(c,b)||Wv(Ic(tk(a.c,gg),10),c);yC()}} -function pl(){fl();var a,b;--el;if(el==0&&dl.length!=0){try{for(b=0;b>>0,b.toString(16))}return a.toString()} -function cv(a){var b;if(!CF(kJ,a.type)){debugger;throw Ui(new BE)}b=a;return b.altKey||b.ctrlKey||b.metaKey||b.shiftKey} -function Uu(a,b,c){if(a==null){debugger;throw Ui(new BE)}if(b==null){debugger;throw Ui(new BE)}this.c=a;this.b=b;this.d=c} -function Ct(a){if(a.b){throw Ui(new kF('Trying to start a new request while another is active'))}a.b=true;At(a,new Gt)} -function Pm(a){while(a.parentNode&&(a=a.parentNode)){if(a.toString()==='[object ShadowRoot]'){return true}}return false} -function qm(a,b){var c,d;c=Oc(b.get(a.e.e.d),$wnd.Map);if(c!=null&&c.has(a.f)){d=c.get(a.f);WA(a,d);return true}return false} -function ox(a,b){var c,d;c=nv(b,11);for(d=0;d<(dB(c.a),c.c.length);d++){BA(a).classList.add(Pc(c.c[d]))}return yB(c,new Mz(a))} -function Jp(a){var b,c,d,e;b=(e=new Pj,e.a=a,Np(e,Kp(a)),e);c=new Tj(b);Gp.push(c);d=Kp(a).getConfig('uidl');Sj(c,d)} -function wp(a){var b,c;b=Ic(tk(a.a,ud),9).c;c='/'.length;if(!CF(b.substr(b.length-c,c),'/')){debugger;throw Ui(new BE)}return b} -function ax(a,b){if(typeof a.get===mI){var c=a.get(b);if(typeof c===kI&&typeof c[aJ]!==uI){return {nodeId:c[aJ]}}}return null} -function OB(a,b){var c;c=Ic(a.b.get(b),14);if(!c){c=new YA(b,a,CF('innerHTML',b)&&a.d==1);a.b.set(b,c);aB(a.a,new sB(a,c))}return c} -function cx(c){Yw();var b=c['}p'].promises;b!==undefined&&b.forEach(function(a){a[1](Error('Client is resynchronizing'))})} -function dk(){return /iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==='MacIntel'&&navigator.maxTouchPoints>1} -function ck(){this.a=new nD($wnd.navigator.userAgent);this.a.b?'ontouchstart' in window:this.a.f?!!navigator.msMaxTouchPoints:bk()} -function $n(a){this.b=new $wnd.Set;this.a=new $wnd.Map;this.d=!!($wnd.HTMLImports&&$wnd.HTMLImports.whenReady);this.c=a;Tn(this)} -function kr(a){this.c=a;ap(Ic(tk(a,Ke),11),new ur(this));GD($wnd,'offline',new wr(this),false);GD($wnd,'online',new yr(this),false)} -function uD(){uD=bj;tD=new vD('STYLESHEET',0);rD=new vD('JAVASCRIPT',1);sD=new vD('JS_MODULE',2);qD=new vD('DYNAMIC_IMPORT',3)} -function Hm(a){var b;if(Bm==null){return}b=Oc(Bm.get(a),$wnd.Set);if(b!=null){Bm.delete(a);b.forEach(cj(bn.prototype.ib,bn,[]))}} -function hC(a){var b;a.d=true;gC(a);a.e||wC(new mC(a));if(a.c.size!=0){b=a.c;a.c=new $wnd.Set;b.forEach(cj(qC.prototype.ib,qC,[]))}} -function Wt(a,b,c,d,e){var f;f={};f[RI]='mSync';f[GJ]=mE(b.d);f['feature']=Object(c);f['property']=d;f[ZI]=e==null?null:e;Ut(a,f)} -function Xj(a,b,c){var d;if(a==c.d){d=new $wnd.Function('callback','callback();');d.call(null,b);return FE(),true}return FE(),false} -function mc(){if(Error.stackTraceLimit>0){$wnd.Error.stackTraceLimit=Error.stackTraceLimit=64;return true}return 'stack' in new Error} -function zm(a){return typeof a.update==mI&&a.updateComplete instanceof Promise&&typeof a.shouldUpdate==mI&&typeof a.firstUpdated==mI} -function iF(a){var b;b=eF(a);if(b>3.4028234663852886E38){return Infinity}else if(b<-3.4028234663852886E38){return -Infinity}return b} -function IE(a){if(a>=48&&a<48+$wnd.Math.min(10,10)){return a-48}if(a>=97&&a<97){return a-97+10}if(a>=65&&a<65){return a-65+10}return -1} -function _E(a,b){var c=0;while(!b[c]||b[c]==''){c++}var d=b[c++];for(;cd&&Cc(b,d,null);return b} -function DF(a,b){WH(a);if(b==null){return false}if(CF(a,b)){return true}return a.length==b.length&&CF(a.toLowerCase(),b.toLowerCase())} -function kE(b){var c;try{return c=$wnd.JSON.parse(b),c}catch(a){a=Ti(a);if(Sc(a,7)){throw Ui(new pE("Can't parse "+b))}else throw Ui(a)}} -function Rk(a){this.d=a;'scrollRestoration' in history&&(history.scrollRestoration='manual');GD($wnd,NI,new Bo(this),false);Ok(this,true)} -function Eq(){Eq=bj;Bq=new Fq('CONNECT_PENDING',0);Aq=new Fq('CONNECTED',1);Dq=new Fq('DISCONNECT_PENDING',2);Cq=new Fq('DISCONNECTED',3)} -function er(a,b){if(a.b!=b){return}a.b=null;a.a=0;fk('connected');gk&&($wnd.console.log('Re-established connection to server'),undefined)} -function Tt(a,b,c,d,e){var f;f={};f[RI]='attachExistingElementById';f[GJ]=mE(b.d);f[HJ]=Object(c);f[IJ]=Object(d);f['attachId']=e;Ut(a,f)} -function kl(a){gk&&($wnd.console.log('Finished loading eager dependencies, loading lazy.'),undefined);a.forEach(cj(Ql.prototype.eb,Ql,[]))} -function Cr(a){ij(a.c);gk&&($wnd.console.debug('Sending heartbeat request...'),undefined);aD(a.d,null,'text/plain; charset=utf-8',new Hr(a))} -function Rv(a){AB(nv(a.e,24),cj(bw.prototype.ib,bw,[]));lv(a.e,cj(fw.prototype.eb,fw,[]));a.a.forEach(cj(dw.prototype.eb,dw,[a]));a.d=true} -function hI(a){fI();var b,c,d;c=':'+a;d=eI[c];if(d!=null){return ad((WH(d),d))}d=cI[c];b=d==null?gI(a):ad((WH(d),d));iI();eI[c]=b;return b} -function O(a){return Xc(a)?hI(a):Uc(a)?ad((WH(a),a)):Tc(a)?(WH(a),a)?1231:1237:Rc(a)?a.t():Bc(a)?bI(a):!!a&&!!a.hashCode?a.hashCode():bI(a)} -function wk(a,b,c){if(a.a.has(b)){debugger;throw Ui(new CE((KE(b),'Registry already has a class of type '+b.i+' registered')))}a.a.set(b,c)} -function rw(a,b){qw();var c;if(a.g.f){debugger;throw Ui(new CE('Binding state node while processing state tree changes'))}c=sw(a);c.Mb(a,b,ow)} -function IA(a,b,c,d,e){this.e=a;if(c==null){debugger;throw Ui(new BE)}if(d==null){debugger;throw Ui(new BE)}this.c=b;this.d=c;this.a=d;this.b=e} -function Zx(a,b){var c,d;d=OB(b,_J);dB(d.a);d.c||WA(d,a.getAttribute(_J));c=OB(b,aK);Pm(a)&&(dB(c.a),!c.c)&&!!a.style&&WA(c,a.style.display)} -function Yl(a,b,c,d){var e,f;if(!d){f=Ic(tk(a.g.c,Vd),59);e=Ic(f.a.get(c),27);if(!e){f.b[b]=c;f.a.set(c,pF(b));return pF(b)}return e}return d} -function ky(a,b){var c,d;while(b!=null){for(c=a.length-1;c>-1;c--){d=Ic(a[c],6);if(b.isSameNode(d.a)){return d.d}}b=BA(b.parentNode)}return -1} -function _l(a,b,c){var d;if(Zl(a.a,c)){d=Ic(a.e.get(Zg),78);if(!d||!d.a.has(c)){return}OA(OB(b,c),a.a[c]).N()}else{PB(b,c)||WA(OB(b,c),null)}} -function jm(a,b,c){var d,e;e=Lv(Ic(tk(a.c,gg),10),ad((WH(b),b)));if(e.c.has(1)){d=new $wnd.Map;NB(ov(e,1),cj(xm.prototype.eb,xm,[d]));c.set(b,d)}} -function QC(a,b,c){var d,e;e=Oc(a.c.get(b),$wnd.Map);if(e==null){e=new $wnd.Map;a.c.set(b,e)}d=Mc(e.get(c));if(d==null){d=[];e.set(c,d)}return d} -function jy(a){var b;hx==null&&(hx=new $wnd.Map);b=Lc(hx.get(a));if(b==null){b=Lc(new $wnd.Function(FJ,XJ,'return ('+a+')'));hx.set(a,b)}return b} -function ps(){if($wnd.performance&&$wnd.performance.timing){return (new Date).getTime()-$wnd.performance.timing.responseStart}else{return -1}} -function Sw(a,b,c,d){var e,f,g,h,i;i=Nc(a._());h=d.d;for(g=0;g=1&&lD(a[0],'OS major');if(a.length>=2){b=EF(a[1],OF(45));if(b>-1){c=a[1].substr(0,b-0);lD(c,hK)}else{lD(a[1],hK)}}} -function X(a,b,c){var d,e,f,g,h;Y(a);for(e=(a.i==null&&(a.i=zc(ri,pI,5,0,0,1)),a.i),f=0,g=e.length;f0){hk('Scheduling heartbeat in '+a.a+' seconds');jj(a.c,a.a*1000)}else{gk&&($wnd.console.debug('Disabling heartbeat'),undefined);ij(a.c)}} -function ht(a){var b,c,d,e;b=OB(ov(Ic(tk(a.a,gg),10).e,5),'parameters');e=(dB(b.a),Ic(b.g,6));d=ov(e,6);c=new $wnd.Map;NB(d,cj(tt.prototype.eb,tt,[c]));return c} -function Wv(a,b){var c,d;if(!b){debugger;throw Ui(new BE)}d=b.e;c=d.e;if(mm(Ic(tk(a.c,Xd),51),b)||!Ov(a,c)){return}Wt(Ic(tk(a.c,Kf),28),c,d.d,b.f,(dB(b.a),b.g))} -function dv(a,b){var c;c=$wnd.location.pathname;if(c==null){debugger;throw Ui(new CE('window.location.path should never be null'))}if(c!=a){return false}return b} -function LC(a,b,c){var d;if(!b){throw Ui(new uF('Cannot add a handler with a null type'))}a.b>0?KC(a,new XC(a,b,c)):(d=QC(a,b,null),d.push(c));return new WC(a,b,c)} -function Yx(a,b){var c,d,e;Zx(a,b);e=OB(b,_J);dB(e.a);e.c&&Cy(Ic(tk(b.e.g.c,ud),9),a,_J,(dB(e.a),e.g));c=OB(b,aK);dB(c.a);if(c.c){d=(dB(c.a),ej(c.g));MD(a.style,d)}} -function bp(a,b){if(b.c!=a.b.c+1){throw Ui(new jF('Tried to move from state '+hp(a.b)+' to '+(b.b!=null?b.b:''+b.c)+' which is not allowed'))}a.b=b;NC(a.a,new ep(a))} -function ss(a){var b;if(a==null){return null}if(!CF(a.substr(0,9),'for(;;);[')||(b=']'.length,!CF(a.substr(a.length-b,b),']'))){return null}return MF(a,9,a.length-1)} -function Yi(b,c,d,e){Xi();var f=Vi;$moduleName=c;$moduleBase=d;Si=e;function g(){for(var a=0;a=0;d--){if(CF(a[d].d,b)||CF(a[d].d,c)){a.length>=d+1&&a.splice(0,d+1);break}}return a} -function St(a,b,c,d,e,f){var g;g={};g[RI]='attachExistingElement';g[GJ]=mE(b.d);g[HJ]=Object(c);g[IJ]=Object(d);g['attachTagName']=e;g['attachIndex']=Object(f);Ut(a,g)} -function Qm(a){var b=typeof $wnd.Polymer===mI&&$wnd.Polymer.Element&&a instanceof $wnd.Polymer.Element;var c=a.constructor.polymerElementVersion!==undefined;return b||c} -function Rw(a,b,c,d){var e,f,g,h;h=nv(b,c);dB(h.a);if(h.c.length>0){f=Nc(a._());for(e=0;e<(dB(h.a),h.c.length);e++){g=Pc(h.c[e]);Zw(f,g,b,d)}}return yB(h,new Vw(a,b,d))} -function iy(a,b){var c,d,e,f,g;c=BA(b).childNodes;for(e=0;ed&&(YH(b-1,a.length),a.charCodeAt(b-1)<=32)){--b}return d>0||b=65536){b=55296+(a-65536>>10&1023)&65535;c=56320+(a-65536&1023)&65535;return String.fromCharCode(b)+(''+String.fromCharCode(c))}else{return String.fromCharCode(a&65535)}} -function Ib(a){a&&Sb((Qb(),Pb));--yb;if(yb<0){debugger;throw Ui(new CE('Negative entryDepth value at exit '+yb))}if(a){if(yb!=0){debugger;throw Ui(new CE('Depth not 0'+yb))}if(Cb!=-1){Nb(Cb);Cb=-1}}} -function zy(a,b,c,d){var e,f,g,h,i,j,k;e=false;for(h=0;h2000){Bb=a;Cb=$wnd.setTimeout(Ob,10)}}if(yb++==0){Rb((Qb(),Pb));return true}return false} -function yq(a){var b,c,d;if(a.a>=a.b.length){debugger;throw Ui(new BE)}if(a.a==0){c=''+a.b.length+'|';b=4095-c.length;d=c+MF(a.b,0,$wnd.Math.min(a.b.length,b));a.a+=b}else{d=xq(a,a.a,a.a+4095);a.a+=4095}return d} -function es(a){var b,c,d,e;if(a.h.length==0){return false}e=-1;for(b=0;b=f&&(YH(b,a.length),a.charCodeAt(b)!=32)){--b}if(b==f){return}d=a.substr(b+1,c-(b+1));e=KF(d,'\\.',0);hD(e)} -function Bu(a,b){var c,d,e,f,g,h;if(!b){debugger;throw Ui(new BE)}for(d=(g=oE(b),g),e=0,f=d.length;e=0;d--){TF((g.a+=i,g),Pc(c[d]));i='.'}return g.a} -function fq(a,b){var c,d,e,f,g;if(jq()){cq(b.a)}else{f=(Ic(tk(a.d,ud),9).j?(e='VAADIN/static/push/vaadinPush-min.js'):(e='VAADIN/static/push/vaadinPush.js'),e);gk&&XD($wnd.console,'Loading '+f);d=Ic(tk(a.d,we),57);g=Ic(tk(a.d,ud),9).l+f;c=new uq(a,f,b);Xn(d,g,c,false,WI)}} -function JC(a,b){var c,d,e,f,g,h;if(hE(b)==1){c=b;h=ad(lE(c[0]));switch(h){case 0:{g=ad(lE(c[1]));d=(f=g,Ic(a.a.get(f),6)).a;return d}case 1:return e=Mc(c[1]),e;case 2:return HC(ad(lE(c[1])),ad(lE(c[2])),Ic(tk(a.c,Kf),28));default:throw Ui(new jF(fK+iE(c)));}}else{return b}} -function bs(a,b){var c,d,e,f,g;gk&&($wnd.console.log('Handling dependencies'),undefined);c=new $wnd.Map;for(e=(CD(),Dc(xc(Ih,1),pI,43,0,[AD,zD,BD])),f=0,g=e.length;fa.a){a.a==0?gk&&XD($wnd.console,'Updating client-to-server id to '+b+' based on server'):ok('Server expects next client-to-server id to be '+b+' but we were going to use '+a.a+'. Will use '+b+'.');a.a=b}} -function bo(a,b,c){a.onload=jI(function(){a.onload=null;a.onerror=null;a.onreadystatechange=null;b.gb(c)});a.onerror=jI(function(){a.onload=null;a.onerror=null;a.onreadystatechange=null;b.fb(c)});a.onreadystatechange=function(){('loaded'===a.readyState||'complete'===a.readyState)&&a.onload(arguments[0])}} -function Os(a,b,c){var d,e,f,g,h,i,j,k;Ct(Ic(tk(a.c,Gf),13));i={};d=Ic(tk(a.c,sf),20).b;CF(d,'init')||(i['csrfToken']=d,undefined);i['rpc']=b;i[xJ]=mE(Ic(tk(a.c,sf),20).f);i[AJ]=mE(a.a++);if(c){for(f=(j=oE(c),j),g=0,h=f.length;g0){k=Cx(a,b);d=!k?null:BA(k.a).nextSibling}else{d=null}for(g=0;g=a.f.length||a.a>=a.g.length){ok('No matching scroll position found (entries X:'+a.f.length+', Y:'+a.g.length+') for opened history index ('+a.a+'). '+MI);Pk(a);return}c=hF(Kc(a.f[a.a]));d=hF(Kc(a.g[a.a]));b?(a.e=yt(Ic(tk(a.d,Gf),13),new Do(a,c,d))):Xk(Dc(xc(cd,1),pI,90,15,[c,d]))} -function Bx(b,c){var d,e,f,g,h;if(!c){return -1}try{h=BA(Nc(c));f=[];f.push(b);for(e=0;e0&&(YH(0,a.length),a.charCodeAt(0)==45||(YH(0,a.length),a.charCodeAt(0)==43))?1:0;for(b=e;b2147483647){throw Ui(new wF(qK+a+'"'))}return f} -function KF(a,b,c){var d,e,f,g,h,i,j,k;d=new RegExp(b,'g');j=zc(pi,pI,2,0,6,1);e=0;k=a;g=null;while(true){i=d.exec(k);if(i==null||k==''||e==c-1&&c>0){j[e]=k;break}else{h=i.index;j[e]=k.substr(0,h);k=MF(k,h+i[0].length,k.length);d.lastIndex=0;if(g==k){j[e]=k.substr(0,1);k=k.substr(1)}g=k;++e}}if(c==0&&a.length>0){f=j.length;while(f>0&&j[f-1]==''){--f}f=14&&c<=16));case 11:return b!=null&&Yc(b);case 12:return b!=null&&(typeof b===kI||typeof b==mI);case 0:return Hc(b,a.__elementTypeId$);case 2:return Zc(b)&&!(b.pc===fj);case 1:return Zc(b)&&!(b.pc===fj)||Hc(b,a.__elementTypeId$);default:return true;}} -function Wl(b,c){if(document.body.$&&document.body.$.hasOwnProperty&&document.body.$.hasOwnProperty(c)){return document.body.$[c]}else if(b.shadowRoot){return b.shadowRoot.getElementById(c)}else if(b.getElementById){return b.getElementById(c)}else if(c&&c.match('^[a-zA-Z0-9-_]*$')){return b.querySelector('#'+c)}else{return Array.from(b.querySelectorAll('[id]')).find(function(a){return a.id==c})}} -function eq(a,b){var c,d;if(!_p(a)){throw Ui(new kF('This server to client push connection should not be used to send client to server messages'))}if(a.f==(Eq(),Aq)){d=Dp(b);nk('Sending push ('+a.g+') message to server: '+d);if(CF(a.g,pJ)){c=new zq(d);while(c.a=QA((d=ov(Ic(tk(Ic(tk(a.c,Ef),37).a,gg),10).e,9),OB(d,'reconnectAttempts')),10000)?Rq(a):fr(a,c)} -function Xl(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r;j=null;g=BA(a.a).childNodes;o=new $wnd.Map;e=!b;i=-1;for(m=0;m. User has navigated out of site in an unrecognized way.');Pk(b)}}else{Pk(b)}} -function Cy(a,b,c,d){var e,f,g,h,i;if(d==null||Xc(d)){Ep(b,c,Pc(d))}else{f=d;if(0==hE(f)){g=f;if(!('uri' in g)){debugger;throw Ui(new CE("Implementation error: JsonObject is recieved as an attribute value for '"+c+"' but it has no "+'uri'+' key'))}i=g['uri'];if(a.q&&!i.match(/^(?:[a-zA-Z]+:)?\/\//)){e=a.l;e=(h='/'.length,CF(e.substr(e.length-h,h),'/')?e:e+'/');BA(b).setAttribute(c,e+(''+i))}else{i==null?BA(b).removeAttribute(c):BA(b).setAttribute(c,i)}}else{Ep(b,c,ej(d))}}} -function Gx(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p;p=Ic(c.e.get(Zg),78);if(!p||!p.a.has(a)){return}k=KF(a,'\\.',0);g=c;f=null;e=0;j=k.length;for(m=k,n=0,o=m.length;n=f){debugger;throw Ui(new BE)}return g.length==0?null:g}else{return a}} -function ly(a,b,c,d,e){var f,g,h;h=Lv(e,ad(a));if(!h.c.has(1)){return}if(!gy(h,b)){debugger;throw Ui(new CE('Host element is not a parent of the node whose property has changed. This is an implementation error. Most likely it means that there are several StateTrees on the same page (might be possible with portlets) and the target StateTree should not be passed into the method as an argument but somehow detected from the host element. Another option is that host element is calculated incorrectly.'))}f=ov(h,1);g=OB(f,c);OA(g,d).N()} -function Go(a,b,c,d){var e,f,g,h,i,j;h=$doc;j=h.createElement('div');j.className='v-system-error';if(a!=null){f=h.createElement('div');f.className='caption';f.textContent=a;j.appendChild(f);gk&&WD($wnd.console,a)}if(b!=null){i=h.createElement('div');i.className='message';i.textContent=b;j.appendChild(i);gk&&WD($wnd.console,b)}if(c!=null){g=h.createElement('div');g.className='details';g.textContent=c;j.appendChild(g);gk&&WD($wnd.console,c)}if(d!=null){e=h.querySelector(d);!!e&&PD(Nc(IG(MG(e.shadowRoot),e)),j)}else{QD(h.body,j)}return j} -function Eu(h,e,f){var g={};g.getNode=jI(function(a){var b=e.get(a);if(b==null){throw new ReferenceError('There is no a StateNode for the given argument.')}return b});g.$appId=h.Gb().replace(/-\d+$/,'');g.registry=h.a;g.attachExistingElement=jI(function(a,b,c,d){Xl(g.getNode(a),b,c,d)});g.populateModelProperties=jI(function(a,b){$l(g.getNode(a),b)});g.registerUpdatableModelProperties=jI(function(a,b){am(g.getNode(a),b)});g.stopApplication=jI(function(){f.N()});g.scrollPositionHandlerAfterServerNavigation=jI(function(a){bm(g.registry,a)});return g} -function qc(a,b){var c,d,e,f,g,h,i,j,k;j='';if(b.length==0){return a.L(yI,wI,-1,-1)}k=NF(b);CF(k.substr(0,3),'at ')&&(k=k.substr(3));k=k.replace(/\[.*?\]/g,'');g=k.indexOf('(');if(g==-1){g=k.indexOf('@');if(g==-1){j=k;k=''}else{j=NF(k.substr(g+1));k=NF(k.substr(0,g))}}else{c=k.indexOf(')',g);j=k.substr(g+1,c-(g+1));k=NF(k.substr(0,g))}g=EF(k,OF(46));g!=-1&&(k=k.substr(g+1));(k.length==0||CF(k,'Anonymous function'))&&(k=wI);h=GF(j,OF(58));e=HF(j,OF(58),h-1);i=-1;d=-1;f=yI;if(h!=-1&&e!=-1){f=j.substr(0,e);i=kc(j.substr(e+1,h-(e+1)));d=kc(j.substr(h+1))}return a.L(f,k,i,d)} -function Np(a,b){var c,d,e;c=Vp(b,'serviceUrl');Oj(a,Tp(b,'webComponentMode'));zj(a,Tp(b,'clientRouting'));if(c==null){Jj(a,Bp('.'));Aj(a,Bp(Vp(b,mJ)))}else{a.l=c;Aj(a,Bp(c+(''+Vp(b,mJ))))}Nj(a,Up(b,'v-uiId').a);Dj(a,Up(b,'heartbeatInterval').a);Gj(a,Up(b,'maxMessageSuspendTimeout').a);Kj(a,(d=b.getConfig(nJ),d?d.vaadinVersion:null));e=b.getConfig(nJ);Sp();Lj(a,b.getConfig('sessExpMsg'));Hj(a,!Tp(b,'debug'));Ij(a,Tp(b,'requestTiming'));Cj(a,b.getConfig('webcomponents'));Bj(a,Tp(b,'devToolsEnabled'));Fj(a,Vp(b,'liveReloadUrl'));Ej(a,Vp(b,'liveReloadBackend'));Mj(a,Vp(b,'springBootLiveReloadPort'))} -function wb(b){var c=function(a){return typeof a!=uI};var d=function(a){return a.replace(/\r\n/g,'')};if(c(b.outerHTML))return d(b.outerHTML);c(b.innerHTML)&&b.cloneNode&&$doc.createElement('div').appendChild(b.cloneNode(true)).innerHTML;if(c(b.nodeType)&&b.nodeType==3){return "'"+b.data.replace(/ /g,'\u25AB').replace(/\u00A0/,'\u25AA')+"'"}if(typeof c(b.htmlText)&&b.collapse){var e=b.htmlText;if(e){return 'IETextRange ['+d(e)+']'}else{var f=b.duplicate();f.pasteHTML('|');var g='IETextRange '+d(b.parentElement().outerHTML);f.moveStart('character',-1);f.pasteHTML('');return g}}return b.toString?b.toString():'[JavaScriptObject]'} -function Vm(a,b,c){var d,e,f;f=[];if(a.c.has(1)){if(!Sc(b,42)){debugger;throw Ui(new CE('Received an inconsistent NodeFeature for a node that has a ELEMENT_PROPERTIES feature. It should be NodeMap, but it is: '+b))}e=Ic(b,42);NB(e,cj(on.prototype.eb,on,[f,c]));f.push(MB(e,new kn(f,c)))}else if(a.c.has(16)){if(!Sc(b,30)){debugger;throw Ui(new CE('Received an inconsistent NodeFeature for a node that has a TEMPLATE_MODELLIST feature. It should be NodeList, but it is: '+b))}d=Ic(b,30);f.push(yB(d,new dn(c)))}if(f.length==0){debugger;throw Ui(new CE('Node should have ELEMENT_PROPERTIES or TEMPLATE_MODELLIST feature'))}f.push(kv(a,new hn(f)))} -function Dk(a,b){this.a=new $wnd.Map;this.b=new $wnd.Map;wk(this,xd,a);wk(this,ud,b);wk(this,we,new $n(this));wk(this,Le,new yp(this));wk(this,Sd,new ol(this));wk(this,Fe,new Lo(this));xk(this,Ke,new Ek);wk(this,gg,new Zv(this));wk(this,Gf,new Dt(this));wk(this,sf,new os(this));wk(this,uf,new Ts(this));wk(this,Of,new eu(this));wk(this,Kf,new Yt(this));wk(this,Zf,new Ku(this));xk(this,Vf,new Gk);xk(this,Vd,new Ik);wk(this,Xd,new rm(this));wk(this,df,new Er(this));wk(this,Ve,new kr(this));wk(this,Uf,new mu(this));wk(this,Cf,new kt(this));wk(this,Ef,new vt(this));b.b||(b.q?wk(this,ze,new Yk):wk(this,ze,new Rk(this)));wk(this,yf,new bt(this))} -function cy(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o;l=e.e;o=Pc(PA(OB(ov(b,0),'tag')));h=false;if(!a){h=true;gk&&YD($wnd.console,bK+d+" is not found. The requested tag name is '"+o+"'")}else if(!(!!a&&DF(o,a.tagName))){h=true;ok(bK+d+" has the wrong tag name '"+a.tagName+"', the requested tag name is '"+o+"'")}if(h){Vv(l.g,l,b.d,-1,c);return false}if(!l.c.has(20)){return true}k=ov(l,20);m=Ic(PA(OB(k,YJ)),6);if(!m){return true}j=nv(m,2);g=null;for(i=0;i<(dB(j.a),j.c.length);i++){n=Ic(j.c[i],6);f=n.a;if(K(f,a)){g=pF(n.d);break}}if(g){gk&&YD($wnd.console,bK+d+" has been already attached previously via the node id='"+g+"'");Vv(l.g,l,b.d,g.a,c);return false}return true} -function Gu(b,c,d,e){var f,g,h,i,j,k,l,m,n;if(c.length!=d.length+1){debugger;throw Ui(new BE)}try{j=new ($wnd.Function.bind.apply($wnd.Function,[null].concat(c)));j.apply(Eu(b,e,new Qu(b)),d)}catch(a){a=Ti(a);if(Sc(a,7)){i=a;gk&&ik(new pk(i));gk&&($wnd.console.error('Exception is thrown during JavaScript execution. Stacktrace will be dumped separately.'),undefined);if(!Ic(tk(b.a,ud),9).j){g=new WF('[');h='';for(l=c,m=0,n=l.length;m=0){g=b.substr(f+3);g=JF(g,mK,'$1');this.a=iF(g)}}else if(this.l){g=LF(b,b.indexOf('webkit/')+7);g=JF(g,nK,'$1');this.a=iF(g)}else if(this.k){g=LF(b,b.indexOf(jK)+8);g=JF(g,nK,'$1');this.a=iF(g);this.a>7&&(this.a=7)}else this.c&&(this.a=0)}catch(a){a=Ti(a);if(Sc(a,7)){c=a;ZF();'Browser engine version parsing failed for: '+b+' '+c.D()}else throw Ui(a)}try{if(this.f){if(b.indexOf('msie')!=-1){if(this.k);else{e=LF(b,b.indexOf('msie ')+5);e=pD(e,0,EF(e,OF(59)));mD(e)}}else{f=b.indexOf('rv:');if(f>=0){g=b.substr(f+3);g=JF(g,mK,'$1');mD(g)}}}else if(this.d){d=b.indexOf(' firefox/')+9;mD(pD(b,d,d+5))}else if(this.b){iD(b)}else if(this.j){d=b.indexOf(' version/');if(d>=0){d+=9;mD(pD(b,d,d+5))}}else if(this.i){d=b.indexOf(' version/');d!=-1?(d+=9):(d=b.indexOf('opera/')+6);mD(pD(b,d,d+5))}else if(this.c){d=b.indexOf(' edge/')+6;b.indexOf(' edg/')!=-1?(d=b.indexOf(' edg/')+5):b.indexOf(kK)!=-1?(d=b.indexOf(kK)+6):b.indexOf(lK)!=-1&&(d=b.indexOf(lK)+8);mD(pD(b,d,d+8))}}catch(a){a=Ti(a);if(Sc(a,7)){c=a;ZF();'Browser version parsing failed for: '+b+' '+c.D()}else throw Ui(a)}if(b.indexOf('windows ')!=-1){b.indexOf('windows phone')!=-1}else if(b.indexOf('android')!=-1){fD(b)}else if(b.indexOf('linux')!=-1);else if(b.indexOf('macintosh')!=-1||b.indexOf('mac osx')!=-1||b.indexOf('mac os x')!=-1){this.g=b.indexOf('ipad')!=-1;this.h=b.indexOf('iphone')!=-1;(this.g||this.h)&&jD(b)}else b.indexOf('; cros ')!=-1&&gD(b)} -var kI='object',lI='[object Array]',mI='function',nI='java.lang',oI='com.google.gwt.core.client',pI={4:1},qI='__noinit__',rI={4:1,7:1,8:1,5:1},sI='null',tI='com.google.gwt.core.client.impl',uI='undefined',vI='Working array length changed ',wI='anonymous',xI='fnStack',yI='Unknown',zI='must be non-negative',AI='must be positive',BI='com.google.web.bindery.event.shared',CI='com.vaadin.client',DI='url',EI={67:1},FI={33:1},GI='historyIndex',HI='historyResetToken',II='xPositions',JI='yPositions',KI='scrollPos-',LI='Failed to get session storage: ',MI='Unable to restore scroll positions. History.state has been manipulated or user has navigated away from site in an unrecognized way.',NI='beforeunload',OI='scrollPositionX',QI='scrollPositionY',RI='type',SI={47:1},TI={25:1},UI={18:1},VI={24:1},WI='text/javascript',XI='constructor',YI='properties',ZI='value',$I='com.vaadin.client.flow.reactive',_I={15:1},aJ='nodeId',bJ='Root node for node ',cJ=' could not be found',dJ=' is not an Element',eJ={65:1},fJ={82:1},gJ={46:1},hJ={91:1},iJ='script',jJ='stylesheet',kJ='click',lJ='com.vaadin.flow.shared',mJ='contextRootUrl',nJ='versionInfo',oJ='v-uiId=',pJ='websocket',qJ='transport',rJ='application/json; charset=UTF-8',sJ='VAADIN/push',tJ='com.vaadin.client.communication',uJ={92:1},vJ='dialogText',wJ='dialogTextGaveUp',xJ='syncId',yJ='resynchronize',zJ='Received message with server id ',AJ='clientId',BJ='Vaadin-Security-Key',CJ='Vaadin-Push-ID',DJ='sessionExpired',EJ='pushServletMapping',FJ='event',GJ='node',HJ='attachReqId',IJ='attachAssignedId',JJ='com.vaadin.client.flow',KJ='bound',LJ='payload',MJ='subTemplate',NJ={45:1},OJ='Node is null',PJ='Node is not created for this tree',QJ='Node id is not registered with this tree',RJ='$server',SJ='feat',TJ='remove',UJ='com.vaadin.client.flow.binding',VJ='intermediate',WJ='elemental.util',XJ='element',YJ='shadowRoot',ZJ='The HTML node for the StateNode with id=',$J='An error occurred when Flow tried to find a state node matching the element ',_J='hidden',aK='styleDisplay',bK='Element addressed by the ',cK='dom-repeat',dK='dom-change',eK='com.vaadin.client.flow.nodefeature',fK='Unsupported complex type in ',gK='com.vaadin.client.gwt.com.google.web.bindery.event.shared',hK='OS minor',iK=' headlesschrome/',jK='trident/',kK=' edga/',lK=' edgios/',mK='(\\.[0-9]+).+',nK='([0-9]+\\.[0-9]+).*',oK='com.vaadin.flow.shared.ui',pK='java.io',qK='For input string: "',rK='java.util',sK='java.util.stream',tK='Index: ',uK=', Size: ',vK='user.agent';var _,$i,Vi,Si=-1;$wnd.goog=$wnd.goog||{};$wnd.goog.global=$wnd.goog.global||$wnd;_i();aj(1,null,{},I);_.r=function J(a){return H(this,a)};_.s=function L(){return this.nc};_.t=function N(){return bI(this)};_.u=function P(){var a;return LE(M(this))+'@'+(a=O(this)>>>0,a.toString(16))};_.equals=function(a){return this.r(a)};_.hashCode=function(){return this.t()};_.toString=function(){return this.u()};var Ec,Fc,Gc;aj(68,1,{68:1},ME);_.Zb=function NE(a){var b;b=new ME;b.e=4;a>1?(b.c=UE(this,a-1)):(b.c=this);return b};_.$b=function TE(){KE(this);return this.b};_._b=function VE(){return LE(this)};_.ac=function XE(){KE(this);return this.g};_.bc=function ZE(){return (this.e&4)!=0};_.cc=function $E(){return (this.e&1)!=0};_.u=function bF(){return ((this.e&2)!=0?'interface ':(this.e&1)!=0?'':'class ')+(KE(this),this.i)};_.e=0;var JE=1;var ji=PE(nI,'Object',1);var Yh=PE(nI,'Class',68);aj(97,1,{},R);_.a=0;var dd=PE(oI,'Duration',97);var S=null;aj(5,1,{4:1,5:1});_.w=function bb(a){return new Error(a)};_.A=function db(){return this.e};_.B=function eb(){var a;return a=Ic(xH(zH(BG((this.i==null&&(this.i=zc(ri,pI,5,0,0,1)),this.i)),new _F),gH(new rH,new pH,new tH,Dc(xc(Gi,1),pI,48,0,[(kH(),iH)]))),93),pG(a,zc(ji,pI,1,a.a.length,5,1))};_.C=function fb(){return this.f};_.D=function gb(){return this.g};_.F=function hb(){Z(this,cb(this.w($(this,this.g))));hc(this)};_.u=function jb(){return $(this,this.D())};_.e=qI;_.j=true;var ri=PE(nI,'Throwable',5);aj(7,5,{4:1,7:1,5:1});var ai=PE(nI,'Exception',7);aj(8,7,rI,mb);var li=PE(nI,'RuntimeException',8);aj(54,8,rI,nb);var fi=PE(nI,'JsException',54);aj(122,54,rI);var hd=PE(tI,'JavaScriptExceptionBase',122);aj(26,122,{26:1,4:1,7:1,8:1,5:1},rb);_.D=function ub(){return qb(this),this.c};_.G=function vb(){return _c(this.b)===_c(ob)?null:this.b};var ob;var ed=PE(oI,'JavaScriptException',26);var fd=PE(oI,'JavaScriptObject$',0);aj(320,1,{});var gd=PE(oI,'Scheduler',320);var yb=0,zb=false,Ab,Bb=0,Cb=-1;aj(132,320,{});_.e=false;_.i=false;var Pb;var ld=PE(tI,'SchedulerImpl',132);aj(133,1,{},bc);_.H=function cc(){this.a.e=true;Tb(this.a);this.a.e=false;return this.a.i=Ub(this.a)};var jd=PE(tI,'SchedulerImpl/Flusher',133);aj(134,1,{},dc);_.H=function ec(){this.a.e&&_b(this.a.f,1);return this.a.i};var kd=PE(tI,'SchedulerImpl/Rescuer',134);var fc;aj(330,1,{});var pd=PE(tI,'StackTraceCreator/Collector',330);aj(123,330,{},nc);_.J=function oc(a){var b={},j;var c=[];a[xI]=c;var d=arguments.callee.caller;while(d){var e=(gc(),d.name||(d.name=jc(d.toString())));c.push(e);var f=':'+e;var g=b[f];if(g){var h,i;for(h=0,i=g.length;h0){Sn(this.b,this.c);return false}else if(a==0){Rn(this.b,this.c);return true}else if(Q(this.a)>60000){Rn(this.b,this.c);return false}else{return true}};var le=PE(CI,'ResourceLoader/1',196);aj(197,41,{},ho);_.N=function io(){this.a.b.has(this.c)||Rn(this.a,this.b)};var me=PE(CI,'ResourceLoader/2',197);aj(201,41,{},jo);_.N=function ko(){this.a.b.has(this.c)?Sn(this.a,this.b):Rn(this.a,this.b)};var ne=PE(CI,'ResourceLoader/3',201);aj(202,1,TI,lo);_.fb=function mo(a){Rn(this.a,a)};_.gb=function no(a){Sn(this.a,a)};var oe=PE(CI,'ResourceLoader/4',202);aj(62,1,{},oo);var pe=PE(CI,'ResourceLoader/ResourceLoadEvent',62);aj(101,1,TI,po);_.fb=function qo(a){Rn(this.a,a)};_.gb=function ro(a){Sn(this.a,a)};var re=PE(CI,'ResourceLoader/SimpleLoadListener',101);aj(195,1,TI,so);_.fb=function to(a){Rn(this.a,a)};_.gb=function uo(a){var b;if((!ak&&(ak=new ck),ak).a.b||(!ak&&(ak=new ck),ak).a.f||(!ak&&(ak=new ck),ak).a.c){b=co(this.b);if(b==0){Rn(this.a,a);return}}Sn(this.a,a)};var se=PE(CI,'ResourceLoader/StyleSheetLoadListener',195);aj(198,1,FI,vo);_._=function wo(){return this.a.call(null)};var te=PE(CI,'ResourceLoader/lambda$0$Type',198);aj(199,1,UI,xo);_.N=function yo(){this.b.gb(this.a)};var ue=PE(CI,'ResourceLoader/lambda$1$Type',199);aj(200,1,UI,zo);_.N=function Ao(){this.b.fb(this.a)};var ve=PE(CI,'ResourceLoader/lambda$2$Type',200);aj(160,1,{},Bo);_.nb=function Co(a){Nk(this.a)};var xe=PE(CI,'ScrollPositionHandler/0methodref$onBeforeUnload$Type',160);aj(161,1,hJ,Do);_.ob=function Eo(a){Mk(this.a,this.b,this.c)};_.b=0;_.c=0;var ye=PE(CI,'ScrollPositionHandler/lambda$1$Type',161);aj(22,1,{22:1},Lo);var Fe=PE(CI,'SystemErrorHandler',22);aj(165,1,{},No);_.qb=function Oo(a,b){var c;c=b;Fo(c.D())};_.rb=function Po(a){var b;nk('Received xhr HTTP session resynchronization message: '+a.responseText);vk(this.a.a);bp(Ic(tk(this.a.a,Ke),11),(rp(),pp));b=rs(ss(a.responseText));ds(Ic(tk(this.a.a,sf),20),b);Nj(Ic(tk(this.a.a,ud),9),b['uiId']);Yo((Qb(),Pb),new So(this))};var Ce=PE(CI,'SystemErrorHandler/1',165);aj(166,1,{},Qo);_.ib=function Ro(a){Ko(Pc(a))};var Ae=PE(CI,'SystemErrorHandler/1/0methodref$recreateNodes$Type',166);aj(167,1,{},So);_.I=function To(){yH(BG(Ic(tk(this.a.a.a,ud),9).e),new Qo)};var Be=PE(CI,'SystemErrorHandler/1/lambda$0$Type',167);aj(163,1,{},Uo);_.nb=function Vo(a){Cp(this.a)};var De=PE(CI,'SystemErrorHandler/lambda$0$Type',163);aj(164,1,{},Wo);_.nb=function Xo(a){Mo(this.a,a)};var Ee=PE(CI,'SystemErrorHandler/lambda$1$Type',164);aj(136,132,{},Zo);_.a=0;var He=PE(CI,'TrackingScheduler',136);aj(137,1,{},$o);_.I=function _o(){this.a.a--};var Ge=PE(CI,'TrackingScheduler/lambda$0$Type',137);aj(11,1,{11:1},cp);var Ke=PE(CI,'UILifecycle',11);aj(171,337,{},ep);_.P=function fp(a){Ic(a,92).sb(this)};_.Q=function gp(){return dp};var dp=null;var Ie=PE(CI,'UILifecycle/StateChangeEvent',171);aj(21,1,{4:1,32:1,21:1});_.r=function kp(a){return this===a};_.t=function lp(){return bI(this)};_.u=function mp(){return this.b!=null?this.b:''+this.c};_.c=0;var $h=PE(nI,'Enum',21);aj(60,21,{60:1,4:1,32:1,21:1},sp);var op,pp,qp;var Je=QE(CI,'UILifecycle/UIState',60,tp);aj(336,1,pI);var Gh=PE(lJ,'VaadinUriResolver',336);aj(50,336,{50:1,4:1},yp);_.tb=function Ap(a){return xp(this,a)};var Le=PE(CI,'URIResolver',50);var Fp=false,Gp;aj(116,1,{},Qp);_.I=function Rp(){Mp(this.a)};var Me=PE('com.vaadin.client.bootstrap','Bootstrapper/lambda$0$Type',116);aj(102,1,{},gq);_.ub=function iq(){return Ic(tk(this.d,sf),20).f};_.vb=function kq(a){this.f=(Eq(),Cq);Jo(Ic(tk(Ic(tk(this.d,Ve),16).c,Fe),22),'','Client unexpectedly disconnected. Ensure client timeout is disabled.','',null,null)};_.wb=function lq(a){this.f=(Eq(),Bq);Ic(tk(this.d,Ve),16);gk&&($wnd.console.log('Push connection closed'),undefined)};_.xb=function mq(a){this.f=(Eq(),Cq);Sq(Ic(tk(this.d,Ve),16),'Push connection using '+a[qJ]+' failed!')};_.yb=function nq(a){var b,c;c=a['responseBody'];b=rs(ss(c));if(!b){$q(Ic(tk(this.d,Ve),16),this,c);return}else{nk('Received push ('+this.g+') message: '+c);ds(Ic(tk(this.d,sf),20),b)}};_.zb=function oq(a){nk('Push connection established using '+a[qJ]);dq(this,a)};_.Ab=function pq(a,b){this.f==(Eq(),Aq)&&(this.f=Bq);br(Ic(tk(this.d,Ve),16),this)};_.Bb=function qq(a){nk('Push connection re-established using '+a[qJ]);dq(this,a)};_.Cb=function rq(){ok('Push connection using primary method ('+this.a[qJ]+') failed. Trying with '+this.a['fallbackTransport'])};var Ue=PE(tJ,'AtmospherePushConnection',102);aj(252,1,{},sq);_.I=function tq(){Wp(this.a)};var Ne=PE(tJ,'AtmospherePushConnection/0methodref$connect$Type',252);aj(254,1,TI,uq);_.fb=function vq(a){cr(Ic(tk(this.a.d,Ve),16),a.a)};_.gb=function wq(a){if(jq()){nk(this.c+' loaded');cq(this.b.a)}else{cr(Ic(tk(this.a.d,Ve),16),a.a)}};var Oe=PE(tJ,'AtmospherePushConnection/1',254);aj(249,1,{},zq);_.a=0;var Pe=PE(tJ,'AtmospherePushConnection/FragmentedMessage',249);aj(52,21,{52:1,4:1,32:1,21:1},Fq);var Aq,Bq,Cq,Dq;var Qe=QE(tJ,'AtmospherePushConnection/State',52,Gq);aj(251,1,uJ,Hq);_.sb=function Iq(a){aq(this.a,a)};var Re=PE(tJ,'AtmospherePushConnection/lambda$0$Type',251);aj(250,1,VI,Jq);_.I=function Kq(){};var Se=PE(tJ,'AtmospherePushConnection/lambda$1$Type',250);aj(365,$wnd.Function,{},Lq);_.eb=function Mq(a,b){bq(this.a,Pc(a),Pc(b))};aj(253,1,VI,Nq);_.I=function Oq(){cq(this.a)};var Te=PE(tJ,'AtmospherePushConnection/lambda$3$Type',253);var Ve=RE(tJ,'ConnectionStateHandler');aj(224,1,{16:1},kr);_.a=0;_.b=null;var _e=PE(tJ,'DefaultConnectionStateHandler',224);aj(226,41,{},lr);_.N=function mr(){this.a.d=null;Qq(this.a,this.b)};var We=PE(tJ,'DefaultConnectionStateHandler/1',226);aj(63,21,{63:1,4:1,32:1,21:1},sr);_.a=0;var nr,or,pr;var Xe=QE(tJ,'DefaultConnectionStateHandler/Type',63,tr);aj(225,1,uJ,ur);_.sb=function vr(a){Yq(this.a,a)};var Ye=PE(tJ,'DefaultConnectionStateHandler/lambda$0$Type',225);aj(227,1,{},wr);_.nb=function xr(a){Rq(this.a)};var Ze=PE(tJ,'DefaultConnectionStateHandler/lambda$1$Type',227);aj(228,1,{},yr);_.nb=function zr(a){Zq(this.a)};var $e=PE(tJ,'DefaultConnectionStateHandler/lambda$2$Type',228);aj(56,1,{56:1},Er);_.a=-1;var df=PE(tJ,'Heartbeat',56);aj(221,41,{},Fr);_.N=function Gr(){Cr(this.a)};var af=PE(tJ,'Heartbeat/1',221);aj(223,1,{},Hr);_.qb=function Ir(a,b){!b?Wq(Ic(tk(this.a.b,Ve),16),a):Vq(Ic(tk(this.a.b,Ve),16),b);Br(this.a)};_.rb=function Jr(a){Xq(Ic(tk(this.a.b,Ve),16));Br(this.a)};var bf=PE(tJ,'Heartbeat/2',223);aj(222,1,uJ,Kr);_.sb=function Lr(a){Ar(this.a,a)};var cf=PE(tJ,'Heartbeat/lambda$0$Type',222);aj(173,1,{},Pr);_.ib=function Qr(a){ek('firstDelay',pF(Ic(a,27).a))};var ef=PE(tJ,'LoadingIndicatorConfigurator/0methodref$setFirstDelay$Type',173);aj(174,1,{},Rr);_.ib=function Sr(a){ek('secondDelay',pF(Ic(a,27).a))};var ff=PE(tJ,'LoadingIndicatorConfigurator/1methodref$setSecondDelay$Type',174);aj(175,1,{},Tr);_.ib=function Ur(a){ek('thirdDelay',pF(Ic(a,27).a))};var gf=PE(tJ,'LoadingIndicatorConfigurator/2methodref$setThirdDelay$Type',175);aj(176,1,gJ,Vr);_.mb=function Wr(a){Or(SA(Ic(a.e,14)))};var hf=PE(tJ,'LoadingIndicatorConfigurator/lambda$3$Type',176);aj(177,1,gJ,Xr);_.mb=function Yr(a){Nr(this.b,this.a,a)};_.a=0;var jf=PE(tJ,'LoadingIndicatorConfigurator/lambda$4$Type',177);aj(20,1,{20:1},os);_.a=0;_.b='init';_.d=false;_.e=0;_.f=-1;_.i=null;_.m=0;var sf=PE(tJ,'MessageHandler',20);aj(188,1,VI,ts);_.I=function us(){!AA&&$wnd.Polymer!=null&&CF($wnd.Polymer.version.substr(0,'1.'.length),'1.')&&(AA=true,gk&&($wnd.console.log('Polymer micro is now loaded, using Polymer DOM API'),undefined),zA=new CA,undefined)};var kf=PE(tJ,'MessageHandler/0methodref$updateApiImplementation$Type',188);aj(187,41,{},vs);_.N=function ws(){_r(this.a)};var lf=PE(tJ,'MessageHandler/1',187);aj(353,$wnd.Function,{},xs);_.ib=function ys(a){Zr(Ic(a,6))};aj(61,1,{61:1},zs);var mf=PE(tJ,'MessageHandler/PendingUIDLMessage',61);aj(189,1,VI,As);_.I=function Bs(){ks(this.a,this.d,this.b,this.c)};_.c=0;var nf=PE(tJ,'MessageHandler/lambda$1$Type',189);aj(191,1,_I,Cs);_.hb=function Ds(){xC(new Es(this.a,this.b))};var of=PE(tJ,'MessageHandler/lambda$3$Type',191);aj(190,1,_I,Es);_.hb=function Fs(){hs(this.a,this.b)};var pf=PE(tJ,'MessageHandler/lambda$4$Type',190);aj(193,1,_I,Gs);_.hb=function Hs(){is(this.a)};var qf=PE(tJ,'MessageHandler/lambda$5$Type',193);aj(192,1,{},Is);_.I=function Js(){this.a.forEach(cj(xs.prototype.ib,xs,[]))};var rf=PE(tJ,'MessageHandler/lambda$6$Type',192);aj(19,1,{19:1},Ts);_.a=0;_.d=0;var uf=PE(tJ,'MessageSender',19);aj(185,1,VI,Us);_.I=function Vs(){Ls(this.a)};var tf=PE(tJ,'MessageSender/lambda$0$Type',185);aj(168,1,gJ,Ys);_.mb=function Zs(a){Ws(this.a,a)};var vf=PE(tJ,'PollConfigurator/lambda$0$Type',168);aj(74,1,{74:1},bt);_.Db=function ct(){var a;a=Ic(tk(this.b,gg),10);Tv(a,a.e,'ui-poll',null)};_.a=null;var yf=PE(tJ,'Poller',74);aj(170,41,{},dt);_.N=function et(){var a;a=Ic(tk(this.a.b,gg),10);Tv(a,a.e,'ui-poll',null)};var wf=PE(tJ,'Poller/1',170);aj(169,1,uJ,ft);_.sb=function gt(a){$s(this.a,a)};var xf=PE(tJ,'Poller/lambda$0$Type',169);aj(49,1,{49:1},kt);var Cf=PE(tJ,'PushConfiguration',49);aj(233,1,gJ,nt);_.mb=function ot(a){jt(this.a,a)};var zf=PE(tJ,'PushConfiguration/0methodref$onPushModeChange$Type',233);aj(234,1,_I,pt);_.hb=function qt(){Ss(Ic(tk(this.a.a,uf),19),true)};var Af=PE(tJ,'PushConfiguration/lambda$1$Type',234);aj(235,1,_I,rt);_.hb=function st(){Ss(Ic(tk(this.a.a,uf),19),false)};var Bf=PE(tJ,'PushConfiguration/lambda$2$Type',235);aj(359,$wnd.Function,{},tt);_.eb=function ut(a,b){mt(this.a,Ic(a,14),Pc(b))};aj(37,1,{37:1},vt);var Ef=PE(tJ,'ReconnectConfiguration',37);aj(172,1,VI,wt);_.I=function xt(){Pq(this.a)};var Df=PE(tJ,'ReconnectConfiguration/lambda$0$Type',172);aj(13,1,{13:1},Dt);_.b=false;var Gf=PE(tJ,'RequestResponseTracker',13);aj(186,1,{},Et);_.I=function Ft(){Bt(this.a)};var Ff=PE(tJ,'RequestResponseTracker/lambda$0$Type',186);aj(248,337,{},Gt);_.P=function Ht(a){bd(a);null.qc()};_.Q=function It(){return null};var Hf=PE(tJ,'RequestStartingEvent',248);aj(162,337,{},Kt);_.P=function Lt(a){Ic(a,91).ob(this)};_.Q=function Mt(){return Jt};var Jt;var If=PE(tJ,'ResponseHandlingEndedEvent',162);aj(289,337,{},Nt);_.P=function Ot(a){bd(a);null.qc()};_.Q=function Pt(){return null};var Jf=PE(tJ,'ResponseHandlingStartedEvent',289);aj(28,1,{28:1},Yt);_.Eb=function Zt(a,b,c){Qt(this,a,b,c)};_.Fb=function $t(a,b,c){var d;d={};d[RI]='channel';d[GJ]=Object(a);d['channel']=Object(b);d['args']=c;Ut(this,d)};var Kf=PE(tJ,'ServerConnector',28);aj(36,1,{36:1},eu);_.b=false;var _t;var Of=PE(tJ,'ServerRpcQueue',36);aj(215,1,UI,fu);_.N=function gu(){cu(this.a)};var Lf=PE(tJ,'ServerRpcQueue/0methodref$doFlush$Type',215);aj(214,1,UI,hu);_.N=function iu(){au()};var Mf=PE(tJ,'ServerRpcQueue/lambda$0$Type',214);aj(216,1,{},ju);_.I=function ku(){this.a.a.N()};var Nf=PE(tJ,'ServerRpcQueue/lambda$2$Type',216);aj(72,1,{72:1},mu);_.b=false;var Uf=PE(tJ,'XhrConnection',72);aj(232,41,{},ou);_.N=function pu(){nu(this.b)&&this.a.b&&jj(this,250)};var Pf=PE(tJ,'XhrConnection/1',232);aj(229,1,{},ru);_.qb=function su(a,b){var c;c=new yu(a,this.a);if(!b){ir(Ic(tk(this.c.a,Ve),16),c);return}else{gr(Ic(tk(this.c.a,Ve),16),c)}};_.rb=function tu(a){var b,c;nk('Server visit took '+Jn(this.b)+'ms');c=a.responseText;b=rs(ss(c));if(!b){hr(Ic(tk(this.c.a,Ve),16),new yu(a,this.a));return}jr(Ic(tk(this.c.a,Ve),16));gk&&XD($wnd.console,'Received xhr message: '+c);ds(Ic(tk(this.c.a,sf),20),b)};_.b=0;var Qf=PE(tJ,'XhrConnection/XhrResponseHandler',229);aj(230,1,{},uu);_.nb=function vu(a){this.a.b=true};var Rf=PE(tJ,'XhrConnection/lambda$0$Type',230);aj(231,1,hJ,wu);_.ob=function xu(a){this.a.b=false};var Sf=PE(tJ,'XhrConnection/lambda$1$Type',231);aj(105,1,{},yu);var Tf=PE(tJ,'XhrConnectionError',105);aj(58,1,{58:1},Cu);var Vf=PE(JJ,'ConstantPool',58);aj(85,1,{85:1},Ku);_.Gb=function Lu(){return Ic(tk(this.a,ud),9).a};var Zf=PE(JJ,'ExecuteJavaScriptProcessor',85);aj(218,1,EI,Mu);_.U=function Nu(a){var b;return xC(new Ou(this.a,(b=this.b,b))),FE(),true};var Wf=PE(JJ,'ExecuteJavaScriptProcessor/lambda$0$Type',218);aj(217,1,_I,Ou);_.hb=function Pu(){Fu(this.a,this.b)};var Xf=PE(JJ,'ExecuteJavaScriptProcessor/lambda$1$Type',217);aj(219,1,UI,Qu);_.N=function Ru(){Ju(this.a)};var Yf=PE(JJ,'ExecuteJavaScriptProcessor/lambda$2$Type',219);aj(309,1,{},Uu);var _f=PE(JJ,'FragmentHandler',309);aj(310,1,hJ,Wu);_.ob=function Xu(a){Tu(this.a)};var $f=PE(JJ,'FragmentHandler/0methodref$onResponseHandlingEnded$Type',310);aj(308,1,{},Yu);var ag=PE(JJ,'NodeUnregisterEvent',308);aj(183,1,{},fv);_.nb=function gv(a){av(this.a,a)};var bg=PE(JJ,'RouterLinkHandler/lambda$0$Type',183);aj(184,1,VI,hv);_.I=function iv(){Cp(this.a)};var cg=PE(JJ,'RouterLinkHandler/lambda$1$Type',184);aj(6,1,{6:1},vv);_.Hb=function wv(){return mv(this)};_.Ib=function xv(){return this.g};_.d=0;_.i=false;var fg=PE(JJ,'StateNode',6);aj(346,$wnd.Function,{},zv);_.eb=function Av(a,b){pv(this.a,this.b,Ic(a,34),Kc(b))};aj(347,$wnd.Function,{},Bv);_.ib=function Cv(a){yv(this.a,Ic(a,107))};var Jh=RE('elemental.events','EventRemover');aj(152,1,NJ,Dv);_.Jb=function Ev(){qv(this.a,this.b)};var dg=PE(JJ,'StateNode/lambda$2$Type',152);aj(348,$wnd.Function,{},Fv);_.ib=function Gv(a){rv(this.a,Ic(a,67))};aj(153,1,NJ,Hv);_.Jb=function Iv(){sv(this.a,this.b)};var eg=PE(JJ,'StateNode/lambda$4$Type',153);aj(10,1,{10:1},Zv);_.Kb=function $v(){return this.e};_.Lb=function aw(a,b,c,d){var e;if(Ov(this,a)){e=Nc(c);Xt(Ic(tk(this.c,Kf),28),a,b,e,d)}};_.d=false;_.f=false;var gg=PE(JJ,'StateTree',10);aj(351,$wnd.Function,{},bw);_.ib=function cw(a){lv(Ic(a,6),cj(fw.prototype.eb,fw,[]))};aj(352,$wnd.Function,{},dw);_.eb=function ew(a,b){var c;Qv(this.a,(c=Ic(a,6),Kc(b),c))};aj(340,$wnd.Function,{},fw);_.eb=function gw(a,b){_v(Ic(a,34),Kc(b))};var ow,pw;aj(178,1,{},uw);var hg=PE(UJ,'Binder/BinderContextImpl',178);var ig=RE(UJ,'BindingStrategy');aj(80,1,{80:1},zw);_.b=false;_.g=0;var vw;var lg=PE(UJ,'Debouncer',80);aj(339,1,{});_.b=false;_.c=0;var Oh=PE(WJ,'Timer',339);aj(313,339,{},Fw);var jg=PE(UJ,'Debouncer/1',313);aj(314,339,{},Gw);var kg=PE(UJ,'Debouncer/2',314);aj(380,$wnd.Function,{},Iw);_.eb=function Jw(a,b){var c;Hw(this,(c=Oc(a,$wnd.Map),Nc(b),c))};aj(381,$wnd.Function,{},Mw);_.ib=function Nw(a){Kw(this.a,Oc(a,$wnd.Map))};aj(382,$wnd.Function,{},Ow);_.ib=function Pw(a){Lw(this.a,Ic(a,80))};aj(305,1,FI,Tw);_._=function Uw(){return ex(this.a)};var mg=PE(UJ,'ServerEventHandlerBinder/lambda$0$Type',305);aj(306,1,eJ,Vw);_.jb=function Ww(a){Sw(this.b,this.a,this.c,a)};_.c=false;var ng=PE(UJ,'ServerEventHandlerBinder/lambda$1$Type',306);var Xw;aj(255,1,{317:1},dy);_.Mb=function ey(a,b,c){mx(this,a,b,c)};_.Nb=function hy(a){return wx(a)};_.Pb=function my(a,b){var c,d,e;d=Object.keys(a);e=new Xz(d,a,b);c=Ic(b.e.get(pg),77);!c?Ux(e.b,e.a,e.c):(c.a=e)};_.Qb=function ny(r,s){var t=this;var u=s._propertiesChanged;u&&(s._propertiesChanged=function(a,b,c){jI(function(){t.Pb(b,r)})();u.apply(this,arguments)});var v=r.Ib();var w=s.ready;s.ready=function(){w.apply(this,arguments);Hm(s);var q=function(){var o=s.root.querySelector(cK);if(o){s.removeEventListener(dK,q)}else{return}if(!o.constructor.prototype.$propChangedModified){o.constructor.prototype.$propChangedModified=true;var p=o.constructor.prototype._propertiesChanged;o.constructor.prototype._propertiesChanged=function(a,b,c){p.apply(this,arguments);var d=Object.getOwnPropertyNames(b);var e='items.';var f;for(f=0;f0){var i=h.substr(0,g);var j=h.substr(g+1);var k=a.items[i];if(k&&k.nodeId){var l=k.nodeId;var m=k[j];var n=this.__dataHost;while(!n.localName||n.__dataHost){n=n.__dataHost}jI(function(){ly(l,n,j,m,v)})()}}}}}}};s.root&&s.root.querySelector(cK)?q():s.addEventListener(dK,q)}};_.Ob=function oy(a){if(a.c.has(0)){return true}return !!a.g&&K(a,a.g.e)};var gx,hx;var Ug=PE(UJ,'SimpleElementBindingStrategy',255);aj(370,$wnd.Function,{},Dy);_.ib=function Ey(a){Ic(a,45).Jb()};aj(374,$wnd.Function,{},Fy);_.ib=function Gy(a){Ic(a,18).N()};aj(103,1,{},Hy);var og=PE(UJ,'SimpleElementBindingStrategy/BindingContext',103);aj(77,1,{77:1},Iy);var pg=PE(UJ,'SimpleElementBindingStrategy/InitialPropertyUpdate',77);aj(256,1,{},Jy);_.Rb=function Ky(a){Ix(this.a,a)};var qg=PE(UJ,'SimpleElementBindingStrategy/lambda$0$Type',256);aj(257,1,{},Ly);_.Rb=function My(a){Jx(this.a,a)};var rg=PE(UJ,'SimpleElementBindingStrategy/lambda$1$Type',257);aj(366,$wnd.Function,{},Ny);_.eb=function Oy(a,b){var c;py(this.b,this.a,(c=Ic(a,14),Pc(b),c))};aj(266,1,fJ,Py);_.lb=function Qy(a){qy(this.b,this.a,a)};var sg=PE(UJ,'SimpleElementBindingStrategy/lambda$11$Type',266);aj(267,1,gJ,Ry);_.mb=function Sy(a){ay(this.c,this.b,this.a)};var tg=PE(UJ,'SimpleElementBindingStrategy/lambda$12$Type',267);aj(268,1,_I,Ty);_.hb=function Uy(){Kx(this.b,this.c,this.a)};var ug=PE(UJ,'SimpleElementBindingStrategy/lambda$13$Type',268);aj(269,1,VI,Vy);_.I=function Wy(){this.b.Rb(this.a)};var vg=PE(UJ,'SimpleElementBindingStrategy/lambda$14$Type',269);aj(270,1,VI,Xy);_.I=function Yy(){this.a[this.b]=Dm(this.c)};var wg=PE(UJ,'SimpleElementBindingStrategy/lambda$15$Type',270);aj(272,1,eJ,Zy);_.jb=function $y(a){Lx(this.a,a)};var xg=PE(UJ,'SimpleElementBindingStrategy/lambda$16$Type',272);aj(271,1,_I,_y);_.hb=function az(){Dx(this.b,this.a)};var yg=PE(UJ,'SimpleElementBindingStrategy/lambda$17$Type',271);aj(274,1,eJ,bz);_.jb=function cz(a){Mx(this.a,a)};var zg=PE(UJ,'SimpleElementBindingStrategy/lambda$18$Type',274);aj(273,1,_I,dz);_.hb=function ez(){Nx(this.b,this.a)};var Ag=PE(UJ,'SimpleElementBindingStrategy/lambda$19$Type',273);aj(258,1,{},fz);_.Rb=function gz(a){Ox(this.a,a)};var Bg=PE(UJ,'SimpleElementBindingStrategy/lambda$2$Type',258);aj(275,1,UI,hz);_.N=function iz(){Fx(this.a,this.b,this.c,false)};var Cg=PE(UJ,'SimpleElementBindingStrategy/lambda$20$Type',275);aj(276,1,UI,jz);_.N=function kz(){Fx(this.a,this.b,this.c,false)};var Dg=PE(UJ,'SimpleElementBindingStrategy/lambda$21$Type',276);aj(277,1,UI,lz);_.N=function mz(){Hx(this.a,this.b,this.c,false)};var Eg=PE(UJ,'SimpleElementBindingStrategy/lambda$22$Type',277);aj(278,1,FI,nz);_._=function oz(){return ry(this.a,this.b)};var Fg=PE(UJ,'SimpleElementBindingStrategy/lambda$23$Type',278);aj(279,1,FI,pz);_._=function qz(){return sy(this.a,this.b)};var Gg=PE(UJ,'SimpleElementBindingStrategy/lambda$24$Type',279);aj(367,$wnd.Function,{},rz);_.eb=function sz(a,b){var c;lC((c=Ic(a,75),Pc(b),c))};aj(368,$wnd.Function,{},tz);_.ib=function uz(a){ty(this.a,Oc(a,$wnd.Map))};aj(369,$wnd.Function,{},vz);_.eb=function wz(a,b){var c;(c=Ic(a,45),Pc(b),c).Jb()};aj(259,1,{107:1},xz);_.kb=function yz(a){Vx(this.c,this.b,this.a)};var Hg=PE(UJ,'SimpleElementBindingStrategy/lambda$3$Type',259);aj(371,$wnd.Function,{},zz);_.eb=function Az(a,b){var c;Px(this.a,(c=Ic(a,14),Pc(b),c))};aj(280,1,fJ,Bz);_.lb=function Cz(a){Qx(this.a,a)};var Ig=PE(UJ,'SimpleElementBindingStrategy/lambda$31$Type',280);aj(281,1,VI,Dz);_.I=function Ez(){Rx(this.b,this.a,this.c)};var Jg=PE(UJ,'SimpleElementBindingStrategy/lambda$32$Type',281);aj(282,1,{},Fz);_.nb=function Gz(a){Sx(this.a,a)};var Kg=PE(UJ,'SimpleElementBindingStrategy/lambda$33$Type',282);aj(372,$wnd.Function,{},Hz);_.ib=function Iz(a){Tx(this.a,this.b,Pc(a))};aj(283,1,{},Kz);_.ib=function Lz(a){Jz(this,a)};var Lg=PE(UJ,'SimpleElementBindingStrategy/lambda$35$Type',283);aj(284,1,eJ,Mz);_.jb=function Nz(a){vy(this.a,a)};var Mg=PE(UJ,'SimpleElementBindingStrategy/lambda$37$Type',284);aj(285,1,FI,Oz);_._=function Pz(){return this.a.b};var Ng=PE(UJ,'SimpleElementBindingStrategy/lambda$38$Type',285);aj(373,$wnd.Function,{},Qz);_.ib=function Rz(a){this.a.push(Ic(a,6))};aj(261,1,_I,Sz);_.hb=function Tz(){wy(this.a)};var Og=PE(UJ,'SimpleElementBindingStrategy/lambda$4$Type',261);aj(260,1,{},Uz);_.I=function Vz(){xy(this.a)};var Pg=PE(UJ,'SimpleElementBindingStrategy/lambda$5$Type',260);aj(263,1,UI,Xz);_.N=function Yz(){Wz(this)};var Qg=PE(UJ,'SimpleElementBindingStrategy/lambda$6$Type',263);aj(262,1,FI,Zz);_._=function $z(){return this.a[this.b]};var Rg=PE(UJ,'SimpleElementBindingStrategy/lambda$7$Type',262);aj(265,1,fJ,_z);_.lb=function aA(a){wC(new bA(this.a))};var Sg=PE(UJ,'SimpleElementBindingStrategy/lambda$8$Type',265);aj(264,1,_I,bA);_.hb=function cA(){lx(this.a)};var Tg=PE(UJ,'SimpleElementBindingStrategy/lambda$9$Type',264);aj(286,1,{317:1},hA);_.Mb=function iA(a,b,c){fA(a,b)};_.Nb=function jA(a){return $doc.createTextNode('')};_.Ob=function kA(a){return a.c.has(7)};var dA;var Xg=PE(UJ,'TextBindingStrategy',286);aj(287,1,VI,lA);_.I=function mA(){eA();RD(this.a,Pc(PA(this.b)))};var Vg=PE(UJ,'TextBindingStrategy/lambda$0$Type',287);aj(288,1,{107:1},nA);_.kb=function oA(a){gA(this.b,this.a)};var Wg=PE(UJ,'TextBindingStrategy/lambda$1$Type',288);aj(345,$wnd.Function,{},tA);_.ib=function uA(a){this.a.add(a)};aj(349,$wnd.Function,{},wA);_.eb=function xA(a,b){this.a.push(a)};var zA,AA=false;aj(297,1,{},CA);var Yg=PE('com.vaadin.client.flow.dom','PolymerDomApiImpl',297);aj(78,1,{78:1},DA);var Zg=PE('com.vaadin.client.flow.model','UpdatableModelProperties',78);aj(379,$wnd.Function,{},EA);_.ib=function FA(a){this.a.add(Pc(a))};aj(87,1,{});_.Sb=function HA(){return this.e};var yh=PE($I,'ReactiveValueChangeEvent',87);aj(53,87,{53:1},IA);_.Sb=function JA(){return Ic(this.e,30)};_.b=false;_.c=0;var $g=PE(eK,'ListSpliceEvent',53);aj(14,1,{14:1,318:1},YA);_.Tb=function ZA(a){return _A(this.a,a)};_.b=false;_.c=false;_.d=false;var KA;var ih=PE(eK,'MapProperty',14);aj(86,1,{});var xh=PE($I,'ReactiveEventRouter',86);aj(241,86,{},fB);_.Ub=function gB(a,b){Ic(a,46).mb(Ic(b,79))};_.Vb=function hB(a){return new iB(a)};var ah=PE(eK,'MapProperty/1',241);aj(242,1,gJ,iB);_.mb=function jB(a){jC(this.a)};var _g=PE(eK,'MapProperty/1/0methodref$onValueChange$Type',242);aj(240,1,UI,kB);_.N=function lB(){LA()};var bh=PE(eK,'MapProperty/lambda$0$Type',240);aj(243,1,_I,mB);_.hb=function nB(){this.a.d=false};var dh=PE(eK,'MapProperty/lambda$1$Type',243);aj(244,1,_I,oB);_.hb=function pB(){this.a.d=false};var eh=PE(eK,'MapProperty/lambda$2$Type',244);aj(245,1,UI,qB);_.N=function rB(){UA(this.a,this.b)};var fh=PE(eK,'MapProperty/lambda$3$Type',245);aj(88,87,{88:1},sB);_.Sb=function tB(){return Ic(this.e,42)};var gh=PE(eK,'MapPropertyAddEvent',88);aj(79,87,{79:1},uB);_.Sb=function vB(){return Ic(this.e,14)};var hh=PE(eK,'MapPropertyChangeEvent',79);aj(34,1,{34:1});_.d=0;var jh=PE(eK,'NodeFeature',34);aj(30,34,{34:1,30:1,318:1},DB);_.Tb=function EB(a){return _A(this.a,a)};_.Wb=function FB(a){var b,c,d;c=[];for(b=0;b=0?':'+this.c:'')+')'};_.c=0;var mi=PE(nI,'StackTraceElement',31);Gc={4:1,113:1,32:1,2:1};var pi=PE(nI,'String',2);aj(69,84,{113:1},UF,VF,WF);var ni=PE(nI,'StringBuilder',69);aj(126,70,rI,XF);var oi=PE(nI,'StringIndexOutOfBoundsException',126);aj(494,1,{});var YF;aj(108,1,EI,_F);_.U=function aG(a){return $F(a)};var qi=PE(nI,'Throwable/lambda$0$Type',108);aj(96,8,rI,bG);var si=PE(nI,'UnsupportedOperationException',96);aj(334,1,{106:1});_.dc=function cG(a){throw Ui(new bG('Add not supported on this collection'))};_.u=function dG(){var a,b,c;c=new cH;for(b=this.ec();b.hc();){a=b.ic();bH(c,a===this?'(this Collection)':a==null?sI:ej(a))}return !c.a?c.c:c.e.length==0?c.a.a:c.a.a+(''+c.e)};var ti=PE(rK,'AbstractCollection',334);aj(335,334,{106:1,93:1});_.gc=function eG(a,b){throw Ui(new bG('Add not supported on this list'))};_.dc=function fG(a){this.gc(this.fc(),a);return true};_.r=function gG(a){var b,c,d,e,f;if(a===this){return true}if(!Sc(a,40)){return false}f=Ic(a,93);if(this.a.length!=f.a.length){return false}e=new wG(f);for(c=new wG(this);c.a Element[]; -export declare const licenseCheckOk: (data: Product) => void; -export declare const licenseCheckFailed: (data: ProductAndMessage) => void; -export declare const licenseCheckNoKey: (data: ProductAndMessage) => void; -export declare const licenseInit: () => void; diff --git a/java/demo/frontend/generated/jar-resources/License.js b/java/demo/frontend/generated/jar-resources/License.js deleted file mode 100644 index 5f0f61782..000000000 --- a/java/demo/frontend/generated/jar-resources/License.js +++ /dev/null @@ -1,110 +0,0 @@ -const noLicenseFallbackTimeout = 1000; -export const findAll = (element, tags) => { - const lightDom = Array.from(element.querySelectorAll(tags.join(', '))); - const shadowDom = Array.from(element.querySelectorAll('*')) - .filter((e) => e.shadowRoot) - .flatMap((e) => findAll(e.shadowRoot, tags)); - return [...lightDom, ...shadowDom]; -}; -let licenseCheckListener = false; -const showNoLicenseFallback = (element, productAndMessage) => { - if (!licenseCheckListener) { - // When a license check has succeeded, refresh so that all elements are properly shown again - window.addEventListener('message', (e) => { - if (e.data === 'validate-license') { - window.location.reload(); - } - }, false); - licenseCheckListener = true; - } - const overlay = element._overlayElement; - if (overlay) { - if (overlay.shadowRoot) { - const defaultSlot = overlay.shadowRoot.querySelector('slot:not([name])'); - if (defaultSlot && defaultSlot.assignedElements().length > 0) { - showNoLicenseFallback(defaultSlot.assignedElements()[0], productAndMessage); - return; - } - } - showNoLicenseFallback(overlay, productAndMessage); - return; - } - const htmlMessage = productAndMessage.messageHtml - ? productAndMessage.messageHtml - : `${productAndMessage.message}

Component: ${productAndMessage.product.name} ${productAndMessage.product.version}

`.replace(/https:([^ ]*)/g, "https:$1"); - if (element.isConnected) { - element.outerHTML = `
${htmlMessage}
`; - } -}; -const productTagNames = {}; -const productChecking = {}; -const productMissingLicense = {}; -const productCheckOk = {}; -const key = (product) => { - return `${product.name}_${product.version}`; -}; -const checkLicenseIfNeeded = (cvdlElement) => { - var _a; - const { cvdlName, version } = cvdlElement.constructor; - const product = { name: cvdlName, version }; - const tagName = cvdlElement.tagName.toLowerCase(); - productTagNames[cvdlName] = (_a = productTagNames[cvdlName]) !== null && _a !== void 0 ? _a : []; - productTagNames[cvdlName].push(tagName); - const failedLicenseCheck = productMissingLicense[key(product)]; - if (failedLicenseCheck) { - // Has been checked and the check failed - setTimeout(() => showNoLicenseFallback(cvdlElement, failedLicenseCheck), noLicenseFallbackTimeout); - } - if (productMissingLicense[key(product)] || productCheckOk[key(product)]) { - // Already checked - } - else if (!productChecking[key(product)]) { - // Has not been checked - productChecking[key(product)] = true; - window.Vaadin.devTools.checkLicense(product); - } -}; -export const licenseCheckOk = (data) => { - productCheckOk[key(data)] = true; - // eslint-disable-next-line no-console - console.debug('License check ok for', data); -}; -export const licenseCheckFailed = (data) => { - const productName = data.product.name; - productMissingLicense[key(data.product)] = data; - // eslint-disable-next-line no-console - console.error('License check failed for', productName); - const tags = productTagNames[productName]; - if ((tags === null || tags === void 0 ? void 0 : tags.length) > 0) { - findAll(document, tags).forEach((element) => { - setTimeout(() => showNoLicenseFallback(element, productMissingLicense[key(data.product)]), noLicenseFallbackTimeout); - }); - } -}; -export const licenseCheckNoKey = (data) => { - const keyUrl = data.message; - const productName = data.product.name; - data.messageHtml = `No license found. Go here to start a trial or retrieve your license.`; - productMissingLicense[key(data.product)] = data; - // eslint-disable-next-line no-console - console.error('No license found when checking', productName); - const tags = productTagNames[productName]; - if ((tags === null || tags === void 0 ? void 0 : tags.length) > 0) { - findAll(document, tags).forEach((element) => { - setTimeout(() => showNoLicenseFallback(element, productMissingLicense[key(data.product)]), noLicenseFallbackTimeout); - }); - } -}; -export const licenseInit = () => { - // Process already registered elements - window.Vaadin.devTools.createdCvdlElements.forEach((element) => { - checkLicenseIfNeeded(element); - }); - // Handle new elements directly - window.Vaadin.devTools.createdCvdlElements = { - push: (element) => { - checkLicenseIfNeeded(element); - } - }; -}; -//# sourceMappingURL=License.js.map \ No newline at end of file diff --git a/java/demo/frontend/generated/jar-resources/License.js.map b/java/demo/frontend/generated/jar-resources/License.js.map deleted file mode 100644 index 49a8674cd..000000000 --- a/java/demo/frontend/generated/jar-resources/License.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"License.js","sourceRoot":"","sources":["../../../../src/main/frontend/License.ts"],"names":[],"mappings":"AAAA,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAatC,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,OAAwC,EAAE,IAAc,EAAa,EAAE;IAC7F,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACvE,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;SACxD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;SAC3B,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,UAAW,EAAE,IAAI,CAAC,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,QAAQ,EAAE,GAAG,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AAC;IACtC,IAAI,CAAC,WAAW,GAAG,sGAAsG,MAAM,0DAA0D,CAAC;IAC1L,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAChD,sCAAsC;IACtC,OAAO,CAAC,KAAK,CAAC,gCAAgC,EAAE,WAAW,CAAC,CAAC;IAE7D,MAAM,IAAI,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;IAC1C,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,IAAG,CAAC,EAAE;QACpB,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC1C,UAAU,CACR,GAAG,EAAE,CAAC,qBAAqB,CAAC,OAAO,EAAE,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAC9E,wBAAwB,CACzB,CAAC;QACJ,CAAC,CAAC,CAAC;KACJ;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE;IAC9B,sCAAsC;IACrC,MAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,OAAgB,EAAE,EAAE;QAC/E,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,+BAA+B;IAC9B,MAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,GAAG;QACpD,IAAI,EAAE,CAAC,OAAgB,EAAE,EAAE;YACzB,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["const noLicenseFallbackTimeout = 1000;\n\nexport interface Product {\n name: string;\n version: string;\n}\n\nexport interface ProductAndMessage {\n message: string;\n messageHtml?: string;\n product: Product;\n}\n\nexport const findAll = (element: Element | ShadowRoot | Document, tags: string[]): Element[] => {\n const lightDom = Array.from(element.querySelectorAll(tags.join(', ')));\n const shadowDom = Array.from(element.querySelectorAll('*'))\n .filter((e) => e.shadowRoot)\n .flatMap((e) => findAll(e.shadowRoot!, tags));\n return [...lightDom, ...shadowDom];\n};\n\nlet licenseCheckListener = false;\n\nconst showNoLicenseFallback = (element: Element, productAndMessage: ProductAndMessage) => {\n if (!licenseCheckListener) {\n // When a license check has succeeded, refresh so that all elements are properly shown again\n window.addEventListener(\n 'message',\n (e) => {\n if (e.data === 'validate-license') {\n window.location.reload();\n }\n },\n false\n );\n licenseCheckListener = true;\n }\n const overlay = (element as any)._overlayElement;\n if (overlay) {\n if (overlay.shadowRoot) {\n const defaultSlot = overlay.shadowRoot.querySelector('slot:not([name])');\n if (defaultSlot && defaultSlot.assignedElements().length > 0) {\n showNoLicenseFallback(defaultSlot.assignedElements()[0], productAndMessage);\n return;\n }\n }\n showNoLicenseFallback(overlay, productAndMessage);\n return;\n }\n\n const htmlMessage = productAndMessage.messageHtml\n ? productAndMessage.messageHtml\n : `${productAndMessage.message}

Component: ${productAndMessage.product.name} ${productAndMessage.product.version}

`.replace(\n /https:([^ ]*)/g,\n \"https:$1\"\n );\n\n if (element.isConnected) {\n element.outerHTML = `
${htmlMessage}
`;\n }\n};\n\nconst productTagNames: Record = {};\nconst productChecking: Record = {};\nconst productMissingLicense: Record = {};\nconst productCheckOk: Record = {};\n\nconst key = (product: Product): string => {\n return `${product.name}_${product.version}`;\n};\n\nconst checkLicenseIfNeeded = (cvdlElement: Element) => {\n const { cvdlName, version } = cvdlElement.constructor as CustomElementConstructor & {\n cvdlName: string;\n version: string;\n };\n const product: Product = { name: cvdlName, version };\n const tagName = cvdlElement.tagName.toLowerCase();\n productTagNames[cvdlName] = productTagNames[cvdlName] ?? [];\n productTagNames[cvdlName].push(tagName);\n\n const failedLicenseCheck = productMissingLicense[key(product)];\n if (failedLicenseCheck) {\n // Has been checked and the check failed\n setTimeout(() => showNoLicenseFallback(cvdlElement, failedLicenseCheck), noLicenseFallbackTimeout);\n }\n\n if (productMissingLicense[key(product)] || productCheckOk[key(product)]) {\n // Already checked\n } else if (!productChecking[key(product)]) {\n // Has not been checked\n productChecking[key(product)] = true;\n (window as any).Vaadin.devTools.checkLicense(product);\n }\n};\n\nexport const licenseCheckOk = (data: Product) => {\n productCheckOk[key(data)] = true;\n\n // eslint-disable-next-line no-console\n console.debug('License check ok for', data);\n};\n\nexport const licenseCheckFailed = (data: ProductAndMessage) => {\n const productName = data.product.name;\n productMissingLicense[key(data.product)] = data;\n // eslint-disable-next-line no-console\n console.error('License check failed for', productName);\n\n const tags = productTagNames[productName];\n if (tags?.length > 0) {\n findAll(document, tags).forEach((element) => {\n setTimeout(\n () => showNoLicenseFallback(element, productMissingLicense[key(data.product)]),\n noLicenseFallbackTimeout\n );\n });\n }\n};\n\nexport const licenseCheckNoKey = (data: ProductAndMessage) => {\n const keyUrl = data.message;\n\n const productName = data.product.name;\n data.messageHtml = `No license found. Go here to start a trial or retrieve your license.`;\n productMissingLicense[key(data.product)] = data;\n // eslint-disable-next-line no-console\n console.error('No license found when checking', productName);\n\n const tags = productTagNames[productName];\n if (tags?.length > 0) {\n findAll(document, tags).forEach((element) => {\n setTimeout(\n () => showNoLicenseFallback(element, productMissingLicense[key(data.product)]),\n noLicenseFallbackTimeout\n );\n });\n }\n};\n\nexport const licenseInit = () => {\n // Process already registered elements\n (window as any).Vaadin.devTools.createdCvdlElements.forEach((element: Element) => {\n checkLicenseIfNeeded(element);\n });\n\n // Handle new elements directly\n (window as any).Vaadin.devTools.createdCvdlElements = {\n push: (element: Element) => {\n checkLicenseIfNeeded(element);\n }\n };\n};\n"]} \ No newline at end of file diff --git a/java/demo/frontend/generated/jar-resources/comboBoxConnector.js b/java/demo/frontend/generated/jar-resources/comboBoxConnector.js deleted file mode 100644 index 1168c0fbe..000000000 --- a/java/demo/frontend/generated/jar-resources/comboBoxConnector.js +++ /dev/null @@ -1,284 +0,0 @@ -import { Debouncer } from '@polymer/polymer/lib/utils/debounce.js'; -import { timeOut } from '@polymer/polymer/lib/utils/async.js'; -import { ComboBoxPlaceholder } from '@vaadin/combo-box/src/vaadin-combo-box-placeholder.js'; - -(function () { - const tryCatchWrapper = function (callback) { - return window.Vaadin.Flow.tryCatchWrapper(callback, 'Vaadin Combo Box'); - }; - - window.Vaadin.Flow.comboBoxConnector = { - initLazy: (comboBox) => - tryCatchWrapper(function (comboBox) { - // Check whether the connector was already initialized for the ComboBox - if (comboBox.$connector) { - return; - } - - comboBox.$connector = {}; - - // holds pageIndex -> callback pairs of subsequent indexes (current active range) - const pageCallbacks = {}; - let cache = {}; - let lastFilter = ''; - const placeHolder = new window.Vaadin.ComboBoxPlaceholder(); - - const serverFacade = (() => { - // Private variables - let lastFilterSentToServer = ''; - let dataCommunicatorResetNeeded = false; - - // Public methods - const needsDataCommunicatorReset = () => (dataCommunicatorResetNeeded = true); - const getLastFilterSentToServer = () => lastFilterSentToServer; - const requestData = (startIndex, endIndex, params) => { - const count = endIndex - startIndex; - const filter = params.filter; - - comboBox.$server.setRequestedRange(startIndex, count, filter); - lastFilterSentToServer = filter; - if (dataCommunicatorResetNeeded) { - comboBox.$server.resetDataCommunicator(); - dataCommunicatorResetNeeded = false; - } - }; - - return { - needsDataCommunicatorReset, - getLastFilterSentToServer, - requestData - }; - })(); - - const clearPageCallbacks = (pages = Object.keys(pageCallbacks)) => { - // Flush and empty the existing requests - pages.forEach((page) => { - pageCallbacks[page]([], comboBox.size); - delete pageCallbacks[page]; - - // Empty the comboBox's internal cache without invoking observers by filling - // the filteredItems array with placeholders (comboBox will request for data when it - // encounters a placeholder) - const pageStart = parseInt(page) * comboBox.pageSize; - const pageEnd = pageStart + comboBox.pageSize; - const end = Math.min(pageEnd, comboBox.filteredItems.length); - for (let i = pageStart; i < end; i++) { - comboBox.filteredItems[i] = placeHolder; - } - }); - }; - - comboBox.dataProvider = function (params, callback) { - if (params.pageSize != comboBox.pageSize) { - throw 'Invalid pageSize'; - } - - if (comboBox._clientSideFilter) { - // For clientside filter we first make sure we have all data which we also - // filter based on comboBox.filter. While later we only filter clientside data. - - if (cache[0]) { - performClientSideFilter(cache[0], params.filter, callback); - return; - } else { - // If client side filter is enabled then we need to first ask all data - // and filter it on client side, otherwise next time when user will - // input another filter, eg. continue to type, the local cache will be only - // what was received for the first filter, which may not be the whole - // data from server (keep in mind that client side filter is enabled only - // when the items count does not exceed one page). - params.filter = ''; - } - } - - const filterChanged = params.filter !== lastFilter; - if (filterChanged) { - cache = {}; - lastFilter = params.filter; - this._filterDebouncer = Debouncer.debounce(this._filterDebouncer, timeOut.after(500), () => { - if (serverFacade.getLastFilterSentToServer() === params.filter) { - // Fixes the case when the filter changes - // to something else and back to the original value - // within debounce timeout, and the - // DataCommunicator thinks it doesn't need to send data - serverFacade.needsDataCommunicatorReset(); - } - if (params.filter !== lastFilter) { - throw new Error("Expected params.filter to be '" + lastFilter + "' but was '" + params.filter + "'"); - } - // Remove the debouncer before clearing page callbacks. - // This makes sure that they are executed. - this._filterDebouncer = undefined; - // Call the method again after debounce. - clearPageCallbacks(); - comboBox.dataProvider(params, callback); - }); - return; - } - - // Postpone the execution of new callbacks if there is an active debouncer. - // They will be executed when the page callbacks are cleared within the debouncer. - if (this._filterDebouncer) { - pageCallbacks[params.page] = callback; - return; - } - - if (cache[params.page]) { - // This may happen after skipping pages by scrolling fast - commitPage(params.page, callback); - } else { - pageCallbacks[params.page] = callback; - const maxRangeCount = Math.max(params.pageSize * 2, 500); // Max item count in active range - const activePages = Object.keys(pageCallbacks).map((page) => parseInt(page)); - const rangeMin = Math.min(...activePages); - const rangeMax = Math.max(...activePages); - - if (activePages.length * params.pageSize > maxRangeCount) { - if (params.page === rangeMin) { - clearPageCallbacks([String(rangeMax)]); - } else { - clearPageCallbacks([String(rangeMin)]); - } - comboBox.dataProvider(params, callback); - } else if (rangeMax - rangeMin + 1 !== activePages.length) { - // Wasn't a sequential page index, clear the cache so combo-box will request for new pages - clearPageCallbacks(); - } else { - // The requested page was sequential, extend the requested range - const startIndex = params.pageSize * rangeMin; - const endIndex = params.pageSize * (rangeMax + 1); - - serverFacade.requestData(startIndex, endIndex, params); - } - } - }; - - comboBox.$connector.clear = tryCatchWrapper((start, length) => { - const firstPageToClear = Math.floor(start / comboBox.pageSize); - const numberOfPagesToClear = Math.ceil(length / comboBox.pageSize); - - for (let i = firstPageToClear; i < firstPageToClear + numberOfPagesToClear; i++) { - delete cache[i]; - } - }); - - comboBox.$connector.filter = tryCatchWrapper(function (item, filter) { - filter = filter ? filter.toString().toLowerCase() : ''; - return comboBox._getItemLabel(item, comboBox.itemLabelPath).toString().toLowerCase().indexOf(filter) > -1; - }); - - comboBox.$connector.set = tryCatchWrapper(function (index, items, filter) { - if (filter != serverFacade.getLastFilterSentToServer()) { - return; - } - - if (index % comboBox.pageSize != 0) { - throw 'Got new data to index ' + index + ' which is not aligned with the page size of ' + comboBox.pageSize; - } - - if (index === 0 && items.length === 0 && pageCallbacks[0]) { - // Makes sure that the dataProvider callback is called even when server - // returns empty data set (no items match the filter). - cache[0] = []; - return; - } - - const firstPageToSet = index / comboBox.pageSize; - const updatedPageCount = Math.ceil(items.length / comboBox.pageSize); - - for (let i = 0; i < updatedPageCount; i++) { - let page = firstPageToSet + i; - let slice = items.slice(i * comboBox.pageSize, (i + 1) * comboBox.pageSize); - - cache[page] = slice; - } - }); - - comboBox.$connector.updateData = tryCatchWrapper(function (items) { - const itemsMap = new Map(items.map((item) => [item.key, item])); - - comboBox.filteredItems = comboBox.filteredItems.map((item) => { - return itemsMap.get(item.key) || item; - }); - }); - - comboBox.$connector.updateSize = tryCatchWrapper(function (newSize) { - if (!comboBox._clientSideFilter) { - // FIXME: It may be that this size set is unnecessary, since when - // providing data to combobox via callback we may use data's size. - // However, if this size reflect the whole data size, including - // data not fetched yet into client side, and combobox expect it - // to be set as such, the at least, we don't need it in case the - // filter is clientSide only, since it'll increase the height of - // the popup at only at first user filter to this size, while the - // filtered items count are less. - comboBox.size = newSize; - } - }); - - comboBox.$connector.reset = tryCatchWrapper(function () { - clearPageCallbacks(); - cache = {}; - comboBox.clearCache(); - }); - - comboBox.$connector.confirm = tryCatchWrapper(function (id, filter) { - if (filter != serverFacade.getLastFilterSentToServer()) { - return; - } - - // We're done applying changes from this batch, resolve pending - // callbacks - let activePages = Object.getOwnPropertyNames(pageCallbacks); - for (let i = 0; i < activePages.length; i++) { - let page = activePages[i]; - - if (cache[page]) { - commitPage(page, pageCallbacks[page]); - } - } - - // Let server know we're done - comboBox.$server.confirmUpdate(id); - }); - - const commitPage = tryCatchWrapper(function (page, callback) { - let data = cache[page]; - - if (comboBox._clientSideFilter) { - performClientSideFilter(data, comboBox.filter, callback); - } else { - // Remove the data if server-side filtering, but keep it for client-side - // filtering - delete cache[page]; - - // FIXME: It may be that we ought to provide data.length instead of - // comboBox.size and remove updateSize function. - callback(data, comboBox.size); - } - }); - - // Perform filter on client side (here) using the items from specified page - // and submitting the filtered items to specified callback. - // The filter used is the one from combobox, not the lastFilter stored since - // that may not reflect user's input. - const performClientSideFilter = tryCatchWrapper(function (page, filter, callback) { - let filteredItems = page; - - if (filter) { - filteredItems = page.filter((item) => comboBox.$connector.filter(item, filter)); - } - - callback(filteredItems, filteredItems.length); - }); - - // Prevent setting the custom value as the 'value'-prop automatically - comboBox.addEventListener( - 'custom-value-set', - tryCatchWrapper((e) => e.preventDefault()) - ); - })(comboBox) - }; -})(); - -window.Vaadin.ComboBoxPlaceholder = ComboBoxPlaceholder; diff --git a/java/demo/frontend/generated/jar-resources/confirmDialogConnector.js b/java/demo/frontend/generated/jar-resources/confirmDialogConnector.js deleted file mode 100644 index 98fea9124..000000000 --- a/java/demo/frontend/generated/jar-resources/confirmDialogConnector.js +++ /dev/null @@ -1,40 +0,0 @@ -(function () { - function copyClassName(dialog) { - const overlay = dialog._overlayElement; - if (overlay) { - overlay.className = dialog.className; - } - } - - const observer = new MutationObserver((records) => { - records.forEach((mutation) => { - if (mutation.type === 'attributes' && mutation.attributeName === 'class') { - copyClassName(mutation.target); - } - }); - }); - - window.Vaadin.Flow.confirmDialogConnector = { - initLazy: function (dialog) { - if (dialog.$connector) { - return; - } - - dialog.$connector = {}; - - dialog.addEventListener('opened-changed', (e) => { - if (e.detail.value) { - copyClassName(dialog); - } - }); - - observer.observe(dialog, { - attributes: true, - attributeFilter: ['class'] - }); - - // Copy initial class - copyClassName(dialog); - } - }; -})(); diff --git a/java/demo/frontend/generated/jar-resources/contextMenuConnector.js b/java/demo/frontend/generated/jar-resources/contextMenuConnector.js deleted file mode 100644 index edbd5a523..000000000 --- a/java/demo/frontend/generated/jar-resources/contextMenuConnector.js +++ /dev/null @@ -1,117 +0,0 @@ -(function () { - function tryCatchWrapper(callback) { - return window.Vaadin.Flow.tryCatchWrapper(callback, 'Vaadin Context Menu'); - } - - function getContainer(appId, nodeId) { - try { - return window.Vaadin.Flow.clients[appId].getByNodeId(nodeId); - } catch (error) { - console.error('Could not get node %s from app %s', nodeId, appId); - console.error(error); - } - } - - /** - * Initializes the connector for a context menu element. - * - * @param {HTMLElement} contextMenu - * @param {string} appId - */ - function initLazy(contextMenu, appId) { - if (contextMenu.$connector) { - return; - } - - contextMenu.$connector = { - /** - * Generates and assigns the items to the context menu. - * - * @param {number} nodeId - */ - generateItems: tryCatchWrapper((nodeId) => { - const items = generateItemsTree(appId, nodeId); - - contextMenu.items = items; - }) - }; - } - - /** - * Generates an items tree compatible with the context-menu web component - * by traversing the given Flow DOM tree of context menu item nodes - * whose root node is identified by the `nodeId` argument. - * - * The app id is required to access the store of Flow DOM nodes. - * - * @param {string} appId - * @param {number} nodeId - */ - function generateItemsTree(appId, nodeId) { - const container = getContainer(appId, nodeId); - if (!container) { - return; - } - - return Array.from(container.children).map((child) => { - const item = { - component: child, - checked: child._checked, - theme: child.__theme - }; - if (child.localName == 'vaadin-context-menu-item' && child._containerNodeId) { - item.children = generateItemsTree(appId, child._containerNodeId); - } - child._item = item; - return item; - }); - } - - /** - * Sets the checked state for a context menu item. - * - * This method is supposed to be called when the context menu item is closed, - * so there is no need for triggering a re-render eagarly. - * - * @param {HTMLElement} component - * @param {boolean} checked - */ - function setChecked(component, checked) { - if (component._item) { - component._item.checked = checked; - } - } - - /** - * Sets the theme for a context menu item. - * - * This method is supposed to be called when the context menu item is closed, - * so there is no need for triggering a re-render eagarly. - * - * @param {HTMLElement} component - * @param {string | undefined | null} theme - */ - function setTheme(component, theme) { - if (component._item) { - component._item.theme = theme; - } - } - - window.Vaadin.Flow.contextMenuConnector = { - initLazy(...args) { - return tryCatchWrapper(initLazy)(...args); - }, - - generateItemsTree(...args) { - return tryCatchWrapper(generateItemsTree)(...args); - }, - - setChecked(...args) { - return tryCatchWrapper(setChecked)(...args); - }, - - setTheme(...args) { - return tryCatchWrapper(setTheme)(...args); - } - }; -})(); diff --git a/java/demo/frontend/generated/jar-resources/contextMenuTargetConnector.js b/java/demo/frontend/generated/jar-resources/contextMenuTargetConnector.js deleted file mode 100644 index 9e2b3bb70..000000000 --- a/java/demo/frontend/generated/jar-resources/contextMenuTargetConnector.js +++ /dev/null @@ -1,70 +0,0 @@ -import * as Gestures from '@vaadin/component-base/src/gestures.js'; - -(function () { - function tryCatchWrapper(callback) { - return window.Vaadin.Flow.tryCatchWrapper(callback, 'Vaadin Context Menu Target'); - } - - function init(target) { - if (target.$contextMenuTargetConnector) { - return; - } - - target.$contextMenuTargetConnector = { - openOnHandler: tryCatchWrapper(function (e) { - e.preventDefault(); - e.stopPropagation(); - this.$contextMenuTargetConnector.openEvent = e; - let detail = {}; - if (target.getContextMenuBeforeOpenDetail) { - detail = target.getContextMenuBeforeOpenDetail(e); - } - target.dispatchEvent( - new CustomEvent('vaadin-context-menu-before-open', { - detail: detail - }) - ); - }), - - updateOpenOn: tryCatchWrapper(function (eventType) { - this.removeListener(); - this.openOnEventType = eventType; - - customElements.whenDefined('vaadin-context-menu').then( - tryCatchWrapper(() => { - if (Gestures.gestures[eventType]) { - Gestures.addListener(target, eventType, this.openOnHandler); - } else { - target.addEventListener(eventType, this.openOnHandler); - } - }) - ); - }), - - removeListener: tryCatchWrapper(function () { - if (this.openOnEventType) { - if (Gestures.gestures[this.openOnEventType]) { - Gestures.removeListener(target, this.openOnEventType, this.openOnHandler); - } else { - target.removeEventListener(this.openOnEventType, this.openOnHandler); - } - } - }), - - openMenu: tryCatchWrapper(function (contextMenu) { - contextMenu.open(this.openEvent); - }), - - removeConnector: tryCatchWrapper(function () { - this.removeListener(); - target.$contextMenuTargetConnector = undefined; - }) - }; - } - - window.Vaadin.Flow.contextMenuTargetConnector = { - init(...args) { - return tryCatchWrapper(init)(...args); - } - }; -})(); diff --git a/java/demo/frontend/generated/jar-resources/copy-to-clipboard.js b/java/demo/frontend/generated/jar-resources/copy-to-clipboard.js deleted file mode 100644 index 475842a87..000000000 --- a/java/demo/frontend/generated/jar-resources/copy-to-clipboard.js +++ /dev/null @@ -1,150 +0,0 @@ -"use strict"; - -var deselectCurrent = function () { - var selection = document.getSelection(); - if (!selection.rangeCount) { - return function () {}; - } - var active = document.activeElement; - - var ranges = []; - for (var i = 0; i < selection.rangeCount; i++) { - ranges.push(selection.getRangeAt(i)); - } - - switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML - case 'INPUT': - case 'TEXTAREA': - active.blur(); - break; - - default: - active = null; - break; - } - - selection.removeAllRanges(); - return function () { - selection.type === 'Caret' && - selection.removeAllRanges(); - - if (!selection.rangeCount) { - ranges.forEach(function(range) { - selection.addRange(range); - }); - } - - active && - active.focus(); - }; -}; - - -var clipboardToIE11Formatting = { - "text/plain": "Text", - "text/html": "Url", - "default": "Text" -} - -var defaultMessage = "Copy to clipboard: #{key}, Enter"; - -function format(message) { - var copyKey = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C"; - return message.replace(/#{\s*key\s*}/g, copyKey); -} - -export function copy(text, options) { - var debug, - message, - reselectPrevious, - range, - selection, - mark, - success = false; - if (!options) { - options = {}; - } - debug = options.debug || false; - try { - reselectPrevious = deselectCurrent(); - - range = document.createRange(); - selection = document.getSelection(); - - mark = document.createElement("span"); - mark.textContent = text; - // reset user styles for span element - mark.style.all = "unset"; - // prevents scrolling to the end of the page - mark.style.position = "fixed"; - mark.style.top = 0; - mark.style.clip = "rect(0, 0, 0, 0)"; - // used to preserve spaces and line breaks - mark.style.whiteSpace = "pre"; - // do not inherit user-select (it may be `none`) - mark.style.webkitUserSelect = "text"; - mark.style.MozUserSelect = "text"; - mark.style.msUserSelect = "text"; - mark.style.userSelect = "text"; - mark.addEventListener("copy", function(e) { - e.stopPropagation(); - if (options.format) { - e.preventDefault(); - if (typeof e.clipboardData === "undefined") { // IE 11 - debug && console.warn("unable to use e.clipboardData"); - debug && console.warn("trying IE specific stuff"); - window.clipboardData.clearData(); - var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting["default"] - window.clipboardData.setData(format, text); - } else { // all other browsers - e.clipboardData.clearData(); - e.clipboardData.setData(options.format, text); - } - } - if (options.onCopy) { - e.preventDefault(); - options.onCopy(e.clipboardData); - } - }); - - document.body.appendChild(mark); - - range.selectNodeContents(mark); - selection.addRange(range); - - var successful = document.execCommand("copy"); - if (!successful) { - throw new Error("copy command was unsuccessful"); - } - success = true; - } catch (err) { - debug && console.error("unable to copy using execCommand: ", err); - debug && console.warn("trying IE specific stuff"); - try { - window.clipboardData.setData(options.format || "text", text); - options.onCopy && options.onCopy(window.clipboardData); - success = true; - } catch (err) { - debug && console.error("unable to copy using clipboardData: ", err); - debug && console.error("falling back to prompt"); - message = format("message" in options ? options.message : defaultMessage); - window.prompt(message, text); - } - } finally { - if (selection) { - if (typeof selection.removeRange == "function") { - selection.removeRange(range); - } else { - selection.removeAllRanges(); - } - } - - if (mark) { - document.body.removeChild(mark); - } - reselectPrevious(); - } - - return success; -} - diff --git a/java/demo/frontend/generated/jar-resources/datepickerConnector.js b/java/demo/frontend/generated/jar-resources/datepickerConnector.js deleted file mode 100644 index d25deb36f..000000000 --- a/java/demo/frontend/generated/jar-resources/datepickerConnector.js +++ /dev/null @@ -1,159 +0,0 @@ -import dateFnsFormat from 'date-fns/format'; -import dateFnsParse from 'date-fns/parse'; -import dateFnsIsValid from 'date-fns/isValid'; -import { extractDateParts, parseDate as _parseDate } from '@vaadin/date-picker/src/vaadin-date-picker-helper.js'; - -(function () { - const tryCatchWrapper = function (callback) { - return window.Vaadin.Flow.tryCatchWrapper(callback, 'Vaadin Date Picker'); - }; - - window.Vaadin.Flow.datepickerConnector = { - initLazy: (datepicker) => - tryCatchWrapper(function (datepicker) { - // Check whether the connector was already initialized for the datepicker - if (datepicker.$connector) { - return; - } - - datepicker.$connector = {}; - - const createLocaleBasedDateFormat = function (locale) { - try { - // Check whether the locale is supported or not - new Date().toLocaleDateString(locale); - } catch (e) { - console.warn('The locale is not supported, using default locale setting(en-US).'); - return 'M/d/yyyy'; - } - - // format test date and convert to date-fns pattern - const testDate = new Date(Date.UTC(1234, 4, 6)); - let pattern = testDate.toLocaleDateString(locale, { timeZone: 'UTC' }); - pattern = pattern - // escape date-fns pattern letters by enclosing them in single quotes - .replace(/([a-zA-Z]+)/g, "'$1'") - // insert date placeholder - .replace('06', 'dd') - .replace('6', 'd') - // insert month placeholder - .replace('05', 'MM') - .replace('5', 'M') - // insert year placeholder - .replace('1234', 'yyyy'); - const isValidPattern = pattern.includes('d') && pattern.includes('M') && pattern.includes('y'); - if (!isValidPattern) { - console.warn('The locale is not supported, using default locale setting(en-US).'); - return 'M/d/yyyy'; - } - - return pattern; - }; - - const createFormatterAndParser = tryCatchWrapper(function (formats) { - if (!formats || formats.length === 0) { - throw new Error('Array of custom date formats is null or empty'); - } - - function getShortYearFormat(format) { - if (format.includes('yyyy') && !format.includes('yyyyy')) { - return format.replace('yyyy', 'yy'); - } - if (format.includes('YYYY') && !format.includes('YYYYY')) { - return format.replace('YYYY', 'YY'); - } - return undefined; - } - - function isShortYearFormat(format) { - if (format.includes('y')) { - return !format.includes('yyy'); - } - if (format.includes('Y')) { - return !format.includes('YYY'); - } - return false; - } - - function formatDate(dateParts) { - const format = formats[0]; - const date = _parseDate(`${dateParts.year}-${dateParts.month + 1}-${dateParts.day}`); - - return dateFnsFormat(date, format); - } - - function parseDate(dateString) { - const referenceDate = _getReferenceDate(); - for (let format of formats) { - // We first try to match the date with the shorter version. - const shortYearFormat = getShortYearFormat(format); - if (shortYearFormat) { - const shortYearFormatDate = dateFnsParse(dateString, shortYearFormat, referenceDate); - if (dateFnsIsValid(shortYearFormatDate)) { - let yearValue = shortYearFormatDate.getFullYear(); - // The last parsed year check handles the case where a four-digit year is parsed, then formatted - // as a two-digit year, and then parsed again. In this case we want to keep the century of the - // originally parsed year, instead of using the century of the reference date. - if ( - datepicker.$connector._lastParsedYear && - yearValue === datepicker.$connector._lastParsedYear % 100 - ) { - yearValue = datepicker.$connector._lastParsedYear; - } - return { - day: shortYearFormatDate.getDate(), - month: shortYearFormatDate.getMonth(), - year: yearValue - }; - } - } - const date = dateFnsParse(dateString, format, referenceDate); - - if (dateFnsIsValid(date)) { - let yearValue = date.getFullYear(); - if ( - datepicker.$connector._lastParsedYear && - yearValue % 100 === datepicker.$connector._lastParsedYear % 100 && - isShortYearFormat(format) - ) { - yearValue = datepicker.$connector._lastParsedYear; - } else { - datepicker.$connector._lastParsedYear = yearValue; - } - return { - day: date.getDate(), - month: date.getMonth(), - year: yearValue - }; - } - } - datepicker.$connector._lastParsedYear = undefined; - return false; - } - - return { - formatDate: formatDate, - parseDate: parseDate - }; - }); - - function _getReferenceDate() { - const { referenceDate } = datepicker.i18n; - return referenceDate ? new Date(referenceDate.year, referenceDate.month, referenceDate.day) : new Date(); - } - - datepicker.$connector.updateI18n = tryCatchWrapper(function (locale, i18n) { - // Either use custom formats specified in I18N, or create format from locale - const hasCustomFormats = i18n && i18n.dateFormats && i18n.dateFormats.length > 0; - if (i18n && i18n.referenceDate) { - i18n.referenceDate = extractDateParts(new Date(i18n.referenceDate)); - } - const usedFormats = hasCustomFormats ? i18n.dateFormats : [createLocaleBasedDateFormat(locale)]; - const formatterAndParser = createFormatterAndParser(usedFormats); - - // Merge current web component I18N settings with new I18N settings and the formatting and parsing functions - datepicker.i18n = Object.assign({}, datepicker.i18n, i18n, formatterAndParser); - }); - })(datepicker) - }; -})(); diff --git a/java/demo/frontend/generated/jar-resources/dialogConnector.js b/java/demo/frontend/generated/jar-resources/dialogConnector.js deleted file mode 100644 index 60a41ce4d..000000000 --- a/java/demo/frontend/generated/jar-resources/dialogConnector.js +++ /dev/null @@ -1,38 +0,0 @@ -(function () { - function copyClassName(dialog) { - const overlay = dialog.$.overlay; - if (overlay) { - overlay.className = dialog.className; - } - } - - const observer = new MutationObserver((records) => { - records.forEach((mutation) => { - if (mutation.type === 'attributes' && mutation.attributeName === 'class') { - copyClassName(mutation.target); - } - }); - }); - - window.Vaadin.Flow.dialogConnector = { - initLazy: function (dialog) { - if (dialog.$connector) { - return; - } - dialog.$connector = {}; - - dialog.addEventListener('opened-changed', (e) => { - if (e.detail.value) { - copyClassName(dialog); - } - }); - - observer.observe(dialog, { - attributes: true, - attributeFilter: ['class'] - }); - - copyClassName(dialog); - } - }; -})(); diff --git a/java/demo/frontend/generated/jar-resources/dndConnector-es6.js b/java/demo/frontend/generated/jar-resources/dndConnector-es6.js deleted file mode 100644 index 699684da3..000000000 --- a/java/demo/frontend/generated/jar-resources/dndConnector-es6.js +++ /dev/null @@ -1 +0,0 @@ -import './dndConnector.js'; diff --git a/java/demo/frontend/generated/jar-resources/dndConnector.js b/java/demo/frontend/generated/jar-resources/dndConnector.js deleted file mode 100644 index 13170ec2d..000000000 --- a/java/demo/frontend/generated/jar-resources/dndConnector.js +++ /dev/null @@ -1,110 +0,0 @@ -window.Vaadin = window.Vaadin || {}; -window.Vaadin.Flow = window.Vaadin.Flow || {}; -window.Vaadin.Flow.dndConnector = { - __ondragenterListener: function (event) { - // TODO filter by data type - // TODO prevent dropping on itself (by default) - const effect = event.currentTarget['__dropEffect']; - if (!event.currentTarget.hasAttribute('disabled')) { - if (effect) { - event.dataTransfer.dropEffect = effect; - } - - if (effect && effect !== 'none') { - /* #7108: if drag moves on top of drop target's children, first another ondragenter event - * is fired and then a ondragleave event. This happens again once the drag - * moves on top of another children, or back on top of the drop target element. - * Thus need to "cancel" the following ondragleave, to not remove class name. - * Drop event will happen even when dropped to a child element. */ - if (event.currentTarget.classList.contains('v-drag-over-target')) { - event.currentTarget['__skip-leave'] = true; - } else { - event.currentTarget.classList.add('v-drag-over-target'); - } - // enables browser specific pseudo classes (at least FF) - event.preventDefault(); - event.stopPropagation(); // don't let parents know - } - } - }, - - __ondragoverListener: function (event) { - // TODO filter by data type - // TODO filter by effectAllowed != dropEffect due to Safari & IE11 ? - if (!event.currentTarget.hasAttribute('disabled')) { - const effect = event.currentTarget['__dropEffect']; - if (effect) { - event.dataTransfer.dropEffect = effect; - } - // allows the drop && don't let parents know - event.preventDefault(); - event.stopPropagation(); - } - }, - - __ondragleaveListener: function (event) { - if (event.currentTarget['__skip-leave']) { - event.currentTarget['__skip-leave'] = false; - } else { - event.currentTarget.classList.remove('v-drag-over-target'); - } - // #7109 need to stop or any parent drop target might not get highlighted, - // as ondragenter for it is fired before the child gets dragleave. - event.stopPropagation(); - }, - - __ondropListener: function (event) { - const effect = event.currentTarget['__dropEffect']; - if (effect) { - event.dataTransfer.dropEffect = effect; - } - event.currentTarget.classList.remove('v-drag-over-target'); - // prevent browser handling && don't let parents know - event.preventDefault(); - event.stopPropagation(); - }, - - updateDropTarget: function (element) { - if (element['__active']) { - element.addEventListener('dragenter', this.__ondragenterListener, false); - element.addEventListener('dragover', this.__ondragoverListener, false); - element.addEventListener('dragleave', this.__ondragleaveListener, false); - element.addEventListener('drop', this.__ondropListener, false); - } else { - element.removeEventListener('dragenter', this.__ondragenterListener, false); - element.removeEventListener('dragover', this.__ondragoverListener, false); - element.removeEventListener('dragleave', this.__ondragleaveListener, false); - element.removeEventListener('drop', this.__ondropListener, false); - element.classList.remove('v-drag-over-target'); - } - }, - - /** DRAG SOURCE METHODS: */ - - __dragstartListener: function (event) { - event.stopPropagation(); - event.dataTransfer.setData('text/plain', ''); - if (event.currentTarget.hasAttribute('disabled')) { - event.preventDefault(); - } else { - if (event.currentTarget['__effectAllowed']) { - event.dataTransfer.effectAllowed = event.currentTarget['__effectAllowed']; - } - event.currentTarget.classList.add('v-dragged'); - } - }, - - __dragendListener: function (event) { - event.currentTarget.classList.remove('v-dragged'); - }, - - updateDragSource: function (element) { - if (element['draggable']) { - element.addEventListener('dragstart', this.__dragstartListener, false); - element.addEventListener('dragend', this.__dragendListener, false); - } else { - element.removeEventListener('dragstart', this.__dragstartListener, false); - element.removeEventListener('dragend', this.__dragendListener, false); - } - } -}; diff --git a/java/demo/frontend/generated/jar-resources/flow-component-renderer.js b/java/demo/frontend/generated/jar-resources/flow-component-renderer.js deleted file mode 100644 index 0f6ad78ae..000000000 --- a/java/demo/frontend/generated/jar-resources/flow-component-renderer.js +++ /dev/null @@ -1,155 +0,0 @@ -import '@polymer/polymer/lib/elements/dom-if.js'; -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { Debouncer } from '@polymer/polymer/lib/utils/debounce.js'; -import { idlePeriod } from '@polymer/polymer/lib/utils/async.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; - -class FlowComponentRenderer extends PolymerElement { - static get template() { - return html` - - - `; - } - - static get is() { - return 'flow-component-renderer'; - } - static get properties() { - return { - nodeid: Number, - appid: String, - }; - } - static get observers() { - return ['_attachRenderedComponentIfAble(appid, nodeid)']; - } - - ready() { - super.ready(); - this.addEventListener('click', function (event) { - if ( - this.firstChild && - typeof this.firstChild.click === 'function' && - event.target === this - ) { - event.stopPropagation(); - this.firstChild.click(); - } - }); - this.addEventListener('animationend', this._onAnimationEnd); - } - - _asyncAttachRenderedComponentIfAble() { - this._debouncer = Debouncer.debounce(this._debouncer, idlePeriod, () => - this._attachRenderedComponentIfAble() - ); - } - - _attachRenderedComponentIfAble() { - if (!this.nodeid || !this.appid) { - return; - } - const renderedComponent = this._getRenderedComponent(); - if (this.firstChild) { - if (!renderedComponent) { - this._asyncAttachRenderedComponentIfAble(); - } else if (this.firstChild !== renderedComponent) { - this.replaceChild(renderedComponent, this.firstChild); - this._defineFocusTarget(); - this.onComponentRendered(); - } else { - this._defineFocusTarget(); - this.onComponentRendered(); - } - } else { - if (renderedComponent) { - this.appendChild(renderedComponent); - this._defineFocusTarget(); - this.onComponentRendered(); - } else { - this._asyncAttachRenderedComponentIfAble(); - } - } - } - - _getRenderedComponent() { - try { - return window.Vaadin.Flow.clients[this.appid].getByNodeId(this.nodeid); - } catch (error) { - console.error( - 'Could not get node %s from app %s', - this.nodeid, - this.appid - ); - console.error(error); - } - return null; - } - - onComponentRendered() { - // subclasses can override this method to execute custom logic on resize - } - - /* Setting the `focus-target` attribute to the first focusable descendant - starting from the firstChild necessary for the focus to be delegated - within the flow-component-renderer when used inside a vaadin-grid cell */ - _defineFocusTarget() { - var focusable = this._getFirstFocusableDescendant(this.firstChild); - if (focusable !== null) { - focusable.setAttribute('focus-target', 'true'); - } - } - - _getFirstFocusableDescendant(node) { - if (this._isFocusable(node)) { - return node; - } - if (node.hasAttribute && (node.hasAttribute('disabled') || node.hasAttribute('hidden'))) { - return null; - } - if (!node.children) { - return null; - } - for (var i = 0; i < node.children.length; i++) { - var focusable = this._getFirstFocusableDescendant(node.children[i]); - if (focusable !== null) { - return focusable; - } - } - return null; - } - - _isFocusable(node) { - if ( - node.hasAttribute && - typeof node.hasAttribute === 'function' && - (node.hasAttribute('disabled') || node.hasAttribute('hidden')) - ) { - return false; - } - - return node.tabIndex === 0; - } - - _onAnimationEnd(e) { - // ShadyCSS applies scoping suffixes to animation names - // To ensure that child is attached once element is unhidden - // for when it was filtered out from, eg, ComboBox - // https://github.com/vaadin/vaadin-flow-components/issues/437 - if (e.animationName.indexOf('flow-component-renderer-appear') === 0) { - this._attachRenderedComponentIfAble(); - } - } -} -window.customElements.define(FlowComponentRenderer.is, FlowComponentRenderer); diff --git a/java/demo/frontend/generated/jar-resources/gridConnector.js b/java/demo/frontend/generated/jar-resources/gridConnector.js deleted file mode 100644 index 50cdbfc78..000000000 --- a/java/demo/frontend/generated/jar-resources/gridConnector.js +++ /dev/null @@ -1,1187 +0,0 @@ -import { Debouncer } from '@polymer/polymer/lib/utils/debounce.js'; -import { timeOut, animationFrame } from '@polymer/polymer/lib/utils/async.js'; -import { Grid } from '@vaadin/grid/src/vaadin-grid.js'; -import { ItemCache } from '@vaadin/grid/src/vaadin-grid-data-provider-mixin.js'; -import { isFocusable } from '@vaadin/grid/src/vaadin-grid-active-item-mixin.js'; - -(function () { - const tryCatchWrapper = function (callback) { - return window.Vaadin.Flow.tryCatchWrapper(callback, 'Vaadin Grid'); - }; - - let isItemCacheInitialized = false; - - window.Vaadin.Flow.gridConnector = { - initLazy: (grid) => - tryCatchWrapper(function (grid) { - // Check whether the connector was already initialized for the grid - if (grid.$connector) { - return; - } - - // Make sure ItemCache patching is done only once, but delay it for when - // a server grid is initialized - if (!isItemCacheInitialized) { - isItemCacheInitialized = true; - // Storing original implementation of the method to be used for client - // side only grids - ItemCache.prototype.ensureSubCacheForScaledIndexOriginal = ItemCache.prototype.ensureSubCacheForScaledIndex; - ItemCache.prototype.ensureSubCacheForScaledIndex = tryCatchWrapper(function (scaledIndex) { - if (!this.grid.$connector) { - this.ensureSubCacheForScaledIndexOriginal(scaledIndex); - return; - } - - if (!this.itemCaches[scaledIndex]) { - this.grid.$connector.beforeEnsureSubCacheForScaledIndex(this, scaledIndex); - } - }); - - ItemCache.prototype.isLoadingOriginal = ItemCache.prototype.isLoading; - ItemCache.prototype.isLoading = tryCatchWrapper(function () { - if (!this.grid.$connector) { - return this.isLoadingOriginal(); - } - - return Boolean( - this.grid.$connector.hasEnsureSubCacheQueue() || - Object.keys(this.pendingRequests).length || - Object.keys(this.itemCaches).filter((index) => { - return this.itemCaches[index].isLoading(); - })[0] - ); - }); - - ItemCache.prototype.doEnsureSubCacheForScaledIndex = tryCatchWrapper(function (scaledIndex) { - if (!this.itemCaches[scaledIndex]) { - const subCache = new ItemCache.prototype.constructor(this.grid, this, this.items[scaledIndex]); - subCache.itemkeyCaches = {}; - if (!this.itemkeyCaches) { - this.itemkeyCaches = {}; - } - this.itemCaches[scaledIndex] = subCache; - this.itemkeyCaches[this.grid.getItemId(subCache.parentItem)] = subCache; - this.grid._loadPage(0, subCache); - } - }); - - ItemCache.prototype.getCacheAndIndexByKey = tryCatchWrapper(function (key) { - for (let index in this.items) { - if (this.grid.getItemId(this.items[index]) === key) { - return { cache: this, scaledIndex: index }; - } - } - const keys = Object.keys(this.itemkeyCaches); - for (let i = 0; i < keys.length; i++) { - const expandedKey = keys[i]; - const subCache = this.itemkeyCaches[expandedKey]; - let cacheAndIndex = subCache.getCacheAndIndexByKey(key); - if (cacheAndIndex) { - return cacheAndIndex; - } - } - return undefined; - }); - - ItemCache.prototype.getLevel = tryCatchWrapper(function () { - let cache = this; - let level = 0; - while (cache.parentCache) { - cache = cache.parentCache; - level++; - } - return level; - }); - } - - const rootPageCallbacks = {}; - const treePageCallbacks = {}; - const cache = {}; - - /* parentRequestDelay - optimizes parent requests by batching several requests - * into one request. Delay in milliseconds. Disable by setting to 0. - * parentRequestBatchMaxSize - maximum size of the batch. - */ - const parentRequestDelay = 50; - const parentRequestBatchMaxSize = 20; - - let parentRequestQueue = []; - let parentRequestDebouncer; - let ensureSubCacheQueue = []; - let ensureSubCacheDebouncer; - - const rootRequestDelay = 150; - let rootRequestDebouncer; - - let lastRequestedRanges = {}; - const root = 'null'; - lastRequestedRanges[root] = [0, 0]; - - const validSelectionModes = ['SINGLE', 'NONE', 'MULTI']; - let selectedKeys = {}; - let selectionMode = 'SINGLE'; - - let sorterDirectionsSetFromServer = false; - - grid.size = 0; // To avoid NaN here and there before we get proper data - grid.itemIdPath = 'key'; - - grid.$connector = {}; - - grid.$connector.hasEnsureSubCacheQueue = tryCatchWrapper(() => ensureSubCacheQueue.length > 0); - - grid.$connector.hasParentRequestQueue = tryCatchWrapper(() => parentRequestQueue.length > 0); - - grid.$connector.hasRootRequestQueue = tryCatchWrapper(() => { - return Object.keys(rootPageCallbacks).length > 0 || (rootRequestDebouncer && rootRequestDebouncer.isActive()); - }); - - grid.$connector.beforeEnsureSubCacheForScaledIndex = tryCatchWrapper(function (targetCache, scaledIndex) { - // add call to queue - ensureSubCacheQueue.push({ - cache: targetCache, - scaledIndex: scaledIndex, - itemkey: grid.getItemId(targetCache.items[scaledIndex]), - level: targetCache.getLevel() - }); - - ensureSubCacheDebouncer = Debouncer.debounce(ensureSubCacheDebouncer, animationFrame, () => { - while (ensureSubCacheQueue.length) { - grid.$connector.flushEnsureSubCache(); - } - }); - }); - - grid.$connector.doSelection = tryCatchWrapper(function (items, userOriginated) { - if (selectionMode === 'NONE' || !items.length || (userOriginated && grid.hasAttribute('disabled'))) { - return; - } - if (selectionMode === 'SINGLE') { - grid.selectedItems = []; - selectedKeys = {}; - } - - // For single selection mode, "deselect all" selects a single item `null`, - // which should not end up in the selected items - const sanitizedItems = items.filter((item) => item !== null); - grid.selectedItems = grid.selectedItems.concat(sanitizedItems); - - items.forEach((item) => { - if (item) { - selectedKeys[item.key] = item; - if (userOriginated) { - item.selected = true; - grid.$server.select(item.key); - } - } - const isSelectedItemDifferentOrNull = !grid.activeItem || !item || item.key != grid.activeItem.key; - if (!userOriginated && selectionMode === 'SINGLE' && isSelectedItemDifferentOrNull) { - grid.activeItem = item; - } - }); - }); - - grid.$connector.doDeselection = tryCatchWrapper(function (items, userOriginated) { - if (selectionMode === 'NONE' || !items.length || (userOriginated && grid.hasAttribute('disabled'))) { - return; - } - - const updatedSelectedItems = grid.selectedItems.slice(); - while (items.length) { - const itemToDeselect = items.shift(); - for (let i = 0; i < updatedSelectedItems.length; i++) { - const selectedItem = updatedSelectedItems[i]; - if (itemToDeselect && itemToDeselect.key === selectedItem.key) { - updatedSelectedItems.splice(i, 1); - break; - } - } - if (itemToDeselect) { - delete selectedKeys[itemToDeselect.key]; - if (userOriginated) { - delete itemToDeselect.selected; - grid.$server.deselect(itemToDeselect.key); - } - } - } - grid.selectedItems = updatedSelectedItems; - }); - - grid.__activeItemChanged = tryCatchWrapper(function (newVal, oldVal) { - if (selectionMode != 'SINGLE') { - return; - } - if (!newVal) { - if (oldVal && selectedKeys[oldVal.key]) { - if (grid.__deselectDisallowed) { - grid.activeItem = oldVal; - } else { - grid.$connector.doDeselection([oldVal], true); - } - } - } else if (!selectedKeys[newVal.key]) { - grid.$connector.doSelection([newVal], true); - } - }); - grid._createPropertyObserver('activeItem', '__activeItemChanged', true); - - grid.__activeItemChangedDetails = tryCatchWrapper(function (newVal, oldVal) { - if (grid.__disallowDetailsOnClick) { - return; - } - // when grid is attached, newVal is not set and oldVal is undefined - // do nothing - if (newVal == null && oldVal === undefined) { - return; - } - if (newVal && !newVal.detailsOpened) { - grid.$server.setDetailsVisible(newVal.key); - } else { - grid.$server.setDetailsVisible(null); - } - }); - grid._createPropertyObserver('activeItem', '__activeItemChangedDetails', true); - - grid.$connector._getPageIfSameLevel = tryCatchWrapper(function (parentKey, index, defaultPage) { - let cacheAndIndex = grid._cache.getCacheAndIndex(index); - let parentItem = cacheAndIndex.cache.parentItem; - let parentKeyOfIndex = parentItem ? grid.getItemId(parentItem) : root; - if (parentKey !== parentKeyOfIndex) { - return defaultPage; - } else { - return grid._getPageForIndex(cacheAndIndex.scaledIndex); - } - }); - - grid.$connector.getCacheByKey = tryCatchWrapper(function (key) { - let cacheAndIndex = grid._cache.getCacheAndIndexByKey(key); - if (cacheAndIndex) { - return cacheAndIndex.cache; - } - return undefined; - }); - - grid.$connector.flushEnsureSubCache = tryCatchWrapper(function () { - let pendingFetch = ensureSubCacheQueue.splice(0, 1)[0]; - let itemkey = pendingFetch.itemkey; - - const visibleRows = grid._getVisibleRows(); - let start = visibleRows[0].index; - let end = visibleRows[visibleRows.length - 1].index; - - let buffer = end - start; - let firstNeededIndex = Math.max(0, start - buffer); - let lastNeededIndex = Math.min(end + buffer, grid._effectiveSize); - - // only fetch if given item is still in visible range - for (let index = firstNeededIndex; index <= lastNeededIndex; index++) { - let item = grid._cache.getItemForIndex(index); - - if (grid.getItemId(item) === itemkey) { - if (grid._isExpanded(item)) { - pendingFetch.cache.doEnsureSubCacheForScaledIndex(pendingFetch.scaledIndex); - return true; - } else { - break; - } - } - } - return false; - }); - - grid.$connector.flushParentRequests = tryCatchWrapper(function () { - let pendingFetches = parentRequestQueue.splice(0, parentRequestBatchMaxSize); - - if (pendingFetches.length) { - grid.$server.setParentRequestedRanges(pendingFetches); - return true; - } - return false; - }); - - grid.$connector.beforeParentRequest = tryCatchWrapper(function (firstIndex, size, parentKey) { - // add request in queue - parentRequestQueue.push({ - firstIndex: firstIndex, - size: size, - parentKey: parentKey - }); - - parentRequestDebouncer = Debouncer.debounce(parentRequestDebouncer, timeOut.after(parentRequestDelay), () => { - while (parentRequestQueue.length) { - grid.$connector.flushParentRequests(); - } - }); - }); - - grid.$connector.fetchPage = tryCatchWrapper(function (fetch, page, parentKey) { - // Determine what to fetch based on scroll position and not only - // what grid asked for - - // The buffer size could be multiplied by some constant defined by the user, - // if he needs to reduce the number of items sent to the Grid to improve performance - // or to increase it to make Grid smoother when scrolling - const visibleRows = grid._getVisibleRows(); - let start = visibleRows.length > 0 ? visibleRows[0].index : 0; - let end = visibleRows.length > 0 ? visibleRows[visibleRows.length - 1].index : 0; - let buffer = end - start; - - let firstNeededIndex = Math.max(0, start - buffer); - let lastNeededIndex = Math.min(end + buffer, grid._effectiveSize); - - let firstNeededPage = page; - let lastNeededPage = page; - for (let idx = firstNeededIndex; idx <= lastNeededIndex; idx++) { - firstNeededPage = Math.min( - firstNeededPage, - grid.$connector._getPageIfSameLevel(parentKey, idx, firstNeededPage) - ); - lastNeededPage = Math.max( - lastNeededPage, - grid.$connector._getPageIfSameLevel(parentKey, idx, lastNeededPage) - ); - } - - let firstPage = Math.max(0, firstNeededPage); - let lastPage = - parentKey !== root ? lastNeededPage : Math.min(lastNeededPage, Math.floor(grid.size / grid.pageSize)); - let lastRequestedRange = lastRequestedRanges[parentKey]; - if (!lastRequestedRange) { - lastRequestedRange = [-1, -1]; - } - if (lastRequestedRange[0] != firstPage || lastRequestedRange[1] != lastPage) { - lastRequestedRange = [firstPage, lastPage]; - lastRequestedRanges[parentKey] = lastRequestedRange; - let count = lastPage - firstPage + 1; - fetch(firstPage * grid.pageSize, count * grid.pageSize); - } - }); - - grid.dataProvider = tryCatchWrapper(function (params, callback) { - if (params.pageSize != grid.pageSize) { - throw 'Invalid pageSize'; - } - - let page = params.page; - - if (params.parentItem) { - let parentUniqueKey = grid.getItemId(params.parentItem); - if (!treePageCallbacks[parentUniqueKey]) { - treePageCallbacks[parentUniqueKey] = {}; - } - - let parentCache = grid.$connector.getCacheByKey(parentUniqueKey); - let itemCache = - parentCache && parentCache.itemkeyCaches ? parentCache.itemkeyCaches[parentUniqueKey] : undefined; - if (cache[parentUniqueKey] && cache[parentUniqueKey][page] && itemCache) { - // workaround: sometimes grid-element gives page index that overflows - page = Math.min(page, Math.floor(cache[parentUniqueKey].size / grid.pageSize)); - - // Ensure grid isn't in loading state when the callback executes - ensureSubCacheQueue = []; - callback(cache[parentUniqueKey][page], cache[parentUniqueKey].size); - - // Flush after the callback to have the grid rows up-to-date - updateAllGridRowsInDomBasedOnCache(); - // Prevent sub-caches from being created (& data requests sent) for items - // that may no longer be visible - ensureSubCacheQueue = []; - // Eliminate flickering on eager fetch mode - grid.requestContentUpdate(); - } else { - treePageCallbacks[parentUniqueKey][page] = callback; - - grid.$connector.fetchPage( - (firstIndex, size) => grid.$connector.beforeParentRequest(firstIndex, size, params.parentItem.key), - page, - parentUniqueKey - ); - } - } else { - // workaround: sometimes grid-element gives page index that overflows - page = Math.min(page, Math.floor(grid.size / grid.pageSize)); - - if (cache[root] && cache[root][page]) { - callback(cache[root][page]); - } else { - rootPageCallbacks[page] = callback; - - rootRequestDebouncer = Debouncer.debounce( - rootRequestDebouncer, - timeOut.after(grid._hasData ? rootRequestDelay : 0), - () => { - grid.$connector.fetchPage( - (firstIndex, size) => grid.$server.setRequestedRange(firstIndex, size), - page, - root - ); - } - ); - } - } - }); - - const sorterChangeListener = tryCatchWrapper(function (_, oldValue) { - if (oldValue !== undefined && !sorterDirectionsSetFromServer) { - grid.$server.sortersChanged( - grid._sorters.map(function (sorter) { - return { - path: sorter.path, - direction: sorter.direction - }; - }) - ); - } - }); - - grid.$connector.setSorterDirections = tryCatchWrapper(function (directions) { - sorterDirectionsSetFromServer = true; - setTimeout( - tryCatchWrapper(() => { - try { - const sorters = Array.from(grid.querySelectorAll('vaadin-grid-sorter')); - - // Sorters for hidden columns are removed from DOM but stored in the web component. - // We need to ensure that all the sorters are reset when using `grid.sort(null)`. - grid._sorters.forEach((sorter) => { - if (!sorters.includes(sorter)) { - sorters.push(sorter); - } - }); - - sorters.forEach((sorter) => { - if (!directions.filter((d) => d.column === sorter.getAttribute('path'))[0]) { - sorter.direction = null; - } - }); - - // Apply directions in correct order, depending on configured multi-sort priority. - // For the default "prepend" mode, directions need to be applied in reverse, in - // order for the sort indicators to match the order on the server. For "append" - // just keep the order passed from the server. - if (grid.multiSortPriority !== 'append') { - directions = directions.reverse() - } - directions.forEach(({ column, direction }) => { - sorters.forEach((sorter) => { - if (sorter.getAttribute('path') === column && sorter.direction !== direction) { - sorter.direction = direction; - } - }); - }); - } finally { - sorterDirectionsSetFromServer = false; - } - }) - ); - }); - grid._createPropertyObserver('_previousSorters', sorterChangeListener); - - grid._updateItem = tryCatchWrapper(function (row, item) { - Grid.prototype._updateItem.call(grid, row, item); - - // There might be inactive component renderers on hidden rows that still refer to the - // same component instance as one of the renderers on a visible row. Making the - // inactive/hidden renderer attach the component might steal it from a visible/active one. - if (!row.hidden) { - // make sure that component renderers are updated - Array.from(row.children).forEach((cell) => { - if (cell._content && cell._content.__templateInstance && cell._content.__templateInstance.children) { - Array.from(cell._content.__templateInstance.children).forEach((content) => { - if (content._attachRenderedComponentIfAble) { - content._attachRenderedComponentIfAble(); - } - // In hierarchy column of tree grid, the component renderer is inside its content, - // this updates it renderer from innerContent - if (content.children) { - Array.from(content.children).forEach((innerContent) => { - if (innerContent._attachRenderedComponentIfAble) { - innerContent._attachRenderedComponentIfAble(); - } - }); - } - }); - } - }); - } - // since no row can be selected when selection mode is NONE - // if selectionMode is set to NONE, remove aria-selected attribute from the row - if (selectionMode === validSelectionModes[1]) { - // selectionMode === NONE - row.removeAttribute('aria-selected'); - Array.from(row.children).forEach((cell) => cell.removeAttribute('aria-selected')); - } - }); - - const itemExpandedChanged = tryCatchWrapper(function (item, expanded) { - // method available only for the TreeGrid server-side component - if (item == undefined || grid.$server.updateExpandedState == undefined) { - return; - } - let parentKey = grid.getItemId(item); - grid.$server.updateExpandedState(parentKey, expanded); - - if (!expanded) { - delete cache[parentKey]; - let parentCache = grid.$connector.getCacheByKey(parentKey); - if (parentCache && parentCache.itemkeyCaches && parentCache.itemkeyCaches[parentKey]) { - delete parentCache.itemkeyCaches[parentKey]; - } - if (parentCache && parentCache.itemkeyCaches) { - Object.keys(parentCache.itemCaches) - .filter((idx) => parentCache.items[idx].key === parentKey) - .forEach((idx) => delete parentCache.itemCaches[idx]); - } - delete lastRequestedRanges[parentKey]; - } - }); - - // Patch grid.expandItem and grid.collapseItem to have - // itemExpandedChanged run when either happens. - grid.expandItem = tryCatchWrapper(function (item) { - itemExpandedChanged(item, true); - Grid.prototype.expandItem.call(grid, item); - }); - - grid.collapseItem = tryCatchWrapper(function (item) { - itemExpandedChanged(item, false); - Grid.prototype.collapseItem.call(grid, item); - }); - - const itemsUpdated = function (items) { - if (!items || !Array.isArray(items)) { - throw 'Attempted to call itemsUpdated with an invalid value: ' + JSON.stringify(items); - } - let detailsOpenedItems = Array.from(grid.detailsOpenedItems); - let updatedSelectedItem = false; - for (let i = 0; i < items.length; ++i) { - const item = items[i]; - if (!item) { - continue; - } - if (item.detailsOpened) { - if (grid._getItemIndexInArray(item, detailsOpenedItems) < 0) { - detailsOpenedItems.push(item); - } - } else if (grid._getItemIndexInArray(item, detailsOpenedItems) >= 0) { - detailsOpenedItems.splice(grid._getItemIndexInArray(item, detailsOpenedItems), 1); - } - if (selectedKeys[item.key]) { - selectedKeys[item.key] = item; - item.selected = true; - updatedSelectedItem = true; - } - } - grid.detailsOpenedItems = detailsOpenedItems; - if (updatedSelectedItem) { - // IE 11 Object doesn't support method values - grid.selectedItems = Object.keys(selectedKeys).map(function (e) { - return selectedKeys[e]; - }); - } - }; - - /** - * Updates the cache for the given page for grid or tree-grid. - * - * @param page index of the page to update - * @param parentKey the key of the parent item for the page - * @returns an array of the updated items for the page, or undefined if no items were cached for the page - */ - const updateGridCache = function (page, parentKey) { - let items; - if ((parentKey || root) !== root) { - items = cache[parentKey][page]; - let parentCache = grid.$connector.getCacheByKey(parentKey); - if (parentCache && parentCache.itemkeyCaches) { - let _cache = parentCache.itemkeyCaches[parentKey]; - const callbacksForParentKey = treePageCallbacks[parentKey]; - const callback = callbacksForParentKey && callbacksForParentKey[page]; - _updateGridCache(page, items, callback, _cache); - } - } else { - items = cache[root][page]; - _updateGridCache(page, items, rootPageCallbacks[page], grid._cache); - } - return items; - }; - - const _updateGridCache = function (page, items, callback, levelcache) { - // Force update unless there's a callback waiting - if (!callback) { - let rangeStart = page * grid.pageSize; - let rangeEnd = rangeStart + grid.pageSize; - if (!items) { - if (levelcache && levelcache.items) { - for (let idx = rangeStart; idx < rangeEnd; idx++) { - delete levelcache.items[idx]; - } - } - } else { - if (levelcache && levelcache.items) { - for (let idx = rangeStart; idx < rangeEnd; idx++) { - if (levelcache.items[idx]) { - levelcache.items[idx] = items[idx - rangeStart]; - } - } - } - } - } - }; - - /** - * Updates all visible grid rows in DOM. - */ - const updateAllGridRowsInDomBasedOnCache = function () { - grid._cache.updateSize(); - grid._effectiveSize = grid._cache.effectiveSize; - grid.__updateVisibleRows(); - }; - - /** - * Update the given items in DOM if currently visible. - * - * @param array items the items to update in DOM - */ - const updateGridItemsInDomBasedOnCache = function (items) { - if (!items || !grid.$ || grid.$.items.childElementCount === 0) { - return; - } - - const itemKeys = items.map((item) => item.key); - const indexes = grid - ._getVisibleRows() - .filter((row) => row._item && itemKeys.includes(row._item.key)) - .map((row) => row.index); - if (indexes.length > 0) { - grid.__updateVisibleRows(indexes[0], indexes[indexes.length - 1]); - } - }; - - grid.$connector.set = tryCatchWrapper(function (index, items, parentKey) { - if (index % grid.pageSize != 0) { - throw 'Got new data to index ' + index + ' which is not aligned with the page size of ' + grid.pageSize; - } - let pkey = parentKey || root; - - const firstPage = index / grid.pageSize; - const updatedPageCount = Math.ceil(items.length / grid.pageSize); - - for (let i = 0; i < updatedPageCount; i++) { - let page = firstPage + i; - let slice = items.slice(i * grid.pageSize, (i + 1) * grid.pageSize); - if (!cache[pkey]) { - cache[pkey] = {}; - } - cache[pkey][page] = slice; - - grid.$connector.doSelection(slice.filter((item) => item.selected)); - grid.$connector.doDeselection( - slice.filter((item) => !item.selected && selectedKeys[item.key]) - ); - - const updatedItems = updateGridCache(page, pkey); - if (updatedItems) { - itemsUpdated(updatedItems); - updateGridItemsInDomBasedOnCache(updatedItems); - } - } - }); - - const itemToCacheLocation = function (item) { - let parent = item.parentUniqueKey || root; - if (cache[parent]) { - for (let page in cache[parent]) { - for (let index in cache[parent][page]) { - if (grid.getItemId(cache[parent][page][index]) === grid.getItemId(item)) { - return { page: page, index: index, parentKey: parent }; - } - } - } - } - return null; - }; - - /** - * Updates the given items for a hierarchical grid. - * - * @param updatedItems the updated items array - */ - grid.$connector.updateHierarchicalData = tryCatchWrapper(function (updatedItems) { - let pagesToUpdate = []; - // locate and update the items in cache - // find pages that need updating - for (let i = 0; i < updatedItems.length; i++) { - let cacheLocation = itemToCacheLocation(updatedItems[i]); - if (cacheLocation) { - cache[cacheLocation.parentKey][cacheLocation.page][cacheLocation.index] = updatedItems[i]; - let key = cacheLocation.parentKey + ':' + cacheLocation.page; - if (!pagesToUpdate[key]) { - pagesToUpdate[key] = { - parentKey: cacheLocation.parentKey, - page: cacheLocation.page - }; - } - } - } - // IE11 doesn't work with the transpiled version of the forEach. - let keys = Object.keys(pagesToUpdate); - for (let i = 0; i < keys.length; i++) { - let pageToUpdate = pagesToUpdate[keys[i]]; - const affectedUpdatedItems = updateGridCache(pageToUpdate.page, pageToUpdate.parentKey); - if (affectedUpdatedItems) { - itemsUpdated(affectedUpdatedItems); - updateGridItemsInDomBasedOnCache(affectedUpdatedItems); - } - } - }); - - /** - * Updates the given items for a non-hierarchical grid. - * - * @param updatedItems the updated items array - */ - grid.$connector.updateFlatData = tryCatchWrapper(function (updatedItems) { - // update (flat) caches - for (let i = 0; i < updatedItems.length; i++) { - let cacheLocation = itemToCacheLocation(updatedItems[i]); - if (cacheLocation) { - // update connector cache - cache[cacheLocation.parentKey][cacheLocation.page][cacheLocation.index] = updatedItems[i]; - - // update grid's cache - const index = parseInt(cacheLocation.page) * grid.pageSize + parseInt(cacheLocation.index); - if (grid._cache.items[index]) { - grid._cache.items[index] = updatedItems[i]; - } - } - } - itemsUpdated(updatedItems); - - updateGridItemsInDomBasedOnCache(updatedItems); - }); - - grid.$connector.clearExpanded = tryCatchWrapper(function () { - grid.expandedItems = []; - ensureSubCacheQueue = []; - parentRequestQueue = []; - }); - - grid.$connector.clear = tryCatchWrapper(function (index, length, parentKey) { - let pkey = parentKey || root; - if (!cache[pkey] || Object.keys(cache[pkey]).length === 0) { - return; - } - if (index % grid.pageSize != 0) { - throw ( - 'Got cleared data for index ' + index + ' which is not aligned with the page size of ' + grid.pageSize - ); - } - - let firstPage = Math.floor(index / grid.pageSize); - let updatedPageCount = Math.ceil(length / grid.pageSize); - - for (let i = 0; i < updatedPageCount; i++) { - let page = firstPage + i; - let items = cache[pkey][page]; - grid.$connector.doDeselection(items.filter((item) => selectedKeys[item.key])); - items.forEach((item) => grid.closeItemDetails(item)); - delete cache[pkey][page]; - const updatedItems = updateGridCache(page, parentKey); - if (updatedItems) { - itemsUpdated(updatedItems); - } - updateGridItemsInDomBasedOnCache(items); - } - let cacheToClear = grid._cache; - if (parentKey) { - const cacheAndIndex = grid._cache.getCacheAndIndexByKey(pkey); - cacheToClear = cacheAndIndex.cache.itemCaches[cacheAndIndex.scaledIndex]; - } - const endIndex = index + updatedPageCount * grid.pageSize; - for (let itemIndex = index; itemIndex < endIndex; itemIndex++) { - delete cacheToClear.items[itemIndex]; - const subcacheToClear = cacheToClear.itemCaches[itemIndex]; - delete cacheToClear.itemCaches[itemIndex]; - const itemKeyToRemove = subcacheToClear && subcacheToClear.parentItem.key; - if (itemKeyToRemove) { - delete cacheToClear.itemkeyCaches[itemKeyToRemove]; - } - } - grid._cache.updateSize(); - grid._effectiveSize = grid._cache.effectiveSize; - }); - - grid.$connector.reset = tryCatchWrapper(function () { - grid.size = 0; - deleteObjectContents(cache); - deleteObjectContents(grid._cache.items); - deleteObjectContents(lastRequestedRanges); - if (ensureSubCacheDebouncer) { - ensureSubCacheDebouncer.cancel(); - } - if (parentRequestDebouncer) { - parentRequestDebouncer.cancel(); - } - if (rootRequestDebouncer) { - rootRequestDebouncer.cancel(); - } - ensureSubCacheDebouncer = undefined; - parentRequestDebouncer = undefined; - ensureSubCacheQueue = []; - parentRequestQueue = []; - updateAllGridRowsInDomBasedOnCache(); - }); - - const deleteObjectContents = (obj) => Object.keys(obj).forEach((key) => delete obj[key]); - - grid.$connector.updateSize = (newSize) => (grid.size = newSize); - - grid.$connector.updateUniqueItemIdPath = (path) => (grid.itemIdPath = path); - - grid.$connector.expandItems = tryCatchWrapper(function (items) { - let newExpandedItems = Array.from(grid.expandedItems); - items.filter((item) => !grid._isExpanded(item)).forEach((item) => newExpandedItems.push(item)); - grid.expandedItems = newExpandedItems; - }); - - grid.$connector.collapseItems = tryCatchWrapper(function (items) { - let newExpandedItems = Array.from(grid.expandedItems); - items.forEach((item) => { - let index = grid._getItemIndexInArray(item, newExpandedItems); - if (index >= 0) { - newExpandedItems.splice(index, 1); - } - }); - grid.expandedItems = newExpandedItems; - items.forEach((item) => grid.$connector.removeFromQueue(item)); - }); - - grid.$connector.removeFromQueue = tryCatchWrapper(function (item) { - let itemId = grid.getItemId(item); - delete treePageCallbacks[itemId]; - grid.$connector.removeFromArray(ensureSubCacheQueue, (item) => item.itemkey === itemId); - grid.$connector.removeFromArray(parentRequestQueue, (item) => item.parentKey === itemId); - }); - - grid.$connector.removeFromArray = tryCatchWrapper(function (array, removeTest) { - if (array.length) { - for (let index = array.length - 1; index--; ) { - if (removeTest(array[index])) { - array.splice(index, 1); - } - } - } - }); - - grid.$connector.confirmParent = tryCatchWrapper(function (id, parentKey, levelSize) { - if (!cache[parentKey]) { - cache[parentKey] = {}; - } - cache[parentKey].size = levelSize; - if (levelSize === 0) { - cache[parentKey][0] = []; - } - - let outstandingRequests = Object.getOwnPropertyNames(treePageCallbacks[parentKey] || {}); - for (let i = 0; i < outstandingRequests.length; i++) { - let page = outstandingRequests[i]; - - let lastRequestedRange = lastRequestedRanges[parentKey] || [0, 0]; - - const callback = treePageCallbacks[parentKey][page]; - if ( - (cache[parentKey] && cache[parentKey][page]) || - page < lastRequestedRange[0] || - page > lastRequestedRange[1] - ) { - delete treePageCallbacks[parentKey][page]; - let items = cache[parentKey][page] || new Array(levelSize); - callback(items, levelSize); - } else if (callback && levelSize === 0) { - // The parent item has 0 child items => resolve the callback with an empty array - delete treePageCallbacks[parentKey][page]; - callback([], levelSize); - } - } - // Let server know we're done - grid.$server.confirmParentUpdate(id, parentKey); - - if (!grid.loading) { - grid.__updateVisibleRows(); - } - }); - - grid.$connector.confirm = tryCatchWrapper(function (id) { - // We're done applying changes from this batch, resolve outstanding - // callbacks - let outstandingRequests = Object.getOwnPropertyNames(rootPageCallbacks); - for (let i = 0; i < outstandingRequests.length; i++) { - let page = outstandingRequests[i]; - let lastRequestedRange = lastRequestedRanges[root] || [0, 0]; - - const lastAvailablePage = grid.size ? Math.ceil(grid.size / grid.pageSize) - 1 : 0; - // It's possible that the lastRequestedRange includes a page that's beyond lastAvailablePage if the grid's size got reduced during an ongoing data request - const lastRequestedRangeEnd = Math.min(lastRequestedRange[1], lastAvailablePage); - // Resolve if we have data or if we don't expect to get data - const callback = rootPageCallbacks[page]; - if ((cache[root] && cache[root][page]) || page < lastRequestedRange[0] || +page > lastRequestedRangeEnd) { - delete rootPageCallbacks[page]; - - if (cache[root][page]) { - // Cached data is available, resolve the callback - callback(cache[root][page]); - } else { - // No cached data, resolve the callback with an empty array - callback(new Array(grid.pageSize)); - // Request grid for content update - grid.requestContentUpdate(); - } - - // Makes sure to push all new rows before this stack execution is done so any timeout expiration called after will be applied on a fully updated grid - //Resolves https://github.com/vaadin/vaadin-grid-flow/issues/511 - if (grid._debounceIncreasePool) { - grid._debounceIncreasePool.flush(); - } - } else if (callback && grid.size === 0) { - // The grid has 0 items => resolve the callback with an empty array - delete rootPageCallbacks[page]; - callback([]); - } - } - - // Let server know we're done - grid.$server.confirmUpdate(id); - }); - - grid.$connector.ensureHierarchy = tryCatchWrapper(function () { - for (let parentKey in cache) { - if (parentKey !== root) { - delete cache[parentKey]; - } - } - deleteObjectContents(lastRequestedRanges); - - grid._cache.itemCaches = {}; - grid._cache.itemkeyCaches = {}; - - updateAllGridRowsInDomBasedOnCache(); - }); - - grid.$connector.setSelectionMode = tryCatchWrapper(function (mode) { - if ((typeof mode === 'string' || mode instanceof String) && validSelectionModes.indexOf(mode) >= 0) { - selectionMode = mode; - selectedKeys = {}; - grid.$connector.updateMultiSelectable(); - } else { - throw 'Attempted to set an invalid selection mode'; - } - }); - - /* - * Manage aria-multiselectable attribute depending on the selection mode. - * see more: https://github.com/vaadin/web-components/issues/1536 - * or: https://www.w3.org/TR/wai-aria-1.1/#aria-multiselectable - * For selection mode SINGLE, set the aria-multiselectable attribute to false - */ - grid.$connector.updateMultiSelectable = tryCatchWrapper(function () { - if (!grid.$) { - return; - } - - if (selectionMode === validSelectionModes[0]) { - grid.$.table.setAttribute('aria-multiselectable', false); - // For selection mode NONE, remove the aria-multiselectable attribute - } else if (selectionMode === validSelectionModes[1]) { - grid.$.table.removeAttribute('aria-multiselectable'); - // For selection mode MULTI, set aria-multiselectable to true - } else { - grid.$.table.setAttribute('aria-multiselectable', true); - } - }); - - // Have the multi-selectable state updated on attach - grid._createPropertyObserver('isAttached', () => grid.$connector.updateMultiSelectable()); - - // TODO: should be removed once https://github.com/vaadin/vaadin-grid/issues/1471 gets implemented - grid.$connector.setVerticalScrollingEnabled = tryCatchWrapper(function (enabled) { - // There are two scollable containers in grid so apply the changes for both - setVerticalScrollingEnabled(grid.$.table, enabled); - }); - - const setVerticalScrollingEnabled = function (scrollable, enabled) { - // Prevent Y axis scrolling with CSS. This will hide the vertical scrollbar. - scrollable.style.overflowY = enabled ? '' : 'hidden'; - // Clean up an existing listener - scrollable.removeEventListener('wheel', scrollable.__wheelListener); - // Add a wheel event listener with the horizontal scrolling prevention logic - !enabled && - scrollable.addEventListener( - 'wheel', - (scrollable.__wheelListener = tryCatchWrapper((e) => { - if (e.deltaX) { - // If there was some horizontal delta related to the wheel event, force the vertical - // delta to 0 and let grid process the wheel event normally - Object.defineProperty(e, 'deltaY', { value: 0 }); - } else { - // If there was verical delta only, skip the grid's wheel event processing to - // enable scrolling the page even if grid isn't scrolled to end - e.stopImmediatePropagation(); - } - })) - ); - }; - - grid.addEventListener( - 'vaadin-context-menu-before-open', - tryCatchWrapper(function (e) { - const { key, columnId } = e.detail; - grid.$server.updateContextMenuTargetItem(key, columnId); - }) - ); - - grid.getContextMenuBeforeOpenDetail = tryCatchWrapper(function (event) { - // For `contextmenu` events, we need to access the source event, - // when using open on click we just use the click event itself - const sourceEvent = event.detail.sourceEvent || event; - const eventContext = grid.getEventContext(sourceEvent); - const key = (eventContext.item && eventContext.item.key) || ''; - const columnId = (eventContext.column && eventContext.column.id) || ''; - return { key, columnId }; - }); - - grid.addEventListener( - 'click', - tryCatchWrapper((e) => _fireClickEvent(e, 'item-click')) - ); - grid.addEventListener( - 'dblclick', - tryCatchWrapper((e) => _fireClickEvent(e, 'item-double-click')) - ); - - grid.addEventListener( - 'column-resize', - tryCatchWrapper((e) => { - const cols = grid._getColumnsInOrder().filter((col) => !col.hidden); - - cols.forEach((col) => { - col.dispatchEvent(new CustomEvent('column-drag-resize')); - }); - - grid.dispatchEvent( - new CustomEvent('column-drag-resize', { - detail: { - resizedColumnKey: e.detail.resizedColumn._flowId - } - }) - ); - }) - ); - - grid.addEventListener( - 'column-reorder', - tryCatchWrapper((e) => { - const columns = grid._columnTree - .slice(0) - .pop() - .filter((c) => c._flowId) - .sort((b, a) => b._order - a._order) - .map((c) => c._flowId); - - grid.dispatchEvent( - new CustomEvent('column-reorder-all-columns', { - detail: { columns } - }) - ); - }) - ); - - grid.addEventListener( - 'cell-focus', - tryCatchWrapper((e) => { - const eventContext = grid.getEventContext(e); - const expectedSectionValues = ['header', 'body', 'footer']; - - if (expectedSectionValues.indexOf(eventContext.section) === -1) { - return; - } - - grid.dispatchEvent( - new CustomEvent('grid-cell-focus', { - detail: { - itemKey: eventContext.item ? eventContext.item.key : null, - - internalColumnId: eventContext.column ? eventContext.column._flowId : null, - - section: eventContext.section - } - }) - ); - }) - ); - - function _fireClickEvent(event, eventName) { - // Click event was handled by the component inside grid, do nothing. - if (event.defaultPrevented) { - return; - } - - const target = event.target; - const eventContext = grid.getEventContext(event); - const section = eventContext.section; - - if (isFocusable(target) || target instanceof HTMLLabelElement) { - return; - } - - if (eventContext.item && section !== 'details') { - event.itemKey = eventContext.item.key; - // if you have a details-renderer, getEventContext().column is undefined - if (eventContext.column) { - event.internalColumnId = eventContext.column._flowId; - } - grid.dispatchEvent(new CustomEvent(eventName, { detail: event })); - } - } - - grid.cellClassNameGenerator = tryCatchWrapper(function (column, rowData) { - const style = rowData.item.style; - if (!style) { - return; - } - return (style.row || '') + ' ' + ((column && style[column._flowId]) || ''); - }); - - grid.dropFilter = tryCatchWrapper((rowData) => !rowData.item.dropDisabled); - - grid.dragFilter = tryCatchWrapper((rowData) => !rowData.item.dragDisabled); - - grid.addEventListener( - 'grid-dragstart', - tryCatchWrapper((e) => { - if (grid._isSelected(e.detail.draggedItems[0])) { - // Dragging selected (possibly multiple) items - if (grid.__selectionDragData) { - Object.keys(grid.__selectionDragData).forEach((type) => { - e.detail.setDragData(type, grid.__selectionDragData[type]); - }); - } else { - (grid.__dragDataTypes || []).forEach((type) => { - e.detail.setDragData(type, e.detail.draggedItems.map((item) => item.dragData[type]).join('\n')); - }); - } - - if (grid.__selectionDraggedItemsCount > 1) { - e.detail.setDraggedItemsCount(grid.__selectionDraggedItemsCount); - } - } else { - // Dragging just one (non-selected) item - (grid.__dragDataTypes || []).forEach((type) => { - e.detail.setDragData(type, e.detail.draggedItems[0].dragData[type]); - }); - } - }) - ); - })(grid) - }; -})(); diff --git a/java/demo/frontend/generated/jar-resources/index.d.ts b/java/demo/frontend/generated/jar-resources/index.d.ts deleted file mode 100644 index d4e6e0db6..000000000 --- a/java/demo/frontend/generated/jar-resources/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './Flow'; diff --git a/java/demo/frontend/generated/jar-resources/index.js b/java/demo/frontend/generated/jar-resources/index.js deleted file mode 100644 index 6c1482785..000000000 --- a/java/demo/frontend/generated/jar-resources/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export * from './Flow'; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/java/demo/frontend/generated/jar-resources/index.js.map b/java/demo/frontend/generated/jar-resources/index.js.map deleted file mode 100644 index c662ab4bb..000000000 --- a/java/demo/frontend/generated/jar-resources/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/main/frontend/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC","sourcesContent":["export * from './Flow';\n"]} \ No newline at end of file diff --git a/java/demo/frontend/generated/jar-resources/ironListConnector.js b/java/demo/frontend/generated/jar-resources/ironListConnector.js deleted file mode 100644 index 82d297f3d..000000000 --- a/java/demo/frontend/generated/jar-resources/ironListConnector.js +++ /dev/null @@ -1,166 +0,0 @@ -import { Debouncer } from '@polymer/polymer/lib/utils/debounce.js'; -import { timeOut } from '@polymer/polymer/lib/utils/async.js'; - -window.Vaadin.Flow.ironListConnector = { - initLazy: function (list) { - // Check whether the connector was already initialized for the Iron list - if (list.$connector) { - return; - } - - const extraItemsBuffer = 20; - - let lastRequestedRange = [0, 0]; - - list.$connector = {}; - list.$connector.placeholderItem = { __placeholder: true }; - - const updateRequestedItem = function () { - /* - * TODO Iron list seems to do a small index adjustment after scrolling - * has stopped. This causes a redundant request to be sent to make a - * corresponding minimal change to the buffer. We should avoid these - * requests by making the logic skip doing a request if the available - * buffer is within some tolerance compared to the requested buffer. - */ - let firstNeededItem = list._virtualStart; - let lastNeededItem = list._virtualEnd; - - let first = Math.max(0, firstNeededItem - extraItemsBuffer); - let last = Math.min(lastNeededItem + extraItemsBuffer, list.items.length); - - if (lastRequestedRange[0] != first || lastRequestedRange[1] != last) { - lastRequestedRange = [first, last]; - const count = 1 + last - first; - list.$server.setRequestedRange(first, count); - } - }; - - let requestDebounce; - const scheduleUpdateRequest = function () { - requestDebounce = Debouncer.debounce(requestDebounce, timeOut.after(10), updateRequestedItem); - }; - - /* - * Ensure all items that iron list will be looking at are actually defined. - * If this is not done, the component will keep looking ahead through the - * array until finding enough present items to render. In our case, that's - * a really slow way of achieving nothing since the rest of the array is - * empty. - */ - const originalAssign = list._assignModels; - list._assignModels = function () { - const tempItems = []; - const start = list._virtualStart; - const count = Math.min(list.items.length, list._physicalCount); - for (let i = 0; i < count; i++) { - if (list.items[start + i] === undefined) { - tempItems.push(i); - list.items[start + i] = list.$connector.placeholderItem; - } - } - - originalAssign.apply(list, arguments); - - /* - * TODO: Keep track of placeholder items in the "active" range and - * avoid deleting them so that the next pass will be faster. Instead, - * the end of each pass should only delete placeholders that are no - * longer needed. - */ - for (let i = 0; i < tempItems.length; i++) { - delete list.items[start + tempItems[i]]; - } - - /* - * Check if we need to do anything once things have settled down. - * This method is called multiple times in sequence for the same user - * action, but we only want to do the check once. - */ - scheduleUpdateRequest(); - }; - - list.items = []; - - list.$connector.set = function (index, items) { - for (let i = 0; i < items.length; i++) { - const itemsIndex = index + i; - list.items[itemsIndex] = items[i]; - } - // Do a full render since dirty detection for splices is broken - list._render(); - }; - - list.$connector.updateData = function (items) { - // Find the items by key inside the list update them - const oldItems = list.items; - const mapByKey = {}; - let leftToUpdate = items.length; - - for (let i = 0; i < items.length; i++) { - const item = items[i]; - mapByKey[item.key] = item; - } - - for (let i = 0; i < oldItems.length; i++) { - const oldItem = oldItems[i]; - const newItem = mapByKey[oldItem.key]; - if (newItem) { - list.items[i] = newItem; - list.notifyPath('items.' + i); - leftToUpdate--; - if (leftToUpdate == 0) { - break; - } - } - } - }; - - list.$connector.clear = function (index, length) { - for (let i = 0; i < length; i++) { - const itemsIndex = index + i; - delete list.items[itemsIndex]; - - // Most likely a no-op since the affected index isn't in view - list.notifyPath('items.' + itemsIndex); - } - }; - - list.$connector.updateSize = function (newSize) { - const delta = newSize - list.items.length; - if (delta > 0) { - list.items.length = newSize; - - list.notifySplices('items', [ - { - index: newSize - delta, - removed: [], - addedCount: delta, - object: list.items, - type: 'splice' - } - ]); - } else if (delta < 0) { - const removed = list.items.slice(newSize, list.items.length); - list.items.splice(newSize); - list.notifySplices('items', [ - { - index: newSize, - removed: removed, - addedCount: 0, - object: list.items, - type: 'splice' - } - ]); - } - }; - - list.$connector.setPlaceholderItem = function (placeholderItem) { - if (!placeholderItem) { - placeholderItem = {}; - } - placeholderItem.__placeholder = true; - list.$connector.placeholderItem = placeholderItem; - }; - } -}; diff --git a/java/demo/frontend/generated/jar-resources/ironListStyles.js b/java/demo/frontend/generated/jar-resources/ironListStyles.js deleted file mode 100644 index 96b50e2d3..000000000 --- a/java/demo/frontend/generated/jar-resources/ironListStyles.js +++ /dev/null @@ -1,12 +0,0 @@ -import '@polymer/polymer/lib/elements/custom-style.js'; -const $_documentContainer = document.createElement('template'); - -$_documentContainer.innerHTML = ``; - -document.head.appendChild($_documentContainer.content); diff --git a/java/demo/frontend/generated/jar-resources/lit-renderer.ts b/java/demo/frontend/generated/jar-resources/lit-renderer.ts deleted file mode 100644 index 081a40a9c..000000000 --- a/java/demo/frontend/generated/jar-resources/lit-renderer.ts +++ /dev/null @@ -1,108 +0,0 @@ -/* eslint-disable no-restricted-syntax */ -/* eslint-disable max-params */ -import { html, render } from 'lit'; - -type RenderRoot = HTMLElement & { __litRenderer?: Renderer; _$litPart$?: any }; - -type ItemModel = { item: any; index: number }; - -type Renderer = ((root: RenderRoot, rendererOwner: HTMLElement, model: ItemModel) => void) & { __rendererId?: string }; - -type Component = HTMLElement & { [key: string]: Renderer | undefined }; - -const _window = window as any; -_window.Vaadin = _window.Vaadin || {}; - -/** - * Assigns the component a renderer function which uses Lit to render - * the given template expression inside the render root element. - * - * @param component The host component to which the renderer runction is to be set - * @param rendererName The name of the renderer function - * @param templateExpression The content of the template literal passed to Lit for rendering. - * @param returnChannel A channel to the server. - * Calling it will end up invoking a handler in the server-side LitRenderer. - * @param clientCallables A list of function names that can be called from within the template literal. - * @param propertyNamespace LitRenderer-specific namespace for properties. - * Needed to avoid property name collisions between renderers. - */ -_window.Vaadin.setLitRenderer = ( - component: Component, - rendererName: string, - templateExpression: string, - returnChannel: (name: string, itemKey: string, args: any[]) => void, - clientCallables: string[], - propertyNamespace: string, -) => { - // Dynamically created function that renders the templateExpression - // inside the given root element using Lit - const renderFunction = Function(` - "use strict"; - - const [render, html, returnChannel] = arguments; - - return (root, {item, index}, itemKey) => { - ${clientCallables - .map((clientCallable) => { - // Map all the client-callables as inline functions so they can be accessed from the template literal - return ` - const ${clientCallable} = (...args) => { - if (itemKey !== undefined) { - returnChannel('${clientCallable}', itemKey, args[0] instanceof Event ? [] : [...args]); - } - }`; - }) - .join('')} - - render(html\`${templateExpression}\`, root) - } - `)(render, html, returnChannel); - - const renderer: Renderer = (root, _, { index, item }) => { - // Clean up the root element of any existing content - // (and Lit's _$litPart$ property) from other renderers - // TODO: Remove once https://github.com/vaadin/web-components/issues/2235 is done - if (root.__litRenderer !== renderer) { - root.innerHTML = ''; - delete root._$litPart$; - root.__litRenderer = renderer; - } - - // Map a new item that only includes the properties defined by - // this specific LitRenderer instance. The renderer instance specific - // "propertyNamespace" prefix is stripped from the property name at this point: - // - // item: { key: "2", lr_3_lastName: "Tyler"} - // -> - // mappedItem: { lastName: "Tyler" } - const mappedItem: { [key: string]: any } = {}; - for (const key in item) { - if (key.startsWith(propertyNamespace)) { - mappedItem[key.replace(propertyNamespace, '')] = item[key]; - } - } - - renderFunction(root, { index, item: mappedItem }, item.key); - }; - - renderer.__rendererId = propertyNamespace; - component[rendererName] = renderer; -}; - -/** - * Removes the renderer function with the given name from the component - * if the propertyNamespace matches the renderer's id. - * - * @param component The host component whose renderer function is to be removed - * @param rendererName The name of the renderer function - * @param rendererId The rendererId of the function to be removed - */ -_window.Vaadin.unsetLitRenderer = (component: Component, rendererName: string, rendererId: string) => { - // The check for __rendererId property is necessary since the renderer function - // may get overridden by another renderer, for example, by one coming from - // vaadin-template-renderer. We don't want LitRenderer registration cleanup to - // unintentionally remove the new renderer. - if (component[rendererName]?.__rendererId === rendererId) { - component[rendererName] = undefined; - } -}; diff --git a/java/demo/frontend/generated/jar-resources/loginOverlayConnector.js b/java/demo/frontend/generated/jar-resources/loginOverlayConnector.js deleted file mode 100644 index b56477bef..000000000 --- a/java/demo/frontend/generated/jar-resources/loginOverlayConnector.js +++ /dev/null @@ -1,40 +0,0 @@ -(function () { - function copyClassName(loginOverlay) { - const overlayWrapper = loginOverlay.$.vaadinLoginOverlayWrapper; - if (overlayWrapper) { - overlayWrapper.className = loginOverlay.className; - } - } - - const observer = new MutationObserver((records) => { - records.forEach((mutation) => { - if (mutation.type === 'attributes' && mutation.attributeName === 'class') { - copyClassName(mutation.target); - } - }); - }); - - window.Vaadin.Flow.loginOverlayConnector = { - initLazy: function (loginOverlay) { - if (loginOverlay.$connector) { - return; - } - - loginOverlay.$connector = {}; - - loginOverlay.addEventListener('opened-changed', (e) => { - if (e.detail.value) { - copyClassName(loginOverlay); - } - }); - - observer.observe(loginOverlay, { - attributes: true, - attributeFilter: ['class'] - }); - - // Copy initial class - copyClassName(loginOverlay); - } - }; -})(); diff --git a/java/demo/frontend/generated/jar-resources/lumo-includes.ts b/java/demo/frontend/generated/jar-resources/lumo-includes.ts deleted file mode 100644 index bd4834fe1..000000000 --- a/java/demo/frontend/generated/jar-resources/lumo-includes.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { color } from '@vaadin/vaadin-lumo-styles/color.js'; -import { typography } from '@vaadin/vaadin-lumo-styles/typography.js'; - -const tpl = document.createElement('template'); -tpl.innerHTML = ``; -document.head.appendChild(tpl.content); diff --git a/java/demo/frontend/generated/jar-resources/material-includes.ts b/java/demo/frontend/generated/jar-resources/material-includes.ts deleted file mode 100644 index 07ba838ae..000000000 --- a/java/demo/frontend/generated/jar-resources/material-includes.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { colorLight } from '@vaadin/vaadin-material-styles'; -import { typography } from '@vaadin/vaadin-material-styles'; - -const tpl = document.createElement('template'); -tpl.innerHTML = ``; -document.head.appendChild(tpl.content); diff --git a/java/demo/frontend/generated/jar-resources/menubarConnector.js b/java/demo/frontend/generated/jar-resources/menubarConnector.js deleted file mode 100644 index 72c808e4b..000000000 --- a/java/demo/frontend/generated/jar-resources/menubarConnector.js +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright 2000-2022 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -import './contextMenuConnector.js'; - -(function () { - const tryCatchWrapper = function (callback) { - return window.Vaadin.Flow.tryCatchWrapper(callback, 'Vaadin Menu Bar'); - }; - - /** - * Initializes the connector for a menu bar element. - * - * @param {HTMLElement} menubar - * @param {string} appId - */ - function initLazy(menubar, appId) { - if (menubar.$connector) { - return; - } - - const observer = new MutationObserver((records) => { - const hasChangedAttributes = records.some((entry) => { - const oldValue = entry.oldValue; - const newValue = entry.target.getAttribute(entry.attributeName); - return oldValue !== newValue; - }); - - if (hasChangedAttributes) { - menubar.$connector.generateItems(); - } - }); - - menubar.$connector = { - /** - * Generates and assigns the items to the menu bar. - * - * When the method is called without providing a node id, - * the previously generated items tree will be used. - * That can be useful if you only want to sync the disabled and hidden properties of root items. - * - * @param {number | undefined} nodeId - */ - generateItems: tryCatchWrapper((nodeId) => { - if (!menubar.shadowRoot) { - // workaround for https://github.com/vaadin/flow/issues/5722 - setTimeout(() => menubar.$connector.generateItems(nodeId)); - return; - } - - if (nodeId) { - menubar.__generatedItems = window.Vaadin.Flow.contextMenuConnector.generateItemsTree(appId, nodeId); - } - - let items = menubar.__generatedItems || []; - - // Propagate disabled state from items to parent buttons - items.forEach((item) => (item.disabled = item.component.disabled)); - - // Remove hidden items entirely from the array. Just hiding them - // could cause the overflow button to be rendered without items. - // - // The items-prop needs to be set even when all items are visible - // to update the disabled state and re-render buttons. - items = items.filter((item) => !item.component.hidden); - - // Observe for hidden and disabled attributes in case they are changed by Flow. - // When a change occurs, the observer will re-generate items on top of the existing tree - // to sync the new attribute values with the corresponding properties in the items array. - items.forEach((item) => { - observer.observe(item.component, { - attributeFilter: ['hidden', 'disabled'], - attributeOldValue: true - }); - }); - - menubar.items = items; - - // Propagate click events from the menu buttons to the item components - menubar._buttons.forEach((button) => { - if (button.item && button.item.component) { - button.addEventListener('click', (e) => { - if (e.composedPath().indexOf(button.item.component) === -1) { - button.item.component.click(); - e.stopPropagation(); - } - }); - } - }); - }) - }; - } - - window.Vaadin.Flow.menubarConnector = { - initLazy(...args) { - return tryCatchWrapper(initLazy)(...args); - } - }; -})(); diff --git a/java/demo/frontend/generated/jar-resources/messageListConnector.js b/java/demo/frontend/generated/jar-resources/messageListConnector.js deleted file mode 100644 index 6e1a325ed..000000000 --- a/java/demo/frontend/generated/jar-resources/messageListConnector.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2000-2022 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -(function () { - const tryCatchWrapper = function (callback) { - return window.Vaadin.Flow.tryCatchWrapper(callback, 'Vaadin Message List'); - }; - - window.Vaadin.Flow.messageListConnector = { - setItems: (list, items, locale) => - tryCatchWrapper(function (list, items, locale) { - const formatter = new Intl.DateTimeFormat(locale, { - year: 'numeric', - month: 'short', - day: 'numeric', - hour: 'numeric', - minute: 'numeric' - }); - list.items = items.map((item) => - item.time - ? Object.assign(item, { - time: formatter.format(new Date(item.time)) - }) - : item - ); - })(list, items, locale) - }; -})(); diff --git a/java/demo/frontend/generated/jar-resources/notificationConnector.js b/java/demo/frontend/generated/jar-resources/notificationConnector.js deleted file mode 100644 index beee883c2..000000000 --- a/java/demo/frontend/generated/jar-resources/notificationConnector.js +++ /dev/null @@ -1,38 +0,0 @@ -(function () { - function copyClassName(notification) { - const card = notification._card; - if (card) { - card.className = notification.className; - } - } - - const observer = new MutationObserver((records) => { - records.forEach((mutation) => { - if (mutation.type === 'attributes' && mutation.attributeName === 'class') { - copyClassName(mutation.target); - } - }); - }); - - window.Vaadin.Flow.notificationConnector = { - initLazy: function (notification) { - if (notification.$connector) { - return; - } - notification.$connector = {}; - - notification.addEventListener('opened-changed', (e) => { - if (e.detail.value) { - copyClassName(notification); - } - }); - - observer.observe(notification, { - attributes: true, - attributeFilter: ['class'] - }); - - copyClassName(notification); - } - }; -})(); diff --git a/java/demo/frontend/generated/jar-resources/selectConnector.js b/java/demo/frontend/generated/jar-resources/selectConnector.js deleted file mode 100644 index 52fc0a237..000000000 --- a/java/demo/frontend/generated/jar-resources/selectConnector.js +++ /dev/null @@ -1,36 +0,0 @@ -(function () { - const tryCatchWrapper = function (callback) { - return window.Vaadin.Flow.tryCatchWrapper(callback, 'Vaadin Select'); - }; - - window.Vaadin.Flow.selectConnector = { - initLazy: (select) => - tryCatchWrapper(function (select) { - const _findListBoxElement = tryCatchWrapper(function () { - for (let i = 0; i < select.childElementCount; i++) { - const child = select.children[i]; - if ('VAADIN-SELECT-LIST-BOX' === child.tagName.toUpperCase()) { - return child; - } - } - }); - - // do not init this connector twice for the given select - if (select.$connector) { - return; - } - - select.$connector = {}; - - select.renderer = tryCatchWrapper(function (root) { - const listBox = _findListBoxElement(); - if (listBox) { - if (root.firstChild) { - root.removeChild(root.firstChild); - } - root.appendChild(listBox); - } - }); - })(select) - }; -})(); diff --git a/java/demo/frontend/generated/jar-resources/tooltip.ts b/java/demo/frontend/generated/jar-resources/tooltip.ts deleted file mode 100644 index a9c862828..000000000 --- a/java/demo/frontend/generated/jar-resources/tooltip.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Tooltip } from '@vaadin/tooltip'; - -const _window = window as any; -_window.Vaadin = _window.Vaadin || {}; -_window.Vaadin.Flow = _window.Vaadin.Flow || {}; - -_window.Vaadin.Flow.tooltip = { - setDefaultHideDelay: (hideDelay: number) => Tooltip.setDefaultHideDelay(hideDelay), - setDefaultFocusDelay: (focusDelay: number) => Tooltip.setDefaultFocusDelay(focusDelay), - setDefaultHoverDelay: (hoverDelay: number) => Tooltip.setDefaultHoverDelay(hoverDelay), -} diff --git a/java/demo/frontend/generated/jar-resources/vaadin-big-decimal-field.js b/java/demo/frontend/generated/jar-resources/vaadin-big-decimal-field.js deleted file mode 100644 index 3f4b28f0e..000000000 --- a/java/demo/frontend/generated/jar-resources/vaadin-big-decimal-field.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2000-2022 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -(function() { - - let memoizedTemplate; - - customElements.whenDefined('vaadin-text-field').then(() => { - - class BigDecimalFieldElement extends customElements.get('vaadin-text-field') { - - static get template() { - if (!memoizedTemplate) { - memoizedTemplate = super.template.cloneNode(true); - memoizedTemplate.innerHTML += - ``; - } - return memoizedTemplate; - } - - static get is() { - return 'vaadin-big-decimal-field'; - } - - static get properties() { - return { - _decimalSeparator: { - type: String, - value: '.', - observer: '__decimalSeparatorChanged' - } - } - } - - ready() { - super.ready(); - this.inputElement.setAttribute('inputmode', 'decimal'); - } - - __decimalSeparatorChanged(separator, oldSeparator) { - this.allowedCharPattern = '[\\d-+' + separator + ']'; - - if (this.value && oldSeparator) { - this.value = this.value.split(oldSeparator).join(separator); - } - } - - } - - customElements.define(BigDecimalFieldElement.is, BigDecimalFieldElement); - - }); -})(); diff --git a/java/demo/frontend/generated/jar-resources/vaadin-dev-tools.d.ts b/java/demo/frontend/generated/jar-resources/vaadin-dev-tools.d.ts deleted file mode 100644 index a7583c0c1..000000000 --- a/java/demo/frontend/generated/jar-resources/vaadin-dev-tools.d.ts +++ /dev/null @@ -1,119 +0,0 @@ -import { LitElement } from 'lit'; -import { Product } from './License'; -interface Feature { - id: string; - title: string; - moreInfoLink: string; - requiresServerRestart: boolean; - enabled: boolean; -} -declare enum ConnectionStatus { - ACTIVE = "active", - INACTIVE = "inactive", - UNAVAILABLE = "unavailable", - ERROR = "error" -} -export declare class Connection extends Object { - static HEARTBEAT_INTERVAL: number; - status: ConnectionStatus; - webSocket?: WebSocket; - constructor(url?: string); - onHandshake(): void; - onReload(): void; - onConnectionError(_: string): void; - onStatusChange(_: ConnectionStatus): void; - onMessage(message: any): void; - handleMessage(msg: any): void; - handleError(msg: any): void; - setActive(yes: boolean): void; - setStatus(status: ConnectionStatus): void; - private send; - setFeature(featureId: string, enabled: boolean): void; - sendTelemetry(browserData: any): void; - sendLicenseCheck(product: Product): void; -} -declare enum MessageType { - LOG = "log", - INFORMATION = "information", - WARNING = "warning", - ERROR = "error" -} -interface Message { - id: number; - type: MessageType; - message: string; - details?: string; - link?: string; - persistentId?: string; - dontShowAgain: boolean; - deleted: boolean; -} -export declare class VaadinDevTools extends LitElement { - static BLUE_HSL: import("lit").CSSResult; - static GREEN_HSL: import("lit").CSSResult; - static GREY_HSL: import("lit").CSSResult; - static YELLOW_HSL: import("lit").CSSResult; - static RED_HSL: import("lit").CSSResult; - static MAX_LOG_ROWS: number; - static get styles(): import("lit").CSSResult; - static DISMISSED_NOTIFICATIONS_IN_LOCAL_STORAGE: string; - static ACTIVE_KEY_IN_SESSION_STORAGE: string; - static TRIGGERED_KEY_IN_SESSION_STORAGE: string; - static TRIGGERED_COUNT_KEY_IN_SESSION_STORAGE: string; - static AUTO_DEMOTE_NOTIFICATION_DELAY: number; - static HOTSWAP_AGENT: string; - static JREBEL: string; - static SPRING_BOOT_DEVTOOLS: string; - static BACKEND_DISPLAY_NAME: Record; - static get isActive(): boolean; - static notificationDismissed(persistentId: string): boolean; - url?: string; - liveReloadDisabled?: boolean; - backend?: string; - springBootLiveReloadPort?: number; - expanded: boolean; - messages: Message[]; - splashMessage?: string; - notifications: Message[]; - frontendStatus: ConnectionStatus; - javaStatus: ConnectionStatus; - private tabs; - private activeTab; - private serverInfo; - private features; - private unreadErrors; - private root; - private javaConnection?; - private frontendConnection?; - private nextMessageId; - private disableEventListener?; - private transitionDuration; - elementTelemetry(): void; - openWebSocketConnection(): void; - getDedicatedWebSocketUrl(): string | undefined; - getSpringBootWebSocketUrl(location: any): string; - connectedCallback(): void; - format(o: any): string; - catchErrors(): void; - disconnectedCallback(): void; - toggleExpanded(): void; - showSplashMessage(msg: string | undefined): void; - demoteSplashMessage(): void; - checkLicense(productInfo: Product): void; - log(type: MessageType, message: string, details?: string, link?: string): void; - showNotification(type: MessageType, message: string, details?: string, link?: string, persistentId?: string): void; - dismissNotification(id: number): void; - findNotificationIndex(id: number): number; - toggleDontShowAgain(id: number): void; - setActive(yes: boolean): void; - getStatusColor(status: ConnectionStatus | undefined): import("lit").CSSResult; - renderMessage(messageObject: Message): import("lit-html").TemplateResult<1>; - render(): import("lit-html").TemplateResult<1>; - renderLog(): import("lit-html").TemplateResult<1>; - activateLog(): void; - renderInfo(): import("lit-html").TemplateResult<1>; - private renderFeatures; - copyInfoToClipboard(): void; - toggleFeatureFlag(e: Event, feature: Feature): void; -} -export {}; diff --git a/java/demo/frontend/generated/jar-resources/vaadin-dev-tools.js b/java/demo/frontend/generated/jar-resources/vaadin-dev-tools.js deleted file mode 100644 index 547fd0da8..000000000 --- a/java/demo/frontend/generated/jar-resources/vaadin-dev-tools.js +++ /dev/null @@ -1,1477 +0,0 @@ -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -import { css, html, LitElement, nothing } from 'lit'; -import { property, query, state } from 'lit/decorators.js'; -import { classMap } from 'lit/directives/class-map.js'; -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore -import { copy } from './copy-to-clipboard.js'; -import { licenseCheckFailed, licenseCheckNoKey, licenseCheckOk, licenseInit } from './License'; -var ConnectionStatus; -(function (ConnectionStatus) { - ConnectionStatus["ACTIVE"] = "active"; - ConnectionStatus["INACTIVE"] = "inactive"; - ConnectionStatus["UNAVAILABLE"] = "unavailable"; - ConnectionStatus["ERROR"] = "error"; -})(ConnectionStatus || (ConnectionStatus = {})); -export class Connection extends Object { - constructor(url) { - super(); - this.status = ConnectionStatus.UNAVAILABLE; - if (url) { - this.webSocket = new WebSocket(url); - this.webSocket.onmessage = (msg) => this.handleMessage(msg); - this.webSocket.onerror = (err) => this.handleError(err); - this.webSocket.onclose = (_) => { - if (this.status !== ConnectionStatus.ERROR) { - this.setStatus(ConnectionStatus.UNAVAILABLE); - } - this.webSocket = undefined; - }; - } - setInterval(() => { - if (this.webSocket && self.status !== ConnectionStatus.ERROR && this.status !== ConnectionStatus.UNAVAILABLE) { - this.webSocket.send(''); - } - }, Connection.HEARTBEAT_INTERVAL); - } - onHandshake() { - // Intentionally empty - } - onReload() { - // Intentionally empty - } - onConnectionError(_) { - // Intentionally empty - } - onStatusChange(_) { - // Intentionally empty - } - onMessage(message) { - // eslint-disable-next-line no-console - console.error('Unknown message received from the live reload server:', message); - } - handleMessage(msg) { - let json; - try { - json = JSON.parse(msg.data); - } - catch (e) { - this.handleError(`[${e.name}: ${e.message}`); - return; - } - if (json.command === 'hello') { - this.setStatus(ConnectionStatus.ACTIVE); - this.onHandshake(); - } - else if (json.command === 'reload') { - if (this.status === ConnectionStatus.ACTIVE) { - this.onReload(); - } - } - else if (json.command === 'license-check-ok') { - licenseCheckOk(json.data); - } - else if (json.command === 'license-check-failed') { - licenseCheckFailed(json.data); - } - else if (json.command === 'license-check-nokey') { - licenseCheckNoKey(json.data); - } - else { - this.onMessage(json); - } - } - handleError(msg) { - // eslint-disable-next-line no-console - console.error(msg); - this.setStatus(ConnectionStatus.ERROR); - if (msg instanceof Event && this.webSocket) { - this.onConnectionError(`Error in WebSocket connection to ${this.webSocket.url}`); - } - else { - this.onConnectionError(msg); - } - } - setActive(yes) { - if (!yes && this.status === ConnectionStatus.ACTIVE) { - this.setStatus(ConnectionStatus.INACTIVE); - } - else if (yes && this.status === ConnectionStatus.INACTIVE) { - this.setStatus(ConnectionStatus.ACTIVE); - } - } - setStatus(status) { - if (this.status !== status) { - this.status = status; - this.onStatusChange(status); - } - } - send(command, data) { - const message = JSON.stringify({ command, data }); - if (!this.webSocket) { - // eslint-disable-next-line no-console - console.error(`Unable to send message ${command}. No websocket is available`); - } - else if (this.webSocket.readyState !== WebSocket.OPEN) { - this.webSocket.addEventListener('open', () => this.webSocket.send(message)); - } - else { - this.webSocket.send(message); - } - } - setFeature(featureId, enabled) { - this.send('setFeature', { featureId, enabled }); - } - sendTelemetry(browserData) { - this.send('reportTelemetry', { browserData }); - } - sendLicenseCheck(product) { - this.send('checkLicense', product); - } -} -Connection.HEARTBEAT_INTERVAL = 180000; -var MessageType; -(function (MessageType) { - MessageType["LOG"] = "log"; - MessageType["INFORMATION"] = "information"; - MessageType["WARNING"] = "warning"; - MessageType["ERROR"] = "error"; -})(MessageType || (MessageType = {})); -export class VaadinDevTools extends LitElement { - constructor() { - super(...arguments); - this.expanded = false; - this.messages = []; - this.notifications = []; - this.frontendStatus = ConnectionStatus.UNAVAILABLE; - this.javaStatus = ConnectionStatus.UNAVAILABLE; - this.tabs = [ - { id: 'log', title: 'Log', render: this.renderLog, activate: this.activateLog }, - { id: 'info', title: 'Info', render: this.renderInfo }, - { id: 'features', title: 'Feature Flags', render: this.renderFeatures } - ]; - this.activeTab = 'log'; - this.serverInfo = { - flowVersion: '', - vaadinVersion: '', - javaVersion: '', - osVersion: '', - productName: '' - }; - this.features = []; - this.unreadErrors = false; - this.nextMessageId = 1; - this.transitionDuration = 0; - } - static get styles() { - return css ` - :host { - --dev-tools-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, - 'Helvetica Neue', sans-serif; - --dev-tools-font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', - monospace; - - --dev-tools-font-size: 0.8125rem; - --dev-tools-font-size-small: 0.75rem; - - --dev-tools-text-color: rgba(255, 255, 255, 0.8); - --dev-tools-text-color-secondary: rgba(255, 255, 255, 0.65); - --dev-tools-text-color-emphasis: rgba(255, 255, 255, 0.95); - --dev-tools-text-color-active: rgba(255, 255, 255, 1); - - --dev-tools-background-color-inactive: rgba(45, 45, 45, 0.25); - --dev-tools-background-color-active: rgba(45, 45, 45, 0.98); - --dev-tools-background-color-active-blurred: rgba(45, 45, 45, 0.85); - - --dev-tools-border-radius: 0.5rem; - --dev-tools-box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 4px 12px -2px rgba(0, 0, 0, 0.4); - - --dev-tools-blue-hsl: ${this.BLUE_HSL}; - --dev-tools-blue-color: hsl(var(--dev-tools-blue-hsl)); - --dev-tools-green-hsl: ${this.GREEN_HSL}; - --dev-tools-green-color: hsl(var(--dev-tools-green-hsl)); - --dev-tools-grey-hsl: ${this.GREY_HSL}; - --dev-tools-grey-color: hsl(var(--dev-tools-grey-hsl)); - --dev-tools-yellow-hsl: ${this.YELLOW_HSL}; - --dev-tools-yellow-color: hsl(var(--dev-tools-yellow-hsl)); - --dev-tools-red-hsl: ${this.RED_HSL}; - --dev-tools-red-color: hsl(var(--dev-tools-red-hsl)); - - /* Needs to be in ms, used in JavaScript as well */ - --dev-tools-transition-duration: 180ms; - - all: initial; - - direction: ltr; - cursor: default; - font: normal 400 var(--dev-tools-font-size) / 1.125rem var(--dev-tools-font-family); - color: var(--dev-tools-text-color); - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; - - position: fixed; - z-index: 20000; - pointer-events: none; - bottom: 0; - right: 0; - width: 100%; - height: 100%; - display: flex; - flex-direction: column-reverse; - align-items: flex-end; - } - - .dev-tools { - pointer-events: auto; - display: flex; - align-items: center; - position: fixed; - z-index: inherit; - right: 0.5rem; - bottom: 0.5rem; - min-width: 1.75rem; - height: 1.75rem; - max-width: 1.75rem; - border-radius: 0.5rem; - padding: 0.375rem; - box-sizing: border-box; - background-color: var(--dev-tools-background-color-inactive); - box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05); - color: var(--dev-tools-text-color); - transition: var(--dev-tools-transition-duration); - white-space: nowrap; - line-height: 1rem; - } - - .dev-tools:hover, - .dev-tools.active { - background-color: var(--dev-tools-background-color-active); - box-shadow: var(--dev-tools-box-shadow); - } - - .dev-tools.active { - max-width: calc(100% - 1rem); - } - - .dev-tools .dev-tools-icon { - flex: none; - pointer-events: none; - display: inline-block; - width: 1rem; - height: 1rem; - fill: #fff; - transition: var(--dev-tools-transition-duration); - margin: 0; - } - - .dev-tools.active .dev-tools-icon { - opacity: 0; - position: absolute; - transform: scale(0.5); - } - - .dev-tools .status-blip { - flex: none; - display: block; - width: 6px; - height: 6px; - border-radius: 50%; - z-index: 20001; - background: var(--dev-tools-grey-color); - position: absolute; - top: -1px; - right: -1px; - } - - .dev-tools .status-description { - overflow: hidden; - text-overflow: ellipsis; - padding: 0 0.25rem; - } - - .dev-tools.error { - background-color: hsla(var(--dev-tools-red-hsl), 0.15); - animation: bounce 0.5s; - animation-iteration-count: 2; - } - - .switch { - display: inline-flex; - align-items: center; - } - - .switch input { - opacity: 0; - width: 0; - height: 0; - position: absolute; - } - - .switch .slider { - display: block; - flex: none; - width: 28px; - height: 18px; - border-radius: 9px; - background-color: rgba(255, 255, 255, 0.3); - transition: var(--dev-tools-transition-duration); - margin-right: 0.5rem; - } - - .switch:focus-within .slider, - .switch .slider:hover { - background-color: rgba(255, 255, 255, 0.35); - transition: none; - } - - .switch input:focus-visible ~ .slider { - box-shadow: 0 0 0 2px var(--dev-tools-background-color-active), 0 0 0 4px var(--dev-tools-blue-color); - } - - .switch .slider::before { - content: ''; - display: block; - margin: 2px; - width: 14px; - height: 14px; - background-color: #fff; - transition: var(--dev-tools-transition-duration); - border-radius: 50%; - } - - .switch input:checked + .slider { - background-color: var(--dev-tools-green-color); - } - - .switch input:checked + .slider::before { - transform: translateX(10px); - } - - .switch input:disabled + .slider::before { - background-color: var(--dev-tools-grey-color); - } - - .window.hidden { - opacity: 0; - transform: scale(0); - position: absolute; - } - - .window.visible { - transform: none; - opacity: 1; - pointer-events: auto; - } - - .window.visible ~ .dev-tools { - opacity: 0; - pointer-events: none; - } - - .window.visible ~ .dev-tools .dev-tools-icon, - .window.visible ~ .dev-tools .status-blip { - transition: none; - opacity: 0; - } - - .window { - border-radius: var(--dev-tools-border-radius); - overflow: hidden; - margin: 0.5rem; - width: 30rem; - max-width: calc(100% - 1rem); - max-height: calc(100vh - 1rem); - flex-shrink: 1; - background-color: var(--dev-tools-background-color-active); - color: var(--dev-tools-text-color); - transition: var(--dev-tools-transition-duration); - transform-origin: bottom right; - display: flex; - flex-direction: column; - box-shadow: var(--dev-tools-box-shadow); - outline: none; - } - - .window-toolbar { - display: flex; - flex: none; - align-items: center; - padding: 0.375rem; - white-space: nowrap; - order: 1; - background-color: rgba(0, 0, 0, 0.2); - gap: 0.5rem; - } - - .tab { - color: var(--dev-tools-text-color-secondary); - font: inherit; - font-size: var(--dev-tools-font-size-small); - font-weight: 500; - line-height: 1; - padding: 0.25rem 0.375rem; - background: none; - border: none; - margin: 0; - border-radius: 0.25rem; - transition: var(--dev-tools-transition-duration); - } - - .tab:hover, - .tab.active { - color: var(--dev-tools-text-color-active); - } - - .tab.active { - background-color: rgba(255, 255, 255, 0.12); - } - - .tab.unreadErrors::after { - content: '•'; - color: hsl(var(--dev-tools-red-hsl)); - font-size: 1.5rem; - position: absolute; - transform: translate(0, -50%); - } - - .ahreflike { - font-weight: 500; - color: var(--dev-tools-text-color-secondary); - text-decoration: underline; - cursor: pointer; - } - - .ahreflike:hover { - color: var(--dev-tools-text-color-emphasis); - } - - .button { - all: initial; - font-family: inherit; - font-size: var(--dev-tools-font-size-small); - line-height: 1; - white-space: nowrap; - background-color: rgba(0, 0, 0, 0.2); - color: inherit; - font-weight: 600; - padding: 0.25rem 0.375rem; - border-radius: 0.25rem; - } - - .button:focus, - .button:hover { - color: var(--dev-tools-text-color-emphasis); - } - - .minimize-button { - flex: none; - width: 1rem; - height: 1rem; - color: inherit; - background-color: transparent; - border: 0; - padding: 0; - margin: 0 0 0 auto; - opacity: 0.8; - } - - .minimize-button:hover { - opacity: 1; - } - - .minimize-button svg { - max-width: 100%; - } - - .message.information { - --dev-tools-notification-color: var(--dev-tools-blue-color); - } - - .message.warning { - --dev-tools-notification-color: var(--dev-tools-yellow-color); - } - - .message.error { - --dev-tools-notification-color: var(--dev-tools-red-color); - } - - .message { - display: flex; - padding: 0.1875rem 0.75rem 0.1875rem 2rem; - background-clip: padding-box; - } - - .message.log { - padding-left: 0.75rem; - } - - .message-content { - margin-right: 0.5rem; - -webkit-user-select: text; - -moz-user-select: text; - user-select: text; - } - - .message-heading { - position: relative; - display: flex; - align-items: center; - margin: 0.125rem 0; - } - - .message.log { - color: var(--dev-tools-text-color-secondary); - } - - .message:not(.log) .message-heading { - font-weight: 500; - } - - .message.has-details .message-heading { - color: var(--dev-tools-text-color-emphasis); - font-weight: 600; - } - - .message-heading::before { - position: absolute; - margin-left: -1.5rem; - display: inline-block; - text-align: center; - font-size: 0.875em; - font-weight: 600; - line-height: calc(1.25em - 2px); - width: 14px; - height: 14px; - box-sizing: border-box; - border: 1px solid transparent; - border-radius: 50%; - } - - .message.information .message-heading::before { - content: 'i'; - border-color: currentColor; - color: var(--dev-tools-notification-color); - } - - .message.warning .message-heading::before, - .message.error .message-heading::before { - content: '!'; - color: var(--dev-tools-background-color-active); - background-color: var(--dev-tools-notification-color); - } - - .features-tray { - padding: 0.75rem; - flex: auto; - overflow: auto; - animation: fade-in var(--dev-tools-transition-duration) ease-in; - user-select: text; - } - - .features-tray p { - margin-top: 0; - color: var(--dev-tools-text-color-secondary); - } - - .features-tray .feature { - display: flex; - align-items: center; - gap: 1rem; - padding-bottom: 0.5em; - } - - .message .message-details { - font-weight: 400; - color: var(--dev-tools-text-color-secondary); - margin: 0.25rem 0; - } - - .message .message-details[hidden] { - display: none; - } - - .message .message-details p { - display: inline; - margin: 0; - margin-right: 0.375em; - word-break: break-word; - } - - .message .persist { - color: var(--dev-tools-text-color-secondary); - white-space: nowrap; - margin: 0.375rem 0; - display: flex; - align-items: center; - position: relative; - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; - } - - .message .persist::before { - content: ''; - width: 1em; - height: 1em; - border-radius: 0.2em; - margin-right: 0.375em; - background-color: rgba(255, 255, 255, 0.3); - } - - .message .persist:hover::before { - background-color: rgba(255, 255, 255, 0.4); - } - - .message .persist.on::before { - background-color: rgba(255, 255, 255, 0.9); - } - - .message .persist.on::after { - content: ''; - order: -1; - position: absolute; - width: 0.75em; - height: 0.25em; - border: 2px solid var(--dev-tools-background-color-active); - border-width: 0 0 2px 2px; - transform: translate(0.05em, -0.05em) rotate(-45deg) scale(0.8, 0.9); - } - - .message .dismiss-message { - font-weight: 600; - align-self: stretch; - display: flex; - align-items: center; - padding: 0 0.25rem; - margin-left: 0.5rem; - color: var(--dev-tools-text-color-secondary); - } - - .message .dismiss-message:hover { - color: var(--dev-tools-text-color); - } - - .notification-tray { - display: flex; - flex-direction: column-reverse; - align-items: flex-end; - margin: 0.5rem; - flex: none; - } - - .window.hidden + .notification-tray { - margin-bottom: 3rem; - } - - .notification-tray .message { - pointer-events: auto; - background-color: var(--dev-tools-background-color-active); - color: var(--dev-tools-text-color); - max-width: 30rem; - box-sizing: border-box; - border-radius: var(--dev-tools-border-radius); - margin-top: 0.5rem; - transition: var(--dev-tools-transition-duration); - transform-origin: bottom right; - animation: slideIn var(--dev-tools-transition-duration); - box-shadow: var(--dev-tools-box-shadow); - padding-top: 0.25rem; - padding-bottom: 0.25rem; - } - - .notification-tray .message.animate-out { - animation: slideOut forwards var(--dev-tools-transition-duration); - } - - .notification-tray .message .message-details { - max-height: 10em; - overflow: hidden; - } - - .message-tray { - flex: auto; - overflow: auto; - max-height: 20rem; - user-select: text; - } - - .message-tray .message { - animation: fade-in var(--dev-tools-transition-duration) ease-in; - padding-left: 2.25rem; - } - - .message-tray .message.warning { - background-color: hsla(var(--dev-tools-yellow-hsl), 0.09); - } - - .message-tray .message.error { - background-color: hsla(var(--dev-tools-red-hsl), 0.09); - } - - .message-tray .message.error .message-heading { - color: hsl(var(--dev-tools-red-hsl)); - } - - .message-tray .message.warning .message-heading { - color: hsl(var(--dev-tools-yellow-hsl)); - } - - .message-tray .message + .message { - border-top: 1px solid rgba(255, 255, 255, 0.07); - } - - .message-tray .dismiss-message, - .message-tray .persist { - display: none; - } - - .info-tray { - padding: 0.75rem; - position: relative; - flex: auto; - overflow: auto; - animation: fade-in var(--dev-tools-transition-duration) ease-in; - user-select: text; - } - - .info-tray dl { - margin: 0; - display: grid; - grid-template-columns: max-content 1fr; - column-gap: 0.75rem; - position: relative; - } - - .info-tray dt { - grid-column: 1; - color: var(--dev-tools-text-color-emphasis); - } - - .info-tray dt:not(:first-child)::before { - content: ''; - width: 100%; - position: absolute; - height: 1px; - background-color: rgba(255, 255, 255, 0.1); - margin-top: -0.375rem; - } - - .info-tray dd { - grid-column: 2; - margin: 0; - } - - .info-tray :is(dt, dd):not(:last-child) { - margin-bottom: 0.75rem; - } - - .info-tray dd + dd { - margin-top: -0.5rem; - } - - .info-tray .live-reload-status::before { - content: '•'; - color: var(--status-color); - width: 0.75rem; - display: inline-block; - font-size: 1rem; - line-height: 0.5rem; - } - - .info-tray .copy { - position: fixed; - z-index: 1; - top: 0.5rem; - right: 0.5rem; - } - - .info-tray .switch { - vertical-align: -4px; - } - - @keyframes slideIn { - from { - transform: translateX(100%); - opacity: 0; - } - to { - transform: translateX(0%); - opacity: 1; - } - } - - @keyframes slideOut { - from { - transform: translateX(0%); - opacity: 1; - } - to { - transform: translateX(100%); - opacity: 0; - } - } - - @keyframes fade-in { - 0% { - opacity: 0; - } - } - - @keyframes bounce { - 0% { - transform: scale(0.8); - } - 50% { - transform: scale(1.5); - background-color: hsla(var(--dev-tools-red-hsl), 1); - } - 100% { - transform: scale(1); - } - } - - @supports (backdrop-filter: blur(1px)) { - .dev-tools, - .window, - .notification-tray .message { - backdrop-filter: blur(8px); - } - .dev-tools:hover, - .dev-tools.active, - .window, - .notification-tray .message { - background-color: var(--dev-tools-background-color-active-blurred); - } - } - `; - } - static get isActive() { - const active = window.sessionStorage.getItem(VaadinDevTools.ACTIVE_KEY_IN_SESSION_STORAGE); - return active === null || active !== 'false'; - } - static notificationDismissed(persistentId) { - const shown = window.localStorage.getItem(VaadinDevTools.DISMISSED_NOTIFICATIONS_IN_LOCAL_STORAGE); - return shown !== null && shown.includes(persistentId); - } - elementTelemetry() { - let data = {}; - try { - // localstorage data is collected by vaadin-usage-statistics.js - const localStorageStatsString = localStorage.getItem('vaadin.statistics.basket'); - if (!localStorageStatsString) { - // Do not send empty data - return; - } - data = JSON.parse(localStorageStatsString); - } - catch (e) { - // In case of parse errors don't send anything - return; - } - if (this.frontendConnection) { - this.frontendConnection.sendTelemetry(data); - } - } - openWebSocketConnection() { - this.frontendStatus = ConnectionStatus.UNAVAILABLE; - this.javaStatus = ConnectionStatus.UNAVAILABLE; - const onConnectionError = (msg) => this.log(MessageType.ERROR, msg); - const onReload = () => { - if (this.liveReloadDisabled) { - return; - } - this.showSplashMessage('Reloading…'); - const lastReload = window.sessionStorage.getItem(VaadinDevTools.TRIGGERED_COUNT_KEY_IN_SESSION_STORAGE); - const nextReload = lastReload ? parseInt(lastReload, 10) + 1 : 1; - window.sessionStorage.setItem(VaadinDevTools.TRIGGERED_COUNT_KEY_IN_SESSION_STORAGE, nextReload.toString()); - window.sessionStorage.setItem(VaadinDevTools.TRIGGERED_KEY_IN_SESSION_STORAGE, 'true'); - window.location.reload(); - }; - const frontendConnection = new Connection(this.getDedicatedWebSocketUrl()); - frontendConnection.onHandshake = () => { - this.log(MessageType.LOG, 'Vaadin development mode initialized'); - if (!VaadinDevTools.isActive) { - frontendConnection.setActive(false); - } - this.elementTelemetry(); - }; - frontendConnection.onConnectionError = onConnectionError; - frontendConnection.onReload = onReload; - frontendConnection.onStatusChange = (status) => { - this.frontendStatus = status; - }; - frontendConnection.onMessage = (message) => { - if ((message === null || message === void 0 ? void 0 : message.command) === 'serverInfo') { - this.serverInfo = message.data; - } - else if ((message === null || message === void 0 ? void 0 : message.command) === 'featureFlags') { - this.features = message.data.features; - } - else { - // eslint-disable-next-line no-console - console.error('Unknown message from front-end connection:', JSON.stringify(message)); - } - }; - this.frontendConnection = frontendConnection; - let javaConnection; - if (this.backend === VaadinDevTools.SPRING_BOOT_DEVTOOLS && this.springBootLiveReloadPort) { - javaConnection = new Connection(this.getSpringBootWebSocketUrl(window.location)); - javaConnection.onHandshake = () => { - if (!VaadinDevTools.isActive) { - javaConnection.setActive(false); - } - }; - javaConnection.onReload = onReload; - javaConnection.onConnectionError = onConnectionError; - } - else if (this.backend === VaadinDevTools.JREBEL || this.backend === VaadinDevTools.HOTSWAP_AGENT) { - javaConnection = frontendConnection; - } - else { - javaConnection = new Connection(undefined); - } - const prevOnStatusChange = javaConnection.onStatusChange; - javaConnection.onStatusChange = (status) => { - prevOnStatusChange(status); - this.javaStatus = status; - }; - const prevOnHandshake = javaConnection.onHandshake; - javaConnection.onHandshake = () => { - prevOnHandshake(); - if (this.backend) { - this.log(MessageType.INFORMATION, `Java live reload available: ${VaadinDevTools.BACKEND_DISPLAY_NAME[this.backend]}`); - } - }; - this.javaConnection = javaConnection; - if (!this.backend) { - this.showNotification(MessageType.WARNING, 'Java live reload unavailable', 'Live reload for Java changes is currently not set up. Find out how to make use of this functionality to boost your workflow.', 'https://vaadin.com/docs/latest/flow/configuration/live-reload', 'liveReloadUnavailable'); - } - } - getDedicatedWebSocketUrl() { - function getAbsoluteUrl(relative) { - // Use innerHTML to obtain an absolute URL - const div = document.createElement('div'); - div.innerHTML = ``; - return div.firstChild.href; - } - if (this.url === undefined) { - return undefined; - } - const connectionBaseUrl = getAbsoluteUrl(this.url); - if (!connectionBaseUrl.startsWith('http://') && !connectionBaseUrl.startsWith('https://')) { - // eslint-disable-next-line no-console - console.error('The protocol of the url should be http or https for live reload to work.'); - return undefined; - } - return `${connectionBaseUrl.replace(/^http/, 'ws')}?v-r=push&debug_window`; - } - getSpringBootWebSocketUrl(location) { - const { hostname } = location; - const wsProtocol = location.protocol === 'https:' ? 'wss' : 'ws'; - if (hostname.endsWith('gitpod.io')) { - // Gitpod uses `port-url` instead of `url:port` - const hostnameWithoutPort = hostname.replace(/.*?-/, ''); - return `${wsProtocol}://${this.springBootLiveReloadPort}-${hostnameWithoutPort}`; - } - else { - return `${wsProtocol}://${hostname}:${this.springBootLiveReloadPort}`; - } - } - connectedCallback() { - super.connectedCallback(); - this.catchErrors(); - // when focus or clicking anywhere, move the splash message to the message tray - this.disableEventListener = (_) => this.demoteSplashMessage(); - document.body.addEventListener('focus', this.disableEventListener); - document.body.addEventListener('click', this.disableEventListener); - this.openWebSocketConnection(); - const lastReload = window.sessionStorage.getItem(VaadinDevTools.TRIGGERED_KEY_IN_SESSION_STORAGE); - if (lastReload) { - const now = new Date(); - const reloaded = `${`0${now.getHours()}`.slice(-2)}:${`0${now.getMinutes()}`.slice(-2)}:${`0${now.getSeconds()}`.slice(-2)}`; - this.showSplashMessage(`Page reloaded at ${reloaded}`); - window.sessionStorage.removeItem(VaadinDevTools.TRIGGERED_KEY_IN_SESSION_STORAGE); - } - this.transitionDuration = parseInt(window.getComputedStyle(this).getPropertyValue('--dev-tools-transition-duration'), 10); - const windowAny = window; - windowAny.Vaadin = windowAny.Vaadin || {}; - windowAny.Vaadin.devTools = Object.assign(this, windowAny.Vaadin.devTools); - licenseInit(); - } - format(o) { - return o.toString(); - } - catchErrors() { - // Process stored messages - const queue = window.Vaadin.ConsoleErrors; - if (queue) { - queue.forEach((args) => { - this.log(MessageType.ERROR, args.map((o) => this.format(o)).join(' ')); - }); - } - // Install new handler that immediately processes messages - window.Vaadin.ConsoleErrors = { - push: (args) => { - this.log(MessageType.ERROR, args.map((o) => this.format(o)).join(' ')); - } - }; - } - disconnectedCallback() { - if (this.disableEventListener) { - document.body.removeEventListener('focus', this.disableEventListener); - document.body.removeEventListener('click', this.disableEventListener); - } - super.disconnectedCallback(); - } - toggleExpanded() { - this.notifications.slice().forEach((notification) => this.dismissNotification(notification.id)); - this.expanded = !this.expanded; - if (this.expanded) { - this.root.focus(); - } - } - showSplashMessage(msg) { - this.splashMessage = msg; - if (this.splashMessage) { - if (this.expanded) { - this.demoteSplashMessage(); - } - else { - // automatically move notification to message tray after a certain amount of time - setTimeout(() => { - this.demoteSplashMessage(); - }, VaadinDevTools.AUTO_DEMOTE_NOTIFICATION_DELAY); - } - } - } - demoteSplashMessage() { - if (this.splashMessage) { - this.log(MessageType.LOG, this.splashMessage); - } - this.showSplashMessage(undefined); - } - checkLicense(productInfo) { - if (this.frontendConnection) { - this.frontendConnection.sendLicenseCheck(productInfo); - } - else { - licenseCheckFailed({ message: 'Internal error: no connection', product: productInfo }); - } - } - log(type, message, details, link) { - const id = this.nextMessageId; - this.nextMessageId += 1; - this.messages.push({ - id, - type, - message, - details, - link, - dontShowAgain: false, - deleted: false - }); - while (this.messages.length > VaadinDevTools.MAX_LOG_ROWS) { - this.messages.shift(); - } - this.requestUpdate(); - this.updateComplete.then(() => { - // Scroll into view - const lastMessage = this.renderRoot.querySelector('.message-tray .message:last-child'); - if (this.expanded && lastMessage) { - setTimeout(() => lastMessage.scrollIntoView({ behavior: 'smooth' }), this.transitionDuration); - this.unreadErrors = false; - } - else if (type === MessageType.ERROR) { - this.unreadErrors = true; - } - }); - } - showNotification(type, message, details, link, persistentId) { - if (persistentId === undefined || !VaadinDevTools.notificationDismissed(persistentId)) { - // Do not open persistent message if another is already visible with the same persistentId - const matchingVisibleNotifications = this.notifications - .filter((notification) => notification.persistentId === persistentId) - .filter((notification) => !notification.deleted); - if (matchingVisibleNotifications.length > 0) { - return; - } - const id = this.nextMessageId; - this.nextMessageId += 1; - this.notifications.push({ - id, - type, - message, - details, - link, - persistentId, - dontShowAgain: false, - deleted: false - }); - // automatically move notification to message tray after a certain amount of time unless it contains a link - if (link === undefined) { - setTimeout(() => { - this.dismissNotification(id); - }, VaadinDevTools.AUTO_DEMOTE_NOTIFICATION_DELAY); - } - this.requestUpdate(); - } - else { - this.log(type, message, details, link); - } - } - dismissNotification(id) { - const index = this.findNotificationIndex(id); - if (index !== -1 && !this.notifications[index].deleted) { - const notification = this.notifications[index]; - // user is explicitly dismissing a notification---after that we won't bug them with it - if (notification.dontShowAgain && - notification.persistentId && - !VaadinDevTools.notificationDismissed(notification.persistentId)) { - let dismissed = window.localStorage.getItem(VaadinDevTools.DISMISSED_NOTIFICATIONS_IN_LOCAL_STORAGE); - dismissed = dismissed === null ? notification.persistentId : `${dismissed},${notification.persistentId}`; - window.localStorage.setItem(VaadinDevTools.DISMISSED_NOTIFICATIONS_IN_LOCAL_STORAGE, dismissed); - } - notification.deleted = true; - this.log(notification.type, notification.message, notification.details, notification.link); - // give some time for the animation - setTimeout(() => { - const idx = this.findNotificationIndex(id); - if (idx !== -1) { - this.notifications.splice(idx, 1); - this.requestUpdate(); - } - }, this.transitionDuration); - } - } - findNotificationIndex(id) { - let index = -1; - this.notifications.some((notification, idx) => { - if (notification.id === id) { - index = idx; - return true; - } - else { - return false; - } - }); - return index; - } - toggleDontShowAgain(id) { - const index = this.findNotificationIndex(id); - if (index !== -1 && !this.notifications[index].deleted) { - const notification = this.notifications[index]; - notification.dontShowAgain = !notification.dontShowAgain; - this.requestUpdate(); - } - } - setActive(yes) { - var _a, _b; - (_a = this.frontendConnection) === null || _a === void 0 ? void 0 : _a.setActive(yes); - (_b = this.javaConnection) === null || _b === void 0 ? void 0 : _b.setActive(yes); - window.sessionStorage.setItem(VaadinDevTools.ACTIVE_KEY_IN_SESSION_STORAGE, yes ? 'true' : 'false'); - } - getStatusColor(status) { - if (status === ConnectionStatus.ACTIVE) { - return css `hsl(${VaadinDevTools.GREEN_HSL})`; - } - else if (status === ConnectionStatus.INACTIVE) { - return css `hsl(${VaadinDevTools.GREY_HSL})`; - } - else if (status === ConnectionStatus.UNAVAILABLE) { - return css `hsl(${VaadinDevTools.YELLOW_HSL})`; - } - else if (status === ConnectionStatus.ERROR) { - return css `hsl(${VaadinDevTools.RED_HSL})`; - } - else { - return css `none`; - } - } - /* eslint-disable lit/no-template-arrow */ - renderMessage(messageObject) { - return html ` - - `; - } - /* eslint-disable lit/no-template-map */ - render() { - return html `
e.key === 'Escape' && this.toggleExpanded()} - > -
- ${this.tabs.map((tab) => html ` `)} - -
- ${this.tabs.map((tab) => (this.activeTab === tab.id ? tab.render.call(this) : nothing))} -
- -
${this.notifications.map((msg) => this.renderMessage(msg))}
-
this.toggleExpanded()} - > - ${this.unreadErrors - ? html ` - - - - - - ` - : html ``} - - - ${this.splashMessage ? html `${this.splashMessage}
` : nothing} - `; - } - renderLog() { - return html `
${this.messages.map((msg) => this.renderMessage(msg))}
`; - } - activateLog() { - this.unreadErrors = false; - this.updateComplete.then(() => { - const lastMessage = this.renderRoot.querySelector('.message-tray .message:last-child'); - if (lastMessage) { - lastMessage.scrollIntoView(); - } - }); - } - renderInfo() { - return html `
- -
-
${this.serverInfo.productName}
-
${this.serverInfo.vaadinVersion}
-
Flow
-
${this.serverInfo.flowVersion}
-
Java
-
${this.serverInfo.javaVersion}
-
OS
-
${this.serverInfo.osVersion}
-
Browser
-
${navigator.userAgent}
-
- Live reload - -
-
- Java ${this.javaStatus} ${this.backend ? `(${VaadinDevTools.BACKEND_DISPLAY_NAME[this.backend]})` : ''} -
-
- Front end ${this.frontendStatus} -
-
-
`; - } - renderFeatures() { - return html `
- ${this.features.map((feature) => html `
- - Learn more -
`)} -
`; - } - copyInfoToClipboard() { - const items = this.renderRoot.querySelectorAll('.info-tray dt, .info-tray dd'); - const text = Array.from(items) - .map((message) => (message.localName === 'dd' ? ': ' : '\n') + message.textContent.trim()) - .join('') - .replace(/^\n/, ''); - copy(text); - this.showNotification(MessageType.INFORMATION, 'Environment information copied to clipboard', undefined, undefined, 'versionInfoCopied'); - } - toggleFeatureFlag(e, feature) { - const enabled = e.target.checked; - if (this.frontendConnection) { - this.frontendConnection.setFeature(feature.id, enabled); - this.showNotification(MessageType.INFORMATION, `“${feature.title}” ${enabled ? 'enabled' : 'disabled'}`, feature.requiresServerRestart ? 'This feature requires a server restart' : undefined, undefined, `feature${feature.id}${enabled ? 'Enabled' : 'Disabled'}`); - } - else { - this.log(MessageType.ERROR, `Unable to toggle feature ${feature.title}: No server connection available`); - } - } -} -VaadinDevTools.BLUE_HSL = css `206, 100%, 70%`; -VaadinDevTools.GREEN_HSL = css `145, 80%, 42%`; -VaadinDevTools.GREY_HSL = css `0, 0%, 50%`; -VaadinDevTools.YELLOW_HSL = css `38, 98%, 64%`; -VaadinDevTools.RED_HSL = css `355, 100%, 68%`; -VaadinDevTools.MAX_LOG_ROWS = 1000; -VaadinDevTools.DISMISSED_NOTIFICATIONS_IN_LOCAL_STORAGE = 'vaadin.live-reload.dismissedNotifications'; -VaadinDevTools.ACTIVE_KEY_IN_SESSION_STORAGE = 'vaadin.live-reload.active'; -VaadinDevTools.TRIGGERED_KEY_IN_SESSION_STORAGE = 'vaadin.live-reload.triggered'; -VaadinDevTools.TRIGGERED_COUNT_KEY_IN_SESSION_STORAGE = 'vaadin.live-reload.triggeredCount'; -VaadinDevTools.AUTO_DEMOTE_NOTIFICATION_DELAY = 5000; -VaadinDevTools.HOTSWAP_AGENT = 'HOTSWAP_AGENT'; -VaadinDevTools.JREBEL = 'JREBEL'; -VaadinDevTools.SPRING_BOOT_DEVTOOLS = 'SPRING_BOOT_DEVTOOLS'; -VaadinDevTools.BACKEND_DISPLAY_NAME = { - HOTSWAP_AGENT: 'HotswapAgent', - JREBEL: 'JRebel', - SPRING_BOOT_DEVTOOLS: 'Spring Boot Devtools' -}; -__decorate([ - property({ type: String }) -], VaadinDevTools.prototype, "url", void 0); -__decorate([ - property({ type: Boolean, attribute: true }) -], VaadinDevTools.prototype, "liveReloadDisabled", void 0); -__decorate([ - property({ type: String }) -], VaadinDevTools.prototype, "backend", void 0); -__decorate([ - property({ type: Number }) -], VaadinDevTools.prototype, "springBootLiveReloadPort", void 0); -__decorate([ - property({ type: Boolean, attribute: false }) -], VaadinDevTools.prototype, "expanded", void 0); -__decorate([ - property({ type: Array, attribute: false }) -], VaadinDevTools.prototype, "messages", void 0); -__decorate([ - property({ type: String, attribute: false }) -], VaadinDevTools.prototype, "splashMessage", void 0); -__decorate([ - property({ type: Array, attribute: false }) -], VaadinDevTools.prototype, "notifications", void 0); -__decorate([ - property({ type: String, attribute: false }) -], VaadinDevTools.prototype, "frontendStatus", void 0); -__decorate([ - property({ type: String, attribute: false }) -], VaadinDevTools.prototype, "javaStatus", void 0); -__decorate([ - state() -], VaadinDevTools.prototype, "tabs", void 0); -__decorate([ - state() -], VaadinDevTools.prototype, "activeTab", void 0); -__decorate([ - state() -], VaadinDevTools.prototype, "serverInfo", void 0); -__decorate([ - state() -], VaadinDevTools.prototype, "features", void 0); -__decorate([ - state() -], VaadinDevTools.prototype, "unreadErrors", void 0); -__decorate([ - query('.window') -], VaadinDevTools.prototype, "root", void 0); -if (customElements.get('vaadin-dev-tools') === undefined) { - customElements.define('vaadin-dev-tools', VaadinDevTools); -} -//# sourceMappingURL=vaadin-dev-tools.js.map \ No newline at end of file diff --git a/java/demo/frontend/generated/jar-resources/vaadin-dev-tools.js.map b/java/demo/frontend/generated/jar-resources/vaadin-dev-tools.js.map deleted file mode 100644 index 55ba4dd01..000000000 --- a/java/demo/frontend/generated/jar-resources/vaadin-dev-tools.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"vaadin-dev-tools.js","sourceRoot":"","sources":["../../../../src/main/frontend/vaadin-dev-tools.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,6DAA6D;AAC7D,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAw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;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;0DAChB;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CACV;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gEACO;AAGlC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;gDACpB;AAG1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;gDACnB;AAGzB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;qDACtB;AAGvB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;qDACd;AAG9B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;sDACmB;AAGhE;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;kDACe;AAG5D;IADC,KAAK,EAAE;4CAKN;AAGF;IADC,KAAK,EAAE;iDAC0B;AAGlC;IADC,KAAK,EAAE;kDAON;AAGF;IADC,KAAK,EAAE;gDACyB;AAGjC;IADC,KAAK,EAAE;oDACqB;AAG7B;IADC,KAAK,CAAC,SAAS,CAAC;4CACU;AAmmB7B,IAAI,cAAc,CAAC,GAAG,CAAC,kBAAkB,CAAC,KAAK,SAAS,EAAE;IACxD,cAAc,CAAC,MAAM,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAAC;CAC3D","sourcesContent":["import { css, html, LitElement, nothing } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport { copy } from './copy-to-clipboard.js';\nimport { licenseCheckFailed, licenseCheckNoKey, licenseCheckOk, Product, licenseInit } from './License';\n\ninterface ServerInfo {\n vaadinVersion: string;\n flowVersion: string;\n javaVersion: string;\n osVersion: string;\n productName: string;\n}\n\ninterface Feature {\n id: string;\n title: string;\n moreInfoLink: string;\n requiresServerRestart: boolean;\n enabled: boolean;\n}\n\ninterface Tab {\n id: 'log' | 'info' | 'features';\n title: string;\n render: () => unknown;\n activate?: () => void;\n}\n\nenum ConnectionStatus {\n ACTIVE = 'active',\n INACTIVE = 'inactive',\n UNAVAILABLE = 'unavailable',\n ERROR = 'error'\n}\n\nexport class Connection extends Object {\n static HEARTBEAT_INTERVAL = 180000;\n\n status: ConnectionStatus = ConnectionStatus.UNAVAILABLE;\n webSocket?: WebSocket;\n\n constructor(url?: string) {\n super();\n\n if (url) {\n this.webSocket = new WebSocket(url);\n this.webSocket.onmessage = (msg) => this.handleMessage(msg);\n this.webSocket.onerror = (err) => this.handleError(err);\n this.webSocket.onclose = (_) => {\n if (this.status !== ConnectionStatus.ERROR) {\n this.setStatus(ConnectionStatus.UNAVAILABLE);\n }\n this.webSocket = undefined;\n };\n }\n\n setInterval(() => {\n if (this.webSocket && self.status !== ConnectionStatus.ERROR && this.status !== ConnectionStatus.UNAVAILABLE) {\n this.webSocket.send('');\n }\n }, Connection.HEARTBEAT_INTERVAL);\n }\n\n onHandshake() {\n // Intentionally empty\n }\n\n onReload() {\n // Intentionally empty\n }\n\n onConnectionError(_: string) {\n // Intentionally empty\n }\n\n onStatusChange(_: ConnectionStatus) {\n // Intentionally empty\n }\n\n onMessage(message: any) {\n // eslint-disable-next-line no-console\n console.error('Unknown message received from the live reload server:', message);\n }\n\n handleMessage(msg: any) {\n let json;\n try {\n json = JSON.parse(msg.data);\n } catch (e: any) {\n this.handleError(`[${e.name}: ${e.message}`);\n return;\n }\n if (json.command === 'hello') {\n this.setStatus(ConnectionStatus.ACTIVE);\n this.onHandshake();\n } else if (json.command === 'reload') {\n if (this.status === ConnectionStatus.ACTIVE) {\n this.onReload();\n }\n } else if (json.command === 'license-check-ok') {\n licenseCheckOk(json.data);\n } else if (json.command === 'license-check-failed') {\n licenseCheckFailed(json.data);\n } else if (json.command === 'license-check-nokey') {\n licenseCheckNoKey(json.data);\n } else {\n this.onMessage(json);\n }\n }\n\n handleError(msg: any) {\n // eslint-disable-next-line no-console\n console.error(msg);\n this.setStatus(ConnectionStatus.ERROR);\n if (msg instanceof Event && this.webSocket) {\n this.onConnectionError(`Error in WebSocket connection to ${this.webSocket.url}`);\n } else {\n this.onConnectionError(msg);\n }\n }\n\n setActive(yes: boolean) {\n if (!yes && this.status === ConnectionStatus.ACTIVE) {\n this.setStatus(ConnectionStatus.INACTIVE);\n } else if (yes && this.status === ConnectionStatus.INACTIVE) {\n this.setStatus(ConnectionStatus.ACTIVE);\n }\n }\n\n setStatus(status: ConnectionStatus) {\n if (this.status !== status) {\n this.status = status;\n this.onStatusChange(status);\n }\n }\n\n private send(command: string, data: any) {\n const message = JSON.stringify({ command, data });\n if (!this.webSocket) {\n // eslint-disable-next-line no-console\n console.error(`Unable to send message ${command}. No websocket is available`);\n } else if (this.webSocket.readyState !== WebSocket.OPEN) {\n this.webSocket.addEventListener('open', () => this.webSocket!.send(message));\n } else {\n this.webSocket.send(message);\n }\n }\n\n setFeature(featureId: string, enabled: boolean) {\n this.send('setFeature', { featureId, enabled });\n }\n sendTelemetry(browserData: any) {\n this.send('reportTelemetry', { browserData });\n }\n sendLicenseCheck(product: Product) {\n this.send('checkLicense', product);\n }\n}\n\nenum MessageType {\n LOG = 'log',\n INFORMATION = 'information',\n WARNING = 'warning',\n ERROR = 'error'\n}\n\ninterface Message {\n id: number;\n type: MessageType;\n message: string;\n details?: string;\n link?: string;\n persistentId?: string;\n dontShowAgain: boolean;\n deleted: boolean;\n}\n\nexport class VaadinDevTools extends LitElement {\n static BLUE_HSL = css`206, 100%, 70%`;\n static GREEN_HSL = css`145, 80%, 42%`;\n static GREY_HSL = css`0, 0%, 50%`;\n static YELLOW_HSL = css`38, 98%, 64%`;\n static RED_HSL = css`355, 100%, 68%`;\n static MAX_LOG_ROWS = 1000;\n\n static get styles() {\n return css`\n :host {\n --dev-tools-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell,\n 'Helvetica Neue', sans-serif;\n --dev-tools-font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',\n monospace;\n\n --dev-tools-font-size: 0.8125rem;\n --dev-tools-font-size-small: 0.75rem;\n\n --dev-tools-text-color: rgba(255, 255, 255, 0.8);\n --dev-tools-text-color-secondary: rgba(255, 255, 255, 0.65);\n --dev-tools-text-color-emphasis: rgba(255, 255, 255, 0.95);\n --dev-tools-text-color-active: rgba(255, 255, 255, 1);\n\n --dev-tools-background-color-inactive: rgba(45, 45, 45, 0.25);\n --dev-tools-background-color-active: rgba(45, 45, 45, 0.98);\n --dev-tools-background-color-active-blurred: rgba(45, 45, 45, 0.85);\n\n --dev-tools-border-radius: 0.5rem;\n --dev-tools-box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 4px 12px -2px rgba(0, 0, 0, 0.4);\n\n --dev-tools-blue-hsl: ${this.BLUE_HSL};\n --dev-tools-blue-color: hsl(var(--dev-tools-blue-hsl));\n --dev-tools-green-hsl: ${this.GREEN_HSL};\n --dev-tools-green-color: hsl(var(--dev-tools-green-hsl));\n --dev-tools-grey-hsl: ${this.GREY_HSL};\n --dev-tools-grey-color: hsl(var(--dev-tools-grey-hsl));\n --dev-tools-yellow-hsl: ${this.YELLOW_HSL};\n --dev-tools-yellow-color: hsl(var(--dev-tools-yellow-hsl));\n --dev-tools-red-hsl: ${this.RED_HSL};\n --dev-tools-red-color: hsl(var(--dev-tools-red-hsl));\n\n /* Needs to be in ms, used in JavaScript as well */\n --dev-tools-transition-duration: 180ms;\n\n all: initial;\n\n direction: ltr;\n cursor: default;\n font: normal 400 var(--dev-tools-font-size) / 1.125rem var(--dev-tools-font-family);\n color: var(--dev-tools-text-color);\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n\n position: fixed;\n z-index: 20000;\n pointer-events: none;\n bottom: 0;\n right: 0;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column-reverse;\n align-items: flex-end;\n }\n\n .dev-tools {\n pointer-events: auto;\n display: flex;\n align-items: center;\n position: fixed;\n z-index: inherit;\n right: 0.5rem;\n bottom: 0.5rem;\n min-width: 1.75rem;\n height: 1.75rem;\n max-width: 1.75rem;\n border-radius: 0.5rem;\n padding: 0.375rem;\n box-sizing: border-box;\n background-color: var(--dev-tools-background-color-inactive);\n box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05);\n color: var(--dev-tools-text-color);\n transition: var(--dev-tools-transition-duration);\n white-space: nowrap;\n line-height: 1rem;\n }\n\n .dev-tools:hover,\n .dev-tools.active {\n background-color: var(--dev-tools-background-color-active);\n box-shadow: var(--dev-tools-box-shadow);\n }\n\n .dev-tools.active {\n max-width: calc(100% - 1rem);\n }\n\n .dev-tools .dev-tools-icon {\n flex: none;\n pointer-events: none;\n display: inline-block;\n width: 1rem;\n height: 1rem;\n fill: #fff;\n transition: var(--dev-tools-transition-duration);\n margin: 0;\n }\n\n .dev-tools.active .dev-tools-icon {\n opacity: 0;\n position: absolute;\n transform: scale(0.5);\n }\n\n .dev-tools .status-blip {\n flex: none;\n display: block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n z-index: 20001;\n background: var(--dev-tools-grey-color);\n position: absolute;\n top: -1px;\n right: -1px;\n }\n\n .dev-tools .status-description {\n overflow: hidden;\n text-overflow: ellipsis;\n padding: 0 0.25rem;\n }\n\n .dev-tools.error {\n background-color: hsla(var(--dev-tools-red-hsl), 0.15);\n animation: bounce 0.5s;\n animation-iteration-count: 2;\n }\n\n .switch {\n display: inline-flex;\n align-items: center;\n }\n\n .switch input {\n opacity: 0;\n width: 0;\n height: 0;\n position: absolute;\n }\n\n .switch .slider {\n display: block;\n flex: none;\n width: 28px;\n height: 18px;\n border-radius: 9px;\n background-color: rgba(255, 255, 255, 0.3);\n transition: var(--dev-tools-transition-duration);\n margin-right: 0.5rem;\n }\n\n .switch:focus-within .slider,\n .switch .slider:hover {\n background-color: rgba(255, 255, 255, 0.35);\n transition: none;\n }\n\n .switch input:focus-visible ~ .slider {\n box-shadow: 0 0 0 2px var(--dev-tools-background-color-active), 0 0 0 4px var(--dev-tools-blue-color);\n }\n\n .switch .slider::before {\n content: '';\n display: block;\n margin: 2px;\n width: 14px;\n height: 14px;\n background-color: #fff;\n transition: var(--dev-tools-transition-duration);\n border-radius: 50%;\n }\n\n .switch input:checked + .slider {\n background-color: var(--dev-tools-green-color);\n }\n\n .switch input:checked + .slider::before {\n transform: translateX(10px);\n }\n\n .switch input:disabled + .slider::before {\n background-color: var(--dev-tools-grey-color);\n }\n\n .window.hidden {\n opacity: 0;\n transform: scale(0);\n position: absolute;\n }\n\n .window.visible {\n transform: none;\n opacity: 1;\n pointer-events: auto;\n }\n\n .window.visible ~ .dev-tools {\n opacity: 0;\n pointer-events: none;\n }\n\n .window.visible ~ .dev-tools .dev-tools-icon,\n .window.visible ~ .dev-tools .status-blip {\n transition: none;\n opacity: 0;\n }\n\n .window {\n border-radius: var(--dev-tools-border-radius);\n overflow: hidden;\n margin: 0.5rem;\n width: 30rem;\n max-width: calc(100% - 1rem);\n max-height: calc(100vh - 1rem);\n flex-shrink: 1;\n background-color: var(--dev-tools-background-color-active);\n color: var(--dev-tools-text-color);\n transition: var(--dev-tools-transition-duration);\n transform-origin: bottom right;\n display: flex;\n flex-direction: column;\n box-shadow: var(--dev-tools-box-shadow);\n outline: none;\n }\n\n .window-toolbar {\n display: flex;\n flex: none;\n align-items: center;\n padding: 0.375rem;\n white-space: nowrap;\n order: 1;\n background-color: rgba(0, 0, 0, 0.2);\n gap: 0.5rem;\n }\n\n .tab {\n color: var(--dev-tools-text-color-secondary);\n font: inherit;\n font-size: var(--dev-tools-font-size-small);\n font-weight: 500;\n line-height: 1;\n padding: 0.25rem 0.375rem;\n background: none;\n border: none;\n margin: 0;\n border-radius: 0.25rem;\n transition: var(--dev-tools-transition-duration);\n }\n\n .tab:hover,\n .tab.active {\n color: var(--dev-tools-text-color-active);\n }\n\n .tab.active {\n background-color: rgba(255, 255, 255, 0.12);\n }\n\n .tab.unreadErrors::after {\n content: '•';\n color: hsl(var(--dev-tools-red-hsl));\n font-size: 1.5rem;\n position: absolute;\n transform: translate(0, -50%);\n }\n\n .ahreflike {\n font-weight: 500;\n color: var(--dev-tools-text-color-secondary);\n text-decoration: underline;\n cursor: pointer;\n }\n\n .ahreflike:hover {\n color: var(--dev-tools-text-color-emphasis);\n }\n\n .button {\n all: initial;\n font-family: inherit;\n font-size: var(--dev-tools-font-size-small);\n line-height: 1;\n white-space: nowrap;\n background-color: rgba(0, 0, 0, 0.2);\n color: inherit;\n font-weight: 600;\n padding: 0.25rem 0.375rem;\n border-radius: 0.25rem;\n }\n\n .button:focus,\n .button:hover {\n color: var(--dev-tools-text-color-emphasis);\n }\n\n .minimize-button {\n flex: none;\n width: 1rem;\n height: 1rem;\n color: inherit;\n background-color: transparent;\n border: 0;\n padding: 0;\n margin: 0 0 0 auto;\n opacity: 0.8;\n }\n\n .minimize-button:hover {\n opacity: 1;\n }\n\n .minimize-button svg {\n max-width: 100%;\n }\n\n .message.information {\n --dev-tools-notification-color: var(--dev-tools-blue-color);\n }\n\n .message.warning {\n --dev-tools-notification-color: var(--dev-tools-yellow-color);\n }\n\n .message.error {\n --dev-tools-notification-color: var(--dev-tools-red-color);\n }\n\n .message {\n display: flex;\n padding: 0.1875rem 0.75rem 0.1875rem 2rem;\n background-clip: padding-box;\n }\n\n .message.log {\n padding-left: 0.75rem;\n }\n\n .message-content {\n margin-right: 0.5rem;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n }\n\n .message-heading {\n position: relative;\n display: flex;\n align-items: center;\n margin: 0.125rem 0;\n }\n\n .message.log {\n color: var(--dev-tools-text-color-secondary);\n }\n\n .message:not(.log) .message-heading {\n font-weight: 500;\n }\n\n .message.has-details .message-heading {\n color: var(--dev-tools-text-color-emphasis);\n font-weight: 600;\n }\n\n .message-heading::before {\n position: absolute;\n margin-left: -1.5rem;\n display: inline-block;\n text-align: center;\n font-size: 0.875em;\n font-weight: 600;\n line-height: calc(1.25em - 2px);\n width: 14px;\n height: 14px;\n box-sizing: border-box;\n border: 1px solid transparent;\n border-radius: 50%;\n }\n\n .message.information .message-heading::before {\n content: 'i';\n border-color: currentColor;\n color: var(--dev-tools-notification-color);\n }\n\n .message.warning .message-heading::before,\n .message.error .message-heading::before {\n content: '!';\n color: var(--dev-tools-background-color-active);\n background-color: var(--dev-tools-notification-color);\n }\n\n .features-tray {\n padding: 0.75rem;\n flex: auto;\n overflow: auto;\n animation: fade-in var(--dev-tools-transition-duration) ease-in;\n user-select: text;\n }\n\n .features-tray p {\n margin-top: 0;\n color: var(--dev-tools-text-color-secondary);\n }\n\n .features-tray .feature {\n display: flex;\n align-items: center;\n gap: 1rem;\n padding-bottom: 0.5em;\n }\n\n .message .message-details {\n font-weight: 400;\n color: var(--dev-tools-text-color-secondary);\n margin: 0.25rem 0;\n }\n\n .message .message-details[hidden] {\n display: none;\n }\n\n .message .message-details p {\n display: inline;\n margin: 0;\n margin-right: 0.375em;\n word-break: break-word;\n }\n\n .message .persist {\n color: var(--dev-tools-text-color-secondary);\n white-space: nowrap;\n margin: 0.375rem 0;\n display: flex;\n align-items: center;\n position: relative;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n }\n\n .message .persist::before {\n content: '';\n width: 1em;\n height: 1em;\n border-radius: 0.2em;\n margin-right: 0.375em;\n background-color: rgba(255, 255, 255, 0.3);\n }\n\n .message .persist:hover::before {\n background-color: rgba(255, 255, 255, 0.4);\n }\n\n .message .persist.on::before {\n background-color: rgba(255, 255, 255, 0.9);\n }\n\n .message .persist.on::after {\n content: '';\n order: -1;\n position: absolute;\n width: 0.75em;\n height: 0.25em;\n border: 2px solid var(--dev-tools-background-color-active);\n border-width: 0 0 2px 2px;\n transform: translate(0.05em, -0.05em) rotate(-45deg) scale(0.8, 0.9);\n }\n\n .message .dismiss-message {\n font-weight: 600;\n align-self: stretch;\n display: flex;\n align-items: center;\n padding: 0 0.25rem;\n margin-left: 0.5rem;\n color: var(--dev-tools-text-color-secondary);\n }\n\n .message .dismiss-message:hover {\n color: var(--dev-tools-text-color);\n }\n\n .notification-tray {\n display: flex;\n flex-direction: column-reverse;\n align-items: flex-end;\n margin: 0.5rem;\n flex: none;\n }\n\n .window.hidden + .notification-tray {\n margin-bottom: 3rem;\n }\n\n .notification-tray .message {\n pointer-events: auto;\n background-color: var(--dev-tools-background-color-active);\n color: var(--dev-tools-text-color);\n max-width: 30rem;\n box-sizing: border-box;\n border-radius: var(--dev-tools-border-radius);\n margin-top: 0.5rem;\n transition: var(--dev-tools-transition-duration);\n transform-origin: bottom right;\n animation: slideIn var(--dev-tools-transition-duration);\n box-shadow: var(--dev-tools-box-shadow);\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n }\n\n .notification-tray .message.animate-out {\n animation: slideOut forwards var(--dev-tools-transition-duration);\n }\n\n .notification-tray .message .message-details {\n max-height: 10em;\n overflow: hidden;\n }\n\n .message-tray {\n flex: auto;\n overflow: auto;\n max-height: 20rem;\n user-select: text;\n }\n\n .message-tray .message {\n animation: fade-in var(--dev-tools-transition-duration) ease-in;\n padding-left: 2.25rem;\n }\n\n .message-tray .message.warning {\n background-color: hsla(var(--dev-tools-yellow-hsl), 0.09);\n }\n\n .message-tray .message.error {\n background-color: hsla(var(--dev-tools-red-hsl), 0.09);\n }\n\n .message-tray .message.error .message-heading {\n color: hsl(var(--dev-tools-red-hsl));\n }\n\n .message-tray .message.warning .message-heading {\n color: hsl(var(--dev-tools-yellow-hsl));\n }\n\n .message-tray .message + .message {\n border-top: 1px solid rgba(255, 255, 255, 0.07);\n }\n\n .message-tray .dismiss-message,\n .message-tray .persist {\n display: none;\n }\n\n .info-tray {\n padding: 0.75rem;\n position: relative;\n flex: auto;\n overflow: auto;\n animation: fade-in var(--dev-tools-transition-duration) ease-in;\n user-select: text;\n }\n\n .info-tray dl {\n margin: 0;\n display: grid;\n grid-template-columns: max-content 1fr;\n column-gap: 0.75rem;\n position: relative;\n }\n\n .info-tray dt {\n grid-column: 1;\n color: var(--dev-tools-text-color-emphasis);\n }\n\n .info-tray dt:not(:first-child)::before {\n content: '';\n width: 100%;\n position: absolute;\n height: 1px;\n background-color: rgba(255, 255, 255, 0.1);\n margin-top: -0.375rem;\n }\n\n .info-tray dd {\n grid-column: 2;\n margin: 0;\n }\n\n .info-tray :is(dt, dd):not(:last-child) {\n margin-bottom: 0.75rem;\n }\n\n .info-tray dd + dd {\n margin-top: -0.5rem;\n }\n\n .info-tray .live-reload-status::before {\n content: '•';\n color: var(--status-color);\n width: 0.75rem;\n display: inline-block;\n font-size: 1rem;\n line-height: 0.5rem;\n }\n\n .info-tray .copy {\n position: fixed;\n z-index: 1;\n top: 0.5rem;\n right: 0.5rem;\n }\n\n .info-tray .switch {\n vertical-align: -4px;\n }\n\n @keyframes slideIn {\n from {\n transform: translateX(100%);\n opacity: 0;\n }\n to {\n transform: translateX(0%);\n opacity: 1;\n }\n }\n\n @keyframes slideOut {\n from {\n transform: translateX(0%);\n opacity: 1;\n }\n to {\n transform: translateX(100%);\n opacity: 0;\n }\n }\n\n @keyframes fade-in {\n 0% {\n opacity: 0;\n }\n }\n\n @keyframes bounce {\n 0% {\n transform: scale(0.8);\n }\n 50% {\n transform: scale(1.5);\n background-color: hsla(var(--dev-tools-red-hsl), 1);\n }\n 100% {\n transform: scale(1);\n }\n }\n\n @supports (backdrop-filter: blur(1px)) {\n .dev-tools,\n .window,\n .notification-tray .message {\n backdrop-filter: blur(8px);\n }\n .dev-tools:hover,\n .dev-tools.active,\n .window,\n .notification-tray .message {\n background-color: var(--dev-tools-background-color-active-blurred);\n }\n }\n `;\n }\n\n static DISMISSED_NOTIFICATIONS_IN_LOCAL_STORAGE = 'vaadin.live-reload.dismissedNotifications';\n static ACTIVE_KEY_IN_SESSION_STORAGE = 'vaadin.live-reload.active';\n static TRIGGERED_KEY_IN_SESSION_STORAGE = 'vaadin.live-reload.triggered';\n static TRIGGERED_COUNT_KEY_IN_SESSION_STORAGE = 'vaadin.live-reload.triggeredCount';\n\n static AUTO_DEMOTE_NOTIFICATION_DELAY = 5000;\n\n static HOTSWAP_AGENT = 'HOTSWAP_AGENT';\n static JREBEL = 'JREBEL';\n static SPRING_BOOT_DEVTOOLS = 'SPRING_BOOT_DEVTOOLS';\n static BACKEND_DISPLAY_NAME: Record = {\n HOTSWAP_AGENT: 'HotswapAgent',\n JREBEL: 'JRebel',\n SPRING_BOOT_DEVTOOLS: 'Spring Boot Devtools'\n };\n\n static get isActive() {\n const active = window.sessionStorage.getItem(VaadinDevTools.ACTIVE_KEY_IN_SESSION_STORAGE);\n return active === null || active !== 'false';\n }\n\n static notificationDismissed(persistentId: string) {\n const shown = window.localStorage.getItem(VaadinDevTools.DISMISSED_NOTIFICATIONS_IN_LOCAL_STORAGE);\n return shown !== null && shown.includes(persistentId);\n }\n\n @property({ type: String })\n url?: string;\n\n @property({ type: Boolean, attribute: true })\n liveReloadDisabled?: boolean;\n\n @property({ type: String })\n backend?: string;\n\n @property({ type: Number })\n springBootLiveReloadPort?: number;\n\n @property({ type: Boolean, attribute: false })\n expanded: boolean = false;\n\n @property({ type: Array, attribute: false })\n messages: Message[] = [];\n\n @property({ type: String, attribute: false })\n splashMessage?: string;\n\n @property({ type: Array, attribute: false })\n notifications: Message[] = [];\n\n @property({ type: String, attribute: false })\n frontendStatus: ConnectionStatus = ConnectionStatus.UNAVAILABLE;\n\n @property({ type: String, attribute: false })\n javaStatus: ConnectionStatus = ConnectionStatus.UNAVAILABLE;\n\n @state()\n private tabs: readonly Tab[] = [\n { id: 'log', title: 'Log', render: this.renderLog, activate: this.activateLog },\n { id: 'info', title: 'Info', render: this.renderInfo },\n { id: 'features', title: 'Feature Flags', render: this.renderFeatures }\n ];\n\n @state()\n private activeTab: string = 'log';\n\n @state()\n private serverInfo: ServerInfo = {\n flowVersion: '',\n vaadinVersion: '',\n javaVersion: '',\n osVersion: '',\n productName: ''\n };\n\n @state()\n private features: Feature[] = [];\n\n @state()\n private unreadErrors = false;\n\n @query('.window')\n private root!: HTMLElement;\n\n private javaConnection?: Connection;\n private frontendConnection?: Connection;\n\n private nextMessageId: number = 1;\n\n private disableEventListener?: EventListener;\n\n private transitionDuration: number = 0;\n\n elementTelemetry() {\n let data = {};\n try {\n // localstorage data is collected by vaadin-usage-statistics.js\n const localStorageStatsString = localStorage.getItem('vaadin.statistics.basket');\n if (!localStorageStatsString) {\n // Do not send empty data\n return;\n }\n data = JSON.parse(localStorageStatsString);\n } catch (e) {\n // In case of parse errors don't send anything\n return;\n }\n\n if (this.frontendConnection) {\n this.frontendConnection.sendTelemetry(data);\n }\n }\n\n openWebSocketConnection() {\n this.frontendStatus = ConnectionStatus.UNAVAILABLE;\n this.javaStatus = ConnectionStatus.UNAVAILABLE;\n\n const onConnectionError = (msg: string) => this.log(MessageType.ERROR, msg);\n const onReload = () => {\n if (this.liveReloadDisabled) {\n return;\n }\n this.showSplashMessage('Reloading…');\n const lastReload = window.sessionStorage.getItem(VaadinDevTools.TRIGGERED_COUNT_KEY_IN_SESSION_STORAGE);\n const nextReload = lastReload ? parseInt(lastReload, 10) + 1 : 1;\n window.sessionStorage.setItem(VaadinDevTools.TRIGGERED_COUNT_KEY_IN_SESSION_STORAGE, nextReload.toString());\n window.sessionStorage.setItem(VaadinDevTools.TRIGGERED_KEY_IN_SESSION_STORAGE, 'true');\n window.location.reload();\n };\n\n const frontendConnection = new Connection(this.getDedicatedWebSocketUrl());\n frontendConnection.onHandshake = () => {\n this.log(MessageType.LOG, 'Vaadin development mode initialized');\n if (!VaadinDevTools.isActive) {\n frontendConnection.setActive(false);\n }\n this.elementTelemetry();\n };\n frontendConnection.onConnectionError = onConnectionError;\n frontendConnection.onReload = onReload;\n frontendConnection.onStatusChange = (status: ConnectionStatus) => {\n this.frontendStatus = status;\n };\n frontendConnection.onMessage = (message: any) => {\n if (message?.command === 'serverInfo') {\n this.serverInfo = message.data as ServerInfo;\n } else if (message?.command === 'featureFlags') {\n this.features = message.data.features as Feature[];\n } else {\n // eslint-disable-next-line no-console\n console.error('Unknown message from front-end connection:', JSON.stringify(message));\n }\n };\n this.frontendConnection = frontendConnection;\n\n let javaConnection: Connection;\n if (this.backend === VaadinDevTools.SPRING_BOOT_DEVTOOLS && this.springBootLiveReloadPort) {\n javaConnection = new Connection(this.getSpringBootWebSocketUrl(window.location));\n javaConnection.onHandshake = () => {\n if (!VaadinDevTools.isActive) {\n javaConnection.setActive(false);\n }\n };\n javaConnection.onReload = onReload;\n javaConnection.onConnectionError = onConnectionError;\n } else if (this.backend === VaadinDevTools.JREBEL || this.backend === VaadinDevTools.HOTSWAP_AGENT) {\n javaConnection = frontendConnection;\n } else {\n javaConnection = new Connection(undefined);\n }\n const prevOnStatusChange = javaConnection.onStatusChange;\n javaConnection.onStatusChange = (status) => {\n prevOnStatusChange(status);\n this.javaStatus = status;\n };\n const prevOnHandshake = javaConnection.onHandshake;\n javaConnection.onHandshake = () => {\n prevOnHandshake();\n if (this.backend) {\n this.log(\n MessageType.INFORMATION,\n `Java live reload available: ${VaadinDevTools.BACKEND_DISPLAY_NAME[this.backend]}`\n );\n }\n };\n this.javaConnection = javaConnection;\n\n if (!this.backend) {\n this.showNotification(\n MessageType.WARNING,\n 'Java live reload unavailable',\n 'Live reload for Java changes is currently not set up. Find out how to make use of this functionality to boost your workflow.',\n 'https://vaadin.com/docs/latest/flow/configuration/live-reload',\n 'liveReloadUnavailable'\n );\n }\n }\n\n getDedicatedWebSocketUrl(): string | undefined {\n function getAbsoluteUrl(relative: string) {\n // Use innerHTML to obtain an absolute URL\n const div = document.createElement('div');\n div.innerHTML = ``;\n return (div.firstChild as HTMLLinkElement).href;\n }\n if (this.url === undefined) {\n return undefined;\n }\n const connectionBaseUrl = getAbsoluteUrl(this.url!);\n\n if (!connectionBaseUrl.startsWith('http://') && !connectionBaseUrl.startsWith('https://')) {\n // eslint-disable-next-line no-console\n console.error('The protocol of the url should be http or https for live reload to work.');\n return undefined;\n }\n return `${connectionBaseUrl.replace(/^http/, 'ws')}?v-r=push&debug_window`;\n }\n\n getSpringBootWebSocketUrl(location: any) {\n const { hostname } = location;\n const wsProtocol = location.protocol === 'https:' ? 'wss' : 'ws';\n if (hostname.endsWith('gitpod.io')) {\n // Gitpod uses `port-url` instead of `url:port`\n const hostnameWithoutPort = hostname.replace(/.*?-/, '');\n return `${wsProtocol}://${this.springBootLiveReloadPort}-${hostnameWithoutPort}`;\n } else {\n return `${wsProtocol}://${hostname}:${this.springBootLiveReloadPort}`;\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.catchErrors();\n\n // when focus or clicking anywhere, move the splash message to the message tray\n this.disableEventListener = (_: any) => this.demoteSplashMessage();\n document.body.addEventListener('focus', this.disableEventListener);\n document.body.addEventListener('click', this.disableEventListener);\n this.openWebSocketConnection();\n\n const lastReload = window.sessionStorage.getItem(VaadinDevTools.TRIGGERED_KEY_IN_SESSION_STORAGE);\n if (lastReload) {\n const now = new Date();\n const reloaded = `${`0${now.getHours()}`.slice(-2)}:${`0${now.getMinutes()}`.slice(\n -2\n )}:${`0${now.getSeconds()}`.slice(-2)}`;\n this.showSplashMessage(`Page reloaded at ${reloaded}`);\n window.sessionStorage.removeItem(VaadinDevTools.TRIGGERED_KEY_IN_SESSION_STORAGE);\n }\n\n this.transitionDuration = parseInt(\n window.getComputedStyle(this).getPropertyValue('--dev-tools-transition-duration'),\n 10\n );\n\n const windowAny = window as any;\n windowAny.Vaadin = windowAny.Vaadin || {};\n windowAny.Vaadin.devTools = Object.assign(this, windowAny.Vaadin.devTools);\n\n licenseInit();\n }\n format(o: any): string {\n return o.toString();\n }\n catchErrors() {\n // Process stored messages\n const queue = (window as any).Vaadin.ConsoleErrors as any[];\n if (queue) {\n queue.forEach((args: any[]) => {\n this.log(MessageType.ERROR, args.map((o) => this.format(o)).join(' '));\n });\n }\n // Install new handler that immediately processes messages\n (window as any).Vaadin.ConsoleErrors = {\n push: (args: any[]) => {\n this.log(MessageType.ERROR, args.map((o) => this.format(o)).join(' '));\n }\n };\n }\n\n disconnectedCallback() {\n if (this.disableEventListener) {\n document.body.removeEventListener('focus', this.disableEventListener!);\n document.body.removeEventListener('click', this.disableEventListener!);\n }\n super.disconnectedCallback();\n }\n\n toggleExpanded() {\n this.notifications.slice().forEach((notification) => this.dismissNotification(notification.id));\n this.expanded = !this.expanded;\n if (this.expanded) {\n this.root.focus();\n }\n }\n\n showSplashMessage(msg: string | undefined) {\n this.splashMessage = msg;\n if (this.splashMessage) {\n if (this.expanded) {\n this.demoteSplashMessage();\n } else {\n // automatically move notification to message tray after a certain amount of time\n setTimeout(() => {\n this.demoteSplashMessage();\n }, VaadinDevTools.AUTO_DEMOTE_NOTIFICATION_DELAY);\n }\n }\n }\n\n demoteSplashMessage() {\n if (this.splashMessage) {\n this.log(MessageType.LOG, this.splashMessage);\n }\n this.showSplashMessage(undefined);\n }\n\n checkLicense(productInfo: Product) {\n if (this.frontendConnection) {\n this.frontendConnection.sendLicenseCheck(productInfo);\n } else {\n licenseCheckFailed({ message: 'Internal error: no connection', product: productInfo });\n }\n }\n\n log(type: MessageType, message: string, details?: string, link?: string) {\n const id = this.nextMessageId;\n this.nextMessageId += 1;\n this.messages.push({\n id,\n type,\n message,\n details,\n link,\n dontShowAgain: false,\n deleted: false\n });\n while (this.messages.length > VaadinDevTools.MAX_LOG_ROWS) {\n this.messages.shift();\n }\n this.requestUpdate();\n this.updateComplete.then(() => {\n // Scroll into view\n const lastMessage = this.renderRoot.querySelector('.message-tray .message:last-child');\n if (this.expanded && lastMessage) {\n setTimeout(() => lastMessage.scrollIntoView({ behavior: 'smooth' }), this.transitionDuration);\n this.unreadErrors = false;\n } else if (type === MessageType.ERROR) {\n this.unreadErrors = true;\n }\n });\n }\n\n showNotification(type: MessageType, message: string, details?: string, link?: string, persistentId?: string) {\n if (persistentId === undefined || !VaadinDevTools.notificationDismissed(persistentId!)) {\n // Do not open persistent message if another is already visible with the same persistentId\n const matchingVisibleNotifications = this.notifications\n .filter((notification) => notification.persistentId === persistentId)\n .filter((notification) => !notification.deleted);\n if (matchingVisibleNotifications.length > 0) {\n return;\n }\n const id = this.nextMessageId;\n this.nextMessageId += 1;\n this.notifications.push({\n id,\n type,\n message,\n details,\n link,\n persistentId,\n dontShowAgain: false,\n deleted: false\n });\n // automatically move notification to message tray after a certain amount of time unless it contains a link\n if (link === undefined) {\n setTimeout(() => {\n this.dismissNotification(id);\n }, VaadinDevTools.AUTO_DEMOTE_NOTIFICATION_DELAY);\n }\n this.requestUpdate();\n } else {\n this.log(type, message, details, link);\n }\n }\n\n dismissNotification(id: number) {\n const index = this.findNotificationIndex(id);\n if (index !== -1 && !this.notifications[index].deleted) {\n const notification = this.notifications[index];\n\n // user is explicitly dismissing a notification---after that we won't bug them with it\n if (\n notification.dontShowAgain &&\n notification.persistentId &&\n !VaadinDevTools.notificationDismissed(notification.persistentId)\n ) {\n let dismissed = window.localStorage.getItem(VaadinDevTools.DISMISSED_NOTIFICATIONS_IN_LOCAL_STORAGE);\n dismissed = dismissed === null ? notification.persistentId : `${dismissed},${notification.persistentId}`;\n window.localStorage.setItem(VaadinDevTools.DISMISSED_NOTIFICATIONS_IN_LOCAL_STORAGE, dismissed);\n }\n\n notification.deleted = true;\n this.log(notification.type, notification.message, notification.details, notification.link);\n\n // give some time for the animation\n setTimeout(() => {\n const idx = this.findNotificationIndex(id);\n if (idx !== -1) {\n this.notifications.splice(idx, 1);\n this.requestUpdate();\n }\n }, this.transitionDuration);\n }\n }\n\n findNotificationIndex(id: number): number {\n let index = -1;\n this.notifications.some((notification, idx) => {\n if (notification.id === id) {\n index = idx;\n return true;\n } else {\n return false;\n }\n });\n return index;\n }\n\n toggleDontShowAgain(id: number) {\n const index = this.findNotificationIndex(id);\n if (index !== -1 && !this.notifications[index].deleted) {\n const notification = this.notifications[index];\n notification.dontShowAgain = !notification.dontShowAgain;\n this.requestUpdate();\n }\n }\n\n setActive(yes: boolean) {\n this.frontendConnection?.setActive(yes);\n this.javaConnection?.setActive(yes);\n window.sessionStorage.setItem(VaadinDevTools.ACTIVE_KEY_IN_SESSION_STORAGE, yes ? 'true' : 'false');\n }\n\n getStatusColor(status: ConnectionStatus | undefined) {\n if (status === ConnectionStatus.ACTIVE) {\n return css`hsl(${VaadinDevTools.GREEN_HSL})`;\n } else if (status === ConnectionStatus.INACTIVE) {\n return css`hsl(${VaadinDevTools.GREY_HSL})`;\n } else if (status === ConnectionStatus.UNAVAILABLE) {\n return css`hsl(${VaadinDevTools.YELLOW_HSL})`;\n } else if (status === ConnectionStatus.ERROR) {\n return css`hsl(${VaadinDevTools.RED_HSL})`;\n } else {\n return css`none`;\n }\n }\n\n /* eslint-disable lit/no-template-arrow */\n renderMessage(messageObject: Message) {\n return html`\n \n
\n
${messageObject.message}
\n
\n ${messageObject.persistentId\n ? html` this.toggleDontShowAgain(messageObject.id)}\n >\n Don’t show again\n
`\n : ''}\n \n
this.dismissNotification(messageObject.id)}>Dismiss
\n \n `;\n }\n\n /* eslint-disable lit/no-template-map */\n render() {\n return html` e.key === 'Escape' && this.toggleExpanded()}\n >\n
\n ${this.tabs.map(\n (tab) =>\n html` {\n this.activeTab = tab.id;\n if (tab.activate) tab.activate.call(this);\n }}\n >\n ${tab.title}\n `\n )}\n \n
\n ${this.tabs.map((tab) => (this.activeTab === tab.id ? tab.render.call(this) : nothing))}\n \n\n
${this.notifications.map((msg) => this.renderMessage(msg))}
\n this.toggleExpanded()}\n >\n ${this.unreadErrors\n ? html`\n \n \n \n \n \n `\n : html`\n \n \n \n \n `}\n\n \n ${this.splashMessage ? html`${this.splashMessage}` : nothing}\n `;\n }\n\n renderLog() {\n return html`
${this.messages.map((msg) => this.renderMessage(msg))}
`;\n }\n activateLog() {\n this.unreadErrors = false;\n this.updateComplete.then(() => {\n const lastMessage = this.renderRoot.querySelector('.message-tray .message:last-child');\n if (lastMessage) {\n lastMessage.scrollIntoView();\n }\n });\n }\n\n renderInfo() {\n return html`
\n \n
\n
${this.serverInfo.productName}
\n
${this.serverInfo.vaadinVersion}
\n
Flow
\n
${this.serverInfo.flowVersion}
\n
Java
\n
${this.serverInfo.javaVersion}
\n
OS
\n
${this.serverInfo.osVersion}
\n
Browser
\n
${navigator.userAgent}
\n
\n Live reload\n \n
\n
\n Java ${this.javaStatus} ${this.backend ? `(${VaadinDevTools.BACKEND_DISPLAY_NAME[this.backend]})` : ''}\n
\n
\n Front end ${this.frontendStatus}\n
\n
\n
`;\n }\n\n private renderFeatures() {\n return html`
\n ${this.features.map(\n (feature) => html`
\n \n Learn more\n
`\n )}\n
`;\n }\n\n copyInfoToClipboard() {\n const items = this.renderRoot.querySelectorAll('.info-tray dt, .info-tray dd');\n const text = Array.from(items)\n .map((message) => (message.localName === 'dd' ? ': ' : '\\n') + message.textContent!.trim())\n .join('')\n .replace(/^\\n/, '');\n copy(text);\n this.showNotification(\n MessageType.INFORMATION,\n 'Environment information copied to clipboard',\n undefined,\n undefined,\n 'versionInfoCopied'\n );\n }\n\n toggleFeatureFlag(e: Event, feature: Feature) {\n const enabled = (e.target! as HTMLInputElement).checked;\n if (this.frontendConnection) {\n this.frontendConnection.setFeature(feature.id, enabled);\n this.showNotification(\n MessageType.INFORMATION,\n `“${feature.title}” ${enabled ? 'enabled' : 'disabled'}`,\n feature.requiresServerRestart ? 'This feature requires a server restart' : undefined,\n undefined,\n `feature${feature.id}${enabled ? 'Enabled' : 'Disabled'}`\n );\n } else {\n this.log(MessageType.ERROR, `Unable to toggle feature ${feature.title}: No server connection available`);\n }\n }\n}\n\nif (customElements.get('vaadin-dev-tools') === undefined) {\n customElements.define('vaadin-dev-tools', VaadinDevTools);\n}\n"]} \ No newline at end of file diff --git a/java/demo/frontend/generated/jar-resources/vaadin-grid-flow-selection-column.js b/java/demo/frontend/generated/jar-resources/vaadin-grid-flow-selection-column.js deleted file mode 100644 index 3c368de58..000000000 --- a/java/demo/frontend/generated/jar-resources/vaadin-grid-flow-selection-column.js +++ /dev/null @@ -1,156 +0,0 @@ -import '@vaadin/grid/vaadin-grid-column.js'; -import { GridColumn } from '@vaadin/grid/src/vaadin-grid-column.js'; -{ - class GridFlowSelectionColumnElement extends GridColumn { - - static get is() { - return 'vaadin-grid-flow-selection-column'; - } - - static get properties() { - return { - - /** - * Automatically sets the width of the column based on the column contents when this is set to `true`. - */ - autoWidth: { - type: Boolean, - value: true - }, - - /** - * Width of the cells for this column. - */ - width: { - type: String, - value: '56px' - }, - - /** - * Flex grow ratio for the cell widths. When set to 0, cell width is fixed. - */ - flexGrow: { - type: Number, - value: 0 - }, - - /** - * When true, all the items are selected. - */ - selectAll: { - type: Boolean, - value: false, - notify: true - }, - - /** - * Whether to display the select all checkbox in indeterminate state, - * which means some, but not all, items are selected - */ - indeterminate: { - type: Boolean, - value: false, - notify: true - }, - - selectAllHidden: Boolean - }; - } - - constructor() { - super(); - this._boundOnSelectEvent = this._onSelectEvent.bind(this); - this._boundOnDeselectEvent = this._onDeselectEvent.bind(this); - } - - static get observers() { - return [ - '_onHeaderRendererOrBindingChanged(_headerRenderer, _headerCell, path, header, selectAll, indeterminate, selectAllHidden)' - ]; - } - - /** @private */ - connectedCallback() { - super.connectedCallback(); - if (this._grid) { - this._grid.addEventListener('select', this._boundOnSelectEvent); - this._grid.addEventListener('deselect', this._boundOnDeselectEvent); - } - } - - /** @private */ - disconnectedCallback() { - super.disconnectedCallback(); - if (this._grid) { - this._grid.removeEventListener('select', this._boundOnSelectEvent); - this._grid.removeEventListener('deselect', this._boundOnDeselectEvent); - } - } - - /** - * Renders the Select All checkbox to the header cell. - * - * @override - */ - _defaultHeaderRenderer(root, _column) { - let checkbox = root.firstElementChild; - if (!checkbox) { - checkbox = document.createElement('vaadin-checkbox'); - checkbox.id = 'selectAllCheckbox'; - checkbox.setAttribute('aria-label', 'Select All'); - checkbox.classList.add('vaadin-grid-select-all-checkbox'); - checkbox.addEventListener('click', this._onSelectAllClick.bind(this)); - root.appendChild(checkbox); - } - - const checked = this.selectAll; - checkbox.hidden = this.selectAllHidden; - checkbox.checked = checked; - checkbox.indeterminate = this.indeterminate; - } - - /** - * Renders the Select Row checkbox to the body cell. - * - * @override - */ - _defaultRenderer(root, _column, { item, selected }) { - let checkbox = root.firstElementChild; - if (!checkbox) { - checkbox = document.createElement('vaadin-checkbox'); - checkbox.setAttribute('aria-label', 'Select Row'); - checkbox.addEventListener('click', this._onSelectClick.bind(this)); - root.appendChild(checkbox); - } - - checkbox.__item = item; - checkbox.checked = selected; - } - - _onSelectClick(e) { - e.currentTarget.checked ? this._grid.$connector.doDeselection([e.currentTarget.__item], true) : this._grid.$connector.doSelection([e.currentTarget.__item], true); - } - - _onSelectAllClick(e) { - e.preventDefault(); - if (this._grid.hasAttribute('disabled')) { - e.currentTarget.checked = !e.currentTarget.checked; - return; - } - this.selectAll ? this.$server.deselectAll() : this.$server.selectAll(); - } - - _onSelectEvent(e) { - } - - _onDeselectEvent(e) { - if (e.detail.userOriginated) { - this.selectAll = false; - } - } - } - - customElements.define(GridFlowSelectionColumnElement.is, GridFlowSelectionColumnElement); - - Vaadin.GridFlowSelectionColumnElement = GridFlowSelectionColumnElement; -} diff --git a/java/demo/frontend/generated/jar-resources/vaadin-time-picker/helpers.js b/java/demo/frontend/generated/jar-resources/vaadin-time-picker/helpers.js deleted file mode 100644 index dd3c3281f..000000000 --- a/java/demo/frontend/generated/jar-resources/vaadin-time-picker/helpers.js +++ /dev/null @@ -1,183 +0,0 @@ -// map from unicode eastern arabic number characters to arabic numbers -const EASTERN_ARABIC_DIGIT_MAP = { - '\\u0660': '0', - '\\u0661': '1', - '\\u0662': '2', - '\\u0663': '3', - '\\u0664': '4', - '\\u0665': '5', - '\\u0666': '6', - '\\u0667': '7', - '\\u0668': '8', - '\\u0669': '9' -}; - -/** - * Escapes the given string so it can be safely used in a regexp. - * - * @param {string} string - * @return {string} - */ -function escapeRegExp(string) { - return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); -} - -/** - * Parses eastern arabic number characters to arabic numbers (0-9) - * - * @param {string} digits - * @return {string} - */ -function parseEasternArabicDigits(digits) { - return digits.replace(/[\u0660-\u0669]/g, function (char) { - const unicode = '\\u0' + char.charCodeAt(0).toString(16); - return EASTERN_ARABIC_DIGIT_MAP[unicode]; - }); -} - -/** - * @param {string} locale - * @param {Date} testTime - * @return {string | null} - */ -function getAmOrPmString(locale, testTime) { - const testTimeString = testTime.toLocaleTimeString(locale); - - // AM/PM string is anything from one letter in eastern arabic to standard two letters, - // to having space in between, dots ... - // cannot disqualify whitespace since some locales use a. m. / p. m. - // TODO when more scripts support is added (than Arabic), need to exclude those numbers too - const amOrPmRegExp = /[^\d\u0660-\u0669]/; - - const matches = - // In most locales, the time ends with AM/PM: - testTimeString.match(new RegExp(`${amOrPmRegExp.source}+$`, 'g')) || - // In some locales, the time starts with AM/PM e.g in Chinese: - testTimeString.match(new RegExp(`^${amOrPmRegExp.source}+`, 'g')); - - return matches && matches[0].trim(); -} - -/** - * @param {string} locale - * @return {string | null} - */ -export function getSeparator(locale) { - let timeString = TEST_PM_TIME.toLocaleTimeString(locale); - - // Since the next regex picks first non-number-whitespace, - // need to discard possible PM from beginning (eg. chinese locale) - const pmString = getPmString(locale); - if (pmString && timeString.startsWith(pmString)) { - timeString = timeString.replace(pmString, ''); - } - - const matches = timeString.match(/[^\u0660-\u0669\s\d]/); - return matches && matches[0]; -} - -/** - * Searches for either an AM or PM token in the given time string - * depending on what is provided in `amOrPmString`. - * - * The search is case and space insensitive. - * - * @example - * `searchAmOrPmToken('1 P M', 'PM')` => `'P M'` - * - * @example - * `searchAmOrPmToken('1 a.m.', 'A. M.')` => `a.m.` - * - * @param {string} timeString - * @param {string} amOrPmString - * @return {string | null} - */ -export function searchAmOrPmToken(timeString, amOrPmString) { - if (!amOrPmString) return null; - - // Create a regexp string for searching for AM/PM without space-sensitivity. - const tokenRegExpString = amOrPmString.split(/\s*/).map(escapeRegExp).join('\\s*'); - - // Create a regexp without case-sensitivity. - const tokenRegExp = new RegExp(tokenRegExpString, 'i'); - - // Match the regexp against the time string. - const tokenMatches = timeString.match(tokenRegExp); - if (tokenMatches) { - return tokenMatches[0]; - } -} - -export const TEST_PM_TIME = new Date('August 19, 1975 23:15:30'); - -export const TEST_AM_TIME = new Date('August 19, 1975 05:15:30'); - -/** - * @param {string} locale - * @return {string} - */ -export function getPmString(locale) { - return getAmOrPmString(locale, TEST_PM_TIME); -} - -/** - * @param {string} locale - * @return {string} - */ -export function getAmString(locale) { - return getAmOrPmString(locale, TEST_AM_TIME); -} - -/** - * @param {string} digits - * @return {number} - */ -export function parseDigitsIntoInteger(digits) { - return parseInt(parseEasternArabicDigits(digits)); -} - -/** - * @param {string} milliseconds - * @return {number} - */ -export function parseMillisecondsIntoInteger(milliseconds) { - milliseconds = parseEasternArabicDigits(milliseconds); - // digits are either .1 .01 or .001 so need to "shift" - if (milliseconds.length === 1) { - milliseconds += '00'; - } else if (milliseconds.length === 2) { - milliseconds += '0'; - } - return parseInt(milliseconds); -} - -/** - * @param {string} timeString - * @param {number} milliseconds - * @param {string} amString - * @param {string} pmString - * @return {string} - */ -export function formatMilliseconds(timeString, milliseconds, amString, pmString) { - // might need to inject milliseconds between seconds and AM/PM - let cleanedTimeString = timeString; - if (timeString.endsWith(amString)) { - cleanedTimeString = timeString.replace(' ' + amString, ''); - } else if (timeString.endsWith(pmString)) { - cleanedTimeString = timeString.replace(' ' + pmString, ''); - } - if (milliseconds) { - let millisecondsString = milliseconds < 10 ? '0' : ''; - millisecondsString += milliseconds < 100 ? '0' : ''; - millisecondsString += milliseconds; - cleanedTimeString += '.' + millisecondsString; - } else { - cleanedTimeString += '.000'; - } - if (timeString.endsWith(amString)) { - cleanedTimeString = cleanedTimeString + ' ' + amString; - } else if (timeString.endsWith(pmString)) { - cleanedTimeString = cleanedTimeString + ' ' + pmString; - } - return cleanedTimeString; -} diff --git a/java/demo/frontend/generated/jar-resources/vaadin-time-picker/timepickerConnector.js b/java/demo/frontend/generated/jar-resources/vaadin-time-picker/timepickerConnector.js deleted file mode 100644 index b41daf980..000000000 --- a/java/demo/frontend/generated/jar-resources/vaadin-time-picker/timepickerConnector.js +++ /dev/null @@ -1,178 +0,0 @@ -import { - TEST_PM_TIME, - formatMilliseconds, - parseMillisecondsIntoInteger, - parseDigitsIntoInteger, - getAmString, - getPmString, - getSeparator, - searchAmOrPmToken -} from './helpers.js'; - -(function () { - const tryCatchWrapper = function (callback) { - return window.Vaadin.Flow.tryCatchWrapper(callback, 'Vaadin Time Picker'); - }; - - // Execute callback when predicate returns true. - // Try again later if predicate returns false. - function when(predicate, callback, timeout = 0) { - if (predicate()) { - callback(); - } else { - setTimeout(() => when(predicate, callback, 200), timeout); - } - } - - window.Vaadin.Flow.timepickerConnector = { - initLazy: (timepicker) => - tryCatchWrapper(function (timepicker) { - // Check whether the connector was already initialized for the timepicker - if (timepicker.$connector) { - return; - } - - timepicker.$connector = {}; - - timepicker.$connector.setLocale = tryCatchWrapper(function (locale) { - // capture previous value if any - let previousValueObject; - if (timepicker.value && timepicker.value !== '') { - previousValueObject = timepicker.i18n.parseTime(timepicker.value); - } - - try { - // Check whether the locale is supported by the browser or not - TEST_PM_TIME.toLocaleTimeString(locale); - } catch (e) { - locale = 'en-US'; - // FIXME should do a callback for server to throw an exception ? - throw new Error( - 'vaadin-time-picker: The locale ' + - locale + - ' is not supported, falling back to default locale setting(en-US).' - ); - } - - // 1. 24 or 12 hour clock, if latter then what are the am/pm strings ? - const pmString = getPmString(locale); - const amString = getAmString(locale); - - // 2. What is the separator ? - const separator = getSeparator(locale); - - const includeSeconds = function () { - return timepicker.step && timepicker.step < 60; - }; - - const includeMilliSeconds = function () { - return timepicker.step && timepicker.step < 1; - }; - - let cachedTimeString; - let cachedTimeObject; - - timepicker.i18n = { - formatTime: tryCatchWrapper(function (timeObject) { - if (!timeObject) return; - - const timeToBeFormatted = new Date(); - timeToBeFormatted.setHours(timeObject.hours); - timeToBeFormatted.setMinutes(timeObject.minutes); - timeToBeFormatted.setSeconds(timeObject.seconds !== undefined ? timeObject.seconds : 0); - - // the web component expects the correct granularity used for the time string, - // thus need to format the time object in correct granularity by passing the format options - let localeTimeString = timeToBeFormatted.toLocaleTimeString(locale, { - hour: 'numeric', - minute: 'numeric', - second: includeSeconds() ? 'numeric' : undefined - }); - - // milliseconds not part of the time format API - if (includeMilliSeconds()) { - localeTimeString = formatMilliseconds(localeTimeString, timeObject.milliseconds, amString, pmString); - } - - return localeTimeString; - }), - - parseTime: tryCatchWrapper(function (timeString) { - if (timeString && timeString === cachedTimeString && cachedTimeObject) { - return cachedTimeObject; - } - - if (!timeString) { - // when nothing is returned, the component shows the invalid state for the input - return; - } - - const amToken = searchAmOrPmToken(timeString, amString); - const pmToken = searchAmOrPmToken(timeString, pmString); - - const numbersOnlyTimeString = timeString - .replace(amToken || '', '') - .replace(pmToken || '', '') - .trim(); - - // A regexp that allows to find the numbers with optional separator and continuing searching after it. - const numbersRegExp = new RegExp('([\\d\\u0660-\\u0669]){1,2}(?:' + separator + ')?', 'g'); - - let hours = numbersRegExp.exec(numbersOnlyTimeString); - if (hours) { - hours = parseDigitsIntoInteger(hours[0].replace(separator, '')); - // handle 12 am -> 0 - // do not do anything if am & pm are not used or if those are the same, - // as with locale bg-BG there is always ч. at the end of the time - if (amToken !== pmToken) { - if (hours === 12 && amToken) { - hours = 0; - } - if (hours !== 12 && pmToken) { - hours += 12; - } - } - const minutes = numbersRegExp.exec(numbersOnlyTimeString); - const seconds = minutes && numbersRegExp.exec(numbersOnlyTimeString); - // detecting milliseconds from input, expects am/pm removed from end, eg. .0 or .00 or .000 - const millisecondRegExp = /[[\.][\d\u0660-\u0669]{1,3}$/; - // reset to end or things can explode - let milliseconds = seconds && includeMilliSeconds() && millisecondRegExp.exec(numbersOnlyTimeString); - // handle case where last numbers are seconds and . is the separator (invalid regexp match) - if (milliseconds && milliseconds['index'] <= seconds['index']) { - milliseconds = undefined; - } - // hours is a number at this point, others are either arrays or null - // the string in [0] from the arrays includes the separator too - cachedTimeObject = hours !== undefined && { - hours: hours, - minutes: minutes ? parseDigitsIntoInteger(minutes[0].replace(separator, '')) : 0, - seconds: seconds ? parseDigitsIntoInteger(seconds[0].replace(separator, '')) : 0, - milliseconds: - minutes && seconds && milliseconds - ? parseMillisecondsIntoInteger(milliseconds[0].replace('.', '')) - : 0 - }; - cachedTimeString = timeString; - return cachedTimeObject; - } - }) - }; - - if (previousValueObject) { - when( - () => timepicker.$, - () => { - const newValue = timepicker.i18n.formatTime(previousValueObject); - // FIXME works but uses private API, needs fixes in web component - if (timepicker.inputElement.value !== newValue) { - timepicker.inputElement.value = newValue; - timepicker.$.comboBox.value = newValue; - } - } - ); - } - }); - })(timepicker) - }; -})(); diff --git a/java/demo/frontend/generated/jar-resources/virtualListConnector.js b/java/demo/frontend/generated/jar-resources/virtualListConnector.js deleted file mode 100644 index eda42f6b0..000000000 --- a/java/demo/frontend/generated/jar-resources/virtualListConnector.js +++ /dev/null @@ -1,130 +0,0 @@ -import { Debouncer } from '@polymer/polymer/lib/utils/debounce.js'; -import { timeOut } from '@polymer/polymer/lib/utils/async.js'; - -window.Vaadin.Flow.virtualListConnector = { - initLazy: function (list) { - // Check whether the connector was already initialized for the virtual list - if (list.$connector) { - return; - } - - const extraItemsBuffer = 20; - - let lastRequestedRange = [0, 0]; - - list.$connector = {}; - list.$connector.placeholderItem = { __placeholder: true }; - - const updateRequestedItem = function () { - /* - * TODO virtual list seems to do a small index adjustment after scrolling - * has stopped. This causes a redundant request to be sent to make a - * corresponding minimal change to the buffer. We should avoid these - * requests by making the logic skip doing a request if the available - * buffer is within some tolerance compared to the requested buffer. - */ - const visibleIndexes = [...list.children] - .filter((el) => '__virtualListIndex' in el) - .map((el) => el.__virtualListIndex); - const firstNeededItem = Math.min(...visibleIndexes); - const lastNeededItem = Math.max(...visibleIndexes); - - let first = Math.max(0, firstNeededItem - extraItemsBuffer); - let last = Math.min(lastNeededItem + extraItemsBuffer, list.items.length); - - if (lastRequestedRange[0] != first || lastRequestedRange[1] != last) { - lastRequestedRange = [first, last]; - const count = 1 + last - first; - list.$server.setRequestedRange(first, count); - } - }; - - const scheduleUpdateRequest = function () { - list.__requestDebounce = Debouncer.debounce(list.__requestDebounce, timeOut.after(50), updateRequestedItem); - }; - - requestAnimationFrame(() => updateRequestedItem); - - // Add an observer function that will invoke on virtualList.renderer property - // change and then patches it with a wrapper renderer - list.patchVirtualListRenderer = function () { - if (!list.renderer || list.renderer.__virtualListConnectorPatched) { - // The list either doesn't have a renderer yet or it's already been patched - return; - } - - const originalRenderer = list.renderer; - - const renderer = (root, list, model) => { - root.__virtualListIndex = model.index; - - if (model.item === undefined) { - originalRenderer.call(list, root, list, { - ...model, - item: list.$connector.placeholderItem - }); - } else { - originalRenderer.call(list, root, list, model); - } - - /* - * Check if we need to do anything once things have settled down. - * This method is called multiple times in sequence for the same user - * action, but we only want to do the check once. - */ - scheduleUpdateRequest(); - }; - renderer.__virtualListConnectorPatched = true; - renderer.__rendererId = originalRenderer.__rendererId; - - list.renderer = renderer; - }; - - list._createPropertyObserver('renderer', 'patchVirtualListRenderer', true); - list.patchVirtualListRenderer(); - - list.items = []; - - list.$connector.set = function (index, items) { - list.items.splice(index, items.length, ...items); - list.items = [...list.items]; - }; - - list.$connector.clear = function (index, length) { - // How many items, starting from "index", should be set as undefined - const clearCount = Math.min(length, list.items.length - index); - list.$connector.set(index, [...Array(clearCount)]); - }; - - list.$connector.updateData = function (items) { - const updatedItemsMap = items.reduce((map, item) => { - map[item.key] = item; - return map; - }, {}); - - list.items = list.items.map((item) => { - // Items can be undefined if they are outside the viewport - if (!item) { - return item; - } - // Replace existing item with updated item, - // return existing item as fallback if it was not updated - return updatedItemsMap[item.key] || item; - }); - }; - - list.$connector.updateSize = function (newSize) { - const delta = newSize - list.items.length; - if (delta > 0) { - list.items = [...list.items, ...Array(delta)]; - } else if (delta < 0) { - list.items = list.items.slice(0, newSize); - } - }; - - list.$connector.setPlaceholderItem = function (placeholderItem = {}) { - placeholderItem.__placeholder = true; - list.$connector.placeholderItem = placeholderItem; - }; - } -}; diff --git a/java/demo/frontend/generated/vaadin-featureflags.ts b/java/demo/frontend/generated/vaadin-featureflags.ts deleted file mode 100644 index d33994382..000000000 --- a/java/demo/frontend/generated/vaadin-featureflags.ts +++ /dev/null @@ -1,11 +0,0 @@ -// @ts-nocheck -window.Vaadin = window.Vaadin || {}; -window.Vaadin.featureFlags = window.Vaadin.featureFlags || {}; -window.Vaadin.featureFlags.exampleFeatureFlag = false; -window.Vaadin.featureFlags.hillaPush = false; -window.Vaadin.featureFlags.hillaEngine = false; -window.Vaadin.featureFlags.oldLicenseChecker = false; -window.Vaadin.featureFlags.collaborationEngineBackend = false; -window.Vaadin.featureFlags.webpackForFrontendBuild = false; -window.Vaadin.featureFlags.enforceFieldValidation = false; -export {}; \ No newline at end of file diff --git a/java/demo/frontend/generated/vaadin.ts b/java/demo/frontend/generated/vaadin.ts deleted file mode 100644 index 3c8cdfca6..000000000 --- a/java/demo/frontend/generated/vaadin.ts +++ /dev/null @@ -1,5 +0,0 @@ -import './vaadin-featureflags.ts'; - -import './index'; - -import 'Frontend/generated/jar-resources/vaadin-dev-tools.js'; diff --git a/java/demo/frontend/generated/vite-devmode.ts b/java/demo/frontend/generated/vite-devmode.ts deleted file mode 100644 index f9f7a5fba..000000000 --- a/java/demo/frontend/generated/vite-devmode.ts +++ /dev/null @@ -1,31 +0,0 @@ -// @ts-ignore -if (import.meta.hot) { - // @ts-ignore - const hot = import.meta.hot; - - const isLiveReloadDisabled = () => { - // Checks if live reload is disabled in the debug window - return sessionStorage.getItem('vaadin.live-reload.active') === 'false'; - }; - - const preventViteReload = (payload: any) => { - // Changing the path prevents Vite from reloading - payload.path = '/_fake/path.html'; - }; - - let pendingNavigationTo: string | undefined = undefined; - - window.addEventListener('vaadin-router-go', (routerEvent: any) => { - pendingNavigationTo = routerEvent.detail.pathname + routerEvent.detail.search; - }); - hot.on('vite:beforeFullReload', (payload: any) => { - if (isLiveReloadDisabled()) { - preventViteReload(payload); - } - if (pendingNavigationTo) { - // Force reload with the new URL - location.href = pendingNavigationTo; - preventViteReload(payload); - } - }); -} diff --git a/java/demo/vite.generated.ts b/java/demo/vite.generated.ts deleted file mode 100644 index 0c90ddf6f..000000000 --- a/java/demo/vite.generated.ts +++ /dev/null @@ -1,639 +0,0 @@ -/** - * NOTICE: this is an auto-generated file - * - * This file has been generated by the `flow:prepare-frontend` maven goal. - * This file will be overwritten on every run. Any custom changes should be made to vite.config.ts - */ -import path from 'path'; -import { readFileSync, existsSync, writeFileSync, mkdirSync } from 'fs'; -import * as net from 'net'; - -import { processThemeResources } from './target/plugins/application-theme-plugin/theme-handle.js'; -import { rewriteCssUrls } from './target/plugins/theme-loader/theme-loader-utils.js'; -import settings from './target/vaadin-dev-server-settings.json'; -import { defineConfig, mergeConfig, PluginOption, ResolvedConfig, UserConfigFn, OutputOptions, AssetInfo, ChunkInfo } from 'vite'; -import { getManifest } from 'workbox-build'; - -import * as rollup from 'rollup'; -import brotli from 'rollup-plugin-brotli'; -import replace from '@rollup/plugin-replace'; -import checker from 'vite-plugin-checker'; -import postcssLit from './target/plugins/rollup-plugin-postcss-lit-custom/rollup-plugin-postcss-lit.js'; - -const appShellUrl = '.'; - -const frontendFolder = path.resolve(__dirname, settings.frontendFolder); -const themeFolder = path.resolve(frontendFolder, settings.themeFolder); -const statsFolder = path.resolve(__dirname, settings.statsOutput); -const frontendBundleFolder = path.resolve(__dirname, settings.frontendBundleOutput); -const jarResourcesFolder = path.resolve(__dirname, settings.jarResourcesFolder); -const generatedFlowImportsFolder = path.resolve(__dirname, settings.generatedFlowImportsFolder); -const themeResourceFolder = path.resolve(__dirname, settings.themeResourceFolder); - -const statsFile = path.resolve(statsFolder, 'stats.json'); - -const projectStaticAssetsFolders = [ - path.resolve(__dirname, 'src', 'main', 'resources', 'META-INF', 'resources'), - path.resolve(__dirname, 'src', 'main', 'resources', 'static'), - frontendFolder -]; - -// Folders in the project which can contain application themes -const themeProjectFolders = projectStaticAssetsFolders.map((folder) => path.resolve(folder, settings.themeFolder)); - -const themeOptions = { - devMode: false, - // The following matches folder 'frontend/generated/themes/' - // (not 'frontend/themes') for theme in JAR that is copied there - themeResourceFolder: path.resolve(themeResourceFolder, settings.themeFolder), - themeProjectFolders: themeProjectFolders, - projectStaticAssetsOutputFolder: path.resolve(__dirname, settings.staticOutput), - frontendGeneratedFolder: path.resolve(frontendFolder, settings.generatedFolder) -}; - -const hasExportedWebComponents = existsSync(path.resolve(frontendFolder, 'web-component.html')); - -// Block debug and trace logs. -console.trace = () => {}; -console.debug = () => {}; - -function injectManifestToSWPlugin(): rollup.Plugin { - const rewriteManifestIndexHtmlUrl = (manifest) => { - const indexEntry = manifest.find((entry) => entry.url === 'index.html'); - if (indexEntry) { - indexEntry.url = appShellUrl; - } - - return { manifest, warnings: [] }; - }; - - return { - name: 'vaadin:inject-manifest-to-sw', - async transform(code, id) { - if (/sw\.(ts|js)$/.test(id)) { - const { manifestEntries } = await getManifest({ - globDirectory: frontendBundleFolder, - globPatterns: ['**/*'], - globIgnores: ['**/*.br'], - manifestTransforms: [rewriteManifestIndexHtmlUrl], - maximumFileSizeToCacheInBytes: 100 * 1024 * 1024, // 100mb, - }); - - return code.replace('self.__WB_MANIFEST', JSON.stringify(manifestEntries)); - } - } - } -} - -function buildSWPlugin(opts): PluginOption { - let config: ResolvedConfig; - const devMode = opts.devMode; - - const swObj = {} - - async function build(action: 'generate' | 'write', additionalPlugins: rollup.Plugin[] = []) { - const includedPluginNames = [ - 'alias', - 'vite:resolve', - 'vite:esbuild', - 'rollup-plugin-dynamic-import-variables', - 'vite:esbuild-transpile', - 'vite:terser', - ] - const plugins: rollup.Plugin[] = config.plugins.filter((p) => { - return includedPluginNames.includes(p.name) - }); - plugins.push( - replace({ - values: { - 'process.env.NODE_ENV': JSON.stringify(config.mode), - ...config.define, - }, - preventAssignment: true - }) - ); - if (additionalPlugins) { - plugins.push(...additionalPlugins); - } - const bundle = await rollup.rollup({ - input: path.resolve(settings.clientServiceWorkerSource), - plugins - }); - - try { - return await bundle[action]({ - file: path.resolve(frontendBundleFolder, 'sw.js'), - format: 'es', - exports: 'none', - sourcemap: config.command === 'serve' || config.build.sourcemap, - inlineDynamicImports: true, - }); - } finally { - await bundle.close(); - } - } - - return { - name: 'vaadin:build-sw', - enforce: 'post', - async configResolved(resolvedConfig) { - config = resolvedConfig; - }, - async buildStart() { - if (devMode) { - const { output } = await build('generate'); - swObj.code = output[0].code; - swObj.map = output[0].map; - } - }, - async load(id) { - if (id.endsWith('sw.js')) { - return ''; - } - }, - async transform(_code, id) { - if (id.endsWith('sw.js')) { - return swObj; - } - }, - async closeBundle() { - await build('write', [ - injectManifestToSWPlugin(), - brotli(), - ]); - } - } -} - -function statsExtracterPlugin(): PluginOption { - return { - name: 'vaadin:stats', - enforce: 'post', - async writeBundle(options: OutputOptions, bundle: { [fileName: string]: AssetInfo | ChunkInfo }) { - const modules = Object.values(bundle).flatMap((b) => (b.modules ? Object.keys(b.modules) : [])); - const nodeModulesFolders = modules.filter((id) => id.includes('node_modules')); - const npmModules = nodeModulesFolders - .map((id) => id.replace(/.*node_modules./, '')) - .map((id) => { - const parts = id.split('/'); - if (id.startsWith('@')) { - return parts[0] + '/' + parts[1]; - } else { - return parts[0]; - } - }) - .sort() - .filter((value, index, self) => self.indexOf(value) === index); - - mkdirSync(path.dirname(statsFile), { recursive: true }); - writeFileSync(statsFile, JSON.stringify({ npmModules }, null, 1)); - } - }; -} -function vaadinBundlesPlugin(): PluginOption { - type ExportInfo = - | string - | { - namespace?: string; - source: string; - }; - - type ExposeInfo = { - exports: ExportInfo[]; - }; - - type PackageInfo = { - version: string; - exposes: Record; - }; - - type BundleJson = { - packages: Record; - }; - - const disabledMessage = 'Vaadin component dependency bundles are disabled.'; - - const modulesDirectory = path.resolve(__dirname, 'node_modules').replace(/\\/g, '/'); - - let vaadinBundleJson: BundleJson; - - function parseModuleId(id: string): { packageName: string; modulePath: string } { - const [scope, scopedPackageName] = id.split('/', 3); - const packageName = scope.startsWith('@') ? `${scope}/${scopedPackageName}` : scope; - const modulePath = `.${id.substring(packageName.length)}`; - return { - packageName, - modulePath - }; - } - - function getExports(id: string): string[] | undefined { - const { packageName, modulePath } = parseModuleId(id); - const packageInfo = vaadinBundleJson.packages[packageName]; - - if (!packageInfo) return; - - const exposeInfo: ExposeInfo = packageInfo.exposes[modulePath]; - if (!exposeInfo) return; - - const exportsSet = new Set(); - for (const e of exposeInfo.exports) { - if (typeof e === 'string') { - exportsSet.add(e); - } else { - const { namespace, source } = e; - if (namespace) { - exportsSet.add(namespace); - } else { - const sourceExports = getExports(source); - if (sourceExports) { - sourceExports.forEach((e) => exportsSet.add(e)); - } - } - } - } - return Array.from(exportsSet); - } - - function getExportBinding(binding: string) { - return binding === 'default' ? '_default as default' : binding; - } - - function getImportAssigment(binding: string) { - return binding === 'default' ? 'default: _default' : binding; - } - - return { - name: 'vaadin:bundles', - enforce: 'pre', - apply(config, { command }) { - if (command !== 'serve') return false; - - try { - const vaadinBundleJsonPath = require.resolve('@vaadin/bundles/vaadin-bundle.json'); - vaadinBundleJson = JSON.parse(readFileSync(vaadinBundleJsonPath, { encoding: 'utf8' })); - } catch (e: unknown) { - if (typeof e === 'object' && (e as { code: string }).code === 'MODULE_NOT_FOUND') { - vaadinBundleJson = { packages: {} }; - console.info(`@vaadin/bundles npm package is not found, ${disabledMessage}`); - return false; - } else { - throw e; - } - } - - const versionMismatches: Array<{ name: string; bundledVersion: string; installedVersion: string }> = []; - for (const [name, packageInfo] of Object.entries(vaadinBundleJson.packages)) { - let installedVersion: string | undefined = undefined; - try { - const { version: bundledVersion } = packageInfo; - const installedPackageJsonFile = path.resolve(modulesDirectory, name, 'package.json'); - const packageJson = JSON.parse(readFileSync(installedPackageJsonFile, { encoding: 'utf8' })); - installedVersion = packageJson.version; - if (installedVersion && installedVersion !== bundledVersion) { - versionMismatches.push({ - name, - bundledVersion, - installedVersion - }); - } - } catch (_) { - // ignore package not found - } - } - if (versionMismatches.length) { - console.info(`@vaadin/bundles has version mismatches with installed packages, ${disabledMessage}`); - console.info(`Packages with version mismatches: ${JSON.stringify(versionMismatches, undefined, 2)}`); - vaadinBundleJson = { packages: {} }; - return false; - } - - return true; - }, - async config(config) { - return mergeConfig( - { - optimizeDeps: { - exclude: [ - // Vaadin bundle - '@vaadin/bundles', - ...Object.keys(vaadinBundleJson.packages) - ] - } - }, - config - ); - }, - load(rawId) { - const [path, params] = rawId.split('?'); - if (!path.startsWith(modulesDirectory)) return; - - const id = path.substring(modulesDirectory.length + 1); - const bindings = getExports(id); - if (bindings === undefined) return; - - const cacheSuffix = params ? `?${params}` : ''; - const bundlePath = `@vaadin/bundles/vaadin.js${cacheSuffix}`; - - return `import { init as VaadinBundleInit, get as VaadinBundleGet } from '${bundlePath}'; -await VaadinBundleInit('default'); -const { ${bindings.map(getImportAssigment).join(', ')} } = (await VaadinBundleGet('./node_modules/${id}'))(); -export { ${bindings.map(getExportBinding).join(', ')} };`; - } - }; -} - -function themePlugin(opts): PluginOption { - const fullThemeOptions = {...themeOptions, devMode: opts.devMode }; - return { - name: 'vaadin:theme', - config() { - processThemeResources(fullThemeOptions, console); - }, - configureServer(server) { - function handleThemeFileCreateDelete(themeFile, stats) { - if (themeFile.startsWith(themeFolder)) { - const changed = path.relative(themeFolder, themeFile) - console.debug('Theme file ' + (!!stats ? 'created' : 'deleted'), changed); - processThemeResources(fullThemeOptions, console); - } - } - server.watcher.on('add', handleThemeFileCreateDelete); - server.watcher.on('unlink', handleThemeFileCreateDelete); - }, - handleHotUpdate(context) { - const contextPath = path.resolve(context.file); - const themePath = path.resolve(themeFolder); - if (contextPath.startsWith(themePath)) { - const changed = path.relative(themePath, contextPath); - - console.debug('Theme file changed', changed); - - if (changed.startsWith(settings.themeName)) { - processThemeResources(fullThemeOptions, console); - } - } - }, - async resolveId(id, importer) { - // force theme generation if generated theme sources does not yet exist - // this may happen for example during Java hot reload when updating - // @Theme annotation value - if (path.resolve(themeOptions.frontendGeneratedFolder, "theme.js") === importer && - !existsSync(path.resolve(themeOptions.frontendGeneratedFolder, id))) { - console.debug('Generate theme file ' + id + ' not existing. Processing theme resource'); - processThemeResources(fullThemeOptions, console); - return; - } - if (!id.startsWith(settings.themeFolder)) { - return; - } - - for (const location of [themeResourceFolder, frontendFolder]) { - const result = await this.resolve(path.resolve(location, id)); - if (result) { - return result; - } - } - }, - async transform(raw, id, options) { - // rewrite urls for the application theme css files - const [bareId, query] = id.split('?'); - if (!bareId?.startsWith(themeFolder) || !bareId?.endsWith('.css')) { - return; - } - const [themeName] = bareId.substring(themeFolder.length + 1).split('/'); - return rewriteCssUrls(raw, path.dirname(bareId), path.resolve(themeFolder, themeName), console, opts); - } - }; -} -function lenientLitImportPlugin(): PluginOption { - return { - name: 'vaadin:lenient-lit-import', - async transform(code, id) { - const decoratorImports = [ - /import (.*?) from (['"])(lit\/decorators)(['"])/, - /import (.*?) from (['"])(lit-element\/decorators)(['"])/ - ]; - const directiveImports = [ - /import (.*?) from (['"])(lit\/directives\/)([^\\.]*?)(['"])/, - /import (.*?) from (['"])(lit-html\/directives\/)([^\\.]*?)(['"])/ - ]; - - decoratorImports.forEach((decoratorImport) => { - let decoratorMatch; - while ((decoratorMatch = code.match(decoratorImport))) { - console.warn( - `Warning: the file ${id} imports from '${decoratorMatch[3]}' when it should import from '${decoratorMatch[3]}.js'` - ); - code = code.replace(decoratorImport, 'import $1 from $2$3.js$4'); - } - }); - - directiveImports.forEach((directiveImport) => { - let directiveMatch; - while ((directiveMatch = code.match(directiveImport))) { - console.warn( - `Warning: the file ${id} imports from '${directiveMatch[3]}${directiveMatch[4]}' when it should import from '${directiveMatch[3]}${directiveMatch[4]}.js'` - ); - code = code.replace(directiveImport, 'import $1 from $2$3$4.js$5'); - } - }); - - return code; - } - }; -} - -function runWatchDog(watchDogPort, watchDogHost) { - const client = net.Socket(); - client.setEncoding('utf8'); - client.on('error', function (err) { - console.log('Watchdog connection error. Terminating vite process...', err); - client.destroy(); - process.exit(0); - }); - client.on('close', function () { - client.destroy(); - runWatchDog(watchDogPort, watchDogHost); - }); - - client.connect(watchDogPort, watchDogHost || 'localhost'); -} - -let spaMiddlewareForceRemoved = false; - -const allowedFrontendFolders = [ - frontendFolder, - path.resolve(generatedFlowImportsFolder), // Contains only generated-flow-imports - path.resolve(__dirname, 'node_modules') -]; - -function setHmrPortToServerPort(): PluginOption { - return { - name: 'set-hmr-port-to-server-port', - configResolved(config) { - if (config.server.strictPort && config.server.hmr !== false) { - if (config.server.hmr === true) config.server.hmr = {}; - config.server.hmr = config.server.hmr || {}; - config.server.hmr.clientPort = config.server.port; - } - } - }; -} -function showRecompileReason(): PluginOption { - return { - name: 'vaadin:why-you-compile', - handleHotUpdate(context) { - console.log('Recompiling because', context.file, 'changed'); - } - }; -} - -export const vaadinConfig: UserConfigFn = (env) => { - const devMode = env.mode === 'development'; - - if (devMode && process.env.watchDogPort) { - // Open a connection with the Java dev-mode handler in order to finish - // vite when it exits or crashes. - runWatchDog(process.env.watchDogPort, process.env.watchDogHost); - } - - return { - root: frontendFolder, - base: '', - resolve: { - alias: { - '@vaadin/flow-frontend': jarResourcesFolder, - Frontend: frontendFolder - }, - preserveSymlinks: true - }, - define: { - OFFLINE_PATH: settings.offlinePath, - VITE_ENABLED: 'true' - }, - server: { - host: '127.0.0.1', - strictPort: true, - fs: { - allow: allowedFrontendFolders - } - }, - build: { - outDir: frontendBundleFolder, - assetsDir: 'VAADIN/build', - rollupOptions: { - input: { - indexhtml: path.resolve(frontendFolder, 'index.html'), - - ...hasExportedWebComponents - ? { webcomponenthtml: path.resolve(frontendFolder, 'web-component.html') } - : {} - } - } - }, - optimizeDeps: { - entries: [ - // Pre-scan entrypoints in Vite to avoid reloading on first open - 'generated/vaadin.ts' - ], - exclude: [ - '@vaadin/router', - '@vaadin/vaadin-license-checker', - '@vaadin/vaadin-usage-statistics', - 'workbox-core', - 'workbox-precaching', - 'workbox-routing', - 'workbox-strategies' - ] - }, - plugins: [ - !devMode && brotli(), - devMode && vaadinBundlesPlugin(), - devMode && setHmrPortToServerPort(), - devMode && showRecompileReason(), - settings.offlineEnabled && buildSWPlugin({ devMode }), - !devMode && statsExtracterPlugin(), - themePlugin({devMode}), - lenientLitImportPlugin(), - postcssLit({ - include: ['**/*.css', '**/*.css\?*'], - exclude: [ - `${themeFolder}/**/*.css`, - `${themeFolder}/**/*.css\?*`, - `${themeResourceFolder}/**/*.css`, - `${themeResourceFolder}/**/*.css\?*`, - '**/*\?html-proxy*' - ] - }), - { - name: 'vaadin:force-remove-html-middleware', - transformIndexHtml: { - enforce: 'pre', - transform(_html, { server }) { - if (server && !spaMiddlewareForceRemoved) { - server.middlewares.stack = server.middlewares.stack.filter((mw) => { - const handleName = '' + mw.handle; - return !handleName.includes('viteHtmlFallbackMiddleware'); - }); - spaMiddlewareForceRemoved = true; - } - } - } - }, - hasExportedWebComponents && { - name: 'vaadin:inject-entrypoints-to-web-component-html', - transformIndexHtml: { - enforce: 'pre', - transform(_html, { path, server }) { - if (path !== '/web-component.html') { - return; - } - - return [ - { - tag: 'script', - attrs: { type: 'module', src: `/generated/vaadin-web-component.ts` }, - injectTo: 'head' - } - ] - } - } - }, - { - name: 'vaadin:inject-entrypoints-to-index-html', - transformIndexHtml: { - enforce: 'pre', - transform(_html, { path, server }) { - if (path !== '/index.html') { - return; - } - - const scripts = []; - - if (devMode) { - scripts.push({ - tag: 'script', - attrs: { type: 'module', src: `/generated/vite-devmode.ts` }, - injectTo: 'head' - }); - } - scripts.push({ - tag: 'script', - attrs: { type: 'module', src: '/generated/vaadin.ts' }, - injectTo: 'head' - }); - return scripts; - } - } - }, - checker({ - typescript: true - }) - ] - }; -}; - -export const overrideVaadinConfig = (customConfig: UserConfigFn) => { - return defineConfig((env) => mergeConfig(vaadinConfig(env), customConfig(env))); -};