{"version":3,"file":"scene.esm.js","sources":["../src/easing.ts","../src/consts.ts","../src/EventTrigger.ts","../src/PropertyObject.ts","../src/utils/property.ts","../src/utils.ts","../src/Animator.ts","../src/Frame.ts","../src/utils/dot.ts","../src/SceneItem.ts","../src/Scene.ts","../src/presets.ts"],"sourcesContent":["import { EasingFunction } from \"./types\";\n\nfunction cubic(y1: number, y2: number, t: number) {\n const t2 = 1 - t;\n\n // Bezier Curve Formula\n return t * t * t + 3 * t * t * t2 * y2 + 3 * t * t2 * t2 * y1;\n}\nfunction solveFromX(x1: number, x2: number, x: number) {\n // x 0 ~ 1\n // t 0 ~ 1\n let t = x;\n let solveX = x;\n let dx = 1;\n\n while (Math.abs(dx) > 1 / 1000) {\n // 예상 t초에 의한 _x값\n solveX = cubic(x1, x2, t);\n dx = solveX - x;\n // 차이가 미세하면 그 값을 t로 지정\n if (Math.abs(dx) < 1 / 1000) {\n return t;\n }\n t -= dx / 2;\n }\n return t;\n}\n/**\n * @namespace easing\n */\n/**\n* Cubic Bezier curve.\n* @memberof easing\n* @func bezier\n* @param {number} [x1] - point1's x\n* @param {number} [y1] - point1's y\n* @param {number} [x2] - point2's x\n* @param {number} [y2] - point2's y\n* @return {function} the curve function\n* @example\nimport {bezier} from \"scenejs\";\nScene.bezier(0, 0, 1, 1) // LINEAR\nScene.bezier(0.25, 0.1, 0.25, 1) // EASE\n*/\nexport function bezier(x1: number, y1: number, x2: number, y2: number) {\n /*\n\t\tx = f(t)\n\t\tcalculate inverse function by x\n\t\tt = f-1(x)\n\t*/\n const func: EasingFunction = (x: number) => {\n const t = solveFromX(x1, x2, Math.max(Math.min(1, x), 0));\n\n return cubic(y1, y2, t);\n };\n\n func.easingName = `cubic-bezier(${x1},${y1},${x2},${y2})`;\n return func;\n}\n/**\n* Specifies a stepping function\n* @see {@link https://www.w3schools.com/cssref/css3_pr_animation-timing-function.asp|CSS3 Timing Function}\n* @memberof easing\n* @func steps\n* @param {number} count - point1's x\n* @param {\"start\" | \"end\"} postion - point1's y\n* @return {function} the curve function\n* @example\nimport {steps} from \"scenejs\";\nScene.steps(1, \"start\") // Scene.STEP_START\nScene.steps(1, \"end\") // Scene.STEP_END\n*/\nexport function steps(count: number, position: \"start\" | \"end\") {\n const func: EasingFunction = (time: number) => {\n const level = 1 / count;\n\n if (time >= 1) {\n return 1;\n }\n return (position === \"start\" ? level : 0) + Math.floor(time / level) * level;\n };\n\n func.easingName = `steps(${count}, ${position})`;\n\n return func;\n}\n\n/**\n* Equivalent to steps(1, start)\n* @memberof easing\n* @name STEP_START\n* @static\n* @type {function}\n* @example\nimport {STEP_START} from \"scenejs\";\nScene.STEP_START // steps(1, start)\n*/\nexport const STEP_START = /*#__PURE__#*/steps(1, \"start\");\n/**\n* Equivalent to steps(1, end)\n* @memberof easing\n* @name STEP_END\n* @static\n* @type {function}\n* @example\nimport {STEP_END} from \"scenejs\";\nScene.STEP_END // steps(1, end)\n*/\nexport const STEP_END = /*#__PURE__#*/steps(1, \"end\");\n/**\n* Linear Speed (0, 0, 1, 1)\n* @memberof easing\n* @name LINEAR\n* @static\n* @type {function}\n* @example\nimport {LINEAR} from \"scenejs\";\nScene.LINEAR\n*/\nexport const LINEAR = /*#__PURE__#*/bezier(0, 0, 1, 1);\n/**\n* Ease Speed (0.25, 0.1, 0.25, 1)\n* @memberof easing\n* @name EASE\n* @static\n* @type {function}\n* @example\nimport {EASE} from \"scenejs\";\nScene.EASE\n*/\nexport const EASE = /*#__PURE__#*/bezier(0.25, 0.1, 0.25, 1);\n/**\n* Ease In Speed (0.42, 0, 1, 1)\n* @memberof easing\n* @name EASE_IN\n* @static\n* @type {function}\n* @example\nimport {EASE_IN} from \"scenejs\";\nScene.EASE_IN\n*/\nexport const EASE_IN = /*#__PURE__#*/bezier(0.42, 0, 1, 1);\n/**\n* Ease Out Speed (0, 0, 0.58, 1)\n* @memberof easing\n* @name EASE_OUT\n* @static\n* @type {function}\n* @example\nimport {EASE_OUT} from \"scenejs\";\nScene.EASE_OUT\n*/\nexport const EASE_OUT = /*#__PURE__#*/bezier(0, 0, 0.58, 1);\n/**\n* Ease In Out Speed (0.42, 0, 0.58, 1)\n* @memberof easing\n* @name EASE_IN_OUT\n* @static\n* @type {function}\n* @example\nimport {EASE_IN_OUT} from \"scenejs\";\nScene.EASE_IN_OUT\n*/\nexport const EASE_IN_OUT = /*#__PURE__#*/bezier(0.42, 0, 0.58, 1);\n","import { IObject } from \"@daybrush/utils\";\nimport { RoleObject, OptionType, EventType, EasingFunction } from \"./types\";\nimport { EASE, EASE_IN, EASE_IN_OUT, LINEAR, EASE_OUT, STEP_START, STEP_END } from \"./easing\";\n\nexport const PREFIX = \"__SCENEJS_\";\nexport const DATA_SCENE_ID = \"data-scene-id\";\nexport const TIMING_FUNCTION = \"animation-timing-function\";\nexport const ROLES: RoleObject = { transform: {}, filter: {}, attribute: {}, html: true };\nexport const ALIAS: IObject = { easing: [TIMING_FUNCTION] };\nexport const FIXED = { [TIMING_FUNCTION]: true, contents: true, html: true };\nexport const MAXIMUM = 1000000;\nexport const THRESHOLD = 0.000001;\n\nexport const DURATION = \"duration\";\nexport const FILL_MODE = \"fillMode\";\nexport const DIRECTION = \"direction\";\nexport const ITERATION_COUNT = \"iterationCount\";\nexport const DELAY = \"delay\";\nexport const EASING = \"easing\";\nexport const PLAY_SPEED = \"playSpeed\";\nexport const EASING_NAME = \"easingName\";\nexport const ITERATION_TIME = \"iterationTime\";\nexport const PAUSED = \"paused\";\nexport const ENDED = \"ended\";\nexport const TIMEUPDATE = \"timeupdate\";\nexport const ANIMATE = \"animate\";\nexport const PLAY = \"play\";\nexport const RUNNING = \"running\";\nexport const ITERATION = \"iteration\";\nexport const START_ANIMATION = \"startAnimation\";\nexport const PAUSE_ANIMATION = \"pauseAnimation\";\nexport const ALTERNATE = \"alternate\";\nexport const REVERSE = \"reverse\";\nexport const ALTERNATE_REVERSE = \"alternate-reverse\";\nexport const NORMAL = \"normal\";\nexport const INFINITE = \"infinite\";\nexport const PLAY_STATE = \"playState\";\nexport const PLAY_CSS = \"playCSS\";\nexport const PREV_TIME = \"prevTime\";\nexport const TICK_TIME = \"tickTime\";\nexport const CURRENT_TIME = \"currentTime\";\nexport const SELECTOR = \"selector\";\nexport const TRANSFORM_NAME = \"transform\";\nexport const EASINGS = {\n \"linear\": LINEAR,\n \"ease\": EASE,\n \"ease-in\": EASE_IN,\n \"ease-out\": EASE_OUT,\n \"ease-in-out\": EASE_IN_OUT,\n \"step-start\": STEP_START,\n \"step-end\": STEP_END,\n};\n\n/**\n* option name list\n* @name Scene.OPTIONS\n* @memberof Scene\n* @static\n* @type {$ts:OptionType}\n* @example\n* Scene.OPTIONS // [\"duration\", \"fillMode\", \"direction\", \"iterationCount\", \"delay\", \"easing\", \"playSpeed\"]\n*/\nexport const OPTIONS: OptionType = [DURATION, FILL_MODE, DIRECTION, ITERATION_COUNT, DELAY, EASING, PLAY_SPEED];\n\n/**\n* Event name list\n* @name Scene.EVENTS\n* @memberof Scene\n* @static\n* @type {$ts:EventType}\n* @example\n* Scene.EVENTS // [\"paused\", \"ended\", \"timeupdate\", \"animate\", \"play\", \"iteration\"];\n*/\nexport const EVENTS: EventType = [PAUSED, ENDED, TIMEUPDATE, ANIMATE, PLAY, ITERATION];\n","import { isObject, isArray, toArray } from \"@daybrush/utils\";\nimport { CallbackType, EventParameter } from \"./types\";\n\n/**\n* attach and trigger event handlers.\n*/\nclass EventTrigger {\n public events: { [name: string]: CallbackType[] };\n /**\n * @example\n const et = new Scene.EventTrigger();\n const scene = new Scene();\n\n scene.on(\"call\", e => {\n console.log(e.param);\n });\n et.on(\"call\", e => {\n console.log(e.param);\n });\n scene.trigger(\"call\", {param: 1});\n et.trigger(\"call\", {param: 1});\n */\n constructor() {\n this.events = {};\n }\n public _on(name: string | EventParameter, callback?: CallbackType | CallbackType[], once?: boolean) {\n const events = this.events;\n\n if (isObject(name)) {\n for (const n in name) {\n this._on(n, name[n], once);\n }\n return;\n }\n if (!(name in events)) {\n events[name] = [];\n }\n if (!callback) {\n return;\n }\n if (isArray(callback)) {\n callback.forEach(func => this._on(name, func, once));\n return;\n }\n events[name].push(once ? function callback2(...args) {\n callback(...args);\n this.off(name, callback2);\n } : callback);\n }\n /**\n * Attach an event handler function for one or more events to target\n * @param - event's name\n * @param - function to execute when the event is triggered.\n * @return {EventTrigger} An Instance itself.\n * @example\n target.on(\"animate\", function() {\n console.log(\"animate\");\n });\n\n target.trigger(\"animate\");\n\n */\n public on(name: string | EventParameter, callback?: CallbackType | CallbackType[]) {\n this._on(name, callback);\n return this;\n }\n /**\n * Dettach an event handler function for one or more events to target\n * @param - event's name\n * @param - function to execute when the event is triggered.\n * @return {EventTrigger} An Instance itself.\n * @example\n const callback = function() {\n console.log(\"animate\");\n };\n target.on(\"animate\", callback);\n\n target.off(\"animate\", callback);\n target.off(\"animate\");\n\n */\n public off(name?: string, callback?: CallbackType) {\n if (!name) {\n this.events = {};\n } else if (!callback) {\n this.events[name] = [];\n } else {\n const callbacks = this.events[name];\n\n if (!callbacks) {\n return this;\n }\n const index = callbacks.indexOf(callback);\n\n if (index !== -1) {\n callbacks.splice(index, 1);\n }\n }\n return this;\n }\n /**\n * execute event handler\n * @param - event's name\n * @param - event handler's additional parameter\n * @return {EventTrigger} An Instance itself.\n * @example\n target.on(\"animate\", function(a1, a2) {\n console.log(\"animate\", a1, a2);\n });\n\n target.trigger(\"animate\", [1, 2]); // log => \"animate\", 1, 2\n\n */\n public trigger(name: string, ...data: any[]) {\n const events = this.events;\n\n if (!(name in events)) {\n return this;\n }\n\n const args = data || [];\n\n !args[0] && (args[0] = {});\n const event = events[name];\n const target = args[0];\n\n target.type = name;\n target.currentTarget = this;\n !target.target && (target.target = this);\n toArray(events[name]).forEach(callback => {\n callback.apply(this, data);\n });\n\n return this;\n }\n public once(name: string | EventParameter, callback?: CallbackType | CallbackType[]) {\n this._on(name, callback, true);\n return this;\n }\n}\nexport default EventTrigger;\n","import { isString } from \"@daybrush/utils\";\nimport { PropertyObjectState } from \"./types\";\n\n/**\n* Make string, array to PropertyObject for the dot product\n*/\nclass PropertyObject implements PropertyObjectState {\n public value: any[];\n public prefix: string = \"\";\n public suffix: string = \"\";\n public model: string = \"\";\n public type: string = \"\";\n public separator: string = \",\";\n\n /**\n * @param - This value is in the array format.\n * @param - options\n * @example\n var obj = new PropertyObject([100,100,100,0.5], {\n \"separator\" : \",\",\n \"prefix\" : \"rgba(\",\n \"suffix\" : \")\"\n });\n */\n constructor(value: string | any[], options?: Partial) {\n options && this.setOptions(options);\n this.value = isString(value) ? value.split(this.separator) : value;\n }\n public setOptions(newOptions: Partial) {\n for (const name in newOptions) {\n this[name as keyof PropertyObjectState] = newOptions[name as keyof PropertyObjectState];\n }\n return this;\n }\n /**\n * the number of values.\n * @example\n const obj1 = new PropertyObject(\"1,2,3\", \",\");\n\n console.log(obj1.length);\n // 3\n */\n public size() {\n return this.value.length;\n }\n /**\n * retrieve one of values at the index\n * @param {Number} index - index\n * @return {Object} one of values at the index\n * @example\n const obj1 = new PropertyObject(\"1,2,3\", \",\");\n\n console.log(obj1.get(0));\n // 1\n */\n public get(index: number) {\n return this.value[index];\n }\n /**\n * Set the value at that index\n * @param {Number} index - index\n * @param {Object} value - text, a number, object to set\n * @return {PropertyObject} An instance itself\n * @example\n const obj1 = new PropertyObject(\"1,2,3\", \",\");\n obj1.set(0, 2);\n console.log(obj1.toValue());\n // 2,2,3\n */\n public set(index: number, value: any) {\n this.value[index] = value;\n return this;\n }\n /**\n * create a copy of an instance itself.\n * @return {PropertyObject} clone\n * @example\n const obj1 = new PropertyObject(\"1,2,3\", \",\");\n const obj2 = obj1.clone();\n */\n public clone(): PropertyObject {\n const {\n separator,\n prefix,\n suffix,\n model,\n type,\n } = this;\n const arr = this.value.map(v => ((v instanceof PropertyObject) ? v.clone() : v));\n return new PropertyObject(arr, {\n separator,\n prefix,\n suffix,\n model,\n type,\n });\n }\n /**\n * Make Property Object to String\n * @return {String} Make Property Object to String\n * @example\n //rgba(100, 100, 100, 0.5)\n const obj4 = new PropertyObject([100,100,100,0.5], {\n \"separator\" : \",\",\n \"prefix\" : \"rgba(\",\n \"suffix\" : \")\",\n });\n console.log(obj4.toValue());\n // \"rgba(100,100,100,0.5)\"\n */\n public toValue(): string {\n return this.prefix + this.join() + this.suffix;\n }\n /**\n * Make Property Object's array to String\n * @return {String} Join the elements of an array into a string\n * @example\n //rgba(100, 100, 100, 0.5)\n var obj4 = new PropertyObject([100,100,100,0.5], {\n \"separator\" : \",\",\n \"prefix\" : \"rgba(\",\n \"suffix\" : \")\"\n });\n obj4.join(); // => \"100,100,100,0.5\"\n */\n public join() {\n return this.value.map(v => ((v instanceof PropertyObject) ? v.toValue() : v)).join(this.separator);\n }\n /**\n * executes a provided function once per array element.\n * @param {Function} callback - Function to execute for each element, taking three arguments\n * @param {All} [callback.currentValue] The current element being processed in the array.\n * @param {Number} [callback.index] The index of the current element being processed in the array.\n * @param {Array} [callback.array] the array.\n * @return {PropertyObject} An instance itself\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach|MDN Array.forEach()} reference to MDN document.\n * @example\n //rgba(100, 100, 100, 0.5)\n var obj4 = new PropertyObject([100,100,100,0.5], {\n \"separator\" : \",\",\n \"prefix\" : \"rgba(\",\n \"suffix\" : \")\"\n });\n\n obj4.forEach(t => {\n console.log(t);\n }); // => \"100,100,100,0.5\"\n */\n public forEach(func: (value?: any, index?: number, array?: any[]) => void) {\n this.value.forEach(func);\n return this;\n }\n}\nexport default PropertyObject;\n","/**\n* @namespace\n* @name Property\n*/\n\nimport PropertyObject from \"../PropertyObject\";\nimport {\n COLOR_MODELS, isString,\n splitComma, splitSpace, stringToRGBA,\n RGBA, splitBracket, IObject, isArray\n} from \"@daybrush/utils\";\n\nexport function splitStyle(str: string) {\n const properties = str.split(\";\");\n const obj: IObject = {};\n let length = properties.length;\n\n for (let i = 0; i < length; ++i) {\n const matches = /([^:]*):([\\S\\s]*)/g.exec(properties[i]);\n\n if (!matches || matches.length < 3 || !matches[1]) {\n --length;\n continue;\n }\n obj[matches[1].trim()] = toPropertyObject(matches[2].trim());\n }\n return {styles: obj, length};\n}\n/**\n* convert array to PropertyObject[type=color].\n* default model \"rgba\"\n* @memberof Property\n* @function arrayToColorObject\n* @param {Array|PropertyObject} value ex) [0, 0, 0, 1]\n* @return {PropertyObject} PropertyObject[type=color]\n* @example\narrayToColorObject([0, 0, 0])\n// => PropertyObject(type=\"color\", model=\"rgba\", value=[0, 0, 0, 1], separator=\",\")\n*/\nexport function arrayToColorObject(arr: number[]) {\n const model = RGBA;\n\n if (arr.length === 3) {\n arr[3] = 1;\n }\n return new PropertyObject(arr, {\n model,\n separator: \",\",\n type: \"color\",\n prefix: `${model}(`,\n suffix: \")\",\n });\n}\n/**\n* convert text with parentheses to object.\n* @memberof Property\n* @function stringToBracketObject\n* @param {String} value ex) \"rgba(0,0,0,1)\"\n* @return {PropertyObject} PropertyObject\n* @example\nstringToBracketObject(\"abcde(0, 0, 0,1)\")\n// => PropertyObject(model=\"abcde\", value=[0, 0, 0,1], separator=\",\")\n*/\nexport function stringToBracketObject(text: string) {\n // [prefix, value, other]\n const { prefix: model, value, suffix: afterModel } = splitBracket(text);\n\n if (typeof value === \"undefined\") {\n return text;\n }\n if (COLOR_MODELS.indexOf(model) !== -1) {\n return arrayToColorObject(stringToRGBA(text));\n }\n // divide comma(,)\n const obj = toPropertyObject(value);\n\n let arr = [value];\n let separator = \",\";\n let prefix = `${model}(`;\n let suffix = `)${afterModel}`;\n\n if (obj instanceof PropertyObject) {\n separator = obj.separator;\n arr = obj.value;\n prefix += obj.prefix;\n suffix = obj.suffix + suffix;\n }\n return new PropertyObject(arr, {\n separator,\n model,\n prefix,\n suffix,\n });\n}\n\nexport function arrayToPropertyObject(arr: any[], separator: string) {\n return new PropertyObject(arr, {\n type: \"array\",\n separator,\n });\n}\n\n/**\n* convert text with parentheses to PropertyObject[type=color].\n* If the values are not RGBA model, change them RGBA mdoel.\n* @memberof Property\n* @function stringToColorObject\n* @param {String|PropertyObject} value ex) \"rgba(0,0,0,1)\"\n* @return {PropertyObject} PropertyObject[type=color]\n* @example\nstringToColorObject(\"rgba(0, 0, 0,1)\")\n// => PropertyObject(type=\"color\", model=\"rgba\", value=[0, 0, 0,1], separator=\",\")\n*/\nexport function stringToColorObject(value: string): string | PropertyObject {\n const result = stringToRGBA(value);\n\n return result ? arrayToColorObject(result) : value;\n}\n/**\n* convert CSS Value to PropertyObject\n* @memberof Property\n* @function toPropertyObject\n* @param {String} value it's text contains the array.\n* @return {String} Not Array, Not Separator, Only Number & Unit\n* @return {PropertyObject} Array with Separator.\n* @see referenced regular expression {@link http://stackoverflow.com/questions/20215440/parse-css-gradient-rule-with-javascript-regex}\n* @example\ntoPropertyObject(\"1px solid #000\");\n// => PropertyObject([\"1px\", \"solid\", rgba(0, 0, 0, 1)])\n*/\nexport function toPropertyObject(value: any[]): PropertyObject;\nexport function toPropertyObject(value: IObject): IObject;\nexport function toPropertyObject(value: string): PropertyObject | string;\nexport function toPropertyObject(value: string | IObject | any[]) {\n if (!isString(value)) {\n if (isArray(value)) {\n return arrayToPropertyObject(value, \",\");\n }\n return value;\n }\n let values = splitComma(value);\n\n if (values.length > 1) {\n return arrayToPropertyObject(values.map(v => toPropertyObject(v)), \",\");\n }\n values = splitSpace(value);\n if (values.length > 1) {\n return arrayToPropertyObject(values.map(v => toPropertyObject(v)), \" \");\n }\n values = /^(['\"])([^'\"]*)(['\"])$/g.exec(value);\n if (values && values[1] === values[3]) {\n // Quotes\n return new PropertyObject([toPropertyObject(values[2])], {\n prefix: values[1],\n suffix: values[1],\n });\n } else if (value.indexOf(\"(\") !== -1) {\n // color\n return stringToBracketObject(value);\n } else if (value.charAt(0) === \"#\") {\n return stringToColorObject(value);\n }\n return value;\n}\nexport function toObject(object: PropertyObject, result: IObject = {}) {\n const model = object.model;\n\n if (model) {\n object.setOptions({\n model: \"\",\n suffix: \"\",\n prefix: \"\",\n });\n const value = object.size() > 1 ? object : object.get(0);\n\n result[model] = value;\n } else {\n object.forEach(obj => {\n toObject(obj, result);\n });\n }\n return result;\n}\n","import {\n ROLES, MAXIMUM, FIXED, ALIAS,\n PAUSED, RUNNING, PLAY, ENDED, PREFIX, PLAY_CSS, CURRENT_TIME, START_ANIMATION, EASINGS\n} from \"./consts\";\nimport PropertyObject from \"./PropertyObject\";\nimport Scene from \"./Scene\";\nimport SceneItem from \"./SceneItem\";\nimport {\n isArray, ANIMATION, ARRAY, OBJECT,\n PROPERTY, STRING, NUMBER, IS_WINDOW, IObject, $, document, isObject, addEvent, removeEvent, isString,\n} from \"@daybrush/utils\";\nimport { EasingType, EasingFunction } from \"./types\";\nimport { toPropertyObject } from \"./utils/property\";\nimport { bezier, steps } from \"./easing\";\n\nexport function isPropertyObject(value: any): value is PropertyObject {\n return value instanceof PropertyObject;\n}\nexport function setAlias(name: string, alias: string[]) {\n ALIAS[name] = alias;\n}\nexport function setRole(names: string[], isProperty?: boolean, isFixedProperty?: boolean) {\n const length = names.length;\n let roles: any = ROLES;\n let fixed: any = FIXED;\n\n for (let i = 0; i < length - 1; ++i) {\n !roles[names[i]] && (roles[names[i]] = {});\n roles = roles[names[i]];\n if (isFixedProperty) {\n !fixed[names[i]] && (fixed[names[i]] = {});\n fixed = fixed[names[i]];\n }\n }\n isFixedProperty && (fixed[names[length - 1]] = true);\n roles[names[length - 1]] = isProperty ? true : {};\n}\nexport function getType(value: any) {\n const type = typeof value;\n\n if (type === OBJECT) {\n if (isArray(value)) {\n return ARRAY;\n } else if (isPropertyObject(value)) {\n return PROPERTY;\n }\n } else if (type === STRING || type === NUMBER) {\n return \"value\";\n }\n return type;\n}\nexport function isPureObject(obj: any): obj is object {\n return isObject(obj) && obj.constructor === Object;\n}\nexport function getNames(names: IObject, stack: string[]) {\n let arr: string[][] = [];\n\n if (isPureObject(names)) {\n for (const name in names) {\n stack.push(name);\n arr = arr.concat(getNames(names[name], stack));\n stack.pop();\n }\n } else {\n arr.push(stack.slice());\n }\n return arr;\n}\nexport function updateFrame(names: IObject, properties: IObject) {\n for (const name in properties) {\n const value = properties[name];\n\n if (!isPureObject(value)) {\n names[name] = true;\n continue;\n }\n if (!isObject(names[name])) {\n names[name] = {};\n }\n updateFrame(names[name], properties[name]);\n }\n return names;\n}\nexport function toFixed(num: number) {\n return Math.round(num * MAXIMUM) / MAXIMUM;\n}\nexport function getValueByNames(\n names: Array,\n properties: IObject, length: number = names.length) {\n let value = properties;\n\n for (let i = 0; i < length; ++i) {\n if (!isObject(value)) {\n return undefined;\n }\n value = value[names[i]];\n }\n return value;\n}\nexport function isInProperties(roles: IObject, args: string[], isCheckTrue?: boolean) {\n const length = args.length;\n let role: any = roles;\n\n if (length === 0) {\n return false;\n }\n for (let i = 0; i < length; ++i) {\n if (role === true) {\n return false;\n }\n role = role[args[i]];\n if (!role || (!isCheckTrue && role === true)) {\n return false;\n }\n }\n return true;\n}\nexport function isRole(args: string[], isCheckTrue?: boolean) {\n return isInProperties(ROLES, args, isCheckTrue);\n}\nexport function isFixed(args: string[]) {\n return isInProperties(FIXED, args, true);\n}\n\nexport interface IterationInterface {\n currentTime: number;\n iterationCount: number;\n elapsedTime: number;\n}\nexport function setPlayCSS(item: Scene | SceneItem, isActivate: boolean) {\n item.state[PLAY_CSS] = isActivate;\n}\nexport function isPausedCSS(item: Scene | SceneItem) {\n return item.state[PLAY_CSS] && item.isPaused();\n}\nexport function isEndedCSS(item: Scene | SceneItem) {\n return !item.isEnded() && item.state[PLAY_CSS];\n}\n\nexport function exportCSS(id: number | string, css: string) {\n const styleId = `${PREFIX}STYLE_${toId(id)}`;\n const styleElement: HTMLElement = $(`#${styleId}`);\n\n if (styleElement) {\n styleElement.innerText = css;\n } else {\n document.body.insertAdjacentHTML(\"beforeend\",\n ``);\n }\n}\nexport function makeId(selector?: boolean) {\n for (; ;) {\n const id = `${Math.floor(Math.random() * 10000000)}`;\n\n if (!IS_WINDOW || !selector) {\n return id;\n }\n const checkElement = $(`[data-scene-id=\"${id}\"]`);\n\n if (!checkElement) {\n return id;\n }\n }\n}\nexport function getRealId(item: Scene | SceneItem) {\n return item.getId() || item.setId(makeId(false)).getId();\n}\nexport function toId(text: number | string) {\n return `${text}`.match(/[0-9a-zA-Z]+/g).join(\"\");\n}\nexport function playCSS(\n item: Scene | SceneItem, isExportCSS?: boolean,\n playClassName?: string, properties: object = {}) {\n if (!ANIMATION || item.getPlayState() === RUNNING) {\n return;\n }\n const className = playClassName || START_ANIMATION;\n\n if (isPausedCSS(item)) {\n item.addPlayClass(true, className, properties);\n } else {\n if (item.isEnded()) {\n item.setTime(0);\n }\n isExportCSS && item.exportCSS({ className });\n const el = item.addPlayClass(false, className, properties);\n\n if (!el) {\n return;\n }\n addAnimationEvent(item, el);\n setPlayCSS(item, true);\n }\n item.setPlayState(RUNNING);\n}\n\nexport function addAnimationEvent(item: Scene | SceneItem, el: Element) {\n const state = item.state;\n const duration = item.getDuration();\n const isZeroDuration = !duration || !isFinite(duration);\n const animationend = () => {\n setPlayCSS(item, false);\n item.finish();\n };\n const animationstart = () => {\n item.trigger(PLAY);\n };\n item.once(ENDED, () => {\n removeEvent(el, \"animationcancel\", animationend);\n removeEvent(el, \"animationend\", animationend);\n removeEvent(el, \"animationiteration\", animationiteration);\n removeEvent(el, \"animationstart\", animationstart);\n });\n const animationiteration = ({ elapsedTime }: any) => {\n const currentTime = elapsedTime;\n const iterationCount = isZeroDuration ? 0 : (currentTime / duration);\n\n state[CURRENT_TIME] = currentTime;\n item.setIteration(iterationCount);\n };\n addEvent(el, \"animationcancel\", animationend);\n addEvent(el, \"animationend\", animationend);\n addEvent(el, \"animationiteration\", animationiteration);\n addEvent(el, \"animationstart\", animationstart);\n}\n\nexport function getEasing(curveArray: string | number[] | EasingFunction): EasingType {\n let easing: EasingType;\n\n if (isString(curveArray)) {\n if (curveArray in EASINGS) {\n easing = EASINGS[curveArray];\n } else {\n const obj = toPropertyObject(curveArray);\n\n if (isString(obj)) {\n return 0;\n } else {\n if (obj.model === \"cubic-bezier\") {\n curveArray = obj.value.map(v => parseFloat(v));\n easing = bezier(curveArray[0], curveArray[1], curveArray[2], curveArray[3]);\n } else if (obj.model === \"steps\") {\n easing = steps(parseFloat(obj.value[0]), obj.value[1]);\n } else {\n return 0;\n }\n }\n }\n } else if (isArray(curveArray)) {\n easing = bezier(curveArray[0], curveArray[1], curveArray[2], curveArray[3]);\n } else {\n easing = curveArray;\n }\n\n return easing;\n}\n","import {\n THRESHOLD,\n ALTERNATE, ALTERNATE_REVERSE, REVERSE, INFINITE, NORMAL,\n ITERATION_COUNT, DELAY, FILL_MODE, DIRECTION, PLAY_SPEED,\n DURATION, EASING, ITERATION_TIME, EASING_NAME, PAUSED,\n RUNNING, PLAY, TIMEUPDATE, ENDED, PLAY_STATE, PREV_TIME, TICK_TIME, CURRENT_TIME, ITERATION, OPTIONS, EASINGS\n} from \"./consts\";\nimport EventTrigger from \"./EventTrigger\";\nimport { bezier, steps } from \"./easing\";\nimport { toFixed, getEasing } from \"./utils\";\nimport { splitUnit, isString, camelize, requestAnimationFrame, isArray, cancelAnimationFrame } from \"@daybrush/utils\";\nimport {\n IterationCountType, DirectionType, AnimatorState,\n EasingFunction, FillModeType, PlayStateType, EasingType, AnimatorOptions,\n} from \"./types\";\nimport { toPropertyObject } from \"./utils/property\";\n\nfunction GetterSetter {}>(\n getter: string[], setter: string[], parent: string) {\n return (constructor: T) => {\n const prototype = constructor.prototype;\n\n getter.forEach(name => {\n prototype[camelize(`get ${name}`)] = function() {\n return this[parent][name];\n };\n });\n setter.forEach(name => {\n prototype[camelize(`set ${name}`)] = function(value: any) {\n this[parent][name] = value;\n return this;\n };\n });\n };\n}\nexport function isDirectionReverse(iteration: number, iteraiontCount: IterationCountType, direction: DirectionType) {\n if (direction === REVERSE) {\n return true;\n } else if (iteraiontCount !== INFINITE && iteration === iteraiontCount && iteraiontCount % 1 === 0) {\n return direction === (iteration % 2 >= 1 ? ALTERNATE_REVERSE : ALTERNATE);\n }\n return direction === (iteration % 2 >= 1 ? ALTERNATE : ALTERNATE_REVERSE);\n}\n/**\n* @typedef {Object} AnimatorState The Animator options. Properties used in css animation.\n* @property {number} [duration] The duration property defines how long an animation should take to complete one cycle.\n* @property {\"none\"|\"forwards\"|\"backwards\"|\"both\"} [fillMode] The fillMode property specifies a style for the element when the animation is not playing (before it starts, after it ends, or both).\n* @property {\"infinite\"|number} [iterationCount] The iterationCount property specifies the number of times an animation should be played.\n* @property {array|function} [easing] The easing(timing-function) specifies the speed curve of an animation.\n* @property {number} [delay] The delay property specifies a delay for the start of an animation.\n* @property {\"normal\"|\"reverse\"|\"alternate\"|\"alternate-reverse\"} [direction] The direction property defines whether an animation should be played forwards, backwards or in alternate cycles.\n*/\n\nconst setters = [\"id\", ITERATION_COUNT, DELAY, FILL_MODE,\n DIRECTION, PLAY_SPEED, DURATION, PLAY_SPEED, ITERATION_TIME, PLAY_STATE];\nconst getters = [...setters, EASING, EASING_NAME];\n\n/**\n* play video, animation, the others\n* @extends EventTrigger\n* @see {@link https://www.w3schools.com/css/css3_animations.asp|CSS3 Animation}\n*/\n@GetterSetter(getters, setters, \"state\")\nclass Animator\n extends EventTrigger {\n public state: U;\n private timerId: number = 0;\n\n /**\n * @param - animator's options\n * @example\n const animator = new Animator({\n delay: 2,\n diretion: \"alternate\",\n duration: 2,\n fillMode: \"forwards\",\n iterationCount: 3,\n easing: Scene.easing.EASE,\n });\n */\n constructor(options?: Partial) {\n super();\n this.state = {\n id: \"\",\n easing: 0,\n easingName: \"linear\",\n iterationCount: 1,\n delay: 0,\n fillMode: \"forwards\",\n direction: NORMAL,\n playSpeed: 1,\n currentTime: 0,\n iterationTime: -1,\n iteration: 0,\n tickTime: 0,\n prevTime: 0,\n playState: PAUSED,\n duration: 0,\n } as U;\n this.setOptions(options);\n }\n /**\n * set animator's easing.\n * @param curverArray - The speed curve of an animation.\n * @return {Animator} An instance itself.\n * @example\n animator.({\n delay: 2,\n diretion: \"alternate\",\n duration: 2,\n fillMode: \"forwards\",\n iterationCount: 3,\n easing: Scene.easing.EASE,\n });\n */\n public setEasing(curveArray: string | number[] | EasingFunction): this {\n const easing: EasingType = getEasing(curveArray);\n const easingName = easing && easing[EASING_NAME] || \"linear\";\n const state = this.state;\n\n state[EASING] = easing;\n state[EASING_NAME] = easingName;\n return this;\n }\n /**\n * set animator's options.\n * @see {@link https://www.w3schools.com/css/css3_animations.asp|CSS3 Animation}\n * @param - animator's options\n * @return {Animator} An instance itself.\n * @example\n animator.({\n delay: 2,\n diretion: \"alternate\",\n duration: 2,\n fillMode: \"forwards\",\n iterationCount: 3,\n easing: Scene.eaasing.EASE,\n });\n */\n public setOptions(options: Partial = {}): this {\n for (const name in options) {\n const value = options[name];\n\n if (name === EASING) {\n this.setEasing(value);\n continue;\n } else if (name === DURATION) {\n value && this.setDuration(value);\n continue;\n }\n if (OPTIONS.indexOf(name as any) > -1) {\n this.state[name] = value;\n }\n }\n\n return this;\n }\n /**\n * Get the animator's total duration including delay\n * @return {number} Total duration\n * @example\n animator.getTotalDuration();\n */\n public getTotalDuration(): number {\n return this.getActiveDuration(true);\n }\n /**\n * Get the animator's total duration excluding delay\n * @return {number} Total duration excluding delay\n * @example\n animator.getActiveDuration();\n */\n public getActiveDuration(delay?: boolean): number {\n const state = this.state;\n const count = state[ITERATION_COUNT];\n if (count === INFINITE) {\n return Infinity;\n }\n return (delay ? state[DELAY] : 0) + this.getDuration() * count;\n }\n /**\n * Check if the animator has reached the end.\n * @return {boolean} ended\n * @example\n animator.isEnded(); // true or false\n */\n public isEnded(): boolean {\n if (this.state[TICK_TIME] === 0 && this.state[PLAY_STATE] === PAUSED) {\n return true;\n } else if (this.getTime() < this.getActiveDuration()) {\n return false;\n }\n return true;\n }\n /**\n *Check if the animator is paused:\n * @return {boolean} paused\n * @example\n animator.isPaused(); // true or false\n */\n public isPaused(): boolean {\n return this.state[PLAY_STATE] === PAUSED;\n }\n public start(delay: number = this.state[DELAY]): boolean {\n const state = this.state;\n\n state[PLAY_STATE] = RUNNING;\n if (state[TICK_TIME] >= delay) {\n /**\n * This event is fired when play animator.\n * @event Animator#play\n */\n this.trigger(PLAY);\n return true;\n }\n return false;\n }\n /**\n * play animator\n * @return {Animator} An instance itself.\n */\n public play(toTime?: number) {\n const state = this.state;\n const delay = state[DELAY];\n const currentTime = this.getTime();\n\n state[PLAY_STATE] = RUNNING;\n\n if (this.isEnded() && (currentTime === 0 || currentTime >= this.getActiveDuration())) {\n this.setTime(-delay, true);\n }\n\n this.timerId = requestAnimationFrame((time: number) => {\n state[PREV_TIME] = time;\n this.tick(time, toTime);\n });\n this.start();\n return this;\n }\n /**\n * pause animator\n * @return {Animator} An instance itself.\n */\n public pause(): this {\n const state = this.state;\n\n if (state[PLAY_STATE] !== PAUSED) {\n state[PLAY_STATE] = PAUSED;\n /**\n * This event is fired when animator is paused.\n * @event Animator#paused\n */\n this.trigger(PAUSED);\n }\n cancelAnimationFrame(this.timerId);\n return this;\n }\n /**\n * end animator\n * @return {Animator} An instance itself.\n */\n public finish() {\n this.setTime(0);\n this.state[TICK_TIME] = 0;\n this.end();\n return this;\n }\n /**\n * end animator\n * @return {Animator} An instance itself.\n */\n public end() {\n this.pause();\n /**\n * This event is fired when animator is ended.\n * @event Animator#ended\n */\n this.trigger(ENDED);\n return this;\n }\n /**\n * set currentTime\n * @param {Number|String} time - currentTime\n * @return {Animator} An instance itself.\n * @example\n\n animator.setTime(\"from\"); // 0\n animator.setTime(\"to\"); // 100%\n animator.setTime(\"50%\");\n animator.setTime(10);\n animator.getTime() // 10\n */\n public setTime(time: number | string, isTick?: boolean, isParent?: boolean) {\n const activeDuration = this.getActiveDuration();\n const state = this.state;\n const prevTime = state[TICK_TIME];\n const delay = state[DELAY];\n let currentTime = isTick ? (time as number) : this.getUnitTime(time);\n\n state[TICK_TIME] = delay + currentTime;\n if (currentTime < 0) {\n currentTime = 0;\n } else if (currentTime > activeDuration) {\n currentTime = activeDuration;\n }\n state[CURRENT_TIME] = currentTime;\n this.calculate();\n\n if (isTick && !isParent) {\n const tickTime = state[TICK_TIME];\n\n if (prevTime < delay && time >= 0) {\n this.start(0);\n }\n if (tickTime < prevTime || this.isEnded()) {\n this.end();\n return;\n }\n }\n if (this.isDelay()) {\n return this;\n }\n /**\n * This event is fired when the animator updates the time.\n * @event Animator#timeupdate\n * @param {Object} param The object of data to be sent to an event.\n * @param {Number} param.currentTime The total time that the animator is running.\n * @param {Number} param.time The iteration time during duration that the animator is running.\n * @param {Number} param.iterationCount The iteration count that the animator is running.\n */\n this.trigger(TIMEUPDATE, {\n currentTime,\n time: this.getIterationTime(),\n iterationCount: state[ITERATION],\n });\n\n return this;\n }\n /**\n * Get the animator's current time\n * @return {number} current time\n * @example\n animator.getTime();\n */\n public getTime(): number {\n return this.state[CURRENT_TIME];\n }\n public getUnitTime(time: string | number) {\n if (isString(time)) {\n const duration = this.getDuration() || 100;\n\n if (time === \"from\") {\n return 0;\n } else if (time === \"to\") {\n return duration;\n }\n const { unit, value } = splitUnit(time);\n\n if (unit === \"%\") {\n !this.getDuration() && (this.setDuration(duration));\n return toFixed(parseFloat(time) / 100 * duration);\n } else if (unit === \">\") {\n return value + THRESHOLD;\n } else {\n return value;\n }\n } else {\n return toFixed(time);\n }\n }\n /**\n * Check if the current state of animator is delayed.\n * @return {boolean} check delay state\n */\n public isDelay() {\n const state = this.state;\n const delay = state[DELAY];\n const tickTime = state[TICK_TIME];\n\n return delay > 0 && (tickTime < delay);\n }\n public setIteration(iterationCount: number): this {\n const state = this.state;\n const passIterationCount = Math.floor(iterationCount);\n const maxIterationCount = state[ITERATION_COUNT] === INFINITE ? Infinity : state[ITERATION_COUNT];\n\n if (state[ITERATION] < passIterationCount && passIterationCount < maxIterationCount) {\n /**\n * The event is fired when an iteration of an animation ends.\n * @event Animator#iteration\n * @param {Object} param The object of data to be sent to an event.\n * @param {Number} param.currentTime The total time that the animator is running.\n * @param {Number} param.iterationCount The iteration count that the animator is running.\n */\n this.trigger(\"iteration\", {\n currentTime: state[CURRENT_TIME],\n iterationCount: passIterationCount,\n });\n }\n state[ITERATION] = iterationCount;\n return this;\n }\n protected calculate() {\n const state = this.state;\n const iterationCount = state[ITERATION_COUNT];\n const fillMode = state[FILL_MODE];\n const direction = state[DIRECTION];\n const duration = this.getDuration();\n const time = this.getTime();\n const iteration = duration === 0 ? 0 : time / duration;\n let currentIterationTime = duration ? time % duration : 0;\n\n if (!duration) {\n this.setIterationTime(0);\n return this;\n }\n this.setIteration(iteration);\n\n // direction : normal, reverse, alternate, alternate-reverse\n // fillMode : forwards, backwards, both, none\n const isReverse = isDirectionReverse(iteration, iterationCount, direction);\n\n const isFiniteDuration = isFinite(duration);\n if (isFiniteDuration && isReverse) {\n currentIterationTime = duration - currentIterationTime;\n }\n if (isFiniteDuration && iterationCount !== INFINITE) {\n const isForwards = fillMode === \"both\" || fillMode === \"forwards\";\n\n // fill forwards\n if (iteration >= iterationCount) {\n currentIterationTime = duration * (isForwards ? (iterationCount % 1) || 1 : 0);\n isReverse && (currentIterationTime = duration - currentIterationTime);\n }\n }\n this.setIterationTime(currentIterationTime);\n return this;\n }\n private tick(now: number, to?: number) {\n if (this.isPaused()) {\n return;\n }\n const state = this.state;\n const playSpeed = state[PLAY_SPEED];\n const prevTime = state[PREV_TIME];\n const delay = state[DELAY];\n const tickTime = state[TICK_TIME];\n const currentTime = tickTime + Math.min(1000, now - prevTime) / 1000 * playSpeed;\n\n state[PREV_TIME] = now;\n this.setTime(currentTime - delay, true);\n if (to && to * 1000 < now) {\n this.pause();\n }\n if (state[PLAY_STATE] === PAUSED) {\n return;\n }\n\n this.timerId = requestAnimationFrame((time: number) => {\n this.tick(time, to);\n });\n }\n}\n/**\n * Specifies the unique indicator of the animator\n * @method Animator#setId\n * @param {number | string} - String or number of id to be set in the animator\n * @return {Animator} An instance itself.\n */\n/**\n * Specifies the unique indicator of the animator\n * @method Animator#getId\n * @return {number | string} the indicator of the item.\n */\n/**\n * Get a delay for the start of an animation.\n * @method Animator#getDelay\n * @return {number} delay\n */\n/**\n * Set a delay for the start of an animation.\n * @method Animator#setDelay\n * @param {number} delay - delay\n * @return {Animator} An instance itself.\n */\n/**\n * Get fill mode for the item when the animation is not playing (before it starts, after it ends, or both)\n * @method Animator#getFillMode\n * @return {FillModeType} fillMode\n */\n/**\n * Set fill mode for the item when the animation is not playing (before it starts, after it ends, or both)\n * @method Animator#setFillMode\n * @param {FillModeType} fillMode - fillMode\n * @return {Animator} An instance itself.\n */\n/**\n * Get the number of times an animation should be played.\n * @method Animator#getIterationCount\n * @return {IterationCountType} iterationCount\n */\n/**\n * Set the number of times an animation should be played.\n * @method Animator#setIterationCount\n * @param {IterationCountType} iterationCount - iterationCount\n * @return {Animator} An instance itself.\n */\n/**\n * Get whether an animation should be played forwards, backwards or in alternate cycles.\n * @method Animator#getDirection\n * @return {DirectionType} direction\n */\n/**\n * Set whether an animation should be played forwards, backwards or in alternate cycles.\n * @method Animator#setDirection\n * @param {DirectionType} direction - direction\n * @return {Animator} An instance itself.\n */\n/**\n * Get whether the animation is running or paused.\n * @method Animator#getPlayState\n * @return {PlayStateType} playState\n */\n/**\n * Set whether the animation is running or paused.\n * @method Animator#setPlayState\n * @param {PlayStateType} playState - playState\n * @return {Animator} An instance itself.\n */\n/**\n * Get the animator's play speed\n * @method Animator#getPlaySpeed\n * @return {number} playSpeed\n */\n/**\n * Set the animator's play speed\n * @method Animator#setPlaySpeed\n * @param {number} playSpeed - playSpeed\n * @return {Animator} An instance itself.\n */\n/**\n * Get how long an animation should take to complete one cycle.\n * @method Animator#getDuration\n * @return {number} duration\n */\n/**\n * Set how long an animation should take to complete one cycle.\n * @method Animator#setDuration\n * @param {number} duration - duration\n * @return {Animator} An instance itself.\n */\n/**\n * Get the speed curve of an animation.\n * @method Animator#getEasing\n * @return {EasingType} easing\n */\n/**\n * Get the speed curve's name\n * @method Animator#getEasingName\n * @return {string} the curve's name.\n */\n/**\n\t* Get the animator's current iteration time\n\t* @method Animator#getIterationTime\n\t* @return {number} current iteration time\n\t* @example\nanimator.getIterationTime();\n\t*/\n\n// tslint:disable-next-line:interface-name\ninterface Animator {\n setId(id: number | string): this;\n getId(): number | string;\n getIterationTime(): number;\n setIterationTime(time: number): this;\n setDelay(delay: number): this;\n getDelay(): number;\n setFillMode(fillMode: FillModeType): this;\n getFillMode(): FillModeType;\n setIterationCount(iterationCount: IterationCountType): this;\n getIterationCount(): IterationCountType;\n setDirection(direction: DirectionType): this;\n getDirection(): DirectionType;\n setPlayState(playState: PlayStateType): this;\n getPlayState(): PlayStateType;\n setPlaySpeed(playSpeed: number): this;\n getPlaySpeed(): number;\n setDuration(duration: number): this;\n getDuration(): number;\n getEasing(): EasingType;\n getEasingName(): string;\n}\nexport default Animator;\n","import {\n ALIAS, TIMING_FUNCTION, TRANSFORM_NAME, EASING_NAME\n} from \"./consts\";\nimport { isRole, getType, isPropertyObject, getValueByNames, isFixed, getNames, getEasing } from \"./utils\";\nimport { toPropertyObject, splitStyle, toObject } from \"./utils/property\";\nimport {\n isObject, isArray, isString,\n ANIMATION, TRANSFORM, FILTER, PROPERTY, FUNCTION, ARRAY, OBJECT, IObject, isUndefined\n} from \"@daybrush/utils\";\nimport { NameType } from \"./types\";\n\nfunction toInnerProperties(obj: IObject) {\n if (!obj) {\n return \"\";\n }\n const arrObj = [];\n\n for (const name in obj) {\n arrObj.push(`${name.replace(/\\d$/g, \"\")}(${obj[name]})`);\n }\n return arrObj.join(\" \");\n}\n\n/* eslint-disable */\nfunction clone(target: IObject, toValue = false) {\n return merge({}, target, toValue);\n}\nfunction merge(to: IObject, from: IObject, toValue = false) {\n for (const name in from) {\n const value = from[name];\n const type = getType(value);\n\n if (type === PROPERTY) {\n to[name] = toValue ? value.toValue() : value.clone();\n } else if (type === FUNCTION) {\n to[name] = toValue ? getValue([name], value) : value;\n } else if (type === ARRAY) {\n to[name] = value.slice();\n } else if (type === OBJECT) {\n if (isObject(to[name]) && !isPropertyObject(to[name])) {\n merge(to[name], value, toValue);\n } else {\n to[name] = clone(value, toValue);\n }\n } else {\n to[name] = from[name];\n }\n }\n return to;\n}\n/* eslint-enable */\n\nfunction getPropertyName(args: NameType[]) {\n return args[0] in ALIAS ? ALIAS[args[0]] : args;\n}\nfunction getValue(names: NameType[], value: any): any {\n const type = getType(value);\n\n if (type === PROPERTY) {\n return value.toValue();\n } else if (type === FUNCTION) {\n if (names[0] !== TIMING_FUNCTION) {\n return getValue(names, value());\n }\n } else if (type === OBJECT) {\n return clone(value, true);\n }\n return value;\n}\n/**\n* Animation's Frame\n*/\nclass Frame {\n public properties: IObject;\n /**\n * @param - properties\n * @example\n const frame = new Scene.Frame({\n display: \"none\"\n transform: {\n translate: \"50px\",\n scale: \"5, 5\",\n }\n });\n */\n constructor(properties: any = {}) {\n this.properties = {};\n this.set(properties);\n }\n /**\n * get property value\n * @param {...Number|String|PropertyObject} args - property name or value\n * @example\n frame.get(\"display\") // => \"none\", \"block\", ....\n frame.get(\"transform\", \"translate\") // => \"10px,10px\"\n */\n public get(...args: NameType[]) {\n const value = this.raw(...args);\n\n return getValue(getPropertyName(args), value);\n }\n\n public raw(...args: NameType[]) {\n return getValueByNames(getPropertyName(args), this.properties);\n }\n /**\n * remove property value\n * @param {...String} args - property name\n * @return {Frame} An instance itself\n * @example\n frame.remove(\"display\")\n */\n public remove(...args: NameType[]) {\n const params = getPropertyName(args);\n const length = params.length;\n\n if (!length) {\n return this;\n }\n const value = getValueByNames(params, this.properties, length - 1);\n\n if (isObject(value)) {\n delete value[params[length - 1]];\n }\n return this;\n }\n /**\n * set property\n * @param {...Number|String|PropertyObject} args - property names or values\n * @return {Frame} An instance itself\n * @example\n // one parameter\n frame.set({\n display: \"none\",\n transform: {\n translate: \"10px, 10px\",\n scale: \"1\",\n },\n filter: {\n brightness: \"50%\",\n grayscale: \"100%\"\n }\n });\n\n // two parameters\n frame.set(\"transform\", {\n translate: \"10px, 10px\",\n scale: \"1\",\n });\n\n // three parameters\n frame.set(\"transform\", \"translate\", \"50px\");\n */\n public set(...args: any[]) {\n const self = this;\n const length = args.length;\n const params = args.slice(0, -1);\n const value = args[length - 1];\n\n if (params[0] in ALIAS) {\n self._set(ALIAS[params[0]], value);\n } else if (length === 2 && isArray(params[0])) {\n self._set(params[0], value);\n } else if (isArray(value)) {\n self._set(params, value);\n } else if (isPropertyObject(value)) {\n if (isRole(params)) {\n self.set(...params, toObject(value));\n } else {\n self._set(params, value);\n }\n } else if (isObject(value)) {\n if (!self.has(...params) && isRole(params)) {\n self._set(params, {});\n }\n for (const name in value) {\n self.set(...params, name, value[name]);\n }\n } else if (isString(value)) {\n if (isRole(params, true)) {\n if (isFixed(params) || !isRole(params)) {\n this._set(params, value);\n } else {\n const obj = toPropertyObject(value);\n\n if (isObject(obj)) {\n self.set(...params, obj);\n }\n }\n return this;\n } else {\n const { styles, length: stylesLength } = splitStyle(value);\n\n for (const name in styles) {\n self.set(...params, name, styles[name]);\n }\n if (stylesLength) {\n return this;\n }\n }\n self._set(params, value);\n } else {\n self._set(params, value);\n }\n return self;\n }\n /**\n * Gets the names of properties.\n * @return the names of properties.\n * @example\n // one parameter\n frame.set({\n display: \"none\",\n transform: {\n translate: \"10px, 10px\",\n scale: \"1\",\n },\n });\n\n // [[\"display\"], [\"transform\", \"translate\"], [\"transform\", \"scale\"]]\n console.log(frame.getNames());\n */\n public getNames(): string[][] {\n return getNames(this.properties, []);\n }\n /**\n * check that has property.\n * @param {...String} args - property name\n * @example\n frame.has(\"property\", \"display\") // => true or false\n */\n public has(...args: NameType[]) {\n const params = getPropertyName(args);\n const length = params.length;\n\n if (!length) {\n return false;\n }\n return !isUndefined(getValueByNames(params, this.properties, length));\n }\n /**\n * clone frame.\n * @return {Frame} An instance of clone\n * @example\n frame.clone();\n */\n public clone() {\n const frame = new Frame();\n\n return frame.merge(this);\n }\n /**\n * merge one frame to other frame.\n * @param - target frame.\n * @return {Frame} An instance itself\n * @example\n frame.merge(frame2);\n */\n public merge(frame: Frame) {\n const properties = this.properties;\n const frameProperties = frame.properties;\n\n if (!frameProperties) {\n return this;\n }\n merge(properties, frameProperties);\n\n return this;\n }\n /**\n * Specifies an css object that coverted the frame.\n * @return {object} cssObject\n */\n public toCSSObject() {\n const properties = this.get();\n const cssObject: IObject = {};\n\n for (const name in properties) {\n if (isRole([name], true)) {\n continue;\n }\n const value = properties[name];\n\n if (name === TIMING_FUNCTION) {\n cssObject[TIMING_FUNCTION.replace(\"animation\", ANIMATION)] =\n (isString(value) ? value : value[EASING_NAME]) || \"initial\";\n } else if (name === \"content\") {\n cssObject.content = `\"${(\"\" + value).replace(/\"/g, \"\\\\\\\"\")}\"`;\n } else {\n cssObject[name] = value;\n }\n }\n const transform = toInnerProperties(properties[TRANSFORM_NAME]);\n const filter = toInnerProperties(properties.filter);\n\n TRANSFORM && transform && (cssObject[TRANSFORM] = transform);\n FILTER && filter && (cssObject[FILTER] = filter);\n return cssObject;\n }\n /**\n * Specifies an css text that coverted the frame.\n * @return {string} cssText\n */\n public toCSS() {\n const cssObject = this.toCSSObject();\n const cssArray = [];\n\n for (const name in cssObject) {\n cssArray.push(`${name}:${cssObject[name]};`);\n }\n return cssArray.join(\"\");\n }\n private _set(args: NameType[], value: any) {\n let properties = this.properties;\n const length = args.length;\n\n for (let i = 0; i < length - 1; ++i) {\n const name = args[i];\n\n !(name in properties) && (properties[name] = {});\n properties = properties[name];\n }\n if (!length) {\n return;\n }\n if (args.length === 1 && args[0] === TIMING_FUNCTION ) {\n properties[TIMING_FUNCTION] = getEasing(value);\n } else {\n properties[args[length - 1]] = isString(value) ? toPropertyObject(value) : value;\n }\n }\n}\nexport default Frame;\n","\nimport PropertyObject from \"../PropertyObject\";\nimport { getType } from \"../utils\";\nimport { toPropertyObject } from \"./property\";\nimport { splitUnit, PROPERTY, FUNCTION, ARRAY, dot as dotNumber } from \"@daybrush/utils\";\nimport { EasingType } from \"../types\";\n\nfunction dotArray(a1: any[], a2: any, b1: number, b2: number): any {\n const length = a2.length;\n\n return a1.map((v1, i) => {\n if (i >= length) {\n return v1;\n } else {\n return dot(v1, a2[i], b1, b2);\n }\n });\n}\n\nfunction dotColor(color1: PropertyObject, color2: PropertyObject, b1: number, b2: number) {\n // convert array to PropertyObject(type=color)\n const value1 = color1.value;\n const value2 = color2.value;\n // If the model name is not same, the inner product is impossible.\n const model1 = color1.model;\n const model2 = color2.model;\n\n if (model1 !== model2) {\n // It is recognized as a string.\n return dot(color1.toValue(), color2.toValue(), b1, b2);\n }\n if (value1.length === 3) {\n value1[3] = 1;\n }\n if (value2.length === 3) {\n value2[3] = 1;\n }\n const v = dotArray(value1, value2, b1, b2);\n const colorModel = model1;\n\n for (let i = 0; i < 3; ++i) {\n v[i] = parseInt(v[i], 10);\n }\n const object = new PropertyObject(v, {\n type: \"color\",\n model: colorModel,\n prefix: `${colorModel}(`,\n suffix: \")\",\n });\n\n return object;\n}\n\nfunction dotObject(a1: PropertyObject, a2: PropertyObject, b1: number, b2: number) {\n const a1Type = a1.type;\n\n if (a1Type === \"color\") {\n return dotColor(a1, a2, b1, b2);\n }\n const value1 = a1.value;\n const value2 = a2.value;\n const arr = dotArray(value1, value2, b1, b2);\n\n return new PropertyObject(arr, {\n type: a1Type,\n separator: a1.separator || a2.separator,\n prefix: a1.prefix || a2.prefix,\n suffix: a1.suffix || a2.suffix,\n model: a1.model || a2.model,\n });\n}\n/**\n* The dot product of a1 and a2 for the b1 and b2.\n* @memberof Dot\n* @function dot\n* @param {String|Number|PropertyObject} a1 value1\n* @param {String|Number|PropertyObject} a2 value2\n* @param {Number} b1 b1 ratio\n* @param {Number} b2 b2 ratio\n* @return {String} Not Array, Not Separator, Only Number & Unit\n* @return {PropertyObject} Array with Separator.\n* @example\ndot(1, 3, 0.3, 0.7);\n// => 1.6\n*/\nexport function dot(a1: any, a2: any, b1: number, b2: number): any {\n if (b2 === 0) {\n return a2;\n } else if (b1 === 0 || b1 + b2 === 0) {\n // prevent division by zero.\n return a1;\n }\n // dot Object\n\n const type1 = getType(a1);\n const type2 = getType(a2);\n const isFunction1 = type1 === FUNCTION;\n const isFunction2 = type2 === FUNCTION;\n\n if (isFunction1 || isFunction2) {\n return () => {\n return dot(isFunction1 ? toPropertyObject(a1()) : a1, isFunction2 ? toPropertyObject(a2()) : a2, b1, b2);\n };\n } else if (type1 === type2) {\n if (type1 === PROPERTY) {\n return dotObject(a1, a2, b1, b2);\n } else if (type1 === ARRAY) {\n return dotArray(a1, a2, b1, b2);\n } else if (type1 !== \"value\") {\n return a1;\n }\n } else {\n return a1;\n }\n const v1 = splitUnit(`${a1}`);\n const v2 = splitUnit(`${a2}`);\n let v;\n\n // 숫자가 아닐경우 첫번째 값을 반환 b2가 0일경우 두번째 값을 반환\n if (isNaN(v1.value) || isNaN(v2.value)) {\n return a1;\n } else {\n v = dotNumber(v1.value, v2.value, b1, b2);\n }\n const prefix = v1.prefix || v2.prefix;\n const unit = v1.unit || v2.unit;\n\n if (!prefix && !unit) {\n return v;\n }\n return prefix + v + unit;\n}\n\nexport function dotValue(\n time: number,\n prevTime: number,\n nextTime: number,\n prevValue: any,\n nextValue: any,\n easing?: EasingType) {\n if (time === prevTime) {\n return prevValue;\n } else if (time === nextTime) {\n return nextValue;\n } else if (!easing) {\n return dot(prevValue, nextValue, time - prevTime, nextTime - time);\n }\n const ratio = easing((time - prevTime) / (nextTime - prevTime));\n const value = dot(prevValue, nextValue, ratio, 1 - ratio);\n\n return value;\n}\n","import Animator, { isDirectionReverse } from \"./Animator\";\nimport Frame from \"./Frame\";\nimport {\n toFixed,\n isFixed,\n playCSS,\n toId,\n exportCSS,\n getRealId,\n makeId,\n isPausedCSS,\n isRole,\n isInProperties,\n getValueByNames,\n isEndedCSS,\n setPlayCSS,\n getNames,\n updateFrame,\n} from \"./utils\";\nimport { dotValue } from \"./utils/dot\";\nimport {\n START_ANIMATION,\n PREFIX, THRESHOLD,\n TIMING_FUNCTION, ALTERNATE, ALTERNATE_REVERSE, INFINITE,\n REVERSE, EASING, FILL_MODE, DIRECTION, ITERATION_COUNT,\n EASING_NAME, DELAY, PLAY_SPEED, DURATION, PAUSE_ANIMATION, DATA_SCENE_ID, SELECTOR, ROLES, CURRENT_TIME\n} from \"./consts\";\nimport {\n isObject, isArray, isUndefined, decamelize,\n ANIMATION, fromCSS, addClass, removeClass, hasClass,\n KEYFRAMES, requestAnimationFrame, isFunction,\n IObject, $, splitComma, toArray, isString, IArrayFormat,\n dot as dotNumber,\n find,\n findIndex,\n} from \"@daybrush/utils\";\nimport {\n NameType, RoleObject, AnimateElement, AnimatorState,\n SceneItemState, SceneItemOptions, EasingType, PlayCondition, DirectionType\n} from \"./types\";\n\nfunction getNearTimeIndex(times: number[], time: number) {\n const length = times.length;\n\n for (let i = 0; i < length; ++i) {\n if (times[i] === time) {\n return [i, i];\n } else if (times[i] > time) {\n return [i > 0 ? i - 1 : 0, i];\n }\n }\n return [length - 1, length - 1];\n}\nfunction makeAnimationProperties(properties: object) {\n const cssArray = [];\n\n for (const name in properties) {\n cssArray.push(`${ANIMATION}-${decamelize(name)}:${properties[name]};`);\n }\n return cssArray.join(\"\");\n}\nfunction addTime(times: number[], time: number) {\n const length = times.length;\n for (let i = 0; i < length; ++i) {\n if (time < times[i]) {\n times.splice(i, 0, time);\n return;\n }\n }\n times[length] = time;\n}\nfunction addEntry(entries: number[][], time: number, keytime: number) {\n const prevEntry = entries[entries.length - 1];\n\n (!prevEntry || prevEntry[0] !== time || prevEntry[1] !== keytime) &&\n entries.push([toFixed(time), toFixed(keytime)]);\n}\nexport function getEntries(times: number[], states: AnimatorState[]) {\n let entries = times.map(time => ([time, time]));\n let nextEntries = [];\n\n states.forEach(state => {\n const iterationCount = state[ITERATION_COUNT] as number;\n const delay = state[DELAY];\n const playSpeed = state[PLAY_SPEED];\n const direction = state[DIRECTION];\n const intCount = Math.ceil(iterationCount);\n const currentDuration = entries[entries.length - 1][0];\n const length = entries.length;\n const lastTime = currentDuration * iterationCount;\n\n for (let i = 0; i < intCount; ++i) {\n const isReverse =\n direction === REVERSE ||\n direction === ALTERNATE && i % 2 ||\n direction === ALTERNATE_REVERSE && !(i % 2);\n\n for (let j = 0; j < length; ++j) {\n const entry = entries[isReverse ? length - j - 1 : j];\n const time = entry[1];\n const currentTime = currentDuration * i + (isReverse ? currentDuration - entry[0] : entry[0]);\n const prevEntry = entries[isReverse ? length - j : j - 1];\n\n if (currentTime > lastTime) {\n if (j !== 0) {\n const prevTime = currentDuration * i +\n (isReverse ? currentDuration - prevEntry[0] : prevEntry[0]);\n const divideTime = dotNumber(prevEntry[1], time, lastTime - prevTime, currentTime - lastTime);\n\n addEntry(nextEntries, (delay + currentDuration * iterationCount) / playSpeed, divideTime);\n }\n break;\n } else if (\n currentTime === lastTime\n && nextEntries.length\n && nextEntries[nextEntries.length - 1][0] === lastTime + delay\n ) {\n break;\n }\n addEntry(nextEntries, (delay + currentTime) / playSpeed, time);\n }\n }\n // delay time\n delay && nextEntries.unshift([0, nextEntries[0][1]]);\n\n entries = nextEntries;\n nextEntries = [];\n });\n\n return entries;\n}\n/**\n* manage Frame Keyframes and play keyframes.\n* @extends Animator\n* @example\nconst item = new SceneItem({\n\t0: {\n\t\tdisplay: \"none\",\n\t},\n\t1: {\n\t\tdisplay: \"block\",\n\t\topacity: 0,\n\t},\n\t2: {\n\t\topacity: 1,\n\t}\n});\n*/\nclass SceneItem extends Animator {\n public times: number[] = [];\n public items: IObject = {};\n public names: RoleObject = {};\n public elements: AnimateElement[] = [];\n public temp: Frame;\n private needUpdate: boolean = true;\n private target: any;\n private targetFunc: (frame: Frame) => void;\n\n /**\n * @param - properties\n * @param - options\n * @example\n const item = new SceneItem({\n 0: {\n display: \"none\",\n },\n 1: {\n display: \"block\",\n opacity: 0,\n },\n 2: {\n opacity: 1,\n }\n });\n */\n constructor(properties?: any, options?: Partial) {\n super();\n this.load(properties, options);\n }\n public getDuration() {\n const times = this.times;\n const length = times.length;\n\n return (length === 0 ? 0 : times[length - 1]) || this.state[DURATION];\n }\n /**\n * get size of list\n * @return {Number} length of list\n */\n public size() {\n return this.times.length;\n }\n public setDuration(duration: number) {\n if (!duration) {\n return this;\n }\n const originalDuration = this.getDuration();\n\n if (originalDuration > 0) {\n const ratio = duration / originalDuration;\n const { times, items } = this;\n const obj: IObject = {};\n\n this.times = times.map(time => {\n const time2 = toFixed(time * ratio);\n\n obj[time2] = items[time];\n\n return time2;\n });\n this.items = obj;\n } else {\n this.newFrame(duration);\n }\n return this;\n }\n public setId(id?: number | string) {\n const state = this.state;\n\n state.id = id || makeId(!!length);\n const elements = this.elements;\n\n if (elements.length && !state[SELECTOR]) {\n const sceneId = toId(this.getId());\n\n state[SELECTOR] = `[${DATA_SCENE_ID}=\"${sceneId}\"]`;\n elements.forEach(element => {\n element.setAttribute(DATA_SCENE_ID, sceneId);\n });\n }\n return this;\n }\n\n /**\n * Set properties to the sceneItem at that time\n * @param {Number} time - time\n * @param {...String|Object} [properties] - property names or values\n * @return {SceneItem} An instance itself\n * @example\n item.set(0, \"a\", \"b\") // item.getFrame(0).set(\"a\", \"b\")\n console.log(item.get(0, \"a\")); // \"b\"\n */\n public set(time: any, ...args: any[]) {\n if (isArray(time)) {\n const length = time.length;\n\n for (let i = 0; i < length; ++i) {\n const t = length === 1 ? 0 : this.getUnitTime(`${i / (length - 1) * 100}%`);\n\n this.set(t, time[i]);\n }\n } else if (isObject(time)) {\n for (const t in time) {\n const value = time[t];\n const realTime = this.getUnitTime(t);\n\n if (isNaN(realTime)) {\n getNames(value, [t]).forEach(names => {\n const innerValue = getValueByNames(names.slice(1), value);\n const arr = isArray(innerValue) ?\n innerValue : [getValueByNames(names, this.target), innerValue];\n const length = arr.length;\n\n for (let i = 0; i < length; ++i) {\n this.newFrame(`${i / (length - 1) * 100}%`).set(names, arr[i]);\n }\n });\n } else {\n this.set(realTime, value);\n }\n }\n } else {\n const value = args[0];\n\n if (value instanceof Frame) {\n this.setFrame(time, value);\n } else if (value instanceof SceneItem) {\n const delay = value.getDelay();\n const realTime = this.getUnitTime(time);\n const frames = value.toObject(!this.hasFrame(realTime + delay));\n const duration = value.getDuration();\n const direction = value.getDirection();\n const isReverse = direction.indexOf(\"reverse\") > -1;\n\n for (const frameTime in frames) {\n const nextTime = isReverse ? duration - parseFloat(frameTime) : parseFloat(frameTime);\n this.set(realTime + nextTime, frames[frameTime]);\n }\n } else if (args.length === 1 && isArray(value)) {\n value.forEach((item: any) => {\n this.set(time, item);\n });\n } else {\n const frame = this.newFrame(time);\n\n frame.set(...args);\n }\n }\n this.needUpdate = true;\n return this;\n }\n /**\n * Get properties of the sceneItem at that time\n * @param {Number} time - time\n * @param {...String|Object} args property's name or properties\n * @return {Number|String|PropertyObejct} property value\n * @example\n item.get(0, \"a\"); // item.getFrame(0).get(\"a\");\n item.get(0, \"transform\", \"translate\"); // item.getFrame(0).get(\"transform\", \"translate\");\n */\n public get(time: string | number, ...args: NameType[]) {\n const frame = this.getFrame(time);\n\n return frame && frame.get(...args);\n }\n public remove(time: string | number, ...args: any[]): this;\n /**\n * remove properties to the sceneItem at that time\n * @param {Number} time - time\n * @param {...String|Object} [properties] - property names or values\n * @return {SceneItem} An instance itself\n * @example\n item.remove(0, \"a\");\n */\n public remove(time: string | number, ...args: NameType[]) {\n if (args.length) {\n const frame = this.getFrame(time);\n\n frame && frame.remove(...args);\n } else {\n this.removeFrame(time);\n }\n this.needUpdate = true;\n return this;\n }\n /**\n * Append the item or object at the last time.\n * @param - the scene item or item object\n * @return An instance itself\n * @example\n item.append(new SceneItem({\n 0: {\n opacity: 0,\n },\n 1: {\n opacity: 1,\n }\n }));\n item.append({\n 0: {\n opacity: 0,\n },\n 1: {\n opacity: 1,\n }\n });\n item.set(item.getDuration(), {\n 0: {\n opacity: 0,\n },\n 1: {\n opacity: 1,\n }\n });\n */\n public append(item: SceneItem | IObject) {\n if (item instanceof SceneItem) {\n this.set(this.getDuration(), item);\n } else {\n this.append(new SceneItem(item));\n }\n return this;\n }\n /**\n * Push the front frames for the time and prepend the scene item or item object.\n * @param - the scene item or item object\n * @return An instance itself\n */\n public prepend(item: SceneItem | IObject) {\n if (item instanceof SceneItem) {\n const unshiftTime = item.getDuration() + item.getDelay();\n const firstFrame = this.getFrame(0);\n // remove first frame\n this.removeFrame(0);\n this.unshift(unshiftTime);\n this.set(0, item);\n this.set(unshiftTime + THRESHOLD, firstFrame);\n } else {\n this.prepend(new SceneItem(item));\n }\n return this;\n }\n /**\n * Push out the amount of time.\n * @param - time to push\n * @example\n item.get(0); // frame 0\n item.unshift(3);\n item.get(3) // frame 0\n */\n public unshift(time: number) {\n const { times, items } = this;\n const obj: IObject = {};\n\n this.times = times.map(t => {\n const time2 = toFixed(time + t);\n\n obj[time2] = items[t];\n return time2;\n });\n this.items = obj;\n return this;\n }\n /**\n * Get the frames in the item in object form.\n * @return {}\n * @example\n item.toObject();\n // {0: {display: \"none\"}, 1: {display: \"block\"}}\n */\n public toObject(isStartZero = true): IObject {\n const obj: IObject = {};\n const delay = this.getDelay();\n\n this.forEach((frame: Frame, time: number) => {\n obj[(!time && !isStartZero ? THRESHOLD : 0) + delay + time] = frame.clone();\n });\n return obj;\n }\n /**\n * Specifies an element to synchronize items' keyframes.\n * @param {string} selectors - Selectors to find elements in items.\n * @return {SceneItem} An instance itself\n * @example\nitem.setSelector(\"#id.class\");\n */\n public setSelector(target: string | boolean | ((id: number | string) => string)) {\n if (isFunction(target)) {\n this.setElement(target(this.getId()));\n } else {\n this.setElement(target);\n }\n return this;\n }\n /**\n * Get the elements connected to SceneItem.\n */\n public getElements(): AnimateElement[] {\n return this.elements;\n }\n /**\n * Specifies an element to synchronize item's keyframes.\n * @param - elements to synchronize item's keyframes.\n * @param - Make sure that you have peusdo.\n * @return {SceneItem} An instance itself\n * @example\nitem.setElement(document.querySelector(\"#id.class\"));\nitem.setElement(document.querySelectorAll(\".class\"));\n */\n public setElements(target: boolean | string | AnimateElement | IArrayFormat): this {\n return this.setElement(target);\n }\n /**\n * Specifies an element to synchronize item's keyframes.\n * @param - elements to synchronize item's keyframes.\n * @param - Make sure that you have peusdo.\n * @return {SceneItem} An instance itself\n * @example\nitem.setElement(document.querySelector(\"#id.class\"));\nitem.setElement(document.querySelectorAll(\".class\"));\n */\n public setElement(target: boolean | string | AnimateElement | IArrayFormat) {\n const state = this.state;\n let elements: AnimateElement[] = [];\n\n if (!target) {\n return this;\n } else if (target === true || isString(target)) {\n const selector = target === true ? `${state.id}` : target;\n const matches = /([\\s\\S]+)(:+[a-zA-Z]+)$/g.exec(selector);\n\n elements = toArray($(matches ? matches[1] : selector, true));\n state[SELECTOR] = selector;\n } else {\n elements = (target instanceof Element) ? [target] : toArray(target);\n }\n if (!elements.length) {\n return this;\n }\n this.elements = elements;\n this.setId(this.getId());\n this.target = elements[0].style;\n this.targetFunc = (frame: Frame) => {\n const attributes = frame.get(\"attribute\");\n\n if (attributes) {\n for (const name in attributes) {\n elements.forEach(el => {\n el.setAttribute(name, attributes[name]);\n });\n }\n }\n if (frame.has(\"html\")) {\n const html = frame.get(\"html\");\n\n elements.forEach(el => {\n el.innerHTML = html;\n });\n }\n const cssText = frame.toCSS();\n\n if (state.cssText !== cssText) {\n state.cssText = cssText;\n\n elements.forEach(el => {\n el.style.cssText += cssText;\n });\n return frame;\n }\n };\n return this;\n }\n public setTarget(target: any): this {\n this.target = target;\n this.targetFunc = (frame: Frame) => {\n const obj = frame.get();\n\n for (const name in obj) {\n target[name] = obj[name];\n }\n };\n return this;\n }\n /**\n * add css styles of items's element to the frame at that time.\n * @param {Array} properties - elements to synchronize item's keyframes.\n * @return {SceneItem} An instance itself\n * @example\n item.setElement(document.querySelector(\"#id.class\"));\n item.setCSS(0, [\"opacity\"]);\n item.setCSS(0, [\"opacity\", \"width\", \"height\"]);\n */\n public setCSS(time: number, properties: string[]) {\n this.set(time, fromCSS(this.elements, properties));\n return this;\n }\n public setTime(time: number | string, isTick?: boolean, isParent?: boolean, parentEasing?: EasingType) {\n super.setTime(time, isTick, isParent);\n\n const iterationTime = this.getIterationTime();\n const easing = this.getEasing() || parentEasing;\n const frame = this.getNowFrame(iterationTime, easing);\n const currentTime = this.getTime();\n\n this.temp = frame;\n /**\n * This event is fired when timeupdate and animate.\n * @event SceneItem#animate\n * @param {Number} param.currentTime The total time that the animator is running.\n * @param {Number} param.time The iteration time during duration that the animator is running.\n * @param {Frame} param.frame frame of that time.\n */\n this.trigger(\"animate\", {\n frame,\n currentTime,\n time: iterationTime,\n });\n this.targetFunc && this.targetFunc(frame);\n return this;\n }\n /**\n * update property names used in frames.\n * @return {SceneItem} An instance itself\n * @example\n item.update();\n */\n public update() {\n const names = {};\n this.forEach(frame => {\n updateFrame(names, frame.properties);\n });\n this.names = names;\n this.needUpdate = false;\n return this;\n }\n /**\n * Create and add a frame to the sceneItem at that time\n * @param {Number} time - frame's time\n * @return {Frame} Created frame.\n * @example\n item.newFrame(time);\n */\n public newFrame(time: string | number) {\n let frame = this.getFrame(time);\n\n if (frame) {\n return frame;\n }\n frame = new Frame();\n this.setFrame(time, frame);\n return frame;\n }\n /**\n * Add a frame to the sceneItem at that time\n * @param {Number} time - frame's time\n * @return {SceneItem} An instance itself\n * @example\n item.setFrame(time, frame);\n */\n public setFrame(time: string | number, frame: Frame) {\n const realTime = this.getUnitTime(time);\n\n this.items[realTime] = frame;\n addTime(this.times, realTime);\n this.needUpdate = true;\n return this;\n }\n public getFrame(time: number | string, ...names: any[]): Frame;\n /**\n * get sceneItem's frame at that time\n * @param {Number} time - frame's time\n * @return {Frame} sceneItem's frame at that time\n * @example\n const frame = item.getFrame(time);\n */\n public getFrame(time: number | string) {\n return this.items[this.getUnitTime(time)];\n }\n public removeFrame(time: number | string, ...names: any[]): this;\n /**\n * remove sceneItem's frame at that time\n * @param - frame's time\n * @return {SceneItem} An instance itself\n * @example\n item.removeFrame(time);\n */\n public removeFrame(time: number | string) {\n const realTime = this.getUnitTime(time);\n const items = this.items;\n const index = this.times.indexOf(realTime);\n\n delete items[realTime];\n\n // remove time\n if (index > -1) {\n this.times.splice(index, 1);\n }\n this.needUpdate = true;\n return this;\n }\n /**\n * check if the item has a frame at that time\n * @param {Number} time - frame's time\n * @return {Boolean} true: the item has a frame // false: not\n * @example\n if (item.hasFrame(10)) {\n // has\n } else {\n // not\n }\n */\n public hasFrame(time: number | string) {\n return this.getUnitTime(time) in this.items;\n }\n /**\n * Check if keyframes has propery's name\n * @param - property's time\n * @return {boolean} true: if has property, false: not\n * @example\n item.hasName([\"transform\", \"translate\"]); // true or not\n */\n public hasName(args: string[]) {\n this.needUpdate && this.update();\n return isInProperties(this.names, args, true);\n }\n /**\n * merge frame of the previous time at the next time.\n * @param - The time of the frame to merge\n * @param - The target frame\n * @return {SceneItem} An instance itself\n * @example\n // getFrame(1) contains getFrame(0)\n item.merge(0, 1);\n */\n public mergeFrame(time: number | string, frame: Frame) {\n if (frame) {\n const toFrame = this.newFrame(time);\n\n toFrame.merge(frame);\n }\n return this;\n }\n /**\n * Get frame of the current time\n * @param {Number} time - the current time\n * @param {function} easing - the speed curve of an animation\n * @return {Frame} frame of the current time\n * @example\n let item = new SceneItem({\n 0: {\n display: \"none\",\n },\n 1: {\n display: \"block\",\n opacity: 0,\n },\n 2: {\n opacity: 1,\n }\n });\n // opacity: 0.7; display:\"block\";\n const frame = item.getNowFrame(1.7);\n */\n public getNowFrame(time: number, easing?: EasingType, isAccurate?: boolean) {\n this.needUpdate && this.update();\n const frame = new Frame();\n const [left, right] = getNearTimeIndex(this.times, time);\n let realEasing = this.getEasing() || easing;\n let nameObject = this.names;\n\n if (this.hasName([TIMING_FUNCTION])) {\n const nowEasing = this.getNowValue(time, [TIMING_FUNCTION], left, right, false, 0, true);\n\n isFunction(nowEasing) && (realEasing = nowEasing);\n }\n if (isAccurate) {\n const prevFrame = this.getFrame(time);\n const prevNames = updateFrame({}, prevFrame.properties);\n\n for (const name in ROLES) {\n if (name in prevNames) {\n prevNames[name] = nameObject[name];\n }\n }\n nameObject = prevNames;\n }\n const names = getNames(nameObject, []);\n\n names.forEach(properties => {\n const value = this.getNowValue(time, properties, left, right, isAccurate, realEasing, isFixed(properties));\n\n if (isUndefined(value)) {\n return;\n }\n frame.set(properties, value);\n });\n return frame;\n }\n public load(properties: any = {}, options = properties.options) {\n options && this.setOptions(options);\n\n if (isArray(properties)) {\n this.set(properties);\n } else if (properties.keyframes) {\n this.set(properties.keyframes);\n } else {\n for (const time in properties) {\n if (time !== \"options\") {\n this.set({\n [time]: properties[time],\n });\n }\n }\n }\n if (options && options[DURATION]) {\n this.setDuration(options[DURATION]);\n }\n return this;\n }\n /**\n * clone SceneItem.\n * @return {SceneItem} An instance of clone\n * @example\n * item.clone();\n */\n public clone() {\n const item = new SceneItem();\n\n item.setOptions(this.state);\n this.forEach((frame: Frame, time: number) => {\n item.setFrame(time, frame.clone());\n });\n return item;\n }\n /**\n * executes a provided function once for each scene item.\n * @param - Function to execute for each element, taking three arguments\n * @return {Keyframes} An instance itself\n */\n public forEach(callback: (item: Frame, time: number, items: IObject) => void) {\n const times = this.times;\n const items = this.items;\n\n times.forEach(time => {\n callback(items[time], time, items);\n });\n return this;\n }\n public setOptions(options: Partial = {}) {\n super.setOptions(options);\n const { id, selector, elements, element, target } = options;\n\n id && this.setId(id);\n if (target) {\n this.setTarget(target);\n } else if (selector) {\n this.setSelector(selector);\n } else if (elements || element) {\n this.setElement(elements || element);\n }\n return this;\n }\n public toCSS(\n playCondition: PlayCondition = { className: START_ANIMATION },\n parentDuration = this.getDuration(), states: AnimatorState[] = []) {\n const itemState = this.state;\n const selector = itemState[SELECTOR];\n\n if (!selector) {\n return \"\";\n }\n const originalDuration = this.getDuration();\n itemState[DURATION] = originalDuration;\n states.push(itemState);\n\n const reversedStates = toArray(states).reverse();\n const id = toId(getRealId(this));\n const superParent = states[0];\n const infiniteIndex = findIndex(reversedStates, state => {\n return state[ITERATION_COUNT] === INFINITE || !isFinite(state[DURATION]);\n }, states.length - 1);\n const finiteStates = reversedStates.slice(0, infiniteIndex);\n const duration = parentDuration || finiteStates.reduce((prev, cur) => {\n return (cur[DELAY] + prev * (cur[ITERATION_COUNT] as number)) / cur[PLAY_SPEED];\n }, originalDuration);\n const delay = reversedStates.slice(infiniteIndex).reduce((prev, cur) => {\n return (prev + cur[DELAY]) / cur[PLAY_SPEED];\n }, 0);\n const easingName = find(reversedStates, state => (state[EASING] && state[EASING_NAME]), itemState)[EASING_NAME];\n const iterationCount = reversedStates[infiniteIndex][ITERATION_COUNT];\n const fillMode = superParent[FILL_MODE];\n const direction = reversedStates[infiniteIndex][DIRECTION];\n const cssText = makeAnimationProperties({\n fillMode,\n direction,\n iterationCount,\n delay: `${delay}s`,\n name: `${PREFIX}KEYFRAMES_${id}`,\n duration: `${duration / superParent[PLAY_SPEED]}s`,\n timingFunction: easingName,\n });\n const selectors = splitComma(selector).map(sel => {\n const matches = /([\\s\\S]+)(:+[a-zA-Z]+)$/g.exec(sel);\n\n if (matches) {\n return [matches[1], matches[2]];\n } else {\n return [sel, \"\"];\n }\n });\n const className = playCondition.className;\n const selectorCallback = playCondition.selector;\n const preselector = isFunction(selectorCallback) ? selectorCallback(this, selector) : selectorCallback;\n\n return `\n ${preselector || selectors.map(([sel, peusdo]) => `${sel}.${className}${peusdo}`)} {${cssText}}\n ${selectors.map(([sel, peusdo]) => `${sel}.${PAUSE_ANIMATION}${peusdo}`)} {${ANIMATION}-play-state: paused;}\n @${KEYFRAMES} ${PREFIX}KEYFRAMES_${id}{${this._toKeyframes(duration, finiteStates, direction)}}`;\n }\n /**\n * Export the CSS of the items to the style.\n * @param - Add a selector or className to play.\n * @return {SceneItem} An instance itself\n */\n public exportCSS(\n playCondition?: PlayCondition,\n duration?: number, options?: AnimatorState[]) {\n if (!this.elements.length) {\n return \"\";\n }\n const css = this.toCSS(playCondition, duration, options);\n const isParent = options && !isUndefined(options[ITERATION_COUNT]);\n\n !isParent && exportCSS(getRealId(this), css);\n return this;\n }\n public pause() {\n super.pause();\n isPausedCSS(this) && this.pauseCSS();\n return this;\n }\n public pauseCSS() {\n this.elements.forEach(element => {\n addClass(element, PAUSE_ANIMATION);\n });\n return this;\n }\n public endCSS() {\n this.elements.forEach(element => {\n removeClass(element, PAUSE_ANIMATION);\n removeClass(element, START_ANIMATION);\n });\n setPlayCSS(this, false);\n return this;\n }\n public end() {\n isEndedCSS(this) && this.endCSS();\n super.end();\n return this;\n }\n /**\n * Play using the css animation and keyframes.\n * @param - Check if you want to export css.\n * @param [playClassName=\"startAnimation\"] - Add a class name to play.\n * @param - The shorthand properties for six of the animation properties.\n * @see {@link https://www.w3schools.com/cssref/css3_pr_animation.asp}\n * @example\n item.playCSS();\n item.playCSS(false, \"startAnimation\", {\n direction: \"reverse\",\n fillMode: \"forwards\",\n });\n */\n public playCSS(isExportCSS = true, playClassName?: string, properties: object = {}) {\n playCSS(this, isExportCSS, playClassName, properties);\n return this;\n }\n public addPlayClass(isPaused: boolean, playClassName?: string, properties: object = {}) {\n const elements = this.elements;\n const length = elements.length;\n const cssText = makeAnimationProperties(properties);\n\n if (!length) {\n return;\n }\n if (isPaused) {\n elements.forEach(element => {\n removeClass(element, PAUSE_ANIMATION);\n });\n } else {\n elements.forEach(element => {\n element.style.cssText += cssText;\n if (hasClass(element, START_ANIMATION)) {\n removeClass(element, START_ANIMATION);\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n addClass(element, START_ANIMATION);\n });\n });\n } else {\n addClass(element, START_ANIMATION);\n }\n });\n }\n return elements[0];\n }\n public getNowValue(\n time: number,\n properties: string[],\n left?: number,\n right?: number,\n isAccurate?: boolean,\n easing?: EasingType,\n usePrevValue?: boolean,\n ) {\n const times = this.times;\n const length = times.length;\n\n let prevTime: number;\n let nextTime: number;\n let prevFrame: Frame;\n let nextFrame: Frame;\n const isUndefinedLeft = isUndefined(left);\n const isUndefinedRight = isUndefined(right);\n if (isUndefinedLeft || isUndefinedRight) {\n const indicies = getNearTimeIndex(times, time);\n isUndefinedLeft && (left = indicies[0]);\n isUndefinedRight && (right = indicies[1]);\n }\n\n for (let i = left; i >= 0; --i) {\n const frame = this.getFrame(times[i]);\n\n if (frame.has(...properties)) {\n prevTime = times[i];\n prevFrame = frame;\n break;\n }\n }\n const prevValue = prevFrame && prevFrame.raw(...properties);\n\n if (isAccurate && !isRole([properties[0]])) {\n return prevTime === time ? prevValue : undefined;\n }\n if (usePrevValue) {\n return prevValue;\n }\n for (let i = right; i < length; ++i) {\n const frame = this.getFrame(times[i]);\n\n if (frame.has(...properties)) {\n nextTime = times[i];\n nextFrame = frame;\n break;\n }\n }\n const nextValue = nextFrame && nextFrame.raw(...properties);\n\n if (!prevFrame || isUndefined(prevValue)) {\n return nextValue;\n }\n if (!nextFrame || isUndefined(nextValue) || prevValue === nextValue) {\n return prevValue;\n }\n return dotValue(time, Math.max(prevTime, 0), nextTime, prevValue, nextValue, easing);\n }\n private _toKeyframes(duration: number, states: AnimatorState[], direction: DirectionType) {\n const frames: IObject = {};\n const times = this.times.slice();\n\n if (!times.length) {\n return \"\";\n }\n const originalDuration = this.getDuration();\n (!this.getFrame(0)) && times.unshift(0);\n (!this.getFrame(originalDuration)) && times.push(originalDuration);\n const entries = getEntries(times, states);\n const lastEntry = entries[entries.length - 1];\n\n // end delay time\n lastEntry[0] < duration && addEntry(entries, duration, lastEntry[1]);\n let prevTime = -1;\n\n return entries.map(([time, keytime]) => {\n if (!frames[keytime]) {\n frames[keytime] =\n (!this.hasFrame(keytime) || keytime === 0 || keytime === originalDuration ?\n this.getNowFrame(keytime) : this.getNowFrame(keytime, 0, true)).toCSS();\n }\n\n let frameTime = time / duration * 100;\n\n if (frameTime - prevTime < THRESHOLD) {\n frameTime += THRESHOLD;\n }\n prevTime = frameTime;\n return `${Math.min(frameTime, 100)}%{\n ${time === 0 && !isDirectionReverse(0, 1, direction) ? \"\" : frames[keytime]}\n }`;\n }).join(\"\");\n }\n}\n\nexport default SceneItem;\n","import Animator from \"./Animator\";\nimport SceneItem from \"./SceneItem\";\nimport { SELECTOR, DURATION, DELAY, RUNNING } from \"./consts\";\nimport { playCSS, exportCSS, getRealId, isPausedCSS, isEndedCSS, setPlayCSS } from \"./utils\";\nimport { isFunction, IS_WINDOW, IObject, $, IArrayFormat } from \"@daybrush/utils\";\nimport {\n AnimateElement, SceneState, SceneOptions, EasingType,\n AnimatorState, SceneItemOptions, PlayCondition\n} from \"./types\";\nimport Frame from \"./Frame\";\nimport ListMap from \"list-map\";\n\n/**\n * manage sceneItems and play Scene.\n * @sort 1\n */\nclass Scene extends Animator {\n /**\n * version info\n * @type {string}\n * @example\n * Scene.VERSION // #__VERSION__#\n */\n public static VERSION: string = \"#__VERSION__#\";\n public items: ListMap = new ListMap();\n public temp: IObject;\n /**\n * @param - properties\n * @param - options\n * @example\n const scene = new Scene({\n item1: {\n 0: {\n display: \"none\",\n },\n 1: {\n display: \"block\",\n opacity: 0,\n },\n 2: {\n opacity: 1,\n },\n },\n item2: {\n 2: {\n opacity: 1,\n },\n }\n });\n */\n constructor(properties?: {options?: Partial} & IObject, options?: Partial) {\n super();\n this.load(properties, options);\n }\n public getDuration() {\n let time = 0;\n\n this.forEach(item => {\n time = Math.max(time, item.getTotalDuration() / item.getPlaySpeed());\n });\n return time || this.state[DURATION];\n }\n public setDuration(duration: number) {\n const items = this.items;\n const sceneDuration = this.getDuration();\n\n if (duration === 0 || !isFinite(sceneDuration)) {\n return this;\n }\n if (sceneDuration === 0) {\n this.forEach(item => {\n item.setDuration(duration);\n });\n } else {\n const ratio = duration / sceneDuration;\n\n this.forEach(item => {\n item.setDelay(item.getDelay() * ratio);\n item.setDuration(item.getDuration() * ratio);\n });\n }\n super.setDuration(duration);\n return this;\n }\n public getItem(name: number | string): T;\n /**\n * get item in scene by name\n * @param - The item's name\n * @return {Scene | SceneItem} item\n * @example\n const item = scene.getItem(\"item1\")\n */\n public getItem(name: number | string) {\n return this.items.get(name);\n }\n /**\n * create item in scene\n * @param {} name - name of item to create\n * @param {} options - The option object of SceneItem\n * @return {} Newly created item\n * @example\n const item = scene.newItem(\"item1\")\n */\n public newItem(name: number | string, options: Partial = {}): Scene | SceneItem {\n if (this.items.has(name)) {\n return this.items.get(name);\n }\n const item = new SceneItem();\n\n this.setItem(name, item);\n item.setOptions(options);\n\n return item;\n }\n /**\n * remove item in scene\n * @param - name of item to remove\n * @return An instance itself\n * @example\n const item = scene.newItem(\"item1\")\n\n scene.removeItem(\"item1\");\n */\n public removeItem(name: number | string): this {\n this.items.remove(name);\n return this;\n }\n /**\n * add a sceneItem to the scene\n * @param - name of item to create\n * @param - sceneItem\n * @example\n const item = scene.newItem(\"item1\")\n */\n public setItem(name: number | string, item: Scene | SceneItem) {\n item.setId(name);\n this.items.set(name, item);\n return this;\n }\n public setTime(time: number | string, isTick?: boolean, isParent?: boolean, parentEasing?: EasingType) {\n super.setTime(time, isTick, isParent);\n\n const iterationTime = this.getIterationTime();\n const easing = this.getEasing() || parentEasing;\n const frames: IObject = {};\n\n this.forEach(item => {\n item.setTime(iterationTime * item.getPlaySpeed() - item.getDelay(), isTick, true, easing);\n\n frames[item.getId()] = item.temp;\n });\n this.temp = frames;\n\n /**\n * This event is fired when timeupdate and animate.\n * @event Scene#animate\n * @param {object} param The object of data to be sent to an event.\n * @param {number} param.currentTime The total time that the animator is running.\n * @param {number} param.time The iteration time during duration that the animator is running.\n * @param {object} param.frames frames of that time.\n * @example\nconst scene = new Scene({\n a: {\n 0: {\n opacity: 0,\n },\n 1: {\n opacity: 1,\n }\n },\n b: {\n 0: {\n opacity: 0,\n },\n 1: {\n opacity: 1,\n }\n }\n}).on(\"animate\", e => {\n console.log(e);\n // {a: Frame, b: Frame}\n console.log(e.a.get(\"opacity\"));\n});\n */\n this.trigger(\"animate\", {\n frames,\n currentTime: this.getTime(),\n time: iterationTime,\n });\n\n return this;\n }\n /**\n * executes a provided function once for each scene item.\n * @param - Function to execute for each element, taking three arguments\n * @return {Scene} An instance itself\n */\n public forEach(\n func: (\n item: Scene | SceneItem,\n id: string | number,\n index: number,\n items: IObject,\n ) => void,\n ) {\n const items = this.items;\n\n items.forEach((item, id, index, obj) => {\n func(item, id, index, obj);\n });\n return this;\n }\n public toCSS(\n playCondition?: PlayCondition,\n duration: number = this.getDuration(), parentStates: AnimatorState[] = []) {\n const totalDuration = !duration || !isFinite(duration) ? 0 : duration;\n const styles: string[] = [];\n const state = this.state;\n\n state[DURATION] = this.getDuration();\n\n this.forEach(item => {\n styles.push(item.toCSS(playCondition, totalDuration, parentStates.concat(state)));\n });\n return styles.join(\"\");\n }\n /**\n * Export the CSS of the items to the style.\n * @param - Add a selector or className to play.\n * @return {Scene} An instance itself\n */\n public exportCSS(\n playCondition?: PlayCondition, duration?: number, parentStates?: AnimatorState[]) {\n const css = this.toCSS(playCondition, duration, parentStates);\n\n (!parentStates || !parentStates.length) && exportCSS(getRealId(this), css);\n return this;\n }\n public append(item: SceneItem | Scene) {\n item.setDelay(item.getDelay() + this.getDuration());\n this.setItem(getRealId(item), item);\n }\n public pauseCSS() {\n return this.forEach(item => {\n item.pauseCSS();\n });\n }\n public pause() {\n super.pause();\n\n isPausedCSS(this) && this.pauseCSS();\n this.forEach(item => {\n item.pause();\n });\n return this;\n }\n public endCSS() {\n this.forEach(item => {\n item.endCSS();\n });\n setPlayCSS(this, false);\n }\n public end() {\n isEndedCSS(this) && this.endCSS();\n super.end();\n return this;\n }\n public addPlayClass(isPaused: boolean, playClassName?: string, properties: object = {}) {\n let animtionElement: AnimateElement;\n\n this.forEach(item => {\n const el = item.addPlayClass(isPaused, playClassName, properties);\n\n !animtionElement && (animtionElement = el);\n });\n return animtionElement;\n }\n /**\n * Play using the css animation and keyframes.\n * @param - Check if you want to export css.\n * @param [playClassName=\"startAnimation\"] - Add a class name to play.\n * @param - The shorthand properties for six of the animation properties.\n * @return {Scene} An instance itself\n * @see {@link https://www.w3schools.com/cssref/css3_pr_animation.asp}\n * @example\n scene.playCSS();\n scene.playCSS(false, {\n direction: \"reverse\",\n fillMode: \"forwards\",\n });\n */\n public playCSS(isExportCSS = true, playClassName?: string, properties: Partial = {}) {\n playCSS(this, isExportCSS, playClassName, properties);\n return this;\n }\n public set(properties: any, ...args: any[]): this;\n /**\n * Set properties to the Scene.\n * @param - properties\n * @return An instance itself\n * @example\nscene.set({\n \".a\": {\n 0: {\n opacity: 0,\n },\n 1: {\n opacity: 1,\n },\n },\n});\n// 0\nconsole.log(scene.getItem(\".a\").get(0, \"opacity\"));\n// 1\nconsole.log(scene.getItem(\".a\").get(1, \"opacity\"));\n */\n public set(properties: any) {\n this.load(properties);\n return this;\n }\n public load(properties: any = {}, options = properties.options) {\n if (!properties) {\n return this;\n }\n const selector = options && options[SELECTOR] || this.state[SELECTOR];\n for (const name in properties) {\n if (name === \"options\") {\n continue;\n }\n const object = properties[name];\n let item;\n\n if (object instanceof Scene || object instanceof SceneItem) {\n this.setItem(name, object);\n item = object;\n } else if (isFunction(object) && selector) {\n const elements =\n IS_WINDOW\n ? $(`${isFunction(selector) ? selector(name) : name}`, true) as IArrayFormat\n : ([] as AnimateElement[]);\n const length = elements.length;\n const scene = new Scene();\n\n for (let i = 0; i < length; ++i) {\n (scene.newItem(i) as SceneItem).setId().setElement(elements[i]).load(object(i, elements[i]));\n }\n this.setItem(name, scene);\n continue;\n } else {\n item = this.newItem(name);\n item.load(object);\n }\n selector && item.setSelector(selector);\n }\n this.setOptions(options);\n }\n public setOptions(options: Partial = {}): this {\n super.setOptions(options);\n\n const selector = options.selector;\n\n if (selector) {\n this.state[SELECTOR] = selector;\n }\n return this;\n }\n public setSelector(target?: string | boolean | ((id: number | string) => string)) {\n const state = this.state;\n const selector = target || state[SELECTOR];\n\n state[SELECTOR] = selector;\n const isItFunction = isFunction(target);\n if (selector) {\n this.forEach((item, name) => {\n item.setSelector(isItFunction ? (target as (id: number | string) => string)(name) : selector);\n });\n }\n return this;\n }\n public start(delay: number = this.state[DELAY]): boolean {\n const result = super.start(delay);\n\n if (result) {\n this.forEach(item => {\n item.start(0);\n });\n } else {\n this.forEach(item => {\n item.setPlayState(RUNNING);\n });\n }\n return result;\n }\n}\n\nexport default Scene;\n","import { IObject } from \"@daybrush/utils\";\nimport Scene from \"./Scene\";\nimport SceneItem from \"./SceneItem\";\nimport { SceneOptions, SceneItemOptions } from \"./types\";\n\nexport function animate(properties?: IObject, options?: Partial) {\n return new Scene(properties, options).play();\n}\nexport function animateItem(properties?: IObject, options?: Partial) {\n return new SceneItem(properties, options).play();\n}\n"],"names":["y1","y2","t","t2","x1","x2","x","solveX","dx","Math","abs","cubic","func","solveFromX","max","min","easingName","count","position","time","level","floor","STEP_START","steps","STEP_END","LINEAR","bezier","EASE","EASE_IN","EASE_OUT","EASE_IN_OUT","PREFIX","DATA_SCENE_ID","TIMING_FUNCTION","ROLES","transform","filter","attribute","html","ALIAS","easing","FIXED","_a","MAXIMUM","THRESHOLD","DURATION","FILL_MODE","DIRECTION","ITERATION_COUNT","DELAY","EASING","PLAY_SPEED","EASING_NAME","ITERATION_TIME","PAUSED","ENDED","TIMEUPDATE","ANIMATE","PLAY","RUNNING","ITERATION","START_ANIMATION","PAUSE_ANIMATION","ALTERNATE","REVERSE","ALTERNATE_REVERSE","NORMAL","INFINITE","PLAY_STATE","PLAY_CSS","PREV_TIME","TICK_TIME","CURRENT_TIME","SELECTOR","TRANSFORM_NAME","EASINGS","OPTIONS","EVENTS","events","name","callback","once","isObject","n","_on","isArray","forEach","_this","push","_i","args","off","callback2","callbacks","index","indexOf","splice","data","event","target","type","currentTarget","toArray","apply","value","options","setOptions","isString","split","separator","newOptions","length","prefix","suffix","model","arr","map","v","PropertyObject","clone","join","toValue","str","properties","obj","i","matches","exec","trim","toPropertyObject","styles","RGBA","text","afterModel","COLOR_MODELS","arrayToColorObject","stringToRGBA","result","arrayToPropertyObject","values","splitComma","splitSpace","stringToBracketObject","charAt","stringToColorObject","object","size","get","toObject","alias","names","isProperty","isFixedProperty","roles","fixed","OBJECT","ARRAY","isPropertyObject","PROPERTY","STRING","NUMBER","constructor","Object","stack","isPureObject","concat","getNames","pop","slice","updateFrame","num","round","undefined","isCheckTrue","role","isInProperties","item","isActivate","state","isPaused","isEnded","id","css","styleId","toId","styleElement","$","innerText","document","body","insertAdjacentHTML","selector","random","IS_WINDOW","checkElement","getId","setId","makeId","match","isExportCSS","playClassName","ANIMATION","getPlayState","className","isPausedCSS","addPlayClass","setTime","exportCSS","el","addAnimationEvent","setPlayCSS","setPlayState","duration","getDuration","isZeroDuration","isFinite","animationend","finish","animationstart","trigger","removeEvent","animationiteration","elapsedTime","currentTime","iterationCount","setIteration","addEvent","curveArray","parseFloat","getter","setter","parent","prototype","camelize","iteration","iteraiontCount","direction","setters","getters","tslib_1","_super","delay","fillMode","playSpeed","iterationTime","tickTime","prevTime","playState","getEasing","setEasing","setDuration","getActiveDuration","Infinity","getTime","toTime","timerId","requestAnimationFrame","tick","start","cancelAnimationFrame","end","pause","isTick","isParent","activeDuration","getUnitTime","calculate","isDelay","getIterationTime","unit","toFixed","passIterationCount","maxIterationCount","currentIterationTime","setIterationTime","isReverse","isDirectionReverse","isFiniteDuration","isForwards","now","to","Animator","GetterSetter","EventTrigger","arrObj","replace","merge","from","getType","FUNCTION","getValue","set","raw","getPropertyName","getValueByNames","params","self","_set","isRole","has","isFixed","stylesLength","isUndefined","frame","Frame","frameProperties","cssObject","content","toInnerProperties","TRANSFORM","FILTER","toCSSObject","cssArray","a1","a2","b1","b2","v1","dot","color1","color2","value1","value2","model1","model2","dotArray","colorModel","parseInt","a1Type","dotColor","type1","type2","isFunction1","isFunction2","dotObject","splitUnit","v2","isNaN","dotNumber","nextTime","prevValue","nextValue","ratio","times","decamelize","entries","keytime","prevEntry","states","nextEntries","intCount","ceil","currentDuration","lastTime","j","entry","divideTime","addEntry","unshift","load","originalDuration","ratio_1","items_1","obj_1","time2","items","newFrame","elements","sceneId_1","element","setAttribute","realTime","this_1","innerValue","setFrame","SceneItem","getDelay","frames","hasFrame","getDirection","frameTime","needUpdate","getFrame","remove","removeFrame","append","unshiftTime","firstFrame","prepend","isStartZero","isFunction","setElement","Element","style","targetFunc","attributes","html_1","innerHTML","cssText","toCSS","fromCSS","parentEasing","getNowFrame","temp","addTime","update","toFrame","isAccurate","left","right","realEasing","nameObject","hasName","nowEasing","getNowValue","prevFrame","prevNames","keyframes","setTarget","setSelector","playCondition","parentDuration","itemState","reversedStates","reverse","getRealId","superParent","infiniteIndex","findIndex","finiteStates","reduce","prev","cur","find","makeAnimationProperties","timingFunction","selectors","sel","selectorCallback","preselector","peusdo","KEYFRAMES","_toKeyframes","pauseCSS","addClass","removeClass","isEndedCSS","endCSS","playCSS","hasClass","usePrevValue","nextFrame","isUndefinedLeft","isUndefinedRight","indicies","getNearTimeIndex","dotValue","getEntries","lastEntry","ListMap","getTotalDuration","getPlaySpeed","sceneDuration","setDelay","setItem","parentStates","totalDuration","animtionElement","Scene","scene","newItem","isItFunction","play"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,cAAA,CAAeA,EAAf,EAA2BC,EAA3B,EAAuCC,CAAvC;MACQC,EAAE,GAAG,IAAID,CAAf;;SAGOA,CAAC,GAAGA,CAAJ,GAAQA,CAAR,GAAY,IAAIA,CAAJ,GAAQA,CAAR,GAAYC,EAAZ,GAAiBF,EAA7B,GAAkC,IAAIC,CAAJ,GAAQC,EAAR,GAAaA,EAAb,GAAkBH,EAA3D;;;AAEF,mBAAA,CAAoBI,EAApB,EAAgCC,EAAhC,EAA4CC,CAA5C;;;MAGMJ,CAAC,GAAGI,CAAR;MACIC,MAAM,GAAGD,CAAb;MACIE,EAAE,GAAG,CAAT;;SAEOC,IAAI,CAACC,GAAL,CAASF,EAAT,IAAe,IAAI,IAA1B,EAAgC;;IAE9BD,MAAM,GAAGI,KAAK,CAACP,EAAD,EAAKC,EAAL,EAASH,CAAT,CAAd;IACAM,EAAE,GAAGD,MAAM,GAAGD,CAAd,CAH8B;;QAK1BG,IAAI,CAACC,GAAL,CAASF,EAAT,IAAe,IAAI,IAAvB,EAA6B;aACpBN,CAAP;;;IAEFA,CAAC,IAAIM,EAAE,GAAG,CAAV;;;SAEKN,CAAP;;;;;;;;;;;;;;;;;;;;;;AAmBF,gBAAuBE,IAAYJ,IAAYK,IAA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