Spaces:
Configuration error
Configuration error
luigi12345
commited on
Commit
•
ce925d7
1
Parent(s):
29daf4e
da5cd8cbe262ec434f1b8bc506a7894aec88ece3d944c3eac583b9887ec0db16
Browse files- workers1/Autovideos-worker/.gitignore +1 -0
- workers1/Autovideos-worker/mathweb/flask/app.py +0 -0
- workers1/Autovideos-worker/renderHtml.js +0 -0
- workers1/Autovideos-worker/shy-hill-f5c2/.editorconfig +12 -0
- workers1/Autovideos-worker/shy-hill-f5c2/.gitignore +172 -0
- workers1/Autovideos-worker/shy-hill-f5c2/.prettierrc +6 -0
- workers1/Autovideos-worker/shy-hill-f5c2/.wrangler/tmp/bundle-TEgwOG/checked-fetch.js +30 -0
- workers1/Autovideos-worker/shy-hill-f5c2/.wrangler/tmp/bundle-TEgwOG/middleware-insertion-facade.js +4 -0
- workers1/Autovideos-worker/shy-hill-f5c2/.wrangler/tmp/dev-jXtU1l/index.js +543 -0
- workers1/Autovideos-worker/shy-hill-f5c2/.wrangler/tmp/dev-jXtU1l/index.js.map +8 -0
- workers1/Autovideos-worker/shy-hill-f5c2/package-lock.json +0 -0
- workers1/Autovideos-worker/shy-hill-f5c2/package.json +22 -0
- workers1/Autovideos-worker/shy-hill-f5c2/src/index.js +91 -0
- workers1/Autovideos-worker/shy-hill-f5c2/src/renderHtml.js +198 -0
- workers1/Autovideos-worker/shy-hill-f5c2/test/index.spec.ts +25 -0
- workers1/Autovideos-worker/shy-hill-f5c2/test/tsconfig.json +8 -0
- workers1/Autovideos-worker/shy-hill-f5c2/tsconfig.json +105 -0
- workers1/Autovideos-worker/shy-hill-f5c2/vitest.config.mts +11 -0
- workers1/Autovideos-worker/shy-hill-f5c2/worker-configuration.d.ts +4 -0
- workers1/Autovideos-worker/shy-hill-f5c2/wrangler.toml +115 -0
workers1/Autovideos-worker/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.aider*
|
workers1/Autovideos-worker/mathweb/flask/app.py
ADDED
File without changes
|
workers1/Autovideos-worker/renderHtml.js
ADDED
File without changes
|
workers1/Autovideos-worker/shy-hill-f5c2/.editorconfig
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# http://editorconfig.org
|
2 |
+
root = true
|
3 |
+
|
4 |
+
[*]
|
5 |
+
indent_style = tab
|
6 |
+
end_of_line = lf
|
7 |
+
charset = utf-8
|
8 |
+
trim_trailing_whitespace = true
|
9 |
+
insert_final_newline = true
|
10 |
+
|
11 |
+
[*.yml]
|
12 |
+
indent_style = space
|
workers1/Autovideos-worker/shy-hill-f5c2/.gitignore
ADDED
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Logs
|
2 |
+
|
3 |
+
logs
|
4 |
+
_.log
|
5 |
+
npm-debug.log_
|
6 |
+
yarn-debug.log*
|
7 |
+
yarn-error.log*
|
8 |
+
lerna-debug.log*
|
9 |
+
.pnpm-debug.log*
|
10 |
+
|
11 |
+
# Diagnostic reports (https://nodejs.org/api/report.html)
|
12 |
+
|
13 |
+
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
|
14 |
+
|
15 |
+
# Runtime data
|
16 |
+
|
17 |
+
pids
|
18 |
+
_.pid
|
19 |
+
_.seed
|
20 |
+
\*.pid.lock
|
21 |
+
|
22 |
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
23 |
+
|
24 |
+
lib-cov
|
25 |
+
|
26 |
+
# Coverage directory used by tools like istanbul
|
27 |
+
|
28 |
+
coverage
|
29 |
+
\*.lcov
|
30 |
+
|
31 |
+
# nyc test coverage
|
32 |
+
|
33 |
+
.nyc_output
|
34 |
+
|
35 |
+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
36 |
+
|
37 |
+
.grunt
|
38 |
+
|
39 |
+
# Bower dependency directory (https://bower.io/)
|
40 |
+
|
41 |
+
bower_components
|
42 |
+
|
43 |
+
# node-waf configuration
|
44 |
+
|
45 |
+
.lock-wscript
|
46 |
+
|
47 |
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
48 |
+
|
49 |
+
build/Release
|
50 |
+
|
51 |
+
# Dependency directories
|
52 |
+
|
53 |
+
node_modules/
|
54 |
+
jspm_packages/
|
55 |
+
|
56 |
+
# Snowpack dependency directory (https://snowpack.dev/)
|
57 |
+
|
58 |
+
web_modules/
|
59 |
+
|
60 |
+
# TypeScript cache
|
61 |
+
|
62 |
+
\*.tsbuildinfo
|
63 |
+
|
64 |
+
# Optional npm cache directory
|
65 |
+
|
66 |
+
.npm
|
67 |
+
|
68 |
+
# Optional eslint cache
|
69 |
+
|
70 |
+
.eslintcache
|
71 |
+
|
72 |
+
# Optional stylelint cache
|
73 |
+
|
74 |
+
.stylelintcache
|
75 |
+
|
76 |
+
# Microbundle cache
|
77 |
+
|
78 |
+
.rpt2_cache/
|
79 |
+
.rts2_cache_cjs/
|
80 |
+
.rts2_cache_es/
|
81 |
+
.rts2_cache_umd/
|
82 |
+
|
83 |
+
# Optional REPL history
|
84 |
+
|
85 |
+
.node_repl_history
|
86 |
+
|
87 |
+
# Output of 'npm pack'
|
88 |
+
|
89 |
+
\*.tgz
|
90 |
+
|
91 |
+
# Yarn Integrity file
|
92 |
+
|
93 |
+
.yarn-integrity
|
94 |
+
|
95 |
+
# dotenv environment variable files
|
96 |
+
|
97 |
+
.env
|
98 |
+
.env.development.local
|
99 |
+
.env.test.local
|
100 |
+
.env.production.local
|
101 |
+
.env.local
|
102 |
+
|
103 |
+
# parcel-bundler cache (https://parceljs.org/)
|
104 |
+
|
105 |
+
.cache
|
106 |
+
.parcel-cache
|
107 |
+
|
108 |
+
# Next.js build output
|
109 |
+
|
110 |
+
.next
|
111 |
+
out
|
112 |
+
|
113 |
+
# Nuxt.js build / generate output
|
114 |
+
|
115 |
+
.nuxt
|
116 |
+
dist
|
117 |
+
|
118 |
+
# Gatsby files
|
119 |
+
|
120 |
+
.cache/
|
121 |
+
|
122 |
+
# Comment in the public line in if your project uses Gatsby and not Next.js
|
123 |
+
|
124 |
+
# https://nextjs.org/blog/next-9-1#public-directory-support
|
125 |
+
|
126 |
+
# public
|
127 |
+
|
128 |
+
# vuepress build output
|
129 |
+
|
130 |
+
.vuepress/dist
|
131 |
+
|
132 |
+
# vuepress v2.x temp and cache directory
|
133 |
+
|
134 |
+
.temp
|
135 |
+
.cache
|
136 |
+
|
137 |
+
# Docusaurus cache and generated files
|
138 |
+
|
139 |
+
.docusaurus
|
140 |
+
|
141 |
+
# Serverless directories
|
142 |
+
|
143 |
+
.serverless/
|
144 |
+
|
145 |
+
# FuseBox cache
|
146 |
+
|
147 |
+
.fusebox/
|
148 |
+
|
149 |
+
# DynamoDB Local files
|
150 |
+
|
151 |
+
.dynamodb/
|
152 |
+
|
153 |
+
# TernJS port file
|
154 |
+
|
155 |
+
.tern-port
|
156 |
+
|
157 |
+
# Stores VSCode versions used for testing VSCode extensions
|
158 |
+
|
159 |
+
.vscode-test
|
160 |
+
|
161 |
+
# yarn v2
|
162 |
+
|
163 |
+
.yarn/cache
|
164 |
+
.yarn/unplugged
|
165 |
+
.yarn/build-state.yml
|
166 |
+
.yarn/install-state.gz
|
167 |
+
.pnp.\*
|
168 |
+
|
169 |
+
# wrangler project
|
170 |
+
|
171 |
+
.dev.vars
|
172 |
+
.wrangler/
|
workers1/Autovideos-worker/shy-hill-f5c2/.prettierrc
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"printWidth": 140,
|
3 |
+
"singleQuote": true,
|
4 |
+
"semi": true,
|
5 |
+
"useTabs": true
|
6 |
+
}
|
workers1/Autovideos-worker/shy-hill-f5c2/.wrangler/tmp/bundle-TEgwOG/checked-fetch.js
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const urls = new Set();
|
2 |
+
|
3 |
+
function checkURL(request, init) {
|
4 |
+
const url =
|
5 |
+
request instanceof URL
|
6 |
+
? request
|
7 |
+
: new URL(
|
8 |
+
(typeof request === "string"
|
9 |
+
? new Request(request, init)
|
10 |
+
: request
|
11 |
+
).url
|
12 |
+
);
|
13 |
+
if (url.port && url.port !== "443" && url.protocol === "https:") {
|
14 |
+
if (!urls.has(url.toString())) {
|
15 |
+
urls.add(url.toString());
|
16 |
+
console.warn(
|
17 |
+
`WARNING: known issue with \`fetch()\` requests to custom HTTPS ports in published Workers:\n` +
|
18 |
+
` - ${url.toString()} - the custom port will be ignored when the Worker is published using the \`wrangler deploy\` command.\n`
|
19 |
+
);
|
20 |
+
}
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
globalThis.fetch = new Proxy(globalThis.fetch, {
|
25 |
+
apply(target, thisArg, argArray) {
|
26 |
+
const [request, init] = argArray;
|
27 |
+
checkURL(request, init);
|
28 |
+
return Reflect.apply(target, thisArg, argArray);
|
29 |
+
},
|
30 |
+
});
|
workers1/Autovideos-worker/shy-hill-f5c2/.wrangler/tmp/bundle-TEgwOG/middleware-insertion-facade.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { __facade_registerInternal__ } from "/Users/samihalawa/git/BACKUP_WORKERS/Autovideos-worker/shy-hill-f5c2/node_modules/wrangler/templates/middleware/loader-sw.ts";
|
2 |
+
import * as __MIDDLEWARE_0__ from "/Users/samihalawa/git/BACKUP_WORKERS/Autovideos-worker/shy-hill-f5c2/node_modules/wrangler/templates/middleware/middleware-ensure-req-body-drained.ts";
|
3 |
+
import * as __MIDDLEWARE_1__ from "/Users/samihalawa/git/BACKUP_WORKERS/Autovideos-worker/shy-hill-f5c2/node_modules/wrangler/templates/middleware/middleware-miniflare3-json-error.ts";
|
4 |
+
__facade_registerInternal__([__MIDDLEWARE_0__.default,__MIDDLEWARE_1__.default])
|
workers1/Autovideos-worker/shy-hill-f5c2/.wrangler/tmp/dev-jXtU1l/index.js
ADDED
@@ -0,0 +1,543 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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anceof URL ? request : new URL(
|
7 |
+
(typeof request === "string" ? new Request(request, init) : request).url
|
8 |
+
);
|
9 |
+
if (url.port && url.port !== "443" && url.protocol === "https:") {
|
10 |
+
if (!urls.has(url.toString())) {
|
11 |
+
urls.add(url.toString());
|
12 |
+
console.warn(
|
13 |
+
`WARNING: known issue with \`fetch()\` requests to custom HTTPS ports in published Workers:
|
14 |
+
- ${url.toString()} - the custom port will be ignored when the Worker is published using the \`wrangler deploy\` command.
|
15 |
+
`
|
16 |
+
);
|
17 |
+
}
|
18 |
+
}
|
19 |
+
}
|
20 |
+
globalThis.fetch = new Proxy(globalThis.fetch, {
|
21 |
+
apply(target, thisArg, argArray) {
|
22 |
+
const [request, init] = argArray;
|
23 |
+
checkURL(request, init);
|
24 |
+
return Reflect.apply(target, thisArg, argArray);
|
25 |
+
}
|
26 |
+
});
|
27 |
+
|
28 |
+
// node_modules/wrangler/templates/middleware/common.ts
|
29 |
+
var __facade_middleware__ = [];
|
30 |
+
function __facade_register__(...args) {
|
31 |
+
__facade_middleware__.push(...args.flat());
|
32 |
+
}
|
33 |
+
function __facade_registerInternal__(...args) {
|
34 |
+
__facade_middleware__.unshift(...args.flat());
|
35 |
+
}
|
36 |
+
function __facade_invokeChain__(request, env, ctx, dispatch, middlewareChain) {
|
37 |
+
const [head, ...tail] = middlewareChain;
|
38 |
+
const middlewareCtx = {
|
39 |
+
dispatch,
|
40 |
+
next(newRequest, newEnv) {
|
41 |
+
return __facade_invokeChain__(newRequest, newEnv, ctx, dispatch, tail);
|
42 |
+
}
|
43 |
+
};
|
44 |
+
return head(request, env, ctx, middlewareCtx);
|
45 |
+
}
|
46 |
+
function __facade_invoke__(request, env, ctx, dispatch, finalMiddleware) {
|
47 |
+
return __facade_invokeChain__(request, env, ctx, dispatch, [
|
48 |
+
...__facade_middleware__,
|
49 |
+
finalMiddleware
|
50 |
+
]);
|
51 |
+
}
|
52 |
+
|
53 |
+
// node_modules/wrangler/templates/middleware/loader-sw.ts
|
54 |
+
var __FACADE_EVENT_TARGET__;
|
55 |
+
if (globalThis.MINIFLARE) {
|
56 |
+
__FACADE_EVENT_TARGET__ = new (Object.getPrototypeOf(WorkerGlobalScope))();
|
57 |
+
} else {
|
58 |
+
__FACADE_EVENT_TARGET__ = new EventTarget();
|
59 |
+
}
|
60 |
+
function __facade_isSpecialEvent__(type) {
|
61 |
+
return type === "fetch" || type === "scheduled";
|
62 |
+
}
|
63 |
+
var __facade__originalAddEventListener__ = globalThis.addEventListener;
|
64 |
+
var __facade__originalRemoveEventListener__ = globalThis.removeEventListener;
|
65 |
+
var __facade__originalDispatchEvent__ = globalThis.dispatchEvent;
|
66 |
+
globalThis.addEventListener = function(type, listener, options) {
|
67 |
+
if (__facade_isSpecialEvent__(type)) {
|
68 |
+
__FACADE_EVENT_TARGET__.addEventListener(
|
69 |
+
type,
|
70 |
+
listener,
|
71 |
+
options
|
72 |
+
);
|
73 |
+
} else {
|
74 |
+
__facade__originalAddEventListener__(type, listener, options);
|
75 |
+
}
|
76 |
+
};
|
77 |
+
globalThis.removeEventListener = function(type, listener, options) {
|
78 |
+
if (__facade_isSpecialEvent__(type)) {
|
79 |
+
__FACADE_EVENT_TARGET__.removeEventListener(
|
80 |
+
type,
|
81 |
+
listener,
|
82 |
+
options
|
83 |
+
);
|
84 |
+
} else {
|
85 |
+
__facade__originalRemoveEventListener__(type, listener, options);
|
86 |
+
}
|
87 |
+
};
|
88 |
+
globalThis.dispatchEvent = function(event) {
|
89 |
+
if (__facade_isSpecialEvent__(event.type)) {
|
90 |
+
return __FACADE_EVENT_TARGET__.dispatchEvent(event);
|
91 |
+
} else {
|
92 |
+
return __facade__originalDispatchEvent__(event);
|
93 |
+
}
|
94 |
+
};
|
95 |
+
globalThis.addMiddleware = __facade_register__;
|
96 |
+
globalThis.addMiddlewareInternal = __facade_registerInternal__;
|
97 |
+
var __facade_waitUntil__ = Symbol("__facade_waitUntil__");
|
98 |
+
var __facade_response__ = Symbol("__facade_response__");
|
99 |
+
var __facade_dispatched__ = Symbol("__facade_dispatched__");
|
100 |
+
var __Facade_ExtendableEvent__ = class extends Event {
|
101 |
+
[__facade_waitUntil__] = [];
|
102 |
+
waitUntil(promise) {
|
103 |
+
if (!(this instanceof __Facade_ExtendableEvent__)) {
|
104 |
+
throw new TypeError("Illegal invocation");
|
105 |
+
}
|
106 |
+
this[__facade_waitUntil__].push(promise);
|
107 |
+
}
|
108 |
+
};
|
109 |
+
var __Facade_FetchEvent__ = class extends __Facade_ExtendableEvent__ {
|
110 |
+
#request;
|
111 |
+
#passThroughOnException;
|
112 |
+
[__facade_response__];
|
113 |
+
[__facade_dispatched__] = false;
|
114 |
+
constructor(type, init) {
|
115 |
+
super(type);
|
116 |
+
this.#request = init.request;
|
117 |
+
this.#passThroughOnException = init.passThroughOnException;
|
118 |
+
}
|
119 |
+
get request() {
|
120 |
+
return this.#request;
|
121 |
+
}
|
122 |
+
respondWith(response) {
|
123 |
+
if (!(this instanceof __Facade_FetchEvent__)) {
|
124 |
+
throw new TypeError("Illegal invocation");
|
125 |
+
}
|
126 |
+
if (this[__facade_response__] !== void 0) {
|
127 |
+
throw new DOMException(
|
128 |
+
"FetchEvent.respondWith() has already been called; it can only be called once.",
|
129 |
+
"InvalidStateError"
|
130 |
+
);
|
131 |
+
}
|
132 |
+
if (this[__facade_dispatched__]) {
|
133 |
+
throw new DOMException(
|
134 |
+
"Too late to call FetchEvent.respondWith(). It must be called synchronously in the event handler.",
|
135 |
+
"InvalidStateError"
|
136 |
+
);
|
137 |
+
}
|
138 |
+
this.stopImmediatePropagation();
|
139 |
+
this[__facade_response__] = response;
|
140 |
+
}
|
141 |
+
passThroughOnException() {
|
142 |
+
if (!(this instanceof __Facade_FetchEvent__)) {
|
143 |
+
throw new TypeError("Illegal invocation");
|
144 |
+
}
|
145 |
+
this.#passThroughOnException();
|
146 |
+
}
|
147 |
+
};
|
148 |
+
var __Facade_ScheduledEvent__ = class extends __Facade_ExtendableEvent__ {
|
149 |
+
#scheduledTime;
|
150 |
+
#cron;
|
151 |
+
#noRetry;
|
152 |
+
constructor(type, init) {
|
153 |
+
super(type);
|
154 |
+
this.#scheduledTime = init.scheduledTime;
|
155 |
+
this.#cron = init.cron;
|
156 |
+
this.#noRetry = init.noRetry;
|
157 |
+
}
|
158 |
+
get scheduledTime() {
|
159 |
+
return this.#scheduledTime;
|
160 |
+
}
|
161 |
+
get cron() {
|
162 |
+
return this.#cron;
|
163 |
+
}
|
164 |
+
noRetry() {
|
165 |
+
if (!(this instanceof __Facade_ScheduledEvent__)) {
|
166 |
+
throw new TypeError("Illegal invocation");
|
167 |
+
}
|
168 |
+
this.#noRetry();
|
169 |
+
}
|
170 |
+
};
|
171 |
+
__facade__originalAddEventListener__("fetch", (event) => {
|
172 |
+
const ctx = {
|
173 |
+
waitUntil: event.waitUntil.bind(event),
|
174 |
+
passThroughOnException: event.passThroughOnException.bind(event)
|
175 |
+
};
|
176 |
+
const __facade_sw_dispatch__ = function(type, init) {
|
177 |
+
if (type === "scheduled") {
|
178 |
+
const facadeEvent = new __Facade_ScheduledEvent__("scheduled", {
|
179 |
+
scheduledTime: Date.now(),
|
180 |
+
cron: init.cron ?? "",
|
181 |
+
noRetry() {
|
182 |
+
}
|
183 |
+
});
|
184 |
+
__FACADE_EVENT_TARGET__.dispatchEvent(facadeEvent);
|
185 |
+
event.waitUntil(Promise.all(facadeEvent[__facade_waitUntil__]));
|
186 |
+
}
|
187 |
+
};
|
188 |
+
const __facade_sw_fetch__ = function(request, _env, ctx2) {
|
189 |
+
const facadeEvent = new __Facade_FetchEvent__("fetch", {
|
190 |
+
request,
|
191 |
+
passThroughOnException: ctx2.passThroughOnException
|
192 |
+
});
|
193 |
+
__FACADE_EVENT_TARGET__.dispatchEvent(facadeEvent);
|
194 |
+
facadeEvent[__facade_dispatched__] = true;
|
195 |
+
event.waitUntil(Promise.all(facadeEvent[__facade_waitUntil__]));
|
196 |
+
const response = facadeEvent[__facade_response__];
|
197 |
+
if (response === void 0) {
|
198 |
+
throw new Error("No response!");
|
199 |
+
}
|
200 |
+
return response;
|
201 |
+
};
|
202 |
+
event.respondWith(
|
203 |
+
__facade_invoke__(
|
204 |
+
event.request,
|
205 |
+
globalThis,
|
206 |
+
ctx,
|
207 |
+
__facade_sw_dispatch__,
|
208 |
+
__facade_sw_fetch__
|
209 |
+
)
|
210 |
+
);
|
211 |
+
});
|
212 |
+
__facade__originalAddEventListener__("scheduled", (event) => {
|
213 |
+
const facadeEvent = new __Facade_ScheduledEvent__("scheduled", {
|
214 |
+
scheduledTime: event.scheduledTime,
|
215 |
+
cron: event.cron,
|
216 |
+
noRetry: event.noRetry.bind(event)
|
217 |
+
});
|
218 |
+
__FACADE_EVENT_TARGET__.dispatchEvent(facadeEvent);
|
219 |
+
event.waitUntil(Promise.all(facadeEvent[__facade_waitUntil__]));
|
220 |
+
});
|
221 |
+
|
222 |
+
// node_modules/wrangler/templates/middleware/middleware-ensure-req-body-drained.ts
|
223 |
+
var drainBody = async (request, env, _ctx, middlewareCtx) => {
|
224 |
+
try {
|
225 |
+
return await middlewareCtx.next(request, env);
|
226 |
+
} finally {
|
227 |
+
try {
|
228 |
+
if (request.body !== null && !request.bodyUsed) {
|
229 |
+
const reader = request.body.getReader();
|
230 |
+
while (!(await reader.read()).done) {
|
231 |
+
}
|
232 |
+
}
|
233 |
+
} catch (e) {
|
234 |
+
console.error("Failed to drain the unused request body.", e);
|
235 |
+
}
|
236 |
+
}
|
237 |
+
};
|
238 |
+
var middleware_ensure_req_body_drained_default = drainBody;
|
239 |
+
|
240 |
+
// node_modules/wrangler/templates/middleware/middleware-miniflare3-json-error.ts
|
241 |
+
function reduceError(e) {
|
242 |
+
return {
|
243 |
+
name: e?.name,
|
244 |
+
message: e?.message ?? String(e),
|
245 |
+
stack: e?.stack,
|
246 |
+
cause: e?.cause === void 0 ? void 0 : reduceError(e.cause)
|
247 |
+
};
|
248 |
+
}
|
249 |
+
var jsonError = async (request, env, _ctx, middlewareCtx) => {
|
250 |
+
try {
|
251 |
+
return await middlewareCtx.next(request, env);
|
252 |
+
} catch (e) {
|
253 |
+
const error = reduceError(e);
|
254 |
+
return Response.json(error, {
|
255 |
+
status: 500,
|
256 |
+
headers: { "MF-Experimental-Error-Stack": "true" }
|
257 |
+
});
|
258 |
+
}
|
259 |
+
};
|
260 |
+
var middleware_miniflare3_json_error_default = jsonError;
|
261 |
+
|
262 |
+
// .wrangler/tmp/bundle-TEgwOG/middleware-insertion-facade.js
|
263 |
+
__facade_registerInternal__([middleware_ensure_req_body_drained_default, middleware_miniflare3_json_error_default]);
|
264 |
+
|
265 |
+
// src/renderHtml.js
|
266 |
+
async function renderHtml() {
|
267 |
+
return `
|
268 |
+
<!DOCTYPE html>
|
269 |
+
<html lang="en">
|
270 |
+
<head>
|
271 |
+
<meta charset="UTF-8">
|
272 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
273 |
+
<title>Melinda AI - Create Video Presentations</title>
|
274 |
+
<!-- Tailwind CSS -->
|
275 |
+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
|
276 |
+
<!-- Swiper CSS -->
|
277 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.css" />
|
278 |
+
<!-- Animate.css -->
|
279 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"/>
|
280 |
+
<!-- Prism.js for Code Highlighting -->
|
281 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism.min.css" />
|
282 |
+
<style>
|
283 |
+
body { font-family: 'Roboto', sans-serif; background-color: #f0f4f8; overflow-x: hidden; }
|
284 |
+
.hero { background: url('https://images.unsplash.com/photo-1522202176988-66273c2fd55f?auto=format&fit=crop&w=1500&q=80') center/cover; color: #fff; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
|
285 |
+
.overlay { background: rgba(0,0,0,0.6); padding: 60px 30px; border-radius: 10px; }
|
286 |
+
.video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 800px; }
|
287 |
+
.video-container iframe { position: absolute; top:0; left:0; width:100%; height:100%; }
|
288 |
+
pre { background: #f7fafc; padding: 15px; border-radius: 5px; overflow-x: auto; max-width: 800px; }
|
289 |
+
/* Loader Styles */
|
290 |
+
.loader {
|
291 |
+
border: 8px solid #f3f3f3;
|
292 |
+
border-top: 8px solid #3498db;
|
293 |
+
border-radius: 50%;
|
294 |
+
width: 60px;
|
295 |
+
height: 60px;
|
296 |
+
animation: spin 2s linear infinite;
|
297 |
+
margin: auto;
|
298 |
+
}
|
299 |
+
@keyframes spin {
|
300 |
+
0% { transform: rotate(0deg); }
|
301 |
+
100% { transform: rotate(360deg); }
|
302 |
+
}
|
303 |
+
</style>
|
304 |
+
</head>
|
305 |
+
<body>
|
306 |
+
<!-- Hero Section -->
|
307 |
+
<section class="hero">
|
308 |
+
<div class="overlay text-center">
|
309 |
+
<h1 class="text-5xl font-bold mb-6">Melinda AI</h1>
|
310 |
+
<p class="text-xl mb-8">Create stunning video presentations effortlessly.</p>
|
311 |
+
<div class="flex flex-col md:flex-row justify-center items-center gap-4">
|
312 |
+
<input type="text" id="prompt" class="w-full md:w-2/3 p-3 rounded-lg border focus:outline-none focus:border-blue-500" placeholder="Enter presentation topic">
|
313 |
+
<button onclick="generateSlides()" class="bg-blue-500 text-white px-6 py-3 rounded-lg">Create Presentation</button>
|
314 |
+
</div>
|
315 |
+
<div id="loader" class="mt-6"></div>
|
316 |
+
<div id="error" class="mt-4 text-lg text-red-500"></div>
|
317 |
+
</div>
|
318 |
+
</section>
|
319 |
+
|
320 |
+
<!-- Presentation Container -->
|
321 |
+
<div class="max-w-4xl mx-auto mt-10 hidden" id="presentation">
|
322 |
+
<!-- Swiper -->
|
323 |
+
<div class="swiper mySwiper">
|
324 |
+
<div class="swiper-wrapper" id="swiper-wrapper"></div>
|
325 |
+
<div class="swiper-pagination"></div>
|
326 |
+
</div>
|
327 |
+
<!-- Progress Bar -->
|
328 |
+
<div class="w-full bg-gray-200 h-1 mt-4">
|
329 |
+
<div id="progress-bar" class="bg-blue-500 h-1 transition-all duration-700"></div>
|
330 |
+
</div>
|
331 |
+
<!-- Controls -->
|
332 |
+
<div class="flex justify-center gap-4 mt-4">
|
333 |
+
<button onclick="pauseSlides()" class="bg-yellow-500 text-white px-4 py-2 rounded">Pause</button>
|
334 |
+
<button onclick="playSlides()" class="bg-green-500 text-white px-4 py-2 rounded">Play</button>
|
335 |
+
<button onclick="toggleFullscreen()" class="bg-blue-500 text-white px-4 py-2 rounded">Fullscreen</button>
|
336 |
+
<button onclick="toggleMusic()" class="bg-pink-500 text-white px-4 py-2 rounded">Play Music</button>
|
337 |
+
<button onclick="exportVideo()" class="bg-teal-500 text-white px-4 py-2 rounded">Export Video</button>
|
338 |
+
</div>
|
339 |
+
<!-- Background Music -->
|
340 |
+
<audio id="background-music" loop>
|
341 |
+
<source src="https://www.bensound.com/bensound-music/bensound-sunny.mp3" type="audio/mpeg">
|
342 |
+
</audio>
|
343 |
+
</div>
|
344 |
+
|
345 |
+
<!-- Scripts -->
|
346 |
+
<script src="https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.js"><\/script>
|
347 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js"><\/script>
|
348 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-javascript.min.js"><\/script>
|
349 |
+
<script>
|
350 |
+
let swiper;
|
351 |
+
let mediaRecorder, recordedChunks = [];
|
352 |
+
|
353 |
+
async function generateSlides() {
|
354 |
+
const prompt = document.getElementById('prompt').value.trim();
|
355 |
+
if (!prompt) { alert('Please enter a topic to generate the presentation.'); return; }
|
356 |
+
document.getElementById('loader').innerHTML = '<div class="loader"></div>';
|
357 |
+
|
358 |
+
try {
|
359 |
+
const res = await fetch('/generate?prompt=' + encodeURIComponent(prompt));
|
360 |
+
if (!res.ok) throw new Error('Failed to fetch slides.');
|
361 |
+
const data = await res.json();
|
362 |
+
renderSlides(data.slides);
|
363 |
+
document.getElementById('presentation').classList.remove('hidden');
|
364 |
+
document.getElementById('loader').innerHTML = '';
|
365 |
+
} catch (err) {
|
366 |
+
document.getElementById('error').textContent = err.message;
|
367 |
+
document.getElementById('loader').innerHTML = '';
|
368 |
+
}
|
369 |
+
}
|
370 |
+
|
371 |
+
function renderSlides(slides) {
|
372 |
+
const wrapper = document.getElementById('swiper-wrapper');
|
373 |
+
wrapper.innerHTML = '';
|
374 |
+
slides.forEach(slide => {
|
375 |
+
const slideEl = document.createElement('div');
|
376 |
+
slideEl.classList.add('swiper-slide', 'animate__animated', 'animate__' + (slide.animation || 'fadeIn'));
|
377 |
+
let html = '';
|
378 |
+
if (slide.imageUrl) html += '<img src="' + slide.imageUrl + '" alt="Slide Image" class="w-full h-auto mb-4">';
|
379 |
+
if (slide.videoUrl) html += '<div class="video-container mb-4">
|
380 |
+
<iframe src="' + slide.videoUrl + '" allowfullscreen></iframe>
|
381 |
+
</div>';
|
382 |
+
if (slide.heading) html += '<h2 class="text-3xl font-bold my-4">' + sanitize(slide.heading) + '</h2>';
|
383 |
+
if (slide.content) html += '<p class="text-lg mb-4">' + sanitize(slide.content).replace(/
|
384 |
+
/g, '<br>') + '</p>';
|
385 |
+
if (slide.codeSnippet) html += '<pre><code class="language-javascript">' + sanitize(slide.codeSnippet) + '</code></pre>';
|
386 |
+
slideEl.innerHTML = html;
|
387 |
+
wrapper.appendChild(slideEl);
|
388 |
+
});
|
389 |
+
if (swiper) { swiper.update(); swiper.autoplay.start(); }
|
390 |
+
else {
|
391 |
+
swiper = new Swiper('.mySwiper', {
|
392 |
+
pagination: { el: '.swiper-pagination', clickable: true },
|
393 |
+
autoplay: { delay: 7000, disableOnInteraction: false },
|
394 |
+
loop: true,
|
395 |
+
effect: 'fade',
|
396 |
+
fadeEffect: { crossFade: true },
|
397 |
+
keyboard: { enabled: true },
|
398 |
+
on: {
|
399 |
+
slideChangeTransitionStart: () => { document.getElementById('progress-bar').style.width = '0%'; },
|
400 |
+
slideChangeTransitionEnd: () => { document.getElementById('progress-bar').style.width = '100%'; },
|
401 |
+
},
|
402 |
+
});
|
403 |
+
}
|
404 |
+
Prism.highlightAll();
|
405 |
+
}
|
406 |
+
|
407 |
+
function sanitize(str) {
|
408 |
+
return str.replace(/[&<>"'/]/g, m => ({ '&':'&', '<':'<', '>':'>', '"':'"', "'":''', '/':'/' })[m]);
|
409 |
+
}
|
410 |
+
|
411 |
+
function pauseSlides() { if (swiper) swiper.autoplay.stop(); }
|
412 |
+
function playSlides() { if (swiper) swiper.autoplay.start(); }
|
413 |
+
function toggleFullscreen() {
|
414 |
+
const el = document.getElementById('presentation');
|
415 |
+
if (!document.fullscreenElement) {
|
416 |
+
el.requestFullscreen().catch(err => alert('Error attempting to enable fullscreen mode: ' + err.message));
|
417 |
+
} else {
|
418 |
+
document.exitFullscreen();
|
419 |
+
}
|
420 |
+
}
|
421 |
+
function toggleMusic() {
|
422 |
+
const music = document.getElementById('background-music');
|
423 |
+
const btn = document.querySelector('button[onclick="toggleMusic()"]');
|
424 |
+
if (music.paused) {
|
425 |
+
music.play();
|
426 |
+
btn.textContent = 'Pause Music';
|
427 |
+
} else {
|
428 |
+
music.pause();
|
429 |
+
btn.textContent = 'Play Music';
|
430 |
+
}
|
431 |
+
}
|
432 |
+
|
433 |
+
async function exportVideo() {
|
434 |
+
if (!navigator.mediaDevices.getDisplayMedia) { alert('MediaRecorder API is not supported in your browser.'); return; }
|
435 |
+
const presentation = document.getElementById('presentation');
|
436 |
+
try {
|
437 |
+
const stream = presentation.captureStream(30); // 30 FPS
|
438 |
+
mediaRecorder = new MediaRecorder(stream, { mimeType: 'video/webm' });
|
439 |
+
mediaRecorder.ondataavailable = e => { if (e.data.size > 0) recordedChunks.push(e.data); };
|
440 |
+
mediaRecorder.onstop = () => {
|
441 |
+
const blob = new Blob(recordedChunks, { type: 'video/webm' });
|
442 |
+
const url = URL.createObjectURL(blob);
|
443 |
+
const a = document.createElement('a');
|
444 |
+
a.href = url;
|
445 |
+
a.download = 'presentation.webm';
|
446 |
+
a.click();
|
447 |
+
URL.revokeObjectURL(url);
|
448 |
+
recordedChunks = [];
|
449 |
+
};
|
450 |
+
mediaRecorder.start();
|
451 |
+
setTimeout(() => mediaRecorder.stop(), slidesLength() * 7000 + 1000);
|
452 |
+
} catch (err) {
|
453 |
+
alert('Error exporting video: ' + err.message);
|
454 |
+
}
|
455 |
+
}
|
456 |
+
|
457 |
+
function slidesLength() {
|
458 |
+
return document.querySelectorAll('.swiper-slide').length;
|
459 |
+
}
|
460 |
+
<\/script>
|
461 |
+
</body>
|
462 |
+
</html>
|
463 |
+
`;
|
464 |
+
}
|
465 |
+
|
466 |
+
// src/index.js
|
467 |
+
addEventListener("fetch", (event) => {
|
468 |
+
event.respondWith(handleRequest(event.request));
|
469 |
+
});
|
470 |
+
async function handleRequest(request) {
|
471 |
+
const { pathname } = new URL(request.url);
|
472 |
+
if (pathname === "/") {
|
473 |
+
const html = await renderHtml();
|
474 |
+
return new Response(html, { headers: { "Content-Type": "text/html;charset=UTF-8" } });
|
475 |
+
} else if (pathname === "/generate") {
|
476 |
+
return new Response(JSON.stringify(getSlides()), {
|
477 |
+
headers: { "Content-Type": "application/json" }
|
478 |
+
});
|
479 |
+
} else {
|
480 |
+
return new Response("Not Found", { status: 404 });
|
481 |
+
}
|
482 |
+
}
|
483 |
+
function getSlides() {
|
484 |
+
return {
|
485 |
+
slides: [
|
486 |
+
{
|
487 |
+
heading: "Welcome to Melinda AI",
|
488 |
+
content: "Create stunning video presentations effortlessly.",
|
489 |
+
imageUrl: "https://source.unsplash.com/1600x900/?presentation",
|
490 |
+
videoUrl: "https://www.youtube.com/embed/dQw4w9WgXcQ",
|
491 |
+
animation: "fadeIn",
|
492 |
+
codeSnippet: "function greet(name) {\n return `Hello, ${name}!`;\n}",
|
493 |
+
speakerNotes: "Introduce Melinda AI and its capabilities.",
|
494 |
+
theme: "default",
|
495 |
+
languages: ["en"]
|
496 |
+
},
|
497 |
+
{
|
498 |
+
heading: "Smooth Transitions",
|
499 |
+
content: "Experience seamless transitions with cinematic effects.",
|
500 |
+
imageUrl: "https://source.unsplash.com/1600x900/?animation",
|
501 |
+
animation: "slideInUp",
|
502 |
+
codeSnippet: 'gsap.from(".slide-heading", { duration: 2, y: -50, opacity: 0 });',
|
503 |
+
speakerNotes: "Demonstrate animation improvements.",
|
504 |
+
theme: "dark",
|
505 |
+
languages: ["en"]
|
506 |
+
},
|
507 |
+
{
|
508 |
+
heading: "Interactive Elements",
|
509 |
+
content: "Engage your audience with interactive buttons and polls.",
|
510 |
+
imageUrl: "https://source.unsplash.com/1600x900/?interactive",
|
511 |
+
animation: "zoomIn",
|
512 |
+
codeSnippet: '<button onclick="startPoll()" class="bg-green-500 text-white px-4 py-2 rounded">Start Poll</button>',
|
513 |
+
speakerNotes: "Explain benefits of interactivity.",
|
514 |
+
theme: "light",
|
515 |
+
languages: ["en"]
|
516 |
+
},
|
517 |
+
{
|
518 |
+
heading: "Multimedia Integration",
|
519 |
+
content: "Incorporate videos and images seamlessly into your presentations.",
|
520 |
+
imageUrl: "https://source.unsplash.com/1600x900/?multimedia",
|
521 |
+
videoUrl: "https://www.youtube.com/embed/5NV6Rdv1a3I",
|
522 |
+
animation: "fadeIn",
|
523 |
+
codeSnippet: '<div class="video-container">\n <iframe src="https://www.youtube.com/embed/5NV6Rdv1a3I" allowfullscreen></iframe>\n</div>',
|
524 |
+
speakerNotes: "Highlight multimedia importance.",
|
525 |
+
theme: "default",
|
526 |
+
languages: ["en"]
|
527 |
+
},
|
528 |
+
{
|
529 |
+
heading: "Accessibility & Themes",
|
530 |
+
content: "Ensure your presentations are accessible with customizable themes.",
|
531 |
+
imageUrl: "https://source.unsplash.com/1600x900/?accessibility",
|
532 |
+
animation: "slideInUp",
|
533 |
+
codeSnippet: "body.theme-dark {\n background-color: #1a202c;\n color: #a0aec0;\n}",
|
534 |
+
speakerNotes: "Discuss accessibility features.",
|
535 |
+
theme: "dark",
|
536 |
+
languages: ["en"]
|
537 |
+
}
|
538 |
+
// Add more slides here to cover all desired features (up to 30)
|
539 |
+
]
|
540 |
+
};
|
541 |
+
}
|
542 |
+
})();
|
543 |
+
//# sourceMappingURL=index.js.map
|
workers1/Autovideos-worker/shy-hill-f5c2/.wrangler/tmp/dev-jXtU1l/index.js.map
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"version": 3,
|
3 |
+
"sources": ["../bundle-TEgwOG/checked-fetch.js", "../../../node_modules/wrangler/templates/middleware/common.ts", "../../../node_modules/wrangler/templates/middleware/loader-sw.ts", "../../../node_modules/wrangler/templates/middleware/middleware-ensure-req-body-drained.ts", "../../../node_modules/wrangler/templates/middleware/middleware-miniflare3-json-error.ts", "../bundle-TEgwOG/middleware-insertion-facade.js", "../../../src/renderHtml.js", "../../../src/index.js"],
|
4 |
+
"sourceRoot": "/Users/samihalawa/git/BACKUP_WORKERS/Autovideos-worker/shy-hill-f5c2/.wrangler/tmp/dev-jXtU1l",
|
5 |
+
"sourcesContent": ["const urls = new Set();\n\nfunction checkURL(request, init) {\n\tconst url =\n\t\trequest instanceof URL\n\t\t\t? request\n\t\t\t: new URL(\n\t\t\t\t\t(typeof request === \"string\"\n\t\t\t\t\t\t? new Request(request, init)\n\t\t\t\t\t\t: request\n\t\t\t\t\t).url\n\t\t\t\t);\n\tif (url.port && url.port !== \"443\" && url.protocol === \"https:\") {\n\t\tif (!urls.has(url.toString())) {\n\t\t\turls.add(url.toString());\n\t\t\tconsole.warn(\n\t\t\t\t`WARNING: known issue with \\`fetch()\\` requests to custom HTTPS ports in published Workers:\\n` +\n\t\t\t\t\t` - ${url.toString()} - the custom port will be ignored when the Worker is published using the \\`wrangler deploy\\` command.\\n`\n\t\t\t);\n\t\t}\n\t}\n}\n\nglobalThis.fetch = new Proxy(globalThis.fetch, {\n\tapply(target, thisArg, argArray) {\n\t\tconst [request, init] = argArray;\n\t\tcheckURL(request, init);\n\t\treturn Reflect.apply(target, thisArg, argArray);\n\t},\n});\n", "export type Awaitable<T> = T | Promise<T>;\n// TODO: allow dispatching more events?\nexport type Dispatcher = (\n\ttype: \"scheduled\",\n\tinit: { cron?: string }\n) => Awaitable<void>;\n\nexport type IncomingRequest = Request<\n\tunknown,\n\tIncomingRequestCfProperties<unknown>\n>;\n\nexport interface MiddlewareContext {\n\tdispatch: Dispatcher;\n\tnext(request: IncomingRequest, env: any): Awaitable<Response>;\n}\n\nexport type Middleware = (\n\trequest: IncomingRequest,\n\tenv: any,\n\tctx: ExecutionContext,\n\tmiddlewareCtx: MiddlewareContext\n) => Awaitable<Response>;\n\nconst __facade_middleware__: Middleware[] = [];\n\n// The register functions allow for the insertion of one or many middleware,\n// We register internal middleware first in the stack, but have no way of controlling\n// the order that addMiddleware is run in service workers so need an internal function.\nexport function __facade_register__(...args: (Middleware | Middleware[])[]) {\n\t__facade_middleware__.push(...args.flat());\n}\nexport function __facade_registerInternal__(\n\t...args: (Middleware | Middleware[])[]\n) {\n\t__facade_middleware__.unshift(...args.flat());\n}\n\nfunction __facade_invokeChain__(\n\trequest: IncomingRequest,\n\tenv: any,\n\tctx: ExecutionContext,\n\tdispatch: Dispatcher,\n\tmiddlewareChain: Middleware[]\n): Awaitable<Response> {\n\tconst [head, ...tail] = middlewareChain;\n\tconst middlewareCtx: MiddlewareContext = {\n\t\tdispatch,\n\t\tnext(newRequest, newEnv) {\n\t\t\treturn __facade_invokeChain__(newRequest, newEnv, ctx, dispatch, tail);\n\t\t},\n\t};\n\treturn head(request, env, ctx, middlewareCtx);\n}\n\nexport function __facade_invoke__(\n\trequest: IncomingRequest,\n\tenv: any,\n\tctx: ExecutionContext,\n\tdispatch: Dispatcher,\n\tfinalMiddleware: Middleware\n): Awaitable<Response> {\n\treturn __facade_invokeChain__(request, env, ctx, dispatch, [\n\t\t...__facade_middleware__,\n\t\tfinalMiddleware,\n\t]);\n}\n", "import {\n\t__facade_invoke__,\n\t__facade_register__,\n\t__facade_registerInternal__,\n\tAwaitable,\n\tDispatcher,\n\tIncomingRequest,\n\tMiddleware,\n} from \"./common\";\n\nexport { __facade_register__, __facade_registerInternal__ };\n\n// Miniflare 2's `EventTarget` follows the spec and doesn't allow exceptions to\n// be caught by `dispatchEvent`. Instead it has a custom `ThrowingEventTarget`\n// class that rethrows errors from event listeners in `dispatchEvent`.\n// We'd like errors to be propagated to the top-level `addEventListener`, so\n// we'd like to use `ThrowingEventTarget`. Unfortunately, `ThrowingEventTarget`\n// isn't exposed on the global scope, but `WorkerGlobalScope` (which extends\n// `ThrowingEventTarget`) is. Therefore, we get at it in this nasty way.\nlet __FACADE_EVENT_TARGET__: EventTarget;\nif ((globalThis as any).MINIFLARE) {\n\t__FACADE_EVENT_TARGET__ = new (Object.getPrototypeOf(WorkerGlobalScope))();\n} else {\n\t__FACADE_EVENT_TARGET__ = new EventTarget();\n}\n\nfunction __facade_isSpecialEvent__(\n\ttype: string\n): type is \"fetch\" | \"scheduled\" {\n\treturn type === \"fetch\" || type === \"scheduled\";\n}\nconst __facade__originalAddEventListener__ = globalThis.addEventListener;\nconst __facade__originalRemoveEventListener__ = globalThis.removeEventListener;\nconst __facade__originalDispatchEvent__ = globalThis.dispatchEvent;\n\nglobalThis.addEventListener = function (type, listener, options) {\n\tif (__facade_isSpecialEvent__(type)) {\n\t\t__FACADE_EVENT_TARGET__.addEventListener(\n\t\t\ttype,\n\t\t\tlistener as EventListenerOrEventListenerObject,\n\t\t\toptions\n\t\t);\n\t} else {\n\t\t__facade__originalAddEventListener__(type, listener, options);\n\t}\n};\nglobalThis.removeEventListener = function (type, listener, options) {\n\tif (__facade_isSpecialEvent__(type)) {\n\t\t__FACADE_EVENT_TARGET__.removeEventListener(\n\t\t\ttype,\n\t\t\tlistener as EventListenerOrEventListenerObject,\n\t\t\toptions\n\t\t);\n\t} else {\n\t\t__facade__originalRemoveEventListener__(type, listener, options);\n\t}\n};\nglobalThis.dispatchEvent = function (event) {\n\tif (__facade_isSpecialEvent__(event.type)) {\n\t\treturn __FACADE_EVENT_TARGET__.dispatchEvent(event);\n\t} else {\n\t\treturn __facade__originalDispatchEvent__(event);\n\t}\n};\n\ndeclare global {\n\tvar addMiddleware: typeof __facade_register__;\n\tvar addMiddlewareInternal: typeof __facade_registerInternal__;\n}\nglobalThis.addMiddleware = __facade_register__;\nglobalThis.addMiddlewareInternal = __facade_registerInternal__;\n\nconst __facade_waitUntil__ = Symbol(\"__facade_waitUntil__\");\nconst __facade_response__ = Symbol(\"__facade_response__\");\nconst __facade_dispatched__ = Symbol(\"__facade_dispatched__\");\n\nclass __Facade_ExtendableEvent__ extends Event {\n\t[__facade_waitUntil__]: Awaitable<unknown>[] = [];\n\n\twaitUntil(promise: Awaitable<any>) {\n\t\tif (!(this instanceof __Facade_ExtendableEvent__)) {\n\t\t\tthrow new TypeError(\"Illegal invocation\");\n\t\t}\n\t\tthis[__facade_waitUntil__].push(promise);\n\t}\n}\n\ninterface FetchEventInit extends EventInit {\n\trequest: Request;\n\tpassThroughOnException: FetchEvent[\"passThroughOnException\"];\n}\n\nclass __Facade_FetchEvent__ extends __Facade_ExtendableEvent__ {\n\t#request: Request;\n\t#passThroughOnException: FetchEvent[\"passThroughOnException\"];\n\t[__facade_response__]?: Awaitable<Response>;\n\t[__facade_dispatched__] = false;\n\n\tconstructor(type: \"fetch\", init: FetchEventInit) {\n\t\tsuper(type);\n\t\tthis.#request = init.request;\n\t\tthis.#passThroughOnException = init.passThroughOnException;\n\t}\n\n\tget request() {\n\t\treturn this.#request;\n\t}\n\n\trespondWith(response: Awaitable<Response>) {\n\t\tif (!(this instanceof __Facade_FetchEvent__)) {\n\t\t\tthrow new TypeError(\"Illegal invocation\");\n\t\t}\n\t\tif (this[__facade_response__] !== undefined) {\n\t\t\tthrow new DOMException(\n\t\t\t\t\"FetchEvent.respondWith() has already been called; it can only be called once.\",\n\t\t\t\t\"InvalidStateError\"\n\t\t\t);\n\t\t}\n\t\tif (this[__facade_dispatched__]) {\n\t\t\tthrow new DOMException(\n\t\t\t\t\"Too late to call FetchEvent.respondWith(). It must be called synchronously in the event handler.\",\n\t\t\t\t\"InvalidStateError\"\n\t\t\t);\n\t\t}\n\t\tthis.stopImmediatePropagation();\n\t\tthis[__facade_response__] = response;\n\t}\n\n\tpassThroughOnException() {\n\t\tif (!(this instanceof __Facade_FetchEvent__)) {\n\t\t\tthrow new TypeError(\"Illegal invocation\");\n\t\t}\n\t\t// Need to call native method immediately in case uncaught error thrown\n\t\tthis.#passThroughOnException();\n\t}\n}\n\ninterface ScheduledEventInit extends EventInit {\n\tscheduledTime: number;\n\tcron: string;\n\tnoRetry: ScheduledEvent[\"noRetry\"];\n}\n\nclass __Facade_ScheduledEvent__ extends __Facade_ExtendableEvent__ {\n\t#scheduledTime: number;\n\t#cron: string;\n\t#noRetry: ScheduledEvent[\"noRetry\"];\n\n\tconstructor(type: \"scheduled\", init: ScheduledEventInit) {\n\t\tsuper(type);\n\t\tthis.#scheduledTime = init.scheduledTime;\n\t\tthis.#cron = init.cron;\n\t\tthis.#noRetry = init.noRetry;\n\t}\n\n\tget scheduledTime() {\n\t\treturn this.#scheduledTime;\n\t}\n\n\tget cron() {\n\t\treturn this.#cron;\n\t}\n\n\tnoRetry() {\n\t\tif (!(this instanceof __Facade_ScheduledEvent__)) {\n\t\t\tthrow new TypeError(\"Illegal invocation\");\n\t\t}\n\t\t// Need to call native method immediately in case uncaught error thrown\n\t\tthis.#noRetry();\n\t}\n}\n\n__facade__originalAddEventListener__(\"fetch\", (event) => {\n\tconst ctx: ExecutionContext = {\n\t\twaitUntil: event.waitUntil.bind(event),\n\t\tpassThroughOnException: event.passThroughOnException.bind(event),\n\t};\n\n\tconst __facade_sw_dispatch__: Dispatcher = function (type, init) {\n\t\tif (type === \"scheduled\") {\n\t\t\tconst facadeEvent = new __Facade_ScheduledEvent__(\"scheduled\", {\n\t\t\t\tscheduledTime: Date.now(),\n\t\t\t\tcron: init.cron ?? \"\",\n\t\t\t\tnoRetry() {},\n\t\t\t});\n\n\t\t\t__FACADE_EVENT_TARGET__.dispatchEvent(facadeEvent);\n\t\t\tevent.waitUntil(Promise.all(facadeEvent[__facade_waitUntil__]));\n\t\t}\n\t};\n\n\tconst __facade_sw_fetch__: Middleware = function (request, _env, ctx) {\n\t\tconst facadeEvent = new __Facade_FetchEvent__(\"fetch\", {\n\t\t\trequest,\n\t\t\tpassThroughOnException: ctx.passThroughOnException,\n\t\t});\n\n\t\t__FACADE_EVENT_TARGET__.dispatchEvent(facadeEvent);\n\t\tfacadeEvent[__facade_dispatched__] = true;\n\t\tevent.waitUntil(Promise.all(facadeEvent[__facade_waitUntil__]));\n\n\t\tconst response = facadeEvent[__facade_response__];\n\t\tif (response === undefined) {\n\t\t\tthrow new Error(\"No response!\"); // TODO: proper error message\n\t\t}\n\t\treturn response;\n\t};\n\n\tevent.respondWith(\n\t\t__facade_invoke__(\n\t\t\tevent.request as IncomingRequest,\n\t\t\tglobalThis,\n\t\t\tctx,\n\t\t\t__facade_sw_dispatch__,\n\t\t\t__facade_sw_fetch__\n\t\t)\n\t);\n});\n\n__facade__originalAddEventListener__(\"scheduled\", (event) => {\n\tconst facadeEvent = new __Facade_ScheduledEvent__(\"scheduled\", {\n\t\tscheduledTime: event.scheduledTime,\n\t\tcron: event.cron,\n\t\tnoRetry: event.noRetry.bind(event),\n\t});\n\n\t__FACADE_EVENT_TARGET__.dispatchEvent(facadeEvent);\n\tevent.waitUntil(Promise.all(facadeEvent[__facade_waitUntil__]));\n});\n", "import type { Middleware } from \"./common\";\n\nconst drainBody: Middleware = async (request, env, _ctx, middlewareCtx) => {\n\ttry {\n\t\treturn await middlewareCtx.next(request, env);\n\t} finally {\n\t\ttry {\n\t\t\tif (request.body !== null && !request.bodyUsed) {\n\t\t\t\tconst reader = request.body.getReader();\n\t\t\t\twhile (!(await reader.read()).done) {}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(\"Failed to drain the unused request body.\", e);\n\t\t}\n\t}\n};\n\nexport default drainBody;\n", "import type { Middleware } from \"./common\";\n\ninterface JsonError {\n\tmessage?: string;\n\tname?: string;\n\tstack?: string;\n\tcause?: JsonError;\n}\n\nfunction reduceError(e: any): JsonError {\n\treturn {\n\t\tname: e?.name,\n\t\tmessage: e?.message ?? String(e),\n\t\tstack: e?.stack,\n\t\tcause: e?.cause === undefined ? undefined : reduceError(e.cause),\n\t};\n}\n\n// See comment in `bundle.ts` for details on why this is needed\nconst jsonError: Middleware = async (request, env, _ctx, middlewareCtx) => {\n\ttry {\n\t\treturn await middlewareCtx.next(request, env);\n\t} catch (e: any) {\n\t\tconst error = reduceError(e);\n\t\treturn Response.json(error, {\n\t\t\tstatus: 500,\n\t\t\theaders: { \"MF-Experimental-Error-Stack\": \"true\" },\n\t\t});\n\t}\n};\n\nexport default jsonError;\n", "\t\t\t\timport { __facade_registerInternal__ } from \"/Users/samihalawa/git/BACKUP_WORKERS/Autovideos-worker/shy-hill-f5c2/node_modules/wrangler/templates/middleware/loader-sw.ts\";\n\t\t\t\timport * as __MIDDLEWARE_0__ from \"/Users/samihalawa/git/BACKUP_WORKERS/Autovideos-worker/shy-hill-f5c2/node_modules/wrangler/templates/middleware/middleware-ensure-req-body-drained.ts\";\nimport * as __MIDDLEWARE_1__ from \"/Users/samihalawa/git/BACKUP_WORKERS/Autovideos-worker/shy-hill-f5c2/node_modules/wrangler/templates/middleware/middleware-miniflare3-json-error.ts\";\n\t\t\t\t__facade_registerInternal__([__MIDDLEWARE_0__.default,__MIDDLEWARE_1__.default])", "// src/renderHtml.js\n\nexport async function renderHtml() {\n return `\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Melinda AI - Create Video Presentations</title>\n <!-- Tailwind CSS -->\n <link href=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css\" rel=\"stylesheet\">\n <!-- Swiper CSS -->\n <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.css\" />\n <!-- Animate.css -->\n <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css\"/>\n <!-- Prism.js for Code Highlighting -->\n <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism.min.css\" />\n <style>\n body { font-family: 'Roboto', sans-serif; background-color: #f0f4f8; overflow-x: hidden; }\n .hero { background: url('https://images.unsplash.com/photo-1522202176988-66273c2fd55f?auto=format&fit=crop&w=1500&q=80') center/cover; color: #fff; min-height: 100vh; display: flex; align-items: center; justify-content: center; }\n .overlay { background: rgba(0,0,0,0.6); padding: 60px 30px; border-radius: 10px; }\n .video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 800px; }\n .video-container iframe { position: absolute; top:0; left:0; width:100%; height:100%; }\n pre { background: #f7fafc; padding: 15px; border-radius: 5px; overflow-x: auto; max-width: 800px; }\n /* Loader Styles */\n .loader {\n border: 8px solid #f3f3f3;\n border-top: 8px solid #3498db;\n border-radius: 50%;\n width: 60px;\n height: 60px;\n animation: spin 2s linear infinite;\n margin: auto;\n }\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n </style>\n </head>\n <body>\n <!-- Hero Section -->\n <section class=\"hero\">\n <div class=\"overlay text-center\">\n <h1 class=\"text-5xl font-bold mb-6\">Melinda AI</h1>\n <p class=\"text-xl mb-8\">Create stunning video presentations effortlessly.</p>\n <div class=\"flex flex-col md:flex-row justify-center items-center gap-4\">\n <input type=\"text\" id=\"prompt\" class=\"w-full md:w-2/3 p-3 rounded-lg border focus:outline-none focus:border-blue-500\" placeholder=\"Enter presentation topic\">\n <button onclick=\"generateSlides()\" class=\"bg-blue-500 text-white px-6 py-3 rounded-lg\">Create Presentation</button>\n </div>\n <div id=\"loader\" class=\"mt-6\"></div>\n <div id=\"error\" class=\"mt-4 text-lg text-red-500\"></div>\n </div>\n </section>\n \n <!-- Presentation Container -->\n <div class=\"max-w-4xl mx-auto mt-10 hidden\" id=\"presentation\">\n <!-- Swiper -->\n <div class=\"swiper mySwiper\">\n <div class=\"swiper-wrapper\" id=\"swiper-wrapper\"></div>\n <div class=\"swiper-pagination\"></div>\n </div>\n <!-- Progress Bar -->\n <div class=\"w-full bg-gray-200 h-1 mt-4\">\n <div id=\"progress-bar\" class=\"bg-blue-500 h-1 transition-all duration-700\"></div>\n </div>\n <!-- Controls -->\n <div class=\"flex justify-center gap-4 mt-4\">\n <button onclick=\"pauseSlides()\" class=\"bg-yellow-500 text-white px-4 py-2 rounded\">Pause</button>\n <button onclick=\"playSlides()\" class=\"bg-green-500 text-white px-4 py-2 rounded\">Play</button>\n <button onclick=\"toggleFullscreen()\" class=\"bg-blue-500 text-white px-4 py-2 rounded\">Fullscreen</button>\n <button onclick=\"toggleMusic()\" class=\"bg-pink-500 text-white px-4 py-2 rounded\">Play Music</button>\n <button onclick=\"exportVideo()\" class=\"bg-teal-500 text-white px-4 py-2 rounded\">Export Video</button>\n </div>\n <!-- Background Music -->\n <audio id=\"background-music\" loop>\n <source src=\"https://www.bensound.com/bensound-music/bensound-sunny.mp3\" type=\"audio/mpeg\">\n </audio>\n </div>\n \n <!-- Scripts -->\n <script src=\"https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.js\"></script>\n <script src=\"https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js\"></script>\n <script src=\"https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-javascript.min.js\"></script>\n <script>\n let swiper;\n let mediaRecorder, recordedChunks = [];\n \n async function generateSlides() {\n const prompt = document.getElementById('prompt').value.trim();\n if (!prompt) { alert('Please enter a topic to generate the presentation.'); return; }\n document.getElementById('loader').innerHTML = '<div class=\"loader\"></div>';\n \n try {\n const res = await fetch('/generate?prompt=' + encodeURIComponent(prompt));\n if (!res.ok) throw new Error('Failed to fetch slides.');\n const data = await res.json();\n renderSlides(data.slides);\n document.getElementById('presentation').classList.remove('hidden');\n document.getElementById('loader').innerHTML = '';\n } catch (err) {\n document.getElementById('error').textContent = err.message;\n document.getElementById('loader').innerHTML = '';\n }\n }\n \n function renderSlides(slides) {\n const wrapper = document.getElementById('swiper-wrapper');\n wrapper.innerHTML = '';\n slides.forEach(slide => {\n const slideEl = document.createElement('div');\n slideEl.classList.add('swiper-slide', 'animate__animated', 'animate__' + (slide.animation || 'fadeIn'));\n let html = '';\n if (slide.imageUrl) html += '<img src=\"' + slide.imageUrl + '\" alt=\"Slide Image\" class=\"w-full h-auto mb-4\">';\n if (slide.videoUrl) html += '<div class=\"video-container mb-4\">\\n <iframe src=\"' + slide.videoUrl + '\" allowfullscreen></iframe>\\n</div>';\n if (slide.heading) html += '<h2 class=\"text-3xl font-bold my-4\">' + sanitize(slide.heading) + '</h2>';\n if (slide.content) html += '<p class=\"text-lg mb-4\">' + sanitize(slide.content).replace(/\\n/g, '<br>') + '</p>';\n if (slide.codeSnippet) html += '<pre><code class=\"language-javascript\">' + sanitize(slide.codeSnippet) + '</code></pre>';\n slideEl.innerHTML = html;\n wrapper.appendChild(slideEl);\n });\n if (swiper) { swiper.update(); swiper.autoplay.start(); }\n else {\n swiper = new Swiper('.mySwiper', {\n pagination: { el: '.swiper-pagination', clickable: true },\n autoplay: { delay: 7000, disableOnInteraction: false },\n loop: true,\n effect: 'fade',\n fadeEffect: { crossFade: true },\n keyboard: { enabled: true },\n on: {\n slideChangeTransitionStart: () => { document.getElementById('progress-bar').style.width = '0%'; },\n slideChangeTransitionEnd: () => { document.getElementById('progress-bar').style.width = '100%'; },\n },\n });\n }\n Prism.highlightAll();\n }\n \n function sanitize(str) {\n return str.replace(/[&<>\"'/]/g, m => ({ '&':'&', '<':'<', '>':'>', '\"':'"', \"'\":''', '/':'/' })[m]);\n }\n \n function pauseSlides() { if (swiper) swiper.autoplay.stop(); }\n function playSlides() { if (swiper) swiper.autoplay.start(); }\n function toggleFullscreen() {\n const el = document.getElementById('presentation');\n if (!document.fullscreenElement) {\n el.requestFullscreen().catch(err => alert('Error attempting to enable fullscreen mode: ' + err.message));\n } else {\n document.exitFullscreen();\n }\n }\n function toggleMusic() {\n const music = document.getElementById('background-music');\n const btn = document.querySelector('button[onclick=\"toggleMusic()\"]');\n if (music.paused) { \n music.play(); \n btn.textContent = 'Pause Music'; \n } else { \n music.pause(); \n btn.textContent = 'Play Music'; \n }\n }\n \n async function exportVideo() {\n if (!navigator.mediaDevices.getDisplayMedia) { alert('MediaRecorder API is not supported in your browser.'); return; }\n const presentation = document.getElementById('presentation');\n try {\n const stream = presentation.captureStream(30); // 30 FPS\n mediaRecorder = new MediaRecorder(stream, { mimeType: 'video/webm' });\n mediaRecorder.ondataavailable = e => { if (e.data.size > 0) recordedChunks.push(e.data); };\n mediaRecorder.onstop = () => {\n const blob = new Blob(recordedChunks, { type: 'video/webm' });\n const url = URL.createObjectURL(blob);\n const a = document.createElement('a'); \n a.href = url; \n a.download = 'presentation.webm'; \n a.click();\n URL.revokeObjectURL(url); \n recordedChunks = [];\n };\n mediaRecorder.start();\n setTimeout(() => mediaRecorder.stop(), slidesLength() * 7000 + 1000);\n } catch (err) {\n alert('Error exporting video: ' + err.message);\n }\n }\n \n function slidesLength() {\n return document.querySelectorAll('.swiper-slide').length;\n }\n </script>\n </body>\n </html>\n `;\n}\n", "// src/index.js\n\nimport { renderHtml } from './renderHtml.js';\n\naddEventListener('fetch', event => {\n event.respondWith(handleRequest(event.request));\n});\n\n/**\n * Handles incoming HTTP requests.\n * @param {Request} request\n * @returns {Promise<Response>}\n */\nasync function handleRequest(request) {\n const { pathname } = new URL(request.url);\n\n if (pathname === '/') {\n const html = await renderHtml();\n return new Response(html, { headers: { 'Content-Type': 'text/html;charset=UTF-8' } });\n } else if (pathname === '/generate') {\n return new Response(JSON.stringify(getSlides()), {\n headers: { 'Content-Type': 'application/json' },\n });\n } else {\n return new Response('Not Found', { status: 404 });\n }\n}\n\n/**\n * Returns predefined slide data.\n * @returns {Object}\n */\nfunction getSlides() {\n return {\n slides: [\n {\n heading: \"Welcome to Melinda AI\",\n content: \"Create stunning video presentations effortlessly.\",\n imageUrl: \"https://source.unsplash.com/1600x900/?presentation\",\n videoUrl: \"https://www.youtube.com/embed/dQw4w9WgXcQ\",\n animation: \"fadeIn\",\n codeSnippet: 'function greet(name) {\\n return `Hello, ${name}!`;\\n}',\n speakerNotes: \"Introduce Melinda AI and its capabilities.\",\n theme: \"default\",\n languages: [\"en\"],\n },\n {\n heading: \"Smooth Transitions\",\n content: \"Experience seamless transitions with cinematic effects.\",\n imageUrl: \"https://source.unsplash.com/1600x900/?animation\",\n animation: \"slideInUp\",\n codeSnippet: 'gsap.from(\".slide-heading\", { duration: 2, y: -50, opacity: 0 });',\n speakerNotes: \"Demonstrate animation improvements.\",\n theme: \"dark\",\n languages: [\"en\"],\n },\n {\n heading: \"Interactive Elements\",\n content: \"Engage your audience with interactive buttons and polls.\",\n imageUrl: \"https://source.unsplash.com/1600x900/?interactive\",\n animation: \"zoomIn\",\n codeSnippet: '<button onclick=\"startPoll()\" class=\"bg-green-500 text-white px-4 py-2 rounded\">Start Poll</button>',\n speakerNotes: \"Explain benefits of interactivity.\",\n theme: \"light\",\n languages: [\"en\"],\n },\n {\n heading: \"Multimedia Integration\",\n content: \"Incorporate videos and images seamlessly into your presentations.\",\n imageUrl: \"https://source.unsplash.com/1600x900/?multimedia\",\n videoUrl: \"https://www.youtube.com/embed/5NV6Rdv1a3I\",\n animation: \"fadeIn\",\n codeSnippet: '<div class=\"video-container\">\\n <iframe src=\"https://www.youtube.com/embed/5NV6Rdv1a3I\" allowfullscreen></iframe>\\n</div>',\n speakerNotes: \"Highlight multimedia importance.\",\n theme: \"default\",\n languages: [\"en\"],\n },\n {\n heading: \"Accessibility & Themes\",\n content: \"Ensure your presentations are accessible with customizable themes.\",\n imageUrl: \"https://source.unsplash.com/1600x900/?accessibility\",\n animation: \"slideInUp\",\n codeSnippet: 'body.theme-dark {\\n background-color: #1a202c;\\n color: #a0aec0;\\n}',\n speakerNotes: \"Discuss accessibility features.\",\n theme: \"dark\",\n languages: [\"en\"],\n },\n // Add more slides here to cover all desired features (up to 30)\n ],\n };\n}\n"],
|
6 |
+
"mappings": ";;;AAAA,MAAM,OAAO,oBAAI,IAAI;AAErB,WAAS,SAAS,SAAS,MAAM;AAChC,UAAM,MACL,mBAAmB,MAChB,UACA,IAAI;AAAA,OACH,OAAO,YAAY,WACjB,IAAI,QAAQ,SAAS,IAAI,IACzB,SACD;AAAA,IACH;AACH,QAAI,IAAI,QAAQ,IAAI,SAAS,SAAS,IAAI,aAAa,UAAU;AAChE,UAAI,CAAC,KAAK,IAAI,IAAI,SAAS,CAAC,GAAG;AAC9B,aAAK,IAAI,IAAI,SAAS,CAAC;AACvB,gBAAQ;AAAA,UACP;AAAA,KACO,IAAI,SAAS;AAAA;AAAA,QACrB;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAEA,aAAW,QAAQ,IAAI,MAAM,WAAW,OAAO;AAAA,IAC9C,MAAM,QAAQ,SAAS,UAAU;AAChC,YAAM,CAAC,SAAS,IAAI,IAAI;AACxB,eAAS,SAAS,IAAI;AACtB,aAAO,QAAQ,MAAM,QAAQ,SAAS,QAAQ;AAAA,IAC/C;AAAA,EACD,CAAC;;;ACLD,MAAM,wBAAsC,CAAC;AAKtC,WAAS,uBAAuB,MAAqC;AAC3E,0BAAsB,KAAK,GAAG,KAAK,KAAK,CAAC;AAAA,EAC1C;AACO,WAAS,+BACZ,MACF;AACD,0BAAsB,QAAQ,GAAG,KAAK,KAAK,CAAC;AAAA,EAC7C;AAEA,WAAS,uBACR,SACA,KACA,KACA,UACA,iBACsB;AACtB,UAAM,CAAC,MAAM,GAAG,IAAI,IAAI;AACxB,UAAM,gBAAmC;AAAA,MACxC;AAAA,MACA,K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,UACE,SAAS;AAAA,UACT,SAAS;AAAA,UACT,UAAU;AAAA,UACV,UAAU;AAAA,UACV,WAAW;AAAA,UACX,aAAa;AAAA,UACb,cAAc;AAAA,UACd,OAAO;AAAA,UACP,WAAW,CAAC,IAAI;AAAA,QAClB;AAAA,QACA;AAAA,UACE,SAAS;AAAA,UACT,SAAS;AAAA,UACT,UAAU;AAAA,UACV,WAAW;AAAA,UACX,aAAa;AAAA,UACb,cAAc;AAAA,UACd,OAAO;AAAA,UACP,WAAW,CAAC,IAAI;AAAA,QAClB;AAAA;AAAA,MAEF;AAAA,IACF;AAAA,EACF;",
|
7 |
+
"names": ["ctx"]
|
8 |
+
}
|
workers1/Autovideos-worker/shy-hill-f5c2/package-lock.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
workers1/Autovideos-worker/shy-hill-f5c2/package.json
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "shy-hill-f5c2",
|
3 |
+
"version": "0.0.0",
|
4 |
+
"private": true,
|
5 |
+
"scripts": {
|
6 |
+
"deploy": "wrangler deploy",
|
7 |
+
"dev": "wrangler dev",
|
8 |
+
"start": "wrangler dev",
|
9 |
+
"test": "vitest",
|
10 |
+
"cf-typegen": "wrangler types"
|
11 |
+
},
|
12 |
+
"devDependencies": {
|
13 |
+
"@cloudflare/vitest-pool-workers": "^0.4.5",
|
14 |
+
"@cloudflare/workers-types": "^4.20240909.0",
|
15 |
+
"typescript": "^5.5.2",
|
16 |
+
"vitest": "1.5.0",
|
17 |
+
"wrangler": "^3.60.3"
|
18 |
+
},
|
19 |
+
"dependencies": {
|
20 |
+
"hono": "^4.6.1"
|
21 |
+
}
|
22 |
+
}
|
workers1/Autovideos-worker/shy-hill-f5c2/src/index.js
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// src/index.js
|
2 |
+
|
3 |
+
import { renderHtml } from './renderHtml.js';
|
4 |
+
|
5 |
+
addEventListener('fetch', event => {
|
6 |
+
event.respondWith(handleRequest(event.request));
|
7 |
+
});
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Handles incoming HTTP requests.
|
11 |
+
* @param {Request} request
|
12 |
+
* @returns {Promise<Response>}
|
13 |
+
*/
|
14 |
+
async function handleRequest(request) {
|
15 |
+
const { pathname } = new URL(request.url);
|
16 |
+
|
17 |
+
if (pathname === '/') {
|
18 |
+
const html = await renderHtml();
|
19 |
+
return new Response(html, { headers: { 'Content-Type': 'text/html;charset=UTF-8' } });
|
20 |
+
} else if (pathname === '/generate') {
|
21 |
+
return new Response(JSON.stringify(getSlides()), {
|
22 |
+
headers: { 'Content-Type': 'application/json' },
|
23 |
+
});
|
24 |
+
} else {
|
25 |
+
return new Response('Not Found', { status: 404 });
|
26 |
+
}
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Returns predefined slide data.
|
31 |
+
* @returns {Object}
|
32 |
+
*/
|
33 |
+
function getSlides() {
|
34 |
+
return {
|
35 |
+
slides: [
|
36 |
+
{
|
37 |
+
heading: "Welcome to Melinda AI",
|
38 |
+
content: "Create stunning video presentations effortlessly.",
|
39 |
+
imageUrl: "https://source.unsplash.com/1600x900/?presentation",
|
40 |
+
videoUrl: "https://www.youtube.com/embed/dQw4w9WgXcQ",
|
41 |
+
animation: "fadeIn",
|
42 |
+
codeSnippet: 'function greet(name) {\n return `Hello, ${name}!`;\n}',
|
43 |
+
speakerNotes: "Introduce Melinda AI and its capabilities.",
|
44 |
+
theme: "default",
|
45 |
+
languages: ["en"],
|
46 |
+
},
|
47 |
+
{
|
48 |
+
heading: "Smooth Transitions",
|
49 |
+
content: "Experience seamless transitions with cinematic effects.",
|
50 |
+
imageUrl: "https://source.unsplash.com/1600x900/?animation",
|
51 |
+
animation: "slideInUp",
|
52 |
+
codeSnippet: 'gsap.from(".slide-heading", { duration: 2, y: -50, opacity: 0 });',
|
53 |
+
speakerNotes: "Demonstrate animation improvements.",
|
54 |
+
theme: "dark",
|
55 |
+
languages: ["en"],
|
56 |
+
},
|
57 |
+
{
|
58 |
+
heading: "Interactive Elements",
|
59 |
+
content: "Engage your audience with interactive buttons and polls.",
|
60 |
+
imageUrl: "https://source.unsplash.com/1600x900/?interactive",
|
61 |
+
animation: "zoomIn",
|
62 |
+
codeSnippet: '<button onclick="startPoll()" class="bg-green-500 text-white px-4 py-2 rounded">Start Poll</button>',
|
63 |
+
speakerNotes: "Explain benefits of interactivity.",
|
64 |
+
theme: "light",
|
65 |
+
languages: ["en"],
|
66 |
+
},
|
67 |
+
{
|
68 |
+
heading: "Multimedia Integration",
|
69 |
+
content: "Incorporate videos and images seamlessly into your presentations.",
|
70 |
+
imageUrl: "https://source.unsplash.com/1600x900/?multimedia",
|
71 |
+
videoUrl: "https://www.youtube.com/embed/5NV6Rdv1a3I",
|
72 |
+
animation: "fadeIn",
|
73 |
+
codeSnippet: '<div class="video-container">\n <iframe src="https://www.youtube.com/embed/5NV6Rdv1a3I" allowfullscreen></iframe>\n</div>',
|
74 |
+
speakerNotes: "Highlight multimedia importance.",
|
75 |
+
theme: "default",
|
76 |
+
languages: ["en"],
|
77 |
+
},
|
78 |
+
{
|
79 |
+
heading: "Accessibility & Themes",
|
80 |
+
content: "Ensure your presentations are accessible with customizable themes.",
|
81 |
+
imageUrl: "https://source.unsplash.com/1600x900/?accessibility",
|
82 |
+
animation: "slideInUp",
|
83 |
+
codeSnippet: 'body.theme-dark {\n background-color: #1a202c;\n color: #a0aec0;\n}',
|
84 |
+
speakerNotes: "Discuss accessibility features.",
|
85 |
+
theme: "dark",
|
86 |
+
languages: ["en"],
|
87 |
+
},
|
88 |
+
// Add more slides here to cover all desired features (up to 30)
|
89 |
+
],
|
90 |
+
};
|
91 |
+
}
|
workers1/Autovideos-worker/shy-hill-f5c2/src/renderHtml.js
ADDED
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// src/renderHtml.js
|
2 |
+
|
3 |
+
export async function renderHtml() {
|
4 |
+
return `
|
5 |
+
<!DOCTYPE html>
|
6 |
+
<html lang="en">
|
7 |
+
<head>
|
8 |
+
<meta charset="UTF-8">
|
9 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
10 |
+
<title>Melinda AI - Create Video Presentations</title>
|
11 |
+
<!-- Tailwind CSS -->
|
12 |
+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
|
13 |
+
<!-- Swiper CSS -->
|
14 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.css" />
|
15 |
+
<!-- Animate.css -->
|
16 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"/>
|
17 |
+
<!-- Prism.js for Code Highlighting -->
|
18 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism.min.css" />
|
19 |
+
<style>
|
20 |
+
body { font-family: 'Roboto', sans-serif; background-color: #f0f4f8; overflow-x: hidden; }
|
21 |
+
.hero { background: url('https://images.unsplash.com/photo-1522202176988-66273c2fd55f?auto=format&fit=crop&w=1500&q=80') center/cover; color: #fff; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
|
22 |
+
.overlay { background: rgba(0,0,0,0.6); padding: 60px 30px; border-radius: 10px; }
|
23 |
+
.video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 800px; }
|
24 |
+
.video-container iframe { position: absolute; top:0; left:0; width:100%; height:100%; }
|
25 |
+
pre { background: #f7fafc; padding: 15px; border-radius: 5px; overflow-x: auto; max-width: 800px; }
|
26 |
+
/* Loader Styles */
|
27 |
+
.loader {
|
28 |
+
border: 8px solid #f3f3f3;
|
29 |
+
border-top: 8px solid #3498db;
|
30 |
+
border-radius: 50%;
|
31 |
+
width: 60px;
|
32 |
+
height: 60px;
|
33 |
+
animation: spin 2s linear infinite;
|
34 |
+
margin: auto;
|
35 |
+
}
|
36 |
+
@keyframes spin {
|
37 |
+
0% { transform: rotate(0deg); }
|
38 |
+
100% { transform: rotate(360deg); }
|
39 |
+
}
|
40 |
+
</style>
|
41 |
+
</head>
|
42 |
+
<body>
|
43 |
+
<!-- Hero Section -->
|
44 |
+
<section class="hero">
|
45 |
+
<div class="overlay text-center">
|
46 |
+
<h1 class="text-5xl font-bold mb-6">Melinda AI</h1>
|
47 |
+
<p class="text-xl mb-8">Create stunning video presentations effortlessly.</p>
|
48 |
+
<div class="flex flex-col md:flex-row justify-center items-center gap-4">
|
49 |
+
<input type="text" id="prompt" class="w-full md:w-2/3 p-3 rounded-lg border focus:outline-none focus:border-blue-500" placeholder="Enter presentation topic">
|
50 |
+
<button onclick="generateSlides()" class="bg-blue-500 text-white px-6 py-3 rounded-lg">Create Presentation</button>
|
51 |
+
</div>
|
52 |
+
<div id="loader" class="mt-6"></div>
|
53 |
+
<div id="error" class="mt-4 text-lg text-red-500"></div>
|
54 |
+
</div>
|
55 |
+
</section>
|
56 |
+
|
57 |
+
<!-- Presentation Container -->
|
58 |
+
<div class="max-w-4xl mx-auto mt-10 hidden" id="presentation">
|
59 |
+
<!-- Swiper -->
|
60 |
+
<div class="swiper mySwiper">
|
61 |
+
<div class="swiper-wrapper" id="swiper-wrapper"></div>
|
62 |
+
<div class="swiper-pagination"></div>
|
63 |
+
</div>
|
64 |
+
<!-- Progress Bar -->
|
65 |
+
<div class="w-full bg-gray-200 h-1 mt-4">
|
66 |
+
<div id="progress-bar" class="bg-blue-500 h-1 transition-all duration-700"></div>
|
67 |
+
</div>
|
68 |
+
<!-- Controls -->
|
69 |
+
<div class="flex justify-center gap-4 mt-4">
|
70 |
+
<button onclick="pauseSlides()" class="bg-yellow-500 text-white px-4 py-2 rounded">Pause</button>
|
71 |
+
<button onclick="playSlides()" class="bg-green-500 text-white px-4 py-2 rounded">Play</button>
|
72 |
+
<button onclick="toggleFullscreen()" class="bg-blue-500 text-white px-4 py-2 rounded">Fullscreen</button>
|
73 |
+
<button onclick="toggleMusic()" class="bg-pink-500 text-white px-4 py-2 rounded">Play Music</button>
|
74 |
+
<button onclick="exportVideo()" class="bg-teal-500 text-white px-4 py-2 rounded">Export Video</button>
|
75 |
+
</div>
|
76 |
+
<!-- Background Music -->
|
77 |
+
<audio id="background-music" loop>
|
78 |
+
<source src="https://www.bensound.com/bensound-music/bensound-sunny.mp3" type="audio/mpeg">
|
79 |
+
</audio>
|
80 |
+
</div>
|
81 |
+
|
82 |
+
<!-- Scripts -->
|
83 |
+
<script src="https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.js"></script>
|
84 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js"></script>
|
85 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-javascript.min.js"></script>
|
86 |
+
<script>
|
87 |
+
let swiper;
|
88 |
+
let mediaRecorder, recordedChunks = [];
|
89 |
+
|
90 |
+
async function generateSlides() {
|
91 |
+
const prompt = document.getElementById('prompt').value.trim();
|
92 |
+
if (!prompt) { alert('Please enter a topic to generate the presentation.'); return; }
|
93 |
+
document.getElementById('loader').innerHTML = '<div class="loader"></div>';
|
94 |
+
|
95 |
+
try {
|
96 |
+
const res = await fetch('/generate?prompt=' + encodeURIComponent(prompt));
|
97 |
+
if (!res.ok) throw new Error('Failed to fetch slides.');
|
98 |
+
const data = await res.json();
|
99 |
+
renderSlides(data.slides);
|
100 |
+
document.getElementById('presentation').classList.remove('hidden');
|
101 |
+
document.getElementById('loader').innerHTML = '';
|
102 |
+
} catch (err) {
|
103 |
+
document.getElementById('error').textContent = err.message;
|
104 |
+
document.getElementById('loader').innerHTML = '';
|
105 |
+
}
|
106 |
+
}
|
107 |
+
|
108 |
+
function renderSlides(slides) {
|
109 |
+
const wrapper = document.getElementById('swiper-wrapper');
|
110 |
+
wrapper.innerHTML = '';
|
111 |
+
slides.forEach(slide => {
|
112 |
+
const slideEl = document.createElement('div');
|
113 |
+
slideEl.classList.add('swiper-slide', 'animate__animated', 'animate__' + (slide.animation || 'fadeIn'));
|
114 |
+
let html = '';
|
115 |
+
if (slide.imageUrl) html += '<img src="' + slide.imageUrl + '" alt="Slide Image" class="w-full h-auto mb-4">';
|
116 |
+
if (slide.videoUrl) html += '<div class="video-container mb-4">\n <iframe src="' + slide.videoUrl + '" allowfullscreen></iframe>\n</div>';
|
117 |
+
if (slide.heading) html += '<h2 class="text-3xl font-bold my-4">' + sanitize(slide.heading) + '</h2>';
|
118 |
+
if (slide.content) html += '<p class="text-lg mb-4">' + sanitize(slide.content).replace(/\n/g, '<br>') + '</p>';
|
119 |
+
if (slide.codeSnippet) html += '<pre><code class="language-javascript">' + sanitize(slide.codeSnippet) + '</code></pre>';
|
120 |
+
slideEl.innerHTML = html;
|
121 |
+
wrapper.appendChild(slideEl);
|
122 |
+
});
|
123 |
+
if (swiper) { swiper.update(); swiper.autoplay.start(); }
|
124 |
+
else {
|
125 |
+
swiper = new Swiper('.mySwiper', {
|
126 |
+
pagination: { el: '.swiper-pagination', clickable: true },
|
127 |
+
autoplay: { delay: 7000, disableOnInteraction: false },
|
128 |
+
loop: true,
|
129 |
+
effect: 'fade',
|
130 |
+
fadeEffect: { crossFade: true },
|
131 |
+
keyboard: { enabled: true },
|
132 |
+
on: {
|
133 |
+
slideChangeTransitionStart: () => { document.getElementById('progress-bar').style.width = '0%'; },
|
134 |
+
slideChangeTransitionEnd: () => { document.getElementById('progress-bar').style.width = '100%'; },
|
135 |
+
},
|
136 |
+
});
|
137 |
+
}
|
138 |
+
Prism.highlightAll();
|
139 |
+
}
|
140 |
+
|
141 |
+
function sanitize(str) {
|
142 |
+
return str.replace(/[&<>"'/]/g, m => ({ '&':'&', '<':'<', '>':'>', '"':'"', "'":''', '/':'/' })[m]);
|
143 |
+
}
|
144 |
+
|
145 |
+
function pauseSlides() { if (swiper) swiper.autoplay.stop(); }
|
146 |
+
function playSlides() { if (swiper) swiper.autoplay.start(); }
|
147 |
+
function toggleFullscreen() {
|
148 |
+
const el = document.getElementById('presentation');
|
149 |
+
if (!document.fullscreenElement) {
|
150 |
+
el.requestFullscreen().catch(err => alert('Error attempting to enable fullscreen mode: ' + err.message));
|
151 |
+
} else {
|
152 |
+
document.exitFullscreen();
|
153 |
+
}
|
154 |
+
}
|
155 |
+
function toggleMusic() {
|
156 |
+
const music = document.getElementById('background-music');
|
157 |
+
const btn = document.querySelector('button[onclick="toggleMusic()"]');
|
158 |
+
if (music.paused) {
|
159 |
+
music.play();
|
160 |
+
btn.textContent = 'Pause Music';
|
161 |
+
} else {
|
162 |
+
music.pause();
|
163 |
+
btn.textContent = 'Play Music';
|
164 |
+
}
|
165 |
+
}
|
166 |
+
|
167 |
+
async function exportVideo() {
|
168 |
+
if (!navigator.mediaDevices.getDisplayMedia) { alert('MediaRecorder API is not supported in your browser.'); return; }
|
169 |
+
const presentation = document.getElementById('presentation');
|
170 |
+
try {
|
171 |
+
const stream = presentation.captureStream(30); // 30 FPS
|
172 |
+
mediaRecorder = new MediaRecorder(stream, { mimeType: 'video/webm' });
|
173 |
+
mediaRecorder.ondataavailable = e => { if (e.data.size > 0) recordedChunks.push(e.data); };
|
174 |
+
mediaRecorder.onstop = () => {
|
175 |
+
const blob = new Blob(recordedChunks, { type: 'video/webm' });
|
176 |
+
const url = URL.createObjectURL(blob);
|
177 |
+
const a = document.createElement('a');
|
178 |
+
a.href = url;
|
179 |
+
a.download = 'presentation.webm';
|
180 |
+
a.click();
|
181 |
+
URL.revokeObjectURL(url);
|
182 |
+
recordedChunks = [];
|
183 |
+
};
|
184 |
+
mediaRecorder.start();
|
185 |
+
setTimeout(() => mediaRecorder.stop(), slidesLength() * 7000 + 1000);
|
186 |
+
} catch (err) {
|
187 |
+
alert('Error exporting video: ' + err.message);
|
188 |
+
}
|
189 |
+
}
|
190 |
+
|
191 |
+
function slidesLength() {
|
192 |
+
return document.querySelectorAll('.swiper-slide').length;
|
193 |
+
}
|
194 |
+
</script>
|
195 |
+
</body>
|
196 |
+
</html>
|
197 |
+
`;
|
198 |
+
}
|
workers1/Autovideos-worker/shy-hill-f5c2/test/index.spec.ts
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// test/index.spec.ts
|
2 |
+
import { env, createExecutionContext, waitOnExecutionContext, SELF } from 'cloudflare:test';
|
3 |
+
import { describe, it, expect } from 'vitest';
|
4 |
+
import worker from '../src/index';
|
5 |
+
|
6 |
+
// For now, you'll need to do something like this to get a correctly-typed
|
7 |
+
// `Request` to pass to `worker.fetch()`.
|
8 |
+
const IncomingRequest = Request<unknown, IncomingRequestCfProperties>;
|
9 |
+
|
10 |
+
describe('Hello World worker', () => {
|
11 |
+
it('responds with Hello World! (unit style)', async () => {
|
12 |
+
const request = new IncomingRequest('http://example.com');
|
13 |
+
// Create an empty context to pass to `worker.fetch()`.
|
14 |
+
const ctx = createExecutionContext();
|
15 |
+
const response = await worker.fetch(request, env, ctx);
|
16 |
+
// Wait for all `Promise`s passed to `ctx.waitUntil()` to settle before running test assertions
|
17 |
+
await waitOnExecutionContext(ctx);
|
18 |
+
expect(await response.text()).toMatchInlineSnapshot(`"Hello World!"`);
|
19 |
+
});
|
20 |
+
|
21 |
+
it('responds with Hello World! (integration style)', async () => {
|
22 |
+
const response = await SELF.fetch('https://example.com');
|
23 |
+
expect(await response.text()).toMatchInlineSnapshot(`"Hello World!"`);
|
24 |
+
});
|
25 |
+
});
|
workers1/Autovideos-worker/shy-hill-f5c2/test/tsconfig.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"extends": "../tsconfig.json",
|
3 |
+
"compilerOptions": {
|
4 |
+
"types": ["@cloudflare/workers-types/experimental", "@cloudflare/vitest-pool-workers"]
|
5 |
+
},
|
6 |
+
"include": ["./**/*.ts", "../src/env.d.ts"],
|
7 |
+
"exclude": []
|
8 |
+
}
|
workers1/Autovideos-worker/shy-hill-f5c2/tsconfig.json
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"compilerOptions": {
|
3 |
+
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
4 |
+
|
5 |
+
/* Projects */
|
6 |
+
// "incremental": true, /* Enable incremental compilation */
|
7 |
+
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
8 |
+
// "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */
|
9 |
+
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */
|
10 |
+
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
11 |
+
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
12 |
+
|
13 |
+
/* Language and Environment */
|
14 |
+
"target": "es2021" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
15 |
+
"lib": ["es2021"] /* Specify a set of bundled library declaration files that describe the target runtime environment. */,
|
16 |
+
"jsx": "react-jsx" /* Specify what JSX code is generated. */,
|
17 |
+
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
18 |
+
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
19 |
+
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
|
20 |
+
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
21 |
+
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */
|
22 |
+
// "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */
|
23 |
+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
24 |
+
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
25 |
+
|
26 |
+
/* Modules */
|
27 |
+
"module": "es2022" /* Specify what module code is generated. */,
|
28 |
+
// "rootDir": "./", /* Specify the root folder within your source files. */
|
29 |
+
"moduleResolution": "Bundler" /* Specify how TypeScript looks up a file from a given module specifier. */,
|
30 |
+
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
31 |
+
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
32 |
+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
33 |
+
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
|
34 |
+
"types": [
|
35 |
+
"@cloudflare/workers-types/2023-07-01"
|
36 |
+
] /* Specify type package names to be included without being referenced in a source file. */,
|
37 |
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
38 |
+
"resolveJsonModule": true /* Enable importing .json files */,
|
39 |
+
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
|
40 |
+
|
41 |
+
/* JavaScript Support */
|
42 |
+
"allowJs": true /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */,
|
43 |
+
"checkJs": false /* Enable error reporting in type-checked JavaScript files. */,
|
44 |
+
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
|
45 |
+
|
46 |
+
/* Emit */
|
47 |
+
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
48 |
+
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
49 |
+
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
50 |
+
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
51 |
+
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
|
52 |
+
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
53 |
+
// "removeComments": true, /* Disable emitting comments. */
|
54 |
+
"noEmit": true /* Disable emitting files from a compilation. */,
|
55 |
+
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
56 |
+
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
|
57 |
+
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
58 |
+
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
59 |
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
60 |
+
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
61 |
+
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
62 |
+
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
63 |
+
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
64 |
+
// "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */
|
65 |
+
// "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
|
66 |
+
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
67 |
+
// "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
|
68 |
+
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
69 |
+
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
70 |
+
|
71 |
+
/* Interop Constraints */
|
72 |
+
"isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */,
|
73 |
+
"allowSyntheticDefaultImports": true /* Allow 'import x from y' when a module doesn't have a default export. */,
|
74 |
+
// "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */,
|
75 |
+
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
76 |
+
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
77 |
+
|
78 |
+
/* Type Checking */
|
79 |
+
"strict": true /* Enable all strict type-checking options. */,
|
80 |
+
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
|
81 |
+
// "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
|
82 |
+
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
83 |
+
// "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
|
84 |
+
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
85 |
+
// "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
|
86 |
+
// "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
|
87 |
+
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
88 |
+
// "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
|
89 |
+
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
|
90 |
+
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
91 |
+
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
92 |
+
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
93 |
+
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
|
94 |
+
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
95 |
+
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
|
96 |
+
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
97 |
+
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
98 |
+
|
99 |
+
/* Completeness */
|
100 |
+
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
101 |
+
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
102 |
+
},
|
103 |
+
"exclude": ["test"],
|
104 |
+
"include": ["worker-configuration.d.ts", "src/**/*.ts"]
|
105 |
+
}
|
workers1/Autovideos-worker/shy-hill-f5c2/vitest.config.mts
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { defineWorkersConfig } from '@cloudflare/vitest-pool-workers/config';
|
2 |
+
|
3 |
+
export default defineWorkersConfig({
|
4 |
+
test: {
|
5 |
+
poolOptions: {
|
6 |
+
workers: {
|
7 |
+
wrangler: { configPath: './wrangler.toml' },
|
8 |
+
},
|
9 |
+
},
|
10 |
+
},
|
11 |
+
});
|
workers1/Autovideos-worker/shy-hill-f5c2/worker-configuration.d.ts
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Generated by Wrangler
|
2 |
+
// After adding bindings to `wrangler.toml`, regenerate this interface via `npm run cf-typegen`
|
3 |
+
interface Env {
|
4 |
+
}
|
workers1/Autovideos-worker/shy-hill-f5c2/wrangler.toml
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#:schema node_modules/wrangler/config-schema.json
|
2 |
+
name = "shy-hill-f5c2"
|
3 |
+
main = "src/index.js"
|
4 |
+
compatibility_date = "2024-09-09"
|
5 |
+
compatibility_flags = ["nodejs_compat"]
|
6 |
+
|
7 |
+
|
8 |
+
[ai]
|
9 |
+
binding = "AI"
|
10 |
+
|
11 |
+
# wrangler.toml
|
12 |
+
|
13 |
+
|
14 |
+
# Automatically place your workloads in an optimal location to minimize latency.
|
15 |
+
# If you are running back-end logic in a Worker, running it closer to your back-end infrastructure
|
16 |
+
# rather than the end user may result in better performance.
|
17 |
+
# Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
|
18 |
+
# [placement]
|
19 |
+
# mode = "smart"
|
20 |
+
|
21 |
+
# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
|
22 |
+
# Docs:
|
23 |
+
# - https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
|
24 |
+
# Note: Use secrets to store sensitive data.
|
25 |
+
# - https://developers.cloudflare.com/workers/configuration/secrets/
|
26 |
+
# [vars]
|
27 |
+
# MY_VARIABLE = "production_value"
|
28 |
+
|
29 |
+
# Bind the Workers AI model catalog. Run machine learning models, powered by serverless GPUs, on Cloudflare’s global network
|
30 |
+
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
|
31 |
+
# [ai]
|
32 |
+
# binding = "AI"
|
33 |
+
|
34 |
+
# Bind an Analytics Engine dataset. Use Analytics Engine to write analytics within your Pages Function.
|
35 |
+
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
|
36 |
+
# [[analytics_engine_datasets]]
|
37 |
+
# binding = "MY_DATASET"
|
38 |
+
|
39 |
+
# Bind a headless browser instance running on Cloudflare's global network.
|
40 |
+
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
|
41 |
+
# [browser]
|
42 |
+
# binding = "MY_BROWSER"
|
43 |
+
|
44 |
+
# Bind a D1 database. D1 is Cloudflare’s native serverless SQL database.
|
45 |
+
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
|
46 |
+
# [[d1_databases]]
|
47 |
+
# binding = "MY_DB"
|
48 |
+
# database_name = "my-database"
|
49 |
+
# database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
50 |
+
|
51 |
+
# Bind a dispatch namespace. Use Workers for Platforms to deploy serverless functions programmatically on behalf of your customers.
|
52 |
+
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
|
53 |
+
# [[dispatch_namespaces]]
|
54 |
+
# binding = "MY_DISPATCHER"
|
55 |
+
# namespace = "my-namespace"
|
56 |
+
|
57 |
+
# Bind a Durable Object. Durable objects are a scale-to-zero compute primitive based on the actor model.
|
58 |
+
# Durable Objects can live for as long as needed. Use these when you need a long-running "server", such as in realtime apps.
|
59 |
+
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
|
60 |
+
# [[durable_objects.bindings]]
|
61 |
+
# name = "MY_DURABLE_OBJECT"
|
62 |
+
# class_name = "MyDurableObject"
|
63 |
+
|
64 |
+
# Durable Object migrations.
|
65 |
+
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#migrations
|
66 |
+
# [[migrations]]
|
67 |
+
# tag = "v1"
|
68 |
+
# new_classes = ["MyDurableObject"]
|
69 |
+
|
70 |
+
# Bind a Hyperdrive configuration. Use to accelerate access to your existing databases from Cloudflare Workers.
|
71 |
+
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
|
72 |
+
# [[hyperdrive]]
|
73 |
+
# binding = "MY_HYPERDRIVE"
|
74 |
+
# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
75 |
+
|
76 |
+
# Bind a KV Namespace. Use KV as persistent storage for small key-value pairs.
|
77 |
+
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
|
78 |
+
# [[kv_namespaces]]
|
79 |
+
# binding = "MY_KV_NAMESPACE"
|
80 |
+
# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
81 |
+
|
82 |
+
# Bind an mTLS certificate. Use to present a client certificate when communicating with another service.
|
83 |
+
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
|
84 |
+
# [[mtls_certificates]]
|
85 |
+
# binding = "MY_CERTIFICATE"
|
86 |
+
# certificate_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
87 |
+
|
88 |
+
# Bind a Queue producer. Use this binding to schedule an arbitrary task that may be processed later by a Queue consumer.
|
89 |
+
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
90 |
+
# [[queues.producers]]
|
91 |
+
# binding = "MY_QUEUE"
|
92 |
+
# queue = "my-queue"
|
93 |
+
|
94 |
+
# Bind a Queue consumer. Queue Consumers can retrieve tasks scheduled by Producers to act on them.
|
95 |
+
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
96 |
+
# [[queues.consumers]]
|
97 |
+
# queue = "my-queue"
|
98 |
+
|
99 |
+
# Bind an R2 Bucket. Use R2 to store arbitrarily large blobs of data, such as files.
|
100 |
+
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
|
101 |
+
# [[r2_buckets]]
|
102 |
+
# binding = "MY_BUCKET"
|
103 |
+
# bucket_name = "my-bucket"
|
104 |
+
|
105 |
+
# Bind another Worker service. Use this binding to call another Worker without network overhead.
|
106 |
+
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
|
107 |
+
# [[services]]
|
108 |
+
# binding = "MY_SERVICE"
|
109 |
+
# service = "my-service"
|
110 |
+
|
111 |
+
# Bind a Vectorize index. Use to store and query vector embeddings for semantic search, classification and other vector search use-cases.
|
112 |
+
# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
|
113 |
+
# [[vectorize]]
|
114 |
+
# binding = "MY_INDEX"
|
115 |
+
# index_name = "my-index"
|