@zync/zync-screnplay-player 0.1.227 → 0.1.229
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.
- package/dist/ZyncScreenplayPlayer.js +3 -0
- package/dist/bundle.js +1 -1
- package/dist/bundle.js.LICENSE.txt +26 -13
- package/dist/renderer.cjs +1 -0
- package/dist/screenplay/RemotionRenderer/components/LottieAnimationGlobal.js +21 -21
- package/dist/screenplay/RemotionRenderer/components/layouts/HookThreeGlitchOverlay.js +141 -0
- package/dist/screenplay/RemotionRenderer/components/layouts/HookVideo.js +45 -24
- package/dist/screenplay/RemotionRenderer/components/utils/FaceCenteredVideo.js +50 -50
- package/dist/screenplay/RemotionRenderer/components/utils/PausableImg.js +4 -4
- package/dist/screenplay/RemotionRenderer/components/utils/README.md +80 -80
- package/dist/screenplay/RemotionRenderer/components/utils/StretchTextDemo.js +3 -3
- package/dist/screenplay/RemotionRenderer/development.js +1 -1
- package/dist/screenplay/RemotionRenderer/helpers/convertToSeconds.js +8 -8
- package/dist/screenplay/RemotionRenderer/helpers/faceBasedVideoStyles.js +4 -4
- package/dist/screenplay/RemotionRenderer/helpers/faceCenteredVideoTransforms.js +46 -46
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/HookVideoLayout.js +8 -2
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/SimpleFrameLayout.js +0 -1
- package/dist/screenplay/RemotionRenderer/main/screenplaySchema.js +51 -51
- package/dist/screenplay/RemotionRenderer/registeredComponents.js +2 -2
- package/dist/screenplay/RemotionRenderer/tracks/LayoutVideoTrack.js +435 -52
- package/package.json +52 -47
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/*
|
|
2
|
-
object-assign
|
|
3
|
-
(c) Sindre Sorhus
|
|
4
|
-
@license MIT
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
1
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
8
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
* Copyright 2010-2025 Three.js Authors
|
|
6
|
+
* SPDX-License-Identifier: MIT
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
9
|
/**
|
|
10
10
|
* @license React
|
|
11
|
-
* react-
|
|
11
|
+
* react-dom.production.min.js
|
|
12
12
|
*
|
|
13
13
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
14
|
*
|
|
@@ -18,7 +18,7 @@ object-assign
|
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* @license React
|
|
21
|
-
* react.production.min.js
|
|
21
|
+
* react-jsx-runtime.production.min.js
|
|
22
22
|
*
|
|
23
23
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
24
24
|
*
|
|
@@ -26,8 +26,9 @@ object-assign
|
|
|
26
26
|
* LICENSE file in the root directory of this source tree.
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
29
|
+
/**
|
|
30
|
+
* @license React
|
|
31
|
+
* react-reconciler-constants.production.min.js
|
|
31
32
|
*
|
|
32
33
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
33
34
|
*
|
|
@@ -35,8 +36,9 @@ object-assign
|
|
|
35
36
|
* LICENSE file in the root directory of this source tree.
|
|
36
37
|
*/
|
|
37
38
|
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
39
|
+
/**
|
|
40
|
+
* @license React
|
|
41
|
+
* react-reconciler.production.min.js
|
|
40
42
|
*
|
|
41
43
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
42
44
|
*
|
|
@@ -44,7 +46,8 @@ object-assign
|
|
|
44
46
|
* LICENSE file in the root directory of this source tree.
|
|
45
47
|
*/
|
|
46
48
|
|
|
47
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* @license React
|
|
48
51
|
* react.production.min.js
|
|
49
52
|
*
|
|
50
53
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -52,3 +55,13 @@ object-assign
|
|
|
52
55
|
* This source code is licensed under the MIT license found in the
|
|
53
56
|
* LICENSE file in the root directory of this source tree.
|
|
54
57
|
*/
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @license React
|
|
61
|
+
* scheduler.production.min.js
|
|
62
|
+
*
|
|
63
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
64
|
+
*
|
|
65
|
+
* This source code is licensed under the MIT license found in the
|
|
66
|
+
* LICENSE file in the root directory of this source tree.
|
|
67
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e,t,r={d:(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};r.r(n),r.d(n,{RemotionRenderer:()=>Yo}),function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(e||(e={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(t||(t={}));const o=e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),i=e=>{switch(typeof e){case"undefined":return o.undefined;case"string":return o.string;case"number":return isNaN(e)?o.nan:o.number;case"boolean":return o.boolean;case"function":return o.function;case"bigint":return o.bigint;case"symbol":return o.symbol;case"object":return Array.isArray(e)?o.array:null===e?o.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?o.promise:"undefined"!=typeof Map&&e instanceof Map?o.map:"undefined"!=typeof Set&&e instanceof Set?o.set:"undefined"!=typeof Date&&e instanceof Date?o.date:o.object;default:return o.unknown}},a=e.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class s extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const o of e.issues)if("invalid_union"===o.code)o.unionErrors.map(n);else if("invalid_return_type"===o.code)n(o.returnTypeError);else if("invalid_arguments"===o.code)n(o.argumentsError);else if(0===o.path.length)r._errors.push(t(o));else{let e=r,n=0;for(;n<o.path.length;){const r=o.path[n];n===o.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(o))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof s))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,e.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}s.create=e=>new s(e);const u=(t,r)=>{let n;switch(t.code){case a.invalid_type:n=t.received===o.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case a.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,e.jsonStringifyReplacer)}`;break;case a.unrecognized_keys:n=`Unrecognized key(s) in object: ${e.joinValues(t.keys,", ")}`;break;case a.invalid_union:n="Invalid input";break;case a.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${e.joinValues(t.options)}`;break;case a.invalid_enum_value:n=`Invalid enum value. Expected ${e.joinValues(t.options)}, received '${t.received}'`;break;case a.invalid_arguments:n="Invalid function arguments";break;case a.invalid_return_type:n="Invalid function return type";break;case a.invalid_date:n="Invalid date";break;case a.invalid_string:"object"==typeof t.validation?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,"number"==typeof t.validation.position&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:e.assertNever(t.validation):n="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case a.too_small:n="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:"date"===t.type?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case a.too_big:n="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"bigint"===t.type?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"date"===t.type?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case a.custom:n="Invalid input";break;case a.invalid_intersection_types:n="Intersection results could not be merged";break;case a.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case a.not_finite:n="Number must be finite";break;default:n=r.defaultError,e.assertNever(t)}return{message:n}};let c=u;function l(){return c}const d=e=>{const{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],a={...o,path:i};if(void 0!==o.message)return{...o,path:i,message:o.message};let s="";const u=n.filter((e=>!!e)).slice().reverse();for(const e of u)s=e(a,{data:t,defaultError:s}).message;return{...o,path:i,message:s}};function f(e,t){const r=l(),n=d({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===u?void 0:u].filter((e=>!!e))});e.common.issues.push(n)}class p{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if("aborted"===n.status)return v;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,n=await e.value;r.push({key:t,value:n})}return p.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:t,value:o}=n;if("aborted"===t.status)return v;if("aborted"===o.status)return v;"dirty"===t.status&&e.dirty(),"dirty"===o.status&&e.dirty(),"__proto__"===t.value||void 0===o.value&&!n.alwaysSet||(r[t.value]=o.value)}return{status:e.value,value:r}}}const v=Object.freeze({status:"aborted"}),y=e=>({status:"dirty",value:e}),m=e=>({status:"valid",value:e}),h=e=>"aborted"===e.status,b=e=>"dirty"===e.status,g=e=>"valid"===e.status,_=e=>"undefined"!=typeof Promise&&e instanceof Promise;function w(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function O(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r}var k,S,j;"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(k||(k={}));class x{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const P=(e,t)=>{if(g(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new s(e.common.issues);return this._error=t,this._error}}};function T(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:o};return{errorMap:(t,o)=>{var i,a;const{message:s}=e;return"invalid_enum_value"===t.code?{message:null!=s?s:o.defaultError}:void 0===o.data?{message:null!==(i=null!=s?s:n)&&void 0!==i?i:o.defaultError}:"invalid_type"!==t.code?{message:o.defaultError}:{message:null!==(a=null!=s?s:r)&&void 0!==a?a:o.defaultError}},description:o}}class E{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return i(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new p,ctx:{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(_(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const n={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},o=this._parseSync({data:e,path:n.path,parent:n});return P(n,o)}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(_(n)?n:Promise.resolve(n));return P(r,o)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const o=e(t),i=()=>n.addIssue({code:a.custom,...r(t)});return"undefined"!=typeof Promise&&o instanceof Promise?o.then((e=>!!e||(i(),!1))):!!o||(i(),!1)}))}refinement(e,t){return this._refinement(((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1)))}_refinement(e){return new ke({schema:this,typeName:Ce.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Se.create(this,this._def)}nullable(){return je.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return oe.create(this,this._def)}promise(){return Oe.create(this,this._def)}or(e){return se.create([this,e],this._def)}and(e){return de.create(this,e,this._def)}transform(e){return new ke({...T(this._def),schema:this,typeName:Ce.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new xe({...T(this._def),innerType:this,defaultValue:t,typeName:Ce.ZodDefault})}brand(){return new Ne({typeName:Ce.ZodBranded,type:this,...T(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Pe({...T(this._def),innerType:this,catchValue:t,typeName:Ce.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ve.create(this,e)}readonly(){return Ze.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const N=/^c[^\s-]{8,}$/i,V=/^[0-9a-z]+$/,Z=/^[0-9A-HJKMNP-TV-Z]{26}$/,R=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,A=/^[a-z0-9_-]{21}$/i,C=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,I=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let M;const F=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,L=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,B=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,D="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",U=new RegExp(`^${D}$`);function $(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function z(e){let t=`${D}T${$(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}class q extends E{_parse(t){this._def.coerce&&(t.data=String(t.data));if(this._getType(t)!==o.string){const e=this._getOrReturnCtx(t);return f(e,{code:a.invalid_type,expected:o.string,received:e.parsedType}),v}const r=new p;let n;for(const o of this._def.checks)if("min"===o.kind)t.data.length<o.value&&(n=this._getOrReturnCtx(t,n),f(n,{code:a.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if("max"===o.kind)t.data.length>o.value&&(n=this._getOrReturnCtx(t,n),f(n,{code:a.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if("length"===o.kind){const e=t.data.length>o.value,i=t.data.length<o.value;(e||i)&&(n=this._getOrReturnCtx(t,n),e?f(n,{code:a.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):i&&f(n,{code:a.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if("email"===o.kind)I.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"email",code:a.invalid_string,message:o.message}),r.dirty());else if("emoji"===o.kind)M||(M=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),M.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"emoji",code:a.invalid_string,message:o.message}),r.dirty());else if("uuid"===o.kind)R.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"uuid",code:a.invalid_string,message:o.message}),r.dirty());else if("nanoid"===o.kind)A.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"nanoid",code:a.invalid_string,message:o.message}),r.dirty());else if("cuid"===o.kind)N.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"cuid",code:a.invalid_string,message:o.message}),r.dirty());else if("cuid2"===o.kind)V.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"cuid2",code:a.invalid_string,message:o.message}),r.dirty());else if("ulid"===o.kind)Z.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"ulid",code:a.invalid_string,message:o.message}),r.dirty());else if("url"===o.kind)try{new URL(t.data)}catch(e){n=this._getOrReturnCtx(t,n),f(n,{validation:"url",code:a.invalid_string,message:o.message}),r.dirty()}else if("regex"===o.kind){o.regex.lastIndex=0;o.regex.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"regex",code:a.invalid_string,message:o.message}),r.dirty())}else if("trim"===o.kind)t.data=t.data.trim();else if("includes"===o.kind)t.data.includes(o.value,o.position)||(n=this._getOrReturnCtx(t,n),f(n,{code:a.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty());else if("toLowerCase"===o.kind)t.data=t.data.toLowerCase();else if("toUpperCase"===o.kind)t.data=t.data.toUpperCase();else if("startsWith"===o.kind)t.data.startsWith(o.value)||(n=this._getOrReturnCtx(t,n),f(n,{code:a.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty());else if("endsWith"===o.kind)t.data.endsWith(o.value)||(n=this._getOrReturnCtx(t,n),f(n,{code:a.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty());else if("datetime"===o.kind){z(o).test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{code:a.invalid_string,validation:"datetime",message:o.message}),r.dirty())}else if("date"===o.kind){U.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{code:a.invalid_string,validation:"date",message:o.message}),r.dirty())}else if("time"===o.kind){new RegExp(`^${$(o)}$`).test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{code:a.invalid_string,validation:"time",message:o.message}),r.dirty())}else"duration"===o.kind?C.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"duration",code:a.invalid_string,message:o.message}),r.dirty()):"ip"===o.kind?(i=t.data,("v4"!==(s=o.version)&&s||!F.test(i))&&("v6"!==s&&s||!L.test(i))&&(n=this._getOrReturnCtx(t,n),f(n,{validation:"ip",code:a.invalid_string,message:o.message}),r.dirty())):"base64"===o.kind?B.test(t.data)||(n=this._getOrReturnCtx(t,n),f(n,{validation:"base64",code:a.invalid_string,message:o.message}),r.dirty()):e.assertNever(o);var i,s;return{status:r.value,value:t.data}}_regex(e,t,r){return this.refinement((t=>e.test(t)),{validation:t,code:a.invalid_string,...k.errToObj(r)})}_addCheck(e){return new q({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...k.errToObj(e)})}url(e){return this._addCheck({kind:"url",...k.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...k.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...k.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...k.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...k.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...k.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...k.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...k.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...k.errToObj(e)})}datetime(e){var t,r;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(r=null==e?void 0:e.local)&&void 0!==r&&r,...k.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...k.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...k.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...k.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...k.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...k.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...k.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...k.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...k.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...k.errToObj(t)})}nonempty(e){return this.min(1,k.errToObj(e))}trim(){return new q({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new q({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new q({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function K(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n;return parseInt(e.toFixed(o).replace(".",""))%parseInt(t.toFixed(o).replace(".",""))/Math.pow(10,o)}q.create=e=>{var t;return new q({checks:[],typeName:Ce.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...T(e)})};class W extends E{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){this._def.coerce&&(t.data=Number(t.data));if(this._getType(t)!==o.number){const e=this._getOrReturnCtx(t);return f(e,{code:a.invalid_type,expected:o.number,received:e.parsedType}),v}let r;const n=new p;for(const o of this._def.checks)if("int"===o.kind)e.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),f(r,{code:a.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty());else if("min"===o.kind){(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),f(r,{code:a.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty())}else if("max"===o.kind){(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),f(r,{code:a.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty())}else"multipleOf"===o.kind?0!==K(t.data,o.value)&&(r=this._getOrReturnCtx(t,r),f(r,{code:a.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):"finite"===o.kind?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),f(r,{code:a.not_finite,message:o.message}),n.dirty()):e.assertNever(o);return{status:n.value,value:t.data}}gte(e,t){return this.setLimit("min",e,!0,k.toString(t))}gt(e,t){return this.setLimit("min",e,!1,k.toString(t))}lte(e,t){return this.setLimit("max",e,!0,k.toString(t))}lt(e,t){return this.setLimit("max",e,!1,k.toString(t))}setLimit(e,t,r,n){return new W({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:k.toString(n)}]})}_addCheck(e){return new W({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:k.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:k.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((t=>"int"===t.kind||"multipleOf"===t.kind&&e.isInteger(t.value)))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}W.create=e=>new W({checks:[],typeName:Ce.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...T(e)});class H extends E{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){this._def.coerce&&(t.data=BigInt(t.data));if(this._getType(t)!==o.bigint){const e=this._getOrReturnCtx(t);return f(e,{code:a.invalid_type,expected:o.bigint,received:e.parsedType}),v}let r;const n=new p;for(const o of this._def.checks)if("min"===o.kind){(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),f(r,{code:a.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty())}else if("max"===o.kind){(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),f(r,{code:a.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty())}else"multipleOf"===o.kind?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),f(r,{code:a.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):e.assertNever(o);return{status:n.value,value:t.data}}gte(e,t){return this.setLimit("min",e,!0,k.toString(t))}gt(e,t){return this.setLimit("min",e,!1,k.toString(t))}lte(e,t){return this.setLimit("max",e,!0,k.toString(t))}lt(e,t){return this.setLimit("max",e,!1,k.toString(t))}setLimit(e,t,r,n){return new H({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:k.toString(n)}]})}_addCheck(e){return new H({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}H.create=e=>{var t;return new H({checks:[],typeName:Ce.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...T(e)})};class G extends E{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==o.boolean){const t=this._getOrReturnCtx(e);return f(t,{code:a.invalid_type,expected:o.boolean,received:t.parsedType}),v}return m(e.data)}}G.create=e=>new G({typeName:Ce.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...T(e)});class J extends E{_parse(t){this._def.coerce&&(t.data=new Date(t.data));if(this._getType(t)!==o.date){const e=this._getOrReturnCtx(t);return f(e,{code:a.invalid_type,expected:o.date,received:e.parsedType}),v}if(isNaN(t.data.getTime())){return f(this._getOrReturnCtx(t),{code:a.invalid_date}),v}const r=new p;let n;for(const o of this._def.checks)"min"===o.kind?t.data.getTime()<o.value&&(n=this._getOrReturnCtx(t,n),f(n,{code:a.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):"max"===o.kind?t.data.getTime()>o.value&&(n=this._getOrReturnCtx(t,n),f(n,{code:a.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):e.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(e){return new J({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:k.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:k.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}J.create=e=>new J({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Ce.ZodDate,...T(e)});class Y extends E{_parse(e){if(this._getType(e)!==o.symbol){const t=this._getOrReturnCtx(e);return f(t,{code:a.invalid_type,expected:o.symbol,received:t.parsedType}),v}return m(e.data)}}Y.create=e=>new Y({typeName:Ce.ZodSymbol,...T(e)});class X extends E{_parse(e){if(this._getType(e)!==o.undefined){const t=this._getOrReturnCtx(e);return f(t,{code:a.invalid_type,expected:o.undefined,received:t.parsedType}),v}return m(e.data)}}X.create=e=>new X({typeName:Ce.ZodUndefined,...T(e)});class Q extends E{_parse(e){if(this._getType(e)!==o.null){const t=this._getOrReturnCtx(e);return f(t,{code:a.invalid_type,expected:o.null,received:t.parsedType}),v}return m(e.data)}}Q.create=e=>new Q({typeName:Ce.ZodNull,...T(e)});class ee extends E{constructor(){super(...arguments),this._any=!0}_parse(e){return m(e.data)}}ee.create=e=>new ee({typeName:Ce.ZodAny,...T(e)});class te extends E{constructor(){super(...arguments),this._unknown=!0}_parse(e){return m(e.data)}}te.create=e=>new te({typeName:Ce.ZodUnknown,...T(e)});class re extends E{_parse(e){const t=this._getOrReturnCtx(e);return f(t,{code:a.invalid_type,expected:o.never,received:t.parsedType}),v}}re.create=e=>new re({typeName:Ce.ZodNever,...T(e)});class ne extends E{_parse(e){if(this._getType(e)!==o.undefined){const t=this._getOrReturnCtx(e);return f(t,{code:a.invalid_type,expected:o.void,received:t.parsedType}),v}return m(e.data)}}ne.create=e=>new ne({typeName:Ce.ZodVoid,...T(e)});class oe extends E{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==o.array)return f(t,{code:a.invalid_type,expected:o.array,received:t.parsedType}),v;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(e||o)&&(f(t,{code:e?a.too_big:a.too_small,minimum:o?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(f(t,{code:a.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(f(t,{code:a.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map(((e,r)=>n.type._parseAsync(new x(t,e,t.path,r))))).then((e=>p.mergeArray(r,e)));const i=[...t.data].map(((e,r)=>n.type._parseSync(new x(t,e,t.path,r))));return p.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new oe({...this._def,minLength:{value:e,message:k.toString(t)}})}max(e,t){return new oe({...this._def,maxLength:{value:e,message:k.toString(t)}})}length(e,t){return new oe({...this._def,exactLength:{value:e,message:k.toString(t)}})}nonempty(e){return this.min(1,e)}}function ie(e){if(e instanceof ae){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Se.create(ie(n))}return new ae({...e._def,shape:()=>t})}return e instanceof oe?new oe({...e._def,type:ie(e.element)}):e instanceof Se?Se.create(ie(e.unwrap())):e instanceof je?je.create(ie(e.unwrap())):e instanceof fe?fe.create(e.items.map((e=>ie(e)))):e}oe.create=(e,t)=>new oe({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ce.ZodArray,...T(t)});class ae extends E{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const t=this._def.shape(),r=e.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(e){if(this._getType(e)!==o.object){const t=this._getOrReturnCtx(e);return f(t,{code:a.invalid_type,expected:o.object,received:t.parsedType}),v}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof re&&"strip"===this._def.unknownKeys))for(const e in r.data)i.includes(e)||s.push(e);const u=[];for(const e of i){const t=n[e],o=r.data[e];u.push({key:{status:"valid",value:e},value:t._parse(new x(r,o,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof re){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of s)u.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)s.length>0&&(f(r,{code:a.unrecognized_keys,keys:s}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of s){const n=r.data[t];u.push({key:{status:"valid",value:t},value:e._parse(new x(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of u){const r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e})).then((e=>p.mergeObjectSync(t,e))):p.mergeObjectSync(t,u)}get shape(){return this._def.shape()}strict(e){return k.errToObj,new ae({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,o,i,a;const s=null!==(i=null===(o=(n=this._def).errorMap)||void 0===o?void 0:o.call(n,t,r).message)&&void 0!==i?i:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=k.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new ae({...this._def,unknownKeys:"strip"})}passthrough(){return new ae({...this._def,unknownKeys:"passthrough"})}extend(e){return new ae({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ae({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ce.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ae({...this._def,catchall:e})}pick(t){const r={};return e.objectKeys(t).forEach((e=>{t[e]&&this.shape[e]&&(r[e]=this.shape[e])})),new ae({...this._def,shape:()=>r})}omit(t){const r={};return e.objectKeys(this.shape).forEach((e=>{t[e]||(r[e]=this.shape[e])})),new ae({...this._def,shape:()=>r})}deepPartial(){return ie(this)}partial(t){const r={};return e.objectKeys(this.shape).forEach((e=>{const n=this.shape[e];t&&!t[e]?r[e]=n:r[e]=n.optional()})),new ae({...this._def,shape:()=>r})}required(t){const r={};return e.objectKeys(this.shape).forEach((e=>{if(t&&!t[e])r[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Se;)t=t._def.innerType;r[e]=t}})),new ae({...this._def,shape:()=>r})}keyof(){return ge(e.objectKeys(this.shape))}}ae.create=(e,t)=>new ae({shape:()=>e,unknownKeys:"strip",catchall:re.create(),typeName:Ce.ZodObject,...T(t)}),ae.strictCreate=(e,t)=>new ae({shape:()=>e,unknownKeys:"strict",catchall:re.create(),typeName:Ce.ZodObject,...T(t)}),ae.lazycreate=(e,t)=>new ae({shape:e,unknownKeys:"strip",catchall:re.create(),typeName:Ce.ZodObject,...T(t)});class se extends E{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map((async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map((e=>new s(e.ctx.common.issues)));return f(t,{code:a.invalid_union,unionErrors:r}),v}));{let e;const n=[];for(const o of r){const r={...t,common:{...t.common,issues:[]},parent:null},i=o._parseSync({data:t.data,path:t.path,parent:r});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const o=n.map((e=>new s(e)));return f(t,{code:a.invalid_union,unionErrors:o}),v}}get options(){return this._def.options}}se.create=(e,t)=>new se({options:e,typeName:Ce.ZodUnion,...T(t)});const ue=t=>t instanceof he?ue(t.schema):t instanceof ke?ue(t.innerType()):t instanceof be?[t.value]:t instanceof _e?t.options:t instanceof we?e.objectValues(t.enum):t instanceof xe?ue(t._def.innerType):t instanceof X?[void 0]:t instanceof Q?[null]:t instanceof Se?[void 0,...ue(t.unwrap())]:t instanceof je?[null,...ue(t.unwrap())]:t instanceof Ne||t instanceof Ze?ue(t.unwrap()):t instanceof Pe?ue(t._def.innerType):[];class ce extends E{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==o.object)return f(t,{code:a.invalid_type,expected:o.object,received:t.parsedType}),v;const r=this.discriminator,n=t.data[r],i=this.optionsMap.get(n);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(f(t,{code:a.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),v)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const r of t){const t=ue(r.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of t){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,r)}}return new ce({typeName:Ce.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...T(r)})}}function le(t,r){const n=i(t),a=i(r);if(t===r)return{valid:!0,data:t};if(n===o.object&&a===o.object){const n=e.objectKeys(r),o=e.objectKeys(t).filter((e=>-1!==n.indexOf(e))),i={...t,...r};for(const e of o){const n=le(t[e],r[e]);if(!n.valid)return{valid:!1};i[e]=n.data}return{valid:!0,data:i}}if(n===o.array&&a===o.array){if(t.length!==r.length)return{valid:!1};const e=[];for(let n=0;n<t.length;n++){const o=le(t[n],r[n]);if(!o.valid)return{valid:!1};e.push(o.data)}return{valid:!0,data:e}}return n===o.date&&a===o.date&&+t==+r?{valid:!0,data:t}:{valid:!1}}class de extends E{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(h(e)||h(n))return v;const o=le(e.value,n.value);return o.valid?((b(e)||b(n))&&t.dirty(),{status:t.value,value:o.data}):(f(r,{code:a.invalid_intersection_types}),v)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}de.create=(e,t,r)=>new de({left:e,right:t,typeName:Ce.ZodIntersection,...T(r)});class fe extends E{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==o.array)return f(r,{code:a.invalid_type,expected:o.array,received:r.parsedType}),v;if(r.data.length<this._def.items.length)return f(r,{code:a.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),v;!this._def.rest&&r.data.length>this._def.items.length&&(f(r,{code:a.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new x(r,e,r.path,t)):null})).filter((e=>!!e));return r.common.async?Promise.all(n).then((e=>p.mergeArray(t,e))):p.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new fe({...this._def,rest:e})}}fe.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fe({items:e,typeName:Ce.ZodTuple,rest:null,...T(t)})};class pe extends E{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==o.object)return f(r,{code:a.invalid_type,expected:o.object,received:r.parsedType}),v;const n=[],i=this._def.keyType,s=this._def.valueType;for(const e in r.data)n.push({key:i._parse(new x(r,e,r.path,e)),value:s._parse(new x(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?p.mergeObjectAsync(t,n):p.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new pe(t instanceof E?{keyType:e,valueType:t,typeName:Ce.ZodRecord,...T(r)}:{keyType:q.create(),valueType:e,typeName:Ce.ZodRecord,...T(t)})}}class ve extends E{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==o.map)return f(r,{code:a.invalid_type,expected:o.map,received:r.parsedType}),v;const n=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map((([e,t],o)=>({key:n._parse(new x(r,e,r.path,[o,"key"])),value:i._parse(new x(r,t,r.path,[o,"value"]))})));if(r.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const r of s){const n=await r.key,o=await r.value;if("aborted"===n.status||"aborted"===o.status)return v;"dirty"!==n.status&&"dirty"!==o.status||t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const r of s){const n=r.key,o=r.value;if("aborted"===n.status||"aborted"===o.status)return v;"dirty"!==n.status&&"dirty"!==o.status||t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}}}}ve.create=(e,t,r)=>new ve({valueType:t,keyType:e,typeName:Ce.ZodMap,...T(r)});class ye extends E{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==o.set)return f(r,{code:a.invalid_type,expected:o.set,received:r.parsedType}),v;const n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(f(r,{code:a.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(f(r,{code:a.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const i=this._def.valueType;function s(e){const r=new Set;for(const n of e){if("aborted"===n.status)return v;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const u=[...r.data.values()].map(((e,t)=>i._parse(new x(r,e,r.path,t))));return r.common.async?Promise.all(u).then((e=>s(e))):s(u)}min(e,t){return new ye({...this._def,minSize:{value:e,message:k.toString(t)}})}max(e,t){return new ye({...this._def,maxSize:{value:e,message:k.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ye.create=(e,t)=>new ye({valueType:e,minSize:null,maxSize:null,typeName:Ce.ZodSet,...T(t)});class me extends E{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==o.function)return f(t,{code:a.invalid_type,expected:o.function,received:t.parsedType}),v;function r(e,r){return d({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,l(),u].filter((e=>!!e)),issueData:{code:a.invalid_arguments,argumentsError:r}})}function n(e,r){return d({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,l(),u].filter((e=>!!e)),issueData:{code:a.invalid_return_type,returnTypeError:r}})}const i={errorMap:t.common.contextualErrorMap},c=t.data;if(this._def.returns instanceof Oe){const e=this;return m((async function(...t){const o=new s([]),a=await e._def.args.parseAsync(t,i).catch((e=>{throw o.addIssue(r(t,e)),o})),u=await Reflect.apply(c,this,a);return await e._def.returns._def.type.parseAsync(u,i).catch((e=>{throw o.addIssue(n(u,e)),o}))}))}{const e=this;return m((function(...t){const o=e._def.args.safeParse(t,i);if(!o.success)throw new s([r(t,o.error)]);const a=Reflect.apply(c,this,o.data),u=e._def.returns.safeParse(a,i);if(!u.success)throw new s([n(a,u.error)]);return u.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new me({...this._def,args:fe.create(e).rest(te.create())})}returns(e){return new me({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new me({args:e||fe.create([]).rest(te.create()),returns:t||te.create(),typeName:Ce.ZodFunction,...T(r)})}}class he extends E{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}he.create=(e,t)=>new he({getter:e,typeName:Ce.ZodLazy,...T(t)});class be extends E{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return f(t,{received:t.data,code:a.invalid_literal,expected:this._def.value}),v}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ge(e,t){return new _e({values:e,typeName:Ce.ZodEnum,...T(t)})}be.create=(e,t)=>new be({value:e,typeName:Ce.ZodLiteral,...T(t)});class _e extends E{constructor(){super(...arguments),S.set(this,void 0)}_parse(t){if("string"!=typeof t.data){const r=this._getOrReturnCtx(t),n=this._def.values;return f(r,{expected:e.joinValues(n),received:r.parsedType,code:a.invalid_type}),v}if(w(this,S,"f")||O(this,S,new Set(this._def.values),"f"),!w(this,S,"f").has(t.data)){const e=this._getOrReturnCtx(t),r=this._def.values;return f(e,{received:e.data,code:a.invalid_enum_value,options:r}),v}return m(t.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return _e.create(e,{...this._def,...t})}exclude(e,t=this._def){return _e.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}S=new WeakMap,_e.create=ge;class we extends E{constructor(){super(...arguments),j.set(this,void 0)}_parse(t){const r=e.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==o.string&&n.parsedType!==o.number){const t=e.objectValues(r);return f(n,{expected:e.joinValues(t),received:n.parsedType,code:a.invalid_type}),v}if(w(this,j,"f")||O(this,j,new Set(e.getValidEnumValues(this._def.values)),"f"),!w(this,j,"f").has(t.data)){const t=e.objectValues(r);return f(n,{received:n.data,code:a.invalid_enum_value,options:t}),v}return m(t.data)}get enum(){return this._def.values}}j=new WeakMap,we.create=(e,t)=>new we({values:e,typeName:Ce.ZodNativeEnum,...T(t)});class Oe extends E{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==o.promise&&!1===t.common.async)return f(t,{code:a.invalid_type,expected:o.promise,received:t.parsedType}),v;const r=t.parsedType===o.promise?t.data:Promise.resolve(t.data);return m(r.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Oe.create=(e,t)=>new Oe({type:e,typeName:Ce.ZodPromise,...T(t)});class ke extends E{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ce.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:e=>{f(n,e),e.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===o.type){const e=o.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===r.value)return v;const t=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===t.status?v:"dirty"===t.status||"dirty"===r.value?y(t.value):t}));{if("aborted"===r.value)return v;const t=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===t.status?v:"dirty"===t.status||"dirty"===r.value?y(t.value):t}}if("refinement"===o.type){const e=e=>{const t=o.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const t=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===t.status?v:("dirty"===t.status&&r.dirty(),e(t.value),{status:r.value,value:t.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((t=>"aborted"===t.status?v:("dirty"===t.status&&r.dirty(),e(t.value).then((()=>({status:r.value,value:t.value}))))))}if("transform"===o.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!g(e))return e;const t=o.transform(e.value,i);if(t instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:t}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>g(e)?Promise.resolve(o.transform(e.value,i)).then((e=>({status:r.value,value:e}))):e))}e.assertNever(o)}}ke.create=(e,t,r)=>new ke({schema:e,typeName:Ce.ZodEffects,effect:t,...T(r)}),ke.createWithPreprocess=(e,t,r)=>new ke({schema:t,effect:{type:"preprocess",transform:e},typeName:Ce.ZodEffects,...T(r)});class Se extends E{_parse(e){return this._getType(e)===o.undefined?m(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Se.create=(e,t)=>new Se({innerType:e,typeName:Ce.ZodOptional,...T(t)});class je extends E{_parse(e){return this._getType(e)===o.null?m(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}je.create=(e,t)=>new je({innerType:e,typeName:Ce.ZodNullable,...T(t)});class xe extends E{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===o.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}xe.create=(e,t)=>new xe({innerType:e,typeName:Ce.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...T(t)});class Pe extends E{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return _(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new s(r.common.issues)},input:r.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new s(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Pe.create=(e,t)=>new Pe({innerType:e,typeName:Ce.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...T(t)});class Te extends E{_parse(e){if(this._getType(e)!==o.nan){const t=this._getOrReturnCtx(e);return f(t,{code:a.invalid_type,expected:o.nan,received:t.parsedType}),v}return{status:"valid",value:e.data}}}Te.create=e=>new Te({typeName:Ce.ZodNaN,...T(e)});const Ee=Symbol("zod_brand");class Ne extends E{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ve extends E{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?v:"dirty"===e.status?(t.dirty(),y(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})()}{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?v:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new Ve({in:e,out:t,typeName:Ce.ZodPipeline})}}class Ze extends E{_parse(e){const t=this._def.innerType._parse(e),r=e=>(g(e)&&(e.value=Object.freeze(e.value)),e);return _(t)?t.then((e=>r(e))):r(t)}unwrap(){return this._def.innerType}}function Re(e,t={},r){return e?ee.create().superRefine(((n,o)=>{var i,a;if(!e(n)){const e="function"==typeof t?t(n):"string"==typeof t?{message:t}:t,s=null===(a=null!==(i=e.fatal)&&void 0!==i?i:r)||void 0===a||a,u="string"==typeof e?{message:e}:e;o.addIssue({code:"custom",...u,fatal:s})}})):ee.create()}Ze.create=(e,t)=>new Ze({innerType:e,typeName:Ce.ZodReadonly,...T(t)});const Ae={object:ae.lazycreate};var Ce;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Ce||(Ce={}));const Ie=q.create,Me=W.create,Fe=Te.create,Le=H.create,Be=G.create,De=J.create,Ue=Y.create,$e=X.create,ze=Q.create,qe=ee.create,Ke=te.create,We=re.create,He=ne.create,Ge=oe.create,Je=ae.create,Ye=ae.strictCreate,Xe=se.create,Qe=ce.create,et=de.create,tt=fe.create,rt=pe.create,nt=ve.create,ot=ye.create,it=me.create,at=he.create,st=be.create,ut=_e.create,ct=we.create,lt=Oe.create,dt=ke.create,ft=Se.create,pt=je.create,vt=ke.createWithPreprocess,yt=Ve.create,mt={string:e=>q.create({...e,coerce:!0}),number:e=>W.create({...e,coerce:!0}),boolean:e=>G.create({...e,coerce:!0}),bigint:e=>H.create({...e,coerce:!0}),date:e=>J.create({...e,coerce:!0})},ht=v;var bt=Object.freeze({__proto__:null,defaultErrorMap:u,setErrorMap:function(e){c=e},getErrorMap:l,makeIssue:d,EMPTY_PATH:[],addIssueToContext:f,ParseStatus:p,INVALID:v,DIRTY:y,OK:m,isAborted:h,isDirty:b,isValid:g,isAsync:_,get util(){return e},get objectUtil(){return t},ZodParsedType:o,getParsedType:i,ZodType:E,datetimeRegex:z,ZodString:q,ZodNumber:W,ZodBigInt:H,ZodBoolean:G,ZodDate:J,ZodSymbol:Y,ZodUndefined:X,ZodNull:Q,ZodAny:ee,ZodUnknown:te,ZodNever:re,ZodVoid:ne,ZodArray:oe,ZodObject:ae,ZodUnion:se,ZodDiscriminatedUnion:ce,ZodIntersection:de,ZodTuple:fe,ZodRecord:pe,ZodMap:ve,ZodSet:ye,ZodFunction:me,ZodLazy:he,ZodLiteral:be,ZodEnum:_e,ZodNativeEnum:we,ZodPromise:Oe,ZodEffects:ke,ZodTransformer:ke,ZodOptional:Se,ZodNullable:je,ZodDefault:xe,ZodCatch:Pe,ZodNaN:Te,BRAND:Ee,ZodBranded:Ne,ZodPipeline:Ve,ZodReadonly:Ze,custom:Re,Schema:E,ZodSchema:E,late:Ae,get ZodFirstPartyTypeKind(){return Ce},coerce:mt,any:qe,array:Ge,bigint:Le,boolean:Be,date:De,discriminatedUnion:Qe,effect:dt,enum:ut,function:it,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Re((t=>t instanceof e),t),intersection:et,lazy:at,literal:st,map:nt,nan:Fe,nativeEnum:ct,never:We,null:ze,nullable:pt,number:Me,object:Je,oboolean:()=>Be().optional(),onumber:()=>Me().optional(),optional:ft,ostring:()=>Ie().optional(),pipeline:yt,preprocess:vt,promise:lt,record:rt,set:ot,strictObject:Ye,string:Ie,symbol:Ue,transformer:dt,tuple:tt,undefined:$e,union:Xe,unknown:Ke,void:He,NEVER:ht,ZodIssueCode:a,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:s}),gt=/^#(?:[0-9a-fA-F]{3}){1,2}$/,_t=(bt.object({type:bt.string(),data:{sourceVideo:bt.object({videoUrl:bt.string().url(),start:bt.number()}).optional(),offset:bt.number(),duration:bt.number()}}),bt.object({input:bt.object({backgroundColor:bt.string().regex(gt),primaryColor:bt.string().regex(gt),accentColor:bt.string().regex(gt),theme:bt.enum(["default","glitch","glassmorphism","sports","sportsbounce","bigbold","pushpull","none","depth","collabintro"])}),tracks:bt.array(bt.union([bt.object({type:"segments"}),bt.object({type:"segmentx"})])),output:bt.object({orientation:bt.enum(["landscape","portrait","square"]),fps:bt.number().step(30).min(30).max(60),callbackUrl:bt.string().url().optional(),callbackMetadata:bt.any().optional()})}));function wt(e){return wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wt(e)}function Ot(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function kt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ot(Object(r),!0).forEach((function(t){jt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ot(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function St(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,xt(n.key),n)}}function jt(e,t,r){return(t=xt(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xt(e){var t=function(e,t){if("object"!=wt(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=wt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==wt(t)?t:t+""}var Pt=function(e){return e.split("_").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})).join("")},Tt=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("number"==typeof e&&Number.isFinite(e)){var n=r?0:1,o=Math.round(e),i=Math.max(n,o);if(!t)return i;var a=n%2==0?n:n+1;if(i%2==0)return Math.max(a,i);var s=i-1;if(s>=a)return s;var u=i+1;return Math.max(a,u)}};function Et(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Nt(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Nt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var Vt="square",Zt="portrait",Rt="landscape",At=function(){var e=Et((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(":"),2),t=e[0],r=e[1];return t&&r?Number(t)===Number(r)?Vt:Number(t)>Number(r)?Rt:Zt:Rt};function Ct(e){return Ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ct(e)}function It(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Mt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?It(Object(r),!0).forEach((function(t){Ft(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):It(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ft(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Ct(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Ct(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ct(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Lt=function(e){var t,r,n;if(!e)return e;var o=null!==(t=e.face_metadata)&&void 0!==t?t:[],i=o.filter((function(e){var t=e.face_data;return Boolean(t)})),a=o.find((function(e){return"average"===e.aggregation}));return Mt(Mt({},e),{},{metadata:{videoProperties:e.video_properties,frames:i,averageFaceData:null!==(r=null==a?void 0:a.face_data)&&void 0!==r?r:null,averageSampleCount:null!==(n=null==a?void 0:a.sample_count)&&void 0!==n?n:0}})};function Bt(e){return Bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bt(e)}function Dt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ut(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ut(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ut(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function $t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,zt(n.key),n)}}function zt(e){var t=function(e,t){if("object"!=Bt(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Bt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Bt(t)?t:t+""}function qt(e,t,r){return t=Wt(t),function(e,t){if(t&&("object"==Bt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Kt()?Reflect.construct(t,r||[],Wt(e).constructor):t.apply(e,r))}function Kt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Kt=function(){return!!e})()}function Wt(e){return Wt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wt(e)}function Ht(e,t){return Ht=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ht(e,t)}var Gt=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=qt(this,t,[e])).getLayoutProps(e),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ht(e,t)}(t,e),r=t,(n=[{key:"getLayoutProps",value:function(e){var t,r,n,o,i,a,s,u,c=At(e.data.sourceVideo.aspectRatio),l=(null===(t=e.data)||void 0===t?void 0:t.trimLeft)||0,d=(null===(r=e.data)||void 0===r?void 0:r.trimRight)||0;this.config={theme:e.theme,frameColor:e.data.frameColor,logoUrl:e.data.logoUrl,videoUrl:e.data.sourceVideo.videoUrl,videoZoom:e.data.sourceVideo.zoom,sourceVideoOrientation:c,startVideoFrom:Tt(this.fps*((null===(n=e.data.sourceVideo)||void 0===n?void 0:n.start)+l),!0)||0,disableTransitionSounds:null===(o=e.data)||void 0===o?void 0:o.disableTransitionSounds,useSquareInLandscape:(null===(i=e.data)||void 0===i?void 0:i.useSquareInLandscape)||!1,trimLeft:l,trimRight:d,words:e.data.words,noBackgroundVideoUrl:null===(a=e.data.noBackgroundVideo)||void 0===a?void 0:a.videoUrl,noBackgroundVideoEffects:(u=e.data.noBackgroundVideoEffects,u?Object.entries(u).reduce((function(e,t){var r,n=Dt(t,2),o=n[0],i=n[1];return e[o]=!0===(r=i)||"true"===r||1===r||"1"===r,e}),{}):u),faceMetadata:Lt(null===(s=e.data.noBackgroundVideo)||void 0===s?void 0:s.faceMetadata)}}}])&&$t(r.prototype,n),o&&$t(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),jt(this,"fps",30),jt(this,"component",void 0),jt(this,"config",{}),jt(this,"props",{}),jt(this,"from",void 0),jt(this,"durationInFrames",void 0),jt(this,"to",void 0);var r=t.data.duration-(t.data.trimLeft||0)-(t.data.trimRight||0);this.from=this.fps*t.data.offset||0,this.durationInFrames=Tt(this.fps*r),this.to=this.from+this.durationInFrames,this.component=Pt(t.type)},(t=[{key:"flatten",value:function(){return kt(kt({fps:this.fps,from:this.from,to:this.to,durationInFrames:this.durationInFrames,component:this.component},this.config),this.props)}}])&&St(e.prototype,t),r&&St(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}());function Jt(e){return Jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jt(e)}function Yt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Xt(n.key),n)}}function Xt(e){var t=function(e,t){if("object"!=Jt(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Jt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Jt(t)?t:t+""}function Qt(e,t,r){return t=tr(t),function(e,t){if(t&&("object"==Jt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,er()?Reflect.construct(t,r||[],tr(e).constructor):t.apply(e,r))}function er(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(er=function(){return!!e})()}function tr(e){return tr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},tr(e)}function rr(e,t){return rr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rr(e,t)}var nr=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Qt(this,t,[e])).getVideoProps(e),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rr(e,t)}(t,e),r=t,(n=[{key:"getVideoProps",value:function(e){var t,r,n,o,i,a,s,u;this.props={noBackgroundVideoEffects:e.data.noBackgroundVideoEffects,noBackgroundVideoUrl:null===(t=e.data.noBackgroundVideo)||void 0===t?void 0:t.videoUrl,faceMetadata:Lt(null===(r=e.data.noBackgroundVideo)||void 0===r?void 0:r.faceMetadata),videoUrl:null===(n=e.data.sourceVideo)||void 0===n?void 0:n.videoUrl,videoZoom:(null===(o=e.data.sourceVideo)||void 0===o?void 0:o.zoom)||1,disableTransitionSounds:null===(i=e.data)||void 0===i?void 0:i.disableTransitionSounds,useSquareInLandscape:(null==e||null===(a=e.data)||void 0===a?void 0:a.useSquareInLandscape)||!1,brollUrl:null===(s=e.data)||void 0===s?void 0:s.brollUrl,sentenceText:null===(u=e.data)||void 0===u?void 0:u.sentenceText,theme:null==e?void 0:e.theme}}}])&&Yt(r.prototype,n),o&&Yt(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Gt);function or(e){return or="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},or(e)}function ir(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ar(n.key),n)}}function ar(e){var t=function(e,t){if("object"!=or(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=or(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==or(t)?t:t+""}function sr(e,t,r){return t=cr(t),function(e,t){if(t&&("object"==or(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ur()?Reflect.construct(t,r||[],cr(e).constructor):t.apply(e,r))}function ur(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ur=function(){return!!e})()}function cr(e){return cr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cr(e)}function lr(e,t){return lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},lr(e,t)}var dr="LEFT_TO_RIGHT",fr="RIGHT_TO_LEFT",pr=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=sr(this,t,[e])).getVideoProps(e),r.getLayoutVariant(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lr(e,t)}(t,e),r=t,(n=[{key:"getLayoutVariant",value:function(){this.props.variant||(this.props.variant=[dr,fr][process.env.REACT_APP_DOMAIN?0:Math.floor(2*Math.random())])}},{key:"getVideoProps",value:function(e){var t,r,n,o,i,a=At(null===(t=e.data.sourceVideo)||void 0===t?void 0:t.aspectRatio);this.props={videoUrl:null===(r=e.data.sourceVideo)||void 0===r?void 0:r.videoUrl,sourceVideoOrientation:a,videoZoom:(null===(n=e.data.sourceVideo)||void 0===n?void 0:n.zoom)||1,text:e.data.text,disableTransitionSounds:null===(o=e.data)||void 0===o?void 0:o.disableTransitionSounds,useSquareInLandscape:(null===(i=e.data)||void 0===i?void 0:i.useSquareInLandscape)||!1}}}])&&ir(r.prototype,n),o&&ir(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Gt);function vr(e){return vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vr(e)}function yr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,mr(n.key),n)}}function mr(e){var t=function(e,t){if("object"!=vr(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=vr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==vr(t)?t:t+""}function hr(e,t,r){return t=gr(t),function(e,t){if(t&&("object"==vr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,br()?Reflect.construct(t,r||[],gr(e).constructor):t.apply(e,r))}function br(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(br=function(){return!!e})()}function gr(e){return gr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},gr(e)}function _r(e,t){return _r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_r(e,t)}var wr=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=hr(this,t,[e])).getVideoProps(e),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_r(e,t)}(t,e),r=t,(n=[{key:"getVideoProps",value:function(e){var t,r,n,o,i,a,s,u,c,l,d,f,p,v,y,m,h,b,g,_,w,O,k=At(null===(t=e.data.sourceVideo)||void 0===t?void 0:t.aspectRatio);this.props={startFirstVideoFrom:Tt(this.fps*((null===(r=e.data)||void 0===r?void 0:r.startFirstVideoFrom)+((null===(n=e.data)||void 0===n?void 0:n.trimLeft)||0)),!0)||0,firstVideoFile:null===(o=e.data)||void 0===o?void 0:o.firstVideoFile,firstVideoDuration:(null===(i=e.data)||void 0===i?void 0:i.firstVideoDuration)-((null===(a=e.data)||void 0===a?void 0:a.trimLeft)||0),firstNoBackgroundVideoUrl:null===(s=e.data)||void 0===s||null===(u=s.firstNoBackgroundVideo)||void 0===u?void 0:u.videoUrl,firstNoBackgroundFaceMetadata:Lt(null===(c=e.data)||void 0===c||null===(l=c.firstNoBackgroundVideo)||void 0===l?void 0:l.faceMetadata),startSecondVideoFrom:Tt(this.fps*(null===(d=e.data)||void 0===d?void 0:d.startSecondVideoFrom),!0)||0,firstVideoDurationWithoutLastSegment:null===(f=e.data)||void 0===f?void 0:f.firstVideoDurationWithoutLastSegment,secondVideoFile:null===(p=e.data)||void 0===p?void 0:p.secondVideoFile,secondNoBackgroundVideoUrl:null===(v=e.data)||void 0===v||null===(y=v.secondNoBackgroundVideo)||void 0===y?void 0:y.videoUrl,secondNoBackgroundFaceMetadata:Lt(null===(m=e.data)||void 0===m||null===(h=m.secondNoBackgroundVideo)||void 0===h?void 0:h.faceMetadata),videoUrl:null===(b=e.data.sourceVideo)||void 0===b?void 0:b.videoUrl,sourceVideoOrientation:k,videoZoom:(null===(g=e.data.sourceVideo)||void 0===g?void 0:g.zoom)||1,useSquareInLandscapeFirstVideo:(null===(_=e.data)||void 0===_?void 0:_.useSquareInLandscapeFirstVideo)||!1,useSquareInLandscapeSecondVideo:(null===(w=e.data)||void 0===w?void 0:w.useSquareInLandscapeSecondVideo)||!1,text:e.data.text,handoffOverlapSeconds:(null===(O=e.data)||void 0===O?void 0:O.handoffOverlapSeconds)||0}}}])&&yr(r.prototype,n),o&&yr(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Gt);function Or(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return kr(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?kr(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var Sr=function(e){return e?Object.entries(e).reduce((function(e,t){var r=Or(t,2),n=r[0],o=r[1];return e[n]=function(e){return!0===e||"true"===e||1===e||"1"===e}(o),e}),{}):e},jr=function(e,t){var r,n,o,i,a,s;if(!e)return{};var u=(null==e?void 0:e.trimLeft)||0,c=null!=e&&null!==(r=e.sourceVideo)&&void 0!==r&&r.aspectRatio?At(e.sourceVideo.aspectRatio):void 0;return{firstVideoFile:null==e?void 0:e.firstVideoFile,firstNoBackgroundVideoUrl:null==e||null===(n=e.firstNoBackgroundVideo)||void 0===n?void 0:n.videoUrl,firstNoBackgroundFaceMetadata:Lt(null==e||null===(o=e.firstNoBackgroundVideo)||void 0===o?void 0:o.faceMetadata),startSecondVideoFrom:Tt(t*((null==e?void 0:e.startSecondVideoFrom)||0),!0)||0,secondVideoFile:null==e?void 0:e.secondVideoFile,text:null==e?void 0:e.text,fullName:null==e?void 0:e.fullName,name:null==e?void 0:e.fullName,title:null==e?void 0:e.title,collaboratorName:null==e?void 0:e.collaboratorName,collaboratorTitle:null==e?void 0:e.collaboratorTitle,topicLabel:null==e?void 0:e.topicLabel,activeSpeaker:null==e?void 0:e.activeSpeaker,noBackgroundVideoEffects:Sr(null==e?void 0:e.noBackgroundVideoEffects),sourceVideoOrientation:c,startVideoFrom:Tt(t*(((null==e||null===(i=e.sourceVideo)||void 0===i?void 0:i.start)||0)+u),!0)||0,videoUrl:null==e||null===(a=e.sourceVideo)||void 0===a?void 0:a.videoUrl,videoZoom:null==e||null===(s=e.sourceVideo)||void 0===s?void 0:s.zoom}};function xr(e){return xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xr(e)}function Pr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Tr(n.key),n)}}function Tr(e){var t=function(e,t){if("object"!=xr(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=xr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==xr(t)?t:t+""}function Er(e,t,r){return t=Vr(t),function(e,t){if(t&&("object"==xr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Nr()?Reflect.construct(t,r||[],Vr(e).constructor):t.apply(e,r))}function Nr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Nr=function(){return!!e})()}function Vr(e){return Vr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Vr(e)}function Zr(e,t){return Zr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Zr(e,t)}var Rr=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Er(this,t,[e])).getVideoProps(e),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zr(e,t)}(t,e),r=t,(n=[{key:"getVideoProps",value:function(e){this.props=jr(e.data,this.fps)}}])&&Pr(r.prototype,n),o&&Pr(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Gt);function Ar(e){return Ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ar(e)}function Cr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ir(n.key),n)}}function Ir(e){var t=function(e,t){if("object"!=Ar(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Ar(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ar(t)?t:t+""}function Mr(e,t,r){return t=Lr(t),function(e,t){if(t&&("object"==Ar(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Fr()?Reflect.construct(t,r||[],Lr(e).constructor):t.apply(e,r))}function Fr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fr=function(){return!!e})()}function Lr(e){return Lr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Lr(e)}function Br(e,t){return Br=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Br(e,t)}var Dr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Mr(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Br(e,t)}(t,e),r=t,n&&Cr(r.prototype,n),o&&Cr(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Rr);function Ur(e){return Ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ur(e)}function $r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,zr(n.key),n)}}function zr(e){var t=function(e,t){if("object"!=Ur(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Ur(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ur(t)?t:t+""}function qr(e,t,r){return t=Wr(t),function(e,t){if(t&&("object"==Ur(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Kr()?Reflect.construct(t,r||[],Wr(e).constructor):t.apply(e,r))}function Kr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Kr=function(){return!!e})()}function Wr(e){return Wr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wr(e)}function Hr(e,t){return Hr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Hr(e,t)}var Gr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),qr(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hr(e,t)}(t,e),r=t,n&&$r(r.prototype,n),o&&$r(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Rr);function Jr(e){return Jr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jr(e)}function Yr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Xr(n.key),n)}}function Xr(e){var t=function(e,t){if("object"!=Jr(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Jr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Jr(t)?t:t+""}function Qr(e,t,r){return t=tn(t),function(e,t){if(t&&("object"==Jr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,en()?Reflect.construct(t,r||[],tn(e).constructor):t.apply(e,r))}function en(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(en=function(){return!!e})()}function tn(e){return tn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},tn(e)}function rn(e,t){return rn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rn(e,t)}var nn=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Qr(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rn(e,t)}(t,e),r=t,n&&Yr(r.prototype,n),o&&Yr(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Rr);function on(e){return on="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},on(e)}function an(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,sn(n.key),n)}}function sn(e){var t=function(e,t){if("object"!=on(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=on(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==on(t)?t:t+""}function un(e,t,r){return t=ln(t),function(e,t){if(t&&("object"==on(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,cn()?Reflect.construct(t,r||[],ln(e).constructor):t.apply(e,r))}function cn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cn=function(){return!!e})()}function ln(e){return ln=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ln(e)}function dn(e,t){return dn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},dn(e,t)}var fn=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),un(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dn(e,t)}(t,e),r=t,n&&an(r.prototype,n),o&&an(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Rr);function pn(e){return pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pn(e)}function vn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,yn(n.key),n)}}function yn(e){var t=function(e,t){if("object"!=pn(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=pn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==pn(t)?t:t+""}function mn(e,t,r){return t=bn(t),function(e,t){if(t&&("object"==pn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,hn()?Reflect.construct(t,r||[],bn(e).constructor):t.apply(e,r))}function hn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hn=function(){return!!e})()}function bn(e){return bn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bn(e)}function gn(e,t){return gn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gn(e,t)}var _n=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),mn(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gn(e,t)}(t,e),r=t,n&&vn(r.prototype,n),o&&vn(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Rr);function wn(e){return wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wn(e)}function On(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,kn(n.key),n)}}function kn(e){var t=function(e,t){if("object"!=wn(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=wn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==wn(t)?t:t+""}function Sn(e,t,r){return t=xn(t),function(e,t){if(t&&("object"==wn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,jn()?Reflect.construct(t,r||[],xn(e).constructor):t.apply(e,r))}function jn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(jn=function(){return!!e})()}function xn(e){return xn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xn(e)}function Pn(e,t){return Pn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Pn(e,t)}var Tn=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Sn(this,t,[e])).getVideoProps(e),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pn(e,t)}(t,e),r=t,(n=[{key:"getVideoProps",value:function(e){var t,r,n,o;this.props={videoUrl:null===(t=e.data.sourceVideo)||void 0===t?void 0:t.videoUrl,imageUrl:e.data.imageUrl,videoZoom:(null===(r=e.data.sourceVideo)||void 0===r?void 0:r.zoom)||1,disableTransitionSounds:null===(n=e.data)||void 0===n?void 0:n.disableTransitionSounds,useSquareInLandscape:(null===(o=e.data)||void 0===o?void 0:o.useSquareInLandscape)||!1}}}])&&On(r.prototype,n),o&&On(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Gt);function En(e){return En="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},En(e)}function Nn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Vn(n.key),n)}}function Vn(e){var t=function(e,t){if("object"!=En(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=En(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==En(t)?t:t+""}function Zn(e,t,r){return t=An(t),function(e,t){if(t&&("object"==En(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Rn()?Reflect.construct(t,r||[],An(e).constructor):t.apply(e,r))}function Rn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Rn=function(){return!!e})()}function An(e){return An=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},An(e)}function Cn(e,t){return Cn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Cn(e,t)}var In=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Zn(this,t,[e])).getVideoProps(e),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cn(e,t)}(t,e),r=t,(n=[{key:"getVideoProps",value:function(e){var t,r,n,o;this.props={videoUrl:null===(t=e.data.sourceVideo)||void 0===t?void 0:t.videoUrl,videoZoom:(null===(r=e.data.sourceVideo)||void 0===r?void 0:r.zoom)||1,disableTransitionSounds:null===(n=e.data)||void 0===n?void 0:n.disableTransitionSounds,words:e.data.words,useSquareInLandscape:(null===(o=e.data)||void 0===o?void 0:o.useSquareInLandscape)||!1}}}])&&Nn(r.prototype,n),o&&Nn(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Gt);function Mn(e){return Mn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mn(e)}function Fn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ln(n.key),n)}}function Ln(e){var t=function(e,t){if("object"!=Mn(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Mn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Mn(t)?t:t+""}function Bn(e,t,r){return t=Un(t),function(e,t){if(t&&("object"==Mn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Dn()?Reflect.construct(t,r||[],Un(e).constructor):t.apply(e,r))}function Dn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Dn=function(){return!!e})()}function Un(e){return Un=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Un(e)}function $n(e,t){return $n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$n(e,t)}var zn=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Bn(this,t,[e])).getVideoProps(e),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$n(e,t)}(t,e),r=t,(n=[{key:"getVideoProps",value:function(e){var t;this.props={sentenceText:e.data.sentenceText,sentenceTextTwo:e.data.sentenceTextTwo,useSquareInLandscape:(null===(t=e.data)||void 0===t?void 0:t.useSquareInLandscape)||!1}}}])&&Fn(r.prototype,n),o&&Fn(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Gt);function qn(e){return qn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qn(e)}function Kn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Wn(n.key),n)}}function Wn(e){var t=function(e,t){if("object"!=qn(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=qn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==qn(t)?t:t+""}function Hn(e,t,r){return t=Jn(t),function(e,t){if(t&&("object"==qn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Gn()?Reflect.construct(t,r||[],Jn(e).constructor):t.apply(e,r))}function Gn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Gn=function(){return!!e})()}function Jn(e){return Jn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Jn(e)}function Yn(e,t){return Yn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Yn(e,t)}var Xn=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Hn(this,t,[e])).getVideoProps(e),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yn(e,t)}(t,e),r=t,(n=[{key:"getVideoProps",value:function(e){var t,r,n,o,i,a,s,u,c,l,d,f,p,v,y,m;this.props={videoUrl:null===(t=e.data.sourceVideo)||void 0===t?void 0:t.videoUrl,videoZoom:(null===(r=e.data.sourceVideo)||void 0===r?void 0:r.zoom)||1,disableTransitionSounds:null===(n=e.data)||void 0===n?void 0:n.disableTransitionSounds,triangleSize:(null===(o=e.data)||void 0===o?void 0:o.triangleSize)||600,triangleColor:(null===(i=e.data)||void 0===i?void 0:i.triangleColor)||"#00FF7F",triangleBorderWidth:(null===(a=e.data)||void 0===a?void 0:a.triangleBorderWidth)||20,borderRadius:(null===(s=e.data)||void 0===s?void 0:s.borderRadius)||80,rotationSpeed:(null===(u=e.data)||void 0===u?void 0:u.rotationSpeed)||30,horizontalMovement:(null===(c=e.data)||void 0===c?void 0:c.horizontalMovement)||0,verticalMovement:(null===(l=e.data)||void 0===l?void 0:l.verticalMovement)||0,maskStartScale:void 0!==(null===(d=e.data)||void 0===d?void 0:d.maskStartScale)?e.data.maskStartScale:10,maskEndScale:void 0!==(null===(f=e.data)||void 0===f?void 0:f.maskEndScale)?e.data.maskEndScale:1,maskAnimationDuration:(null===(p=e.data)||void 0===p?void 0:p.maskAnimationDuration)||2,sentenceText:null===(v=e.data)||void 0===v?void 0:v.sentenceText,text:null===(y=e.data)||void 0===y?void 0:y.text,useSquareInLandscape:(null===(m=e.data)||void 0===m?void 0:m.useSquareInLandscape)||!1}}}])&&Kn(r.prototype,n),o&&Kn(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Gt);function Qn(e){return Qn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qn(e)}function eo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,to(n.key),n)}}function to(e){var t=function(e,t){if("object"!=Qn(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Qn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Qn(t)?t:t+""}function ro(e,t,r){return t=oo(t),function(e,t){if(t&&("object"==Qn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,no()?Reflect.construct(t,r||[],oo(e).constructor):t.apply(e,r))}function no(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(no=function(){return!!e})()}function oo(e){return oo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oo(e)}function io(e,t){return io=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},io(e,t)}var ao=function(e){return!0===e||"true"===e||1===e||"1"===e},so=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=ro(this,t,[e])).getVideoProps(e),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&io(e,t)}(t,e),r=t,(n=[{key:"getVideoProps",value:function(e){var t,r,n,o,i,a,s,u,c,l,d,f,p,v;this.props={videoUrl:null===(t=e.data.sourceVideo)||void 0===t?void 0:t.videoUrl,videoZoom:(null===(r=e.data.sourceVideo)||void 0===r?void 0:r.zoom)||1,disableTransitionSounds:null===(n=e.data)||void 0===n?void 0:n.disableTransitionSounds,useSquareInLandscape:(null===(o=e.data)||void 0===o?void 0:o.useSquareInLandscape)||!1,hookText:null===(i=e.data)||void 0===i?void 0:i.hookText,hookStyle:(null===(a=e.data)||void 0===a?void 0:a.hookStyle)||"punch_zoom",hookDurationSeconds:null!==(s=null===(u=e.data)||void 0===u?void 0:u.hookDurationSeconds)&&void 0!==s?s:1.6,hookAccentText:null===(c=e.data)||void 0===c?void 0:c.hookAccentText,hookSubtext:null===(l=e.data)||void 0===l?void 0:l.hookSubtext,disableHookSounds:(null===(d=e.data)||void 0===d?void 0:d.disableHookSounds)||!1,disableHookExitEffect:ao(null===(f=e.data)||void 0===f?void 0:f.disableHookExitEffect),hookThreeGlitchEffectEnabled:ao(null===(p=e.data)||void 0===p?void 0:p.hookThreeGlitchEffectEnabled),disableHookThreeGlitchEffect:ao(null===(v=e.data)||void 0===v?void 0:v.disableHookThreeGlitchEffect)}}}])&&eo(r.prototype,n),o&&eo(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Gt);function uo(e){return uo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uo(e)}function co(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,lo(n.key),n)}}function lo(e){var t=function(e,t){if("object"!=uo(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=uo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==uo(t)?t:t+""}function fo(e,t,r){return t=vo(t),function(e,t){if(t&&("object"==uo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,po()?Reflect.construct(t,r||[],vo(e).constructor):t.apply(e,r))}function po(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(po=function(){return!!e})()}function vo(e){return vo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vo(e)}function yo(e,t){return yo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yo(e,t)}var mo=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=fo(this,t,[e])).getVideoProps(e),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yo(e,t)}(t,e),r=t,(n=[{key:"getVideoProps",value:function(e){var t,r,n,o=this,i=(null===(t=e.data)||void 0===t?void 0:t.trimLeft)||0,a=Array.isArray(null===(r=e.data)||void 0===r?void 0:r.videos)?e.data.videos:[];this.props={videos:a.map((function(e,t){var r,n,a=0===t?i:0;return{videoFile:null==e?void 0:e.videoFile,videoDuration:((null==e?void 0:e.videoDuration)||0)-a,speakerRole:(null==e?void 0:e.speakerRole)||null,startVideoFrom:Tt(o.fps*(((null==e?void 0:e.startVideoFrom)||0)+a),!0)||0,noBackgroundVideoUrl:null==e||null===(r=e.noBackgroundVideo)||void 0===r?void 0:r.videoUrl,noBackgroundFaceMetadata:Lt(null==e||null===(n=e.noBackgroundVideo)||void 0===n?void 0:n.faceMetadata),useSquareInLandscape:(null==e?void 0:e.useSquareInLandscape)||!1}})),handoffOverlapSeconds:Array.isArray(null===(n=e.data)||void 0===n?void 0:n.handoffOverlapSeconds)?e.data.handoffOverlapSeconds:[]}}}])&&co(r.prototype,n),o&&co(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Gt);function ho(e){return ho="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ho(e)}function bo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,go(n.key),n)}}function go(e){var t=function(e,t){if("object"!=ho(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=ho(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ho(t)?t:t+""}var _o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},r=[{key:"createObject",value:function(e){switch(e.type){case"text_with_video":return new pr(e).flatten();case"broll_background":case"simple_frame_broll":case"simple_frame_sentence":case"broll_split_screen":case"broll_green_screen":case"broll_studio_backdrop":case"key_point_overlay_depth":case"simple_frame":return new nr(e).flatten();case"handoff":return new wr(e).flatten();case"multi_handoff":return new mo(e).flatten();case"creator_collab_split":return new Rr(e).flatten();case"creator_collab_cold_open":return new Dr(e).flatten();case"creator_collab_documentary_inset":return new Gr(e).flatten();case"creator_collab_rack_focus":return new nn(e).flatten();case"creator_collab_studio_set":return new fn(e).flatten();case"creator_collab_conversation_spine":return new _n(e).flatten();case"motion_still":case"motion_still_green_screen":case"motion_still_full_screen":case"motion_still_studio_backdrop":return new Tn(e).flatten();case"keyword":return new In(e).flatten();case"intro_video":return new zn(e).flatten();case"dynamic_triangle":return new Xn(e).flatten();case"hook_video":return new so(e).flatten();default:return new Gt(e).flatten()}}}],(t=null)&&bo(e.prototype,t),r&&bo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}(),wo={none:{durationInFrames:15,presentation:"glitchOnePresentation"}};function Oo(e){return Oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Oo(e)}function ko(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return So(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?So(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function So(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function jo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jo(Object(r),!0).forEach((function(t){Po(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Po(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Oo(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Oo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Oo(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var To=1e-6,Eo=function(e){if(void 0!==e)return JSON.parse(JSON.stringify(e))},No=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=Number(e);return Number.isFinite(r)?r:t},Vo=function(e){return!0===e||"true"===e||1===e||"1"===e},Zo=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?t<=e+To?null:{start:e,end:t}:null},Ro=function(e){return Number.isFinite(e)&&e>Math.max(To,.26-To)},Ao=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!Array.isArray(e)||0===e.length)return[];var t=e.map((function(e){return Zo(null==e?void 0:e.start,null==e?void 0:e.end)})).filter(Boolean).sort((function(e,t){return e.start-t.start}));return 0===t.length?[]:t.reduce((function(e,t){var r=e[e.length-1];return r&&t.start<=r.end+To?(r.end=Math.max(r.end,t.end),e):(e.push(xo({},t)),e)}),[])},Co=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=No(null==e?void 0:e.start,null),n=No(null==e?void 0:e.end,null);if(!Number.isFinite(r)||!Number.isFinite(n)||n<=r+To)return[];if(!Array.isArray(t)||0===t.length)return[{start:r,end:n}];var o,i=[],a=r,s=ko(Ao(t));try{for(s.s();!(o=s.n()).done;){var u=o.value;if(!(u.end<=a+To)){if(u.start>=n-To)break;if(u.start>a+To&&i.push({start:a,end:Math.min(u.start,n)}),(a=Math.max(a,u.end))>=n-To)break}}}catch(e){s.e(e)}finally{s.f()}return a<n-To&&i.push({start:a,end:n}),i.filter((function(e){return e.end>e.start+To}))},Io=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=No(e,null);if(!Number.isFinite(r))return 0;if(!Array.isArray(t)||0===t.length)return r;var n,o=0,i=ko(t);try{for(i.s();!(n=i.n()).done;){var a=n.value;if(a.start>=r)break;o+=Math.max(0,Math.min(r,a.end)-a.start)}}catch(e){i.e(e)}finally{i.f()}return Math.max(0,r-o)},Mo=function(e){return"string"==typeof(null==e?void 0:e.type)&&e.type.includes("caption")},Fo=function(e){var t,r,n,o,i,a,s=Math.max(0,No(null==e||null===(t=e.layout)||void 0===t||null===(r=t.data)||void 0===r?void 0:r.duration,0)),u=Math.max(0,No(null==e||null===(n=e.layout)||void 0===n||null===(o=n.data)||void 0===o?void 0:o.trimLeft,0)),c=Math.max(0,No(null==e||null===(i=e.layout)||void 0===i||null===(a=i.data)||void 0===a?void 0:a.trimRight,0)),l=u,d=Math.max(l,s-c);return{duration:s,trimLeft:u,trimRight:c,playableStart:l,playableEnd:d,playableDuration:Math.max(0,d-l)}},Lo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!Array.isArray(e))return[];var t=[];return e.forEach((function(e){if(Vo(null==e?void 0:e.disabled)){var r=No(null==e?void 0:e.offset,null),n=No(null==e?void 0:e.duration,null);!Number.isFinite(r)||!Number.isFinite(n)||n<=To||t.push({start:r,end:r+n})}})),Ao(t)},Bo=function(e,t){var r=Array.isArray(null==e?void 0:e.effects)?e.effects:[],n=[];return r.forEach((function(e){var r;Mo(e)&&Lo((null==e||null===(r=e.data)||void 0===r?void 0:r.transcript_text)||[]).forEach((function(e){var r=function(e,t,r){var n=Math.max(e.start,t),o=Math.min(e.end,r);return Zo(n,o)}(e,t.playableStart,t.playableEnd);r&&n.push(r)}))})),Ao(n)},Do=function(e){var t=e.transcript,r=e.rangeStart,n=e.rangeEnd,o=e.offsetMode,i=e.offsetBase,a=void 0===i?0:i,s=e.stripDisabled;if(!t)return null;if(void 0!==s&&s&&Vo(null==t?void 0:t.disabled))return null;var u=No(null==t?void 0:t.offset,null),c=No(null==t?void 0:t.duration,null);if(!Number.isFinite(u)||!Number.isFinite(c)||c<=To)return null;var l=u+c,d=Math.max(u,r),f=Math.min(l,n);if(f<=d+To)return null;var p=Eo(t),v=function(e){return"relative"===o?e-a:e};p.offset=v(d),p.duration=f-d;var y=(Array.isArray(null==t?void 0:t.punctuations)?t.punctuations:[]).map((function(e){var t=No(null==e?void 0:e.start,null),r=No(null==e?void 0:e.end,null);if(!Number.isFinite(t)||!Number.isFinite(r)||r<=t+To)return null;var n=Math.max(t,d),o=Math.min(r,f);return o<=n+To?null:xo(xo({},e),{},{start:v(n),end:v(o)})})).filter(Boolean);if((d>u+To||f<l-To)&&y.length>0){var m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!Array.isArray(t)||0===t.length)return{text:e,punctuations:[]};if("string"!=typeof e)return{text:e,punctuations:t};var r=e.split(" ");if(0===r.length)return{text:e,punctuations:t};var n=[],o=new Set;if(t.forEach((function(e){var t=No(null==e?void 0:e.index,null);Number.isInteger(t)&&(t<0||t>=r.length||o.has(t)||(o.add(t),n.push(t)))})),0===n.length)return{text:e,punctuations:[]};var i=n.map((function(e){return r[e]})).filter((function(e){return void 0!==e}));if(0===i.length)return{text:e,punctuations:[]};var a=new Map(n.map((function(e,t){return[e,t]}))),s=t.filter((function(e){return a.has(No(null==e?void 0:e.index,null))})).map((function(e){return xo(xo({},e),{},{index:a.get(No(null==e?void 0:e.index,null))})}));return{text:i.join(" "),punctuations:s}}(null==t?void 0:t.text,y),h=m.text,b=m.punctuations;p.text=h,p.punctuations=b}else p.text=null==t?void 0:t.text,p.punctuations=y;return p},Uo=function(e){var t=e.transcripts,r=e.rangeStart,n=e.rangeEnd,o=e.offsetMode,i=e.offsetBase,a=e.stripDisabled;return Array.isArray(t)?t.map((function(e){return Do({transcript:e,rangeStart:r,rangeEnd:n,offsetMode:o,offsetBase:i,stripDisabled:a})})).filter(Boolean):[]},$o=function(e,t,r){if(!e||!Array.isArray(null==e?void 0:e.segments))return e;var n=[];return e.segments.forEach((function(e){var o,i=No(null==e||null===(o=e.data)||void 0===o?void 0:o.offset,0),a=function(e,t){var r,n,o=No(null==e||null===(r=e.data)||void 0===r?void 0:r.duration,null);if(Number.isFinite(o)&&o>To)return o;if("caption"!==t)return null;var i=(Array.isArray(null==e||null===(n=e.data)||void 0===n?void 0:n.transcript_text)?e.data.transcript_text:[]).reduce((function(e,t){var r=No(null==t?void 0:t.offset,null),n=No(null==t?void 0:t.duration,null);return!Number.isFinite(r)||!Number.isFinite(n)||n<=To?e:Math.max(e,r+n)}),0);return i>To?i:null}(e,r);if(!Number.isFinite(a)||a<=To){var s,u=Eo(e);if(u.data=u.data||{},u.data.offset=Io(i,t),"caption"===r&&(u.data.transcript_text=Uo({transcripts:(null==e||null===(s=e.data)||void 0===s?void 0:s.transcript_text)||[],rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,offsetMode:"relative",offsetBase:0,stripDisabled:!0}),0===u.data.transcript_text.length))return;n.push(u)}else{Co({start:i,end:i+a},t).forEach((function(o){var a=o.end-o.start;if(Ro(a)){var s=Eo(e);if(s.data=s.data||{},s.data.offset=Io(o.start,t),s.data.duration=a,function(e,t){var r,n,o,i;if(null!=e&&e.data&&Number.isFinite(t)&&0!==t){var a=No(null==e||null===(r=e.data)||void 0===r||null===(n=r.sourceVideo)||void 0===n?void 0:n.start,null);Number.isFinite(a)&&(e.data.sourceVideo.start=Math.max(0,a+t));var s=No(null==e||null===(o=e.data)||void 0===o||null===(i=o.sourceAudio)||void 0===i?void 0:i.start,null);Number.isFinite(s)&&(e.data.sourceAudio.start=Math.max(0,s+t))}}(s,o.start-i),"caption"===r){var u,c=o.start-i,l=o.end-i;if(s.data.transcript_text=Uo({transcripts:(null==e||null===(u=e.data)||void 0===u?void 0:u.transcript_text)||[],rangeStart:c,rangeEnd:l,offsetMode:"relative",offsetBase:c,stripDisabled:!0}),0===s.data.transcript_text.length)return}n.push(s)}}))}})),xo(xo({},e),{},{segments:n})},zo=function(e){var t=Eo(e)||{};if(!Array.isArray(null==t?void 0:t.tracks))return t;var r=function(e){var t,r,n=[],o=null==e||null===(t=e.tracks)||void 0===t?void 0:t.find((function(e){return"segment"===e.type})),i=null==e||null===(r=e.tracks)||void 0===r?void 0:r.find((function(e){return"caption"===e.type})),a=0;return Array.isArray(null==o?void 0:o.segments)&&o.segments.forEach((function(e){var t=Fo(e);Bo(e,t).forEach((function(e){var r=a+(e.start-t.trimLeft),o=a+(e.end-t.trimLeft),i=Zo(r,o);i&&n.push(i)})),a+=t.playableDuration})),Array.isArray(null==i?void 0:i.segments)&&i.segments.forEach((function(e){var t,r,o=No(null==e||null===(t=e.data)||void 0===t?void 0:t.offset,0);Lo((null==e||null===(r=e.data)||void 0===r?void 0:r.transcript_text)||[]).forEach((function(e){var t=Zo(o+e.start,o+e.end);t&&n.push(t)}))})),Ao(n)}(t);return 0===r.length||(t.tracks=t.tracks.map((function(e){if(!e||!Array.isArray(null==e?void 0:e.segments))return e;switch(e.type){case"segment":return function(e,t){if(!e||!Array.isArray(null==e?void 0:e.segments))return e;var r=[],n=0;return e.segments.forEach((function(e,o){var i,a=Fo(e),s=a.duration,u=a.playableStart,c=a.playableEnd,l=a.playableDuration,d=a.trimLeft;if(!0===(null==e||null===(i=e.layout)||void 0===i?void 0:i.removed)||l<=To){var f=Eo(e);return f.__transitionAfter=!0,f.__originSegmentIndex=o,r.push(f),void(n+=l)}var p=[],v=n,y=v+l;t.forEach((function(e){if(!(e.end<=v+To||e.start>=y-To)){var t=Math.max(e.start,v),r=Math.min(e.end,y);if(!(r<=t+To)){var n=Zo(d+(t-v),d+(r-v));n&&p.push(n)}}}));var m=Ao(p),h=Co({start:u,end:c},m);0!==h.length?(h.forEach((function(t,n){var i=t.end-t.start;if(Ro(i)){var a=Eo(e);a.layout.data.trimLeft=t.start,a.layout.data.trimRight=Math.max(0,s-t.end),a.__transitionAfter=n===h.length-1,a.__originSegmentIndex=o,Array.isArray(a.effects)&&(a.effects=a.effects.map((function(e){var r;if(!Mo(e))return e;var n=Eo(e);return n.data=n.data||{},n.data.transcript_text=Uo({transcripts:(null==e||null===(r=e.data)||void 0===r?void 0:r.transcript_text)||[],rangeStart:t.start,rangeEnd:t.end,offsetMode:"absolute",offsetBase:t.start,stripDisabled:!0}),n}))),r.push(a)}})),n+=l):n+=l})),xo(xo({},e),{},{segments:r})}(e,r);case"effect":return $o(e,r,"effect");case"audio":return $o(e,r,"audio");case"caption":return $o(e,r,"caption");default:return e}}))),t};function qo(e){return qo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qo(e)}function Ko(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Wo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ko(Object(r),!0).forEach((function(t){Go(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ko(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ho(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Jo(n.key),n)}}function Go(e,t,r){return(t=Jo(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jo(e){var t=function(e,t){if("object"!=qo(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=qo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==qo(t)?t:t+""}var Yo=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Go(this,"screenplay",void 0),Go(this,"fps",30),Go(this,"mainVideoTrack",{}),Go(this,"layoutVideoTrack",[]),Go(this,"effectsVideoTrack",[]),Go(this,"captionsVideoTrack",[]),Go(this,"audioTrack",[]),Go(this,"output",void 0),this.screenplay=zo(t),this.output=this.getRemotionOutputSettings()},t=[{key:"validate",value:function(){try{_t.parse(this.screenplay)}catch(e){console.log({error:e})}}},{key:"getRemotionOutputSettings",value:function(){var e=this,t={},r=this.screenplay.output.orientation,n=this.screenplay.input.theme||"default";switch(r){case"landscape":t.width=1920,t.height=1080;break;case"portrait":t.width=1080,t.height=1920;break;case"square":t.width=1080,t.height=1080}var o=this.getSegmentTrack().segments||[];return t.durationInFrames=o.reduce((function(t,r,o,i){var a,s,u,c,l,d,f,p=t+(((null==r||null===(a=r.layout)||void 0===a||null===(s=a.data)||void 0===s?void 0:s.duration)||0)-((null==r||null===(u=r.layout)||void 0===u||null===(c=u.data)||void 0===c?void 0:c.trimLeft)||0)-((null==r||null===(l=r.layout)||void 0===l||null===(d=l.data)||void 0===d?void 0:d.trimRight)||0))*e.fps,v=wo[n],y=null!==(f=null==r?void 0:r.transitionAfter)&&void 0!==f?f:null==r?void 0:r.__transitionAfter;if(v){var m=!(o===i.length-1)&&!1!==y;return Tt(p)-(m?v.durationInFrames:0)}return Tt(p)}),0),t.theme=this.screenplay.input.theme||"default",t.fps=this.fps,Wo(Wo({},this.screenplay.output),t)}},{key:"toRemotionFragment",value:function(e,t){var r,n,o,i,a,s,u,c,l,d,f,p,v,y,m,h,b,g,_,w,O,k=0;t&&(k=t.data.trimLeft||0);var S=Pt(e.type),j="Title"===S||"Nametag"===S?function(){var e,t,r,n,o,i,a,s,u,c,l,d,f,p,v,y,m,h,b,g,_,w,O,k,S,j,x,P,T=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},E=arguments.length>2?arguments[2]:void 0,N=jr(arguments.length>1?arguments[1]:void 0,E),V=null!==(e=null!==(t=T.firstVideoFile)&&void 0!==t?t:T.videoUrl)&&void 0!==e?e:null===(r=T.sourceVideo)||void 0===r?void 0:r.videoUrl,Z=null!==(n=T.firstNoBackgroundVideoUrl)&&void 0!==n?n:null===(o=T.firstNoBackgroundVideo)||void 0===o?void 0:o.videoUrl,R=null!==(i=T.firstNoBackgroundFaceMetadata)&&void 0!==i?i:Lt(null===(a=T.firstNoBackgroundVideo)||void 0===a?void 0:a.faceMetadata),A=T.noBackgroundVideoEffects?Sr(T.noBackgroundVideoEffects):void 0,C=null!==(s=T.startVideoFrom)&&void 0!==s?s:"number"==typeof(null===(u=T.sourceVideo)||void 0===u?void 0:u.start)?Tt(E*T.sourceVideo.start,!1,!0):void 0,I=null!==(c=T.videoUrl)&&void 0!==c?c:null===(l=T.sourceVideo)||void 0===l?void 0:l.videoUrl,M=null!==(d=T.videoZoom)&&void 0!==d?d:null===(f=T.sourceVideo)||void 0===f?void 0:f.zoom;return{text:null!==(p=T.text)&&void 0!==p?p:N.text,fullName:null!==(v=null!==(y=null!==(m=T.fullName)&&void 0!==m?m:T.name)&&void 0!==y?y:N.fullName)&&void 0!==v?v:N.name,name:null!==(h=null!==(b=null!==(g=T.name)&&void 0!==g?g:T.fullName)&&void 0!==b?b:N.name)&&void 0!==h?h:N.fullName,title:null!==(_=T.title)&&void 0!==_?_:N.title,collaboratorName:null!==(w=T.collaboratorName)&&void 0!==w?w:N.collaboratorName,collaboratorTitle:null!==(O=T.collaboratorTitle)&&void 0!==O?O:N.collaboratorTitle,topicLabel:null!==(k=T.topicLabel)&&void 0!==k?k:N.topicLabel,activeSpeaker:null!==(S=T.activeSpeaker)&&void 0!==S?S:N.activeSpeaker,firstVideoFile:null!=V?V:N.firstVideoFile,firstNoBackgroundVideoUrl:null!=Z?Z:N.firstNoBackgroundVideoUrl,firstNoBackgroundFaceMetadata:null!=R?R:N.firstNoBackgroundFaceMetadata,secondVideoFile:null!==(j=T.secondVideoFile)&&void 0!==j?j:N.secondVideoFile,startSecondVideoFrom:null!==(x=T.startSecondVideoFrom)&&void 0!==x?x:N.startSecondVideoFrom,noBackgroundVideoEffects:null!=A?A:N.noBackgroundVideoEffects,sourceVideoOrientation:null!==(P=T.sourceVideoOrientation)&&void 0!==P?P:N.sourceVideoOrientation,startVideoFrom:null!=C?C:N.startVideoFrom,videoUrl:null!=I?I:N.videoUrl,videoZoom:null!=M?M:N.videoZoom}}(e.data,null==t?void 0:t.data,this.fps):{},x="HandoffNametag"===S?{useSquareInLandscape:null!==(r=null===(n=e.data)||void 0===n?void 0:n.useSquareInLandscape)&&void 0!==r?r:null==t||null===(o=t.data)||void 0===o?void 0:o.useSquareInLandscape,handoffNametagVariant:null!==(i=null===(a=e.data)||void 0===a?void 0:a.handoffNametagVariant)&&void 0!==i?i:null==t||null===(s=t.data)||void 0===s?void 0:s.handoffNametagVariant,useSquareInLandscapeFirstVideo:null!==(u=null===(c=e.data)||void 0===c?void 0:c.useSquareInLandscapeFirstVideo)&&void 0!==u?u:null==t||null===(l=t.data)||void 0===l?void 0:l.useSquareInLandscapeFirstVideo,useSquareInLandscapeSecondVideo:null!==(d=null===(f=e.data)||void 0===f?void 0:f.useSquareInLandscapeSecondVideo)&&void 0!==d?d:null==t||null===(p=t.data)||void 0===p?void 0:p.useSquareInLandscapeSecondVideo}:{useSquareInLandscape:null!==(v=null===(y=e.data)||void 0===y?void 0:y.useSquareInLandscape)&&void 0!==v?v:null==t||null===(m=t.data)||void 0===m?void 0:m.useSquareInLandscape},P=this.fps*(e.data.offset-k)||0,T=Tt(this.fps*e.data.duration),E=P+T;return Wo(Wo(Wo(Wo({},e.data),j),x),{},{component:S,videoUrl:null!==(h=null===(b=e.data.sourceVideo)||void 0===b?void 0:b.videoUrl)&&void 0!==h?h:j.videoUrl,startVideoFrom:null!==(g="number"==typeof(null===(_=e.data.sourceVideo)||void 0===_?void 0:_.start)?Tt(this.fps*e.data.sourceVideo.start,!1,!0):j.startVideoFrom)&&void 0!==g?g:0,durationInFrames:T,from:P,to:E,videoZoom:null!==(w=null===(O=e.data.sourceVideo)||void 0===O?void 0:O.zoom)&&void 0!==w?w:j.videoZoom,offset:Tt(this.fps*(e.data.offset-k))||0,theme:e.theme,themeSettings:null==e?void 0:e.themeSettings})}},{key:"toRemotionAudioFragment",value:function(e){var t,r,n,o,i,a,s,u,c=this.fps*e.data.offset||0,l=Tt(this.fps*e.data.duration)||void 0,d=c+l;return Wo(Wo({},e.data),{},{component:Pt(e.type),src:null===(t=e.data.sourceAudio)||void 0===t?void 0:t.url,startAudioFrom:null!==(r=Tt(this.fps*(null===(n=e.data.sourceAudio)||void 0===n?void 0:n.start),!1,!0))&&void 0!==r?r:0,durationInFrames:l,from:c,to:d,offset:this.fps*e.data.offset||0,volume:null!==(o=null===(i=e.data)||void 0===i||null===(a=i.sourceAudio)||void 0===a?void 0:a.volume)&&void 0!==o?o:1,loop:(null===(s=e.data)||void 0===s||null===(u=s.sourceAudio)||void 0===u?void 0:u.loop)||!1})}},{key:"toRemotionSegment",value:function(e){var t,r,n=this,o=e.layout,i=e.effects,a=void 0===i?[]:i;return{layout:_o.createObject(o),effects:a.map((function(e){return e.type.includes("caption")?n.toRemotionCaptionSegment(e,o):n.toRemotionFragment(e,o)})),transitionAfter:null===(t=null!==(r=null==e?void 0:e.transitionAfter)&&void 0!==r?r:null==e?void 0:e.__transitionAfter)||void 0===t||t}}},{key:"toEffectSegment",value:function(e){return this.toRemotionFragment(e)}},{key:"toRemotionCaptionSegment",value:function(e,t){var r,n,o=this,i=(null==t||null===(r=t.data)||void 0===r?void 0:r.trimLeft)||0,a=Number(null==e||null===(n=e.data)||void 0===n?void 0:n.offset),s=Number.isFinite(a)?this.fps*(a+i):0,u=e.data.transcript_text;if(!u)throw new Error("No transcript_text provided in transcript segment");return u=u.map((function(e){var t=o.fps*(e.offset-i)||0,r=Tt(o.fps*e.duration);return{text:e.text,from:t,durationInFrames:r,punctuations:e.punctuations?e.punctuations.map((function(e){return Wo(Wo({},e),{},{start:Tt(o.fps*(e.start-i)),end:Tt(o.fps*(e.end-i))})})):[]}})),{component:Pt(e.type),durationInFrames:Tt(this.screenplay.durationInFrames),from:s,transcripts:u,theme:e.theme,color:e.data.color}}},{key:"generateMainVideoTrack",value:function(){var e,t=this.screenplay.tracks.find((function(e){return"segment"===e.type}));if(!t)throw new Error("Layout track not found");if(!t.segments&&0===(null===(e=t.segments)||void 0===e?void 0:e.length))throw new Error("Layout track has no segments specified");this.mainVideoTrack=this.toRemotionSegment(t.segments[0])}},{key:"getSegmentTrack",value:function(){var e=this.screenplay.tracks.find((function(e){return"segment"===e.type}));if(!e)throw new Error("Layout track not found");return e}},{key:"generateLayoutTrack",value:function(){var e=this;this.getSegmentTrack().segments.forEach((function(t){e.layoutVideoTrack.push(e.toRemotionSegment(t))}))}},{key:"generateEffectsTrack",value:function(){var e=this,t=this.screenplay.tracks.find((function(e){return"effect"===e.type}));if(!t)throw new Error("Effect track not found");t.segments.forEach((function(t){e.effectsVideoTrack.push(e.toEffectSegment(t))}))}},{key:"generateCaptionsTrack",value:function(){var e=this,t=this.screenplay.tracks.find((function(e){return"caption"===e.type}));if(!t)throw new Error("Caption track not found");t.segments.forEach((function(t,r){!function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(r),e.captionsVideoTrack.push(e.toRemotionCaptionSegment(t))}))}},{key:"generateAudioTrack",value:function(){var e=this,t=this.screenplay.tracks.find((function(e){return"audio"===e.type}));t?t.segments.forEach((function(t){e.audioTrack.push(e.toRemotionAudioFragment(t))})):console.log("[ScreenPlay] Audio track not found. Skipping")}},{key:"buildRemotionTimeline",value:function(){return{input:this.screenplay.input,mainVideoTrack:this.mainVideoTrack,layoutVideoTrack:this.layoutVideoTrack,effectsVideoTrack:this.effectsVideoTrack,captionsVideoTrack:this.captionsVideoTrack,audioTrack:this.audioTrack,output:this.output}}}],t&&Ho(e.prototype,t),r&&Ho(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();module.exports=n})();
|
|
@@ -8,9 +8,9 @@ import React, { useEffect, useState } from 'react';
|
|
|
8
8
|
import { delayRender, continueRender, cancelRender } from 'remotion';
|
|
9
9
|
import { Lottie } from '@remotion/lottie';
|
|
10
10
|
|
|
11
|
-
/**
|
|
12
|
-
* Convert a HEX color string (e.g. "#ff8800") to the RGBA float array that
|
|
13
|
-
* Lottie expects: [r, g, b, a] where each component is 0‑1.
|
|
11
|
+
/**
|
|
12
|
+
* Convert a HEX color string (e.g. "#ff8800") to the RGBA float array that
|
|
13
|
+
* Lottie expects: [r, g, b, a] where each component is 0‑1.
|
|
14
14
|
*/
|
|
15
15
|
var hexToRGBA = function hexToRGBA(hex) {
|
|
16
16
|
var clean = hex.replace('#', '');
|
|
@@ -25,9 +25,9 @@ var hexToRGBA = function hexToRGBA(hex) {
|
|
|
25
25
|
];
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
/**
|
|
29
|
-
* Recursively walks through shape objects and overrides any fill (fl) or
|
|
30
|
-
* stroke (st) color with the provided RGBA array.
|
|
28
|
+
/**
|
|
29
|
+
* Recursively walks through shape objects and overrides any fill (fl) or
|
|
30
|
+
* stroke (st) color with the provided RGBA array.
|
|
31
31
|
*/
|
|
32
32
|
var _applyColor = function applyColor(shapes, rgba) {
|
|
33
33
|
shapes === null || shapes === void 0 ? void 0 : shapes.forEach(function (shape) {
|
|
@@ -40,11 +40,11 @@ var _applyColor = function applyColor(shapes, rgba) {
|
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
/**
|
|
44
|
-
* Traverses all layers (top‑level + asset layers) and applies the primary
|
|
45
|
-
* color to every fill / stroke it encounters. This is useful for Lottie files
|
|
46
|
-
* that were exported with a single static color (e.g. white) and do not use
|
|
47
|
-
* layer naming conventions like "PrimaryColor".
|
|
43
|
+
/**
|
|
44
|
+
* Traverses all layers (top‑level + asset layers) and applies the primary
|
|
45
|
+
* color to every fill / stroke it encounters. This is useful for Lottie files
|
|
46
|
+
* that were exported with a single static color (e.g. white) and do not use
|
|
47
|
+
* layer naming conventions like "PrimaryColor".
|
|
48
48
|
*/
|
|
49
49
|
var replaceGlobalColor = function replaceGlobalColor(data, hex) {
|
|
50
50
|
var _data$assets;
|
|
@@ -60,16 +60,16 @@ var replaceGlobalColor = function replaceGlobalColor(data, hex) {
|
|
|
60
60
|
});
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
/**
|
|
64
|
-
* LottieAnimationGlobal – specialised wrapper to render the provided Lottie
|
|
65
|
-
* (e.g. text‑bubble‑animation.json) while dynamically replacing **all** stroke
|
|
66
|
-
* and fill colors with the supplied `primaryColor`.
|
|
67
|
-
*
|
|
68
|
-
* Props:
|
|
69
|
-
* • animationPath – URL or local path to the json file.
|
|
70
|
-
* • primaryColor – HEX string, defaults to "#ffffff".
|
|
71
|
-
* • autoplay – boolean, whether to start playing immediately.
|
|
72
|
-
* • loop – boolean, whether to loop the animation.
|
|
63
|
+
/**
|
|
64
|
+
* LottieAnimationGlobal – specialised wrapper to render the provided Lottie
|
|
65
|
+
* (e.g. text‑bubble‑animation.json) while dynamically replacing **all** stroke
|
|
66
|
+
* and fill colors with the supplied `primaryColor`.
|
|
67
|
+
*
|
|
68
|
+
* Props:
|
|
69
|
+
* • animationPath – URL or local path to the json file.
|
|
70
|
+
* • primaryColor – HEX string, defaults to "#ffffff".
|
|
71
|
+
* • autoplay – boolean, whether to start playing immediately.
|
|
72
|
+
* • loop – boolean, whether to loop the animation.
|
|
73
73
|
*/
|
|
74
74
|
export var LottieAnimationGlobal = function LottieAnimationGlobal(_ref) {
|
|
75
75
|
var animationPath = _ref.animationPath,
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
|
+
import { useThree } from "@react-three/fiber";
|
|
3
|
+
import { ThreeCanvas } from "@remotion/three";
|
|
4
|
+
import * as THREE from "three";
|
|
5
|
+
import { AbsoluteFill, interpolate, useCurrentFrame } from "remotion";
|
|
6
|
+
var vertexShader = "\n varying vec2 vUv;\n\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n";
|
|
7
|
+
var fragmentShader = "\n uniform float uFrame;\n uniform float uOpacity;\n uniform vec3 uAccentColor;\n varying vec2 vUv;\n\n float random(vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898, 78.233)) + uFrame * 0.73) * 43758.5453123);\n }\n\n void main() {\n vec2 blockUv = floor(vUv * vec2(96.0, 54.0));\n float noise = step(0.962, random(blockUv + floor(uFrame * 1.7)));\n float block = step(0.84, random(vec2(floor(vUv.y * 34.0), floor(uFrame * 0.9))));\n float scanline = 1.0 - smoothstep(\n 0.0,\n 0.018,\n abs(fract(vUv.y * 128.0 + uFrame * 0.018) - 0.5)\n );\n float edgeFade = smoothstep(0.0, 0.18, vUv.x) * smoothstep(1.0, 0.82, vUv.x);\n vec3 cyan = vec3(0.0, 0.92, 1.0);\n vec3 magenta = vec3(1.0, 0.08, 0.36);\n vec3 color = mix(cyan, magenta, random(vec2(floor(vUv.y * 18.0), floor(uFrame))));\n color = mix(color, uAccentColor, 0.28);\n float alpha = uOpacity * edgeFade * (noise * 0.26 + block * 0.1 + scanline * 0.035);\n\n gl_FragColor = vec4(color, alpha);\n }\n";
|
|
8
|
+
var getBurstOpacity = function getBurstOpacity(_ref) {
|
|
9
|
+
var localFrame = _ref.localFrame,
|
|
10
|
+
durationInFrames = _ref.durationInFrames,
|
|
11
|
+
intensity = _ref.intensity;
|
|
12
|
+
if (localFrame < 0 || localFrame > durationInFrames) {
|
|
13
|
+
return 0;
|
|
14
|
+
}
|
|
15
|
+
var peakFrame = Math.max(4, Math.round(durationInFrames * 0.42));
|
|
16
|
+
var ramp = interpolate(localFrame, [0, peakFrame], [0, 1], {
|
|
17
|
+
extrapolateLeft: "clamp",
|
|
18
|
+
extrapolateRight: "clamp"
|
|
19
|
+
});
|
|
20
|
+
var decay = interpolate(localFrame, [peakFrame, durationInFrames], [1, 0], {
|
|
21
|
+
extrapolateLeft: "clamp",
|
|
22
|
+
extrapolateRight: "clamp"
|
|
23
|
+
});
|
|
24
|
+
var impact = localFrame <= peakFrame ? ramp : Math.max(0, Math.min(1, decay));
|
|
25
|
+
var strobe = localFrame % 3 === 0 ? 1 : localFrame % 3 === 1 ? 0.64 : 0.82;
|
|
26
|
+
return Math.max(0, Math.min(1, impact * strobe * intensity));
|
|
27
|
+
};
|
|
28
|
+
var getThreeColor = function getThreeColor(color) {
|
|
29
|
+
try {
|
|
30
|
+
return new THREE.Color(color || "#ff2f6d");
|
|
31
|
+
} catch (_unused) {
|
|
32
|
+
return new THREE.Color("#ff2f6d");
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var GlitchShaderPlane = function GlitchShaderPlane(_ref2) {
|
|
36
|
+
var frame = _ref2.frame,
|
|
37
|
+
opacity = _ref2.opacity,
|
|
38
|
+
accentColor = _ref2.accentColor;
|
|
39
|
+
var _useThree = useThree(),
|
|
40
|
+
viewport = _useThree.viewport;
|
|
41
|
+
var uniforms = useMemo(function () {
|
|
42
|
+
return {
|
|
43
|
+
uFrame: {
|
|
44
|
+
value: frame
|
|
45
|
+
},
|
|
46
|
+
uOpacity: {
|
|
47
|
+
value: opacity
|
|
48
|
+
},
|
|
49
|
+
uAccentColor: {
|
|
50
|
+
value: getThreeColor(accentColor)
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}, []);
|
|
54
|
+
uniforms.uFrame.value = frame;
|
|
55
|
+
uniforms.uOpacity.value = opacity;
|
|
56
|
+
uniforms.uAccentColor.value = getThreeColor(accentColor);
|
|
57
|
+
return /*#__PURE__*/React.createElement("mesh", {
|
|
58
|
+
scale: [viewport.width, viewport.height, 1],
|
|
59
|
+
position: [0, 0, 0]
|
|
60
|
+
}, /*#__PURE__*/React.createElement("planeGeometry", {
|
|
61
|
+
args: [1, 1]
|
|
62
|
+
}), /*#__PURE__*/React.createElement("shaderMaterial", {
|
|
63
|
+
vertexShader: vertexShader,
|
|
64
|
+
fragmentShader: fragmentShader,
|
|
65
|
+
uniforms: uniforms,
|
|
66
|
+
transparent: true,
|
|
67
|
+
depthWrite: false,
|
|
68
|
+
depthTest: false,
|
|
69
|
+
blending: THREE.AdditiveBlending
|
|
70
|
+
}));
|
|
71
|
+
};
|
|
72
|
+
var HookThreeGlitchScene = function HookThreeGlitchScene(_ref3) {
|
|
73
|
+
var startFrame = _ref3.startFrame,
|
|
74
|
+
durationInFrames = _ref3.durationInFrames,
|
|
75
|
+
intensity = _ref3.intensity,
|
|
76
|
+
accentColor = _ref3.accentColor;
|
|
77
|
+
var frame = useCurrentFrame();
|
|
78
|
+
var localFrame = frame - startFrame;
|
|
79
|
+
var opacity = getBurstOpacity({
|
|
80
|
+
localFrame: localFrame,
|
|
81
|
+
durationInFrames: durationInFrames,
|
|
82
|
+
intensity: intensity
|
|
83
|
+
});
|
|
84
|
+
if (opacity <= 0.001) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("ambientLight", {
|
|
88
|
+
intensity: 0.8
|
|
89
|
+
}), /*#__PURE__*/React.createElement(GlitchShaderPlane, {
|
|
90
|
+
frame: frame,
|
|
91
|
+
opacity: opacity,
|
|
92
|
+
accentColor: accentColor
|
|
93
|
+
}));
|
|
94
|
+
};
|
|
95
|
+
export var HookThreeGlitchOverlay = function HookThreeGlitchOverlay(_ref4) {
|
|
96
|
+
var width = _ref4.width,
|
|
97
|
+
height = _ref4.height,
|
|
98
|
+
startFrame = _ref4.startFrame,
|
|
99
|
+
durationInFrames = _ref4.durationInFrames,
|
|
100
|
+
accentColor = _ref4.accentColor,
|
|
101
|
+
_ref4$intensity = _ref4.intensity,
|
|
102
|
+
intensity = _ref4$intensity === void 0 ? 1 : _ref4$intensity,
|
|
103
|
+
_ref4$zIndex = _ref4.zIndex,
|
|
104
|
+
zIndex = _ref4$zIndex === void 0 ? 19 : _ref4$zIndex;
|
|
105
|
+
return /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
106
|
+
style: {
|
|
107
|
+
zIndex: zIndex,
|
|
108
|
+
pointerEvents: "none",
|
|
109
|
+
mixBlendMode: "screen"
|
|
110
|
+
}
|
|
111
|
+
}, /*#__PURE__*/React.createElement(ThreeCanvas, {
|
|
112
|
+
width: width,
|
|
113
|
+
height: height,
|
|
114
|
+
dpr: 1,
|
|
115
|
+
orthographic: true,
|
|
116
|
+
camera: {
|
|
117
|
+
position: [0, 0, 10],
|
|
118
|
+
zoom: 1
|
|
119
|
+
},
|
|
120
|
+
gl: {
|
|
121
|
+
alpha: true,
|
|
122
|
+
antialias: false,
|
|
123
|
+
premultipliedAlpha: false,
|
|
124
|
+
powerPreference: "high-performance"
|
|
125
|
+
},
|
|
126
|
+
onCreated: function onCreated(_ref5) {
|
|
127
|
+
var gl = _ref5.gl;
|
|
128
|
+
gl.setClearColor(0x000000, 0);
|
|
129
|
+
},
|
|
130
|
+
style: {
|
|
131
|
+
width: "100%",
|
|
132
|
+
height: "100%",
|
|
133
|
+
background: "transparent"
|
|
134
|
+
}
|
|
135
|
+
}, /*#__PURE__*/React.createElement(HookThreeGlitchScene, {
|
|
136
|
+
startFrame: startFrame,
|
|
137
|
+
durationInFrames: durationInFrames,
|
|
138
|
+
intensity: intensity,
|
|
139
|
+
accentColor: accentColor
|
|
140
|
+
})));
|
|
141
|
+
};
|