@remotion/studio 4.0.232 → 4.0.233

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ var __export = (target, all) => {
10
10
  };
11
11
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
12
12
 
13
- // /Users/jonathanburger/remotion/packages/studio/node_modules/zod/lib/index.mjs
13
+ // ../../node_modules/.pnpm/zod@3.22.3/node_modules/zod/lib/index.mjs
14
14
  var exports_lib = {};
15
15
  __export(exports_lib, {
16
16
  z: () => z,
@@ -142,113 +142,6 @@ function addIssueToContext(ctx, issueData) {
142
142
  });
143
143
  ctx.common.issues.push(issue);
144
144
  }
145
- function processCreateParams(params) {
146
- if (!params)
147
- return {};
148
- const { errorMap, invalid_type_error, required_error, description } = params;
149
- if (errorMap && (invalid_type_error || required_error)) {
150
- throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
151
- }
152
- if (errorMap)
153
- return { errorMap, description };
154
- const customMap = (iss, ctx) => {
155
- if (iss.code !== "invalid_type")
156
- return { message: ctx.defaultError };
157
- if (typeof ctx.data === "undefined") {
158
- return { message: required_error !== null && required_error !== undefined ? required_error : ctx.defaultError };
159
- }
160
- return { message: invalid_type_error !== null && invalid_type_error !== undefined ? invalid_type_error : ctx.defaultError };
161
- };
162
- return { errorMap: customMap, description };
163
- }
164
- function isValidIP(ip, version) {
165
- if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
166
- return true;
167
- }
168
- if ((version === "v6" || !version) && ipv6Regex.test(ip)) {
169
- return true;
170
- }
171
- return false;
172
- }
173
- function floatSafeRemainder(val, step) {
174
- const valDecCount = (val.toString().split(".")[1] || "").length;
175
- const stepDecCount = (step.toString().split(".")[1] || "").length;
176
- const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
177
- const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
178
- const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
179
- return valInt % stepInt / Math.pow(10, decCount);
180
- }
181
- function deepPartialify(schema) {
182
- if (schema instanceof ZodObject) {
183
- const newShape = {};
184
- for (const key in schema.shape) {
185
- const fieldSchema = schema.shape[key];
186
- newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
187
- }
188
- return new ZodObject({
189
- ...schema._def,
190
- shape: () => newShape
191
- });
192
- } else if (schema instanceof ZodArray) {
193
- return new ZodArray({
194
- ...schema._def,
195
- type: deepPartialify(schema.element)
196
- });
197
- } else if (schema instanceof ZodOptional) {
198
- return ZodOptional.create(deepPartialify(schema.unwrap()));
199
- } else if (schema instanceof ZodNullable) {
200
- return ZodNullable.create(deepPartialify(schema.unwrap()));
201
- } else if (schema instanceof ZodTuple) {
202
- return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));
203
- } else {
204
- return schema;
205
- }
206
- }
207
- function mergeValues(a, b) {
208
- const aType = getParsedType(a);
209
- const bType = getParsedType(b);
210
- if (a === b) {
211
- return { valid: true, data: a };
212
- } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
213
- const bKeys = util.objectKeys(b);
214
- const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
215
- const newObj = { ...a, ...b };
216
- for (const key of sharedKeys) {
217
- const sharedValue = mergeValues(a[key], b[key]);
218
- if (!sharedValue.valid) {
219
- return { valid: false };
220
- }
221
- newObj[key] = sharedValue.data;
222
- }
223
- return { valid: true, data: newObj };
224
- } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
225
- if (a.length !== b.length) {
226
- return { valid: false };
227
- }
228
- const newArray = [];
229
- for (let index = 0;index < a.length; index++) {
230
- const itemA = a[index];
231
- const itemB = b[index];
232
- const sharedValue = mergeValues(itemA, itemB);
233
- if (!sharedValue.valid) {
234
- return { valid: false };
235
- }
236
- newArray.push(sharedValue.data);
237
- }
238
- return { valid: true, data: newArray };
239
- } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {
240
- return { valid: true, data: a };
241
- } else {
242
- return { valid: false };
243
- }
244
- }
245
- function createZodEnum(values, params) {
246
- return new ZodEnum({
247
- values,
248
- typeName: ZodFirstPartyTypeKind.ZodEnum,
249
- ...processCreateParams(params)
250
- });
251
- }
252
145
 
