Spaces:
Running
Running
Upload 2 files
Browse files- index.html +67 -0
- mock-service-worker.js +50 -0
index.html
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8" />
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
+
<title>Citibank Demo Business Inc</title>
|
| 7 |
+
|
| 8 |
+
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
|
| 9 |
+
<script src="https://apis.google.com/js/api.js"></script>
|
| 10 |
+
<style>
|
| 11 |
+
html, body, #root {
|
| 12 |
+
margin: 0;
|
| 13 |
+
padding: 0;
|
| 14 |
+
height: 100%;
|
| 15 |
+
width: 100%;
|
| 16 |
+
overflow: hidden;
|
| 17 |
+
}
|
| 18 |
+
</style>
|
| 19 |
+
<script type="importmap">
|
| 20 |
+
{
|
| 21 |
+
"imports": {
|
| 22 |
+
"react": "https://esm.sh/react@18.3.1",
|
| 23 |
+
"react-dom/client": "https://esm.sh/react-dom@18.3.1/client",
|
| 24 |
+
"@google/genai": "https://esm.sh/@google/genai@0.14.0",
|
| 25 |
+
"marked": "https://esm.sh/marked@13.0.1",
|
| 26 |
+
"jszip": "https://esm.sh/jszip@3.10.1",
|
| 27 |
+
"diff": "https://esm.sh/diff@5.2.0",
|
| 28 |
+
"idb": "https://esm.sh/idb@8.0.0",
|
| 29 |
+
"react-colorful": "https://esm.sh/react-colorful@5.6.1",
|
| 30 |
+
"@octokit/rest": "https://esm.sh/@octokit/rest@20.1.1",
|
| 31 |
+
"axe-core": "https://esm.sh/axe-core@4.9.1",
|
| 32 |
+
"mermaid": "https://esm.sh/mermaid@11.2.0",
|
| 33 |
+
"@tailwindcss/typography": "https://esm.sh/@tailwindcss/typography@0.5.13",
|
| 34 |
+
"path": "https://esm.sh/path@^0.12.7",
|
| 35 |
+
"url": "https://esm.sh/url@^0.11.4",
|
| 36 |
+
"react/": "https://aistudiocdn.com/react@^19.1.1/",
|
| 37 |
+
"react-dom/": "https://aistudiocdn.com/react-dom@^19.1.1/",
|
| 38 |
+
"vite": "https://aistudiocdn.com/vite@^7.1.7"
|
| 39 |
+
}
|
| 40 |
+
}
|
| 41 |
+
</script>
|
| 42 |
+
<script type="module" crossorigin src="/assets/index-DyMS-nC-.js"></script>
|
| 43 |
+
<link rel="modulepreload" crossorigin href="/assets/@braintree-DY5JYOZd.js">
|
| 44 |
+
<link rel="modulepreload" crossorigin href="/assets/react-B-lWpQRQ.js">
|
| 45 |
+
<link rel="modulepreload" crossorigin href="/assets/scheduler-DYLXRpC5.js">
|
| 46 |
+
<link rel="modulepreload" crossorigin href="/assets/react-dom-CU2yWD-Y.js">
|
| 47 |
+
<link rel="modulepreload" crossorigin href="/assets/@google-xfXoiafW.js">
|
| 48 |
+
<link rel="modulepreload" crossorigin href="/assets/idb-Dob3nYDb.js">
|
| 49 |
+
<link rel="modulepreload" crossorigin href="/assets/axe-core-CA05Kxsw.js">
|
| 50 |
+
<link rel="modulepreload" crossorigin href="/assets/marked-CesSW9Du.js">
|
| 51 |
+
<link rel="modulepreload" crossorigin href="/assets/vscode-jsonrpc-2tvYB2ki.js">
|
| 52 |
+
<link rel="modulepreload" crossorigin href="/assets/lodash-es-CKTcnrxn.js">
|
| 53 |
+
<link rel="modulepreload" crossorigin href="/assets/@chevrotain-DMYZVohV.js">
|
| 54 |
+
<link rel="modulepreload" crossorigin href="/assets/chevrotain-D5DQZOif.js">
|
| 55 |
+
<link rel="modulepreload" crossorigin href="/assets/chevrotain-allstar-eFSt8-qu.js">
|
| 56 |
+
<link rel="modulepreload" crossorigin href="/assets/vscode-languageserver-types-NoPvPymt.js">
|
| 57 |
+
<link rel="modulepreload" crossorigin href="/assets/vscode-languageserver-textdocument-CKBVUiR3.js">
|
| 58 |
+
<link rel="modulepreload" crossorigin href="/assets/vscode-uri-CoxP0whD.js">
|
| 59 |
+
<link rel="modulepreload" crossorigin href="/assets/langium-B_PGe6V2.js">
|
| 60 |
+
<link rel="modulepreload" crossorigin href="/assets/@mermaid-js-Ce0__7Tp.js">
|
| 61 |
+
<link rel="stylesheet" crossorigin href="/assets/index-CRCZVWeJ.css">
|
| 62 |
+
</head>
|
| 63 |
+
<body>
|
| 64 |
+
<div id="root"></div>
|
| 65 |
+
<script id="gsi-client" src="https://accounts.google.com/gsi/client" async defer></script>
|
| 66 |
+
</body>
|
| 67 |
+
</html>
|
mock-service-worker.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* @license
|
| 3 |
+
* SPDX-License-Identifier: Apache-2.0
|
| 4 |
+
*/
|
| 5 |
+
|
| 6 |
+
const MOCK_ROUTES = new Map();
|
| 7 |
+
|
| 8 |
+
self.addEventListener('install', (event) => {
|
| 9 |
+
self.skipWaiting();
|
| 10 |
+
});
|
| 11 |
+
|
| 12 |
+
self.addEventListener('activate', (event) => {
|
| 13 |
+
event.waitUntil(self.clients.claim());
|
| 14 |
+
});
|
| 15 |
+
|
| 16 |
+
self.addEventListener('message', (event) => {
|
| 17 |
+
if (event.data.type === 'SET_ROUTES') {
|
| 18 |
+
const routes = event.data.routes || [];
|
| 19 |
+
MOCK_ROUTES.clear();
|
| 20 |
+
routes.forEach(route => {
|
| 21 |
+
// Simple wildcard support
|
| 22 |
+
const regex = new RegExp('^' + route.path.replace(/\*/g, '.*') + '$');
|
| 23 |
+
MOCK_ROUTES.set(regex, {
|
| 24 |
+
method: route.method,
|
| 25 |
+
response: route.response,
|
| 26 |
+
});
|
| 27 |
+
});
|
| 28 |
+
}
|
| 29 |
+
});
|
| 30 |
+
|
| 31 |
+
self.addEventListener('fetch', (event) => {
|
| 32 |
+
const url = new URL(event.request.url);
|
| 33 |
+
const path = url.pathname;
|
| 34 |
+
const method = event.request.method;
|
| 35 |
+
|
| 36 |
+
for (const [routeRegex, routeInfo] of MOCK_ROUTES.entries()) {
|
| 37 |
+
if (routeRegex.test(path) && routeInfo.method === method) {
|
| 38 |
+
event.respondWith(
|
| 39 |
+
new Response(JSON.stringify(routeInfo.response.body), {
|
| 40 |
+
status: routeInfo.response.status,
|
| 41 |
+
headers: { 'Content-Type': 'application/json', ...routeInfo.response.headers },
|
| 42 |
+
})
|
| 43 |
+
);
|
| 44 |
+
return;
|
| 45 |
+
}
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
// If no mock route matches, fall back to the network.
|
| 49 |
+
event.respondWith(fetch(event.request));
|
| 50 |
+
});
|