253
146
  class ParseStatus {
254
147
  constructor() {
@@ -322,6 +215,25 @@ class ParseInputLazyPath {
322
215
  return this._cachedPath;
323
216
  }
324
217
  }
218
+ function processCreateParams(params) {
219
+ if (!params)
220
+ return {};
221
+ const { errorMap: errorMap2, invalid_type_error, required_error, description } = params;
222
+ if (errorMap2 && (invalid_type_error || required_error)) {
223
+ throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
224
+ }
225
+ if (errorMap2)
226
+ return { errorMap: errorMap2, description };
227
+ const customMap = (iss, ctx) => {
228
+ if (iss.code !== "invalid_type")
229
+ return { message: ctx.defaultError };
230
+ if (typeof ctx.data === "undefined") {
231
+ return { message: required_error !== null && required_error !== undefined ? required_error : ctx.defaultError };
232
+ }
233
+ return { message: invalid_type_error !== null && invalid_type_error !== undefined ? invalid_type_error : ctx.defaultError };
234
+ };
235
+ return { errorMap: customMap, description };
236
+ }
325
237
 
326
238
  class ZodType {
327
239
  constructor(def) {
@@ -566,6 +478,94 @@ class ZodType {
566
478
  return this.safeParse(null).success;
567
479
  }
568
480
  }
481
+ function isValidIP(ip, version) {
482
+ if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
483
+ return true;
484
+ }
485
+ if ((version === "v6" || !version) && ipv6Regex.test(ip)) {
486
+ return true;
487
+ }
488
+ return false;
489
+ }
490
+ function floatSafeRemainder(val, step) {
491
+ const valDecCount = (val.toString().split(".")[1] || "").length;
492
+ const stepDecCount = (step.toString().split(".")[1] || "").length;
493
+ const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
494
+ const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
495
+ const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
496
+ return valInt % stepInt / Math.pow(10, decCount);
497
+ }
498
+ function deepPartialify(schema) {
499
+ if (schema instanceof ZodObject) {
500
+ const newShape = {};
501
+ for (const key in schema.shape) {
502
+ const fieldSchema = schema.shape[key];
503
+ newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
504
+ }
505
+ return new ZodObject({
506
+ ...schema._def,
507
+ shape: () => newShape
508
+ });
509
+ } else if (schema instanceof ZodArray) {
510
+ return new ZodArray({
511
+ ...schema._def,
512
+ type: deepPartialify(schema.element)
513
+ });
514
+ } else if (schema instanceof ZodOptional) {
515
+ return ZodOptional.create(deepPartialify(schema.unwrap()));
516
+ } else if (schema instanceof ZodNullable) {
517
+ return ZodNullable.create(deepPartialify(schema.unwrap()));
518
+ } else if (schema instanceof ZodTuple) {
519
+ return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));
520
+ } else {
521
+ return schema;
522
+ }
523
+ }
524
+ function mergeValues(a, b) {
525
+ const aType = getParsedType(a);
526
+ const bType = getParsedType(b);
527
+ if (a === b) {
528
+ return { valid: true, data: a };
529
+ } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
530
+ const bKeys = util.objectKeys(b);
531
+ const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
532
+ const newObj = { ...a, ...b };
533
+ for (const key of sharedKeys) {
534
+ const sharedValue = mergeValues(a[key], b[key]);
535
+ if (!sharedValue.valid) {
536
+ return { valid: false };
537
+ }
538
+ newObj[key] = sharedValue.data;
539
+ }
540
+ return { valid: true, data: newObj };
541
+ } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
542
+ if (a.length !== b.length) {
543
+ return { valid: false };
544
+ }
545
+ const newArray = [];
546
+ for (let index = 0;index < a.length; index++) {
547
+ const itemA = a[index];
548
+ const itemB = b[index];
549
+ const sharedValue = mergeValues(itemA, itemB);
550
+ if (!sharedValue.valid) {
551
+ return { valid: false };
552
+ }
553
+ newArray.push(sharedValue.data);
554
+ }
555
+ return { valid: true, data: newArray };
556
+ } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {
557
+ return { valid: true, data: a };
558
+ } else {
559
+ return { valid: false };
560
+ }
561
+ }
562
+ function createZodEnum(values, params) {
563
+ return new ZodEnum({
564
+ values,
565
+ typeName: ZodFirstPartyTypeKind.ZodEnum,
566
+ ...processCreateParams(params)
567
+ });
568
+ }
569
569
  var util, objectUtil, ZodParsedType, getParsedType = (data) => {
570
570
  const t = typeof data;
571
571
  switch (t) {
@@ -723,7 +723,7 @@ var util, objectUtil, ZodParsedType, getParsedType = (data) => {
723
723
  path: fullPath,
724
724
  message: issueData.message || errorMessage
725
725
  };
726
- }, EMPTY_PATH, INVALID, DIRTY = (value) => ({ status: "dirty", value }), OK = (value) => ({ status: "valid", value }), isAborted = (x) => x.status === "aborted", isDirty = (x) => x.status === "dirty", isValid = (x) => x.status === "valid", isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise, errorUtil = (x) => typeof Promise !== "undefined" && x instanceof Promise, handleResult = (ctx, result) => {
726
+ }, EMPTY_PATH, INVALID, DIRTY = (value) => ({ status: "dirty", value }), OK = (value) => ({ status: "valid", value }), isAborted = (x) => x.status === "aborted", isDirty = (x) => x.status === "dirty", isValid = (x) => x.status === "valid", isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise, errorUtil, handleResult = (ctx, result) => {
727
727
  if (isValid(result)) {
728
728
  return { success: true, data: result.value };
729
729
  } else {
@@ -744,21 +744,21 @@ var util, objectUtil, ZodParsedType, getParsedType = (data) => {
744
744
  }, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, emailRegex, emojiRegex, ipv4Regex, ipv6Regex, datetimeRegex = (args) => {
745
745
  if (args.precision) {
746
746
  if (args.offset) {
747
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)\$`);
747
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
748
748
  } else {
749
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z\$`);
749
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
750
750
  }
751
751
  } else if (args.precision === 0) {
752
752
  if (args.offset) {
753
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)\$`);
753
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
754
754
  } else {
755
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z\$`);
755
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
756
756
  }
757
757
  } else {
758
758
  if (args.offset) {
759
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)\$`);
759
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
760
760
  } else {
761
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z\$`);
761
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
762
762
  }
763
763
  }
764
764
  }, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator = (type) => {