代码拉取完成,页面将自动刷新
{"version":3,"sources":["webpack://PIXI.live2d/webpack/universalModuleDefinition","webpack://PIXI.live2d/webpack/bootstrap","webpack://PIXI.live2d/./src/utils/log.ts","webpack://PIXI.live2d/./src/utils/math.ts","webpack://PIXI.live2d/./src/utils/obj.ts","webpack://PIXI.live2d/./src/utils/string.ts","webpack://PIXI.live2d/./src/config.ts","webpack://PIXI.live2d/external {\"commonjs\":\"@pixi/math\",\"commonjs2\":\"@pixi/math\",\"amd\":\"@pixi/math\",\"root\":\"PIXI\"}","webpack://PIXI.live2d/external {\"commonjs\":\"@pixi/utils\",\"commonjs2\":\"@pixi/utils\",\"amd\":\"@pixi/utils\",\"root\":[\"PIXI\",\"utils\"]}","webpack://PIXI.live2d/./src/factory/Live2DLoader.ts","webpack://PIXI.live2d/./src/factory/model-middlewares.ts","webpack://PIXI.live2d/./src/factory/texture.ts","webpack://PIXI.live2d/./src/factory/Live2DFactory.ts","webpack://PIXI.live2d/./src/cubism-common/index.ts","webpack://PIXI.live2d/./src/cubism-common/SoundManager.ts","webpack://PIXI.live2d/./src/cubism-common/constants.ts","webpack://PIXI.live2d/./node_modules/lodash/_root.js","webpack://PIXI.live2d/./src/cubism-common/MotionState.ts","webpack://PIXI.live2d/./node_modules/lodash/_getNative.js","webpack://PIXI.live2d/./node_modules/lodash/isArray.js","webpack://PIXI.live2d/./src/cubism-common/ExpressionManager.ts","webpack://PIXI.live2d/./src/cubism-common/ModelSettings.ts","webpack://PIXI.live2d/./src/cubism-common/MotionManager.ts","webpack://PIXI.live2d/./src/cubism-common/InternalModel.ts","webpack://PIXI.live2d/./src/cubism-common/FocusController.ts","webpack://PIXI.live2d/./src/factory/XHRLoader.ts","webpack://PIXI.live2d/./src/utils/middleware.ts","webpack://PIXI.live2d/external {\"commonjs\":\"@pixi/core\",\"commonjs2\":\"@pixi/core\",\"amd\":\"@pixi/core\",\"root\":\"PIXI\"}","webpack://PIXI.live2d/./node_modules/lodash/_baseGetTag.js","webpack://PIXI.live2d/./node_modules/lodash/_Symbol.js","webpack://PIXI.live2d/./node_modules/lodash/isObjectLike.js","webpack://PIXI.live2d/external {\"commonjs\":\"@pixi/text\",\"commonjs2\":\"@pixi/text\",\"amd\":\"@pixi/text\",\"root\":\"PIXI\"}","webpack://PIXI.live2d/./node_modules/lodash/identity.js","webpack://PIXI.live2d/./node_modules/lodash/isObject.js","webpack://PIXI.live2d/./node_modules/lodash/_ListCache.js","webpack://PIXI.live2d/./node_modules/lodash/_assocIndexOf.js","webpack://PIXI.live2d/./node_modules/lodash/_nativeCreate.js","webpack://PIXI.live2d/./node_modules/lodash/_getMapData.js","webpack://PIXI.live2d/./node_modules/lodash/_toKey.js","webpack://PIXI.live2d/./src/InteractionMixin.ts","webpack://PIXI.live2d/./src/Live2DTransform.ts","webpack://PIXI.live2d/./src/Live2DModel.ts","webpack://PIXI.live2d/./src/factory/FileLoader.ts","webpack://PIXI.live2d/./src/factory/ZipLoader.ts","webpack://PIXI.live2d/./src/tools/HitAreaFrames.ts","webpack://PIXI.live2d/./node_modules/lodash/pull.js","webpack://PIXI.live2d/external {\"commonjs\":\"@pixi/display\",\"commonjs2\":\"@pixi/display\",\"amd\":\"@pixi/display\",\"root\":\"PIXI\"}","webpack://PIXI.live2d/external {\"commonjs\":\"@pixi/graphics\",\"commonjs2\":\"@pixi/graphics\",\"amd\":\"@pixi/graphics\",\"root\":\"PIXI\"}","webpack://PIXI.live2d/./node_modules/lodash/_defineProperty.js","webpack://PIXI.live2d/./node_modules/lodash/isFunction.js","webpack://PIXI.live2d/./node_modules/lodash/_freeGlobal.js","webpack://PIXI.live2d/./node_modules/lodash/_toSource.js","webpack://PIXI.live2d/./node_modules/lodash/_arrayMap.js","webpack://PIXI.live2d/./node_modules/lodash/_baseUnary.js","webpack://PIXI.live2d/./node_modules/lodash/keys.js","webpack://PIXI.live2d/./node_modules/lodash/isLength.js","webpack://PIXI.live2d/./node_modules/lodash/_Map.js","webpack://PIXI.live2d/./node_modules/lodash/_MapCache.js","webpack://PIXI.live2d/./node_modules/lodash/_isKey.js","webpack://PIXI.live2d/./node_modules/lodash/isSymbol.js","webpack://PIXI.live2d/./node_modules/lodash/_baseRest.js","webpack://PIXI.live2d/./node_modules/lodash/_overRest.js","webpack://PIXI.live2d/./node_modules/lodash/_apply.js","webpack://PIXI.live2d/./node_modules/lodash/_setToString.js","webpack://PIXI.live2d/./node_modules/lodash/_baseSetToString.js","webpack://PIXI.live2d/./node_modules/lodash/constant.js","webpack://PIXI.live2d/./node_modules/lodash/_baseIsNative.js","webpack://PIXI.live2d/(webpack)/buildin/global.js","webpack://PIXI.live2d/./node_modules/lodash/_getRawTag.js","webpack://PIXI.live2d/./node_modules/lodash/_objectToString.js","webpack://PIXI.live2d/./node_modules/lodash/_isMasked.js","webpack://PIXI.live2d/./node_modules/lodash/_coreJsData.js","webpack://PIXI.live2d/./node_modules/lodash/_getValue.js","webpack://PIXI.live2d/./node_modules/lodash/_shortOut.js","webpack://PIXI.live2d/./node_modules/lodash/pullAll.js","webpack://PIXI.live2d/./node_modules/lodash/_basePullAll.js","webpack://PIXI.live2d/./node_modules/lodash/_baseIndexOf.js","webpack://PIXI.live2d/./node_modules/lodash/_baseFindIndex.js","webpack://PIXI.live2d/./node_modules/lodash/_baseIsNaN.js","webpack://PIXI.live2d/./node_modules/lodash/_strictIndexOf.js","webpack://PIXI.live2d/./node_modules/lodash/_baseIndexOfWith.js","webpack://PIXI.live2d/./node_modules/lodash/_copyArray.js","webpack://PIXI.live2d/./node_modules/lodash/isArguments.js","webpack://PIXI.live2d/./node_modules/lodash/isBuffer.js","webpack://PIXI.live2d/(webpack)/buildin/module.js","webpack://PIXI.live2d/./node_modules/lodash/_isIndex.js","webpack://PIXI.live2d/./node_modules/lodash/isTypedArray.js","webpack://PIXI.live2d/./node_modules/lodash/_Stack.js","webpack://PIXI.live2d/./node_modules/lodash/eq.js","webpack://PIXI.live2d/./node_modules/lodash/_baseIsEqual.js","webpack://PIXI.live2d/./node_modules/lodash/_equalArrays.js","webpack://PIXI.live2d/./node_modules/lodash/_isStrictComparable.js","webpack://PIXI.live2d/./node_modules/lodash/_matchesStrictComparable.js","webpack://PIXI.live2d/./node_modules/lodash/_baseGet.js","webpack://PIXI.live2d/./node_modules/lodash/_castPath.js","webpack://PIXI.live2d/./cubism/src/rendering/cubismrenderer.ts","webpack://PIXI.live2d/./cubism/src/math/cubismvector2.ts","webpack://PIXI.live2d/./cubism/src/math/cubismmath.ts","webpack://PIXI.live2d/./cubism/src/math/cubismmatrix44.ts","webpack://PIXI.live2d/./cubism/src/live2dcubismframework.ts","webpack://PIXI.live2d/./cubism/src/utils/cubismdebug.ts","webpack://PIXI.live2d/./cubism/src/motion/acubismmotion.ts","webpack://PIXI.live2d/./cubism/src/motion/cubismexpressionmotion.ts","webpack://PIXI.live2d/./cubism/src/motion/cubismmotionqueueentry.ts","webpack://PIXI.live2d/./cubism/src/motion/cubismmotionqueuemanager.ts","webpack://PIXI.live2d/./src/cubism4/Cubism4ExpressionManager.ts","webpack://PIXI.live2d/./cubism/src/settings/cubismmodelsettingsjson.ts","webpack://PIXI.live2d/./src/cubism4/Cubism4ModelSettings.ts","webpack://PIXI.live2d/./cubism/src/motion/cubismmotioninternal.ts","webpack://PIXI.live2d/./cubism/src/motion/cubismmotionjson.ts","webpack://PIXI.live2d/./cubism/src/motion/cubismmotion.ts","webpack://PIXI.live2d/./src/cubism4/Cubism4MotionManager.ts","webpack://PIXI.live2d/./cubism/src/effect/cubismbreath.ts","webpack://PIXI.live2d/./cubism/src/effect/cubismeyeblink.ts","webpack://PIXI.live2d/./cubism/src/config.ts","webpack://PIXI.live2d/./cubism/src/type/csmrectf.ts","webpack://PIXI.live2d/./cubism/src/rendering/cubismrenderer_webgl.ts","webpack://PIXI.live2d/./src/cubism4/Cubism4InternalModel.ts","webpack://PIXI.live2d/./cubism/src/cubismdefaultparameterid.ts","webpack://PIXI.live2d/./src/cubism4/setup.ts","webpack://PIXI.live2d/./cubism/src/effect/cubismpose.ts","webpack://PIXI.live2d/./cubism/src/model/cubismmodel.ts","webpack://PIXI.live2d/./cubism/src/model/cubismmoc.ts","webpack://PIXI.live2d/./cubism/src/physics/cubismphysicsinternal.ts","webpack://PIXI.live2d/./cubism/src/physics/cubismphysicsjson.ts","webpack://PIXI.live2d/./cubism/src/physics/cubismphysics.ts","webpack://PIXI.live2d/./src/cubism4/factory.ts","webpack://PIXI.live2d/./node_modules/lodash/mapKeys.js","webpack://PIXI.live2d/./src/cubism4/check-runtime.ts","webpack://PIXI.live2d/./node_modules/lodash/_baseAssignValue.js","webpack://PIXI.live2d/./node_modules/lodash/_baseForOwn.js","webpack://PIXI.live2d/./node_modules/lodash/_baseFor.js","webpack://PIXI.live2d/./node_modules/lodash/_createBaseFor.js","webpack://PIXI.live2d/./node_modules/lodash/_arrayLikeKeys.js","webpack://PIXI.live2d/./node_modules/lodash/_baseTimes.js","webpack://PIXI.live2d/./node_modules/lodash/_baseIsArguments.js","webpack://PIXI.live2d/./node_modules/lodash/stubFalse.js","webpack://PIXI.live2d/./node_modules/lodash/_baseIsTypedArray.js","webpack://PIXI.live2d/./node_modules/lodash/_nodeUtil.js","webpack://PIXI.live2d/./node_modules/lodash/_baseKeys.js","webpack://PIXI.live2d/./node_modules/lodash/_isPrototype.js","webpack://PIXI.live2d/./node_modules/lodash/_nativeKeys.js","webpack://PIXI.live2d/./node_modules/lodash/_overArg.js","webpack://PIXI.live2d/./node_modules/lodash/isArrayLike.js","webpack://PIXI.live2d/./node_modules/lodash/_baseIteratee.js","webpack://PIXI.live2d/./node_modules/lodash/_baseMatches.js","webpack://PIXI.live2d/./node_modules/lodash/_baseIsMatch.js","webpack://PIXI.live2d/./node_modules/lodash/_listCacheClear.js","webpack://PIXI.live2d/./node_modules/lodash/_listCacheDelete.js","webpack://PIXI.live2d/./node_modules/lodash/_listCacheGet.js","webpack://PIXI.live2d/./node_modules/lodash/_listCacheHas.js","webpack://PIXI.live2d/./node_modules/lodash/_listCacheSet.js","webpack://PIXI.live2d/./node_modules/lodash/_stackClear.js","webpack://PIXI.live2d/./node_modules/lodash/_stackDelete.js","webpack://PIXI.live2d/./node_modules/lodash/_stackGet.js","webpack://PIXI.live2d/./node_modules/lodash/_stackHas.js","webpack://PIXI.live2d/./node_modules/lodash/_stackSet.js","webpack://PIXI.live2d/./node_modules/lodash/_mapCacheClear.js","webpack://PIXI.live2d/./node_modules/lodash/_Hash.js","webpack://PIXI.live2d/./node_modules/lodash/_hashClear.js","webpack://PIXI.live2d/./node_modules/lodash/_hashDelete.js","webpack://PIXI.live2d/./node_modules/lodash/_hashGet.js","webpack://PIXI.live2d/./node_modules/lodash/_hashHas.js","webpack://PIXI.live2d/./node_modules/lodash/_hashSet.js","webpack://PIXI.live2d/./node_modules/lodash/_mapCacheDelete.js","webpack://PIXI.live2d/./node_modules/lodash/_isKeyable.js","webpack://PIXI.live2d/./node_modules/lodash/_mapCacheGet.js","webpack://PIXI.live2d/./node_modules/lodash/_mapCacheHas.js","webpack://PIXI.live2d/./node_modules/lodash/_mapCacheSet.js","webpack://PIXI.live2d/./node_modules/lodash/_baseIsEqualDeep.js","webpack://PIXI.live2d/./node_modules/lodash/_SetCache.js","webpack://PIXI.live2d/./node_modules/lodash/_setCacheAdd.js","webpack://PIXI.live2d/./node_modules/lodash/_setCacheHas.js","webpack://PIXI.live2d/./node_modules/lodash/_arraySome.js","webpack://PIXI.live2d/./node_modules/lodash/_cacheHas.js","webpack://PIXI.live2d/./node_modules/lodash/_equalByTag.js","webpack://PIXI.live2d/./node_modules/lodash/_Uint8Array.js","webpack://PIXI.live2d/./node_modules/lodash/_mapToArray.js","webpack://PIXI.live2d/./node_modules/lodash/_setToArray.js","webpack://PIXI.live2d/./node_modules/lodash/_equalObjects.js","webpack://PIXI.live2d/./node_modules/lodash/_getAllKeys.js","webpack://PIXI.live2d/./node_modules/lodash/_baseGetAllKeys.js","webpack://PIXI.live2d/./node_modules/lodash/_arrayPush.js","webpack://PIXI.live2d/./node_modules/lodash/_getSymbols.js","webpack://PIXI.live2d/./node_modules/lodash/_arrayFilter.js","webpack://PIXI.live2d/./node_modules/lodash/stubArray.js","webpack://PIXI.live2d/./node_modules/lodash/_getTag.js","webpack://PIXI.live2d/./node_modules/lodash/_DataView.js","webpack://PIXI.live2d/./node_modules/lodash/_Promise.js","webpack://PIXI.live2d/./node_modules/lodash/_Set.js","webpack://PIXI.live2d/./node_modules/lodash/_WeakMap.js","webpack://PIXI.live2d/./node_modules/lodash/_getMatchData.js","webpack://PIXI.live2d/./node_modules/lodash/_baseMatchesProperty.js","webpack://PIXI.live2d/./node_modules/lodash/get.js","webpack://PIXI.live2d/./node_modules/lodash/_stringToPath.js","webpack://PIXI.live2d/./node_modules/lodash/_memoizeCapped.js","webpack://PIXI.live2d/./node_modules/lodash/memoize.js","webpack://PIXI.live2d/./node_modules/lodash/toString.js","webpack://PIXI.live2d/./node_modules/lodash/_baseToString.js","webpack://PIXI.live2d/./node_modules/lodash/hasIn.js","webpack://PIXI.live2d/./node_modules/lodash/_baseHasIn.js","webpack://PIXI.live2d/./node_modules/lodash/_hasPath.js","webpack://PIXI.live2d/./node_modules/lodash/property.js","webpack://PIXI.live2d/./node_modules/lodash/_baseProperty.js","webpack://PIXI.live2d/./node_modules/lodash/_basePropertyDeep.js","webpack://PIXI.live2d/./src/csm4.ts"],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__2__","__WEBPACK_EXTERNAL_MODULE__3__","__WEBPACK_EXTERNAL_MODULE__20__","__WEBPACK_EXTERNAL_MODULE__24__","__WEBPACK_EXTERNAL_MODULE__34__","__WEBPACK_EXTERNAL_MODULE__35__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","logger","clamp","num","lower","upper","rand","min","max","Math","random","copyProperty","type","from","to","fromKey","toKey","copyArray","array","Array","isArray","filter","item","applyMixins","derivedCtor","baseCtors","forEach","baseCtor","getOwnPropertyNames","getOwnPropertyDescriptor","folderName","url","lastSlashIndex","lastIndexOf","slice","log","tag","messages","config","logLevel","LOG_LEVEL_VERBOSE","console","warn","LOG_LEVEL_WARNING","error","LOG_LEVEL_ERROR","LOG_LEVEL_NONE","sound","motionSync","motionFadingDuration","idleMotionFadingDuration","expressionFadingDuration","VERSION","Live2DLoader","context","this","middlewares","then","result","loader","TAG","urlToJSON","next","source","data","load","target","live2dModel","emit","jsonToSettings","settings","runtime","findRuntime","createModelSettings","TypeError","waitUntilReady","ready","setupOptionals","internalModel","tasks","pose","push","createPose","coreModel","catch","e","physics","createPhysics","length","Promise","all","setupEssentials","live2DModel","textureLoadings","textures","map","tex","options","textureOptions","resourceOptions","crossorigin","crossOrigin","fromURL","Error","err","event","autoLoad","texture","baseTexture","valid","resolve","resource","_live2d_load","reject","errorHandler","removeEventListener","addEventListener","createTexture","resolveURL","createInternalModel","modelData","moc","isValidMoc","createCoreModel","runtimes","sort","a","b","version","test","textureLoaded","once","modelLoaded","readyEventEmitted","live2DModelMiddlewares","motionManager","group","index","handleError","definition","definitions","undefined","listeners","includes","releaseTasks","motionTasksMap","set","taskGroup","path","getMotionFile","motionDataType","motion","createMotion","expressionManager","expressionTasksMap","getExpressionFile","expression","createExpression","delete","WeakMap","_loadMotion","loadMotion","_loadExpression","loadExpression","SoundManager","_volume","audios","audio","volume","file","onFinish","onError","Audio","preload","dispose","play","dispatchEvent","ErrorEvent","readyState","HAVE_ENOUGH_DATA","pause","removeAttribute","LOGICAL_WIDTH","LOGICAL_HEIGHT","freeGlobal","freeSelf","self","Function","MotionPriority","MotionState","debug","currentPriority","NONE","reservePriority","priority","currentGroup","currentIndex","dump","reservedGroup","reservedIndex","reservedIdleGroup","reservedIdleIndex","IDLE","setReservedIdle","FORCE","setReserved","setCurrent","requestedGroup","requestedIndex","join","baseIsNative","getValue","ExpressionManager","super","expressions","reserveExpressionIndex","destroyed","defaultExpression","currentExpression","stopAllExpressions","availableIndices","floor","setExpression","_setExpression","getExpressionIndex","indexOf","model","now","isFinished","updateParameters","ModelSettings","json","replacer","files","replaceFiles","assertFileExists","expectedFile","shouldThrow","actualPath","getDefinedFiles","MotionPreloadStrategy","MotionManager","motionGroups","state","playing","idleMotionGroup","groups","idle","setupMotions","stopAllMotions","keys","motionPreload","ALL","NORMAL","reserve","currentAudio","soundURL","getSoundFile","add","readyToPlay","src","start","getMotionName","shouldOverrideExpression","resetExpression","_startMotion","groupDefs","isActive","startMotion","_stopAllMotions","reset","restoreExpression","complete","shouldRequestIdleMotion","startRandomMotion","updated","update","destroy","tempBounds","x","y","width","height","InternalModel","focusController","originalWidth","originalHeight","localTransform","drawingMatrix","hitAreas","textureFlipY","viewport","setupLayout","setupHitAreas","size","getSize","layout","assign","getLayout","scale","offsetX","centerX","left","right","offsetY","centerY","top","bottom","translate","getHitAreaDefs","hitArea","def","hitAreaName","isHit","drawIndex","bounds","getDrawableBounds","vertices","getDrawableVertices","vx","vy","transform","copyFrom","append","dt","FocusController","targetX","targetY","instant","dx","dy","abs","sqrt","maxSpeed","ax","ay","maxA","v","maxV","NetworkError","message","status","aborted","XHRLoader","onload","onerror","xhr","XMLHttpRequest","allXhrSet","xhrSet","xhrMap","Set","cancelXHRs","open","responseType","response","onabort","onloadend","abort","clear","createXHR","send","runMiddlewares","middleware","dispatch","fn","getRawTag","objectToString","symToStringTag","listCacheClear","listCacheDelete","listCacheGet","listCacheHas","listCacheSet","ListCache","entries","entry","has","eq","nativeCreate","getNative","isKeyable","__data__","isSymbol","InteractionMixin","_autoInteract","autoInteract","on","onTap","off","manager","interactionManager","unregisterInteraction","onPointerMove","tap","global","focus","tempPoint","tempMatrix","TickerClass","PIXI","Ticker","anchor","onAnchorChange","glContextID","elapsedTime","performance","deltaTime","_autoUpdate","init","Live2DFactory","setupLive2DModel","onLoad","tickerClass","autoUpdate","_destroyed","shared","onTickerUpdate","remove","_options","interactive","pivot","id","setRandomExpression","toModelPosition","hitAreaNames","hitTest","position","clone","skipUpdate","_recursivePostUpdateTransform","parent","displayObjectUpdateTransform","_tempDisplayObjectParent","worldTransform","applyInverse","point","getBounds","contains","_bounds","addFrame","deltaMS","renderer","registerInteraction","plugins","interaction","batch","geometry","shader","shouldUpdateTexture","CONTEXT_UID","updateWebGLContext","gl","_glTextures","pixelStorei","WebGLRenderingContext","UNPACK_FLIP_Y_WEBGL","bindTexture","touched","textureGC","count","framebuffer","internalTransform","globalUniforms","uniforms","projectionMatrix","updateTransform","draw","settingsURL","filePath","resolved","filesMap","fileMap","definedFile","decodeURI","actualFile","find","webkitRelativePath","URL","createObjectURL","_objectURL","settingsFile","endsWith","settingsText","readText","settingsJSON","JSON","parse","reader","FileReader","readAsText","File","createSettings","validateFiles","encodeURI","upload","objectURL","revokeObjectURL","resourceObjectURL","values","unshift","filePaths","getFilePaths","requiredFilePaths","getFiles","settingsFilePath","paths","ZIP_PROTOCOL","uid","sourceURL","zipBlob","startsWith","zipReader","unzip","releaseReader","initialized","texts","strokeWidth","normalColor","activeColor","textStyle","fontSize","fill","stroke","strokeThickness","text","visible","addChild","color","tx","ty","drawRect","_render","pull","baseRest","func","baseGetTag","isObject","funcToString","toString","iteratee","arrayLikeKeys","baseKeys","isArrayLike","Map","mapCacheClear","mapCacheDelete","mapCacheGet","mapCacheHas","mapCacheSet","MapCache","reIsDeepProp","reIsPlainProp","isObjectLike","identity","overRest","setToString","apply","nativeMax","args","arguments","otherArgs","thisArg","baseSetToString","shortOut","constant","string","isFunction","isMasked","toSource","reIsHostCtor","funcProto","objectProto","reIsNative","RegExp","replace","g","nativeObjectToString","isOwn","unmasked","coreJsData","maskSrcKey","exec","IE_PROTO","nativeNow","Date","lastCalled","stamp","remaining","basePullAll","arrayMap","baseIndexOf","baseIndexOfWith","baseUnary","splice","comparator","seen","fromIndex","computed","baseFindIndex","baseIsNaN","strictIndexOf","predicate","fromRight","baseIsArguments","propertyIsEnumerable","isArguments","stubFalse","freeExports","nodeType","freeModule","Buffer","isBuffer","webpackPolyfill","deprecate","children","reIsUint","baseIsTypedArray","nodeUtil","nodeIsTypedArray","isTypedArray","stackClear","stackDelete","stackGet","stackHas","stackSet","Stack","other","baseIsEqualDeep","baseIsEqual","bitmask","customizer","stack","SetCache","arraySome","cacheHas","equalFunc","isPartial","arrLength","othLength","arrStacked","othStacked","arrValue","othValue","compared","othIndex","srcValue","castPath","isKey","stringToPath","CubismBlendMode","CubismVector2","vector2","ret","scalar","multiply","division","pow","rhs","isEqual","sin","cos","PI","degrees","radian","atan2","directionToRadian","degree","radianToDegrees","totalAngle","CubismMatrix44","_tr","Float32Array","loadIdentity","dst","j","k","setMatrix","tr","tr1","getArray","cloneMatrix","_isCulling","_isPremultipliedAlpha","_anisortopy","_modelColor","CubismTextureColor","_mvpMatrix4x4","_model","getModel","doDrawModel","matrix44","red","green","blue","alpha","R","G","B","A","enable","culling","s_isStarted","s_isInitialized","s_option","Constant","LogLevel","vertexOffset","vertexStep","option","CubismLogInfo","Live2DCubismCore","_isStarted","Logging","csmSetLogFunction","logFunction","Version","csmGetVersion","minor","patch","versionNumber","CubismLogWarning","staticRelease","csmGetLogFunction","loggingLevel","LogLevel_Off","CSM_ASSERT","CubismLogDebug","fmt","print","LogLevel_Debug","LogLevel_Info","LogLevel_Warning","CubismLogError","LogLevel_Error","format","getLoggingLevel","logPrint","coreLogFunction","_fadeInSeconds","_fadeOutSeconds","_weight","_offsetSeconds","_firedEventValues","motionQueueEntry","userTimeSeconds","isAvailable","isStarted","setIsStarted","setStartTime","setFadeInStartTime","duration","getDuration","getEndTime","setEndTime","getStartTime","fadeWeight","getEasingSine","getFadeInStartTime","setState","doUpdateParameters","setIsFinished","fadeInSeconds","fadeOutSeconds","weight","offsetSeconds","beforeCheckTimeSeconds","motionTimeSeconds","onFinishedMotionHandler","_onFinishedMotion","_parameters","fadeInTime","FadeInTime","fadeOutTime","FadeOutTime","setFadeInTime","setFadeOutTime","parameters","Parameters","param","parameterId","Id","Value","blendType","Blend","ExpressionBlendType","ExpressionBlendType_Multiply","ExpressionBlendType_Overwrite","ExpressionBlendType_Add","parameter","addParameterValueById","multiplyParameterValueById","setParameterValueById","CubismMotionQueueEntry","_autoDelete","_available","_finished","_started","_startTimeSeconds","_fadeInStartTimeSeconds","_endTimeSeconds","_stateTimeSeconds","_stateWeight","_lastEventCheckSeconds","_motionQueueEntryHandle","_isTriggeredFadeOut","_motion","release","newEndTimeSeconds","startTime","endTime","f","timeSeconds","checkSeconds","_userTimeSeconds","_eventCustomData","_motions","autoDelete","InvalidMotionQueueEntryHandleValue","setFadeOut","getFadeOutTime","motionQueueEntryNumber","callback","customData","_eventCallBack","firedList","getFiredEvent","getLastCheckEventSeconds","setLastCheckEventSeconds","isTriggeredFadeOut","startFadeOut","getFadeOutSeconds","queueManager","findIndex","Name","doUpdateMotion","CubismModelSettingsJson","Groups","HitAreas","Layout","FileReferences","Moc","Expressions","motions","Motions","Textures","Physics","Pose","Ids","isValidJSON","every","Sound","CubismMotionCurveTarget","CubismMotionSegmentType","CubismMotionPoint","time","CubismMotionSegment","basePointIndex","segmentType","CubismMotionCurve","CubismMotionCurveTarget_Model","segmentCount","baseSegmentIndex","CubismMotionEvent","fireTime","CubismMotionData","loop","curveCount","eventCount","fps","curves","segments","points","events","CubismMotionJson","_json","Meta","Duration","Loop","CurveCount","Fps","TotalSegmentCount","TotalPointCount","curveIndex","Curves","Target","Segments","segmentIndex","UserDataCount","TotalUserDataSize","userDataIndex","UserData","Time","lerpPoints","linearEvaluate","bezierEvaluate","p01","p12","p23","p012","p123","steppedEvaluate","inverseSteppedEvaluate","evaluateCurve","motionData","curve","totalSegmentCount","pointPosition","CubismMotionSegmentType_Bezier","segment","evaluate","_eyeBlinkParameterIds","_lipSyncParameterIds","_sourceFrameRate","_loopDurationSeconds","_isLoop","_isLoopFadeIn","_lastWeight","_motionData","_modelCurveIdEyeBlink","_modelCurveIdLipSync","timeOffsetSeconds","lipSyncValue","Number","MAX_VALUE","eyeBlinkValue","lipSyncFlags","eyeBlinkFlags","tmpFadeIn","tmpFadeOut","parameterIndex","CubismMotionCurveTarget_Parameter","getParameterIndex","sourceValue","getParameterValueByIndex","fin","fout","setParameterValueByIndex","getParameterValueById","CubismMotionCurveTarget_PartOpacity","loopFadeIn","eyeBlinkParameterIds","lipSyncParameterIds","motionJson","getMotionDuration","isMotionLoop","getMotionCurveCount","getMotionFps","getEventCount","getMotionFadeInTime","getMotionFadeOutTime","getMotionTotalSegmentCount","totalPointCount","getMotionCurveTarget","getMotionCurveId","getMotionCurveFadeInTime","getMotionCurveFadeOutTime","segmentPosition","getMotionCurveSegmentCount","getMotionCurveSegment","CubismMotionSegmentType_Linear","CubismMotionSegmentType_Stepped","CubismMotionSegmentType_InverseStepped","userdatacount","getEventTime","getEventValue","u","eyeBlinkIds","getEyeBlinkParameters","lipSyncIds","getLipSyncParameters","setEventCallback","caller","eventValue","setFinishedMotionHandler","defaultFadingDuration","setEffectIds","CubismBreath","_breathParameters","_currentTime","breathParameters","deltaTimeSeconds","offset","peak","cycle","BreathParameterData","CubismEyeBlink","modelSetting","_blinkingState","EyeState","EyeState_First","_nextBlinkingTime","_stateStartTimeSeconds","_blinkingIntervalSeconds","_closingSeconds","_closedSeconds","_openingSeconds","_parameterIds","blinkingInterval","closing","closed","opening","parameterIds","parameterValue","EyeState_Closing","EyeState_Closed","EyeState_Opening","EyeState_Interval","determinNextBlinkingTiming","CloseIfZero","csmRect","w","h","supportMoreMaskDivisions","s_instance","s_viewport","s_fbo","_maskRenderTexture","_colorBuffer","_currentFrameNo","_clippingMaskBufferSize","_clippingContextListForMask","_clippingContextListForDraw","_channelColors","_tmpBoundsOnModel","_tmpMatrix","_tmpMatrixForMask","_tmpMatrixForDraw","tmp","channelNo","_maskTexture","frameNo","TEXTURE_2D","texImage2D","RGBA","UNSIGNED_BYTE","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","LINEAR","TEXTURE_MAG_FILTER","createFramebuffer","bindFramebuffer","FRAMEBUFFER","framebufferTexture2D","COLOR_ATTACHMENT0","CubismRenderTextureResource","clippingContext","clippedDrawTotalMinX","clippedDrawTotalMinY","clippedDrawTotalMaxX","MIN_VALUE","clippedDrawTotalMaxY","clippedDrawCount","_clippedDrawableIndexList","clippedDrawableIndex","drawableIndex","drawableVertexCount","getDrawableVertexCount","drawableVertexes","minX","minY","maxX","maxY","pi","_allClippedDrawRect","_isUsing","deleteFramebuffer","deleteTexture","drawableCount","drawableMasks","drawableMaskCounts","findSameClip","addClippedDrawable","usingClipCount","clipIndex","cc","calcClippedDrawTotalBounds","getMaskRenderTexture","getMvpMatrix","preDraw","setupLayoutBounds","clearColor","COLOR_BUFFER_BIT","clipContext","allClipedDrawRect","layoutBoundsOnTex01","_layoutBounds","MARGIN","setRect","expand","scaleX","scaleY","translateRelative","scaleRelative","_matrixForMask","_matrixForDraw","clipDrawCount","_clippingIdCount","clipDrawIndex","_clippingIdList","getDrawableDynamicFlagVertexPositionsDidChange","setIsCulling","getDrawableCulling","setClippingContextBufferForMask","drawMesh","getDrawableTextureIndices","getDrawableVertexIndexCount","getDrawableVertexIndices","getDrawableVertexUvs","getDrawableOpacity","CubismBlendMode_Normal","sameCount","clipId","div","mod","curClipIndex","layoutCount","_layoutChannelNo","xpos","ypos","clippingDrawableIndices","clipCount","_owner","setGL","_shaderSets","releaseShaderProgram","textureId","vertexCount","vertexArray","indexArray","uvArray","bufferData","opacity","colorBlendMode","baseColor","isPremultipliedAlpha","matrix4x4","invertedMask","SRC_COLOR","DST_COLOR","SRC_ALPHA","DST_ALPHA","generateShaders","clippingContextBufferForMask","getClippingContextBufferForMask","shaderSet","ShaderNames","ShaderNames_SetupMask","useProgram","shaderProgram","activeTexture","TEXTURE0","uniform1i","samplerTexture0Location","vertex","createBuffer","bindBuffer","ARRAY_BUFFER","DYNAMIC_DRAW","enableVertexAttribArray","attributePositionLocation","vertexAttribPointer","FLOAT","uv","attributeTexCoordLocation","colorChannel","getClippingManager","getChannelFlagAsColor","uniform4f","uniformChannelFlagLocation","uniformMatrix4fv","uniformClipMatrixLocation","rect","uniformBaseColorLocation","getRight","getBottom","ZERO","ONE_MINUS_SRC_COLOR","ONE_MINUS_SRC_ALPHA","clippingContextBufferForDraw","getClippingContextBufferForDraw","ShaderNames_NormalPremultipliedAlpha","ONE","CubismBlendMode_Additive","ShaderNames_AddPremultipliedAlpha","CubismBlendMode_Multiplicative","ShaderNames_MultPremultipliedAlpha","TEXTURE1","getColorBuffer","samplerTexture1Location","uniformMatrixLocation","ELEMENT_ARRAY_BUFFER","blendFuncSeparate","deleteProgram","loadShaderProgram","vertexShaderSrcSetupMask","fragmentShaderSrcsetupMask","vertexShaderSrc","fragmentShaderSrcPremultipliedAlpha","vertexShaderSrcMasked","fragmentShaderSrcMaskPremultipliedAlpha","fragmentShaderSrcMaskInvertedPremultipliedAlpha","getAttribLocation","getUniformLocation","vertexShaderSource","fragmentShaderSource","createProgram","vertShader","compileShaderSource","VERTEX_SHADER","fragShader","FRAGMENT_SHADER","attachShader","linkProgram","getProgramParameter","LINK_STATUS","deleteShader","shaderType","shaderSource","createShader","compileShader","getShaderInfoLog","getShaderParameter","COMPILE_STATUS","_clippingContextBufferForMask","_clippingContextBufferForDraw","_clippingManager","firstDraw","_textures","_sortedDrawableIndexList","_bufferData","isUsingMasking","initialize","getDrawableCount","getDrawableMasks","getDrawableMaskCounts","modelTextureNo","glTexture","setClippingMaskBufferSize","getClippingMaskBufferSize","deleteBuffer","setupClippingContext","renderOrder","getDrawableRenderOrders","order","getDrawableDynamicFlagIsVisible","setClippingContextBufferForDraw","getClippingContextListForDraw","getDrawableBlendMode","getDrawableInvertedMaskBit","textureNo","indexCount","isCulling","CULL_FACE","disable","frontFace","CCW","modelColorRGBA","getModelColor","drawtexture","getInstance","setupShaderProgram","drawElements","TRIANGLES","UNSIGNED_SHORT","deleteInstance","fbo","getExtension","SCISSOR_TEST","STENCIL_TEST","DEPTH_TEST","CW","BLEND","colorMask","clip","setGl","doStaticRelease","lipSync","breath","idParamAngleX","idParamAngleY","idParamAngleZ","idParamEyeBallX","idParamEyeBallY","idParamBodyAngleX","idParamBreath","pixelsPerUnit","centeringTransform","eyeBlink","setParameters","setIsPremultipliedAlpha","canvasinfo","CanvasWidth","CanvasHeight","_","charAt","toLowerCase","PixelsPerUnit","startUp","getDrawableIndex","getDrawableIds","arr","prepend","motionUpdated","saveParameters","updateFocus","updateNaturalMovements","loadParameters","matrix","setMvpMatrix","setRenderState","getParameter","FRAMEBUFFER_BINDING","drawModel","startupPromise","startupRetries","cubism4Ready","startUpWithRetry","startUpCubism4","cause","setTimeout","LogLevel_Verbose","CubismPose","_fadeTimeSeconds","_lastModel","_partGroups","_partGroupCounts","pose3json","poseListInfo","poseCount","poseIndex","idListInfo","idCount","groupCount","groupIndex","partInfo","partData","PartData","partId","linkListInfo","Link","linkCount","linkIndex","linkPart","link","beginIndex","partGroupCount","doFade","copyPartOpacities","partsIndex","partIndex","paramIndex","setPartOpacityByIndex","getPartOpacityByIndex","linkPartIndex","visiblePartIndex","newOpacity","a1","assignment","getPartIndex","clonePartData","_savedParameters","_drawableIds","_partIds","_notExistPartId","_notExistParameterId","_notExistParameterValues","_notExistPartOpacities","drawables","resetDynamicFlags","parameterCount","savedParameterCount","_parameterValues","partCount","parts","getPartCount","_partOpacities","maximumValues","minimumValues","defaultValues","getParameterCount","addParameterValueByIndex","multiplyParameterValueByIndex","drawableId","ids","renderOrders","textureIndices","dynamicFlags","Utils","hasVertexPositionsDidChangeBit","indexCounts","vertexCounts","getDrawableVertexPositions","indices","vertexPositions","vertexUvs","opacities","constantFlags","hasIsDoubleSidedBit","hasBlendAdditiveBit","hasBlendMultiplicativeBit","hasIsInvertedMaskBit","masks","maskCounts","hasIsVisibleBit","hasVisibilityDidChangeBit","hasOpacityDidChangeBit","hasRenderOrderDidChangeBit","_parameterMaximumValues","_parameterMinimumValues","partIds","drawableIds","_moc","_modelCount","mocBytes","fromArrayBuffer","cubismModel","Model","fromMoc","_release","CubismPhysicsTargetType","CubismPhysicsSource","initialPosition","lastPosition","lastGravity","force","velocity","CubismPhysicsSubRig","normalizationPosition","normalizationAngle","CubismPhysicsInput","destination","translationScale","inputs","outputs","particles","gravity","wind","EffectiveForces","Gravity","X","Y","Wind","PhysicsSettingCount","TotalInputCount","TotalOutputCount","VertexCount","physicsSettingIndex","PhysicsSettings","Normalization","Position","Minimum","Maximum","Default","Angle","Input","inputIndex","Weight","Reflect","Type","Source","Output","outputIndex","VertexIndex","Scale","Destination","Vertices","vertexIndex","Mobility","Delay","Acceleration","Radius","_physicsRig","radAngle","outputValue","totalTranslation","currentSetting","currentInput","currentOutput","currentParticles","parameterMaximumValue","parameterMinimumValue","parameterDefaultValue","settingIndex","subRigCount","angle","baseInputIndex","baseOutputIndex","baseParticleIndex","inputCount","sourceParameterIndex","getNormalizedParameterValue","reflect","degreesToRadian","updateParticles","particleCount","maximum","outputCount","particleIndex","destinationParameterIndex","translation","outParameterValue","stringify","subarray","updateOutputParameterValue","outParamIndex","physicsJson","getGravity","getWind","getSubRigCount","setting","minimum","getNormalizationPositionMinimumValue","getNormalizationPositionMaximumValue","defalut","getNormalizationPositionDefaultValue","getNormalizationAngleMinimumValue","getNormalizationAngleMaximumValue","getNormalizationAngleDefaultValue","getInputCount","input","getInputWeight","getInputReflect","getInputType","CubismPhysicsSource_X","getInputTranslationXFromNormalizedParameterValue","CubismPhysicsSource_Y","getInputTranslationYFromNormalizedParamterValue","CubismPhysicsSource_Angle","getInputAngleFromNormalizedParameterValue","targetType","CubismPhysicsTargetType_Parameter","getInputSourceId","getOutputCount","output","getOutputVertexIndex","angleScale","getOutputAngleScale","getOutputWeight","getOutputDestinationId","getOutputType","getOutputTranslationX","getScale","getOutputScaleTranslationX","getOutputTranslationY","getOutputScaleTranslationY","getOutputAngle","getOutputScaleAngle","getOutputReflect","getParticleCount","particle","mobility","getParticleMobility","delay","getParticleDelay","acceleration","getParticleAcceleration","radius","getParticleRadius","getParticlePosition","strand","targetTranslation","targetAngle","isInverted","normalizeParameterValue","normalizaitionPosition","parentGravity","substract","multiplyByScaler","getDefaultValue","getRangeValue","strandCount","windDirection","thresholdValue","airResistance","totalRadian","currentGravity","direction","newDirection","radianToDirection","normalize","divisionByScalar","parameterValueMinimum","parameterValueMaximum","outputScale","valueBelowMinimum","valueExceededMaximum","parameterMinimum","parameterMaximum","parameterDefault","normalizedMinimum","normalizedMaximum","normalizedDefault","maxValue","minValue","minNormValue","maxNormValue","middleNormValue","middleValue","paramValue","sign","nLength","pLength","releaseMoc","__moc","cubism4","registerRuntime","byteLength","view","Int8Array","String","fromCharCode","createModel","ignored","coreModelWithMoc","baseAssignValue","baseForOwn","baseIteratee","baseFor","createBaseFor","keysFunc","iterable","props","baseTimes","isIndex","inherited","isArr","isArg","isBuff","isType","skipIndexes","isLength","typedArrayTags","freeProcess","process","types","binding","isPrototype","nativeKeys","Ctor","constructor","overArg","arg","baseMatches","baseMatchesProperty","baseIsMatch","getMatchData","matchesStrictComparable","matchData","noCustomizer","objValue","COMPARE_PARTIAL_FLAG","assocIndexOf","pop","pairs","LARGE_ARRAY_SIZE","Hash","hashClear","hashDelete","hashGet","hashHas","hashSet","getMapData","equalArrays","equalByTag","equalObjects","getTag","objectTag","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","setCacheAdd","setCacheHas","cache","Uint8Array","mapToArray","setToArray","symbolProto","symbolValueOf","valueOf","byteOffset","buffer","convert","stacked","getAllKeys","objProps","objLength","objStacked","skipCtor","objCtor","othCtor","baseGetAllKeys","getSymbols","arrayPush","symbolsFunc","arrayFilter","stubArray","nativeGetSymbols","getOwnPropertySymbols","symbol","resIndex","DataView","dataViewCtorString","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","ArrayBuffer","ctorString","isStrictComparable","hasIn","baseGet","defaultValue","memoizeCapped","rePropName","reEscapeChar","charCodeAt","match","number","quote","subString","memoize","resolver","memoized","Cache","baseToString","symbolToString","baseHasIn","hasPath","hasFunc","baseProperty","basePropertyDeep"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,cAAeA,QAAQ,eAAgBA,QAAQ,cAAeA,QAAQ,cAAeA,QAAQ,iBAAkBA,QAAQ,mBAC/H,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,aAAc,cAAe,aAAc,aAAc,gBAAiB,kBAAmBJ,GAC3E,iBAAZC,QACdA,QAAgB,OAAID,EAAQG,QAAQ,cAAeA,QAAQ,eAAgBA,QAAQ,cAAeA,QAAQ,cAAeA,QAAQ,iBAAkBA,QAAQ,oBAE3JJ,EAAW,KAAIA,EAAW,MAAK,GAAIA,EAAW,KAAU,OAAIC,EAAQD,EAAW,KAAGA,EAAW,KAAS,MAAGA,EAAW,KAAGA,EAAW,KAAGA,EAAW,KAAGA,EAAW,OARhK,CASGO,QAAQ,SAASC,EAAgCC,EAAgCC,EAAiCC,EAAiCC,EAAiCC,GACvL,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUd,QAGnC,IAAIC,EAASW,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHhB,QAAS,IAUV,OANAiB,EAAQH,GAAUI,KAAKjB,EAAOD,QAASC,EAAQA,EAAOD,QAASa,GAG/DZ,EAAOe,GAAI,EAGJf,EAAOD,QA0Df,OArDAa,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASrB,EAASsB,EAAMC,GAC3CV,EAAoBW,EAAExB,EAASsB,IAClCG,OAAOC,eAAe1B,EAASsB,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAAS7B,GACX,oBAAX8B,Q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,M,+BCX3B","file":"cubism4.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@pixi/math\"), require(\"@pixi/utils\"), require(\"@pixi/core\"), require(\"@pixi/text\"), require(\"@pixi/display\"), require(\"@pixi/graphics\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"@pixi/math\", \"@pixi/utils\", \"@pixi/core\", \"@pixi/text\", \"@pixi/display\", \"@pixi/graphics\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"live2d\"] = factory(require(\"@pixi/math\"), require(\"@pixi/utils\"), require(\"@pixi/core\"), require(\"@pixi/text\"), require(\"@pixi/display\"), require(\"@pixi/graphics\"));\n\telse\n\t\troot[\"PIXI\"] = root[\"PIXI\"] || {}, root[\"PIXI\"][\"live2d\"] = factory(root[\"PIXI\"], root[\"PIXI\"][\"utils\"], root[\"PIXI\"], root[\"PIXI\"], root[\"PIXI\"], root[\"PIXI\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__3__, __WEBPACK_EXTERNAL_MODULE__20__, __WEBPACK_EXTERNAL_MODULE__24__, __WEBPACK_EXTERNAL_MODULE__34__, __WEBPACK_EXTERNAL_MODULE__35__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 167);\n","import { config } from '@/config';\n\n/**\n * A simple tagged logger.\n *\n * You can replace the methods with your own ones.\n *\n * ```js\n * import { logger } from 'pixi-live2d-display';\n *\n * logger.log = (tag, ...messages) => {\n * console.log(tag, 'says:', ...messages);\n * };\n * ```\n */\nexport namespace logger {\n export function log(tag: string, ...messages: any[]) {\n if (config.logLevel <= config.LOG_LEVEL_VERBOSE) {\n console.log(`[${tag}]`, ...messages);\n }\n }\n\n export function warn(tag: string, ...messages: any[]) {\n if (config.logLevel <= config.LOG_LEVEL_WARNING) {\n console.warn(`[${tag}]`, ...messages);\n }\n }\n\n export function error(tag: string, ...messages: any[]) {\n if (config.logLevel <= config.LOG_LEVEL_ERROR) {\n console.error(`[${tag}]`, ...messages);\n }\n }\n}\n","/**\n * These functions can be slightly faster than the ones in Lodash.\n * @packageDocumentation\n */\n\nexport function clamp(num: number, lower: number, upper: number) {\n return num < lower ? lower : num > upper ? upper : num;\n}\n\nexport function rand(min: number, max: number) {\n return Math.random() * (max - min) + min;\n}\n","/**\n * Copies a property at only if it matches the `type`.\n * @param type - Type expected to match `typeof` on the property.\n * @param from - Source object.\n * @param to - Destination object.\n * @param fromKey - Key of the property in source object.\n * @param toKey - Key of the property in destination object.\n */\n// TODO: lint and fix the formatting!\nexport function copyProperty<From, FromKey extends keyof From, ToKey extends keyof any, To extends Partial<Record<ToKey, From[FromKey]>>>(type: string, from: From, to: To, fromKey: FromKey, toKey: ToKey) {\n const value = from[fromKey];\n\n if (value !== null && typeof value === type) {\n // a type error will occur here, have no idea\n to[toKey] = value as any;\n }\n}\n\n/**\n * Copies an array at `key`, filtering the items that match the `type`.\n * @param type - Type expected to match `typeof` on the items.\n * @param from - Source object.\n * @param to - Destination object.\n * @param fromKey - Key of the array property in source object.\n * @param toKey - Key of the array property in destination object.\n */\nexport function copyArray<FromKey extends keyof any, From extends Partial<Record<FromKey, any[]>>, ToKey extends keyof any, To extends Partial<Record<ToKey, any[]>>>(type: string, from: From, to: To, fromKey: FromKey, toKey: ToKey) {\n const array = from[fromKey];\n\n if (Array.isArray(array)) {\n to[toKey] = array.filter(item => item !== null && typeof item === type) as any;\n }\n}\n\n/**\n * @see {@link https://www.typescriptlang.org/docs/handbook/mixins.html}\n */\nexport function applyMixins(derivedCtor: any, baseCtors: any[]) {\n baseCtors.forEach(baseCtor => {\n Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {\n if (name !== 'constructor') {\n Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name)!);\n }\n });\n });\n}\n","/**\n * Gets the name of parent folder in a url.\n * @param url - URL of a file.\n * @return Name of the parent folder, or the file itself if it has no parent folder.\n */\nexport function folderName(url: string) {\n let lastSlashIndex = url.lastIndexOf('/');\n\n if (lastSlashIndex != -1) {\n url = url.slice(0, lastSlashIndex);\n }\n\n lastSlashIndex = url.lastIndexOf('/');\n\n if (lastSlashIndex !== -1) {\n url = url.slice(lastSlashIndex + 1);\n }\n\n return url;\n}\n","/**\n * Global configs.\n */\nexport namespace config {\n export const LOG_LEVEL_VERBOSE = 0;\n export const LOG_LEVEL_WARNING = 1;\n export const LOG_LEVEL_ERROR = 2;\n export const LOG_LEVEL_NONE = 999;\n\n declare const __PRODUCTION__: boolean;\n\n /**\n * Global log level.\n * @default {@link LOG_LEVEL_WARNING}\n */\n export let logLevel = __PRODUCTION__ ? LOG_LEVEL_WARNING : LOG_LEVEL_VERBOSE;\n\n /**\n * Enabling sound for motions.\n */\n export let sound = true;\n\n /**\n * Deferring motion and corresponding sound until both are loaded.\n */\n export let motionSync = true;\n\n /**\n * Default fading duration for motions without such value specified.\n */\n export let motionFadingDuration = 500;\n\n /**\n * Default fading duration for idle motions without such value specified.\n */\n export let idleMotionFadingDuration = 2000;\n\n /**\n * Default fading duration for expressions without such value specified.\n */\n export let expressionFadingDuration = 500;\n\n export let cubism4: {\n /**\n * Should masks support 4x4 division, which is unofficial and experimental.\n * See [official manual](https://docs.live2d.com/cubism-sdk-manual/ow-sdk-mask-premake-web/?locale=en_us).\n * @default true\n */\n supportMoreMaskDivisions: boolean;\n } | undefined;\n}\n\ndeclare const __VERSION__: string;\n\n/**\n * Consistent with the `version` in package.json.\n */\nexport const VERSION = __VERSION__;\n","module.exports = __WEBPACK_EXTERNAL_MODULE__2__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3__;","import { ExpressionManager, InternalModel, ModelSettings, MotionManager } from '@/cubism-common';\nimport { XHRLoader } from '@/factory/XHRLoader';\nimport { Live2DModel } from '@/Live2DModel';\nimport { Middleware, runMiddlewares } from '@/utils/middleware';\n\nexport type Live2DLoaderTarget = Live2DModel | InternalModel | MotionManager | ExpressionManager\n\n/**\n * The context transferred through Live2DLoader middlewares.\n */\nexport interface Live2DLoaderContext {\n /** The XHR's response type. */\n type: XMLHttpRequestResponseType;\n\n /** Will be resolved by {@link ModelSettings.resolveURL} if a ModelSettings is provided. */\n url: string;\n\n /** If provided, the given URL will be resolved by {@link ModelSettings.resolveURL}. */\n settings?: ModelSettings;\n\n /**\n * Owner of this resource. The load task will be automatically canceled\n * when receiving an \"destroy\" event from the target.\n */\n target?: Live2DLoaderTarget;\n\n /** Loaded data. */\n result?: any;\n}\n\nexport class Live2DLoader {\n static middlewares: Middleware<Live2DLoaderContext>[] = [XHRLoader.loader];\n\n /**\n * Loads a resource.\n * @return Promise that resolves with the loaded data in a format that's consistent with the specified `type`.\n */\n static load<T = any>(context: Live2DLoaderContext): Promise<T> {\n return runMiddlewares(this.middlewares, context).then(() => context.result);\n }\n}\n","import { Middleware } from '@/utils/middleware';\nimport { Live2DLoader } from '@/factory/Live2DLoader';\nimport { ModelSettings } from '@/cubism-common';\nimport { logger } from '@/utils';\nimport { createTexture } from '@/factory/texture';\nimport { Live2DFactory, Live2DFactoryContext } from '@/factory/Live2DFactory';\n\nconst TAG = 'Live2DFactory';\n\n/**\n * A middleware that converts the source from a URL to a settings JSON object.\n */\nexport const urlToJSON: Middleware<Live2DFactoryContext> = async (context, next) => {\n if (typeof context.source === 'string') {\n const data = await Live2DLoader.load({\n url: context.source,\n type: 'json',\n target: context.live2dModel,\n });\n\n data.url = context.source;\n\n context.source = data;\n\n context.live2dModel.emit('settingsJSONLoaded', data);\n }\n\n return next();\n};\n\n/**\n * A middleware that converts the source from a settings JSON object to a ModelSettings instance.\n */\nexport const jsonToSettings: Middleware<Live2DFactoryContext> = async (context, next) => {\n if (context.source instanceof ModelSettings) {\n context.settings = context.source;\n\n return next();\n } else if (typeof context.source === 'object') {\n const runtime = Live2DFactory.findRuntime(context.source);\n\n if (runtime) {\n const settings = runtime.createModelSettings(context.source);\n\n context.settings = settings;\n context.live2dModel.emit('settingsLoaded', settings);\n\n return next();\n }\n }\n\n throw new TypeError('Unknown settings format.');\n};\n\nexport const waitUntilReady: Middleware<Live2DFactoryContext> = (context, next) => {\n if (context.settings) {\n const runtime = Live2DFactory.findRuntime(context.settings);\n\n if (runtime) {\n return runtime.ready().then(next);\n }\n }\n\n return next();\n};\n\n/**\n * A middleware that populates the Live2DModel with optional resources.\n * Requires InternalModel in context when all the subsequent middlewares have finished.\n */\nexport const setupOptionals: Middleware<Live2DFactoryContext> = async (context, next) => {\n // wait until all has finished\n await next();\n\n const internalModel = context.internalModel;\n\n if (internalModel) {\n const settings = context.settings!;\n const runtime = Live2DFactory.findRuntime(settings);\n\n if (runtime) {\n const tasks: Promise<void>[] = [];\n\n if (settings.pose) {\n tasks.push(\n Live2DLoader.load({\n settings,\n url: settings.pose,\n type: 'json',\n target: internalModel,\n })\n .then((data: ArrayBuffer) => {\n internalModel.pose = runtime.createPose(internalModel.coreModel, data);\n context.live2dModel.emit('poseLoaded', internalModel.pose);\n })\n .catch((e: Error) => logger.warn(TAG, 'Failed to load pose.\\n', e)),\n );\n }\n\n if (settings.physics) {\n tasks.push(\n Live2DLoader.load({\n settings,\n url: settings.physics,\n type: 'json',\n target: internalModel,\n })\n .then((data: ArrayBuffer) => {\n internalModel.physics = runtime.createPhysics(internalModel.coreModel, data);\n context.live2dModel.emit('physicsLoaded', internalModel.physics);\n })\n .catch((e: Error) => logger.warn(TAG, 'Failed to load physics.\\n', e)),\n );\n }\n\n if (tasks.length) {\n await Promise.all(tasks);\n }\n }\n }\n};\n\n/**\n * A middleware that populates the Live2DModel with essential resources.\n * Requires ModelSettings in context immediately, and InternalModel in context\n * when all the subsequent middlewares have finished.\n */\nexport const setupEssentials: Middleware<Live2DFactoryContext> = async (context, next) => {\n if (context.settings) {\n const live2DModel = context.live2dModel;\n\n const textureLoadings = context.settings.textures.map(tex => {\n const url = context.settings!.resolveURL(tex);\n return createTexture(url, { crossOrigin: context.options.crossOrigin });\n });\n\n // wait for the internal model to be created\n await next();\n\n if (context.internalModel) {\n live2DModel.internalModel = context.internalModel;\n live2DModel.emit('modelLoaded', context.internalModel);\n } else {\n throw new TypeError('Missing internal model.');\n }\n\n live2DModel.textures = await Promise.all(textureLoadings);\n live2DModel.emit('textureLoaded', live2DModel.textures);\n } else {\n throw new TypeError('Missing settings.');\n }\n};\n\n/**\n * A middleware that creates the InternalModel. Requires ModelSettings in context.\n */\nexport const createInternalModel: Middleware<Live2DFactoryContext> = async (context, next) => {\n const settings = context.settings;\n\n if (settings instanceof ModelSettings) {\n const runtime = Live2DFactory.findRuntime(settings);\n\n if (!runtime) {\n throw new TypeError('Unknown model settings.');\n }\n\n const modelData = await Live2DLoader.load<ArrayBuffer>({\n settings,\n url: settings.moc,\n type: 'arraybuffer',\n target: context.live2dModel,\n });\n\n if (!runtime.isValidMoc(modelData)) {\n throw new Error('Invalid moc data');\n }\n\n const coreModel = runtime.createCoreModel(modelData);\n\n context.internalModel = runtime.createInternalModel(coreModel, settings, context.options);\n\n return next();\n }\n\n throw new TypeError('Missing settings.');\n};\n","import { Texture } from '@pixi/core';\n\nexport function createTexture(url: string, options: { crossOrigin?: string } = {}): Promise<Texture> {\n const textureOptions: any = { resourceOptions: { crossorigin: options.crossOrigin } };\n\n // there's already such a method since Pixi v5.3.0\n if ((Texture as any).fromURL) {\n return Texture.fromURL(url, textureOptions).catch(e => {\n if (e instanceof Error) {\n throw e;\n }\n\n // assume e is an ErrorEvent, let's convert it to an Error\n const err = new Error('Texture loading error');\n (err as any).event = e;\n\n throw err;\n });\n }\n\n // and in order to provide backward compatibility for older Pixi versions,\n // we have to manually implement this method\n // see https://github.com/pixijs/pixi.js/pull/6687/files\n\n textureOptions.resourceOptions.autoLoad = false;\n\n const texture = Texture.from(url, textureOptions);\n\n if (texture.baseTexture.valid) {\n return Promise.resolve(texture);\n }\n\n const resource = texture.baseTexture.resource as any;\n\n // before Pixi v5.2.2, the Promise will not be rejected when loading has failed,\n // we have to manually handle the \"error\" event\n // see https://github.com/pixijs/pixi.js/pull/6374\n resource._live2d_load ??= new Promise<Texture>((resolve, reject) => {\n const errorHandler = (event: ErrorEvent) => {\n (resource.source as HTMLImageElement).removeEventListener('error', errorHandler);\n\n // convert the ErrorEvent to an Error\n const err = new Error('Texture loading error');\n (err as any).event = event;\n\n reject(err);\n };\n\n (resource.source as HTMLImageElement).addEventListener('error', errorHandler);\n\n (resource.load() as Promise<unknown>).then(() => resolve(texture)).catch(errorHandler);\n });\n\n return resource._live2d_load;\n}\n","import { ExpressionManager, InternalModel, ModelSettings, MotionManager } from '@/cubism-common';\nimport { Live2DLoader } from '@/factory/Live2DLoader';\nimport { Live2DModel, Live2DModelOptions } from '@/Live2DModel';\nimport { logger } from '@/utils';\nimport { Middleware, runMiddlewares } from '@/utils/middleware';\nimport {\n createInternalModel,\n jsonToSettings,\n setupEssentials,\n setupOptionals,\n urlToJSON,\n waitUntilReady,\n} from '@/factory/model-middlewares';\n\nexport interface Live2DFactoryOptions extends Live2DModelOptions {\n /**\n * String to use for crossOrigin properties on `<img>` elements when loading textures.\n * @default undefined\n */\n crossOrigin?: string;\n\n /**\n * Callback invokes when the model has been loaded.\n * @default undefined\n */\n onLoad?(): void;\n\n /**\n * Callback invokes when error occurs while loading the model.\n * @default undefined\n */\n onError?(e: Error): void;\n}\n\n/**\n * The context transferred through the model creation middlewares.\n */\nexport interface Live2DFactoryContext {\n source: any,\n options: Live2DFactoryOptions;\n live2dModel: Live2DModel;\n internalModel?: InternalModel;\n settings?: ModelSettings;\n}\n\n/**\n * Represents a Cubism version.\n */\nexport interface Live2DRuntime {\n /**\n * The version number. Higher version takes priority when matching the runtime.\n */\n version: number;\n\n /**\n * Checks if the source belongs to this runtime.\n * @param source - Either a settings JSON object or a ModelSettings instance.\n * @return True if the source belongs to this runtime.\n */\n test(source: any): boolean;\n\n // TODO: remove\n ready(): Promise<void>;\n\n /**\n * Checks if the data is a valid moc to create the core model.\n * @param modelData - The moc content.\n * @return True if the data is valid.\n */\n isValidMoc(modelData: ArrayBuffer): boolean;\n\n /**\n * Creates a ModelSettings.\n * @param json - The settings JSON object.\n * @return Created ModelSettings.\n */\n createModelSettings(json: JSONObject): ModelSettings;\n\n /**\n * Creates a core model.\n * @param data - Content of the moc file.\n * @return Created core model.\n */\n createCoreModel(data: ArrayBuffer): any;\n\n /**\n * Creates an InternalModel.\n * @param coreModel - Core model that *must* belong to this runtime.\n * @param settings - ModelSettings of this model.\n * @param options - Options that will be passed to the InternalModel's constructor.\n * @return Created InternalModel.\n */\n createInternalModel(coreModel: any, settings: ModelSettings, options?: Live2DFactoryOptions): InternalModel;\n\n /**\n * Creates a pose.\n * @param coreModel - Core model that *must* belong to this runtime.\n * @param data - Content of the pose file.\n * @return Created pose.\n */\n createPose(coreModel: any, data: any): any;\n\n /**\n * Creates a physics.\n * @param coreModel - Core model that *must* belong to this runtime.\n * @param data - Content of the physics file.\n * @return Created physics.\n */\n createPhysics(coreModel: any, data: any): any;\n}\n\n/**\n * Handles all the network load tasks.\n *\n * - Model creation: requested by {@link Live2DModel.from}.\n * - Motion loading: implements the load method of MotionManager.\n * - Expression loading: implements the load method of ExpressionManager.\n */\nexport class Live2DFactory {\n /**\n * All registered runtimes, sorted by versions in descending order.\n */\n static runtimes: Live2DRuntime[] = [];\n\n static urlToJSON = urlToJSON;\n static jsonToSettings = jsonToSettings;\n static waitUntilReady = waitUntilReady;\n static setupOptionals = setupOptionals;\n static setupEssentials = setupEssentials;\n static createInternalModel = createInternalModel;\n\n /**\n * Middlewares to run through when setting up a Live2DModel.\n */\n static live2DModelMiddlewares: Middleware<Live2DFactoryContext>[] = [\n urlToJSON, jsonToSettings, waitUntilReady, setupOptionals, setupEssentials, createInternalModel,\n ];\n\n /**\n * load tasks of each motion. The structure of each value in this map\n * is the same as respective {@link MotionManager.definitions}.\n */\n static motionTasksMap = new WeakMap<MotionManager, Record<string, (Promise<any> | undefined)[]>>();\n\n /**\n * Load tasks of each expression.\n */\n static expressionTasksMap = new WeakMap<ExpressionManager, (Promise<any> | undefined)[]>();\n\n /**\n * Registers a Live2DRuntime.\n */\n static registerRuntime(runtime: Live2DRuntime) {\n Live2DFactory.runtimes.push(runtime);\n\n // higher version as higher priority\n Live2DFactory.runtimes.sort((a, b) => b.version - a.version);\n }\n\n /**\n * Finds a runtime that matches given source.\n * @param source - Either a settings JSON object or a ModelSettings instance.\n * @return The Live2DRuntime, or undefined if not found.\n */\n static findRuntime(source: any): Live2DRuntime | undefined {\n for (const runtime of Live2DFactory.runtimes) {\n if (runtime.test(source)) {\n return runtime;\n }\n }\n }\n\n /**\n * Sets up a Live2DModel, populating it with all defined resources.\n * @param live2dModel - The Live2DModel instance.\n * @param source - Can be one of: settings file URL, settings JSON object, ModelSettings instance.\n * @param options - Options for the process.\n * @return Promise that resolves when all resources have been loaded, rejects when error occurs.\n */\n static async setupLive2DModel<IM extends InternalModel>(live2dModel: Live2DModel<IM>, source: string | object | IM['settings'], options?: Live2DFactoryOptions): Promise<void> {\n const textureLoaded = new Promise(resolve => live2dModel.once('textureLoaded', resolve));\n const modelLoaded = new Promise(resolve => live2dModel.once('modelLoaded', resolve));\n\n // because the \"ready\" event is supposed to be emitted after\n // both the internal model and textures have been loaded,\n // we should here wrap the emit() in a then() so it'll\n // be executed after all the handlers of \"modelLoaded\" and \"textureLoaded\"\n const readyEventEmitted = Promise.all([textureLoaded, modelLoaded]).then(() => live2dModel.emit('ready'));\n\n await runMiddlewares(Live2DFactory.live2DModelMiddlewares, {\n live2dModel,\n source,\n options: options || {},\n });\n\n // the \"load\" event should never be emitted before \"ready\"\n await readyEventEmitted;\n\n live2dModel.emit('load');\n }\n\n /**\n * Loads a Motion and registers the task to {@link motionTasksMap}. The task will be automatically\n * canceled when its owner - the MotionManager instance - has been destroyed.\n * @param motionManager - MotionManager that owns this Motion.\n * @param group - The motion group.\n * @param index - Index in the motion group.\n * @return Promise that resolves with the Motion, or with undefined if it can't be loaded.\n */\n static loadMotion<Motion, MotionSpec>(motionManager: MotionManager<Motion, MotionSpec>, group: string, index: number): Promise<Motion | undefined> {\n // errors in this method are always handled\n const handleError = (e: any) => motionManager.emit('motionLoadError', group, index, e);\n\n try {\n const definition = motionManager.definitions[group] ?. [index];\n\n if (!definition) {\n return Promise.resolve(undefined);\n }\n\n if (!motionManager.listeners('destroy').includes(Live2DFactory.releaseTasks)) {\n motionManager.once('destroy', Live2DFactory.releaseTasks);\n }\n\n let tasks = Live2DFactory.motionTasksMap.get(motionManager);\n\n if (!tasks) {\n tasks = {};\n Live2DFactory.motionTasksMap.set(motionManager, tasks);\n }\n\n let taskGroup = tasks[group];\n\n if (!taskGroup) {\n taskGroup = [];\n tasks[group] = taskGroup;\n }\n\n const path = motionManager.getMotionFile(definition);\n\n taskGroup[index] ??= Live2DLoader.load({\n url: path,\n settings: motionManager.settings,\n type: motionManager.motionDataType,\n target: motionManager,\n })\n .then(data => {\n const taskGroup = Live2DFactory.motionTasksMap.get(motionManager)?.[group];\n\n if (taskGroup) {\n delete taskGroup[index];\n }\n\n const motion = motionManager.createMotion(data, group, definition);\n\n motionManager.emit('motionLoaded', group, index, motion);\n\n return motion;\n })\n .catch(e => {\n logger.warn(motionManager.tag, `Failed to load motion: ${path}\\n`, e);\n handleError(e);\n });\n\n return taskGroup[index]!;\n } catch (e) {\n logger.warn(motionManager.tag, `Failed to load motion at \"${group}\"[${index}]\\n`, e);\n handleError(e);\n }\n\n return Promise.resolve(undefined);\n }\n\n /**\n * Loads an Expression and registers the task to {@link expressionTasksMap}. The task will be automatically\n * canceled when its owner - the ExpressionManager instance - has been destroyed.\n * @param expressionManager - ExpressionManager that owns this Expression.\n * @param index - Index of the Expression.\n * @return Promise that resolves with the Expression, or with undefined if it can't be loaded.\n */\n static loadExpression<Expression, ExpressionSpec>(expressionManager: ExpressionManager<Expression, ExpressionSpec>, index: number): Promise<Expression | undefined> {\n // errors in this method are always handled\n const handleError = (e: any) => expressionManager.emit('expressionLoadError', index, e);\n\n try {\n const definition = expressionManager.definitions[index];\n\n if (!definition) {\n return Promise.resolve(undefined);\n }\n\n if (!expressionManager.listeners('destroy').includes(Live2DFactory.releaseTasks)) {\n expressionManager.once('destroy', Live2DFactory.releaseTasks);\n }\n\n let tasks = Live2DFactory.expressionTasksMap.get(expressionManager);\n\n if (!tasks) {\n tasks = [];\n Live2DFactory.expressionTasksMap.set(expressionManager, tasks);\n }\n\n const path = expressionManager.getExpressionFile(definition);\n\n tasks[index] ??= Live2DLoader.load({\n url: path,\n settings: expressionManager.settings,\n type: 'json',\n target: expressionManager,\n })\n .then(data => {\n const tasks = Live2DFactory.expressionTasksMap.get(expressionManager);\n\n if (tasks) {\n delete tasks[index];\n }\n\n const expression = expressionManager.createExpression(data, definition);\n\n expressionManager.emit('expressionLoaded', index, expression);\n\n return expression;\n })\n .catch(e => {\n logger.warn(expressionManager.tag, `Failed to load expression: ${path}\\n`, e);\n handleError(e);\n });\n\n return tasks[index]!;\n } catch (e) {\n logger.warn(expressionManager.tag, `Failed to load expression at [${index}]\\n`, e);\n handleError(e);\n }\n\n return Promise.resolve(undefined);\n }\n\n static releaseTasks(this: MotionManager | ExpressionManager) {\n if (this instanceof MotionManager) {\n Live2DFactory.motionTasksMap.delete(this);\n } else {\n Live2DFactory.expressionTasksMap.delete(this);\n }\n }\n}\n\n(MotionManager.prototype as any)._loadMotion = function(this: MotionManager, group: string, index: number) {\n return Live2DFactory.loadMotion(this, group, index);\n};\n\n(ExpressionManager.prototype as any)._loadExpression = function(this: ExpressionManager, index: number) {\n return Live2DFactory.loadExpression(this, index);\n};\n","export * from './constants';\nexport * from './ExpressionManager';\nexport * from './FocusController';\nexport * from './ModelSettings';\nexport * from './MotionState';\nexport * from './MotionManager';\nexport * from './SoundManager';\nexport * from './InternalModel';\n","import { logger } from '@/utils';\nimport pull from 'lodash/pull';\n\nconst TAG = 'SoundManager';\nconst VOLUME = 0.5;\n\n/**\n * Manages all the sounds.\n */\nexport class SoundManager {\n /**\n * Audio elements playing or pending to play. Finished audios will be removed automatically.\n */\n static audios: HTMLAudioElement[] = [];\n\n protected static _volume = VOLUME;\n\n /**\n * Global volume that applies to all the sounds.\n */\n static get volume(): number {\n return this._volume;\n }\n\n static set volume(value: number) {\n this._volume = (value > 1 ? 1 : value < 0 ? 0 : value) || 0;\n this.audios.forEach(audio => (audio.volume = this._volume));\n }\n\n // TODO: return an ID?\n /**\n * Creates an audio element and adds it to the {@link audios}.\n * @param file - URL of the sound file.\n * @param onFinish - Callback invoked when the playback has finished.\n * @param onError - Callback invoked when error occurs.\n * @return Created audio element.\n */\n static add(file: string, onFinish?: () => void, onError?: (e: Error) => void): HTMLAudioElement {\n const audio = new Audio(file);\n\n audio.volume = this._volume;\n audio.preload = 'auto';\n\n audio.addEventListener('ended', () => {\n this.dispose(audio);\n onFinish?.();\n });\n\n audio.addEventListener('error', (e: ErrorEvent) => {\n this.dispose(audio);\n logger.warn(TAG, `Error occurred on \"${file}\"`, e.error);\n onError?.(e.error);\n });\n\n this.audios.push(audio);\n\n return audio;\n }\n\n /**\n * Plays the sound.\n * @param audio - An audio element.\n * @return Promise that resolves when the audio is ready to play, rejects when error occurs.\n */\n static play(audio: HTMLAudioElement): Promise<void> {\n return new Promise((resolve, reject) => {\n // see https://developers.google.com/web/updates/2017/09/autoplay-policy-changes\n audio.play()?.catch(e => {\n audio.dispatchEvent(new ErrorEvent('error', { error: e }));\n reject(e);\n });\n\n if (audio.readyState === audio.HAVE_ENOUGH_DATA) {\n resolve();\n } else {\n audio.addEventListener('canplaythrough', resolve as () => void);\n }\n });\n }\n\n /**\n * Disposes an audio element and removes it from {@link audios}.\n * @param audio - An audio element.\n */\n static dispose(audio: HTMLAudioElement): void {\n audio.pause();\n audio.removeAttribute('src');\n\n pull(this.audios, audio);\n }\n\n /**\n * Destroys all managed audios.\n */\n static destroy(): void {\n // dispose() removes given audio from the array, so the loop must be backward\n for (let i = this.audios.length - 1; i >= 0; i--) {\n this.dispose(this.audios[i]!);\n }\n }\n}\n","export const LOGICAL_WIDTH = 2;\nexport const LOGICAL_HEIGHT = 2;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","import { logger } from '@/utils';\n\n/**\n * Indicates the motion priority.\n */\nexport enum MotionPriority {\n /** States that the model is currently not playing any motion. This priority cannot be applied to a motion. */\n NONE,\n\n /** Low priority, used when starting idle motions automatically. */\n IDLE,\n\n /** Medium priority. */\n NORMAL,\n\n /** High priority. Motions as this priority will always be played regardless of the current priority. */\n FORCE\n}\n\n/**\n * Handles the state of a MotionManager.\n */\nexport class MotionState {\n /**\n * Tag for logging.\n */\n tag!: string;\n\n /**\n * When enabled, the states will be dumped to the logger when an exception occurs.\n */\n debug = false;\n\n /**\n * Priority of the current motion. Will be `MotionPriority.NONE` if there's no playing motion.\n */\n currentPriority = MotionPriority.NONE;\n\n /**\n * Priority of the reserved motion, which is still in loading and will be played once loaded.\n * Will be `MotionPriority.NONE` if there's no reserved motion.\n */\n reservePriority = MotionPriority.NONE;\n\n /**\n * Group of current motion.\n */\n currentGroup?: string;\n\n /**\n * Index of current motion in its group.\n */\n currentIndex?: number;\n\n /**\n * Group of the reserved motion.\n */\n reservedGroup?: string;\n\n /**\n * Index of the reserved motion in its group.\n */\n reservedIndex?: number;\n\n /**\n * Group of the reserved idle motion.\n */\n reservedIdleGroup?: string;\n\n /**\n * Index of the reserved idle motion in its group.\n */\n reservedIdleIndex?: number;\n\n /**\n * Reserves the playback for a motion.\n * @param group - The motion group.\n * @param index - Index in the motion group.\n * @param priority - The priority to be applied.\n * @return True if the reserving has succeeded.\n */\n reserve(group: string, index: number, priority: MotionPriority): boolean {\n if (priority <= MotionPriority.NONE) {\n logger.log(this.tag, `Cannot start a motion with MotionPriority.NONE.`);\n return false;\n }\n\n if (group === this.currentGroup && index === this.currentIndex) {\n logger.log(this.tag, `Motion is already playing.`, this.dump(group, index));\n return false;\n }\n\n if ((group === this.reservedGroup && index === this.reservedIndex) || (group === this.reservedIdleGroup && index === this.reservedIdleIndex)) {\n logger.log(this.tag, `Motion is already reserved.`, this.dump(group, index));\n return false;\n }\n\n if (priority === MotionPriority.IDLE) {\n if (this.currentPriority !== MotionPriority.NONE) {\n logger.log(this.tag, `Cannot start idle motion because another motion is playing.`, this.dump(group, index));\n return false;\n }\n\n if (this.reservedIdleGroup !== undefined) {\n logger.log(this.tag, `Cannot start idle motion because another idle motion has reserved.`, this.dump(group, index));\n return false;\n }\n\n this.setReservedIdle(group, index);\n } else {\n if (priority < MotionPriority.FORCE) {\n if (priority <= this.currentPriority) {\n logger.log(this.tag, 'Cannot start motion because another motion is playing as an equivalent or higher priority.', this.dump(group, index));\n return false;\n }\n\n if (priority <= this.reservePriority) {\n logger.log(this.tag, 'Cannot start motion because another motion has reserved as an equivalent or higher priority.', this.dump(group, index));\n return false;\n }\n }\n\n this.setReserved(group, index, priority);\n }\n\n return true;\n }\n\n /**\n * Requests the playback for a motion.\n * @param motion - The Motion, can be undefined.\n * @param group - The motion group.\n * @param index - Index in the motion group.\n * @param priority - The priority to be applied.\n * @return True if the request has been approved, i.e. the motion is allowed to play.\n */\n start(motion: any, group: string, index: number, priority: MotionPriority): boolean {\n if (priority === MotionPriority.IDLE) {\n this.setReservedIdle(undefined, undefined);\n\n if (this.currentPriority !== MotionPriority.NONE) {\n logger.log(this.tag, 'Cannot start idle motion because another motion is playing.', this.dump(group, index));\n return false;\n }\n } else {\n if (group !== this.reservedGroup || index !== this.reservedIndex) {\n logger.log(this.tag, 'Cannot start motion because another motion has taken the place.', this.dump(group, index));\n return false;\n }\n\n this.setReserved(undefined, undefined, MotionPriority.NONE);\n }\n\n if (!motion) {\n return false;\n }\n\n this.setCurrent(group, index, priority);\n\n return true;\n }\n\n /**\n * Notifies the motion playback has finished.\n */\n complete() {\n this.setCurrent(undefined, undefined, MotionPriority.NONE);\n }\n\n /**\n * Sets the current motion.\n */\n setCurrent(group: string | undefined, index: number | undefined, priority: MotionPriority) {\n this.currentPriority = priority;\n this.currentGroup = group;\n this.currentIndex = index;\n }\n\n /**\n * Sets the reserved motion.\n */\n setReserved(group: string | undefined, index: number | undefined, priority: MotionPriority) {\n this.reservePriority = priority;\n this.reservedGroup = group;\n this.reservedIndex = index;\n }\n\n /**\n * Sets the reserved idle motion.\n */\n setReservedIdle(group: string | undefined, index: number | undefined) {\n this.reservedIdleGroup = group;\n this.reservedIdleIndex = index;\n }\n\n /**\n * Checks if a Motion is currently playing or has reserved.\n * @return True if active.\n */\n isActive(group: string, index: number): boolean {\n return (group === this.currentGroup && index === this.currentIndex)\n || (group === this.reservedGroup && index === this.reservedIndex)\n || (group === this.reservedIdleGroup && index === this.reservedIdleIndex);\n }\n\n /**\n * Resets the state.\n */\n reset() {\n this.setCurrent(undefined, undefined, MotionPriority.NONE);\n\n // make sure the reserved motions (if existing) won't start when they are loaded\n this.setReserved(undefined, undefined, MotionPriority.NONE);\n this.setReservedIdle(undefined, undefined);\n }\n\n /**\n * Checks if an idle motion should be requests to play.\n */\n shouldRequestIdleMotion(): boolean {\n return this.currentGroup === undefined && this.reservedIdleGroup === undefined;\n }\n\n /**\n * Checks if the model's expression should be overridden by the motion.\n */\n shouldOverrideExpression(): boolean {\n return this.currentPriority > MotionPriority.IDLE;\n }\n\n /**\n * Dumps the state for debugging.\n */\n dump(requestedGroup?: string, requestedIndex?: number): string {\n if (this.debug) {\n const keys: (keyof this)[] = [\n 'currentPriority',\n 'reservePriority',\n 'currentGroup',\n 'currentIndex',\n 'reservedGroup',\n 'reservedIndex',\n 'reservedIdleGroup',\n 'reservedIdleIndex',\n ];\n return `\\n<Requested> group = \"${requestedGroup}\", index = ${requestedIndex}\\n` + keys.map(key => '[' + key + '] ' + this[key]).join('\\n');\n }\n return '';\n }\n}\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","import { ModelSettings } from '@/cubism-common/ModelSettings';\nimport { MotionManagerOptions } from '@/cubism-common/MotionManager';\nimport { logger } from '@/utils';\nimport { EventEmitter } from '@pixi/utils';\n\n/**\n * Abstract expression manager.\n * @emits {@link ExpressionManagerEvents}\n */\nexport abstract class ExpressionManager<Expression = any, ExpressionSpec = any> extends EventEmitter {\n /**\n * Tag for logging.\n */\n tag: string;\n\n /**\n * Expression definitions copied from ModelSettings.\n */\n abstract readonly definitions: ExpressionSpec[];\n\n /**\n * The ModelSettings reference.\n */\n readonly settings: ModelSettings;\n\n /**\n * The Expressions. The structure is the same as {@link definitions}, initially there's only\n * an empty array, which means all expressions will be `undefined`. When an Expression has\n * been loaded, it'll fill the place in which it should be; when it fails to load,\n * the place will be filled with `null`.\n */\n expressions: (Expression | null | undefined)[] = [];\n\n /**\n * An empty Expression to reset all the expression parameters.\n */\n defaultExpression!: Expression;\n\n /**\n * Current Expression. This will not be overwritten by the {@link defaultExpression}.\n */\n currentExpression!: Expression;\n\n /**\n * The pending Expression.\n */\n reserveExpressionIndex = -1;\n\n /**\n * Flags the instance has been destroyed.\n */\n destroyed = false;\n\n protected constructor(settings: ModelSettings, options?: MotionManagerOptions) {\n super();\n this.settings = settings;\n this.tag = `ExpressionManager(${settings.name})`;\n }\n\n /**\n * Should be called in the constructor of derived class.\n */\n protected init() {\n this.defaultExpression = this.createExpression({}, undefined);\n this.currentExpression = this.defaultExpression;\n\n this.stopAllExpressions();\n }\n\n /**\n * Loads an Expression. Errors in this method will not be thrown,\n * but be emitted with an \"expressionLoadError\" event.\n * @param index - Index of the expression in definitions.\n * @return Promise that resolves with the Expression, or with undefined if it can't be loaded.\n * @emits {@link ExpressionManagerEvents.expressionLoaded}\n * @emits {@link ExpressionManagerEvents.expressionLoadError}\n */\n protected async loadExpression(index: number): Promise<Expression | undefined> {\n if (!this.definitions[index]) {\n logger.warn(this.tag, `Undefined expression at [${index}]`);\n return undefined;\n }\n\n if (this.expressions[index] === null) {\n logger.warn(this.tag, `Cannot set expression at [${index}] because it's already failed in loading.`);\n return undefined;\n }\n\n if (this.expressions[index]) {\n return this.expressions[index] as Expression;\n }\n\n const expression = await this._loadExpression(index);\n\n this.expressions[index] = expression;\n\n return expression;\n }\n\n /**\n * Loads the Expression. Will be implemented by Live2DFactory.\n * @ignore\n */\n private _loadExpression(index: number): Promise<Expression | undefined> {\n throw new Error('Not implemented.');\n }\n\n /**\n * Sets a random Expression that differs from current one.\n * @return Promise that resolves with true if succeeded, with false otherwise.\n */\n async setRandomExpression(): Promise<boolean> {\n if (this.definitions.length) {\n const availableIndices = [];\n\n for (let i = 0; i < this.definitions.length; i++) {\n if (\n this.expressions[i] !== null\n && this.expressions[i] !== this.currentExpression\n && i !== this.reserveExpressionIndex\n ) {\n availableIndices.push(i);\n }\n }\n\n if (availableIndices.length) {\n const index = Math.floor(Math.random() * availableIndices.length);\n\n return this.setExpression(index);\n }\n }\n\n return false;\n }\n\n /**\n * Resets model's expression using {@link defaultExpression}.\n */\n resetExpression(): void {\n this._setExpression(this.defaultExpression);\n }\n\n /**\n * Restores model's expression to {@link currentExpression}.\n */\n restoreExpression(): void {\n this._setExpression(this.currentExpression);\n }\n\n /**\n * Sets an Expression.\n * @param index - Either the index, or the name of the expression.\n * @return Promise that resolves with true if succeeded, with false otherwise.\n */\n async setExpression(index: number | string): Promise<boolean> {\n if (typeof index !== 'number') {\n index = this.getExpressionIndex(index);\n }\n\n if (!(index > -1 && index < this.definitions.length)) {\n return false;\n }\n\n if (index === this.expressions.indexOf(this.currentExpression)) {\n return false;\n }\n\n this.reserveExpressionIndex = index;\n\n const expression = await this.loadExpression(index);\n\n if (!expression || this.reserveExpressionIndex !== index) {\n return false;\n }\n\n this.reserveExpressionIndex = -1;\n this.currentExpression = expression;\n this._setExpression(expression);\n\n return true;\n }\n\n /**\n * Updates parameters of the core model.\n * @return True if the parameters are actually updated.\n */\n update(model: object, now: DOMHighResTimeStamp) {\n if (!this.isFinished()) {\n return this.updateParameters(model, now);\n }\n\n return false;\n }\n\n /**\n * Destroys the instance.\n * @emits {@link ExpressionManagerEvents.destroy}\n */\n destroy() {\n this.destroyed = true;\n this.emit('destroy');\n\n const self = this as Mutable<Partial<this>>;\n self.definitions = undefined;\n self.expressions = undefined;\n }\n\n /**\n * Checks if the expression playback has finished.\n */\n abstract isFinished(): boolean;\n\n /**\n * Retrieves the expression's index by its name.\n * @return The index. `-1` if not found.\n */\n abstract getExpressionIndex(name: string): number;\n\n /**\n * Retrieves the expression's file path by its definition.\n * @return The file path extracted from given definition. Not resolved.\n */\n abstract getExpressionFile(definition: ExpressionSpec): string;\n\n /**\n * Creates an Expression from the data.\n * @param data - Content of the expression file.\n * @param definition - The expression definition. Can be undefined when creating the {@link defaultExpression}.\n * @return The created Expression.\n */\n abstract createExpression(data: JSONObject, definition: ExpressionSpec | undefined): Expression;\n\n /**\n * Applies the Expression to the model.\n */\n protected abstract _setExpression(motion: Expression): number;\n\n /**\n * Cancels expression playback.\n */\n protected abstract stopAllExpressions(): void;\n\n /**\n * Updates parameters of the core model.\n * @return True if the parameters are actually updated.\n */\n protected abstract updateParameters(model: object, now: DOMHighResTimeStamp): boolean;\n}\n","import { folderName } from '@/utils';\nimport { url } from '@pixi/utils';\n\n/**\n * Parses, and provides access to the settings JSON.\n */\nexport abstract class ModelSettings {\n json: JSONObject;\n\n /**\n * The model's name, typically used for displaying or logging. By default it's inferred from\n * the URL by taking the folder name (the second to last component). In Cubism 2 it'll be overwritten\n * by the `name` field of settings JSON.\n */\n name: string;\n\n /**\n * URL of the model settings file, used to resolve paths of the resource files defined in settings.\n * This typically ends with `.model.json` in Cubism 2 and `.model3.json` in Cubism 4.\n */\n url: string;\n\n /**\n * Relative path of he moc file, typically ends with `.moc` in Cubism 2 and `.moc3` in Cubism 4.\n */\n abstract moc: string;\n\n /**\n * Relative paths of the texture images.\n */\n abstract textures: string[];\n\n /**\n * Relative path of the pose file.\n */\n pose?: string;\n\n /**\n * Relative path of the physics file.\n */\n physics?: string;\n\n /**\n * @param json - The settings JSON object.\n * @param json.url - The `url` field must be defined to specify the settings file's URL.\n */\n protected constructor(json: JSONObject & { url: string }) {\n this.json = json;\n\n let url = (json as any).url;\n\n if (typeof url !== 'string') {\n // this is not allowed because it'll typically result in errors, including a\n // fatal error - an OOM that crashes the browser while initializing this cubism2 model,\n // I'm not kidding!\n throw new TypeError('The `url` field in settings JSON must be defined as a string.');\n }\n\n this.url = url;\n\n // set default name to folder's name\n this.name = folderName(this.url);\n }\n\n /**\n * Resolves a relative path using the {@link url}. This is used to resolve the resource files\n * defined in the settings.\n * @param path - Relative path.\n * @return Resolved path.\n */\n resolveURL(path: string): string {\n return url.resolve(this.url, path);\n }\n\n /**\n * Replaces the resource files by running each file through the `replacer`.\n * @param replacer - Invoked with two arguments: `(file, path)`, where `file` is the file definition,\n * and `path` is its property path in the ModelSettings instance. A string must be returned to be the replacement.\n *\n * ```js\n * modelSettings.replaceFiles((file, path) => {\n * // file = \"foo.moc\", path = \"moc\"\n * // file = \"foo.png\", path = \"textures[0]\"\n * // file = \"foo.mtn\", path = \"motions.idle[0].file\"\n * // file = \"foo.motion3.json\", path = \"motions.idle[0].File\"\n *\n * return \"bar/\" + file;\n * });\n * ```\n */\n replaceFiles(replacer: (file: string, path: string) => string) {\n this.moc = replacer(this.moc, 'moc');\n\n if (this.pose !== undefined) {\n (this.pose = replacer(this.pose, 'pose'));\n }\n\n if (this.physics !== undefined) {\n (this.physics = replacer(this.physics, 'physics'));\n }\n\n for (let i = 0; i < this.textures.length; i++) {\n this.textures[i] = replacer(this.textures[i]!, `textures[${i}]`);\n }\n };\n\n /**\n * Retrieves all resource files defined in the settings.\n * @return A flat array of the paths of all resource files.\n *\n * ```js\n * modelSettings.getDefinedFiles();\n * // returns: [\"foo.moc\", \"foo.png\", ...]\n * ```\n */\n getDefinedFiles(): string[] {\n const files: string[] = [];\n\n this.replaceFiles((file: string) => {\n files.push(file);\n\n return file;\n });\n\n return files;\n }\n\n /**\n * Validates that the files defined in the settings exist in given files. Each file will be\n * resolved by {@link resolveURL} before comparison.\n * @param files - A flat array of file paths.\n * @return All the files which are defined in the settings and also exist in given files,\n * *including the optional files*.\n * @throws Error if any *essential* file is defined in settings but not included in given files.\n */\n validateFiles(files: string[]): string[] {\n const assertFileExists = (expectedFile: string, shouldThrow: boolean): boolean => {\n const actualPath = this.resolveURL(expectedFile);\n\n if (!files.includes(actualPath)) {\n if (shouldThrow) {\n throw new Error(`File \"${expectedFile}\" is defined in settings, but doesn't exist in given files`);\n }\n\n return false;\n }\n\n return true;\n };\n\n const essentialFiles = [this.moc, ...this.textures];\n\n essentialFiles.forEach(texture => assertFileExists(texture, true));\n\n const definedFiles = this.getDefinedFiles();\n\n return definedFiles.filter(file => assertFileExists(file, false));\n }\n}\n","import { config } from '@/config';\nimport { ExpressionManager } from '@/cubism-common/ExpressionManager';\nimport { ModelSettings } from '@/cubism-common/ModelSettings';\nimport { MotionPriority, MotionState } from '@/cubism-common/MotionState';\nimport { SoundManager } from '@/cubism-common/SoundManager';\nimport { logger } from '@/utils';\nimport { EventEmitter } from '@pixi/utils';\n\nexport interface MotionManagerOptions {\n /**\n * How to preload the motions.\n * @default {@link MotionPreloadStrategy.NONE}\n */\n motionPreload?: MotionPreloadStrategy;\n\n /**\n * Specifies the idle motion group.\n * @default \"idle\" in Cubism 2 and \"Idle\" in Cubism 4.\n */\n idleMotionGroup?: string;\n}\n\n/**\n * Indicates how the motions will be preloaded.\n */\nexport enum MotionPreloadStrategy {\n /** Preload all the motions. */\n ALL = 'ALL',\n\n /** Preload only the idle motions. */\n IDLE = 'IDLE',\n\n /** No preload. */\n NONE = 'NONE',\n}\n\n/**\n * Handles the motion playback.\n * @emits {@link MotionManagerEvents}\n */\nexport abstract class MotionManager<Motion = any, MotionSpec = any> extends EventEmitter {\n /**\n * Tag for logging.\n */\n tag: string;\n\n /**\n * Motion definitions copied from ModelSettings.\n */\n abstract readonly definitions: Partial<Record<string, MotionSpec[]>>;\n\n /**\n * Motion groups with particular internal usages. Currently there's only the `idle` field,\n * which specifies the actual name of the idle motion group, so the idle motions\n * can be correctly found from the settings JSON of various Cubism versions.\n */\n abstract readonly groups: { idle: string };\n\n /**\n * Indicates the content type of the motion files, varies in different Cubism versions.\n * This will be used as `xhr.responseType`.\n */\n abstract readonly motionDataType: 'json' | 'arraybuffer';\n\n /**\n * Can be undefined if the settings defines no expression.\n */\n abstract expressionManager?: ExpressionManager;\n\n /**\n * The ModelSettings reference.\n */\n readonly settings: ModelSettings;\n\n /**\n * The Motions. The structure is the same as {@link definitions}, initially each group contains\n * an empty array, which means all motions will be `undefined`. When a Motion has been loaded,\n * it'll fill the place in which it should be; when it fails to load, the place will be filled\n * with `null`.\n */\n motionGroups: Partial<Record<string, (Motion | undefined | null)[]>> = {};\n\n /**\n * Maintains the state of this MotionManager.\n */\n state = new MotionState();\n\n /**\n * Audio element of the current motion if a sound file is defined with it.\n */\n currentAudio?: HTMLAudioElement;\n\n /**\n * Flags there's a motion playing.\n */\n playing = false;\n\n /**\n * Flags the instances has been destroyed.\n */\n destroyed = false;\n\n protected constructor(settings: ModelSettings, options?: MotionManagerOptions) {\n super();\n this.settings = settings;\n this.tag = `MotionManager(${settings.name})`;\n this.state.tag = this.tag;\n }\n\n /**\n * Should be called in the constructor of derived class.\n */\n protected init(options?: MotionManagerOptions) {\n if (options?.idleMotionGroup) {\n this.groups.idle = options.idleMotionGroup;\n }\n\n this.setupMotions(options);\n this.stopAllMotions();\n }\n\n /**\n * Sets up motions from the definitions, and preloads them according to the preload strategy.\n */\n protected setupMotions(options?: MotionManagerOptions): void {\n for (const group of Object.keys(this.definitions)) {\n // init with the same structure of definitions\n this.motionGroups[group] = [];\n }\n\n // preload motions\n\n let groups;\n\n switch (options?.motionPreload) {\n case MotionPreloadStrategy.NONE:\n return;\n\n case MotionPreloadStrategy.ALL:\n groups = Object.keys(this.definitions);\n break;\n\n case MotionPreloadStrategy.IDLE:\n default:\n groups = [this.groups.idle];\n break;\n }\n\n for (const group of groups) {\n if (this.definitions[group]) {\n for (let i = 0; i < this.definitions[group]!.length; i++) {\n this.loadMotion(group, i).then();\n }\n }\n }\n }\n\n /**\n * Loads a Motion in a motion group. Errors in this method will not be thrown,\n * but be emitted with a \"motionLoadError\" event.\n * @param group - The motion group.\n * @param index - Index in the motion group.\n * @return Promise that resolves with the Motion, or with undefined if it can't be loaded.\n * @emits {@link MotionManagerEvents.motionLoaded}\n * @emits {@link MotionManagerEvents.motionLoadError}\n */\n async loadMotion(group: string, index: number): Promise<Motion | undefined> {\n if (!this.definitions[group] ?. [index]) {\n logger.warn(this.tag, `Undefined motion at \"${group}\"[${index}]`);\n return undefined;\n }\n\n if (this.motionGroups[group]![index] === null) {\n logger.warn(this.tag, `Cannot start motion at \"${group}\"[${index}] because it's already failed in loading.`);\n return undefined;\n }\n\n if (this.motionGroups[group]![index]) {\n return this.motionGroups[group]![index]!;\n }\n\n const motion = await this._loadMotion(group, index);\n\n if (this.destroyed) {\n return;\n }\n\n this.motionGroups[group]![index] = motion ?? null;\n\n return motion;\n }\n\n // TODO: remove\n /**\n * Loads the Motion. Will be implemented by Live2DFactory.\n * @ignore\n */\n private _loadMotion(group: string, index: number): Promise<Motion | undefined> {\n throw new Error('Not implemented.');\n }\n\n /**\n * Starts a motion as given priority.\n * @param group - The motion group.\n * @param index - Index in the motion group.\n * @param priority - The priority to be applied.\n * @return Promise that resolves with true if the motion is successfully started, with false otherwise.\n */\n async startMotion(group: string, index: number, priority = MotionPriority.NORMAL): Promise<boolean> {\n if (!this.state.reserve(group, index, priority)) {\n return false;\n }\n\n const definition = this.definitions[group]?.[index];\n\n if (!definition) {\n return false;\n }\n\n if (this.currentAudio) {\n // TODO: reuse the audio?\n SoundManager.dispose(this.currentAudio);\n }\n\n let audio: HTMLAudioElement | undefined;\n\n if (config.sound) {\n const soundURL = this.getSoundFile(definition);\n\n if (soundURL) {\n try {\n // start to load the audio\n audio = SoundManager.add(\n this.settings.resolveURL(soundURL),\n () => this.currentAudio = undefined,\n () => this.currentAudio = undefined,\n );\n\n this.currentAudio = audio;\n } catch (e) {\n logger.warn(this.tag, 'Failed to create audio', soundURL, e);\n }\n }\n }\n\n const motion = await this.loadMotion(group, index);\n\n if (audio) {\n const readyToPlay = SoundManager.play(audio)\n .catch(e => logger.warn(this.tag, 'Failed to play audio', audio!.src, e));\n\n if (config.motionSync) {\n // wait until the audio is ready\n await readyToPlay;\n }\n }\n\n if (!this.state.start(motion, group, index, priority)) {\n if (audio) {\n SoundManager.dispose(audio);\n this.currentAudio = undefined;\n }\n\n return false;\n }\n\n logger.log(this.tag, 'Start motion:', this.getMotionName(definition));\n\n this.emit('motionStart', group, index, audio);\n\n if (this.state.shouldOverrideExpression()) {\n this.expressionManager && this.expressionManager.resetExpression();\n }\n\n this.playing = true;\n\n this._startMotion(motion!);\n\n return true;\n }\n\n /**\n * Starts a random Motion as given priority.\n * @param group - The motion group.\n * @param priority - The priority to be applied.\n * @return Promise that resolves with true if the motion is successfully started, with false otherwise.\n */\n async startRandomMotion(group: string, priority?: MotionPriority): Promise<boolean> {\n const groupDefs = this.definitions[group];\n\n if (groupDefs?.length) {\n const availableIndices = [];\n\n for (let i = 0; i < groupDefs!.length; i++) {\n if (this.motionGroups[group]![i] !== null && !this.state.isActive(group, i)) {\n availableIndices.push(i);\n }\n }\n\n if (availableIndices.length) {\n const index = Math.floor(Math.random() * availableIndices.length);\n\n return this.startMotion(group, availableIndices[index]!, priority);\n }\n }\n\n return false;\n }\n\n /**\n * Stops all playing motions as well as the sound.\n */\n stopAllMotions(): void {\n this._stopAllMotions();\n\n this.state.reset();\n\n if (this.currentAudio) {\n SoundManager.dispose(this.currentAudio);\n this.currentAudio = undefined;\n }\n }\n\n /**\n * Updates parameters of the core model.\n * @param model - The core model.\n * @param now - Current time in milliseconds.\n * @return True if the parameters have been actually updated.\n */\n update(model: object, now: DOMHighResTimeStamp): boolean {\n if (this.isFinished()) {\n if (this.playing) {\n this.playing = false;\n this.emit('motionFinish');\n }\n\n if (this.state.shouldOverrideExpression()) {\n this.expressionManager?.restoreExpression();\n }\n\n this.state.complete();\n\n if (this.state.shouldRequestIdleMotion()) {\n // noinspection JSIgnoredPromiseFromCall\n this.startRandomMotion(this.groups.idle, MotionPriority.IDLE);\n }\n }\n\n let updated = this.updateParameters(model, now);\n\n updated = this.expressionManager?.update(model, now) || updated;\n\n return updated;\n }\n\n /**\n * Destroys the instance.\n * @emits {@link MotionManagerEvents.destroy}\n */\n destroy() {\n this.destroyed = true;\n this.emit('destroy');\n\n this.stopAllMotions();\n this.expressionManager?.destroy();\n\n const self = this as Mutable<Partial<this>>;\n self.definitions = undefined;\n self.motionGroups = undefined;\n }\n\n /**\n * Checks if the motion playback has finished.\n */\n abstract isFinished(): boolean;\n\n /**\n * Creates a Motion from the data.\n * @param data - Content of the motion file. The format must be consistent with {@link motionDataType}.\n * @param group - The motion group.\n * @param definition - The motion definition.\n * @return The created Motion.\n */\n abstract createMotion(data: ArrayBuffer | JSONObject, group: string, definition: MotionSpec): Motion;\n\n /**\n * Retrieves the motion's file path by its definition.\n * @return The file path extracted from given definition. Not resolved.\n */\n abstract getMotionFile(definition: MotionSpec): string;\n\n /**\n * Retrieves the motion's name by its definition.\n * @return The motion's name.\n */\n protected abstract getMotionName(definition: MotionSpec): string;\n\n /**\n * Retrieves the motion's sound file by its definition.\n * @return The motion's sound file, can be undefined.\n */\n protected abstract getSoundFile(definition: MotionSpec): string | undefined;\n\n /**\n * Starts the Motion.\n */\n protected abstract _startMotion(motion: Motion, onFinish?: (motion: Motion) => void): number;\n\n /**\n * Stops all playing motions.\n */\n protected abstract _stopAllMotions(): void;\n\n /**\n * Updates parameters of the core model.\n * @param model - The core model.\n * @param now - Current time in milliseconds.\n * @return True if the parameters have been actually updated.\n */\n protected abstract updateParameters(model: object, now: DOMHighResTimeStamp): boolean;\n}\n","import { LOGICAL_HEIGHT, LOGICAL_WIDTH } from '@/cubism-common/constants';\nimport { FocusController } from '@/cubism-common/FocusController';\nimport { ModelSettings } from '@/cubism-common/ModelSettings';\nimport { MotionManager, MotionManagerOptions } from '@/cubism-common/MotionManager';\nimport { Matrix } from '@pixi/math';\nimport { EventEmitter } from '@pixi/utils';\n\n/**\n * Common layout definition shared between all Cubism versions.\n */\nexport interface CommonLayout {\n centerX?: number;\n centerY?: number;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n top?: number;\n bottom?: number;\n left?: number;\n right?: number;\n}\n\n/**\n * Common hit area definition shared between all Cubism versions.\n */\nexport interface CommonHitArea {\n id: string;\n name: string;\n index: number;\n}\n\nexport interface Bounds {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface InternalModelOptions extends MotionManagerOptions {}\n\nconst tempBounds: Bounds = { x: 0, y: 0, width: 0, height: 0 };\n\n/**\n * A wrapper that manages the states of a Live2D core model, and delegates all operations to it.\n * @emits {@link InternalModelEvents}\n */\nexport abstract class InternalModel extends EventEmitter {\n /**\n * The managed Live2D core model.\n */\n abstract readonly coreModel: object;\n\n abstract readonly settings: ModelSettings;\n\n focusController = new FocusController();\n\n abstract motionManager: MotionManager;\n\n pose?: any;\n physics?: any;\n\n /**\n * Original canvas width of the model. Note this doesn't represent the model's real size,\n * as the model can overflow from its canvas.\n */\n readonly originalWidth: number = 0;\n\n /**\n * Original canvas height of the model. Note this doesn't represent the model's real size,\n * as the model can overflow from its canvas.\n */\n readonly originalHeight: number = 0;\n\n /**\n * Canvas width of the model, scaled by the `width` of the model's layout.\n */\n readonly width: number = 0;\n\n /**\n * Canvas height of the model, scaled by the `height` of the model's layout.\n */\n readonly height: number = 0;\n\n /**\n * Local transformation, calculated from the model's layout.\n */\n localTransform = new Matrix();\n\n /**\n * The final matrix to draw the model.\n */\n drawingMatrix = new Matrix();\n\n // TODO: change structure\n /**\n * The hit area definitions, keyed by their names.\n */\n hitAreas: Record<string, CommonHitArea> = {};\n\n /**\n * Flags whether `gl.UNPACK_FLIP_Y_WEBGL` should be enabled when binding the textures.\n */\n textureFlipY = false;\n\n /**\n * WebGL viewport when drawing the model. The format is `[x, y, width, height]`.\n */\n viewport: [number, number, number, number] = [0, 0, 0, 0];\n\n /**\n * Flags this instance has been destroyed.\n */\n destroyed = false;\n\n /**\n * Should be called in the constructor of derived class.\n */\n protected init() {\n this.setupLayout();\n this.setupHitAreas();\n }\n\n /**\n * Sets up the model's size and local transform by the model's layout.\n */\n protected setupLayout() {\n // cast `this` to be mutable\n const self = this as Mutable<this>;\n\n const size = this.getSize();\n\n self.originalWidth = size[0];\n self.originalHeight = size[1];\n\n const layout = Object.assign(\n {\n width: LOGICAL_WIDTH,\n height: LOGICAL_HEIGHT,\n },\n this.getLayout(),\n );\n\n this.localTransform.scale(layout.width / LOGICAL_WIDTH, layout.height / LOGICAL_HEIGHT);\n\n self.width = this.originalWidth * this.localTransform.a;\n self.height = this.originalHeight * this.localTransform.d;\n\n // this calculation differs from Live2D SDK...\n const offsetX = (layout.x !== undefined && layout.x - layout.width / 2)\n || (layout.centerX !== undefined && layout.centerX)\n || (layout.left !== undefined && layout.left - layout.width / 2)\n || (layout.right !== undefined && layout.right + layout.width / 2)\n || 0;\n\n const offsetY = (layout.y !== undefined && layout.y - layout.height / 2)\n || (layout.centerY !== undefined && layout.centerY)\n || (layout.top !== undefined && layout.top - layout.height / 2)\n || (layout.bottom !== undefined && layout.bottom + layout.height / 2)\n || 0;\n\n this.localTransform.translate(this.width * offsetX, -this.height * offsetY);\n }\n\n /**\n * Sets up the hit areas by their definitions in settings.\n */\n protected setupHitAreas() {\n const definitions = this.getHitAreaDefs().filter(hitArea => hitArea.index >= 0);\n\n for (const def of definitions) {\n this.hitAreas[def.name] = def;\n }\n }\n\n /**\n * Hit-test on the model.\n * @param x - Position in model canvas.\n * @param y - Position in model canvas.\n * @return The names of the *hit* hit areas. Can be empty if none is hit.\n */\n hitTest(x: number, y: number): string[] {\n return Object.keys(this.hitAreas).filter(hitAreaName => this.isHit(hitAreaName, x, y));\n }\n\n /**\n * Hit-test for a single hit area.\n * @param hitAreaName - The hit area's name.\n * @param x - Position in model canvas.\n * @param y - Position in model canvas.\n * @return True if hit.\n */\n isHit(hitAreaName: string, x: number, y: number): boolean {\n if (!this.hitAreas[hitAreaName]) {\n return false;\n }\n\n const drawIndex = this.hitAreas[hitAreaName]!.index;\n\n const bounds = this.getDrawableBounds(drawIndex, tempBounds);\n\n return bounds.x <= x && x <= bounds.x + bounds.width && bounds.y <= y && y <= bounds.y + bounds.height;\n }\n\n /**\n * Gets a drawable's bounds.\n * @param index - Index of the drawable.\n * @param bounds - Object to store the output values.\n * @return The bounds in model canvas space.\n */\n getDrawableBounds(index: number, bounds?: Bounds): Bounds {\n const vertices = this.getDrawableVertices(index);\n\n let left = vertices[0]!;\n let right = vertices[0]!;\n let top = vertices[1]!;\n let bottom = vertices[1]!;\n\n for (let i = 0; i < vertices.length; i += 2) {\n const vx = vertices[i]!;\n const vy = vertices[i + 1]!;\n\n left = Math.min(vx, left);\n right = Math.max(vx, right);\n top = Math.min(vy, top);\n bottom = Math.max(vy, bottom);\n }\n\n bounds ??= {} as Bounds;\n\n bounds.x = left;\n bounds.y = top;\n bounds.width = right - left;\n bounds.height = bottom - top;\n\n return bounds;\n }\n\n /**\n * Updates the model's transform.\n * @param transform - The world transform.\n */\n updateTransform(transform: Matrix) {\n this.drawingMatrix.copyFrom(transform).append(this.localTransform);\n }\n\n /**\n * Updates the model's parameters.\n * @param dt - Elapsed time in milliseconds from last frame.\n * @param now - Current time in milliseconds.\n */\n update(dt: DOMHighResTimeStamp, now: DOMHighResTimeStamp): void {\n this.focusController.update(dt);\n };\n\n /**\n * Destroys the model and all related resources.\n * @emits {@link InternalModelEvents.destroy | destroy}\n */\n destroy() {\n this.destroyed = true;\n this.emit('destroy');\n\n this.motionManager.destroy();\n (this as Partial<this>).motionManager = undefined;\n }\n\n /**\n * Gets all the hit area definitions.\n * @return Normalized definitions.\n */\n protected abstract getHitAreaDefs(): CommonHitArea[];\n\n /**\n * Gets the model's original canvas size.\n * @return `[width, height]`\n */\n protected abstract getSize(): [number, number];\n\n /**\n * Gets the layout definition.\n * @return Normalized definition.\n */\n protected abstract getLayout(): CommonLayout;\n\n /**\n * Gets all the drawables' IDs.\n * @return IDs.\n */\n abstract getDrawableIDs(): string[];\n\n /**\n * Finds the index of a drawable by its ID.\n * @return The index.\n */\n abstract getDrawableIndex(id: string): number;\n\n /**\n * Gets a drawable's vertices.\n * @param index - Either the index or the ID of the drawable.\n * @throws Error when the drawable cannot be found.\n */\n abstract getDrawableVertices(index: number | string): Float32Array;\n\n /**\n * Updates WebGL context bound to this model.\n * @param gl - WebGL context.\n * @param glContextID - Unique ID for given WebGL context.\n */\n abstract updateWebGLContext(gl: WebGLRenderingContext, glContextID: number): void;\n\n /**\n * Binds a texture to the model. The index must be the same as that of this texture\n * in the {@link ModelSettings.textures} array.\n */\n abstract bindTexture(index: number, texture: WebGLTexture): void;\n\n /**\n * Draws the model.\n */\n abstract draw(gl: WebGLRenderingContext): void;\n}\n","import { clamp } from '@/utils';\n\n// Minimum distance to respond\nconst EPSILON = 0.01;\n\nconst MAX_SPEED = 40 / 7.5;\n\n// the time to accelerate to max speed\nconst ACCELERATION_TIME = 1 / (0.15 * 1000);\n\n/**\n * Interpolates the transition of focus position.\n */\nexport class FocusController {\n /** The focus position. */\n targetX = 0;\n\n /** The focus position. */\n targetY = 0;\n\n /** Current position. */\n x = 0;\n\n /** Current position. */\n y = 0;\n\n /** Current velocity. */\n vx = 0;\n\n /** Current velocity. */\n vy = 0;\n\n /**\n * Sets the focus position.\n * @param x - X position in range `[-1, 1]`.\n * @param y - Y position in range `[-1, 1]`.\n * @param instant - Should the focus position be instantly applied.\n */\n focus(x: number, y: number, instant: boolean = false) {\n this.targetX = clamp(x, -1, 1);\n this.targetY = clamp(y, -1, 1);\n\n if (instant) {\n this.x = this.targetX;\n this.y = this.targetY;\n }\n }\n\n /**\n * Updates the interpolation.\n * @param dt - Delta time in milliseconds.\n */\n update(dt: DOMHighResTimeStamp) {\n const dx = this.targetX - this.x;\n const dy = this.targetY - this.y;\n\n if (Math.abs(dx) < EPSILON && Math.abs(dy) < EPSILON) return;\n\n const d = Math.sqrt(dx ** 2 + dy ** 2);\n const maxSpeed = MAX_SPEED / (1000 / dt);\n\n let ax = maxSpeed * (dx / d) - this.vx;\n let ay = maxSpeed * (dy / d) - this.vy;\n\n const a = Math.sqrt(ax ** 2 + ay ** 2);\n const maxA = maxSpeed * ACCELERATION_TIME * dt;\n\n if (a > maxA) {\n ax *= maxA / a;\n ay *= maxA / a;\n }\n\n this.vx += ax;\n this.vy += ay;\n\n const v = Math.sqrt(this.vx ** 2 + this.vy ** 2);\n const maxV = 0.5 * (Math.sqrt(maxA ** 2 + 8 * maxA * d) - maxA);\n\n if (v > maxV) {\n this.vx *= maxV / v;\n this.vy *= maxV / v;\n }\n\n this.x += this.vx;\n this.y += this.vy;\n }\n}\n","import { Live2DLoaderContext, Live2DLoaderTarget } from '@/factory/Live2DLoader';\nimport { logger } from '@/utils';\nimport { Middleware } from '@/utils/middleware';\n\nconst TAG = 'XHRLoader';\n\nclass NetworkError extends Error {\n constructor(message: string, public url: string, public status: number, public aborted = false) {\n super(message);\n }\n}\n\n/**\n * The basic XHR loader.\n *\n * A network error will be thrown with the following properties:\n * - `url` - The request URL.\n * - `status` - The HTTP status.\n * - `aborted` - True if the error is caused by aborting the XHR.\n */\nexport class XHRLoader {\n /**\n * All the created XHRs, keyed by their owners respectively.\n */\n static xhrMap = new WeakMap<Live2DLoaderTarget, Set<XMLHttpRequest>>();\n\n /**\n * All the created XHRs as a flat array.\n */\n static allXhrSet = new Set<XMLHttpRequest>();\n\n /**\n * Middleware for Live2DLoader.\n */\n static loader: Middleware<Live2DLoaderContext> = (context, next) => {\n return new Promise<void>((resolve, reject) => {\n const xhr = XHRLoader.createXHR(\n context.target,\n context.settings ? context.settings.resolveURL(context.url) : context.url,\n context.type,\n data => {\n context.result = data;\n resolve();\n },\n reject,\n );\n xhr.send();\n });\n };\n\n /**\n * Creates a managed XHR.\n * @param target - If provided, the XHR will be canceled when receiving an \"destroy\" event from the target.\n * @param url - The URL.\n * @param type - The XHR response type.\n * @param onload - Load listener.\n * @param onerror - Error handler.\n */\n static createXHR<T = any>(\n target: Live2DLoaderTarget | undefined,\n url: string,\n type: XMLHttpRequestResponseType,\n onload: (data: T) => void,\n onerror: (e: Error) => void,\n ): XMLHttpRequest {\n const xhr = new XMLHttpRequest();\n\n XHRLoader.allXhrSet.add(xhr);\n\n if (target) {\n let xhrSet = XHRLoader.xhrMap.get(target);\n\n if (!xhrSet) {\n xhrSet = new Set([xhr]);\n XHRLoader.xhrMap.set(target, xhrSet);\n } else {\n xhrSet.add(xhr);\n }\n\n if (!target.listeners('destroy').includes(XHRLoader.cancelXHRs)) {\n target.once('destroy', XHRLoader.cancelXHRs);\n }\n }\n\n xhr.open('GET', url);\n xhr.responseType = type;\n xhr.onload = () => {\n if ((xhr.status === 200 || xhr.status === 0) && xhr.response) {\n onload(xhr.response);\n } else {\n (xhr.onerror as any)();\n }\n };\n xhr.onerror = () => {\n logger.warn(TAG, `Failed to load resource as ${xhr.responseType} (Status ${xhr.status}): ${url}`);\n onerror(new NetworkError('Network error.', url, xhr.status));\n };\n xhr.onabort = () => onerror(new NetworkError('Aborted.', url, xhr.status, true));\n xhr.onloadend = () => {\n XHRLoader.allXhrSet.delete(xhr);\n\n if (target) {\n XHRLoader.xhrMap.get(target)?.delete(xhr);\n }\n };\n\n return xhr;\n }\n\n /**\n * Cancels all XHRs related to this target.\n */\n static cancelXHRs(this: Live2DLoaderTarget) {\n XHRLoader.xhrMap.get(this)?.forEach(xhr => {\n xhr.abort();\n XHRLoader.allXhrSet.delete(xhr);\n });\n XHRLoader.xhrMap.delete(this);\n }\n\n /**\n * Release all XHRs.\n */\n static release() {\n XHRLoader.allXhrSet.forEach(xhr => xhr.abort());\n XHRLoader.allXhrSet.clear();\n XHRLoader.xhrMap = new WeakMap();\n }\n}\n","export type Middleware<T> = (context: T, next: (err?: any) => Promise<void>) => Promise<void>\n\n/**\n * Run middlewares with given context.\n * @see https://github.com/koajs/compose/blob/master/index.js\n *\n * @param middleware\n * @param context\n */\nexport function runMiddlewares<T>(middleware: Middleware<T>[], context: T): Promise<void> {\n // last called middleware #\n let index = -1;\n return dispatch(0);\n\n function dispatch(i: number, err?: Error): Promise<void> {\n if (err) return Promise.reject(err);\n if (i <= index) return Promise.reject(new Error('next() called multiple times'));\n index = i;\n const fn = middleware[i];\n if (!fn) return Promise.resolve();\n try {\n return Promise.resolve(fn(context, dispatch.bind(null, i + 1)));\n } catch (err) {\n return Promise.reject(err);\n }\n }\n}\n","module.exports = __WEBPACK_EXTERNAL_MODULE__20__;","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","module.exports = __WEBPACK_EXTERNAL_MODULE__24__;","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","var isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = toKey;\n","import { InteractionEvent, InteractionManager } from '@pixi/interaction';\nimport { Live2DModel } from './Live2DModel';\n\n/**\n * The interaction control split from Live2DModel class for code clarity. This mixin should *only*\n * be used on the Live2DModel.\n */\nexport class InteractionMixin {\n private _autoInteract = false;\n\n /**\n * Enables automatic interaction. Only takes effect if Pixi's interaction\n * feature has been enabled (by registering the `PIXI.InteractionManager` into `PIXI.Renderer`).\n */\n get autoInteract(): boolean {\n return this._autoInteract;\n }\n\n set autoInteract(autoInteract: boolean) {\n if (autoInteract !== this._autoInteract) {\n if (autoInteract) {\n (this as any as Live2DModel).on('pointertap', onTap, this);\n } else {\n (this as any as Live2DModel).off('pointertap', onTap, this);\n }\n\n this._autoInteract = autoInteract;\n }\n }\n\n /**\n * Local reference used to clean up the event listeners when destroying the model.\n */\n interactionManager?: InteractionManager;\n\n /**\n * Registers interaction by subscribing to the `PIXI.InteractionManager`.\n */\n registerInteraction(this: Live2DModel, manager?: InteractionManager): void {\n if (manager !== this.interactionManager) {\n this.unregisterInteraction();\n\n if (this._autoInteract && manager) {\n this.interactionManager = manager;\n\n manager.on('pointermove', onPointerMove, this);\n }\n }\n }\n\n /**\n * Unregisters interaction.\n */\n unregisterInteraction(this: Live2DModel): void {\n if (this.interactionManager) {\n this.interactionManager?.off('pointermove', onPointerMove, this);\n this.interactionManager = undefined;\n }\n }\n}\n\nfunction onTap(this: Live2DModel, event: InteractionEvent): void {\n this.tap(event.data.global.x, event.data.global.y);\n}\n\nfunction onPointerMove(this: Live2DModel, event: InteractionEvent) {\n this.focus(event.data.global.x, event.data.global.y);\n}\n","import { Transform } from '@pixi/math';\n\n/**\n * Useless class. May be useful in the future.\n */\nexport class Live2DTransform extends Transform {\n}\n","import { InternalModel, ModelSettings, MotionPriority } from '@/cubism-common';\nimport { MotionManagerOptions } from '@/cubism-common/MotionManager';\nimport type { Live2DFactoryOptions } from '@/factory/Live2DFactory';\nimport { Live2DFactory } from '@/factory/Live2DFactory';\nimport { Renderer, Texture } from '@pixi/core';\nimport { Container } from '@pixi/display';\nimport { Matrix, ObservablePoint, Point, Rectangle } from '@pixi/math';\nimport { Ticker } from '@pixi/ticker';\nimport { InteractionMixin } from './InteractionMixin';\nimport { Live2DTransform } from './Live2DTransform';\nimport { applyMixins, logger } from './utils';\n\nexport interface Live2DModelOptions extends MotionManagerOptions {\n /**\n * Should the internal model be automatically updated by `PIXI.Ticker.shared`.\n * @default ture\n */\n autoUpdate?: boolean;\n\n /**\n * Should the internal model automatically reacts to interactions by listening for pointer events.\n * @see {@link InteractionMixin}\n * @default true\n */\n autoInteract?: boolean;\n}\n\nconst tempPoint = new Point();\nconst tempMatrix = new Matrix();\n\n// a reference to Ticker class, defaults to window.PIXI.Ticker (when loaded by a <script> tag)\nlet TickerClass: typeof Ticker | undefined = (window as any).PIXI?.Ticker;\n\nexport interface Live2DModel<IM extends InternalModel = InternalModel> extends InteractionMixin {}\n\nexport type Live2DConstructor = { new(options?: Live2DModelOptions): Live2DModel }\n\n/**\n * A wrapper that allows the Live2D model to be used as a DisplayObject in PixiJS.\n *\n * ```js\n * const model = await Live2DModel.from('shizuku.model.json');\n * container.add(model);\n * ```\n * @emits {@link Live2DModelEvents}\n */\nexport class Live2DModel<IM extends InternalModel = InternalModel> extends Container {\n /**\n * Creates a Live2DModel from given source.\n * @param source - Can be one of: settings file URL, settings JSON object, ModelSettings instance.\n * @param options - Options for the creation.\n * @return Promise that resolves with the Live2DModel.\n */\n static from<M extends Live2DConstructor = typeof Live2DModel>(this: M, source: string | JSONObject | ModelSettings, options?: Live2DFactoryOptions): Promise<InstanceType<M>> {\n const model = new this(options) as InstanceType<M>;\n\n return Live2DFactory.setupLive2DModel(model, source, options).then(() => model);\n }\n\n /**\n * Synchronous version of `Live2DModel.from()`. This method immediately returns a Live2DModel instance,\n * whose resources have not been loaded. Therefore this model can't be manipulated or rendered\n * until the \"load\" event has been emitted.\n *\n * ```js\n * // no `await` here as it's not a Promise\n * const model = Live2DModel.fromSync('shizuku.model.json');\n *\n * // these will cause errors!\n * // app.stage.addChild(model);\n * // model.motion('tap_body');\n *\n * model.once('load', () => {\n * // now it's safe\n * app.stage.addChild(model);\n * model.motion('tap_body');\n * });\n * ```\n */\n static fromSync<M extends Live2DConstructor = typeof Live2DModel>(this: M, source: string | JSONObject | ModelSettings, options?: Live2DFactoryOptions): InstanceType<M> {\n const model = new this(options) as InstanceType<M>;\n\n Live2DFactory.setupLive2DModel(model, source, options).then(options?.onLoad).catch(options?.onError);\n\n return model;\n }\n\n /**\n * Registers the class of `PIXI.Ticker` for auto updating.\n */\n static registerTicker(tickerClass: typeof Ticker): void {\n TickerClass = tickerClass;\n }\n\n /**\n * Tag for logging.\n */\n tag = 'Live2DModel(uninitialized)';\n\n /**\n * The internal model. Though typed as non-nullable, it'll be undefined until the \"ready\" event is emitted.\n */\n internalModel!: IM;\n\n /**\n * Pixi textures.\n */\n textures: Texture[] = [];\n\n /** @override */\n transform = new Live2DTransform();\n\n /**\n * The anchor behaves like the one in `PIXI.Sprite`, where `(0, 0)` means the top left\n * and `(1, 1)` means the bottom right.\n */\n anchor = new ObservablePoint(this.onAnchorChange, this, 0, 0);\n\n /**\n * An ID of Gl context that syncs with `renderer.CONTEXT_UID`. Used to check if the GL context has changed.\n */\n protected glContextID = -1;\n\n /**\n * Elapsed time in milliseconds since created.\n */\n elapsedTime: DOMHighResTimeStamp = performance.now();\n\n /**\n * Elapsed time in milliseconds from last frame to this frame.\n */\n deltaTime: DOMHighResTimeStamp = 0;\n\n protected _autoUpdate = false;\n\n /**\n * Enables automatic updating. Requires {@link Live2DModel.registerTicker} or the global `window.PIXI.Ticker`.\n */\n get autoUpdate() {\n return this._autoUpdate;\n }\n\n set autoUpdate(autoUpdate: boolean) {\n if (autoUpdate) {\n if (!this._destroyed) {\n if (TickerClass) {\n TickerClass.shared.add(this.onTickerUpdate, this);\n\n this._autoUpdate = true;\n } else {\n logger.warn(this.tag, 'No Ticker registered, please call Live2DModel.registerTicker(Ticker).');\n }\n }\n } else {\n TickerClass?.shared.remove(this.onTickerUpdate, this);\n\n this._autoUpdate = false;\n }\n }\n\n constructor(options?: Live2DModelOptions) {\n super();\n\n this.once('modelLoaded', () => this.init(options));\n }\n\n // TODO: rename\n /**\n * A handler of the \"modelLoaded\" event, invoked when the internal model has been loaded.\n */\n protected init(options?: Live2DModelOptions) {\n this.tag = `Live2DModel(${this.internalModel.settings.name})`;\n\n const _options = Object.assign({\n autoUpdate: true,\n autoInteract: true,\n }, options);\n\n if (_options.autoInteract) {\n this.interactive = true;\n }\n\n this.autoInteract = _options.autoInteract;\n this.autoUpdate = _options.autoUpdate;\n }\n\n /**\n * A callback that observes {@link anchor}, invoked when the anchor's values have been changed.\n */\n protected onAnchorChange(): void {\n this.pivot.set(this.anchor.x * this.internalModel.width, this.anchor.y * this.internalModel.height);\n }\n\n /**\n * Shorthand to start a motion.\n * @param group - The motion group.\n * @param index - The index in this group. If not presented, a random motion will be started.\n * @param priority - The motion priority. Defaults to `MotionPriority.NORMAL`.\n * @return Promise that resolves with true if the motion is successfully started, with false otherwise.\n */\n motion(group: string, index?: number, priority?: MotionPriority): Promise<boolean> {\n return index === undefined\n ? this.internalModel.motionManager.startRandomMotion(group, priority)\n : this.internalModel.motionManager.startMotion(group, index, priority);\n }\n\n /**\n * Shorthand to set an expression.\n * @param id - Either the index, or the name of the expression. If not presented, a random expression will be set.\n * @return Promise that resolves with true if succeeded, with false otherwise.\n */\n expression(id?: number | string): Promise<boolean> {\n if (this.internalModel.motionManager.expressionManager) {\n return id === undefined\n ? this.internalModel.motionManager.expressionManager.setRandomExpression()\n : this.internalModel.motionManager.expressionManager.setExpression(id);\n }\n return Promise.resolve(false);\n }\n\n /**\n * Updates the focus position. This will not cause the model to immediately look at the position,\n * instead the movement will be interpolated.\n * @param x - Position in world space.\n * @param y - Position in world space.\n * @param instant - Should the focus position be instantly applied.\n */\n focus(x: number, y: number, instant: boolean = false): void {\n tempPoint.x = x;\n tempPoint.y = y;\n\n // we can pass `true` as the third argument to skip the update transform\n // because focus won't take effect until the model is rendered,\n // and a model being rendered will always get transform updated\n this.toModelPosition(tempPoint, tempPoint, true);\n\n this.internalModel.focusController.focus(\n (tempPoint.x / this.internalModel.originalWidth) * 2 - 1,\n -((tempPoint.y / this.internalModel.originalHeight) * 2 - 1),\n instant,\n );\n }\n\n /**\n * Tap on the model. This will perform a hit-testing, and emit a \"hit\" event\n * if at least one of the hit areas is hit.\n * @param x - Position in world space.\n * @param y - Position in world space.\n * @emits {@link Live2DModelEvents.hit}\n */\n tap(x: number, y: number): void {\n const hitAreaNames = this.hitTest(x, y);\n\n if (hitAreaNames.length) {\n logger.log(this.tag, `Hit`, hitAreaNames);\n\n this.emit('hit', hitAreaNames);\n }\n }\n\n /**\n * Hit-test on the model.\n * @param x - Position in world space.\n * @param y - Position in world space.\n * @return The names of the *hit* hit areas. Can be empty if none is hit.\n */\n hitTest(x: number, y: number): string[] {\n tempPoint.x = x;\n tempPoint.y = y;\n this.toModelPosition(tempPoint, tempPoint);\n\n return this.internalModel.hitTest(tempPoint.x, tempPoint.y);\n }\n\n /**\n * Calculates the position in the canvas of original, unscaled Live2D model.\n * @param position - A Point in world space.\n * @param result - A Point to store the new value. Defaults to a new Point.\n * @param skipUpdate - True to skip the update transform.\n * @return The Point in model canvas space.\n */\n toModelPosition(position: Point, result: Point = position.clone(), skipUpdate?: boolean): Point {\n if (!skipUpdate) {\n this._recursivePostUpdateTransform();\n\n if (!this.parent) {\n (this.parent as any) = this._tempDisplayObjectParent;\n this.displayObjectUpdateTransform();\n (this.parent as any) = null;\n } else {\n this.displayObjectUpdateTransform();\n }\n }\n\n this.transform.worldTransform.applyInverse(position, result);\n this.internalModel.localTransform.applyInverse(result, result);\n\n return result;\n }\n\n /**\n * A method required by `PIXI.InteractionManager` to perform hit-testing.\n * @param point - A Point in world space.\n * @return True if the point is inside this model.\n */\n containsPoint(point: Point): boolean {\n return this.getBounds(true).contains(point.x, point.y);\n }\n\n /** @override */\n protected _calculateBounds(): void {\n this._bounds.addFrame(this.transform, 0, 0, this.internalModel.width, this.internalModel.height);\n }\n\n /**\n * An update callback to be added to `PIXI.Ticker` and invoked every tick.\n */\n onTickerUpdate(): void {\n this.update(TickerClass!.shared.deltaMS);\n }\n\n /**\n * Updates the model. Note this method just updates the timer,\n * and the actual update will be done right before rendering the model.\n * @param dt - The elapsed time in milliseconds since last frame.\n */\n update(dt: DOMHighResTimeStamp): void {\n this.deltaTime += dt;\n this.elapsedTime += dt;\n\n // don't call `this.internalModel.update()` here, because it requires WebGL context\n }\n\n /** @override */\n protected _render(renderer: Renderer): void {\n this.registerInteraction(renderer.plugins.interaction);\n\n // reset certain systems in renderer to make Live2D's drawing system compatible with Pixi\n renderer.batch.reset();\n renderer.geometry.reset();\n renderer.shader.reset();\n renderer.state.reset();\n\n let shouldUpdateTexture = false;\n\n // when the WebGL context has changed\n if (this.glContextID !== (renderer as any).CONTEXT_UID) {\n this.glContextID = (renderer as any).CONTEXT_UID;\n\n this.internalModel.updateWebGLContext(renderer.gl, this.glContextID);\n\n shouldUpdateTexture = true;\n }\n\n for (let i = 0; i < this.textures.length; i++) {\n const texture = this.textures[i]!;\n\n if (!texture.valid) {\n continue;\n }\n\n if (shouldUpdateTexture || !(texture.baseTexture as any)._glTextures[this.glContextID]) {\n renderer.gl.pixelStorei(WebGLRenderingContext.UNPACK_FLIP_Y_WEBGL, this.internalModel.textureFlipY);\n\n // let the TextureSystem generate corresponding WebGLTexture, and bind to an arbitrary location\n renderer.texture.bind(texture.baseTexture, 0);\n }\n\n // bind the WebGLTexture into Live2D core.\n // because the Texture in Pixi can be shared between multiple DisplayObjects,\n // it's unable to know if the WebGLTexture in this Texture has been destroyed (GCed) and regenerated,\n // and therefore we always bind the texture at this moment no matter what\n this.internalModel.bindTexture(i, (texture.baseTexture as any)._glTextures[this.glContextID].texture);\n\n // manually update the GC counter so they won't be GCed while using this model\n (texture.baseTexture as any).touched = renderer.textureGC.count;\n }\n\n const viewport = (renderer.framebuffer as any).viewport as Rectangle;\n this.internalModel.viewport = [viewport.x, viewport.y, viewport.width, viewport.height];\n\n // update only if the time has changed, as the model will possibly be updated once but rendered multiple times\n if (this.deltaTime) {\n this.internalModel.update(this.deltaTime, this.elapsedTime);\n this.deltaTime = 0;\n }\n\n const internalTransform = tempMatrix\n .copyFrom(renderer.globalUniforms.uniforms.projectionMatrix)\n .append(this.worldTransform);\n\n this.internalModel.updateTransform(internalTransform);\n this.internalModel.draw(renderer.gl);\n\n // reset WebGL state and texture bindings\n renderer.state.reset();\n renderer.texture.reset();\n }\n\n /**\n * Destroys the model and all related resources. This takes the same options and also\n * behaves the same as `PIXI.Container#destroy`.\n * @param options - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param [options.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param [options.texture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the texture of the child sprite\n * @param [options.baseTexture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the base texture of the child sprite\n */\n destroy(options?: { children?: boolean, texture?: boolean, baseTexture?: boolean }): void {\n this.emit('destroy');\n\n // the setters will do the cleanup\n this.autoUpdate = false;\n\n this.unregisterInteraction();\n\n if (options?.texture) {\n this.textures.forEach(texture => texture.destroy(options.baseTexture));\n }\n\n this.internalModel.destroy();\n\n super.destroy(options);\n }\n}\n\napplyMixins(Live2DModel, [InteractionMixin]);\n","import { InternalModel, ModelSettings } from '@/cubism-common';\nimport { Live2DFactory, Live2DFactoryContext } from '@/factory';\nimport { Middleware } from '@/utils/middleware';\nimport { url as urlUtils } from '@pixi/utils';\n\ndeclare global {\n interface File {\n webkitRelativePath: string;\n }\n}\n\ndeclare module '@/cubism-common/ModelSettings' {\n interface ModelSettings {\n /** @ignore */\n _objectURL?: string;\n }\n}\n\nexport type ExtendedFileList = File[] & { settings?: ModelSettings }\n\n/**\n * Experimental loader to load resources from uploaded files.\n *\n * This loader relies on\n * [webkitRelativePath](https://developer.mozilla.org/en-US/docs/Web/API/File/webkitRelativePath)\n * to recognize the file path.\n *\n * Though named as a \"Loader\", this class has nothing to do with Live2DLoader,\n * it only contains a middleware for the Live2DFactory.\n */\nexport class FileLoader {\n /**\n * Stores all the object URLs of uploaded files.\n */\n static filesMap: {\n [settingsFileURL: string]: {\n [resourceFileURL: string]: string\n }\n } = {};\n\n /**\n * Resolves the path of a resource file to the object URL.\n * @param settingsURL - Object URL of the settings file.\n * @param filePath - Resource file path.\n * @return Resolved object URL.\n */\n static resolveURL(settingsURL: string, filePath: string): string {\n const resolved = FileLoader.filesMap[settingsURL]?.[filePath];\n\n if (resolved === undefined) {\n throw new Error('Cannot find this file from uploaded files: ' + filePath);\n }\n\n return resolved;\n }\n\n /**\n * Middleware for Live2DFactory.\n */\n static factory: Middleware<Live2DFactoryContext> = async (context, next) => {\n if (Array.isArray(context.source) && context.source[0] instanceof File) {\n const files = context.source as File[];\n\n let settings = (files as ExtendedFileList).settings;\n\n if (!settings) {\n settings = await FileLoader.createSettings(files);\n } else if (!settings._objectURL) {\n throw new Error('\"_objectURL\" must be specified in ModelSettings');\n }\n\n settings.validateFiles(files.map(file => encodeURI(file.webkitRelativePath)));\n\n await FileLoader.upload(files, settings);\n\n // override the default method to resolve URL from uploaded files\n settings.resolveURL = function(url) {\n return FileLoader.resolveURL(this._objectURL!, url);\n };\n\n context.source = settings;\n\n // clean up when destroying the model\n context.live2dModel.once('modelLoaded', (internalModel: InternalModel) => {\n internalModel.once('destroy', function(this: InternalModel) {\n const objectURL = this.settings._objectURL!;\n\n URL.revokeObjectURL(objectURL);\n\n if (FileLoader.filesMap[objectURL]) {\n for (const resourceObjectURL of Object.values(FileLoader.filesMap[objectURL]!)) {\n URL.revokeObjectURL(resourceObjectURL);\n }\n }\n\n delete FileLoader.filesMap[objectURL];\n });\n });\n }\n\n return next();\n };\n\n /**\n * Consumes the files by storing their object URLs. Files not defined in the settings will be ignored.\n */\n static async upload(files: File[], settings: ModelSettings): Promise<void> {\n const fileMap: Record<string, string> = {};\n\n // only consume the files defined in settings\n for (const definedFile of settings.getDefinedFiles()) {\n const actualPath = decodeURI(urlUtils.resolve(settings.url, definedFile));\n\n const actualFile = files.find(file => file.webkitRelativePath === actualPath);\n\n if (actualFile) {\n fileMap[definedFile] = URL.createObjectURL(actualFile);\n }\n }\n\n FileLoader.filesMap[settings._objectURL!] = fileMap;\n }\n\n /**\n * Creates a ModelSettings by given files.\n * @return Promise that resolves with the created ModelSettings.\n */\n static async createSettings(files: File[]): Promise<ModelSettings> {\n const settingsFile = files.find(file => file.name.endsWith('model.json') || file.name.endsWith('model3.json'));\n\n if (!settingsFile) {\n throw new TypeError('Settings file not found');\n }\n\n const settingsText = await FileLoader.readText(settingsFile);\n const settingsJSON = JSON.parse(settingsText);\n\n settingsJSON.url = settingsFile.webkitRelativePath;\n\n const runtime = Live2DFactory.findRuntime(settingsJSON);\n\n if (!runtime) {\n throw new Error('Unknown settings JSON');\n }\n\n const settings = runtime.createModelSettings(settingsJSON);\n\n settings._objectURL = URL.createObjectURL(settingsFile);\n\n return settings;\n }\n\n /**\n * Reads a file as text in UTF-8.\n */\n static async readText(file: File): Promise<string> {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n\n reader.onload = () => resolve(reader.result as string);\n reader.onerror = reject;\n reader.readAsText(file, 'utf8');\n });\n }\n}\n\nLive2DFactory.live2DModelMiddlewares.unshift(FileLoader.factory);\n","import { url as urlUtils } from '@pixi/utils';\nimport { Middleware } from '@/utils/middleware';\nimport { InternalModel, ModelSettings } from '@/cubism-common';\nimport { ExtendedFileList } from './FileLoader';\nimport { Live2DFactory, Live2DFactoryContext } from '@/factory/Live2DFactory';\nimport { Live2DLoader } from '@/factory/Live2DLoader';\n\ntype ZipReader = any;\n\n/**\n * Experimental loader to load resources from a zip file.\n *\n * Though named as a \"Loader\", this class has nothing to do with Live2DLoader,\n * it only contains a middleware for the Live2DFactory.\n */\nexport class ZipLoader {\n static ZIP_PROTOCOL = 'zip://';\n static uid = 0;\n\n static factory: Middleware<Live2DFactoryContext> = async (context, next) => {\n const source = context.source;\n\n let sourceURL: string;\n let zipBlob: Blob | undefined;\n let settings: ModelSettings | undefined;\n\n if (typeof source === 'string' && (source.endsWith('.zip') || source.startsWith(ZipLoader.ZIP_PROTOCOL))) {\n if (source.startsWith(ZipLoader.ZIP_PROTOCOL)) {\n sourceURL = source.slice(ZipLoader.ZIP_PROTOCOL.length);\n } else {\n sourceURL = source;\n }\n\n zipBlob = await Live2DLoader.load({\n url: sourceURL,\n type: 'blob',\n target: context.live2dModel,\n });\n } else if (\n Array.isArray(source)\n && source.length === 1\n && source[0] instanceof File\n && source[0].name.endsWith('.zip')\n ) {\n zipBlob = source[0];\n\n sourceURL = URL.createObjectURL(zipBlob);\n\n settings = (source as ExtendedFileList).settings;\n }\n\n if (zipBlob) {\n if (!zipBlob.size) {\n throw new Error('Empty zip file');\n }\n\n const reader = await ZipLoader.zipReader(zipBlob, sourceURL!);\n\n if (!settings) {\n settings = await ZipLoader.createSettings(reader);\n }\n\n // a fake URL, the only requirement is it should be unique,\n // as FileLoader will use it as the ID of all uploaded files\n settings._objectURL = ZipLoader.ZIP_PROTOCOL + ZipLoader.uid + '/' + settings.url;\n\n const files = await ZipLoader.unzip(reader, settings);\n\n (files as ExtendedFileList).settings = settings;\n\n // pass files to the FileLoader\n context.source = files;\n\n // clean up when destroying the model\n if (sourceURL!.startsWith('blob:')) {\n context.live2dModel.once('modelLoaded', (internalModel: InternalModel) => {\n internalModel.once('destroy', function(this: InternalModel) {\n URL.revokeObjectURL(sourceURL);\n\n });\n });\n }\n\n ZipLoader.releaseReader(reader);\n }\n\n return next();\n };\n\n static async unzip(reader: ZipReader, settings: ModelSettings): Promise<File[]> {\n const filePaths = await ZipLoader.getFilePaths(reader);\n\n const requiredFilePaths: string[] = [];\n\n // only consume the files defined in settings\n for (const definedFile of settings.getDefinedFiles()) {\n const actualPath = decodeURI(urlUtils.resolve(settings.url, definedFile));\n\n if (filePaths.includes(actualPath)) {\n requiredFilePaths.push(actualPath);\n }\n }\n\n const files = await ZipLoader.getFiles(reader, requiredFilePaths);\n\n for (let i = 0; i < files.length; i++) {\n const path = requiredFilePaths[i]!;\n const file = files[i]!;\n\n // let's borrow this property...\n Object.defineProperty(file, 'webkitRelativePath', {\n value: path,\n });\n }\n\n return files;\n }\n\n static async createSettings(reader: ZipReader): Promise<ModelSettings> {\n const filePaths = await ZipLoader.getFilePaths(reader);\n\n const settingsFilePath = filePaths.find(path => path.endsWith('model.json') || path.endsWith('model3.json'));\n\n if (!settingsFilePath) {\n throw new Error('Settings file not found');\n }\n\n const settingsText = await ZipLoader.readText(reader, settingsFilePath);\n\n if (!settingsText) {\n throw new Error('Empty settings file: ' + settingsFilePath);\n }\n\n const settingsJSON = JSON.parse(settingsText);\n\n settingsJSON.url = settingsFilePath;\n\n const runtime = Live2DFactory.findRuntime(settingsJSON);\n\n if (!runtime) {\n throw new Error('Unknown settings JSON');\n }\n\n return runtime.createModelSettings(settingsJSON);\n }\n\n static async zipReader(data: Blob, url: string): Promise<ZipReader> {\n throw new Error('Not implemented');\n }\n\n static async getFilePaths(reader: ZipReader): Promise<string[]> {\n throw new Error('Not implemented');\n }\n\n static async getFiles(reader: ZipReader, paths: string[]): Promise<File[]> {\n throw new Error('Not implemented');\n }\n\n static async readText(reader: ZipReader, path: string): Promise<string> {\n throw new Error('Not implemented');\n }\n\n static releaseReader(reader: ZipReader) {\n // this method is optional\n }\n}\n\nLive2DFactory.live2DModelMiddlewares.unshift(ZipLoader.factory);\n","import { Live2DModel } from '@/Live2DModel';\nimport { Renderer } from '@pixi/core';\nimport { Graphics } from '@pixi/graphics';\nimport { InteractionEvent } from '@pixi/interaction';\nimport { Text, TextStyle } from '@pixi/text';\nimport { Rectangle } from '@pixi/math';\n\nconst tempBounds = new Rectangle();\n\nexport class HitAreaFrames extends Graphics {\n initialized = false;\n\n texts: Text[] = [];\n\n strokeWidth = 4;\n normalColor = 0xE31A1A;\n activeColor = 0x1EC832;\n\n constructor() {\n super();\n\n this.interactive = true;\n\n this.on('added', this.init).on('pointermove', this.onPointerMove);\n }\n\n init() {\n const internalModel = (this.parent as Live2DModel).internalModel;\n\n const textStyle = new TextStyle({\n fontSize: 24,\n fill: '#ffffff',\n stroke: '#000000',\n strokeThickness: 4,\n });\n\n this.texts = Object.keys(internalModel.hitAreas).map(hitAreaName => {\n const text = new Text(hitAreaName, textStyle);\n\n text.visible = false;\n\n this.addChild(text);\n\n return text;\n });\n }\n\n onPointerMove(e: InteractionEvent) {\n const hitAreaNames = (this.parent as Live2DModel).hitTest(e.data.global.x, e.data.global.y);\n\n this.texts.forEach(text => {\n text.visible = hitAreaNames.includes(text.text);\n });\n }\n\n /** @override */\n protected _render(renderer: Renderer): void {\n const internalModel = (this.parent as Live2DModel).internalModel;\n\n // extract scale from the transform matrix, and invert it to ease following calculation\n // https://math.stackexchange.com/a/13165\n const scale = 1 / Math.sqrt(this.transform.worldTransform.a ** 2 + this.transform.worldTransform.b ** 2);\n\n this.texts.forEach(text => {\n (\n // correct the type definition of this method, the official definition is wrong!\n this.lineStyle as any as (options: { width?: number, color?: number }) => void\n )({\n width: this.strokeWidth * scale,\n color: text.visible ? this.activeColor : this.normalColor,\n });\n\n const bounds = internalModel.getDrawableBounds(internalModel.hitAreas[text.text]!.index, tempBounds);\n const transform = internalModel.localTransform;\n\n bounds.x = bounds.x * transform.a + transform.tx;\n bounds.y = bounds.y * transform.d + transform.ty;\n bounds.width = bounds.width * transform.a;\n bounds.height = bounds.height * transform.d;\n\n this.drawRect(bounds.x, bounds.y, bounds.width, bounds.height);\n\n text.x = bounds.x + this.strokeWidth * scale;\n text.y = bounds.y + this.strokeWidth * scale;\n text.scale.set(scale);\n });\n\n super._render(renderer);\n\n this.clear();\n }\n}\n","var baseRest = require('./_baseRest'),\n pullAll = require('./pullAll');\n\n/**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\nvar pull = baseRest(pullAll);\n\nmodule.exports = pull;\n","module.exports = __WEBPACK_EXTERNAL_MODULE__34__;","module.exports = __WEBPACK_EXTERNAL_MODULE__35__;","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n","var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n","var isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nmodule.exports = isKey;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n","var basePullAll = require('./_basePullAll');\n\n/**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\nfunction pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n}\n\nmodule.exports = pullAll;\n","var arrayMap = require('./_arrayMap'),\n baseIndexOf = require('./_baseIndexOf'),\n baseIndexOfWith = require('./_baseIndexOfWith'),\n baseUnary = require('./_baseUnary'),\n copyArray = require('./_copyArray');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\nfunction basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n}\n\nmodule.exports = basePullAll;\n","var baseFindIndex = require('./_baseFindIndex'),\n baseIsNaN = require('./_baseIsNaN'),\n strictIndexOf = require('./_strictIndexOf');\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nmodule.exports = baseIndexOf;\n","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseFindIndex;\n","/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nmodule.exports = baseIsNaN;\n","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = strictIndexOf;\n","/**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseIndexOfWith;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nmodule.exports = copyArray;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n","var SetCache = require('./_SetCache'),\n arraySome = require('./_arraySome'),\n cacheHas = require('./_cacheHas');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalArrays;\n","var isObject = require('./isObject');\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nmodule.exports = isStrictComparable;\n","/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nmodule.exports = matchesStrictComparable;\n","var castPath = require('./_castPath'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nmodule.exports = baseGet;\n","var isArray = require('./isArray'),\n isKey = require('./_isKey'),\n stringToPath = require('./_stringToPath'),\n toString = require('./toString');\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nmodule.exports = castPath;\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\nimport { CubismMatrix44 } from '../math/cubismmatrix44';\nimport { CubismModel } from '../model/cubismmodel';\n\n/**\n * モデル描画を処理するレンダラ\n *\n * サブクラスに環境依存の描画命令を記述する。\n */\nexport abstract class CubismRenderer {\n /**\n * レンダラの初期化処理を実行する\n * 引数に渡したモデルからレンダラの初期化処理に必要な情報を取り出すことができる\n * @param model モデルのインスタンス\n */\n public initialize(model: CubismModel): void {\n this._model = model;\n }\n\n /**\n * モデルを描画する\n */\n public drawModel(): void {\n if (this.getModel() == null) return;\n\n this.doDrawModel();\n }\n\n /**\n * Model-View-Projection 行列をセットする\n * 配列は複製されるので、元の配列は外で破棄して良い\n * @param matrix44 Model-View-Projection 行列\n */\n public setMvpMatrix(matrix44: CubismMatrix44): void {\n this._mvpMatrix4x4.setMatrix(matrix44.getArray());\n }\n\n /**\n * Model-View-Projection 行列を取得する\n * @return Model-View-Projection 行列\n */\n public getMvpMatrix(): CubismMatrix44 {\n return this._mvpMatrix4x4;\n }\n\n /**\n * モデルの色をセットする\n * 各色0.0~1.0の間で指定する(1.0が標準の状態)\n * @param red 赤チャンネルの値\n * @param green 緑チャンネルの値\n * @param blue 青チャンネルの値\n * @param alpha αチャンネルの値\n */\n public setModelColor(\n red: number,\n green: number,\n blue: number,\n alpha: number,\n ): void {\n if (red < 0.0) {\n red = 0.0;\n } else if (red > 1.0) {\n red = 1.0;\n }\n\n if (green < 0.0) {\n green = 0.0;\n } else if (green > 1.0) {\n green = 1.0;\n }\n\n if (blue < 0.0) {\n blue = 0.0;\n } else if (blue > 1.0) {\n blue = 1.0;\n }\n\n if (alpha < 0.0) {\n alpha = 0.0;\n } else if (alpha > 1.0) {\n alpha = 1.0;\n }\n\n this._modelColor.R = red;\n this._modelColor.G = green;\n this._modelColor.B = blue;\n this._modelColor.A = alpha;\n }\n\n /**\n * モデルの色を取得する\n * 各色0.0~1.0の間で指定する(1.0が標準の状態)\n *\n * @return RGBAのカラー情報\n */\n public getModelColor(): CubismTextureColor {\n return Object.assign({}, this._modelColor);\n }\n\n /**\n * 乗算済みαの有効・無効をセットする\n * 有効にするならtrue、無効にするならfalseをセットする\n */\n public setIsPremultipliedAlpha(enable: boolean): void {\n this._isPremultipliedAlpha = enable;\n }\n\n /**\n * 乗算済みαの有効・無効を取得する\n * @return true 乗算済みのα有効\n * @return false 乗算済みのα無効\n */\n public isPremultipliedAlpha(): boolean {\n return this._isPremultipliedAlpha;\n }\n\n /**\n * カリング(片面描画)の有効・無効をセットする。\n * 有効にするならtrue、無効にするならfalseをセットする\n */\n public setIsCulling(culling: boolean): void {\n this._isCulling = culling;\n }\n\n /**\n * カリング(片面描画)の有効・無効を取得する。\n * @return true カリング有効\n * @return false カリング無効\n */\n public isCulling(): boolean {\n return this._isCulling;\n }\n\n /**\n * テクスチャの異方性フィルタリングのパラメータをセットする\n * パラメータ値の影響度はレンダラの実装に依存する\n * @param n パラメータの値\n */\n public setAnisotropy(n: number): void {\n this._anisortopy = n;\n }\n\n /**\n * テクスチャの異方性フィルタリングのパラメータをセットする\n * @return 異方性フィルタリングのパラメータ\n */\n public getAnisotropy(): number {\n return this._anisortopy;\n }\n\n /**\n * レンダリングするモデルを取得する\n * @return レンダリングするモデル\n */\n public getModel(): CubismModel {\n return this._model;\n }\n\n /**\n * コンストラクタ\n */\n protected constructor() {\n this._isCulling = false;\n this._isPremultipliedAlpha = false;\n this._anisortopy = 0.0;\n this._modelColor = new CubismTextureColor();\n\n // 単位行列に初期化\n this._mvpMatrix4x4 = new CubismMatrix44();\n this._mvpMatrix4x4.loadIdentity();\n }\n\n /**\n * モデル描画の実装\n */\n public abstract doDrawModel(): void;\n\n /**\n * 描画オブジェクト(アートメッシュ)を描画する\n * ポリゴンメッシュとテクスチャ番号をセットで渡す。\n * @param textureNo 描画するテクスチャ番号\n * @param indexCount 描画オブジェクトのインデックス値\n * @param vertexCount ポリゴンメッシュの頂点数\n * @param indexArray ポリゴンメッシュ頂点のインデックス配列\n * @param vertexArray ポリゴンメッシュの頂点配列\n * @param uvArray uv配列\n * @param opacity 不透明度\n * @param colorBlendMode カラーブレンディングのタイプ\n * @param invertedMask マスク使用時のマスクの反転使用\n */\n public abstract drawMesh(\n textureNo: number,\n indexCount: number,\n vertexCount: number,\n indexArray: Uint16Array,\n vertexArray: Float32Array,\n uvArray: Float32Array,\n opacity: number,\n colorBlendMode: CubismBlendMode,\n invertedMask: boolean,\n ): void;\n\n /**\n * レンダラが保持する静的なリソースを開放する\n */\n public static staticRelease: Function;\n\n protected _mvpMatrix4x4: CubismMatrix44; // Model-View-Projection 行列\n protected _modelColor: CubismTextureColor; // モデル自体のカラー(RGBA)\n protected _isCulling: boolean; // カリングが有効ならtrue\n protected _isPremultipliedAlpha: boolean; // 乗算済みαならtrue\n protected _anisortopy: any; // テクスチャの異方性フィルタリングのパラメータ\n protected _model!: CubismModel; // レンダリング対象のモデル\n}\n\nexport enum CubismBlendMode {\n CubismBlendMode_Normal = 0, // 通常\n CubismBlendMode_Additive = 1, // 加算\n CubismBlendMode_Multiplicative = 2 // 乗算\n}\n\n/**\n * テクスチャの色をRGBAで扱うためのクラス\n */\nexport class CubismTextureColor {\n /**\n * コンストラクタ\n */\n constructor() {\n this.R = 1.0;\n this.G = 1.0;\n this.B = 1.0;\n this.A = 1.0;\n }\n\n R: number; // 赤チャンネル\n G: number; // 緑チャンネル\n B: number; // 青チャンネル\n A: number; // αチャンネル\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\n/**\n * 2次元ベクトル型\n *\n * 2次元ベクトル型の機能を提供する。\n */\nexport class CubismVector2 {\n x: number;\n y: number;\n\n /**\n * コンストラクタ\n */\n public constructor(x?: number, y?: number) {\n this.x = x || 0;\n this.y = y || 0;\n }\n\n /**\n * ベクトルの加算\n *\n * @param vector2 加算するベクトル値\n * @return 加算結果 ベクトル値\n */\n public add(vector2: CubismVector2): CubismVector2 {\n const ret: CubismVector2 = new CubismVector2(0.0, 0.0);\n ret.x = this.x + vector2.x;\n ret.y = this.y + vector2.y;\n return ret;\n }\n\n /**\n * ベクトルの減算\n *\n * @param vector2 減算するベクトル値\n * @return 減算結果 ベクトル値\n */\n public substract(vector2: CubismVector2): CubismVector2 {\n const ret: CubismVector2 = new CubismVector2(0.0, 0.0);\n ret.x = this.x - vector2.x;\n ret.y = this.y - vector2.y;\n return ret;\n }\n\n /**\n * ベクトルの乗算\n *\n * @param vector2 乗算するベクトル値\n * @return 乗算結果 ベクトル値\n */\n public multiply(vector2: CubismVector2): CubismVector2 {\n const ret: CubismVector2 = new CubismVector2(0.0, 0.0);\n ret.x = this.x * vector2.x;\n ret.y = this.y * vector2.y;\n return ret;\n }\n\n /**\n * ベクトルの乗算(スカラー)\n *\n * @param scalar 乗算するスカラー値\n * @return 乗算結果 ベクトル値\n */\n public multiplyByScaler(scalar: number): CubismVector2 {\n return this.multiply(new CubismVector2(scalar, scalar));\n }\n\n /**\n * ベクトルの除算\n *\n * @param vector2 除算するベクトル値\n * @return 除算結果 ベクトル値\n */\n public division(vector2: CubismVector2): CubismVector2 {\n const ret: CubismVector2 = new CubismVector2(0.0, 0.0);\n ret.x = this.x / vector2.x;\n ret.y = this.y / vector2.y;\n return ret;\n }\n\n /**\n * ベクトルの除算(スカラー)\n *\n * @param scalar 除算するスカラー値\n * @return 除算結果 ベクトル値\n */\n public divisionByScalar(scalar: number): CubismVector2 {\n return this.division(new CubismVector2(scalar, scalar));\n }\n\n /**\n * ベクトルの長さを取得する\n *\n * @return ベクトルの長さ\n */\n public getLength(): number {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }\n\n /**\n * ベクトルの距離の取得\n *\n * @param a 点\n * @return ベクトルの距離\n */\n public getDistanceWith(a: CubismVector2): number {\n return Math.sqrt(\n (this.x - a.x) * (this.x - a.x) + (this.y - a.y) * (this.y - a.y),\n );\n }\n\n /**\n * ドット積の計算\n *\n * @param a 値\n * @return 結果\n */\n public dot(a: CubismVector2): number {\n return this.x * a.x + this.y * a.y;\n }\n\n /**\n * 正規化の適用\n */\n public normalize(): void {\n const length: number = Math.pow(this.x * this.x + this.y * this.y, 0.5);\n\n this.x = this.x / length;\n this.y = this.y / length;\n }\n\n /**\n * 等しさの確認(等しいか?)\n *\n * 値が等しいか?\n *\n * @param rhs 確認する値\n * @return true 値は等しい\n * @return false 値は等しくない\n */\n public isEqual(rhs: CubismVector2): boolean {\n return this.x == rhs.x && this.y == rhs.y;\n }\n\n /**\n * 等しさの確認(等しくないか?)\n *\n * 値が等しくないか?\n *\n * @param rhs 確認する値\n * @return true 値は等しくない\n * @return false 値は等しい\n */\n public isNotEqual(rhs: CubismVector2): boolean {\n return !this.isEqual(rhs);\n }\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\nimport { CubismVector2 } from './cubismvector2';\n\n /**\n * 数値計算などに使用するユーティリティクラス\n */\n export class CubismMath {\n /**\n * 第一引数の値を最小値と最大値の範囲に収めた値を返す\n *\n * @param value 収められる値\n * @param min 範囲の最小値\n * @param max 範囲の最大値\n * @return 最小値と最大値の範囲に収めた値\n */\n static range(value: number, min: number, max: number): number {\n if (value < min) {\n value = min;\n } else if (value > max) {\n value = max;\n }\n\n return value;\n }\n\n /**\n * サイン関数の値を求める\n *\n * @param x 角度値(ラジアン)\n * @return サイン関数sin(x)の値\n */\n static sin(x: number): number {\n return Math.sin(x);\n }\n\n /**\n * コサイン関数の値を求める\n *\n * @param x 角度値(ラジアン)\n * @return コサイン関数cos(x)の値\n */\n static cos(x: number): number {\n return Math.cos(x);\n }\n\n /**\n * 値の絶対値を求める\n *\n * @param x 絶対値を求める値\n * @return 値の絶対値\n */\n static abs(x: number): number {\n return Math.abs(x);\n }\n\n /**\n * 平方根(ルート)を求める\n * @param x -> 平方根を求める値\n * @return 値の平方根\n */\n static sqrt(x: number): number {\n return Math.sqrt(x);\n }\n\n /**\n * イージング処理されたサインを求める\n * フェードイン・アウト時のイージングに利用できる\n *\n * @param value イージングを行う値\n * @return イージング処理されたサイン値\n */\n static getEasingSine(value: number): number {\n if (value < 0.0) {\n return 0.0;\n } else if (value > 1.0) {\n return 1.0;\n }\n\n return 0.5 - 0.5 * this.cos(value * Math.PI);\n }\n\n /**\n * 大きい方の値を返す\n *\n * @param left 左辺の値\n * @param right 右辺の値\n * @return 大きい方の値\n */\n static max(left: number, right: number): number {\n return left > right ? left : right;\n }\n\n /**\n * 小さい方の値を返す\n *\n * @param left 左辺の値\n * @param right 右辺の値\n * @return 小さい方の値\n */\n static min(left: number, right: number): number {\n return left > right ? right : left;\n }\n\n /**\n * 角度値をラジアン値に変換する\n *\n * @param degrees 角度値\n * @return 角度値から変換したラジアン値\n */\n static degreesToRadian(degrees: number): number {\n return (degrees / 180.0) * Math.PI;\n }\n\n /**\n * ラジアン値を角度値に変換する\n *\n * @param radian ラジアン値\n * @return ラジアン値から変換した角度値\n */\n static radianToDegrees(radian: number): number {\n return (radian * 180.0) / Math.PI;\n }\n\n /**\n * 2つのベクトルからラジアン値を求める\n *\n * @param from 始点ベクトル\n * @param to 終点ベクトル\n * @return ラジアン値から求めた方向ベクトル\n */\n static directionToRadian(from: CubismVector2, to: CubismVector2): number {\n const q1: number = Math.atan2(to.y, to.x);\n const q2: number = Math.atan2(from.y, from.x);\n\n let ret: number = q1 - q2;\n\n while (ret < -Math.PI) {\n ret += Math.PI * 2.0;\n }\n\n while (ret > Math.PI) {\n ret -= Math.PI * 2.0;\n }\n\n return ret;\n }\n\n /**\n * 2つのベクトルから角度値を求める\n *\n * @param from 始点ベクトル\n * @param to 終点ベクトル\n * @return 角度値から求めた方向ベクトル\n */\n static directionToDegrees(from: CubismVector2, to: CubismVector2): number {\n const radian: number = this.directionToRadian(from, to);\n let degree: number = this.radianToDegrees(radian);\n\n if (to.x - from.x > 0.0) {\n degree = -degree;\n }\n\n return degree;\n }\n\n /**\n * ラジアン値を方向ベクトルに変換する。\n *\n * @param totalAngle ラジアン値\n * @return ラジアン値から変換した方向ベクトル\n */\n\n static radianToDirection(totalAngle: number): CubismVector2 {\n const ret: CubismVector2 = new CubismVector2();\n\n ret.x = this.sin(totalAngle);\n ret.y = this.cos(totalAngle);\n\n return ret;\n }\n\n /**\n * コンストラクタ\n */\n private constructor() {}\n }\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\n/**\n * 4x4の行列\n *\n * 4x4行列の便利クラス。\n */\nexport class CubismMatrix44 {\n /**\n * コンストラクタ\n */\n public constructor() {\n this._tr = new Float32Array(16); // 4 * 4のサイズ\n this.loadIdentity();\n }\n\n /**\n * 受け取った2つの行列の乗算を行う。\n *\n * @param a 行列a\n * @param b 行列b\n * @return 乗算結果の行列\n */\n public static multiply(\n a: Float32Array,\n b: Float32Array,\n dst: Float32Array,\n ): void {\n const c: Float32Array = new Float32Array([\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n ]);\n\n const n = 4;\n\n for (let i = 0; i < n; ++i) {\n for (let j = 0; j < n; ++j) {\n for (let k = 0; k < n; ++k) {\n c[j + i * 4] += a[k + i * 4] * b[j + k * 4];\n }\n }\n }\n\n for (let i = 0; i < 16; ++i) {\n dst[i] = c[i];\n }\n }\n\n /**\n * 単位行列に初期化する\n */\n public loadIdentity(): void {\n const c: Float32Array = new Float32Array([\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0,\n ]);\n\n this.setMatrix(c);\n }\n\n /**\n * 行列を設定\n *\n * @param tr 16個の浮動小数点数で表される4x4の行列\n */\n public setMatrix(tr: Float32Array): void {\n for (let i = 0; i < 16; ++i) {\n this._tr[i] = tr[i];\n }\n }\n\n /**\n * 行列を浮動小数点数の配列で取得\n *\n * @return 16個の浮動小数点数で表される4x4の行列\n */\n public getArray(): Float32Array {\n return this._tr;\n }\n\n /**\n * X軸の拡大率を取得\n * @return X軸の拡大率\n */\n public getScaleX(): number {\n return this._tr[0];\n }\n\n /**\n * Y軸の拡大率を取得する\n *\n * @return Y軸の拡大率\n */\n public getScaleY(): number {\n return this._tr[5];\n }\n\n /**\n * X軸の移動量を取得\n * @return X軸の移動量\n */\n public getTranslateX(): number {\n return this._tr[12];\n }\n\n /**\n * Y軸の移動量を取得\n * @return Y軸の移動量\n */\n public getTranslateY(): number {\n return this._tr[13];\n }\n\n /**\n * X軸の値を現在の行列で計算\n *\n * @param src X軸の値\n * @return 現在の行列で計算されたX軸の値\n */\n public transformX(src: number): number {\n return this._tr[0] * src + this._tr[12];\n }\n\n /**\n * Y軸の値を現在の行列で計算\n *\n * @param src Y軸の値\n * @return 現在の行列で計算されたY軸の値\n */\n public transformY(src: number): number {\n return this._tr[5] * src + this._tr[13];\n }\n\n /**\n * X軸の値を現在の行列で逆計算\n */\n public invertTransformX(src: number): number {\n return (src - this._tr[12]) / this._tr[0];\n }\n\n /**\n * Y軸の値を現在の行列で逆計算\n */\n public invertTransformY(src: number): number {\n return (src - this._tr[13]) / this._tr[5];\n }\n\n /**\n * 現在の行列の位置を起点にして移動\n *\n * 現在の行列の位置を起点にして相対的に移動する。\n *\n * @param x X軸の移動量\n * @param y Y軸の移動量\n */\n public translateRelative(x: number, y: number): void {\n const tr1: Float32Array = new Float32Array([\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0,\n 0.0,\n x,\n y,\n 0.0,\n 1.0,\n ]);\n\n CubismMatrix44.multiply(tr1, this._tr, this._tr);\n }\n\n /**\n * 現在の行列の位置を移動\n *\n * 現在の行列の位置を指定した位置へ移動する\n *\n * @param x X軸の移動量\n * @param y y軸の移動量\n */\n public translate(x: number, y: number): void {\n this._tr[12] = x;\n this._tr[13] = y;\n }\n\n /**\n * 現在の行列のX軸の位置を指定した位置へ移動する\n *\n * @param x X軸の移動量\n */\n public translateX(x: number): void {\n this._tr[12] = x;\n }\n\n /**\n * 現在の行列のY軸の位置を指定した位置へ移動する\n *\n * @param y Y軸の移動量\n */\n public translateY(y: number): void {\n this._tr[13] = y;\n }\n\n /**\n * 現在の行列の拡大率を相対的に設定する\n *\n * @param x X軸の拡大率\n * @param y Y軸の拡大率\n */\n public scaleRelative(x: number, y: number): void {\n const tr1: Float32Array = new Float32Array([\n x,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n y,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0,\n ]);\n\n CubismMatrix44.multiply(tr1, this._tr, this._tr);\n }\n\n /**\n * 現在の行列の拡大率を指定した倍率に設定する\n *\n * @param x X軸の拡大率\n * @param y Y軸の拡大率\n */\n public scale(x: number, y: number): void {\n this._tr[0] = x;\n this._tr[5] = y;\n }\n\n /**\n * 現在の行列に行列を乗算\n *\n * @param m 行列\n */\n public multiplyByMatrix(m: CubismMatrix44): void {\n CubismMatrix44.multiply(m.getArray(), this._tr, this._tr);\n }\n\n /**\n * オブジェクトのコピーを生成する\n */\n public clone(): CubismMatrix44 {\n const cloneMatrix: CubismMatrix44 = new CubismMatrix44();\n\n for (let i = 0; i < this._tr.length; i++) {\n cloneMatrix._tr[i] = this._tr[i];\n }\n\n return cloneMatrix;\n }\n\n protected _tr: Float32Array; // 4x4行列データ\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\nimport { CubismRenderer } from './rendering/cubismrenderer';\nimport { CubismLogInfo, CubismLogWarning } from './utils/cubismdebug';\n\n// ファイルスコープの変数を初期化\n\nlet s_isStarted = false;\nlet s_isInitialized = false;\nlet s_option: CubismStartupOption | undefined = undefined;\n\n/**\n * Framework内で使う定数の宣言\n */\nexport namespace Constant {\n export const vertexOffset = 0; // メッシュ頂点のオフセット値\n export const vertexStep = 2; // メッシュ頂点のステップ値\n}\n\n/**\n * Live2D Cubism SDK Original Workflow SDKのエントリポイント\n * 利用開始時はCubismFramework.initialize()を呼び、CubismFramework.dispose()で終了する。\n */\nexport class CubismFramework {\n /**\n * Cubism FrameworkのAPIを使用可能にする。\n * APIを実行する前に必ずこの関数を実行すること。\n * 一度準備が完了して以降は、再び実行しても内部処理がスキップされます。\n *\n * @param option Optionクラスのインスタンス\n *\n * @return 準備処理が完了したらtrueが返ります。\n */\n public static startUp(option?: CubismStartupOption): boolean {\n if (s_isStarted) {\n CubismLogInfo('CubismFramework.startUp() is already done.');\n return s_isStarted;\n }\n\n if ((Live2DCubismCore as any)._isStarted) {\n s_isStarted = true;\n return true;\n }\n\n (Live2DCubismCore as any)._isStarted = true;\n\n s_option = option;\n\n if (s_option) {\n Live2DCubismCore.Logging.csmSetLogFunction(s_option.logFunction);\n }\n\n s_isStarted = true;\n\n // Live2D Cubism Coreバージョン情報を表示\n if (s_isStarted) {\n const version: number = Live2DCubismCore.Version.csmGetVersion();\n const major: number = (version & 0xff000000) >> 24;\n const minor: number = (version & 0x00ff0000) >> 16;\n const patch: number = version & 0x0000ffff;\n const versionNumber: number = version;\n\n CubismLogInfo(\n `Live2D Cubism Core version: {0}.{1}.{2} ({3})`,\n ('00' + major).slice(-2),\n ('00' + minor).slice(-2),\n ('0000' + patch).slice(-4),\n versionNumber,\n );\n }\n\n CubismLogInfo('CubismFramework.startUp() is complete.');\n\n return s_isStarted;\n }\n\n /**\n * StartUp()で初期化したCubismFrameworkの各パラメータをクリアします。\n * Dispose()したCubismFrameworkを再利用する際に利用してください。\n */\n public static cleanUp(): void {\n s_isStarted = false;\n s_isInitialized = false;\n s_option = undefined;\n }\n\n /**\n * Cubism Framework内のリソースを初期化してモデルを表示可能な状態にします。<br>\n * 再度Initialize()するには先にDispose()を実行する必要があります。\n */\n public static initialize(): void {\n if (!s_isStarted) {\n CubismLogWarning('CubismFramework is not started.');\n return;\n }\n\n // --- s_isInitializedによる連続初期化ガード ---\n // 連続してリソース確保が行われないようにする。\n // 再度Initialize()するには先にDispose()を実行する必要がある。\n if (s_isInitialized) {\n CubismLogWarning(\n 'CubismFramework.initialize() skipped, already initialized.',\n );\n return;\n }\n\n s_isInitialized = true;\n\n CubismLogInfo('CubismFramework.initialize() is complete.');\n }\n\n /**\n * Cubism Framework内の全てのリソースを解放します。\n * ただし、外部で確保されたリソースについては解放しません。\n * 外部で適切に破棄する必要があります。\n */\n public static dispose(): void {\n if (!s_isStarted) {\n CubismLogWarning('CubismFramework is not started.');\n return;\n }\n\n // --- s_isInitializedによる未初期化解放ガード ---\n // dispose()するには先にinitialize()を実行する必要がある。\n if (!s_isInitialized) {\n // false...リソース未確保の場合\n CubismLogWarning('CubismFramework.dispose() skipped, not initialized.');\n return;\n }\n\n // レンダラの静的リソース(シェーダプログラム他)を解放する\n CubismRenderer.staticRelease();\n\n s_isInitialized = false;\n\n CubismLogInfo('CubismFramework.dispose() is complete.');\n }\n\n /**\n * Cubism FrameworkのAPIを使用する準備が完了したかどうか\n * @return APIを使用する準備が完了していればtrueが返ります。\n */\n public static isStarted(): boolean {\n return s_isStarted;\n }\n\n /**\n * Cubism Frameworkのリソース初期化がすでに行われているかどうか\n * @return リソース確保が完了していればtrueが返ります\n */\n public static isInitialized(): boolean {\n return s_isInitialized;\n }\n\n /**\n * Core APIにバインドしたログ関数を実行する\n *\n * @praram message ログメッセージ\n */\n public static coreLogFunction(message: string): void {\n // Return if logging not possible.\n if (!Live2DCubismCore.Logging.csmGetLogFunction()) {\n return;\n }\n\n Live2DCubismCore.Logging.csmGetLogFunction()(message);\n }\n\n /**\n * 現在のログ出力レベル設定の値を返す。\n *\n * @return 現在のログ出力レベル設定の値\n */\n public static getLoggingLevel(): LogLevel {\n if (s_option != null) {\n return s_option.loggingLevel;\n }\n return LogLevel.LogLevel_Off;\n }\n\n /**\n * 静的クラスとして使用する\n * インスタンス化させない\n */\n private constructor() {}\n}\n\nexport interface CubismStartupOption {\n logFunction: Live2DCubismCore.csmLogFunction; // ログ出力の関数オブジェクト\n loggingLevel: LogLevel; // ログ出力レベルの設定\n}\n\n/**\n * ログ出力のレベル\n */\nexport enum LogLevel {\n LogLevel_Verbose = 0, // 詳細ログ\n LogLevel_Debug, // デバッグログ\n LogLevel_Info, // Infoログ\n LogLevel_Warning, // 警告ログ\n LogLevel_Error, // エラーログ\n LogLevel_Off // ログ出力無効\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\nimport { CubismFramework, LogLevel } from '../live2dcubismframework';\n\nexport const CSM_ASSERT = process.env.NODE_ENV === 'production' ? () => {} : (expr: any) => console.assert(expr);\n\nexport function CubismLogVerbose(fmt: string, ...args: any[]) {\n CubismDebug.print(LogLevel.LogLevel_Verbose, '[CSM][V]' + fmt + '\\n', args);\n}\n\nexport function CubismLogDebug(fmt: string, ...args: any[]) {\n CubismDebug.print(LogLevel.LogLevel_Debug, '[CSM][D]' + fmt + '\\n', args);\n}\n\nexport function CubismLogInfo(fmt: string, ...args: any[]) {\n CubismDebug.print(LogLevel.LogLevel_Info, '[CSM][I]' + fmt + '\\n', args);\n}\n\nexport function CubismLogWarning(fmt: string, ...args: any[]) {\n CubismDebug.print(LogLevel.LogLevel_Warning, '[CSM][W]' + fmt + '\\n', args);\n}\n\nexport function CubismLogError(fmt: string, ...args: any[]) {\n CubismDebug.print(LogLevel.LogLevel_Error, '[CSM][E]' + fmt + '\\n', args);\n}\n\n/**\n * デバッグ用のユーティリティクラス。\n * ログの出力、バイトのダンプなど\n */\nexport class CubismDebug {\n /**\n * ログを出力する。第一引数にログレベルを設定する。\n * CubismFramework.initialize()時にオプションで設定されたログ出力レベルを下回る場合はログに出さない。\n *\n * @param logLevel ログレベルの設定\n * @param format 書式付き文字列\n * @param args 可変長引数\n */\n public static print(\n logLevel: LogLevel,\n format: string,\n args?: any[],\n ): void {\n // オプションで設定されたログ出力レベルを下回る場合はログに出さない\n if (logLevel < CubismFramework.getLoggingLevel()) {\n return;\n }\n\n const logPrint: Live2DCubismCore.csmLogFunction = CubismFramework.coreLogFunction;\n\n if (!logPrint) return;\n\n const buffer: string = format.replace(/{(\\d+)}/g, (m, k) => {\n return args![k];\n });\n logPrint(buffer);\n }\n\n /**\n * データから指定した長さだけダンプ出力する。\n * CubismFramework.initialize()時にオプションで設定されたログ出力レベルを下回る場合はログに出さない。\n *\n * @param logLevel ログレベルの設定\n * @param data ダンプするデータ\n * @param length ダンプする長さ\n */\n public static dumpBytes(\n logLevel: LogLevel,\n data: Uint8Array,\n length: number,\n ): void {\n for (let i = 0; i < length; i++) {\n if (i % 16 == 0 && i > 0) this.print(logLevel, '\\n');\n else if (i % 8 == 0 && i > 0) this.print(logLevel, ' ');\n this.print(logLevel, '{0} ', [data[i] & 0xff]);\n }\n\n this.print(logLevel, '\\n');\n }\n\n /**\n * private コンストラクタ\n */\n private constructor() {}\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\nimport { CubismMath } from '../math/cubismmath';\nimport { CubismModel } from '../model/cubismmodel';\nimport { CSM_ASSERT } from '../utils/cubismdebug';\nimport { CubismMotionQueueEntry } from './cubismmotionqueueentry';\n\n/**\n * モーションの抽象基底クラス\n *\n * モーションの抽象基底クラス。MotionQueueManagerによってモーションの再生を管理する。\n */\nexport abstract class ACubismMotion {\n /**\n * コンストラクタ\n */\n public constructor() {\n this._fadeInSeconds = -1.0;\n this._fadeOutSeconds = -1.0;\n this._weight = 1.0;\n this._offsetSeconds = 0.0; // 再生の開始時刻\n this._firedEventValues = [];\n }\n\n /**\n * デストラクタ相当の処理\n */\n public release(): void {\n this._weight = 0.0;\n }\n\n /**\n * モデルのパラメータ\n * @param model 対象のモデル\n * @param motionQueueEntry CubismMotionQueueManagerで管理されているモーション\n * @param userTimeSeconds デルタ時間の積算値[秒]\n */\n public updateParameters(\n model: CubismModel,\n motionQueueEntry: CubismMotionQueueEntry,\n userTimeSeconds: number,\n ): void {\n if (!motionQueueEntry.isAvailable() || motionQueueEntry.isFinished()) {\n return;\n }\n\n if (!motionQueueEntry.isStarted()) {\n motionQueueEntry.setIsStarted(true);\n motionQueueEntry.setStartTime(userTimeSeconds - this._offsetSeconds); // モーションの開始時刻を記録\n motionQueueEntry.setFadeInStartTime(userTimeSeconds); // フェードインの開始時刻\n\n const duration: number = this.getDuration();\n\n if (motionQueueEntry.getEndTime() < 0) {\n // 開始していないうちに終了設定している場合がある。\n motionQueueEntry.setEndTime(\n duration <= 0 ? -1 : motionQueueEntry.getStartTime() + duration,\n );\n // duration == -1 の場合はループする\n }\n }\n\n let fadeWeight: number = this._weight; // 現在の値と掛け合わせる割合\n\n //---- フェードイン・アウトの処理 ----\n // 単純なサイン関数でイージングする\n const fadeIn: number =\n this._fadeInSeconds == 0.0\n ? 1.0\n : CubismMath.getEasingSine(\n (userTimeSeconds - motionQueueEntry.getFadeInStartTime()) /\n this._fadeInSeconds,\n );\n\n const fadeOut: number =\n this._fadeOutSeconds == 0.0 || motionQueueEntry.getEndTime() < 0.0\n ? 1.0\n : CubismMath.getEasingSine(\n (motionQueueEntry.getEndTime() - userTimeSeconds) /\n this._fadeOutSeconds,\n );\n\n fadeWeight = fadeWeight * fadeIn * fadeOut;\n\n motionQueueEntry.setState(userTimeSeconds, fadeWeight);\n\n CSM_ASSERT(0.0 <= fadeWeight && fadeWeight <= 1.0);\n\n //---- 全てのパラメータIDをループする ----\n this.doUpdateParameters(\n model,\n userTimeSeconds,\n fadeWeight,\n motionQueueEntry,\n );\n\n // 後処理\n // 終了時刻を過ぎたら終了フラグを立てる(CubismMotionQueueManager)\n if (\n motionQueueEntry.getEndTime() > 0 &&\n motionQueueEntry.getEndTime() < userTimeSeconds\n ) {\n motionQueueEntry.setIsFinished(true); // 終了\n }\n }\n\n /**\n * フェードインの時間を設定する\n * @param fadeInSeconds フェードインにかかる時間[秒]\n */\n public setFadeInTime(fadeInSeconds: number): void {\n this._fadeInSeconds = fadeInSeconds;\n }\n\n /**\n * フェードアウトの時間を設定する\n * @param fadeOutSeconds フェードアウトにかかる時間[秒]\n */\n public setFadeOutTime(fadeOutSeconds: number): void {\n this._fadeOutSeconds = fadeOutSeconds;\n }\n\n /**\n * フェードアウトにかかる時間の取得\n * @return フェードアウトにかかる時間[秒]\n */\n public getFadeOutTime(): number {\n return this._fadeOutSeconds;\n }\n\n /**\n * フェードインにかかる時間の取得\n * @return フェードインにかかる時間[秒]\n */\n public getFadeInTime(): number {\n return this._fadeInSeconds;\n }\n\n /**\n * モーション適用の重みの設定\n * @param weight 重み(0.0 - 1.0)\n */\n public setWeight(weight: number): void {\n this._weight = weight;\n }\n\n /**\n * モーション適用の重みの取得\n * @return 重み(0.0 - 1.0)\n */\n public getWeight(): number {\n return this._weight;\n }\n\n /**\n * モーションの長さの取得\n * @return モーションの長さ[秒]\n *\n * @note ループの時は「-1」。\n * ループでない場合は、オーバーライドする。\n * 正の値の時は取得される時間で終了する。\n * 「-1」の時は外部から停止命令がない限り終わらない処理となる。\n */\n public getDuration(): number {\n return -1.0;\n }\n\n /**\n * モーションのループ1回分の長さの取得\n * @return モーションのループ一回分の長さ[秒]\n *\n * @note ループしない場合は、getDuration()と同じ値を返す\n * ループ一回分の長さが定義できない場合(プログラム的に動き続けるサブクラスなど)の場合は「-1」を返す\n */\n public getLoopDuration(): number {\n return -1.0;\n }\n\n /**\n * モーション再生の開始時刻の設定\n * @param offsetSeconds モーション再生の開始時刻[秒]\n */\n public setOffsetTime(offsetSeconds: number): void {\n this._offsetSeconds = offsetSeconds;\n }\n\n /**\n * モデルのパラメータ更新\n *\n * イベント発火のチェック。\n * 入力する時間は呼ばれるモーションタイミングを0とした秒数で行う。\n *\n * @param beforeCheckTimeSeconds 前回のイベントチェック時間[秒]\n * @param motionTimeSeconds 今回の再生時間[秒]\n */\n public getFiredEvent(\n beforeCheckTimeSeconds: number,\n motionTimeSeconds: number,\n ): string[] {\n return this._firedEventValues;\n }\n\n /**\n * モーションを更新して、モデルにパラメータ値を反映する\n * @param model 対象のモデル\n * @param userTimeSeconds デルタ時間の積算値[秒]\n * @param weight モーションの重み\n * @param motionQueueEntry CubismMotionQueueManagerで管理されているモーション\n * @return true モデルへパラメータ値の反映あり\n * @return false モデルへのパラメータ値の反映なし(モーションの変化なし)\n */\n public abstract doUpdateParameters(\n model: CubismModel,\n userTimeSeconds: number,\n weight: number,\n motionQueueEntry: CubismMotionQueueEntry,\n ): void;\n\n /**\n * モーション再生終了コールバックの登録\n *\n * モーション再生終了コールバックを登録する。\n * isFinishedフラグを設定するタイミングで呼び出される。\n * 以下の状態の際には呼び出されない:\n * 1. 再生中のモーションが「ループ」として設定されているとき\n * 2. コールバックが登録されていない時\n *\n * @param onFinishedMotionHandler モーション再生終了コールバック関数\n */\n public setFinishedMotionHandler(\n onFinishedMotionHandler?: (self: ACubismMotion) => void,\n ) {\n this._onFinishedMotion = onFinishedMotionHandler;\n };\n\n /**\n * モーション再生終了コールバックの取得\n *\n * モーション再生終了コールバックを取得する。\n *\n * @return 登録されているモーション再生終了コールバック関数\n */\n public getFinishedMotionHandler() {\n return this._onFinishedMotion;\n };\n\n public _fadeInSeconds: number; // フェードインにかかる時間[秒]\n public _fadeOutSeconds: number; // フェードアウトにかかる時間[秒]\n public _weight: number; // モーションの重み\n public _offsetSeconds: number; // モーション再生の開始時間[秒]\n\n public _firedEventValues: string[];\n\n // モーション再生終了コールバック関数\n public _onFinishedMotion?: (self: ACubismMotion) => void;\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\nimport { CubismModel } from '../model/cubismmodel';\nimport { ACubismMotion } from './acubismmotion';\nimport { CubismMotionQueueEntry } from './cubismmotionqueueentry';\n\n// exp3.jsonのキーとデフォルト\nconst DefaultFadeTime = 1.0;\n\n/**\n * 表情のモーション\n *\n * 表情のモーションクラス。\n */\nexport class CubismExpressionMotion extends ACubismMotion {\n /**\n * インスタンスを作成する。\n * @param json expファイルが読み込まれているバッファ\n * @param size バッファのサイズ\n * @return 作成されたインスタンス\n */\n public static create(json: CubismSpec.ExpressionJSON): CubismExpressionMotion {\n const expression: CubismExpressionMotion = new CubismExpressionMotion();\n\n const fadeInTime = json.FadeInTime;\n const fadeOutTime = json.FadeOutTime;\n\n expression.setFadeInTime(fadeInTime !== undefined ? fadeInTime : DefaultFadeTime); // フェードイン\n expression.setFadeOutTime(fadeOutTime !== undefined ? fadeOutTime : DefaultFadeTime); // フェードアウト\n\n // 各パラメータについて\n const parameters = json.Parameters || [];\n\n for (let i = 0; i < parameters.length; ++i) {\n const param = parameters[i];\n const parameterId: string = param.Id; // パラメータID\n\n const value: number = param.Value; // 値\n\n // 計算方法の設定\n let blendType: ExpressionBlendType;\n\n switch (param.Blend) {\n case 'Multiply':\n blendType = ExpressionBlendType.ExpressionBlendType_Multiply;\n break;\n\n case 'Overwrite':\n blendType = ExpressionBlendType.ExpressionBlendType_Overwrite;\n break;\n\n case 'Add':\n // その他 仕様にない値を設定した時は加算モードにすることで復旧\n default:\n blendType = ExpressionBlendType.ExpressionBlendType_Add;\n break;\n }\n\n // 設定オブジェクトを作成してリストに追加する\n const item: ExpressionParameter = {\n parameterId: parameterId,\n blendType: blendType,\n value: value,\n };\n\n expression._parameters.push(item);\n }\n\n return expression;\n }\n\n /**\n * モデルのパラメータの更新の実行\n * @param model 対象のモデル\n * @param userTimeSeconds デルタ時間の積算値[秒]\n * @param weight モーションの重み\n * @param motionQueueEntry CubismMotionQueueManagerで管理されているモーション\n */\n public doUpdateParameters(\n model: CubismModel,\n userTimeSeconds: number,\n weight: number,\n motionQueueEntry: CubismMotionQueueEntry,\n ): void {\n for (let i = 0; i < this._parameters.length; ++i) {\n const parameter: ExpressionParameter = this._parameters[i];\n\n switch (parameter.blendType) {\n case ExpressionBlendType.ExpressionBlendType_Add: {\n model.addParameterValueById(\n parameter.parameterId,\n parameter.value,\n weight,\n );\n break;\n }\n case ExpressionBlendType.ExpressionBlendType_Multiply: {\n model.multiplyParameterValueById(\n parameter.parameterId,\n parameter.value,\n weight,\n );\n break;\n }\n case ExpressionBlendType.ExpressionBlendType_Overwrite: {\n model.setParameterValueById(\n parameter.parameterId,\n parameter.value,\n weight,\n );\n break;\n }\n default:\n // 仕様にない値を設定した時はすでに加算モードになっている\n break;\n }\n }\n }\n\n /**\n * コンストラクタ\n */\n constructor() {\n super();\n\n this._parameters = [];\n }\n\n _parameters: ExpressionParameter[]; // 表情のパラメータ情報リスト\n}\n\n/**\n * 表情パラメータ値の計算方式\n */\nexport enum ExpressionBlendType {\n ExpressionBlendType_Add = 0, // 加算\n ExpressionBlendType_Multiply = 1, // 乗算\n ExpressionBlendType_Overwrite = 2 // 上書き\n}\n\n/**\n * 表情のパラメータ情報\n */\nexport interface ExpressionParameter {\n parameterId: string; // パラメータID\n blendType: ExpressionBlendType; // パラメータの演算種類\n value: number; // 値\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\nimport { ACubismMotion } from './acubismmotion';\nimport { CubismMotionQueueEntryHandle } from './cubismmotionqueuemanager';\n\n/**\n * CubismMotionQueueManagerで再生している各モーションの管理クラス。\n */\nexport class CubismMotionQueueEntry {\n /**\n * コンストラクタ\n */\n public constructor() {\n this._autoDelete = false;\n this._available = true;\n this._finished = false;\n this._started = false;\n this._startTimeSeconds = -1.0;\n this._fadeInStartTimeSeconds = 0.0;\n this._endTimeSeconds = -1.0;\n this._stateTimeSeconds = 0.0;\n this._stateWeight = 0.0;\n this._lastEventCheckSeconds = 0.0;\n this._motionQueueEntryHandle = this;\n this._fadeOutSeconds = 0.0;\n this._isTriggeredFadeOut = false;\n }\n\n /**\n * デストラクタ相当の処理\n */\n public release(): void {\n if (this._autoDelete && this._motion) {\n this._motion.release();\n }\n }\n\n /**\n * フェードアウト時間と開始判定の設定\n * @param fadeOutSeconds フェードアウトにかかる時間[秒]\n */\n public setFadeOut(fadeOutSeconds: number): void {\n this._fadeOutSeconds = fadeOutSeconds;\n this._isTriggeredFadeOut = true;\n }\n\n /**\n * フェードアウトの開始\n * @param fadeOutSeconds フェードアウトにかかる時間[秒]\n * @param userTimeSeconds デルタ時間の積算値[秒]\n */\n public startFadeOut(fadeOutSeconds: number, userTimeSeconds: number): void {\n const newEndTimeSeconds: number = userTimeSeconds + fadeOutSeconds;\n this._isTriggeredFadeOut = true;\n\n if (\n this._endTimeSeconds < 0.0 ||\n newEndTimeSeconds < this._endTimeSeconds\n ) {\n this._endTimeSeconds = newEndTimeSeconds;\n }\n }\n\n /**\n * モーションの終了の確認\n *\n * @return true モーションが終了した\n * @return false 終了していない\n */\n public isFinished(): boolean {\n return this._finished;\n }\n\n /**\n * モーションの開始の確認\n * @return true モーションが開始した\n * @return false 開始していない\n */\n public isStarted(): boolean {\n return this._started;\n }\n\n /**\n * モーションの開始時刻の取得\n * @return モーションの開始時刻[秒]\n */\n public getStartTime(): number {\n return this._startTimeSeconds;\n }\n\n /**\n * フェードインの開始時刻の取得\n * @return フェードインの開始時刻[秒]\n */\n public getFadeInStartTime(): number {\n return this._fadeInStartTimeSeconds;\n }\n\n /**\n * フェードインの終了時刻の取得\n * @return フェードインの終了時刻の取得\n */\n public getEndTime(): number {\n return this._endTimeSeconds;\n }\n\n /**\n * モーションの開始時刻の設定\n * @param startTime モーションの開始時刻\n */\n public setStartTime(startTime: number): void {\n this._startTimeSeconds = startTime;\n }\n\n /**\n * フェードインの開始時刻の設定\n * @param startTime フェードインの開始時刻[秒]\n */\n public setFadeInStartTime(startTime: number): void {\n this._fadeInStartTimeSeconds = startTime;\n }\n\n /**\n * フェードインの終了時刻の設定\n * @param endTime フェードインの終了時刻[秒]\n */\n public setEndTime(endTime: number): void {\n this._endTimeSeconds = endTime;\n }\n\n /**\n * モーションの終了の設定\n * @param f trueならモーションの終了\n */\n public setIsFinished(f: boolean): void {\n this._finished = f;\n }\n\n /**\n * モーション開始の設定\n * @param f trueならモーションの開始\n */\n public setIsStarted(f: boolean): void {\n this._started = f;\n }\n\n /**\n * モーションの有効性の確認\n * @return true モーションは有効\n * @return false モーションは無効\n */\n public isAvailable(): boolean {\n return this._available;\n }\n\n /**\n * モーションの有効性の設定\n * @param v trueならモーションは有効\n */\n public setIsAvailable(v: boolean): void {\n this._available = v;\n }\n\n /**\n * モーションの状態の設定\n * @param timeSeconds 現在時刻[秒]\n * @param weight モーション尾重み\n */\n public setState(timeSeconds: number, weight: number): void {\n this._stateTimeSeconds = timeSeconds;\n this._stateWeight = weight;\n }\n\n /**\n * モーションの現在時刻の取得\n * @return モーションの現在時刻[秒]\n */\n public getStateTime(): number {\n return this._stateTimeSeconds;\n }\n\n /**\n * モーションの重みの取得\n * @return モーションの重み\n */\n public getStateWeight(): number {\n return this._stateWeight;\n }\n\n /**\n * 最後にイベントの発火をチェックした時間を取得\n *\n * @return 最後にイベントの発火をチェックした時間[秒]\n */\n public getLastCheckEventSeconds(): number {\n return this._lastEventCheckSeconds;\n }\n\n /**\n * 最後にイベントをチェックした時間を設定\n * @param checkSeconds 最後にイベントをチェックした時間[秒]\n */\n public setLastCheckEventSeconds(checkSeconds: number): void {\n this._lastEventCheckSeconds = checkSeconds;\n }\n\n /**\n * フェードアウト開始判定の取得\n * @return フェードアウト開始するかどうか\n */\n public isTriggeredFadeOut(): boolean {\n return this._isTriggeredFadeOut && this._endTimeSeconds < 0.0;\n }\n\n /**\n * フェードアウト時間の取得\n * @return フェードアウト時間[秒]\n */\n public getFadeOutSeconds(): number {\n return this._fadeOutSeconds;\n }\n\n _autoDelete: boolean; // 自動削除\n _motion!: ACubismMotion; // モーション\n\n _available: boolean; // 有効化フラグ\n _finished: boolean; // 終了フラグ\n _started: boolean; // 開始フラグ\n _startTimeSeconds: number; // モーション再生開始時刻[秒]\n _fadeInStartTimeSeconds: number; // フェードイン開始時刻(ループの時は初回のみ)[秒]\n _endTimeSeconds: number; // 終了予定時刻[秒]\n _stateTimeSeconds: number; // 時刻の状態[秒]\n _stateWeight: number; // 重みの状態\n _lastEventCheckSeconds: number; // 最終のMotion側のチェックした時間\n private _fadeOutSeconds: number; // フェードアウト時間[秒]\n private _isTriggeredFadeOut: boolean; // フェードアウト開始フラグ\n\n _motionQueueEntryHandle: CubismMotionQueueEntryHandle; // インスタンスごとに一意の値を持つ識別番号\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\nimport { CubismModel } from '../model/cubismmodel';\nimport { ACubismMotion } from './acubismmotion';\nimport { CubismMotionQueueEntry } from './cubismmotionqueueentry';\n\n/**\n * モーション再生の管理\n *\n * モーション再生の管理用クラス。CubismMotionモーションなどACubismMotionのサブクラスを再生するために使用する。\n *\n * @note 再生中に別のモーションが StartMotion()された場合は、新しいモーションに滑らかに変化し旧モーションは中断する。\n * 表情用モーション、体用モーションなどを分けてモーション化した場合など、\n * 複数のモーションを同時に再生させる場合は、複数のCubismMotionQueueManagerインスタンスを使用する。\n */\nexport class CubismMotionQueueManager {\n /**\n * コンストラクタ\n */\n public constructor() {\n this._userTimeSeconds = 0.0;\n this._eventCustomData = null;\n this._motions = [];\n }\n\n /**\n * デストラクタ\n */\n public release(): void {\n for (let i = 0; i < this._motions.length; ++i) {\n if (this._motions[i]) {\n this._motions[i].release();\n }\n }\n\n (this as Partial<this>)._motions = undefined;\n }\n\n /**\n * 指定したモーションの開始\n *\n * 指定したモーションを開始する。同じタイプのモーションが既にある場合は、既存のモーションに終了フラグを立て、フェードアウトを開始させる。\n *\n * @param motion 開始するモーション\n * @param autoDelete 再生が終了したモーションのインスタンスを削除するなら true\n * @param userTimeSeconds デルタ時間の積算値[秒]\n * @return 開始したモーションの識別番号を返す。個別のモーションが終了したか否かを判定するIsFinished()の引数で使用する。開始できない時は「-1」\n */\n public startMotion(\n motion: ACubismMotion,\n autoDelete: boolean,\n userTimeSeconds: number,\n ): CubismMotionQueueEntryHandle {\n if (motion == null) {\n return InvalidMotionQueueEntryHandleValue;\n }\n\n let motionQueueEntry: CubismMotionQueueEntry;\n\n // 既にモーションがあれば終了フラグを立てる\n for (let i = 0; i < this._motions.length; ++i) {\n motionQueueEntry = this._motions[i];\n if (motionQueueEntry == null) {\n continue;\n }\n\n motionQueueEntry.setFadeOut(motionQueueEntry._motion.getFadeOutTime()); // フェードアウト設定\n }\n\n motionQueueEntry = new CubismMotionQueueEntry(); // 終了時に破棄する\n motionQueueEntry._autoDelete = autoDelete;\n motionQueueEntry._motion = motion;\n\n this._motions.push(motionQueueEntry);\n\n return motionQueueEntry._motionQueueEntryHandle;\n }\n\n /**\n * 全てのモーションの終了の確認\n * @return true 全て終了している\n * @return false 終了していない\n */\n public isFinished(): boolean {\n // ------- 処理を行う -------\n // 既にモーションがあれば終了フラグを立てる\n\n let i = 0;\n\n while (i < this._motions.length) {\n const motionQueueEntry: CubismMotionQueueEntry = this._motions[i];\n\n if (motionQueueEntry == null) {\n this._motions.splice(i, 1); // 削除\n continue;\n }\n\n const motion: ACubismMotion = motionQueueEntry._motion;\n\n if (motion == null) {\n motionQueueEntry.release();\n this._motions.splice(i, 1); // 削除\n continue;\n }\n\n // ----- 終了済みの処理があれば削除する ------\n if (!motionQueueEntry.isFinished()) {\n return false;\n }\n\n i++;\n }\n\n return true;\n }\n\n /**\n * 指定したモーションの終了の確認\n * @param motionQueueEntryNumber モーションの識別番号\n * @return true 全て終了している\n * @return false 終了していない\n */\n public isFinishedByHandle(\n motionQueueEntryNumber: CubismMotionQueueEntryHandle,\n ): boolean {\n // 既にモーションがあれば終了フラグを立てる\n for (let i = 0; i < this._motions.length; i++) {\n const motionQueueEntry: CubismMotionQueueEntry = this._motions[i];\n\n if (motionQueueEntry == null) {\n continue;\n }\n\n if (\n motionQueueEntry._motionQueueEntryHandle == motionQueueEntryNumber &&\n !motionQueueEntry.isFinished()\n ) {\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * 全てのモーションを停止する\n */\n public stopAllMotions(): void {\n // ------- 処理を行う -------\n // 既にモーションがあれば終了フラグを立てる\n\n for (let i = 0; i < this._motions.length; i++) {\n const motionQueueEntry: CubismMotionQueueEntry = this._motions[i];\n\n if (motionQueueEntry != null) {\n // ----- 終了済みの処理があれば削除する ------\n motionQueueEntry.release();\n }\n }\n\n this._motions = [];\n }\n\n /**\n * 指定したCubismMotionQueueEntryの取得\n\n * @param motionQueueEntryNumber モーションの識別番号\n * @return 指定したCubismMotionQueueEntry\n * @return null 見つからなかった\n */\n public getCubismMotionQueueEntry(\n motionQueueEntryNumber: any,\n ): CubismMotionQueueEntry | undefined {\n //------- 処理を行う -------\n // 既にモーションがあれば終了フラグを立てる\n return this._motions.find(entry => entry != null && entry._motionQueueEntryHandle == motionQueueEntryNumber);\n }\n\n /**\n * イベントを受け取るCallbackの登録\n *\n * @param callback コールバック関数\n * @param customData コールバックに返されるデータ\n */\n public setEventCallback(\n callback: CubismMotionEventFunction,\n customData: any = null,\n ): void {\n this._eventCallBack = callback;\n this._eventCustomData = customData;\n }\n\n /**\n * モーションを更新して、モデルにパラメータ値を反映する。\n *\n * @param model 対象のモデル\n * @param userTimeSeconds デルタ時間の積算値[秒]\n * @return true モデルへパラメータ値の反映あり\n * @return false モデルへパラメータ値の反映なし(モーションの変化なし)\n */\n public doUpdateMotion(\n model: CubismModel,\n userTimeSeconds: number,\n ): boolean {\n let updated = false;\n\n // ------- 処理を行う --------\n // 既にモーションがあれば終了フラグを立てる\n\n let i = 0;\n\n while (i < this._motions.length) {\n const motionQueueEntry: CubismMotionQueueEntry = this._motions[i];\n\n if (motionQueueEntry == null) {\n this._motions.splice(i, 1); // 削除\n continue;\n }\n\n const motion: ACubismMotion = motionQueueEntry._motion;\n\n if (motion == null) {\n motionQueueEntry.release();\n this._motions.splice(i, 1); // 削除\n continue;\n }\n\n // ------ 値を反映する ------\n motion.updateParameters(model, motionQueueEntry, userTimeSeconds);\n updated = true;\n\n // ------ ユーザトリガーイベントを検査する ----\n const firedList: string[] = motion.getFiredEvent(\n motionQueueEntry.getLastCheckEventSeconds() -\n motionQueueEntry.getStartTime(),\n userTimeSeconds - motionQueueEntry.getStartTime(),\n );\n\n for (let i = 0; i < firedList.length; ++i) {\n this._eventCallBack(this, firedList[i], this._eventCustomData);\n }\n\n motionQueueEntry.setLastCheckEventSeconds(userTimeSeconds);\n\n // ------ 終了済みの処理があれば削除する ------\n if (motionQueueEntry.isFinished()) {\n motionQueueEntry.release();\n this._motions.splice(i, 1); // 削除\n } else {\n if (motionQueueEntry.isTriggeredFadeOut()) {\n motionQueueEntry.startFadeOut(\n motionQueueEntry.getFadeOutSeconds(),\n userTimeSeconds\n );\n }\n i++;\n }\n }\n\n return updated;\n }\n\n _userTimeSeconds: number; // デルタ時間の積算値[秒]\n\n _motions: CubismMotionQueueEntry[]; // モーション\n _eventCallBack!: CubismMotionEventFunction; // コールバック関数\n _eventCustomData: any; // コールバックに戻されるデータ\n}\n\n/**\n * イベントのコールバック関数を定義\n *\n * イベントのコールバックに登録できる関数の型情報\n * @param caller 発火したイベントを再生させたCubismMotionQueueManager\n * @param eventValue 発火したイベントの文字列データ\n * @param customData コールバックに返される登録時に指定されたデータ\n */\nexport interface CubismMotionEventFunction {\n (\n caller: CubismMotionQueueManager,\n eventValue: string,\n customData: any,\n ): void;\n}\n\n/**\n * モーションの識別番号\n *\n * モーションの識別番号の定義\n */\nexport declare type CubismMotionQueueEntryHandle = any;\nexport const InvalidMotionQueueEntryHandleValue: CubismMotionQueueEntryHandle = -1;\n","import { MotionManagerOptions } from '@/cubism-common';\nimport { ExpressionManager } from '@/cubism-common/ExpressionManager';\nimport { Cubism4ModelSettings } from '@/cubism4/Cubism4ModelSettings';\nimport { CubismModel } from '@cubism/model/cubismmodel';\nimport { CubismExpressionMotion } from '@cubism/motion/cubismexpressionmotion';\nimport { CubismMotionQueueManager } from '@cubism/motion/cubismmotionqueuemanager';\n\nexport class Cubism4ExpressionManager extends ExpressionManager<CubismExpressionMotion, CubismSpec.Expression> {\n readonly queueManager = new CubismMotionQueueManager();\n\n readonly definitions: CubismSpec.Expression[];\n\n constructor(settings: Cubism4ModelSettings, options?: MotionManagerOptions) {\n super(settings, options);\n\n this.definitions = settings.expressions ?? [];\n\n this.init();\n }\n\n isFinished(): boolean {\n return this.queueManager.isFinished();\n }\n\n getExpressionIndex(name: string): number {\n return this.definitions.findIndex(def => def.Name === name);\n }\n\n getExpressionFile(definition: CubismSpec.Expression): string {\n return definition.File;\n }\n\n createExpression(data: object, definition: CubismSpec.Expression | undefined) {\n return CubismExpressionMotion.create(data as unknown as CubismSpec.ExpressionJSON);\n }\n\n protected _setExpression(motion: CubismExpressionMotion): number {\n return this.queueManager.startMotion(motion, false, performance.now());\n }\n\n protected stopAllExpressions(): void {\n this.queueManager.stopAllMotions();\n }\n\n protected updateParameters(model: CubismModel, now: DOMHighResTimeStamp): boolean {\n return this.queueManager.doUpdateMotion(model, now);\n }\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\n/**\n * Model3Jsonパーサー\n *\n * model3.jsonファイルをパースして値を取得する\n */\nexport class CubismModelSettingsJson {\n public constructor(json: CubismSpec.ModelJSON) {\n this.groups = json.Groups;\n this.hitAreas = json.HitAreas;\n this.layout = json.Layout;\n\n this.moc = json.FileReferences.Moc;\n this.expressions = json.FileReferences.Expressions;\n this.motions = json.FileReferences.Motions;\n this.textures = json.FileReferences.Textures;\n this.physics = json.FileReferences.Physics;\n this.pose = json.FileReferences.Pose;\n }\n\n public getEyeBlinkParameters(): string[] | undefined {\n return this.groups?.find(group => group.Name === 'EyeBlink')?.Ids;\n }\n\n public getLipSyncParameters(): string[] | undefined {\n return this.groups?.find(group => group.Name === 'LipSync')?.Ids;\n }\n\n groups?: CubismSpec.Group[];\n moc: string;\n expressions?: CubismSpec.Expression[];\n motions?: Record<string, CubismSpec.Motion[]>;\n textures: string[];\n physics?: string;\n pose?: string;\n hitAreas?: CubismSpec.HitArea[];\n layout?: CubismSpec.ModelJSON['Layout'];\n}\n","import { ModelSettings } from '@/cubism-common/ModelSettings';\nimport { applyMixins } from '@/utils';\nimport { CubismModelSettingsJson } from '@cubism/settings/cubismmodelsettingsjson';\n\nexport interface Cubism4ModelSettings extends CubismModelSettingsJson {}\n\nexport class Cubism4ModelSettings extends ModelSettings {\n json!: CubismSpec.ModelJSON;\n\n moc!: string;\n textures!: string[];\n\n static isValidJSON(json: any): json is CubismSpec.ModelJSON {\n return !!json?.FileReferences\n && typeof json.FileReferences.Moc === 'string'\n && json.FileReferences.Textures?.length > 0\n\n // textures must be an array of strings\n && json.FileReferences.Textures.every((item: any) => typeof item === 'string');\n }\n\n constructor(json: CubismSpec.ModelJSON & { url: string }) {\n super(json);\n\n if (!Cubism4ModelSettings.isValidJSON(json)) {\n throw new TypeError('Invalid JSON.');\n }\n\n // this doesn't seem to be allowed in ES6 and above, calling it will cause an error:\n // \"Class constructor CubismModelSettingsJson cannot be invoked without 'new'\"\n //\n // CubismModelSettingsJson.call(this, json);\n\n Object.assign(this, new CubismModelSettingsJson(json));\n }\n\n replaceFiles(replace: (file: string, path: string) => string) {\n super.replaceFiles(replace);\n\n if (this.motions) {\n for (const [group, motions] of Object.entries(this.motions)) {\n for (let i = 0; i < motions.length; i++) {\n motions[i]!.File = replace(motions[i]!.File, `motions.${group}[${i}].File`);\n\n if (motions[i]!.Sound !== undefined) {\n motions[i]!.Sound = replace(motions[i]!.Sound!, `motions.${group}[${i}].Sound`);\n }\n }\n }\n }\n\n if (this.expressions) {\n for (let i = 0; i < this.expressions.length; i++) {\n this.expressions[i]!.File = replace(this.expressions[i]!.File, `expressions[${i}].File`);\n }\n }\n }\n}\n\napplyMixins(Cubism4ModelSettings, [CubismModelSettingsJson]);\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\n/**\n * @brief モーションカーブの種類\n *\n * モーションカーブの種類。\n */\nexport enum CubismMotionCurveTarget {\n CubismMotionCurveTarget_Model, // モデルに対して\n CubismMotionCurveTarget_Parameter, // パラメータに対して\n CubismMotionCurveTarget_PartOpacity // パーツの不透明度に対して\n}\n\n/**\n * @brief モーションカーブのセグメントの種類\n *\n * モーションカーブのセグメントの種類。\n */\nexport enum CubismMotionSegmentType {\n CubismMotionSegmentType_Linear = 0, // リニア\n CubismMotionSegmentType_Bezier = 1, // ベジェ曲線\n CubismMotionSegmentType_Stepped = 2, // ステップ\n CubismMotionSegmentType_InverseStepped = 3 // インバースステップ\n}\n\n/**\n * @brief モーションカーブの制御点\n *\n * モーションカーブの制御点。\n */\nexport class CubismMotionPoint {\n constructor(time = 0.0, value = 0.0) {\n this.time = time;\n this.value = value;\n }\n\n time: number; // 時間[秒]\n value: number; // 値\n}\n\n/**\n * モーションカーブのセグメントの評価関数\n *\n * @param points モーションカーブの制御点リスト\n * @param time 評価する時間[秒]\n */\nexport interface csmMotionSegmentEvaluationFunction {\n (points: CubismMotionPoint[], time: number): number;\n}\n\n/**\n * @brief モーションカーブのセグメント\n *\n * モーションカーブのセグメント。\n */\nexport class CubismMotionSegment {\n /**\n * @brief コンストラクタ\n *\n * コンストラクタ。\n */\n public constructor() {\n this.basePointIndex = 0;\n this.segmentType = 0;\n }\n\n evaluate!: csmMotionSegmentEvaluationFunction; // 使用する評価関数\n basePointIndex: number; // 最初のセグメントへのインデックス\n segmentType: number; // セグメントの種類\n}\n\n/**\n * @brief モーションカーブ\n *\n * モーションカーブ。\n */\nexport class CubismMotionCurve {\n public constructor() {\n this.type = CubismMotionCurveTarget.CubismMotionCurveTarget_Model;\n this.segmentCount = 0;\n this.baseSegmentIndex = 0;\n this.fadeInTime = 0.0;\n this.fadeOutTime = 0.0;\n }\n\n type: CubismMotionCurveTarget; // カーブの種類\n id: string = ''; // カーブのID\n segmentCount: number; // セグメントの個数\n baseSegmentIndex: number; // 最初のセグメントのインデックス\n fadeInTime: number; // フェードインにかかる時間[秒]\n fadeOutTime: number; // フェードアウトにかかる時間[秒]\n}\n\n/**\n * イベント。\n */\nexport class CubismMotionEvent {\n fireTime = 0.0;\n value: string = '';\n}\n\n/**\n * @brief モーションデータ\n *\n * モーションデータ。\n */\nexport class CubismMotionData {\n public constructor() {\n this.duration = 0.0;\n this.loop = false;\n this.curveCount = 0;\n this.eventCount = 0;\n this.fps = 0.0;\n\n this.curves = [];\n this.segments = [];\n this.points = [];\n this.events = [];\n }\n\n duration: number; // モーションの長さ[秒]\n loop: boolean; // ループするかどうか\n curveCount: number; // カーブの個数\n eventCount: number; // UserDataの個数\n fps: number; // フレームレート\n curves: CubismMotionCurve[]; // カーブのリスト\n segments: CubismMotionSegment[]; // セグメントのリスト\n points: CubismMotionPoint[]; // ポイントのリスト\n events: CubismMotionEvent[]; // イベントのリスト\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\n/**\n * motion3.jsonのコンテナ。\n */\nexport class CubismMotionJson {\n /**\n * コンストラクタ\n * @param json motion3.jsonが読み込まれているバッファ\n */\n public constructor(json: CubismSpec.MotionJSON) {\n this._json = json;\n }\n\n /**\n * デストラクタ相当の処理\n */\n public release(): void {\n (this as any)._json = undefined;\n }\n\n /**\n * モーションの長さを取得する\n * @return モーションの長さ[秒]\n */\n public getMotionDuration(): number {\n return this._json.Meta.Duration;\n }\n\n /**\n * モーションのループ情報の取得\n * @return true ループする\n * @return false ループしない\n */\n public isMotionLoop(): boolean {\n return this._json.Meta.Loop || false;\n }\n\n /**\n * モーションカーブの個数の取得\n * @return モーションカーブの個数\n */\n public getMotionCurveCount(): number {\n return this._json.Meta.CurveCount;\n }\n\n /**\n * モーションのフレームレートの取得\n * @return フレームレート[FPS]\n */\n public getMotionFps(): number {\n return this._json.Meta.Fps;\n }\n\n /**\n * モーションのセグメントの総合計の取得\n * @return モーションのセグメントの取得\n */\n public getMotionTotalSegmentCount(): number {\n return this._json.Meta.TotalSegmentCount;\n }\n\n /**\n * モーションのカーブの制御店の総合計の取得\n * @return モーションのカーブの制御点の総合計\n */\n public getMotionTotalPointCount(): number {\n return this._json.Meta.TotalPointCount;\n }\n\n /**\n * モーションのフェードイン時間の取得\n * @return フェードイン時間[秒]\n */\n public getMotionFadeInTime(): number | undefined {\n return this._json.Meta.FadeInTime;\n }\n\n /**\n * モーションのフェードアウト時間の取得\n * @return フェードアウト時間[秒]\n */\n public getMotionFadeOutTime(): number | undefined {\n return this._json.Meta.FadeOutTime;\n }\n\n /**\n * モーションのカーブの種類の取得\n * @param curveIndex カーブのインデックス\n * @return カーブの種類\n */\n public getMotionCurveTarget(curveIndex: number): string {\n return this._json.Curves[curveIndex].Target;\n }\n\n /**\n * モーションのカーブのIDの取得\n * @param curveIndex カーブのインデックス\n * @return カーブのID\n */\n public getMotionCurveId(curveIndex: number): string {\n return this._json.Curves[curveIndex].Id;\n }\n\n /**\n * モーションのカーブのフェードイン時間の取得\n * @param curveIndex カーブのインデックス\n * @return フェードイン時間[秒]\n */\n public getMotionCurveFadeInTime(curveIndex: number): number | undefined {\n return this._json.Curves[curveIndex].FadeInTime;\n }\n\n /**\n * モーションのカーブのフェードアウト時間の取得\n * @param curveIndex カーブのインデックス\n * @return フェードアウト時間[秒]\n */\n public getMotionCurveFadeOutTime(curveIndex: number): number | undefined {\n return this._json.Curves[curveIndex].FadeOutTime;\n }\n\n /**\n * モーションのカーブのセグメントの個数を取得する\n * @param curveIndex カーブのインデックス\n * @return モーションのカーブのセグメントの個数\n */\n public getMotionCurveSegmentCount(curveIndex: number): number {\n return this._json.Curves[curveIndex].Segments.length;\n }\n\n /**\n * モーションのカーブのセグメントの値の取得\n * @param curveIndex カーブのインデックス\n * @param segmentIndex セグメントのインデックス\n * @return セグメントの値\n */\n public getMotionCurveSegment(\n curveIndex: number,\n segmentIndex: number,\n ): number {\n return this._json.Curves[curveIndex].Segments[segmentIndex];\n }\n\n /**\n * イベントの個数の取得\n * @return イベントの個数\n */\n public getEventCount(): number {\n return this._json.Meta.UserDataCount || 0;\n }\n\n /**\n * イベントの総文字数の取得\n * @return イベントの総文字数\n */\n public getTotalEventValueSize(): number {\n return this._json.Meta.TotalUserDataSize!;\n }\n\n /**\n * イベントの時間の取得\n * @param userDataIndex イベントのインデックス\n * @return イベントの時間[秒]\n */\n public getEventTime(userDataIndex: number): number {\n return this._json.UserData![userDataIndex].Time!;\n }\n\n /**\n * イベントの取得\n * @param userDataIndex イベントのインデックス\n * @return イベントの文字列\n */\n public getEventValue(userDataIndex: number): string {\n return this._json.UserData![userDataIndex].Value!;\n }\n\n _json: CubismSpec.MotionJSON; // motion3.jsonのデータ\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\nimport { CubismMath } from '../math/cubismmath';\nimport { CubismModel } from '../model/cubismmodel';\nimport { CSM_ASSERT, CubismLogDebug } from '../utils/cubismdebug';\nimport { ACubismMotion } from './acubismmotion';\nimport {\n CubismMotionCurve,\n CubismMotionCurveTarget,\n CubismMotionData,\n CubismMotionEvent,\n CubismMotionPoint,\n CubismMotionSegment,\n CubismMotionSegmentType,\n} from './cubismmotioninternal';\nimport { CubismMotionJson } from './cubismmotionjson';\nimport { CubismMotionQueueEntry } from './cubismmotionqueueentry';\n\nconst EffectNameEyeBlink = 'EyeBlink';\nconst EffectNameLipSync = 'LipSync';\nconst TargetNameModel = 'Model';\nconst TargetNameParameter = 'Parameter';\nconst TargetNamePartOpacity = 'PartOpacity';\n\nfunction lerpPoints(\n a: CubismMotionPoint,\n b: CubismMotionPoint,\n t: number,\n): CubismMotionPoint {\n const result: CubismMotionPoint = new CubismMotionPoint();\n\n result.time = a.time + (b.time - a.time) * t;\n result.value = a.value + (b.value - a.value) * t;\n\n return result;\n}\n\nfunction linearEvaluate(points: CubismMotionPoint[], time: number): number {\n let t: number = (time - points[0].time) / (points[1].time - points[0].time);\n\n if (t < 0.0) {\n t = 0.0;\n }\n\n return points[0].value + (points[1].value - points[0].value) * t;\n}\n\nfunction bezierEvaluate(points: CubismMotionPoint[], time: number): number {\n let t: number = (time - points[0].time) / (points[3].time - points[0].time);\n\n if (t < 0.0) {\n t = 0.0;\n }\n\n const p01: CubismMotionPoint = lerpPoints(points[0], points[1], t);\n const p12: CubismMotionPoint = lerpPoints(points[1], points[2], t);\n const p23: CubismMotionPoint = lerpPoints(points[2], points[3], t);\n\n const p012: CubismMotionPoint = lerpPoints(p01, p12, t);\n const p123: CubismMotionPoint = lerpPoints(p12, p23, t);\n\n return lerpPoints(p012, p123, t).value;\n}\n\nfunction steppedEvaluate(points: CubismMotionPoint[], time: number): number {\n return points[0].value;\n}\n\nfunction inverseSteppedEvaluate(\n points: CubismMotionPoint[],\n time: number,\n): number {\n return points[1].value;\n}\n\nfunction evaluateCurve(\n motionData: CubismMotionData,\n index: number,\n time: number,\n): number {\n // Find segment to evaluate.\n const curve: CubismMotionCurve = motionData.curves[index];\n\n let target = -1;\n const totalSegmentCount: number =\n curve.baseSegmentIndex + curve.segmentCount;\n let pointPosition = 0;\n for (let i: number = curve.baseSegmentIndex; i < totalSegmentCount; ++i) {\n // Get first point of next segment.\n pointPosition =\n motionData.segments[i].basePointIndex +\n (motionData.segments[i].segmentType ==\n CubismMotionSegmentType.CubismMotionSegmentType_Bezier\n ? 3\n : 1);\n\n // Break if time lies within current segment.\n if (motionData.points[pointPosition].time > time) {\n target = i;\n break;\n }\n }\n\n if (target == -1) {\n return motionData.points[pointPosition].value;\n }\n\n const segment: CubismMotionSegment = motionData.segments[target];\n\n return segment.evaluate(\n motionData.points.slice(segment.basePointIndex),\n time,\n );\n}\n\n/**\n * モーションクラス\n *\n * モーションのクラス。\n */\nexport class CubismMotion extends ACubismMotion {\n /**\n * インスタンスを作成する\n *\n * @param json motion3.jsonが読み込まれているバッファ\n * @param onFinishedMotionHandler モーション再生終了時に呼び出されるコールバック関数\n * @return 作成されたインスタンス\n */\n public static create(json: CubismSpec.MotionJSON, onFinishedMotionHandler?: (self: ACubismMotion) => void): CubismMotion {\n const ret = new CubismMotion();\n\n ret.parse(json);\n ret._sourceFrameRate = ret._motionData.fps;\n ret._loopDurationSeconds = ret._motionData.duration;\n ret._onFinishedMotion = onFinishedMotionHandler;\n\n // NOTE: Editorではループありのモーション書き出しは非対応\n // ret->_loop = (ret->_motionData->Loop > 0);\n return ret;\n }\n\n /**\n * モデルのパラメータの更新の実行\n * @param model 対象のモデル\n * @param userTimeSeconds 現在の時刻[秒]\n * @param fadeWeight モーションの重み\n * @param motionQueueEntry CubismMotionQueueManagerで管理されているモーション\n */\n public doUpdateParameters(\n model: CubismModel,\n userTimeSeconds: number,\n fadeWeight: number,\n motionQueueEntry: CubismMotionQueueEntry,\n ): void {\n if (this._modelCurveIdEyeBlink == null) {\n this._modelCurveIdEyeBlink = EffectNameEyeBlink;\n }\n\n if (this._modelCurveIdLipSync == null) {\n this._modelCurveIdLipSync = EffectNameLipSync;\n }\n\n let timeOffsetSeconds: number =\n userTimeSeconds - motionQueueEntry.getStartTime();\n\n if (timeOffsetSeconds < 0.0) {\n timeOffsetSeconds = 0.0; // エラー回避\n }\n\n let lipSyncValue: number = Number.MAX_VALUE;\n let eyeBlinkValue: number = Number.MAX_VALUE;\n\n //まばたき、リップシンクのうちモーションの適用を検出するためのビット(maxFlagCount個まで\n const MaxTargetSize = 64;\n let lipSyncFlags = 0;\n let eyeBlinkFlags = 0;\n\n //瞬き、リップシンクのターゲット数が上限を超えている場合\n if (this._eyeBlinkParameterIds.length > MaxTargetSize) {\n CubismLogDebug(\n 'too many eye blink targets : {0}',\n this._eyeBlinkParameterIds.length,\n );\n }\n if (this._lipSyncParameterIds.length > MaxTargetSize) {\n CubismLogDebug(\n 'too many lip sync targets : {0}',\n this._lipSyncParameterIds.length,\n );\n }\n\n const tmpFadeIn: number =\n this._fadeInSeconds <= 0.0\n ? 1.0\n : CubismMath.getEasingSine(\n (userTimeSeconds - motionQueueEntry.getFadeInStartTime()) /\n this._fadeInSeconds,\n );\n\n const tmpFadeOut: number =\n this._fadeOutSeconds <= 0.0 || motionQueueEntry.getEndTime() < 0.0\n ? 1.0\n : CubismMath.getEasingSine(\n (motionQueueEntry.getEndTime() - userTimeSeconds) /\n this._fadeOutSeconds,\n );\n let value: number;\n let c: number, parameterIndex: number;\n\n // 'Repeat' time as necessary.\n let time: number = timeOffsetSeconds;\n\n if (this._isLoop) {\n while (time > this._motionData.duration) {\n time -= this._motionData.duration;\n }\n }\n\n const curves: CubismMotionCurve[] = this._motionData.curves;\n\n // Evaluate model curves.\n for (\n c = 0;\n c < this._motionData.curveCount &&\n curves[c].type ==\n CubismMotionCurveTarget.CubismMotionCurveTarget_Model;\n ++c\n ) {\n // Evaluate curve and call handler.\n value = evaluateCurve(this._motionData, c, time);\n\n if (curves[c].id == this._modelCurveIdEyeBlink) {\n eyeBlinkValue = value;\n } else if (curves[c].id == this._modelCurveIdLipSync) {\n lipSyncValue = value;\n }\n }\n\n let parameterMotionCurveCount = 0;\n\n for (\n ;\n c < this._motionData.curveCount &&\n curves[c].type ==\n CubismMotionCurveTarget.CubismMotionCurveTarget_Parameter;\n ++c\n ) {\n parameterMotionCurveCount++;\n\n // Find parameter index.\n parameterIndex = model.getParameterIndex(curves[c].id);\n\n // Skip curve evaluation if no value in sink.\n if (parameterIndex == -1) {\n continue;\n }\n\n const sourceValue: number = model.getParameterValueByIndex(\n parameterIndex,\n );\n\n // Evaluate curve and apply value.\n value = evaluateCurve(this._motionData, c, time);\n\n if (eyeBlinkValue != Number.MAX_VALUE) {\n for (\n let i = 0;\n i < this._eyeBlinkParameterIds.length && i < MaxTargetSize;\n ++i\n ) {\n if (this._eyeBlinkParameterIds[i] == curves[c].id) {\n value *= eyeBlinkValue;\n eyeBlinkFlags |= 1 << i;\n break;\n }\n }\n }\n\n if (lipSyncValue != Number.MAX_VALUE) {\n for (\n let i = 0;\n i < this._lipSyncParameterIds.length && i < MaxTargetSize;\n ++i\n ) {\n if (this._lipSyncParameterIds[i] == curves[c].id) {\n value += lipSyncValue;\n lipSyncFlags |= 1 << i;\n break;\n }\n }\n }\n\n let v: number;\n\n // パラメータごとのフェード\n if (curves[c].fadeInTime < 0.0 && curves[c].fadeOutTime < 0.0) {\n // モーションのフェードを適用\n v = sourceValue + (value - sourceValue) * fadeWeight;\n } else {\n // パラメータに対してフェードインかフェードアウトが設定してある場合はそちらを適用\n let fin: number;\n let fout: number;\n\n if (curves[c].fadeInTime < 0.0) {\n fin = tmpFadeIn;\n } else {\n fin =\n curves[c].fadeInTime == 0.0\n ? 1.0\n : CubismMath.getEasingSine(\n (userTimeSeconds - motionQueueEntry.getFadeInStartTime()) /\n curves[c].fadeInTime,\n );\n }\n\n if (curves[c].fadeOutTime < 0.0) {\n fout = tmpFadeOut;\n } else {\n fout =\n curves[c].fadeOutTime == 0.0 ||\n motionQueueEntry.getEndTime() < 0.0\n ? 1.0\n : CubismMath.getEasingSine(\n (motionQueueEntry.getEndTime() - userTimeSeconds) /\n curves[c].fadeOutTime,\n );\n }\n\n const paramWeight: number = this._weight * fin * fout;\n\n // パラメータごとのフェードを適用\n v = sourceValue + (value - sourceValue) * paramWeight;\n }\n\n model.setParameterValueByIndex(parameterIndex, v, 1.0);\n }\n\n {\n if (eyeBlinkValue != Number.MAX_VALUE) {\n for (\n let i = 0;\n i < this._eyeBlinkParameterIds.length && i < MaxTargetSize;\n ++i\n ) {\n const sourceValue: number = model.getParameterValueById(\n this._eyeBlinkParameterIds[i],\n );\n\n // モーションでの上書きがあった時にはまばたきは適用しない\n if ((eyeBlinkFlags >> i) & 0x01) {\n continue;\n }\n\n const v: number =\n sourceValue + (eyeBlinkValue - sourceValue) * fadeWeight;\n\n model.setParameterValueById(this._eyeBlinkParameterIds[i], v);\n }\n }\n\n if (lipSyncValue != Number.MAX_VALUE) {\n for (\n let i = 0;\n i < this._lipSyncParameterIds.length && i < MaxTargetSize;\n ++i\n ) {\n const sourceValue: number = model.getParameterValueById(\n this._lipSyncParameterIds[i],\n );\n\n // モーションでの上書きがあった時にはリップシンクは適用しない\n if ((lipSyncFlags >> i) & 0x01) {\n continue;\n }\n\n const v: number =\n sourceValue + (lipSyncValue - sourceValue) * fadeWeight;\n\n model.setParameterValueById(this._lipSyncParameterIds[i], v);\n }\n }\n }\n\n for (\n ;\n c < this._motionData.curveCount &&\n curves[c].type ==\n CubismMotionCurveTarget.CubismMotionCurveTarget_PartOpacity;\n ++c\n ) {\n // Find parameter index.\n parameterIndex = model.getParameterIndex(curves[c].id);\n\n // Skip curve evaluation if no value in sink.\n if (parameterIndex == -1) {\n continue;\n }\n\n // Evaluate curve and apply value.\n value = evaluateCurve(this._motionData, c, time);\n\n model.setParameterValueByIndex(parameterIndex, value);\n }\n\n if (timeOffsetSeconds >= this._motionData.duration) {\n if (this._isLoop) {\n motionQueueEntry.setStartTime(userTimeSeconds); // 最初の状態へ\n if (this._isLoopFadeIn) {\n // ループ内でループ用フェードインが有効の時は、フェードイン設定し直し\n motionQueueEntry.setFadeInStartTime(userTimeSeconds);\n }\n } else {\n if (this._onFinishedMotion) {\n this._onFinishedMotion(this);\n }\n\n motionQueueEntry.setIsFinished(true);\n }\n }\n this._lastWeight = fadeWeight;\n }\n\n /**\n * ループ情報の設定\n * @param loop ループ情報\n */\n public setIsLoop(loop: boolean): void {\n this._isLoop = loop;\n }\n\n /**\n * ループ情報の取得\n * @return true ループする\n * @return false ループしない\n */\n public isLoop(): boolean {\n return this._isLoop;\n }\n\n /**\n * ループ時のフェードイン情報の設定\n * @param loopFadeIn ループ時のフェードイン情報\n */\n public setIsLoopFadeIn(loopFadeIn: boolean): void {\n this._isLoopFadeIn = loopFadeIn;\n }\n\n /**\n * ループ時のフェードイン情報の取得\n *\n * @return true する\n * @return false しない\n */\n public isLoopFadeIn(): boolean {\n return this._isLoopFadeIn;\n }\n\n /**\n * モーションの長さを取得する。\n *\n * @return モーションの長さ[秒]\n */\n public getDuration(): number {\n return this._isLoop ? -1.0 : this._loopDurationSeconds;\n }\n\n /**\n * モーションのループ時の長さを取得する。\n *\n * @return モーションのループ時の長さ[秒]\n */\n public getLoopDuration(): number {\n return this._loopDurationSeconds;\n }\n\n /**\n * パラメータに対するフェードインの時間を設定する。\n *\n * @param parameterId パラメータID\n * @param value フェードインにかかる時間[秒]\n */\n public setParameterFadeInTime(\n parameterId: string,\n value: number,\n ): void {\n const curves: CubismMotionCurve[] = this._motionData.curves;\n\n for (let i = 0; i < this._motionData.curveCount; ++i) {\n if (parameterId == curves[i].id) {\n curves[i].fadeInTime = value;\n return;\n }\n }\n }\n\n /**\n * パラメータに対するフェードアウトの時間の設定\n * @param parameterId パラメータID\n * @param value フェードアウトにかかる時間[秒]\n */\n public setParameterFadeOutTime(\n parameterId: string,\n value: number,\n ): void {\n const curves: CubismMotionCurve[] = this._motionData.curves;\n\n for (let i = 0; i < this._motionData.curveCount; ++i) {\n if (parameterId == curves[i].id) {\n curves[i].fadeOutTime = value;\n return;\n }\n }\n }\n\n /**\n * パラメータに対するフェードインの時間の取得\n * @param parameterId パラメータID\n * @return フェードインにかかる時間[秒]\n */\n public getParameterFadeInTime(parameterId: string): number {\n const curves: CubismMotionCurve[] = this._motionData.curves;\n\n for (let i = 0; i < this._motionData.curveCount; ++i) {\n if (parameterId == curves[i].id) {\n return curves[i].fadeInTime;\n }\n }\n\n return -1;\n }\n\n /**\n * パラメータに対するフェードアウトの時間を取得\n *\n * @param parameterId パラメータID\n * @return フェードアウトにかかる時間[秒]\n */\n public getParameterFadeOutTime(parameterId: string): number {\n const curves: CubismMotionCurve[] = this._motionData.curves;\n\n for (let i = 0; i < this._motionData.curveCount; ++i) {\n if (parameterId == curves[i].id) {\n return curves[i].fadeOutTime;\n }\n }\n\n return -1;\n }\n\n /**\n * 自動エフェクトがかかっているパラメータIDリストの設定\n * @param eyeBlinkParameterIds 自動まばたきがかかっているパラメータIDのリスト\n * @param lipSyncParameterIds リップシンクがかかっているパラメータIDのリスト\n */\n public setEffectIds(\n eyeBlinkParameterIds: string[],\n lipSyncParameterIds: string[],\n ): void {\n this._eyeBlinkParameterIds = eyeBlinkParameterIds;\n this._lipSyncParameterIds = lipSyncParameterIds;\n }\n\n /**\n * コンストラクタ\n */\n public constructor() {\n super();\n this._sourceFrameRate = 30.0;\n this._loopDurationSeconds = -1.0;\n this._isLoop = false; // trueから false へデフォルトを変更\n this._isLoopFadeIn = true; // ループ時にフェードインが有効かどうかのフラグ\n this._lastWeight = 0.0;\n }\n\n /**\n * デストラクタ相当の処理\n */\n public release(): void {\n (this as Partial<this>)._motionData = undefined;\n }\n\n /**\n * motion3.jsonをパースする。\n *\n * @param motionJson motion3.jsonが読み込まれているバッファ\n */\n public parse(motionJson: CubismSpec.MotionJSON): void {\n this._motionData = new CubismMotionData();\n\n let json: CubismMotionJson = new CubismMotionJson(motionJson);\n\n this._motionData.duration = json.getMotionDuration();\n this._motionData.loop = json.isMotionLoop();\n this._motionData.curveCount = json.getMotionCurveCount();\n this._motionData.fps = json.getMotionFps();\n this._motionData.eventCount = json.getEventCount();\n\n const fadeInSeconds = json.getMotionFadeInTime();\n const fadeOutSeconds = json.getMotionFadeOutTime();\n\n if (fadeInSeconds !== undefined) {\n this._fadeInSeconds = fadeInSeconds < 0.0 ? 1.0 : fadeInSeconds;\n } else {\n this._fadeInSeconds = 1.0;\n }\n\n if (fadeOutSeconds !== undefined) {\n this._fadeOutSeconds = fadeOutSeconds < 0.0 ? 1.0 : fadeOutSeconds;\n } else {\n this._fadeOutSeconds = 1.0;\n }\n\n this._motionData.curves = Array.from({ length: this._motionData.curveCount }).map(() => new CubismMotionCurve());\n this._motionData.segments = Array.from({ length: json.getMotionTotalSegmentCount() }).map(() => new CubismMotionSegment());\n this._motionData.events = Array.from({ length: this._motionData.eventCount }).map(() => new CubismMotionEvent());\n this._motionData.points = [];\n\n let totalPointCount = 0;\n let totalSegmentCount = 0;\n\n // Curves\n for (let curveCount = 0; curveCount < this._motionData.curveCount; ++curveCount) {\n const curve = this._motionData.curves[curveCount];\n\n switch (json.getMotionCurveTarget(curveCount)) {\n case TargetNameModel:\n curve.type = CubismMotionCurveTarget.CubismMotionCurveTarget_Model;\n break;\n\n case TargetNameParameter:\n curve.type = CubismMotionCurveTarget.CubismMotionCurveTarget_Parameter;\n break;\n\n case TargetNamePartOpacity:\n curve.type = CubismMotionCurveTarget.CubismMotionCurveTarget_PartOpacity;\n break;\n }\n\n curve.id = json.getMotionCurveId(curveCount);\n\n curve.baseSegmentIndex = totalSegmentCount;\n\n const fadeInTime = json.getMotionCurveFadeInTime(curveCount);\n const fadeOutTime = json.getMotionCurveFadeOutTime(curveCount);\n\n curve.fadeInTime = fadeInTime !== undefined ? fadeInTime : -1.0;\n curve.fadeOutTime = fadeOutTime !== undefined ? fadeOutTime : -1.0;\n\n // Segments\n for (\n let segmentPosition = 0;\n segmentPosition < json.getMotionCurveSegmentCount(curveCount);\n ) {\n if (segmentPosition == 0) {\n this._motionData.segments[totalSegmentCount].basePointIndex = totalPointCount;\n\n this._motionData.points[totalPointCount] = new CubismMotionPoint(\n json.getMotionCurveSegment(curveCount, segmentPosition),\n json.getMotionCurveSegment(curveCount, segmentPosition + 1),\n );\n\n totalPointCount += 1;\n segmentPosition += 2;\n } else {\n this._motionData.segments[totalSegmentCount].basePointIndex =\n totalPointCount - 1;\n }\n\n const segment: number = json.getMotionCurveSegment(\n curveCount,\n segmentPosition,\n );\n switch (segment) {\n case CubismMotionSegmentType.CubismMotionSegmentType_Linear: {\n this._motionData.segments[totalSegmentCount].segmentType =\n CubismMotionSegmentType.CubismMotionSegmentType_Linear;\n this._motionData.segments[totalSegmentCount].evaluate = linearEvaluate;\n\n this._motionData.points[totalPointCount] = new CubismMotionPoint(\n json.getMotionCurveSegment(curveCount, segmentPosition + 1),\n json.getMotionCurveSegment(curveCount, segmentPosition + 2),\n );\n\n totalPointCount += 1;\n segmentPosition += 3;\n\n break;\n }\n case CubismMotionSegmentType.CubismMotionSegmentType_Bezier: {\n this._motionData.segments[totalSegmentCount].segmentType =\n CubismMotionSegmentType.CubismMotionSegmentType_Bezier;\n this._motionData.segments[totalSegmentCount].evaluate = bezierEvaluate;\n\n this._motionData.points[totalPointCount] = new CubismMotionPoint(\n json.getMotionCurveSegment(curveCount, segmentPosition + 1),\n json.getMotionCurveSegment(curveCount, segmentPosition + 2),\n );\n\n this._motionData.points[totalPointCount + 1] = new CubismMotionPoint(\n json.getMotionCurveSegment(curveCount, segmentPosition + 3),\n json.getMotionCurveSegment(curveCount, segmentPosition + 4),\n );\n\n this._motionData.points[totalPointCount + 2] = new CubismMotionPoint(\n json.getMotionCurveSegment(curveCount, segmentPosition + 5),\n json.getMotionCurveSegment(curveCount, segmentPosition + 6),\n );\n\n totalPointCount += 3;\n segmentPosition += 7;\n\n break;\n }\n\n case CubismMotionSegmentType.CubismMotionSegmentType_Stepped: {\n this._motionData.segments[totalSegmentCount].segmentType =\n CubismMotionSegmentType.CubismMotionSegmentType_Stepped;\n this._motionData.segments[totalSegmentCount].evaluate = steppedEvaluate;\n\n this._motionData.points[totalPointCount] = new CubismMotionPoint(\n json.getMotionCurveSegment(curveCount, segmentPosition + 1),\n json.getMotionCurveSegment(curveCount, segmentPosition + 2),\n );\n\n totalPointCount += 1;\n segmentPosition += 3;\n\n break;\n }\n\n case CubismMotionSegmentType.CubismMotionSegmentType_InverseStepped: {\n this._motionData.segments[totalSegmentCount].segmentType =\n CubismMotionSegmentType.CubismMotionSegmentType_InverseStepped;\n this._motionData.segments[totalSegmentCount].evaluate = inverseSteppedEvaluate;\n\n this._motionData.points[totalPointCount] = new CubismMotionPoint(\n json.getMotionCurveSegment(curveCount, segmentPosition + 1),\n json.getMotionCurveSegment(curveCount, segmentPosition + 2),\n );\n\n totalPointCount += 1;\n segmentPosition += 3;\n\n break;\n }\n default: {\n CSM_ASSERT(0);\n break;\n }\n }\n\n ++curve.segmentCount;\n ++totalSegmentCount;\n }\n\n this._motionData.curves.push(curve);\n }\n\n for (\n let userdatacount = 0;\n userdatacount < json.getEventCount();\n ++userdatacount\n ) {\n this._motionData.events[userdatacount].fireTime = json.getEventTime(\n userdatacount,\n );\n this._motionData.events[userdatacount].value = json.getEventValue(\n userdatacount,\n );\n }\n\n json.release();\n }\n\n /**\n * モデルのパラメータ更新\n *\n * イベント発火のチェック。\n * 入力する時間は呼ばれるモーションタイミングを0とした秒数で行う。\n *\n * @param beforeCheckTimeSeconds 前回のイベントチェック時間[秒]\n * @param motionTimeSeconds 今回の再生時間[秒]\n */\n public getFiredEvent(\n beforeCheckTimeSeconds: number,\n motionTimeSeconds: number,\n ): string[] {\n this._firedEventValues.length = 0;\n\n // イベントの発火チェック\n for (let u = 0; u < this._motionData.eventCount; ++u) {\n if (\n this._motionData.events[u].fireTime > beforeCheckTimeSeconds &&\n this._motionData.events[u].fireTime <= motionTimeSeconds\n ) {\n this._firedEventValues.push(this._motionData.events[u].value);\n }\n }\n\n return this._firedEventValues;\n }\n\n public _sourceFrameRate: number; // ロードしたファイルのFPS。記述が無ければデフォルト値15fpsとなる\n public _loopDurationSeconds: number; // mtnファイルで定義される一連のモーションの長さ\n public _isLoop: boolean; // ループするか?\n public _isLoopFadeIn: boolean; // ループ時にフェードインが有効かどうかのフラグ。初期値では有効。\n public _lastWeight: number; // 最後に設定された重み\n\n public _motionData!: CubismMotionData; // 実際のモーションデータ本体\n\n public _eyeBlinkParameterIds: string[] = []; // 自動まばたきを適用するパラメータIDハンドルのリスト。 モデル(モデルセッティング)とパラメータを対応付ける。\n public _lipSyncParameterIds: string[] = []; // リップシンクを適用するパラメータIDハンドルのリスト。 モデル(モデルセッティング)とパラメータを対応付ける。\n\n public _modelCurveIdEyeBlink?: string; // モデルが持つ自動まばたき用パラメータIDのハンドル。 モデルとモーションを対応付ける。\n public _modelCurveIdLipSync?: string; // モデルが持つリップシンク用パラメータIDのハンドル。 モデルとモーションを対応付ける。\n}\n","import { MotionManager, MotionManagerOptions } from '@/cubism-common/MotionManager';\nimport { Cubism4ExpressionManager } from '@/cubism4/Cubism4ExpressionManager';\nimport { Cubism4ModelSettings } from '@/cubism4/Cubism4ModelSettings';\nimport { CubismModel } from '@cubism/model/cubismmodel';\nimport { ACubismMotion } from '@cubism/motion/acubismmotion';\nimport { CubismMotion } from '@cubism/motion/cubismmotion';\nimport { CubismMotionQueueManager } from '@cubism/motion/cubismmotionqueuemanager';\nimport { config } from '@/config';\n\nexport class Cubism4MotionManager extends MotionManager<CubismMotion, CubismSpec.Motion> {\n readonly definitions: Partial<Record<string, CubismSpec.Motion[]>>;\n\n readonly groups = { idle: 'Idle' } as const;\n\n readonly motionDataType = 'json';\n\n readonly queueManager = new CubismMotionQueueManager();\n\n readonly settings!: Cubism4ModelSettings;\n\n expressionManager?: Cubism4ExpressionManager;\n\n eyeBlinkIds: string[];\n lipSyncIds: string[];\n\n constructor(settings: Cubism4ModelSettings, options?: MotionManagerOptions) {\n super(settings, options);\n\n this.definitions = settings.motions ?? {};\n this.eyeBlinkIds = settings.getEyeBlinkParameters() || [];\n this.lipSyncIds = settings.getLipSyncParameters() || [];\n\n this.init(options);\n }\n\n protected init(options?: MotionManagerOptions) {\n super.init(options);\n\n if (this.settings.expressions) {\n this.expressionManager = new Cubism4ExpressionManager(this.settings, options);\n }\n\n this.queueManager.setEventCallback((caller, eventValue, customData) => {\n this.emit('motion:' + eventValue);\n });\n }\n\n isFinished(): boolean {\n return this.queueManager.isFinished();\n }\n\n protected _startMotion(motion: CubismMotion, onFinish?: (motion: CubismMotion) => void): number {\n motion.setFinishedMotionHandler(onFinish as (motion: ACubismMotion) => void);\n\n this.queueManager.stopAllMotions();\n\n return this.queueManager.startMotion(motion, false, performance.now());\n }\n\n protected _stopAllMotions(): void {\n this.queueManager.stopAllMotions();\n }\n\n createMotion(data: object, group: string, definition: CubismSpec.Motion): CubismMotion {\n const motion = CubismMotion.create(data as unknown as CubismSpec.MotionJSON);\n\n const defaultFadingDuration = (\n group === this.groups.idle\n ? config.idleMotionFadingDuration\n : config.motionFadingDuration\n ) / 1000;\n\n motion.setFadeInTime(definition.FadeInTime! > 0 ? definition.FadeInTime! : defaultFadingDuration);\n motion.setFadeOutTime(definition.FadeOutTime! > 0 ? definition.FadeOutTime! : defaultFadingDuration);\n\n motion.setEffectIds(this.eyeBlinkIds, this.lipSyncIds);\n\n return motion;\n }\n\n getMotionFile(definition: CubismSpec.Motion): string {\n return definition.File;\n }\n\n protected getMotionName(definition: CubismSpec.Motion): string {\n return definition.File;\n }\n\n protected getSoundFile(definition: CubismSpec.Motion): string | undefined {\n return definition.Sound;\n }\n\n protected updateParameters(model: CubismModel, now: DOMHighResTimeStamp): boolean {\n return this.queueManager.doUpdateMotion(model, now);\n }\n\n destroy() {\n super.destroy();\n\n this.queueManager.release();\n (this as Partial<Mutable<this>>).queueManager = undefined;\n }\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\nimport { CubismModel } from '../model/cubismmodel';\n\n/**\n * 呼吸機能\n *\n * 呼吸機能を提供する。\n */\nexport class CubismBreath {\n /**\n * インスタンスの作成\n */\n public static create(): CubismBreath {\n return new CubismBreath();\n }\n\n /**\n * 呼吸のパラメータの紐づけ\n * @param breathParameters 呼吸を紐づけたいパラメータのリスト\n */\n public setParameters(\n breathParameters: BreathParameterData[],\n ): void {\n this._breathParameters = breathParameters;\n }\n\n /**\n * 呼吸に紐づいているパラメータの取得\n * @return 呼吸に紐づいているパラメータのリスト\n */\n public getParameters(): BreathParameterData[] {\n return this._breathParameters;\n }\n\n /**\n * モデルのパラメータの更新\n * @param model 対象のモデル\n * @param deltaTimeSeconds デルタ時間[秒]\n */\n public updateParameters(\n model: CubismModel,\n deltaTimeSeconds: number,\n ): void {\n this._currentTime += deltaTimeSeconds;\n\n const t: number = this._currentTime * 2.0 * 3.14159;\n\n for (let i = 0; i < this._breathParameters.length; ++i) {\n const data: BreathParameterData = this._breathParameters[i];\n\n model.addParameterValueById(\n data.parameterId,\n data.offset + data.peak * Math.sin(t / data.cycle),\n data.weight,\n );\n }\n }\n\n /**\n * コンストラクタ\n */\n public constructor() {\n this._currentTime = 0.0;\n }\n\n _breathParameters: BreathParameterData[] = []; // 呼吸にひもづいているパラメータのリスト\n _currentTime: number; // 積算時間[秒]\n}\n\n/**\n * 呼吸のパラメータ情報\n */\nexport class BreathParameterData {\n /**\n * コンストラクタ\n * @param parameterId 呼吸をひもづけるパラメータID\n * @param offset 呼吸を正弦波としたときの、波のオフセット\n * @param peak 呼吸を正弦波としたときの、波の高さ\n * @param cycle 呼吸を正弦波としたときの、波の周期\n * @param weight パラメータへの重み\n */\n constructor(\n parameterId?: string,\n offset?: number,\n peak?: number,\n cycle?: number,\n weight?: number,\n ) {\n this.parameterId = parameterId == undefined ? undefined : parameterId;\n this.offset = offset == undefined ? 0.0 : offset;\n this.peak = peak == undefined ? 0.0 : peak;\n this.cycle = cycle == undefined ? 0.0 : cycle;\n this.weight = weight == undefined ? 0.0 : weight;\n }\n\n parameterId?: string; // 呼吸をひもづけるパラメータID\\\n offset: number; // 呼吸を正弦波としたときの、波のオフセット\n peak: number; // 呼吸を正弦波としたときの、波の高さ\n cycle: number; // 呼吸を正弦波としたときの、波の周期\n weight: number; // パラメータへの重み\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\nimport { CubismModel } from '../model/cubismmodel';\nimport { CubismModelSettingsJson } from '../settings/cubismmodelsettingsjson';\n\n/**\n * 自動まばたき機能\n *\n * 自動まばたき機能を提供する。\n */\nexport class CubismEyeBlink {\n /**\n * インスタンスを作成する\n * @param modelSetting モデルの設定情報\n * @return 作成されたインスタンス\n * @note 引数がNULLの場合、パラメータIDが設定されていない空のインスタンスを作成する。\n */\n public static create(\n modelSetting: CubismModelSettingsJson,\n ): CubismEyeBlink {\n return new CubismEyeBlink(modelSetting);\n }\n\n /**\n * まばたきの間隔の設定\n * @param blinkingInterval まばたきの間隔の時間[秒]\n */\n public setBlinkingInterval(blinkingInterval: number): void {\n this._blinkingIntervalSeconds = blinkingInterval;\n }\n\n /**\n * まばたきのモーションの詳細設定\n * @param closing まぶたを閉じる動作の所要時間[秒]\n * @param closed まぶたを閉じている動作の所要時間[秒]\n * @param opening まぶたを開く動作の所要時間[秒]\n */\n public setBlinkingSetting(\n closing: number,\n closed: number,\n opening: number,\n ): void {\n this._closingSeconds = closing;\n this._closedSeconds = closed;\n this._openingSeconds = opening;\n }\n\n /**\n * まばたきさせるパラメータIDのリストの設定\n * @param parameterIds パラメータのIDのリスト\n */\n public setParameterIds(parameterIds: string[]): void {\n this._parameterIds = parameterIds;\n }\n\n /**\n * まばたきさせるパラメータIDのリストの取得\n * @return パラメータIDのリスト\n */\n public getParameterIds(): string[] {\n return this._parameterIds;\n }\n\n /**\n * モデルのパラメータの更新\n * @param model 対象のモデル\n * @param deltaTimeSeconds デルタ時間[秒]\n */\n public updateParameters(\n model: CubismModel,\n deltaTimeSeconds: number,\n ): void {\n this._userTimeSeconds += deltaTimeSeconds;\n let parameterValue: number;\n let t = 0.0;\n\n switch (this._blinkingState) {\n case EyeState.EyeState_Closing:\n t =\n (this._userTimeSeconds - this._stateStartTimeSeconds) /\n this._closingSeconds;\n\n if (t >= 1.0) {\n t = 1.0;\n this._blinkingState = EyeState.EyeState_Closed;\n this._stateStartTimeSeconds = this._userTimeSeconds;\n }\n\n parameterValue = 1.0 - t;\n\n break;\n case EyeState.EyeState_Closed:\n t =\n (this._userTimeSeconds - this._stateStartTimeSeconds) /\n this._closedSeconds;\n\n if (t >= 1.0) {\n this._blinkingState = EyeState.EyeState_Opening;\n this._stateStartTimeSeconds = this._userTimeSeconds;\n }\n\n parameterValue = 0.0;\n\n break;\n case EyeState.EyeState_Opening:\n t =\n (this._userTimeSeconds - this._stateStartTimeSeconds) /\n this._openingSeconds;\n\n if (t >= 1.0) {\n t = 1.0;\n this._blinkingState = EyeState.EyeState_Interval;\n this._nextBlinkingTime = this.determinNextBlinkingTiming();\n }\n\n parameterValue = t;\n\n break;\n case EyeState.EyeState_Interval:\n if (this._nextBlinkingTime < this._userTimeSeconds) {\n this._blinkingState = EyeState.EyeState_Closing;\n this._stateStartTimeSeconds = this._userTimeSeconds;\n }\n\n parameterValue = 1.0;\n\n break;\n case EyeState.EyeState_First:\n default:\n this._blinkingState = EyeState.EyeState_Interval;\n this._nextBlinkingTime = this.determinNextBlinkingTiming();\n\n parameterValue = 1.0;\n break;\n }\n\n if (!CubismEyeBlink.CloseIfZero) {\n parameterValue = -parameterValue;\n }\n\n for (let i = 0; i < this._parameterIds.length; ++i) {\n model.setParameterValueById(this._parameterIds[i], parameterValue);\n }\n }\n\n /**\n * コンストラクタ\n * @param modelSetting モデルの設定情報\n */\n public constructor(modelSetting: CubismModelSettingsJson) {\n this._blinkingState = EyeState.EyeState_First;\n this._nextBlinkingTime = 0.0;\n this._stateStartTimeSeconds = 0.0;\n this._blinkingIntervalSeconds = 4.0;\n this._closingSeconds = 0.1;\n this._closedSeconds = 0.05;\n this._openingSeconds = 0.15;\n this._userTimeSeconds = 0.0;\n this._parameterIds = [];\n\n if (modelSetting == null) {\n return;\n }\n\n this._parameterIds = modelSetting.getEyeBlinkParameters()?.slice() ?? this._parameterIds;\n }\n\n /**\n * 次の瞬きのタイミングの決定\n *\n * @return 次のまばたきを行う時刻[秒]\n */\n public determinNextBlinkingTiming(): number {\n const r: number = Math.random();\n return (\n this._userTimeSeconds + r * (2.0 * this._blinkingIntervalSeconds - 1.0)\n );\n }\n\n _blinkingState: number; // 現在の状態\n _parameterIds: string[]; // 操作対象のパラメータのIDのリスト\n _nextBlinkingTime: number; // 次のまばたきの時刻[秒]\n _stateStartTimeSeconds: number; // 現在の状態が開始した時刻[秒]\n _blinkingIntervalSeconds: number; // まばたきの間隔[秒]\n _closingSeconds: number; // まぶたを閉じる動作の所要時間[秒]\n _closedSeconds: number; // まぶたを閉じている動作の所要時間[秒]\n _openingSeconds: number; // まぶたを開く動作の所要時間[秒]\n _userTimeSeconds: number; // デルタ時間の積算値[秒]\n\n /**\n * IDで指定された目のパラメータが、0のときに閉じるなら true 、1の時に閉じるなら false 。\n */\n static readonly CloseIfZero: boolean = true;\n}\n\n/**\n * まばたきの状態\n *\n * まばたきの状態を表す列挙型\n */\nexport enum EyeState {\n EyeState_First = 0, // 初期状態\n EyeState_Interval, // まばたきしていない状態\n EyeState_Closing, // まぶたが閉じていく途中の状態\n EyeState_Closed, // まぶたが閉じている状態\n EyeState_Opening // まぶたが開いていく途中の状態\n}\n","export namespace config {\n export let supportMoreMaskDivisions = true;\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\n/**\n * 矩形形状(座標・長さはfloat値)を定義するクラス\n */\nexport class csmRect {\n /**\n * コンストラクタ\n * @param x 左端X座標\n * @param y 上端Y座標\n * @param w 幅\n * @param h 高さ\n */\n public constructor(x = 0, y = 0, w = 0, h = 0) {\n this.x = x;\n this.y = y;\n this.width = w;\n this.height = h;\n }\n\n /**\n * 矩形中央のX座標を取得する\n */\n public getCenterX(): number {\n return this.x + 0.5 * this.width;\n }\n\n /**\n * 矩形中央のY座標を取得する\n */\n public getCenterY(): number {\n return this.y + 0.5 * this.height;\n }\n\n /**\n * 右側のX座標を取得する\n */\n public getRight(): number {\n return this.x + this.width;\n }\n\n /**\n * 下端のY座標を取得する\n */\n public getBottom(): number {\n return this.y + this.height;\n }\n\n /**\n * 矩形に値をセットする\n * @param r 矩形のインスタンス\n */\n public setRect(r: csmRect): void {\n this.x = r.x;\n this.y = r.y;\n this.width = r.width;\n this.height = r.height;\n }\n\n /**\n * 矩形中央を軸にして縦横を拡縮する\n * @param w 幅方向に拡縮する量\n * @param h 高さ方向に拡縮する量\n */\n public expand(w: number, h: number) {\n this.x -= w;\n this.y -= h;\n this.width += w * 2.0;\n this.height += h * 2.0;\n }\n\n public x: number; // 左端X座標\n public y: number; // 上端Y座標\n public width: number; // 幅\n public height: number; // 高さ\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\nimport { Constant } from '../live2dcubismframework';\nimport { CubismMatrix44 } from '../math/cubismmatrix44';\nimport { CubismModel } from '../model/cubismmodel';\nimport { csmRect } from '../type/csmrectf';\nimport { CubismLogError } from '../utils/cubismdebug';\nimport { CubismBlendMode, CubismRenderer, CubismTextureColor } from './cubismrenderer';\nimport { config } from '../config';\n\nconst ColorChannelCount = 4; // 実験時に1チャンネルの場合は1、RGBだけの場合は3、アルファも含める場合は4\n\nconst shaderCount = 10; // シェーダーの数 = マスク生成用 + (通常用 + 加算 + 乗算) * (マスク無の乗算済アルファ対応版 + マスク有の乗算済アルファ対応版 + マスク有反転の乗算済アルファ対応版)\nlet s_instance: CubismShader_WebGL | undefined;\nlet s_viewport: number[];\nlet s_fbo: WebGLFramebuffer;\n\n/**\n * クリッピングマスクの処理を実行するクラス\n */\nexport class CubismClippingManager_WebGL {\n /**\n * カラーチャンネル(RGBA)のフラグを取得する\n * @param channelNo カラーチャンネル(RGBA)の番号(0:R, 1:G, 2:B, 3:A)\n */\n public getChannelFlagAsColor(channelNo: number): CubismTextureColor {\n return this._channelColors[channelNo];\n }\n\n /**\n * テンポラリのレンダーテクスチャのアドレスを取得する\n * FrameBufferObjectが存在しない場合、新しく生成する\n *\n * @return レンダーテクスチャのアドレス\n */\n public getMaskRenderTexture(): WebGLFramebuffer | null {\n let ret: WebGLFramebuffer | null = 0;\n\n // テンポラリのRenderTextureを取得する\n if (this._maskTexture && this._maskTexture.texture != 0) {\n // 前回使ったものを返す\n this._maskTexture.frameNo = this._currentFrameNo;\n ret = this._maskTexture.texture;\n }\n\n if (ret == 0) {\n // FrameBufferObjectが存在しない場合、新しく生成する\n\n // クリッピングバッファサイズを取得\n const size: number = this._clippingMaskBufferSize;\n\n this._colorBuffer = this.gl.createTexture();\n this.gl.bindTexture(this.gl.TEXTURE_2D, this._colorBuffer);\n this.gl.texImage2D(\n this.gl.TEXTURE_2D,\n 0,\n this.gl.RGBA,\n size,\n size,\n 0,\n this.gl.RGBA,\n this.gl.UNSIGNED_BYTE,\n null,\n );\n this.gl.texParameteri(\n this.gl.TEXTURE_2D,\n this.gl.TEXTURE_WRAP_S,\n this.gl.CLAMP_TO_EDGE,\n );\n this.gl.texParameteri(\n this.gl.TEXTURE_2D,\n this.gl.TEXTURE_WRAP_T,\n this.gl.CLAMP_TO_EDGE,\n );\n this.gl.texParameteri(\n this.gl.TEXTURE_2D,\n this.gl.TEXTURE_MIN_FILTER,\n this.gl.LINEAR,\n );\n this.gl.texParameteri(\n this.gl.TEXTURE_2D,\n this.gl.TEXTURE_MAG_FILTER,\n this.gl.LINEAR,\n );\n this.gl.bindTexture(this.gl.TEXTURE_2D, null);\n\n ret = this.gl.createFramebuffer();\n this.gl.bindFramebuffer(this.gl.FRAMEBUFFER, ret);\n this.gl.framebufferTexture2D(\n this.gl.FRAMEBUFFER,\n this.gl.COLOR_ATTACHMENT0,\n this.gl.TEXTURE_2D,\n this._colorBuffer,\n 0,\n );\n this.gl.bindFramebuffer(this.gl.FRAMEBUFFER, s_fbo);\n\n this._maskTexture = new CubismRenderTextureResource(\n this._currentFrameNo,\n ret,\n );\n }\n\n return ret;\n }\n\n /**\n * WebGLレンダリングコンテキストを設定する\n * @param gl WebGLレンダリングコンテキスト\n */\n public setGL(gl: WebGLRenderingContext): void {\n this.gl = gl;\n }\n\n /**\n * マスクされる描画オブジェクト群全体を囲む矩形(モデル座標系)を計算する\n * @param model モデルのインスタンス\n * @param clippingContext クリッピングマスクのコンテキスト\n */\n public calcClippedDrawTotalBounds(\n model: CubismModel,\n clippingContext: CubismClippingContext,\n ): void {\n // 被クリッピングマスク(マスクされる描画オブジェクト)の全体の矩形\n let clippedDrawTotalMinX: number = Number.MAX_VALUE;\n let clippedDrawTotalMinY: number = Number.MAX_VALUE;\n let clippedDrawTotalMaxX: number = Number.MIN_VALUE;\n let clippedDrawTotalMaxY: number = Number.MIN_VALUE;\n\n // このマスクが実際に必要か判定する\n // このクリッピングを利用する「描画オブジェクト」がひとつでも使用可能であればマスクを生成する必要がある\n const clippedDrawCount: number =\n clippingContext._clippedDrawableIndexList.length;\n\n for (\n let clippedDrawableIndex = 0;\n clippedDrawableIndex < clippedDrawCount;\n clippedDrawableIndex++\n ) {\n // マスクを使用する描画オブジェクトの描画される矩形を求める\n const drawableIndex: number =\n clippingContext._clippedDrawableIndexList[clippedDrawableIndex];\n\n const drawableVertexCount: number = model.getDrawableVertexCount(\n drawableIndex,\n );\n const drawableVertexes: Float32Array = model.getDrawableVertices(\n drawableIndex,\n );\n\n let minX: number = Number.MAX_VALUE;\n let minY: number = Number.MAX_VALUE;\n let maxX: number = Number.MIN_VALUE;\n let maxY: number = Number.MIN_VALUE;\n\n const loop: number = drawableVertexCount * Constant.vertexStep;\n for (\n let pi: number = Constant.vertexOffset;\n pi < loop;\n pi += Constant.vertexStep\n ) {\n const x: number = drawableVertexes[pi];\n const y: number = drawableVertexes[pi + 1];\n\n if (x < minX) {\n minX = x;\n }\n if (x > maxX) {\n maxX = x;\n }\n if (y < minY) {\n minY = y;\n }\n if (y > maxY) {\n maxY = y;\n }\n }\n\n // 有効な点が一つも取れなかったのでスキップ\n if (minX == Number.MAX_VALUE) {\n continue;\n }\n\n // 全体の矩形に反映\n if (minX < clippedDrawTotalMinX) {\n clippedDrawTotalMinX = minX;\n }\n if (minY < clippedDrawTotalMinY) {\n clippedDrawTotalMinY = minY;\n }\n if (maxX > clippedDrawTotalMaxX) {\n clippedDrawTotalMaxX = maxX;\n }\n if (maxY > clippedDrawTotalMaxY) {\n clippedDrawTotalMaxY = maxY;\n }\n\n if (clippedDrawTotalMinX == Number.MAX_VALUE) {\n clippingContext._allClippedDrawRect.x = 0.0;\n clippingContext._allClippedDrawRect.y = 0.0;\n clippingContext._allClippedDrawRect.width = 0.0;\n clippingContext._allClippedDrawRect.height = 0.0;\n clippingContext._isUsing = false;\n } else {\n clippingContext._isUsing = true;\n const w: number = clippedDrawTotalMaxX - clippedDrawTotalMinX;\n const h: number = clippedDrawTotalMaxY - clippedDrawTotalMinY;\n clippingContext._allClippedDrawRect.x = clippedDrawTotalMinX;\n clippingContext._allClippedDrawRect.y = clippedDrawTotalMinY;\n clippingContext._allClippedDrawRect.width = w;\n clippingContext._allClippedDrawRect.height = h;\n }\n }\n }\n\n /**\n * コンストラクタ\n */\n public constructor() {\n this._maskRenderTexture = null;\n this._colorBuffer = null;\n this._currentFrameNo = 0;\n this._clippingMaskBufferSize = 256;\n this._clippingContextListForMask = [];\n this._clippingContextListForDraw = [];\n this._channelColors = [];\n this._tmpBoundsOnModel = new csmRect();\n this._tmpMatrix = new CubismMatrix44();\n this._tmpMatrixForMask = new CubismMatrix44();\n this._tmpMatrixForDraw = new CubismMatrix44();\n\n let tmp: CubismTextureColor = new CubismTextureColor();\n tmp.R = 1.0;\n tmp.G = 0.0;\n tmp.B = 0.0;\n tmp.A = 0.0;\n this._channelColors.push(tmp);\n\n tmp = new CubismTextureColor();\n tmp.R = 0.0;\n tmp.G = 1.0;\n tmp.B = 0.0;\n tmp.A = 0.0;\n this._channelColors.push(tmp);\n\n tmp = new CubismTextureColor();\n tmp.R = 0.0;\n tmp.G = 0.0;\n tmp.B = 1.0;\n tmp.A = 0.0;\n this._channelColors.push(tmp);\n\n tmp = new CubismTextureColor();\n tmp.R = 0.0;\n tmp.G = 0.0;\n tmp.B = 0.0;\n tmp.A = 1.0;\n this._channelColors.push(tmp);\n }\n\n /**\n * デストラクタ相当の処理\n */\n public release(): void {\n const self = this as Partial<this>;\n\n for (let i = 0; i < this._clippingContextListForMask.length; i++) {\n if (this._clippingContextListForMask[i]) {\n this._clippingContextListForMask[i]?.release();\n }\n }\n self._clippingContextListForMask = undefined;\n\n // _clippingContextListForDrawは_clippingContextListForMaskにあるインスタンスを指している。上記の処理により要素ごとのDELETEは不要。\n self._clippingContextListForDraw = undefined;\n\n if (this._maskTexture) {\n this.gl?.deleteFramebuffer(this._maskTexture.texture);\n self._maskTexture = undefined;\n }\n\n self._channelColors = undefined;\n\n // テクスチャ解放\n this.gl?.deleteTexture(this._colorBuffer);\n this._colorBuffer = null;\n }\n\n /**\n * マネージャの初期化処理\n * クリッピングマスクを使う描画オブジェクトの登録を行う\n * @param model モデルのインスタンス\n * @param drawableCount 描画オブジェクトの数\n * @param drawableMasks 描画オブジェクトをマスクする描画オブジェクトのインデックスのリスト\n * @param drawableCounts 描画オブジェクトをマスクする描画オブジェクトの数\n */\n public initialize(\n model: CubismModel,\n drawableCount: number,\n drawableMasks: Int32Array[],\n drawableMaskCounts: Int32Array,\n ): void {\n // クリッピングマスクを使う描画オブジェクトをすべて登録する\n // クリッピングマスクは、通常数個程度に限定して使うものとする\n for (let i = 0; i < drawableCount; i++) {\n if (drawableMaskCounts[i] <= 0) {\n // クリッピングマスクが使用されていないアートメッシュ(多くの場合使用しない)\n this._clippingContextListForDraw.push(null);\n continue;\n }\n\n // 既にあるClipContextと同じかチェックする\n let clippingContext = this.findSameClip(\n drawableMasks[i],\n drawableMaskCounts[i],\n );\n if (clippingContext == null) {\n // 同一のマスクが存在していない場合は生成する\n clippingContext = new CubismClippingContext(\n this,\n drawableMasks[i],\n drawableMaskCounts[i],\n );\n this._clippingContextListForMask.push(clippingContext);\n }\n\n clippingContext.addClippedDrawable(i);\n\n this._clippingContextListForDraw.push(clippingContext);\n }\n }\n\n /**\n * クリッピングコンテキストを作成する。モデル描画時に実行する。\n * @param model モデルのインスタンス\n * @param renderer レンダラのインスタンス\n */\n public setupClippingContext(\n model: CubismModel,\n renderer: CubismRenderer_WebGL,\n ): void {\n this._currentFrameNo++;\n\n // 全てのクリッピングを用意する\n // 同じクリップ(複数の場合はまとめて一つのクリップ)を使う場合は1度だけ設定する\n let usingClipCount = 0;\n for (\n let clipIndex = 0;\n clipIndex < this._clippingContextListForMask.length;\n clipIndex++\n ) {\n // 1つのクリッピングマスクに関して\n const cc = this._clippingContextListForMask[clipIndex];\n\n // このクリップを利用する描画オブジェクト群全体を囲む矩形を計算\n this.calcClippedDrawTotalBounds(model, cc);\n\n if (cc._isUsing) {\n usingClipCount++; // 使用中としてカウント\n }\n }\n\n // マスク作成処理\n if (usingClipCount > 0) {\n // 生成したFrameBufferと同じサイズでビューポートを設定\n this.gl.viewport(\n 0,\n 0,\n this._clippingMaskBufferSize,\n this._clippingMaskBufferSize,\n );\n\n // マスクをactiveにする\n this._maskRenderTexture = this.getMaskRenderTexture();\n\n // モデル描画時にDrawMeshNowに渡される変換(モデルtoワールド座標変換)\n const modelToWorldF: CubismMatrix44 = renderer.getMvpMatrix();\n\n renderer.preDraw(); // バッファをクリアする\n\n // 各マスクのレイアウトを決定していく\n this.setupLayoutBounds(usingClipCount);\n\n // ---------- マスク描画処理 ----------\n // マスク用RenderTextureをactiveにセット\n this.gl.bindFramebuffer(this.gl.FRAMEBUFFER, this._maskRenderTexture);\n\n // マスクをクリアする\n // (仮仕様) 1が無効(描かれない)領域、0が有効(描かれる)領域。(シェーダーCd*Csで0に近い値をかけてマスクを作る。1をかけると何も起こらない)\n this.gl.clearColor(1.0, 1.0, 1.0, 1.0);\n this.gl.clear(this.gl.COLOR_BUFFER_BIT);\n\n // 実際にマスクを生成する\n // 全てのマスクをどのようにレイアウトして描くかを決定し、ClipContext, ClippedDrawContextに記憶する\n for (\n let clipIndex = 0;\n clipIndex < this._clippingContextListForMask.length;\n clipIndex++\n ) {\n // --- 実際に1つのマスクを描く ---\n const clipContext: CubismClippingContext = this._clippingContextListForMask[clipIndex];\n const allClipedDrawRect: csmRect = clipContext._allClippedDrawRect; // このマスクを使う、すべての描画オブジェクトの論理座標上の囲み矩形\n const layoutBoundsOnTex01: csmRect = clipContext._layoutBounds; // この中にマスクを収める\n\n // モデル座標上の矩形を、適宜マージンを付けて使う\n const MARGIN = 0.05;\n this._tmpBoundsOnModel.setRect(allClipedDrawRect);\n this._tmpBoundsOnModel.expand(\n allClipedDrawRect.width * MARGIN,\n allClipedDrawRect.height * MARGIN,\n );\n //########## 本来は割り当てられた領域の全体を使わず必要最低限のサイズがよい\n\n // シェーダ用の計算式を求める。回転を考慮しない場合は以下のとおり\n // movePeriod' = movePeriod * scaleX + offX\t\t [[ movePeriod' = (movePeriod - tmpBoundsOnModel.movePeriod)*scale + layoutBoundsOnTex01.movePeriod ]]\n const scaleX: number = layoutBoundsOnTex01.width / this._tmpBoundsOnModel.width;\n const scaleY: number = layoutBoundsOnTex01.height / this._tmpBoundsOnModel.height;\n\n // マスク生成時に使う行列を求める\n {\n // シェーダに渡す行列を求める <<<<<<<<<<<<<<<<<<<<<<<< 要最適化(逆順に計算すればシンプルにできる)\n this._tmpMatrix.loadIdentity();\n {\n // layout0..1 を -1..1に変換\n this._tmpMatrix.translateRelative(-1.0, -1.0);\n this._tmpMatrix.scaleRelative(2.0, 2.0);\n }\n {\n // view to layout0..1\n this._tmpMatrix.translateRelative(\n layoutBoundsOnTex01.x,\n layoutBoundsOnTex01.y,\n );\n this._tmpMatrix.scaleRelative(scaleX, scaleY); // new = [translate][scale]\n this._tmpMatrix.translateRelative(\n -this._tmpBoundsOnModel.x,\n -this._tmpBoundsOnModel.y,\n );\n // new = [translate][scale][translate]\n }\n // tmpMatrixForMaskが計算結果\n this._tmpMatrixForMask.setMatrix(this._tmpMatrix.getArray());\n }\n\n //--------- draw時の mask 参照用行列を計算\n {\n // シェーダに渡す行列を求める <<<<<<<<<<<<<<<<<<<<<<<< 要最適化(逆順に計算すればシンプルにできる)\n this._tmpMatrix.loadIdentity();\n {\n this._tmpMatrix.translateRelative(\n layoutBoundsOnTex01.x,\n layoutBoundsOnTex01.y,\n );\n this._tmpMatrix.scaleRelative(scaleX, scaleY); // new = [translate][scale]\n this._tmpMatrix.translateRelative(\n -this._tmpBoundsOnModel.x,\n -this._tmpBoundsOnModel.y,\n );\n // new = [translate][scale][translate]\n }\n this._tmpMatrixForDraw.setMatrix(this._tmpMatrix.getArray());\n }\n clipContext._matrixForMask.setMatrix(\n this._tmpMatrixForMask.getArray(),\n );\n clipContext._matrixForDraw.setMatrix(\n this._tmpMatrixForDraw.getArray(),\n );\n\n const clipDrawCount: number = clipContext._clippingIdCount;\n for (let i = 0; i < clipDrawCount; i++) {\n const clipDrawIndex: number = clipContext._clippingIdList[i];\n\n // 頂点情報が更新されておらず、信頼性がない場合は描画をパスする\n if (\n !model.getDrawableDynamicFlagVertexPositionsDidChange(\n clipDrawIndex,\n )\n ) {\n continue;\n }\n\n renderer.setIsCulling(\n model.getDrawableCulling(clipDrawIndex) != false,\n );\n\n // 今回専用の変換を適用して描く\n // チャンネルも切り替える必要がある(A,R,G,B)\n renderer.setClippingContextBufferForMask(clipContext);\n renderer.drawMesh(\n model.getDrawableTextureIndices(clipDrawIndex),\n model.getDrawableVertexIndexCount(clipDrawIndex),\n model.getDrawableVertexCount(clipDrawIndex),\n model.getDrawableVertexIndices(clipDrawIndex),\n model.getDrawableVertices(clipDrawIndex),\n model.getDrawableVertexUvs(clipDrawIndex),\n model.getDrawableOpacity(clipDrawIndex),\n CubismBlendMode.CubismBlendMode_Normal, // クリッピングは通常描画を強制\n false, // マスク生成時はクリッピングの反転使用は全く関係がない\n );\n }\n }\n\n // --- 後処理 ---\n this.gl.bindFramebuffer(this.gl.FRAMEBUFFER, s_fbo); // 描画対象を戻す\n renderer.setClippingContextBufferForMask(null);\n\n this.gl.viewport(\n s_viewport[0],\n s_viewport[1],\n s_viewport[2],\n s_viewport[3],\n );\n }\n }\n\n /**\n * 既にマスクを作っているかを確認\n * 作っている様であれば該当するクリッピングマスクのインスタンスを返す\n * 作っていなければNULLを返す\n * @param drawableMasks 描画オブジェクトをマスクする描画オブジェクトのリスト\n * @param drawableMaskCounts 描画オブジェクトをマスクする描画オブジェクトの数\n * @return 該当するクリッピングマスクが存在すればインスタンスを返し、なければNULLを返す\n */\n public findSameClip(\n drawableMasks: Int32Array,\n drawableMaskCounts: number,\n ): CubismClippingContext | null {\n // 作成済みClippingContextと一致するか確認\n for (let i = 0; i < this._clippingContextListForMask.length; i++) {\n const clippingContext: CubismClippingContext = this._clippingContextListForMask[i];\n const count: number = clippingContext._clippingIdCount;\n\n // 個数が違う場合は別物\n if (count != drawableMaskCounts) {\n continue;\n }\n\n let sameCount = 0;\n\n // 同じIDを持つか確認。配列の数が同じなので、一致した個数が同じなら同じ物を持つとする\n for (let j = 0; j < count; j++) {\n const clipId: number = clippingContext._clippingIdList[j];\n\n for (let k = 0; k < count; k++) {\n if (drawableMasks[k] == clipId) {\n sameCount++;\n break;\n }\n }\n }\n\n if (sameCount == count) {\n return clippingContext;\n }\n }\n\n return null; // 見つからなかった\n }\n\n /**\n * クリッピングコンテキストを配置するレイアウト\n * 一つのレンダーテクスチャを極力いっぱいに使ってマスクをレイアウトする\n * マスクグループの数が4以下ならRGBA各チャンネルに一つずつマスクを配置し、5以上6以下ならRGBAを2,2,1,1と配置する。\n *\n * @param usingClipCount 配置するクリッピングコンテキストの数\n */\n public setupLayoutBounds(usingClipCount: number): void {\n // ひとつのRenderTextureを極力いっぱいに使ってマスクをレイアウトする\n // マスクグループの数が4以下ならRGBA各チャンネルに1つずつマスクを配置し、5以上6以下ならRGBAを2,2,1,1と配置する\n\n // RGBAを順番に使っていく\n let div: number = usingClipCount / ColorChannelCount; // 1チャンネルに配置する基本のマスク\n let mod: number = usingClipCount % ColorChannelCount; // 余り、この番号のチャンネルまでに一つずつ配分する\n\n // 小数点は切り捨てる\n div = ~~div;\n mod = ~~mod;\n\n // RGBAそれぞれのチャンネルを用意していく(0:R, 1:G, 2:B, 3:A)\n let curClipIndex = 0; // 順番に設定していく\n\n for (let channelNo = 0; channelNo < ColorChannelCount; channelNo++) {\n // このチャンネルにレイアウトする数\n const layoutCount: number = div + (channelNo < mod ? 1 : 0);\n\n // 分割方法を決定する\n if (layoutCount == 0) {\n // 何もしない\n } else if (layoutCount == 1) {\n // 全てをそのまま使う\n const clipContext: CubismClippingContext = this._clippingContextListForMask[curClipIndex++];\n clipContext._layoutChannelNo = channelNo;\n clipContext._layoutBounds.x = 0.0;\n clipContext._layoutBounds.y = 0.0;\n clipContext._layoutBounds.width = 1.0;\n clipContext._layoutBounds.height = 1.0;\n } else if (layoutCount == 2) {\n for (let i = 0; i < layoutCount; i++) {\n let xpos: number = i % 2;\n\n // 小数点は切り捨てる\n xpos = ~~xpos;\n\n const cc: CubismClippingContext = this._clippingContextListForMask[curClipIndex++];\n cc._layoutChannelNo = channelNo;\n\n cc._layoutBounds.x = xpos * 0.5;\n cc._layoutBounds.y = 0.0;\n cc._layoutBounds.width = 0.5;\n cc._layoutBounds.height = 1.0;\n // UVを2つに分解して使う\n }\n } else if (layoutCount <= 4) {\n // 4分割して使う\n for (let i = 0; i < layoutCount; i++) {\n let xpos: number = i % 2;\n let ypos: number = i / 2;\n\n // 小数点は切り捨てる\n xpos = ~~xpos;\n ypos = ~~ypos;\n\n const cc = this._clippingContextListForMask[curClipIndex++];\n cc._layoutChannelNo = channelNo;\n\n cc._layoutBounds.x = xpos * 0.5;\n cc._layoutBounds.y = ypos * 0.5;\n cc._layoutBounds.width = 0.5;\n cc._layoutBounds.height = 0.5;\n }\n } else if (layoutCount <= 9) {\n // 9分割して使う\n for (let i = 0; i < layoutCount; i++) {\n let xpos = i % 3;\n let ypos = i / 3;\n\n // 小数点は切り捨てる\n xpos = ~~xpos;\n ypos = ~~ypos;\n\n const cc: CubismClippingContext = this._clippingContextListForMask[curClipIndex++];\n cc._layoutChannelNo = channelNo;\n\n cc._layoutBounds.x = xpos / 3.0;\n cc._layoutBounds.y = ypos / 3.0;\n cc._layoutBounds.width = 1.0 / 3.0;\n cc._layoutBounds.height = 1.0 / 3.0;\n }\n } else if (config.supportMoreMaskDivisions && layoutCount <= 16) {\n // support 4x4 division\n // https://docs.live2d.com/cubism-sdk-manual/ow-sdk-mask-premake-web/?locale=en_us\n\n for (let i = 0; i < layoutCount; i++) {\n let xpos = i % 4;\n let ypos = i / 4;\n\n // 小数点は切り捨てる\n xpos = ~~xpos;\n ypos = ~~ypos;\n\n const cc: CubismClippingContext = this._clippingContextListForMask[curClipIndex++];\n cc._layoutChannelNo = channelNo;\n\n cc._layoutBounds.x = xpos / 4.0;\n cc._layoutBounds.y = ypos / 4.0;\n cc._layoutBounds.width = 1.0 / 4.0;\n cc._layoutBounds.height = 1.0 / 4.0;\n }\n } else {\n CubismLogError('not supported mask count : {0}', layoutCount);\n }\n }\n }\n\n /**\n * カラーバッファを取得する\n * @return カラーバッファ\n */\n public getColorBuffer(): WebGLTexture | null {\n return this._colorBuffer;\n }\n\n /**\n * 画面描画に使用するクリッピングマスクのリストを取得する\n * @return 画面描画に使用するクリッピングマスクのリスト\n */\n public getClippingContextListForDraw(): (CubismClippingContext | null)[] {\n return this._clippingContextListForDraw;\n }\n\n /**\n * クリッピングマスクバッファのサイズを設定する\n * @param size クリッピングマスクバッファのサイズ\n */\n public setClippingMaskBufferSize(size: number): void {\n this._clippingMaskBufferSize = size;\n }\n\n /**\n * クリッピングマスクバッファのサイズを取得する\n * @return クリッピングマスクバッファのサイズ\n */\n public getClippingMaskBufferSize(): number {\n return this._clippingMaskBufferSize;\n }\n\n public _maskRenderTexture: WebGLFramebuffer | null; // マスク用レンダーテクスチャのアドレス\n public _colorBuffer: WebGLTexture | null; // マスク用カラーバッファーのアドレス\n public _currentFrameNo: number; // マスクテクスチャに与えるフレーム番号\n\n public _channelColors: CubismTextureColor[];\n public _maskTexture?: CubismRenderTextureResource; // マスク用のテクスチャリソースのリスト\n public _clippingContextListForMask: CubismClippingContext[]; // マスク用クリッピングコンテキストのリスト\n public _clippingContextListForDraw: (CubismClippingContext | null)[]; // 描画用クリッピングコンテキストのリスト\n public _clippingMaskBufferSize: number; // クリッピングマスクのバッファサイズ(初期値:256)\n\n private _tmpMatrix: CubismMatrix44; // マスク計算用の行列\n private _tmpMatrixForMask: CubismMatrix44; // マスク計算用の行列\n private _tmpMatrixForDraw: CubismMatrix44; // マスク計算用の行列\n private _tmpBoundsOnModel: csmRect; // マスク配置計算用の矩形\n\n gl!: WebGLRenderingContext; // WebGLレンダリングコンテキスト\n}\n\n/**\n * レンダーテクスチャのリソースを定義する構造体\n * クリッピングマスクで使用する\n */\nexport class CubismRenderTextureResource {\n /**\n * 引数付きコンストラクタ\n * @param frameNo レンダラーのフレーム番号\n * @param texture テクスチャのアドレス\n */\n public constructor(frameNo: number, texture: WebGLFramebuffer | null) {\n this.frameNo = frameNo;\n this.texture = texture;\n }\n\n public frameNo: number; // レンダラのフレーム番号\n public texture: WebGLFramebuffer | null; // テクスチャのアドレス\n}\n\n/**\n * クリッピングマスクのコンテキスト\n */\nexport class CubismClippingContext {\n /**\n * 引数付きコンストラクタ\n */\n public constructor(\n manager: CubismClippingManager_WebGL,\n clippingDrawableIndices: Int32Array,\n clipCount: number,\n ) {\n this._owner = manager;\n\n // クリップしている(=マスク用の)Drawableのインデックスリスト\n this._clippingIdList = clippingDrawableIndices;\n\n // マスクの数\n this._clippingIdCount = clipCount;\n\n this._allClippedDrawRect = new csmRect();\n this._layoutBounds = new csmRect();\n\n this._clippedDrawableIndexList = [];\n\n this._matrixForMask = new CubismMatrix44();\n this._matrixForDraw = new CubismMatrix44();\n }\n\n /**\n * デストラクタ相当の処理\n */\n public release(): void {\n const self = this as Partial<this>;\n self._layoutBounds = undefined;\n self._allClippedDrawRect = undefined;\n self._clippedDrawableIndexList = undefined;\n }\n\n /**\n * このマスクにクリップされる描画オブジェクトを追加する\n *\n * @param drawableIndex クリッピング対象に追加する描画オブジェクトのインデックス\n */\n public addClippedDrawable(drawableIndex: number) {\n this._clippedDrawableIndexList.push(drawableIndex);\n }\n\n /**\n * このマスクを管理するマネージャのインスタンスを取得する\n * @return クリッピングマネージャのインスタンス\n */\n public getClippingManager(): CubismClippingManager_WebGL {\n return this._owner;\n }\n\n public setGl(gl: WebGLRenderingContext): void {\n this._owner.setGL(gl);\n }\n\n public _isUsing: boolean = false; // 現在の描画状態でマスクの準備が必要ならtrue\n public readonly _clippingIdList: Int32Array; // クリッピングマスクのIDリスト\n public _clippingIdCount: number; // クリッピングマスクの数\n public _layoutChannelNo!: number; // RGBAのいずれのチャンネルにこのクリップを配置するか(0:R, 1:G, 2:B, 3:A)\n public _layoutBounds: csmRect; // マスク用チャンネルのどの領域にマスクを入れるか(View座標-1~1, UVは0~1に直す)\n public _allClippedDrawRect: csmRect; // このクリッピングで、クリッピングされるすべての描画オブジェクトの囲み矩形(毎回更新)\n public _matrixForMask: CubismMatrix44; // マスクの位置計算結果を保持する行列\n public _matrixForDraw: CubismMatrix44; // 描画オブジェクトの位置計算結果を保持する行列\n public _clippedDrawableIndexList: number[]; // このマスクにクリップされる描画オブジェクトのリスト\n\n private _owner: CubismClippingManager_WebGL; // このマスクを管理しているマネージャのインスタンス\n}\n\n/**\n * WebGL用のシェーダープログラムを生成・破棄するクラス\n * シングルトンなクラスであり、CubismShader_WebGL.getInstanceからアクセスする。\n */\nexport class CubismShader_WebGL {\n /**\n * インスタンスを取得する(シングルトン)\n * @return インスタンス\n */\n public static getInstance(): CubismShader_WebGL {\n if (s_instance == null) {\n s_instance = new CubismShader_WebGL();\n\n return s_instance;\n }\n return s_instance;\n }\n\n /**\n * インスタンスを開放する(シングルトン)\n */\n public static deleteInstance(): void {\n if (s_instance) {\n s_instance.release();\n s_instance = undefined;\n }\n }\n\n /**\n * privateなコンストラクタ\n */\n private constructor() {\n this._shaderSets = [];\n }\n\n /**\n * デストラクタ相当の処理\n */\n public release(): void {\n this.releaseShaderProgram();\n }\n\n /**\n * シェーダープログラムの一連のセットアップを実行する\n * @param renderer レンダラのインスタンス\n * @param textureId GPUのテクスチャID\n * @param vertexCount ポリゴンメッシュの頂点数\n * @param vertexArray ポリゴンメッシュの頂点配列\n * @param indexArray インデックスバッファの頂点配列\n * @param uvArray uv配列\n * @param opacity 不透明度\n * @param colorBlendMode カラーブレンディングのタイプ\n * @param baseColor ベースカラー\n * @param isPremultipliedAlpha 乗算済みアルファかどうか\n * @param matrix4x4 Model-View-Projection行列\n * @param invertedMask マスクを反転して使用するフラグ\n */\n public setupShaderProgram(\n renderer: CubismRenderer_WebGL,\n textureId: WebGLTexture | null,\n vertexCount: number,\n vertexArray: Float32Array,\n indexArray: Uint16Array,\n uvArray: Float32Array,\n bufferData: {\n vertex: WebGLBuffer | null;\n uv: WebGLBuffer | null;\n index: WebGLBuffer | null;\n },\n opacity: number,\n colorBlendMode: CubismBlendMode,\n baseColor: CubismTextureColor,\n isPremultipliedAlpha: boolean,\n matrix4x4: CubismMatrix44,\n invertedMask: boolean,\n ): void {\n if (!isPremultipliedAlpha) {\n CubismLogError('NoPremultipliedAlpha is not allowed');\n }\n\n if (this._shaderSets.length == 0) {\n this.generateShaders();\n }\n\n // Blending\n let SRC_COLOR: number;\n let DST_COLOR: number;\n let SRC_ALPHA: number;\n let DST_ALPHA: number;\n\n const clippingContextBufferForMask = renderer.getClippingContextBufferForMask();\n\n if (clippingContextBufferForMask != null) {\n // マスク生成時\n const shaderSet: CubismShaderSet = this._shaderSets[ShaderNames.ShaderNames_SetupMask];\n this.gl.useProgram(shaderSet.shaderProgram);\n\n // テクスチャ設定\n this.gl.activeTexture(this.gl.TEXTURE0);\n this.gl.bindTexture(this.gl.TEXTURE_2D, textureId);\n this.gl.uniform1i(shaderSet.samplerTexture0Location, 0);\n\n // 頂点配列の設定(VBO)\n if (bufferData.vertex == null) {\n bufferData.vertex = this.gl.createBuffer();\n }\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, bufferData.vertex);\n this.gl.bufferData(\n this.gl.ARRAY_BUFFER,\n vertexArray,\n this.gl.DYNAMIC_DRAW,\n );\n this.gl.enableVertexAttribArray(shaderSet.attributePositionLocation);\n this.gl.vertexAttribPointer(\n shaderSet.attributePositionLocation,\n 2,\n this.gl.FLOAT,\n false,\n 0,\n 0,\n );\n\n // テクスチャ頂点の設定\n if (bufferData.uv == null) {\n bufferData.uv = this.gl.createBuffer();\n }\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, bufferData.uv);\n this.gl.bufferData(this.gl.ARRAY_BUFFER, uvArray, this.gl.DYNAMIC_DRAW);\n this.gl.enableVertexAttribArray(shaderSet.attributeTexCoordLocation);\n this.gl.vertexAttribPointer(\n shaderSet.attributeTexCoordLocation,\n 2,\n this.gl.FLOAT,\n false,\n 0,\n 0,\n );\n\n // チャンネル\n const channelNo: number = clippingContextBufferForMask._layoutChannelNo;\n const colorChannel: CubismTextureColor = clippingContextBufferForMask\n .getClippingManager()\n .getChannelFlagAsColor(channelNo);\n this.gl.uniform4f(\n shaderSet.uniformChannelFlagLocation,\n colorChannel.R,\n colorChannel.G,\n colorChannel.B,\n colorChannel.A,\n );\n\n this.gl.uniformMatrix4fv(\n shaderSet.uniformClipMatrixLocation,\n false,\n clippingContextBufferForMask._matrixForMask.getArray(),\n );\n\n const rect: csmRect = clippingContextBufferForMask._layoutBounds;\n\n this.gl.uniform4f(\n shaderSet.uniformBaseColorLocation,\n rect.x * 2.0 - 1.0,\n rect.y * 2.0 - 1.0,\n rect.getRight() * 2.0 - 1.0,\n rect.getBottom() * 2.0 - 1.0,\n );\n\n SRC_COLOR = this.gl.ZERO;\n DST_COLOR = this.gl.ONE_MINUS_SRC_COLOR;\n SRC_ALPHA = this.gl.ZERO;\n DST_ALPHA = this.gl.ONE_MINUS_SRC_ALPHA;\n } // マスク生成以外の場合\n else {\n const clippingContextBufferForDraw = renderer.getClippingContextBufferForDraw();\n const masked = clippingContextBufferForDraw != null; // この描画オブジェクトはマスク対象か\n const offset: number = masked ? (invertedMask ? 2 : 1) : 0;\n\n let shaderSet;\n\n switch (colorBlendMode) {\n case CubismBlendMode.CubismBlendMode_Normal:\n default:\n shaderSet = this._shaderSets[ShaderNames.ShaderNames_NormalPremultipliedAlpha + offset];\n SRC_COLOR = this.gl.ONE;\n DST_COLOR = this.gl.ONE_MINUS_SRC_ALPHA;\n SRC_ALPHA = this.gl.ONE;\n DST_ALPHA = this.gl.ONE_MINUS_SRC_ALPHA;\n break;\n\n case CubismBlendMode.CubismBlendMode_Additive:\n shaderSet = this._shaderSets[ShaderNames.ShaderNames_AddPremultipliedAlpha + offset];\n SRC_COLOR = this.gl.ONE;\n DST_COLOR = this.gl.ONE;\n SRC_ALPHA = this.gl.ZERO;\n DST_ALPHA = this.gl.ONE;\n break;\n\n case CubismBlendMode.CubismBlendMode_Multiplicative:\n shaderSet = this._shaderSets[ShaderNames.ShaderNames_MultPremultipliedAlpha + offset];\n SRC_COLOR = this.gl.DST_COLOR;\n DST_COLOR = this.gl.ONE_MINUS_SRC_ALPHA;\n SRC_ALPHA = this.gl.ZERO;\n DST_ALPHA = this.gl.ONE;\n break;\n }\n\n this.gl.useProgram(shaderSet.shaderProgram);\n\n // 頂点配列の設定\n if (bufferData.vertex == null) {\n bufferData.vertex = this.gl.createBuffer();\n }\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, bufferData.vertex);\n this.gl.bufferData(\n this.gl.ARRAY_BUFFER,\n vertexArray,\n this.gl.DYNAMIC_DRAW,\n );\n this.gl.enableVertexAttribArray(shaderSet.attributePositionLocation);\n this.gl.vertexAttribPointer(\n shaderSet.attributePositionLocation,\n 2,\n this.gl.FLOAT,\n false,\n 0,\n 0,\n );\n\n // テクスチャ頂点の設定\n if (bufferData.uv == null) {\n bufferData.uv = this.gl.createBuffer();\n }\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, bufferData.uv);\n this.gl.bufferData(this.gl.ARRAY_BUFFER, uvArray, this.gl.DYNAMIC_DRAW);\n this.gl.enableVertexAttribArray(shaderSet.attributeTexCoordLocation);\n this.gl.vertexAttribPointer(\n shaderSet.attributeTexCoordLocation,\n 2,\n this.gl.FLOAT,\n false,\n 0,\n 0,\n );\n\n // この描画オブジェクトはマスク対象か\n if (clippingContextBufferForDraw != null) {\n this.gl.activeTexture(this.gl.TEXTURE1);\n const tex = clippingContextBufferForDraw\n .getClippingManager()\n .getColorBuffer();\n this.gl.bindTexture(this.gl.TEXTURE_2D, tex);\n this.gl.uniform1i(shaderSet.samplerTexture1Location, 1);\n\n // view座標をClippingContextの座標に変換するための行列を設定\n this.gl.uniformMatrix4fv(\n shaderSet.uniformClipMatrixLocation,\n false,\n clippingContextBufferForDraw._matrixForDraw.getArray(),\n );\n\n // 使用するカラーチャンネルを設定\n const channelNo: number = clippingContextBufferForDraw._layoutChannelNo;\n const colorChannel: CubismTextureColor = clippingContextBufferForDraw\n .getClippingManager()\n .getChannelFlagAsColor(channelNo);\n this.gl.uniform4f(\n shaderSet.uniformChannelFlagLocation,\n colorChannel.R,\n colorChannel.G,\n colorChannel.B,\n colorChannel.A,\n );\n }\n\n // テクスチャ設定\n this.gl.activeTexture(this.gl.TEXTURE0);\n this.gl.bindTexture(this.gl.TEXTURE_2D, textureId);\n this.gl.uniform1i(shaderSet.samplerTexture0Location, 0);\n\n // 座標変換\n this.gl.uniformMatrix4fv(\n shaderSet.uniformMatrixLocation,\n false,\n matrix4x4.getArray(),\n );\n\n this.gl.uniform4f(\n shaderSet.uniformBaseColorLocation,\n baseColor.R,\n baseColor.G,\n baseColor.B,\n baseColor.A,\n );\n }\n\n // IBOを作成し、データを転送\n if (bufferData.index == null) {\n bufferData.index = this.gl.createBuffer();\n }\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, bufferData.index);\n this.gl.bufferData(\n this.gl.ELEMENT_ARRAY_BUFFER,\n indexArray,\n this.gl.DYNAMIC_DRAW,\n );\n this.gl.blendFuncSeparate(SRC_COLOR, DST_COLOR, SRC_ALPHA, DST_ALPHA);\n }\n\n /**\n * シェーダープログラムを解放する\n */\n public releaseShaderProgram(): void {\n for (let i = 0; i < this._shaderSets.length; i++) {\n this.gl.deleteProgram(this._shaderSets[i].shaderProgram);\n this._shaderSets[i].shaderProgram = 0;\n }\n\n this._shaderSets = [];\n }\n\n /**\n * シェーダープログラムを初期化する\n * @param vertShaderSrc 頂点シェーダのソース\n * @param fragShaderSrc フラグメントシェーダのソース\n */\n public generateShaders(): void {\n for (let i = 0; i < shaderCount; i++) {\n this._shaderSets.push({} as any);\n }\n\n this._shaderSets[0].shaderProgram = this.loadShaderProgram(\n vertexShaderSrcSetupMask,\n fragmentShaderSrcsetupMask,\n );\n\n this._shaderSets[1].shaderProgram = this.loadShaderProgram(\n vertexShaderSrc,\n fragmentShaderSrcPremultipliedAlpha,\n );\n this._shaderSets[2].shaderProgram = this.loadShaderProgram(\n vertexShaderSrcMasked,\n fragmentShaderSrcMaskPremultipliedAlpha,\n );\n this._shaderSets[3].shaderProgram = this.loadShaderProgram(\n vertexShaderSrcMasked,\n fragmentShaderSrcMaskInvertedPremultipliedAlpha,\n );\n\n // 加算も通常と同じシェーダーを利用する\n this._shaderSets[4].shaderProgram = this._shaderSets[1].shaderProgram;\n this._shaderSets[5].shaderProgram = this._shaderSets[2].shaderProgram;\n this._shaderSets[6].shaderProgram = this._shaderSets[3].shaderProgram;\n\n // 乗算も通常と同じシェーダーを利用する\n this._shaderSets[7].shaderProgram = this._shaderSets[1].shaderProgram;\n this._shaderSets[8].shaderProgram = this._shaderSets[2].shaderProgram;\n this._shaderSets[9].shaderProgram = this._shaderSets[3].shaderProgram;\n\n // SetupMask\n this._shaderSets[0].attributePositionLocation = this.gl.getAttribLocation(\n this._shaderSets[0].shaderProgram,\n 'a_position',\n );\n this._shaderSets[0].attributeTexCoordLocation = this.gl.getAttribLocation(\n this._shaderSets[0].shaderProgram,\n 'a_texCoord',\n );\n this._shaderSets[0].samplerTexture0Location = this.gl.getUniformLocation(\n this._shaderSets[0].shaderProgram,\n 's_texture0',\n );\n this._shaderSets[0].uniformClipMatrixLocation = this.gl.getUniformLocation(\n this._shaderSets[0].shaderProgram,\n 'u_clipMatrix',\n );\n this._shaderSets[0].uniformChannelFlagLocation = this.gl.getUniformLocation(\n this._shaderSets[0].shaderProgram,\n 'u_channelFlag',\n );\n this._shaderSets[0].uniformBaseColorLocation = this.gl.getUniformLocation(\n this._shaderSets[0].shaderProgram,\n 'u_baseColor',\n );\n\n // 通常(PremultipliedAlpha)\n this._shaderSets[1].attributePositionLocation = this.gl.getAttribLocation(\n this._shaderSets[1].shaderProgram,\n 'a_position',\n );\n this._shaderSets[1].attributeTexCoordLocation = this.gl.getAttribLocation(\n this._shaderSets[1].shaderProgram,\n 'a_texCoord',\n );\n this._shaderSets[1].samplerTexture0Location = this.gl.getUniformLocation(\n this._shaderSets[1].shaderProgram,\n 's_texture0',\n );\n this._shaderSets[1].uniformMatrixLocation = this.gl.getUniformLocation(\n this._shaderSets[1].shaderProgram,\n 'u_matrix',\n );\n this._shaderSets[1].uniformBaseColorLocation = this.gl.getUniformLocation(\n this._shaderSets[1].shaderProgram,\n 'u_baseColor',\n );\n\n // 通常(クリッピング、PremultipliedAlpha)\n this._shaderSets[2].attributePositionLocation = this.gl.getAttribLocation(\n this._shaderSets[2].shaderProgram,\n 'a_position',\n );\n this._shaderSets[2].attributeTexCoordLocation = this.gl.getAttribLocation(\n this._shaderSets[2].shaderProgram,\n 'a_texCoord',\n );\n this._shaderSets[2].samplerTexture0Location = this.gl.getUniformLocation(\n this._shaderSets[2].shaderProgram,\n 's_texture0',\n );\n this._shaderSets[2].samplerTexture1Location = this.gl.getUniformLocation(\n this._shaderSets[2].shaderProgram,\n 's_texture1',\n );\n this._shaderSets[2].uniformMatrixLocation = this.gl.getUniformLocation(\n this._shaderSets[2].shaderProgram,\n 'u_matrix',\n );\n this._shaderSets[2].uniformClipMatrixLocation = this.gl.getUniformLocation(\n this._shaderSets[2].shaderProgram,\n 'u_clipMatrix',\n );\n this._shaderSets[2].uniformChannelFlagLocation = this.gl.getUniformLocation(\n this._shaderSets[2].shaderProgram,\n 'u_channelFlag',\n );\n this._shaderSets[2].uniformBaseColorLocation = this.gl.getUniformLocation(\n this._shaderSets[2].shaderProgram,\n 'u_baseColor',\n );\n\n // 通常(クリッピング・反転, PremultipliedAlpha)\n this._shaderSets[3].attributePositionLocation = this.gl.getAttribLocation(\n this._shaderSets[3].shaderProgram,\n 'a_position',\n );\n this._shaderSets[3].attributeTexCoordLocation = this.gl.getAttribLocation(\n this._shaderSets[3].shaderProgram,\n 'a_texCoord',\n );\n this._shaderSets[3].samplerTexture0Location = this.gl.getUniformLocation(\n this._shaderSets[3].shaderProgram,\n 's_texture0',\n );\n this._shaderSets[3].samplerTexture1Location = this.gl.getUniformLocation(\n this._shaderSets[3].shaderProgram,\n 's_texture1',\n );\n this._shaderSets[3].uniformMatrixLocation = this.gl.getUniformLocation(\n this._shaderSets[3].shaderProgram,\n 'u_matrix',\n );\n this._shaderSets[3].uniformClipMatrixLocation = this.gl.getUniformLocation(\n this._shaderSets[3].shaderProgram,\n 'u_clipMatrix',\n );\n this._shaderSets[3].uniformChannelFlagLocation = this.gl.getUniformLocation(\n this._shaderSets[3].shaderProgram,\n 'u_channelFlag',\n );\n this._shaderSets[3].uniformBaseColorLocation = this.gl.getUniformLocation(\n this._shaderSets[3].shaderProgram,\n 'u_baseColor',\n );\n\n // 加算(PremultipliedAlpha)\n this._shaderSets[4].attributePositionLocation = this.gl.getAttribLocation(\n this._shaderSets[4].shaderProgram,\n 'a_position',\n );\n this._shaderSets[4].attributeTexCoordLocation = this.gl.getAttribLocation(\n this._shaderSets[4].shaderProgram,\n 'a_texCoord',\n );\n this._shaderSets[4].samplerTexture0Location = this.gl.getUniformLocation(\n this._shaderSets[4].shaderProgram,\n 's_texture0',\n );\n this._shaderSets[4].uniformMatrixLocation = this.gl.getUniformLocation(\n this._shaderSets[4].shaderProgram,\n 'u_matrix',\n );\n this._shaderSets[4].uniformBaseColorLocation = this.gl.getUniformLocation(\n this._shaderSets[4].shaderProgram,\n 'u_baseColor',\n );\n\n // 加算(クリッピング、PremultipliedAlpha)\n this._shaderSets[5].attributePositionLocation = this.gl.getAttribLocation(\n this._shaderSets[5].shaderProgram,\n 'a_position',\n );\n this._shaderSets[5].attributeTexCoordLocation = this.gl.getAttribLocation(\n this._shaderSets[5].shaderProgram,\n 'a_texCoord',\n );\n this._shaderSets[5].samplerTexture0Location = this.gl.getUniformLocation(\n this._shaderSets[5].shaderProgram,\n 's_texture0',\n );\n this._shaderSets[5].samplerTexture1Location = this.gl.getUniformLocation(\n this._shaderSets[5].shaderProgram,\n 's_texture1',\n );\n this._shaderSets[5].uniformMatrixLocation = this.gl.getUniformLocation(\n this._shaderSets[5].shaderProgram,\n 'u_matrix',\n );\n this._shaderSets[5].uniformClipMatrixLocation = this.gl.getUniformLocation(\n this._shaderSets[5].shaderProgram,\n 'u_clipMatrix',\n );\n this._shaderSets[5].uniformChannelFlagLocation = this.gl.getUniformLocation(\n this._shaderSets[5].shaderProgram,\n 'u_channelFlag',\n );\n this._shaderSets[5].uniformBaseColorLocation = this.gl.getUniformLocation(\n this._shaderSets[5].shaderProgram,\n 'u_baseColor',\n );\n\n // 加算(クリッピング・反転、PremultipliedAlpha)\n this._shaderSets[6].attributePositionLocation = this.gl.getAttribLocation(\n this._shaderSets[6].shaderProgram,\n 'a_position',\n );\n this._shaderSets[6].attributeTexCoordLocation = this.gl.getAttribLocation(\n this._shaderSets[6].shaderProgram,\n 'a_texCoord',\n );\n this._shaderSets[6].samplerTexture0Location = this.gl.getUniformLocation(\n this._shaderSets[6].shaderProgram,\n 's_texture0',\n );\n this._shaderSets[6].samplerTexture1Location = this.gl.getUniformLocation(\n this._shaderSets[6].shaderProgram,\n 's_texture1',\n );\n this._shaderSets[6].uniformMatrixLocation = this.gl.getUniformLocation(\n this._shaderSets[6].shaderProgram,\n 'u_matrix',\n );\n this._shaderSets[6].uniformClipMatrixLocation = this.gl.getUniformLocation(\n this._shaderSets[6].shaderProgram,\n 'u_clipMatrix',\n );\n this._shaderSets[6].uniformChannelFlagLocation = this.gl.getUniformLocation(\n this._shaderSets[6].shaderProgram,\n 'u_channelFlag',\n );\n this._shaderSets[6].uniformBaseColorLocation = this.gl.getUniformLocation(\n this._shaderSets[6].shaderProgram,\n 'u_baseColor',\n );\n\n // 乗算(PremultipliedAlpha)\n this._shaderSets[7].attributePositionLocation = this.gl.getAttribLocation(\n this._shaderSets[7].shaderProgram,\n 'a_position',\n );\n this._shaderSets[7].attributeTexCoordLocation = this.gl.getAttribLocation(\n this._shaderSets[7].shaderProgram,\n 'a_texCoord',\n );\n this._shaderSets[7].samplerTexture0Location = this.gl.getUniformLocation(\n this._shaderSets[7].shaderProgram,\n 's_texture0',\n );\n this._shaderSets[7].uniformMatrixLocation = this.gl.getUniformLocation(\n this._shaderSets[7].shaderProgram,\n 'u_matrix',\n );\n this._shaderSets[7].uniformBaseColorLocation = this.gl.getUniformLocation(\n this._shaderSets[7].shaderProgram,\n 'u_baseColor',\n );\n\n // 乗算(クリッピング、PremultipliedAlpha)\n this._shaderSets[8].attributePositionLocation = this.gl.getAttribLocation(\n this._shaderSets[8].shaderProgram,\n 'a_position',\n );\n this._shaderSets[8].attributeTexCoordLocation = this.gl.getAttribLocation(\n this._shaderSets[8].shaderProgram,\n 'a_texCoord',\n );\n this._shaderSets[8].samplerTexture0Location = this.gl.getUniformLocation(\n this._shaderSets[8].shaderProgram,\n 's_texture0',\n );\n this._shaderSets[8].samplerTexture1Location = this.gl.getUniformLocation(\n this._shaderSets[8].shaderProgram,\n 's_texture1',\n );\n this._shaderSets[8].uniformMatrixLocation = this.gl.getUniformLocation(\n this._shaderSets[8].shaderProgram,\n 'u_matrix',\n );\n this._shaderSets[8].uniformClipMatrixLocation = this.gl.getUniformLocation(\n this._shaderSets[8].shaderProgram,\n 'u_clipMatrix',\n );\n this._shaderSets[8].uniformChannelFlagLocation = this.gl.getUniformLocation(\n this._shaderSets[8].shaderProgram,\n 'u_channelFlag',\n );\n this._shaderSets[8].uniformBaseColorLocation = this.gl.getUniformLocation(\n this._shaderSets[8].shaderProgram,\n 'u_baseColor',\n );\n\n // 乗算(クリッピング・反転、PremultipliedAlpha)\n this._shaderSets[9].attributePositionLocation = this.gl.getAttribLocation(\n this._shaderSets[9].shaderProgram,\n 'a_position',\n );\n this._shaderSets[9].attributeTexCoordLocation = this.gl.getAttribLocation(\n this._shaderSets[9].shaderProgram,\n 'a_texCoord',\n );\n this._shaderSets[9].samplerTexture0Location = this.gl.getUniformLocation(\n this._shaderSets[9].shaderProgram,\n 's_texture0',\n );\n this._shaderSets[9].samplerTexture1Location = this.gl.getUniformLocation(\n this._shaderSets[9].shaderProgram,\n 's_texture1',\n );\n this._shaderSets[9].uniformMatrixLocation = this.gl.getUniformLocation(\n this._shaderSets[9].shaderProgram,\n 'u_matrix',\n );\n this._shaderSets[9].uniformClipMatrixLocation = this.gl.getUniformLocation(\n this._shaderSets[9].shaderProgram,\n 'u_clipMatrix',\n );\n this._shaderSets[9].uniformChannelFlagLocation = this.gl.getUniformLocation(\n this._shaderSets[9].shaderProgram,\n 'u_channelFlag',\n );\n this._shaderSets[9].uniformBaseColorLocation = this.gl.getUniformLocation(\n this._shaderSets[9].shaderProgram,\n 'u_baseColor',\n );\n }\n\n /**\n * シェーダプログラムをロードしてアドレスを返す\n * @param vertexShaderSource 頂点シェーダのソース\n * @param fragmentShaderSource フラグメントシェーダのソース\n * @return シェーダプログラムのアドレス\n */\n public loadShaderProgram(\n vertexShaderSource: string,\n fragmentShaderSource: string,\n ): WebGLProgram {\n // Create Shader Program\n let shaderProgram = this.gl.createProgram()!;\n\n let vertShader = this.compileShaderSource(\n this.gl.VERTEX_SHADER,\n vertexShaderSource,\n );\n\n if (!vertShader) {\n CubismLogError('Vertex shader compile error!');\n return 0;\n }\n\n let fragShader = this.compileShaderSource(\n this.gl.FRAGMENT_SHADER,\n fragmentShaderSource,\n );\n if (!fragShader) {\n CubismLogError('Vertex shader compile error!');\n return 0;\n }\n\n // Attach vertex shader to program\n this.gl.attachShader(shaderProgram, vertShader);\n\n // Attach fragment shader to program\n this.gl.attachShader(shaderProgram, fragShader);\n\n // link program\n this.gl.linkProgram(shaderProgram);\n const linkStatus = this.gl.getProgramParameter(\n shaderProgram,\n this.gl.LINK_STATUS,\n );\n\n // リンクに失敗したらシェーダーを削除\n if (!linkStatus) {\n CubismLogError('Failed to link program: {0}', shaderProgram);\n\n this.gl.deleteShader(vertShader);\n\n this.gl.deleteShader(fragShader);\n\n if (shaderProgram) {\n this.gl.deleteProgram(shaderProgram);\n }\n\n return 0;\n }\n\n // Release vertex and fragment shaders.\n this.gl.deleteShader(vertShader);\n this.gl.deleteShader(fragShader);\n\n return shaderProgram;\n }\n\n /**\n * シェーダープログラムをコンパイルする\n * @param shaderType シェーダタイプ(Vertex/Fragment)\n * @param shaderSource シェーダソースコード\n *\n * @return コンパイルされたシェーダープログラム\n */\n public compileShaderSource(\n shaderType: GLenum,\n shaderSource: string,\n ): WebGLProgram | null {\n const source: string = shaderSource;\n\n const shader = this.gl.createShader(shaderType)!;\n this.gl.shaderSource(shader, source);\n this.gl.compileShader(shader);\n\n if (!shader) {\n const log = this.gl.getShaderInfoLog(shader);\n CubismLogError('Shader compile log: {0} ', log);\n }\n\n const status: any = this.gl.getShaderParameter(\n shader,\n this.gl.COMPILE_STATUS,\n );\n if (!status) {\n this.gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n }\n\n public setGl(gl: WebGLRenderingContext): void {\n this.gl = gl;\n }\n\n _shaderSets: CubismShaderSet[]; // ロードしたシェーダープログラムを保持する変数\n gl!: WebGLRenderingContext; // webglコンテキスト\n}\n\n/**\n * CubismShader_WebGLのインナークラス\n */\nexport interface CubismShaderSet {\n shaderProgram: WebGLProgram; // シェーダープログラムのアドレス\n attributePositionLocation: GLuint; // シェーダープログラムに渡す変数のアドレス(Position)\n attributeTexCoordLocation: GLuint; // シェーダープログラムに渡す変数のアドレス(TexCoord)\n uniformMatrixLocation: WebGLUniformLocation | null; // シェーダープログラムに渡す変数のアドレス(Matrix)\n uniformClipMatrixLocation: WebGLUniformLocation | null; // シェーダープログラムに渡す変数のアドレス(ClipMatrix)\n samplerTexture0Location: WebGLUniformLocation | null; // シェーダープログラムに渡す変数のアドレス(Texture0)\n samplerTexture1Location: WebGLUniformLocation | null; // シェーダープログラムに渡す変数のアドレス(Texture1)\n uniformBaseColorLocation: WebGLUniformLocation | null; // シェーダープログラムに渡す変数のアドレス(BaseColor)\n uniformChannelFlagLocation: WebGLUniformLocation | null; // シェーダープログラムに渡す変数のアドレス(ChannelFlag)\n}\n\nexport enum ShaderNames {\n // SetupMask\n ShaderNames_SetupMask,\n\n // Normal\n ShaderNames_NormalPremultipliedAlpha,\n ShaderNames_NormalMaskedPremultipliedAlpha,\n ShaderNames_NomralMaskedInvertedPremultipliedAlpha,\n\n // Add\n ShaderNames_AddPremultipliedAlpha,\n ShaderNames_AddMaskedPremultipliedAlpha,\n ShaderNames_AddMaskedPremultipliedAlphaInverted,\n\n // Mult\n ShaderNames_MultPremultipliedAlpha,\n ShaderNames_MultMaskedPremultipliedAlpha,\n ShaderNames_MultMaskedPremultipliedAlphaInverted\n}\n\nexport const vertexShaderSrcSetupMask =\n 'attribute vec4 a_position;' +\n 'attribute vec2 a_texCoord;' +\n 'varying vec2 v_texCoord;' +\n 'varying vec4 v_myPos;' +\n 'uniform mat4 u_clipMatrix;' +\n 'void main()' +\n '{' +\n ' gl_Position = u_clipMatrix * a_position;' +\n ' v_myPos = u_clipMatrix * a_position;' +\n ' v_texCoord = a_texCoord;' +\n ' v_texCoord.y = 1.0 - v_texCoord.y;' +\n '}';\nexport const fragmentShaderSrcsetupMask =\n 'precision mediump float;' +\n 'varying vec2 v_texCoord;' +\n 'varying vec4 v_myPos;' +\n 'uniform vec4 u_baseColor;' +\n 'uniform vec4 u_channelFlag;' +\n 'uniform sampler2D s_texture0;' +\n 'void main()' +\n '{' +\n ' float isInside = ' +\n ' step(u_baseColor.x, v_myPos.x/v_myPos.w)' +\n ' * step(u_baseColor.y, v_myPos.y/v_myPos.w)' +\n ' * step(v_myPos.x/v_myPos.w, u_baseColor.z)' +\n ' * step(v_myPos.y/v_myPos.w, u_baseColor.w);' +\n ' gl_FragColor = u_channelFlag * texture2D(s_texture0, v_texCoord).a * isInside;' +\n '}';\n\n//----- バーテックスシェーダプログラム -----\n// Normal & Add & Mult 共通\nexport const vertexShaderSrc =\n 'attribute vec4 a_position;' + //v.vertex\n 'attribute vec2 a_texCoord;' + //v.texcoord\n 'varying vec2 v_texCoord;' + //v2f.texcoord\n 'uniform mat4 u_matrix;' +\n 'void main()' +\n '{' +\n ' gl_Position = u_matrix * a_position;' +\n ' v_texCoord = a_texCoord;' +\n ' v_texCoord.y = 1.0 - v_texCoord.y;' +\n '}';\n\n// Normal & Add & Mult 共通(クリッピングされたものの描画用)\nexport const vertexShaderSrcMasked =\n 'attribute vec4 a_position;' +\n 'attribute vec2 a_texCoord;' +\n 'varying vec2 v_texCoord;' +\n 'varying vec4 v_clipPos;' +\n 'uniform mat4 u_matrix;' +\n 'uniform mat4 u_clipMatrix;' +\n 'void main()' +\n '{' +\n ' gl_Position = u_matrix * a_position;' +\n ' v_clipPos = u_clipMatrix * a_position;' +\n ' v_texCoord = a_texCoord;' +\n ' v_texCoord.y = 1.0 - v_texCoord.y;' +\n '}';\n\n//----- フラグメントシェーダプログラム -----\n// Normal & Add & Mult 共通 (PremultipliedAlpha)\nexport const fragmentShaderSrcPremultipliedAlpha =\n 'precision mediump float;' +\n 'varying vec2 v_texCoord;' + //v2f.texcoord\n 'uniform vec4 u_baseColor;' +\n 'uniform sampler2D s_texture0;' + //_MainTex\n 'void main()' +\n '{' +\n ' gl_FragColor = texture2D(s_texture0 , v_texCoord) * u_baseColor;' +\n '}';\n\n// Normal (クリッピングされたものの描画用、PremultipliedAlpha兼用)\nexport const fragmentShaderSrcMaskPremultipliedAlpha =\n 'precision mediump float;' +\n 'varying vec2 v_texCoord;' +\n 'varying vec4 v_clipPos;' +\n 'uniform vec4 u_baseColor;' +\n 'uniform vec4 u_channelFlag;' +\n 'uniform sampler2D s_texture0;' +\n 'uniform sampler2D s_texture1;' +\n 'void main()' +\n '{' +\n ' vec4 col_formask = texture2D(s_texture0 , v_texCoord) * u_baseColor;' +\n ' vec4 clipMask = (1.0 - texture2D(s_texture1, v_clipPos.xy / v_clipPos.w)) * u_channelFlag;' +\n ' float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a;' +\n ' col_formask = col_formask * maskVal;' +\n ' gl_FragColor = col_formask;' +\n '}';\n\n// Normal & Add & Mult 共通(クリッピングされて反転使用の描画用、PremultipliedAlphaの場合)\nexport const fragmentShaderSrcMaskInvertedPremultipliedAlpha =\n 'precision mediump float;' +\n 'varying vec2 v_texCoord;' +\n 'varying vec4 v_clipPos;' +\n 'uniform sampler2D s_texture0;' +\n 'uniform sampler2D s_texture1;' +\n 'uniform vec4 u_channelFlag;' +\n 'uniform vec4 u_baseColor;' +\n 'void main()' +\n '{' +\n 'vec4 col_formask = texture2D(s_texture0, v_texCoord) * u_baseColor;' +\n 'vec4 clipMask = (1.0 - texture2D(s_texture1, v_clipPos.xy / v_clipPos.w)) * u_channelFlag;' +\n 'float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a;' +\n 'col_formask = col_formask * (1.0 - maskVal);' +\n 'gl_FragColor = col_formask;' +\n '}';\n\n/**\n * WebGL用の描画命令を実装したクラス\n */\nexport class CubismRenderer_WebGL extends CubismRenderer {\n /**\n * レンダラの初期化処理を実行する\n * 引数に渡したモデルからレンダラの初期化処理に必要な情報を取り出すことができる\n *\n * @param model モデルのインスタンス\n */\n public initialize(model: CubismModel): void {\n if (model.isUsingMasking()) {\n this._clippingManager = new CubismClippingManager_WebGL(); // クリッピングマスク・バッファ前処理方式を初期化\n this._clippingManager.initialize(\n model,\n model.getDrawableCount(),\n model.getDrawableMasks(),\n model.getDrawableMaskCounts(),\n );\n }\n\n for (let i = model.getDrawableCount() - 1; i >= 0; i--) {\n this._sortedDrawableIndexList[i] = 0;\n }\n\n super.initialize(model); // 親クラスの処理を呼ぶ\n }\n\n /**\n * WebGLテクスチャのバインド処理\n * CubismRendererにテクスチャを設定し、CubismRenderer内でその画像を参照するためのIndex値を戻り値とする\n * @param modelTextureNo セットするモデルテクスチャの番号\n * @param glTextureNo WebGLテクスチャの番号\n */\n public bindTexture(modelTextureNo: number, glTexture: WebGLTexture): void {\n this._textures[modelTextureNo] = glTexture;\n }\n\n /**\n * WebGLにバインドされたテクスチャのリストを取得する\n * @return テクスチャのリスト\n */\n public getBindedTextures(): Record<number, WebGLTexture> {\n return this._textures;\n }\n\n /**\n * クリッピングマスクバッファのサイズを設定する\n * マスク用のFrameBufferを破棄、再作成する為処理コストは高い\n * @param size クリッピングマスクバッファのサイズ\n */\n public setClippingMaskBufferSize(size: number) {\n // FrameBufferのサイズを変更するためにインスタンスを破棄・再作成する\n this._clippingManager.release();\n\n this._clippingManager = new CubismClippingManager_WebGL();\n\n this._clippingManager.setClippingMaskBufferSize(size);\n\n this._clippingManager.initialize(\n this.getModel(),\n this.getModel().getDrawableCount(),\n this.getModel().getDrawableMasks(),\n this.getModel().getDrawableMaskCounts(),\n );\n }\n\n /**\n * クリッピングマスクバッファのサイズを取得する\n * @return クリッピングマスクバッファのサイズ\n */\n public getClippingMaskBufferSize(): number {\n return this._clippingManager.getClippingMaskBufferSize();\n }\n\n /**\n * コンストラクタ\n */\n public constructor() {\n super();\n this._clippingContextBufferForMask = null;\n this._clippingContextBufferForDraw = null;\n this._clippingManager = new CubismClippingManager_WebGL();\n this.firstDraw = true;\n this._textures = {};\n this._sortedDrawableIndexList = [];\n this._bufferData = {\n vertex: null,\n uv: null,\n index: null,\n };\n }\n\n /**\n * デストラクタ相当の処理\n */\n public release(): void {\n const self = this as Partial<this>;\n\n this._clippingManager.release();\n self._clippingManager = undefined;\n\n this.gl?.deleteBuffer(this._bufferData.vertex);\n this._bufferData.vertex = null;\n this.gl?.deleteBuffer(this._bufferData.uv);\n this._bufferData.uv = null;\n this.gl?.deleteBuffer(this._bufferData.index);\n this._bufferData.index = null;\n self._bufferData = undefined;\n\n self._textures = undefined;\n }\n\n /**\n * モデルを描画する実際の処理\n */\n public doDrawModel(): void {\n // 上記クリッピング処理内でも一度PreDrawを呼ぶので注意!!\n this.preDraw();\n\n //------------ クリッピングマスク・バッファ前処理方式の場合 ------------\n if (this._clippingManager != null) {\n this._clippingManager.setupClippingContext(this.getModel(), this);\n }\n\n const drawableCount: number = this.getModel().getDrawableCount();\n const renderOrder: Int32Array = this.getModel().getDrawableRenderOrders();\n\n // インデックスを描画順でソート\n for (let i = 0; i < drawableCount; ++i) {\n const order: number = renderOrder[i];\n this._sortedDrawableIndexList[order] = i;\n }\n\n // 描画\n for (let i = 0; i < drawableCount; ++i) {\n const drawableIndex: number = this._sortedDrawableIndexList[i];\n\n // Drawableが表示状態でなければ処理をパスする\n if (!this.getModel().getDrawableDynamicFlagIsVisible(drawableIndex)) {\n continue;\n }\n\n // クリッピングマスクをセットする\n this.setClippingContextBufferForDraw(\n this._clippingManager != null\n ? this._clippingManager.getClippingContextListForDraw()[drawableIndex]\n : null,\n );\n\n this.setIsCulling(this.getModel().getDrawableCulling(drawableIndex));\n\n this.drawMesh(\n this.getModel().getDrawableTextureIndices(drawableIndex),\n this.getModel().getDrawableVertexIndexCount(drawableIndex),\n this.getModel().getDrawableVertexCount(drawableIndex),\n this.getModel().getDrawableVertexIndices(drawableIndex),\n this.getModel().getDrawableVertices(drawableIndex),\n this.getModel().getDrawableVertexUvs(drawableIndex),\n this.getModel().getDrawableOpacity(drawableIndex),\n this.getModel().getDrawableBlendMode(drawableIndex),\n this.getModel().getDrawableInvertedMaskBit(drawableIndex),\n );\n }\n }\n\n /**\n * [オーバーライド]\n * 描画オブジェクト(アートメッシュ)を描画する。\n * ポリゴンメッシュとテクスチャ番号をセットで渡す。\n * @param textureNo 描画するテクスチャ番号\n * @param indexCount 描画オブジェクトのインデックス値\n * @param vertexCount ポリゴンメッシュの頂点数\n * @param indexArray ポリゴンメッシュのインデックス配列\n * @param vertexArray ポリゴンメッシュの頂点配列\n * @param uvArray uv配列\n * @param opacity 不透明度\n * @param colorBlendMode カラー合成タイプ\n * @param invertedMask マスク使用時のマスクの反転使用\n */\n public drawMesh(\n textureNo: number,\n indexCount: number,\n vertexCount: number,\n indexArray: Uint16Array,\n vertexArray: Float32Array,\n uvArray: Float32Array,\n opacity: number,\n colorBlendMode: CubismBlendMode,\n invertedMask: boolean,\n ): void {\n // 裏面描画の有効・無効\n if (this.isCulling()) {\n this.gl.enable(this.gl.CULL_FACE);\n } else {\n this.gl.disable(this.gl.CULL_FACE);\n }\n\n this.gl.frontFace(this.gl.CCW); // Cubism SDK OpenGLはマスク・アートメッシュ共にCCWが表面\n\n const modelColorRGBA: CubismTextureColor = this.getModelColor();\n\n if (this.getClippingContextBufferForMask() == null) {\n // マスク生成時以外\n modelColorRGBA.A *= opacity;\n if (this.isPremultipliedAlpha()) {\n modelColorRGBA.R *= modelColorRGBA.A;\n modelColorRGBA.G *= modelColorRGBA.A;\n modelColorRGBA.B *= modelColorRGBA.A;\n }\n }\n\n let drawtexture: WebGLTexture | null = null; // シェーダに渡すテクスチャ\n\n // テクスチャマップからバインド済みテクスチャIDを取得\n // バインドされていなければダミーのテクスチャIDをセットする\n if (this._textures[textureNo] != null) {\n drawtexture = this._textures[textureNo];\n }\n\n CubismShader_WebGL.getInstance().setupShaderProgram(\n this,\n drawtexture,\n vertexCount,\n vertexArray,\n indexArray,\n uvArray,\n this._bufferData,\n opacity,\n colorBlendMode,\n modelColorRGBA,\n this.isPremultipliedAlpha(),\n this.getMvpMatrix(),\n invertedMask,\n );\n\n // ポリゴンメッシュを描画する\n this.gl.drawElements(\n this.gl.TRIANGLES,\n indexCount,\n this.gl.UNSIGNED_SHORT,\n 0,\n );\n\n // 後処理\n this.gl.useProgram(null);\n this.setClippingContextBufferForDraw(null);\n this.setClippingContextBufferForMask(null);\n }\n\n /**\n * レンダラが保持する静的なリソースを解放する\n * WebGLの静的なシェーダープログラムを解放する\n */\n public static doStaticRelease(): void {\n CubismShader_WebGL.deleteInstance();\n }\n\n /**\n * レンダーステートを設定する\n * @param fbo アプリケーション側で指定しているフレームバッファ\n * @param viewport ビューポート\n */\n public setRenderState(fbo: WebGLFramebuffer, viewport: number[]): void {\n s_fbo = fbo;\n s_viewport = viewport;\n }\n\n /**\n * 描画開始時の追加処理\n * モデルを描画する前にクリッピングマスクに必要な処理を実装している\n */\n public preDraw(): void {\n if (this.firstDraw) {\n this.firstDraw = false;\n\n // 拡張機能を有効にする\n this._anisortopy =\n this.gl.getExtension('EXT_texture_filter_anisotropic') ||\n this.gl.getExtension('WEBKIT_EXT_texture_filter_anisotropic') ||\n this.gl.getExtension('MOZ_EXT_texture_filter_anisotropic');\n }\n\n this.gl.disable(this.gl.SCISSOR_TEST);\n this.gl.disable(this.gl.STENCIL_TEST);\n this.gl.disable(this.gl.DEPTH_TEST);\n\n // カリング(1.0beta3)\n this.gl.frontFace(this.gl.CW);\n\n this.gl.enable(this.gl.BLEND);\n this.gl.colorMask(true, true, true, true);\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, null); // 前にバッファがバインドされていたら破棄する必要がある\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, null);\n }\n\n /**\n * マスクテクスチャに描画するクリッピングコンテキストをセットする\n */\n public setClippingContextBufferForMask(clip: CubismClippingContext | null) {\n this._clippingContextBufferForMask = clip;\n }\n\n /**\n * マスクテクスチャに描画するクリッピングコンテキストを取得する\n * @return マスクテクスチャに描画するクリッピングコンテキスト\n */\n public getClippingContextBufferForMask(): CubismClippingContext | null {\n return this._clippingContextBufferForMask;\n }\n\n /**\n * 画面上に描画するクリッピングコンテキストをセットする\n */\n public setClippingContextBufferForDraw(clip: CubismClippingContext | null): void {\n this._clippingContextBufferForDraw = clip;\n }\n\n /**\n * 画面上に描画するクリッピングコンテキストを取得する\n * @return 画面上に描画するクリッピングコンテキスト\n */\n public getClippingContextBufferForDraw(): CubismClippingContext | null {\n return this._clippingContextBufferForDraw;\n }\n\n /**\n * glの設定\n */\n public startUp(gl: WebGLRenderingContext): void {\n this.gl = gl;\n this._clippingManager.setGL(gl);\n CubismShader_WebGL.getInstance().setGl(gl);\n }\n\n _textures: Record<number, WebGLTexture>; // モデルが参照するテクスチャとレンダラでバインドしているテクスチャとのマップ\n _sortedDrawableIndexList: number[]; // 描画オブジェクトのインデックスを描画順に並べたリスト\n _clippingManager: CubismClippingManager_WebGL; // クリッピングマスク管理オブジェクト\n _clippingContextBufferForMask: CubismClippingContext | null; // マスクテクスチャに描画するためのクリッピングコンテキスト\n _clippingContextBufferForDraw: CubismClippingContext | null; // 画面上描画するためのクリッピングコンテキスト\n firstDraw: boolean;\n _bufferData: {\n vertex: WebGLBuffer | null;\n uv: WebGLBuffer | null;\n index: WebGLBuffer | null;\n }; // 頂点バッファデータ\n gl!: WebGLRenderingContext; // webglコンテキスト\n}\n\n/**\n * レンダラが保持する静的なリソースを開放する\n */\nCubismRenderer.staticRelease = (): void => {\n CubismRenderer_WebGL.doStaticRelease();\n};\n","import { InternalModelOptions } from '@/cubism-common';\nimport { CommonHitArea, CommonLayout, InternalModel } from '@/cubism-common/InternalModel';\nimport { Cubism4ModelSettings } from '@/cubism4/Cubism4ModelSettings';\nimport { Cubism4MotionManager } from '@/cubism4/Cubism4MotionManager';\nimport {\n ParamAngleX,\n ParamAngleY,\n ParamAngleZ,\n ParamBodyAngleX,\n ParamBreath,\n ParamEyeBallX,\n ParamEyeBallY,\n} from '@cubism/cubismdefaultparameterid';\nimport { BreathParameterData, CubismBreath } from '@cubism/effect/cubismbreath';\nimport { CubismEyeBlink } from '@cubism/effect/cubismeyeblink';\nimport { CubismPose } from '@cubism/effect/cubismpose';\nimport { CubismMatrix44 } from '@cubism/math/cubismmatrix44';\nimport { CubismModel } from '@cubism/model/cubismmodel';\nimport { CubismModelUserData } from '@cubism/model/cubismmodeluserdata';\nimport { CubismPhysics } from '@cubism/physics/cubismphysics';\nimport { CubismRenderer_WebGL, CubismShader_WebGL } from '@cubism/rendering/cubismrenderer_webgl';\nimport { Matrix } from '@pixi/math';\nimport mapKeys from 'lodash/mapKeys';\n\nconst tempMatrix = new CubismMatrix44();\n\nexport class Cubism4InternalModel extends InternalModel {\n settings: Cubism4ModelSettings;\n coreModel: CubismModel;\n motionManager: Cubism4MotionManager;\n\n lipSync = true;\n\n breath = CubismBreath.create();\n eyeBlink?: CubismEyeBlink;\n pose?: CubismPose;\n physics?: CubismPhysics;\n\n // what's this for?\n userData?: CubismModelUserData;\n\n renderer = new CubismRenderer_WebGL();\n\n idParamAngleX = ParamAngleX;\n idParamAngleY = ParamAngleY;\n idParamAngleZ = ParamAngleZ;\n idParamEyeBallX = ParamEyeBallX;\n idParamEyeBallY = ParamEyeBallY;\n idParamBodyAngleX = ParamBodyAngleX;\n idParamBreath = ParamBreath;\n\n /**\n * The model's internal scale, defined in the moc3 file.\n */\n readonly pixelsPerUnit: number = 1;\n\n /**\n * Matrix that scales by {@link pixelsPerUnit}, and moves the origin from top-left to center.\n *\n * FIXME: This shouldn't be named as \"centering\"...\n */\n protected centeringTransform = new Matrix();\n\n constructor(coreModel: CubismModel, settings: Cubism4ModelSettings, options?: InternalModelOptions) {\n super();\n\n this.coreModel = coreModel;\n this.settings = settings;\n this.motionManager = new Cubism4MotionManager(settings, options);\n\n this.init();\n }\n\n protected init() {\n super.init();\n\n if (this.settings.getEyeBlinkParameters()?.length! > 0) {\n this.eyeBlink = CubismEyeBlink.create(this.settings);\n }\n\n this.breath.setParameters([\n new BreathParameterData(this.idParamAngleX, 0.0, 15.0, 6.5345, 0.5),\n new BreathParameterData(this.idParamAngleY, 0.0, 8.0, 3.5345, 0.5),\n new BreathParameterData(this.idParamAngleZ, 0.0, 10.0, 5.5345, 0.5),\n new BreathParameterData(this.idParamBodyAngleX, 0.0, 4.0, 15.5345, 0.5),\n new BreathParameterData(this.idParamBreath, 0.0, 0.5, 3.2345, 0.5),\n ]);\n\n this.renderer.initialize(this.coreModel);\n this.renderer.setIsPremultipliedAlpha(true);\n }\n\n protected getSize(): [number, number] {\n return [this.coreModel.getModel().canvasinfo.CanvasWidth, this.coreModel.getModel().canvasinfo.CanvasHeight];\n }\n\n protected getLayout(): CommonLayout {\n // un-capitalize each key to satisfy the common layout format\n // e.g. CenterX -> centerX\n return mapKeys({ ...this.settings.layout }, (_, key) => key.charAt(0).toLowerCase() + key.slice(1));\n }\n\n protected setupLayout() {\n super.setupLayout();\n\n (this as Mutable<this>).pixelsPerUnit = this.coreModel.getModel().canvasinfo.PixelsPerUnit;\n\n // move the origin from top left to center\n this.centeringTransform\n .scale(this.pixelsPerUnit, this.pixelsPerUnit)\n .translate(this.originalWidth / 2, this.originalHeight / 2);\n }\n\n updateWebGLContext(gl: WebGLRenderingContext, glContextID: number): void {\n // reset resources that were bound to previous WebGL context\n this.renderer.firstDraw = true;\n this.renderer._bufferData = {\n vertex: null,\n uv: null,\n index: null,\n };\n this.renderer.startUp(gl);\n this.renderer._clippingManager._currentFrameNo = glContextID;\n this.renderer._clippingManager._maskTexture = undefined;\n CubismShader_WebGL.getInstance()._shaderSets = [];\n }\n\n bindTexture(index: number, texture: WebGLTexture): void {\n this.renderer.bindTexture(index, texture);\n }\n\n protected getHitAreaDefs(): CommonHitArea[] {\n return this.settings.hitAreas?.map(hitArea => ({\n id: hitArea.Id,\n name: hitArea.Name,\n index: this.coreModel.getDrawableIndex(hitArea.Id),\n })) ?? [];\n }\n\n getDrawableIDs(): string[] {\n return this.coreModel.getDrawableIds();\n }\n\n getDrawableIndex(id: string): number {\n return this.coreModel.getDrawableIndex(id);\n }\n\n getDrawableVertices(drawIndex: number | string): Float32Array {\n if (typeof drawIndex === 'string') {\n drawIndex = this.coreModel.getDrawableIndex(drawIndex);\n\n if (drawIndex === -1) throw new TypeError('Unable to find drawable ID: ' + drawIndex);\n }\n\n const arr = this.coreModel.getDrawableVertices(drawIndex).slice();\n\n for (let i = 0; i < arr.length; i += 2) {\n arr[i] = arr[i]! * this.pixelsPerUnit + this.originalWidth / 2;\n arr[i + 1] = -arr[i + 1]! * this.pixelsPerUnit + this.originalHeight / 2;\n }\n\n return arr;\n }\n\n updateTransform(transform: Matrix) {\n this.drawingMatrix\n .copyFrom(this.centeringTransform)\n .prepend(this.localTransform)\n .prepend(transform);\n }\n\n public update(dt: DOMHighResTimeStamp, now: DOMHighResTimeStamp): void {\n super.update(dt, now);\n\n // cubism4 uses seconds\n dt /= 1000;\n now /= 1000;\n\n const model = this.coreModel;\n\n this.emit('beforeMotionUpdate');\n\n const motionUpdated = this.motionManager.update(this.coreModel, now);\n\n this.emit('afterMotionUpdate');\n\n model.saveParameters();\n\n if (!motionUpdated) {\n this.eyeBlink?.updateParameters(model, dt);\n }\n\n this.updateFocus();\n\n // revert the timestamps to be milliseconds\n this.updateNaturalMovements(dt * 1000, now * 1000);\n\n // TODO: Add lip sync API\n // if (this.lipSync) {\n // const value = 0; // 0 ~ 1\n //\n // for (let i = 0; i < this.lipSyncIds.length; ++i) {\n // model.addParameterValueById(this.lipSyncIds[i], value, 0.8);\n // }\n // }\n\n this.physics?.evaluate(model, dt);\n this.pose?.updateParameters(model, dt);\n\n this.emit('beforeModelUpdate');\n\n model.update();\n model.loadParameters();\n }\n\n updateFocus() {\n this.coreModel.addParameterValueById(this.idParamEyeBallX, this.focusController.x); // -1 ~ 1\n this.coreModel.addParameterValueById(this.idParamEyeBallY, this.focusController.y);\n this.coreModel.addParameterValueById(this.idParamAngleX, this.focusController.x * 30); // -30 ~ 30\n this.coreModel.addParameterValueById(this.idParamAngleY, this.focusController.y * 30);\n this.coreModel.addParameterValueById(this.idParamAngleZ, this.focusController.x * this.focusController.y * -30);\n this.coreModel.addParameterValueById(this.idParamBodyAngleX, this.focusController.x * 10); // -10 ~ 10\n }\n\n updateNaturalMovements(dt: DOMHighResTimeStamp, now: DOMHighResTimeStamp) {\n this.breath?.updateParameters(this.coreModel, dt / 1000);\n }\n\n draw(gl: WebGLRenderingContext): void {\n const matrix = this.drawingMatrix;\n const array = tempMatrix.getArray();\n\n // set given 3x3 matrix into a 4x4 matrix, with Y inverted\n array[0] = matrix.a;\n array[1] = matrix.b;\n array[4] = -matrix.c;\n array[5] = -matrix.d;\n array[12] = matrix.tx;\n array[13] = matrix.ty;\n\n this.renderer.setMvpMatrix(tempMatrix);\n this.renderer.setRenderState(gl.getParameter(gl.FRAMEBUFFER_BINDING), this.viewport);\n this.renderer.drawModel();\n }\n\n destroy() {\n super.destroy();\n\n this.renderer.release();\n this.coreModel.release();\n\n (this as Partial<this>).renderer = undefined;\n (this as Partial<this>).coreModel = undefined;\n }\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\n/**\n * @brief パラメータIDのデフォルト値を保持する定数<br>\n * デフォルト値の仕様は以下のマニュアルに基づく<br>\n * https://docs.live2d.com/cubism-editor-manual/standard-parametor-list/\n */\n // パーツID\nexport const HitAreaPrefix = 'HitArea';\nexport const HitAreaHead = 'Head';\nexport const HitAreaBody = 'Body';\nexport const PartsIdCore = 'Parts01Core';\nexport const PartsArmPrefix = 'Parts01Arm_';\nexport const PartsArmLPrefix = 'Parts01ArmL_';\nexport const PartsArmRPrefix = 'Parts01ArmR_';\n\n// パラメータID\nexport const ParamAngleX = 'ParamAngleX';\nexport const ParamAngleY = 'ParamAngleY';\nexport const ParamAngleZ = 'ParamAngleZ';\nexport const ParamEyeLOpen = 'ParamEyeLOpen';\nexport const ParamEyeLSmile = 'ParamEyeLSmile';\nexport const ParamEyeROpen = 'ParamEyeROpen';\nexport const ParamEyeRSmile = 'ParamEyeRSmile';\nexport const ParamEyeBallX = 'ParamEyeBallX';\nexport const ParamEyeBallY = 'ParamEyeBallY';\nexport const ParamEyeBallForm = 'ParamEyeBallForm';\nexport const ParamBrowLY = 'ParamBrowLY';\nexport const ParamBrowRY = 'ParamBrowRY';\nexport const ParamBrowLX = 'ParamBrowLX';\nexport const ParamBrowRX = 'ParamBrowRX';\nexport const ParamBrowLAngle = 'ParamBrowLAngle';\nexport const ParamBrowRAngle = 'ParamBrowRAngle';\nexport const ParamBrowLForm = 'ParamBrowLForm';\nexport const ParamBrowRForm = 'ParamBrowRForm';\nexport const ParamMouthForm = 'ParamMouthForm';\nexport const ParamMouthOpenY = 'ParamMouthOpenY';\nexport const ParamCheek = 'ParamCheek';\nexport const ParamBodyAngleX = 'ParamBodyAngleX';\nexport const ParamBodyAngleY = 'ParamBodyAngleY';\nexport const ParamBodyAngleZ = 'ParamBodyAngleZ';\nexport const ParamBreath = 'ParamBreath';\nexport const ParamArmLA = 'ParamArmLA';\nexport const ParamArmRA = 'ParamArmRA';\nexport const ParamArmLB = 'ParamArmLB';\nexport const ParamArmRB = 'ParamArmRB';\nexport const ParamHandL = 'ParamHandL';\nexport const ParamHandR = 'ParamHandR';\nexport const ParamHairFront = 'ParamHairFront';\nexport const ParamHairSide = 'ParamHairSide';\nexport const ParamHairBack = 'ParamHairBack';\nexport const ParamHairFluffy = 'ParamHairFluffy';\nexport const ParamShoulderY = 'ParamShoulderY';\nexport const ParamBustX = 'ParamBustX';\nexport const ParamBustY = 'ParamBustY';\nexport const ParamBaseX = 'ParamBaseX';\nexport const ParamBaseY = 'ParamBaseY';\nexport const ParamNONE = 'NONE:';\n","import { logger } from '@/utils';\nimport { CubismFramework, CubismStartupOption, LogLevel } from '@cubism/live2dcubismframework';\n\nlet startupPromise: Promise<void>;\nlet startupRetries = 20;\n\n/**\n * Promises the Cubism 4 runtime has been started up.\n * @return Promise that resolves if the startup has succeeded, rejects if failed.\n */\nexport function cubism4Ready(): Promise<void> {\n if (CubismFramework.isStarted()) {\n return Promise.resolve();\n }\n\n startupPromise ??= new Promise<void>(((resolve, reject) => {\n function startUpWithRetry() {\n try {\n startUpCubism4();\n resolve();\n } catch (e) {\n startupRetries--;\n\n if (startupRetries < 0) {\n const err = new Error('Failed to start up Cubism 4 framework.');\n\n (err as any).cause = e;\n\n reject(err);\n return;\n }\n\n logger.log('Cubism4', 'Startup failed, retrying 10ms later...');\n\n setTimeout(startUpWithRetry, 10);\n }\n }\n\n startUpWithRetry();\n }));\n\n return startupPromise;\n}\n\n/**\n * Starts up the Cubism 4 runtime.\n */\nexport function startUpCubism4(options?: CubismStartupOption) {\n options = Object.assign({\n logFunction: console.log,\n loggingLevel: LogLevel.LogLevel_Verbose,\n }, options);\n\n CubismFramework.startUp(options);\n CubismFramework.initialize();\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\nimport { CubismModel } from '../model/cubismmodel';\n\nconst Epsilon = 0.001;\nconst DefaultFadeInSeconds = 0.5;\n\n/**\n * パーツの不透明度の設定\n *\n * パーツの不透明度の管理と設定を行う。\n */\nexport class CubismPose {\n /**\n * インスタンスの作成\n * @param pose3json pose3.jsonのデータ\n * @return 作成されたインスタンス\n */\n public static create(pose3json: CubismSpec.PoseJSON): CubismPose {\n const ret: CubismPose = new CubismPose();\n\n // フェード時間の指定\n if (typeof pose3json.FadeInTime === 'number') {\n ret._fadeTimeSeconds = pose3json.FadeInTime;\n\n if (ret._fadeTimeSeconds <= 0.0) {\n ret._fadeTimeSeconds = DefaultFadeInSeconds;\n }\n }\n\n // パーツグループ\n const poseListInfo = pose3json.Groups;\n const poseCount: number = poseListInfo.length;\n\n for (let poseIndex = 0; poseIndex < poseCount; ++poseIndex) {\n const idListInfo = poseListInfo[poseIndex];\n const idCount: number = idListInfo.length;\n let groupCount = 0;\n\n for (let groupIndex = 0; groupIndex < idCount; ++groupIndex) {\n const partInfo = idListInfo[groupIndex];\n const partData: PartData = new PartData();\n\n partData.partId = partInfo.Id;\n\n const linkListInfo = partInfo.Link;\n\n // リンクするパーツの設定\n if (linkListInfo) {\n const linkCount: number = linkListInfo.length;\n\n for (let linkIndex = 0; linkIndex < linkCount; ++linkIndex) {\n const linkPart: PartData = new PartData();\n\n linkPart.partId = linkListInfo[linkIndex];\n\n partData.link.push(linkPart);\n }\n }\n\n ret._partGroups.push(partData);\n\n ++groupCount;\n }\n\n ret._partGroupCounts.push(groupCount);\n }\n\n return ret;\n }\n\n /**\n * モデルのパラメータの更新\n * @param model 対象のモデル\n * @param deltaTimeSeconds デルタ時間[秒]\n */\n public updateParameters(\n model: CubismModel,\n deltaTimeSeconds: number,\n ): void {\n // 前回のモデルと同じでない場合は初期化が必要\n if (model != this._lastModel) {\n // パラメータインデックスの初期化\n this.reset(model);\n }\n\n this._lastModel = model;\n\n // 設定から時間を変更すると、経過時間がマイナスになる事があるので、経過時間0として対応\n if (deltaTimeSeconds < 0.0) {\n deltaTimeSeconds = 0.0;\n }\n\n let beginIndex = 0;\n\n for (let i = 0; i < this._partGroupCounts.length; i++) {\n const partGroupCount: number = this._partGroupCounts[i];\n\n this.doFade(model, deltaTimeSeconds, beginIndex, partGroupCount);\n\n beginIndex += partGroupCount;\n }\n\n this.copyPartOpacities(model);\n }\n\n /**\n * 表示を初期化\n * @param model 対象のモデル\n * @note 不透明度の初期値が0でないパラメータは、不透明度を1に設定する\n */\n public reset(model: CubismModel): void {\n let beginIndex = 0;\n\n for (let i = 0; i < this._partGroupCounts.length; ++i) {\n const groupCount: number = this._partGroupCounts[i];\n\n for (let j: number = beginIndex; j < beginIndex + groupCount; ++j) {\n this._partGroups[j].initialize(model);\n\n const partsIndex: number = this._partGroups[j].partIndex;\n const paramIndex: number = this._partGroups[j].parameterIndex;\n\n if (partsIndex < 0) {\n continue;\n }\n\n model.setPartOpacityByIndex(partsIndex, j == beginIndex ? 1.0 : 0.0);\n model.setParameterValueByIndex(\n paramIndex,\n j == beginIndex ? 1.0 : 0.0,\n );\n\n for (let k = 0; k < this._partGroups[j].link.length; ++k) {\n this._partGroups\n [j]\n .link[k]\n .initialize(model);\n }\n }\n\n beginIndex += groupCount;\n }\n }\n\n /**\n * パーツの不透明度をコピー\n *\n * @param model 対象のモデル\n */\n public copyPartOpacities(model: CubismModel): void {\n for (\n let groupIndex = 0;\n groupIndex < this._partGroups.length;\n ++groupIndex\n ) {\n const partData: PartData = this._partGroups[groupIndex];\n\n if (partData.link.length == 0) {\n continue; // 連動するパラメータはない\n }\n\n const partIndex: number = this._partGroups[groupIndex].partIndex;\n const opacity: number = model.getPartOpacityByIndex(partIndex);\n\n for (\n let linkIndex = 0;\n linkIndex < partData.link.length;\n ++linkIndex\n ) {\n const linkPart: PartData = partData.link[linkIndex];\n const linkPartIndex: number = linkPart.partIndex;\n\n if (linkPartIndex < 0) {\n continue;\n }\n\n model.setPartOpacityByIndex(linkPartIndex, opacity);\n }\n }\n }\n\n /**\n * パーツのフェード操作を行う。\n * @param model 対象のモデル\n * @param deltaTimeSeconds デルタ時間[秒]\n * @param beginIndex フェード操作を行うパーツグループの先頭インデックス\n * @param partGroupCount フェード操作を行うパーツグループの個数\n */\n public doFade(\n model: CubismModel,\n deltaTimeSeconds: number,\n beginIndex: number,\n partGroupCount: number,\n ): void {\n let visiblePartIndex = -1;\n let newOpacity = 1.0;\n\n const phi = 0.5;\n const backOpacityThreshold = 0.15;\n\n // 現在、表示状態になっているパーツを取得\n for (let i: number = beginIndex; i < beginIndex + partGroupCount; ++i) {\n const partIndex: number = this._partGroups[i].partIndex;\n const paramIndex: number = this._partGroups[i].parameterIndex;\n\n if (model.getParameterValueByIndex(paramIndex) > Epsilon) {\n if (visiblePartIndex >= 0) {\n break;\n }\n\n visiblePartIndex = i;\n newOpacity = model.getPartOpacityByIndex(partIndex);\n\n // 新しい不透明度を計算\n newOpacity += deltaTimeSeconds / this._fadeTimeSeconds;\n\n if (newOpacity > 1.0) {\n newOpacity = 1.0;\n }\n }\n }\n\n if (visiblePartIndex < 0) {\n visiblePartIndex = 0;\n newOpacity = 1.0;\n }\n\n // 表示パーツ、非表示パーツの不透明度を設定する\n for (let i: number = beginIndex; i < beginIndex + partGroupCount; ++i) {\n const partsIndex: number = this._partGroups[i].partIndex;\n\n // 表示パーツの設定\n if (visiblePartIndex == i) {\n model.setPartOpacityByIndex(partsIndex, newOpacity); // 先に設定\n }\n // 非表示パーツの設定\n else {\n let opacity: number = model.getPartOpacityByIndex(partsIndex);\n let a1: number; // 計算によって求められる不透明度\n\n if (newOpacity < phi) {\n a1 = (newOpacity * (phi - 1)) / phi + 1.0; // (0,1),(phi,phi)を通る直線式\n } else {\n a1 = ((1 - newOpacity) * phi) / (1.0 - phi); // (1,0),(phi,phi)を通る直線式\n }\n\n // 背景の見える割合を制限する場合\n const backOpacity: number = (1.0 - a1) * (1.0 - newOpacity);\n\n if (backOpacity > backOpacityThreshold) {\n a1 = 1.0 - backOpacityThreshold / (1.0 - newOpacity);\n }\n\n if (opacity > a1) {\n opacity = a1; // 計算の不透明度よりも大きければ(濃ければ)不透明度を上げる\n }\n\n model.setPartOpacityByIndex(partsIndex, opacity);\n }\n }\n }\n\n /**\n * コンストラクタ\n */\n public constructor() {\n this._fadeTimeSeconds = DefaultFadeInSeconds;\n this._lastModel = undefined;\n this._partGroups = [];\n this._partGroupCounts = [];\n }\n\n _partGroups: PartData[]; // パーツグループ\n _partGroupCounts: number[]; // それぞれのパーツグループの個数\n _fadeTimeSeconds: number; // フェード時間[秒]\n _lastModel?: CubismModel; // 前回操作したモデル\n}\n\n/**\n * パーツにまつわるデータを管理\n */\nexport class PartData {\n /**\n * コンストラクタ\n */\n constructor(v?: PartData) {\n this.parameterIndex = 0;\n this.partIndex = 0;\n this.partId = '';\n this.link = [];\n\n if (v != undefined) {\n this.assignment(v);\n }\n }\n\n /**\n * =演算子のオーバーロード\n */\n public assignment(v: PartData): PartData {\n this.partId = v.partId;\n this.link = v.link.map(link => link.clone());\n\n return this;\n }\n\n /**\n * 初期化\n * @param model 初期化に使用するモデル\n */\n public initialize(model: CubismModel): void {\n this.parameterIndex = model.getParameterIndex(this.partId);\n this.partIndex = model.getPartIndex(this.partId);\n\n model.setParameterValueByIndex(this.parameterIndex, 1);\n }\n\n /**\n * オブジェクトのコピーを生成する\n */\n public clone(): PartData {\n const clonePartData: PartData = new PartData();\n\n clonePartData.partId = this.partId;\n clonePartData.parameterIndex = this.parameterIndex;\n clonePartData.partIndex = this.partIndex;\n clonePartData.link = this.link.map(link => link.clone());\n\n return clonePartData;\n }\n\n partId: string; // パーツID\n parameterIndex: number; // パラメータのインデックス\n partIndex: number; // パーツのインデックス\n link: PartData[]; // 連動するパラメータ\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\nimport { CubismBlendMode } from '../rendering/cubismrenderer';\nimport { CSM_ASSERT } from '../utils/cubismdebug';\n\n/**\n * モデル\n *\n * Mocデータから生成されるモデルのクラス。\n */\nexport class CubismModel {\n /**\n * モデルのパラメータの更新\n */\n public update(): void {\n // Update model\n this._model.update();\n\n this._model.drawables.resetDynamicFlags();\n }\n\n /**\n * キャンバスの幅を取得する\n */\n public getCanvasWidth(): number {\n if (this._model == null) {\n return 0.0;\n }\n\n return (\n this._model.canvasinfo.CanvasWidth /\n this._model.canvasinfo.PixelsPerUnit\n );\n }\n\n /**\n * キャンバスの高さを取得する\n */\n public getCanvasHeight(): number {\n if (this._model == null) {\n return 0.0;\n }\n\n return (\n this._model.canvasinfo.CanvasHeight /\n this._model.canvasinfo.PixelsPerUnit\n );\n }\n\n /**\n * パラメータを保存する\n */\n public saveParameters(): void {\n const parameterCount: number = this._model.parameters.count;\n const savedParameterCount: number = this._savedParameters.length;\n\n for (let i = 0; i < parameterCount; ++i) {\n if (i < savedParameterCount) {\n this._savedParameters[i] = this._parameterValues[i];\n } else {\n this._savedParameters.push(this._parameterValues[i]);\n }\n }\n }\n\n /**\n * モデルを取得\n */\n public getModel(): Live2DCubismCore.Model {\n return this._model;\n }\n\n /**\n * パーツのインデックスを取得\n * @param partId パーツのID\n * @return パーツのインデックス\n */\n public getPartIndex(partId: string): number {\n let partIndex: number;\n const partCount: number = this._model.parts.count;\n\n for (partIndex = 0; partIndex < partCount; ++partIndex) {\n if (partId == this._partIds[partIndex]) {\n return partIndex;\n }\n }\n\n // モデルに存在していない場合、非存在パーツIDリスト内にあるかを検索し、そのインデックスを返す\n if (partId in this._notExistPartId) {\n return this._notExistPartId[partId];\n }\n\n // 非存在パーツIDリストにない場合、新しく要素を追加する\n partIndex = partCount + this._notExistPartId.length;\n this._notExistPartId[partId] = partIndex;\n this._notExistPartOpacities[partIndex] = 0;\n\n return partIndex;\n }\n\n /**\n * パーツの個数の取得\n * @return パーツの個数\n */\n public getPartCount(): number {\n return this._model.parts.count;\n }\n\n /**\n * パーツの不透明度の設定(Index)\n * @param partIndex パーツのインデックス\n * @param opacity 不透明度\n */\n public setPartOpacityByIndex(partIndex: number, opacity: number): void {\n if (partIndex in this._notExistPartOpacities) {\n this._notExistPartOpacities[partIndex] = opacity;\n return;\n }\n\n // インデックスの範囲内検知\n CSM_ASSERT(0 <= partIndex && partIndex < this.getPartCount());\n\n this._partOpacities[partIndex] = opacity;\n }\n\n /**\n * パーツの不透明度の設定(Id)\n * @param partId パーツのID\n * @param opacity パーツの不透明度\n */\n public setPartOpacityById(partId: string, opacity: number): void {\n // 高速化のためにPartIndexを取得できる機構になっているが、外部からの設定の時は呼び出し頻度が低いため不要\n const index: number = this.getPartIndex(partId);\n\n if (index < 0) {\n return; // パーツがないのでスキップ\n }\n\n this.setPartOpacityByIndex(index, opacity);\n }\n\n /**\n * パーツの不透明度の取得(index)\n * @param partIndex パーツのインデックス\n * @return パーツの不透明度\n */\n public getPartOpacityByIndex(partIndex: number): number {\n if (partIndex in this._notExistPartOpacities) {\n // モデルに存在しないパーツIDの場合、非存在パーツリストから不透明度を返す。\n return this._notExistPartOpacities[partIndex];\n }\n\n // インデックスの範囲内検知\n CSM_ASSERT(0 <= partIndex && partIndex < this.getPartCount());\n\n return this._partOpacities[partIndex];\n }\n\n /**\n * パーツの不透明度の取得(id)\n * @param partId パーツのId\n * @return パーツの不透明度\n */\n public getPartOpacityById(partId: string): number {\n // 高速化のためにPartIndexを取得できる機構になっているが、外部からの設定の時は呼び出し頻度が低いため不要\n const index: number = this.getPartIndex(partId);\n\n if (index < 0) {\n return 0; // パーツが無いのでスキップ\n }\n\n return this.getPartOpacityByIndex(index);\n }\n\n /**\n * パラメータのインデックスの取得\n * @param パラメータID\n * @return パラメータのインデックス\n */\n public getParameterIndex(parameterId: string): number {\n let parameterIndex: number;\n const idCount: number = this._model.parameters.count;\n\n for (parameterIndex = 0; parameterIndex < idCount; ++parameterIndex) {\n if (parameterId != this._parameterIds[parameterIndex]) {\n continue;\n }\n\n return parameterIndex;\n }\n\n // モデルに存在していない場合、非存在パラメータIDリスト内を検索し、そのインデックスを返す\n if (parameterId in this._notExistParameterId) {\n return this._notExistParameterId[parameterId];\n }\n\n // 非存在パラメータIDリストにない場合新しく要素を追加する\n parameterIndex = this._model.parameters.count + Object.keys(this._notExistParameterId).length;\n\n this._notExistParameterId[parameterId] = parameterIndex;\n this._notExistParameterValues[parameterIndex] = 0;\n\n return parameterIndex;\n }\n\n /**\n * パラメータの個数の取得\n * @return パラメータの個数\n */\n public getParameterCount(): number {\n return this._model.parameters.count;\n }\n\n /**\n * パラメータの最大値の取得\n * @param parameterIndex パラメータのインデックス\n * @return パラメータの最大値\n */\n public getParameterMaximumValue(parameterIndex: number): number {\n return this._model.parameters.maximumValues[parameterIndex];\n }\n\n /**\n * パラメータの最小値の取得\n * @param parameterIndex パラメータのインデックス\n * @return パラメータの最小値\n */\n public getParameterMinimumValue(parameterIndex: number): number {\n return this._model.parameters.minimumValues[parameterIndex];\n }\n\n /**\n * パラメータのデフォルト値の取得\n * @param parameterIndex パラメータのインデックス\n * @return パラメータのデフォルト値\n */\n public getParameterDefaultValue(parameterIndex: number): number {\n return this._model.parameters.defaultValues[parameterIndex];\n }\n\n /**\n * パラメータの値の取得\n * @param parameterIndex パラメータのインデックス\n * @return パラメータの値\n */\n public getParameterValueByIndex(parameterIndex: number): number {\n if (parameterIndex in this._notExistParameterValues) {\n return this._notExistParameterValues[parameterIndex];\n }\n\n // インデックスの範囲内検知\n CSM_ASSERT(0 <= parameterIndex && parameterIndex < this.getParameterCount());\n\n return this._parameterValues[parameterIndex];\n }\n\n /**\n * パラメータの値の取得\n * @param parameterId パラメータのID\n * @return パラメータの値\n */\n public getParameterValueById(parameterId: string): number {\n // 高速化のためにparameterIndexを取得できる機構になっているが、外部からの設定の時は呼び出し頻度が低いため不要\n const parameterIndex: number = this.getParameterIndex(parameterId);\n return this.getParameterValueByIndex(parameterIndex);\n }\n\n /**\n * パラメータの値の設定\n * @param parameterIndex パラメータのインデックス\n * @param value パラメータの値\n * @param weight 重み\n */\n public setParameterValueByIndex(\n parameterIndex: number,\n value: number,\n weight = 1.0,\n ): void {\n if (parameterIndex in this._notExistParameterValues) {\n this._notExistParameterValues[parameterIndex] =\n weight == 1\n ? value\n : this._notExistParameterValues[parameterIndex] *\n (1 - weight) +\n value * weight;\n\n return;\n }\n\n // インデックスの範囲内検知\n CSM_ASSERT(0 <= parameterIndex && parameterIndex < this.getParameterCount());\n\n if (this._model.parameters.maximumValues[parameterIndex] < value) {\n value = this._model.parameters.maximumValues[parameterIndex];\n }\n if (this._model.parameters.minimumValues[parameterIndex] > value) {\n value = this._model.parameters.minimumValues[parameterIndex];\n }\n\n this._parameterValues[parameterIndex] =\n weight == 1\n ? value\n : (this._parameterValues[parameterIndex] =\n this._parameterValues[parameterIndex] * (1 - weight) +\n value * weight);\n }\n\n /**\n * パラメータの値の設定\n * @param parameterId パラメータのID\n * @param value パラメータの値\n * @param weight 重み\n */\n public setParameterValueById(\n parameterId: string,\n value: number,\n weight = 1.0,\n ): void {\n const index: number = this.getParameterIndex(parameterId);\n this.setParameterValueByIndex(index, value, weight);\n }\n\n /**\n * パラメータの値の加算(index)\n * @param parameterIndex パラメータインデックス\n * @param value 加算する値\n * @param weight 重み\n */\n public addParameterValueByIndex(\n parameterIndex: number,\n value: number,\n weight = 1.0,\n ): void {\n this.setParameterValueByIndex(\n parameterIndex,\n this.getParameterValueByIndex(parameterIndex) + value * weight,\n );\n }\n\n /**\n * パラメータの値の加算(id)\n * @param parameterId パラメータID\n * @param value 加算する値\n * @param weight 重み\n */\n public addParameterValueById(\n parameterId: any,\n value: number,\n weight = 1.0,\n ): void {\n const index: number = this.getParameterIndex(parameterId);\n this.addParameterValueByIndex(index, value, weight);\n }\n\n /**\n * パラメータの値の乗算\n * @param parameterId パラメータのID\n * @param value 乗算する値\n * @param weight 重み\n */\n public multiplyParameterValueById(\n parameterId: string,\n value: number,\n weight = 1.0,\n ): void {\n const index: number = this.getParameterIndex(parameterId);\n this.multiplyParameterValueByIndex(index, value, weight);\n }\n\n /**\n * パラメータの値の乗算\n * @param parameterIndex パラメータのインデックス\n * @param value 乗算する値\n * @param weight 重み\n */\n public multiplyParameterValueByIndex(\n parameterIndex: number,\n value: number,\n weight = 1.0,\n ): void {\n this.setParameterValueByIndex(\n parameterIndex,\n this.getParameterValueByIndex(parameterIndex) *\n (1.0 + (value - 1.0) * weight),\n );\n }\n\n public getDrawableIds() {\n return this._drawableIds.slice();\n }\n\n /**\n * Drawableのインデックスの取得\n * @param drawableId DrawableのID\n * @return Drawableのインデックス\n */\n public getDrawableIndex(drawableId: string): number {\n const drawableCount = this._model.drawables.count;\n\n for (\n let drawableIndex = 0;\n drawableIndex < drawableCount;\n ++drawableIndex\n ) {\n if (this._drawableIds[drawableIndex] == drawableId) {\n return drawableIndex;\n }\n }\n\n return -1;\n }\n\n /**\n * Drawableの個数の取得\n * @return drawableの個数\n */\n public getDrawableCount(): number {\n return this._model.drawables.count;\n }\n\n /**\n * DrawableのIDを取得する\n * @param drawableIndex Drawableのインデックス\n * @return drawableのID\n */\n public getDrawableId(drawableIndex: number): string {\n return this._model.drawables.ids[drawableIndex];\n }\n\n /**\n * Drawableの描画順リストの取得\n * @return Drawableの描画順リスト\n */\n public getDrawableRenderOrders(): Int32Array {\n return this._model.drawables.renderOrders;\n }\n\n /**\n * Drawableのテクスチャインデックスリストの取得\n * @param drawableIndex Drawableのインデックス\n * @return drawableのテクスチャインデックスリスト\n */\n public getDrawableTextureIndices(drawableIndex: number): number {\n return this._model.drawables.textureIndices[drawableIndex];\n }\n\n /**\n * DrawableのVertexPositionsの変化情報の取得\n *\n * 直近のCubismModel.update関数でDrawableの頂点情報が変化したかを取得する。\n *\n * @param drawableIndex Drawableのインデックス\n * @retval true Drawableの頂点情報が直近のCubismModel.update関数で変化した\n * @retval false Drawableの頂点情報が直近のCubismModel.update関数で変化していない\n */\n public getDrawableDynamicFlagVertexPositionsDidChange(\n drawableIndex: number,\n ): boolean {\n const dynamicFlags: Uint8Array = this._model.drawables.dynamicFlags;\n return Live2DCubismCore.Utils.hasVertexPositionsDidChangeBit(\n dynamicFlags[drawableIndex],\n );\n }\n\n /**\n * Drawableの頂点インデックスの個数の取得\n * @param drawableIndex Drawableのインデックス\n * @return drawableの頂点インデックスの個数\n */\n public getDrawableVertexIndexCount(drawableIndex: number): number {\n return this._model.drawables.indexCounts[drawableIndex];\n }\n\n /**\n * Drawableの頂点の個数の取得\n * @param drawableIndex Drawableのインデックス\n * @return drawableの頂点の個数\n */\n public getDrawableVertexCount(drawableIndex: number): number {\n return this._model.drawables.vertexCounts[drawableIndex];\n }\n\n /**\n * Drawableの頂点リストの取得\n * @param drawableIndex drawableのインデックス\n * @return drawableの頂点リスト\n */\n public getDrawableVertices(drawableIndex: number): Float32Array {\n return this.getDrawableVertexPositions(drawableIndex);\n }\n\n /**\n * Drawableの頂点インデックスリストの取得\n * @param drarableIndex Drawableのインデックス\n * @return drawableの頂点インデックスリスト\n */\n public getDrawableVertexIndices(drawableIndex: number): Uint16Array {\n return this._model.drawables.indices[drawableIndex];\n }\n\n /**\n * Drawableの頂点リストの取得\n * @param drawableIndex Drawableのインデックス\n * @return drawableの頂点リスト\n */\n public getDrawableVertexPositions(drawableIndex: number): Float32Array {\n return this._model.drawables.vertexPositions[drawableIndex];\n }\n\n /**\n * Drawableの頂点のUVリストの取得\n * @param drawableIndex Drawableのインデックス\n * @return drawableの頂点UVリスト\n */\n public getDrawableVertexUvs(drawableIndex: number): Float32Array {\n return this._model.drawables.vertexUvs[drawableIndex];\n }\n\n /**\n * Drawableの不透明度の取得\n * @param drawableIndex Drawableのインデックス\n * @return drawableの不透明度\n */\n public getDrawableOpacity(drawableIndex: number): number {\n return this._model.drawables.opacities[drawableIndex];\n }\n\n /**\n * Drawableのカリング情報の取得\n * @param drawableIndex Drawableのインデックス\n * @return drawableのカリング情報\n */\n public getDrawableCulling(drawableIndex: number): boolean {\n const constantFlags = this._model.drawables.constantFlags;\n\n return !Live2DCubismCore.Utils.hasIsDoubleSidedBit(\n constantFlags[drawableIndex],\n );\n }\n\n /**\n * Drawableのブレンドモードを取得\n * @param drawableIndex Drawableのインデックス\n * @return drawableのブレンドモード\n */\n public getDrawableBlendMode(drawableIndex: number): CubismBlendMode {\n const constantFlags = this._model.drawables.constantFlags;\n\n return Live2DCubismCore.Utils.hasBlendAdditiveBit(\n constantFlags[drawableIndex],\n )\n ? CubismBlendMode.CubismBlendMode_Additive\n : Live2DCubismCore.Utils.hasBlendMultiplicativeBit(\n constantFlags[drawableIndex],\n )\n ? CubismBlendMode.CubismBlendMode_Multiplicative\n : CubismBlendMode.CubismBlendMode_Normal;\n }\n\n /**\n * Drawableのマスクの反転使用の取得\n *\n * Drawableのマスク使用時の反転設定を取得する。\n * マスクを使用しない場合は無視される。\n *\n * @param drawableIndex Drawableのインデックス\n * @return Drawableの反転設定\n */\n public getDrawableInvertedMaskBit(drawableIndex: number): boolean {\n const constantFlags: Uint8Array = this._model.drawables.constantFlags;\n\n return Live2DCubismCore.Utils.hasIsInvertedMaskBit(\n constantFlags[drawableIndex],\n );\n }\n\n /**\n * Drawableのクリッピングマスクリストの取得\n * @return Drawableのクリッピングマスクリスト\n */\n public getDrawableMasks(): Int32Array[] {\n return this._model.drawables.masks;\n }\n\n /**\n * Drawableのクリッピングマスクの個数リストの取得\n * @return Drawableのクリッピングマスクの個数リスト\n */\n public getDrawableMaskCounts(): Int32Array {\n return this._model.drawables.maskCounts;\n }\n\n /**\n * クリッピングマスクの使用状態\n *\n * @return true クリッピングマスクを使用している\n * @return false クリッピングマスクを使用していない\n */\n public isUsingMasking(): boolean {\n for (let d = 0; d < this._model.drawables.count; ++d) {\n if (this._model.drawables.maskCounts[d] <= 0) {\n continue;\n }\n return true;\n }\n return false;\n }\n\n /**\n * Drawableの表示情報を取得する\n *\n * @param drawableIndex Drawableのインデックス\n * @return true Drawableが表示\n * @return false Drawableが非表示\n */\n public getDrawableDynamicFlagIsVisible(drawableIndex: number): boolean {\n const dynamicFlags: Uint8Array = this._model.drawables.dynamicFlags;\n return Live2DCubismCore.Utils.hasIsVisibleBit(\n dynamicFlags[drawableIndex],\n );\n }\n\n /**\n * DrawableのDrawOrderの変化情報の取得\n *\n * 直近のCubismModel.update関数でdrawableのdrawOrderが変化したかを取得する。\n * drawOrderはartMesh上で指定する0から1000の情報\n * @param drawableIndex drawableのインデックス\n * @return true drawableの不透明度が直近のCubismModel.update関数で変化した\n * @return false drawableの不透明度が直近のCubismModel.update関数で変化している\n */\n public getDrawableDynamicFlagVisibilityDidChange(\n drawableIndex: number,\n ): boolean {\n const dynamicFlags: Uint8Array = this._model.drawables.dynamicFlags;\n return Live2DCubismCore.Utils.hasVisibilityDidChangeBit(\n dynamicFlags[drawableIndex],\n );\n }\n\n /**\n * Drawableの不透明度の変化情報の取得\n *\n * 直近のCubismModel.update関数でdrawableの不透明度が変化したかを取得する。\n *\n * @param drawableIndex drawableのインデックス\n * @return true Drawableの不透明度が直近のCubismModel.update関数で変化した\n * @return false Drawableの不透明度が直近のCubismModel.update関数で変化してない\n */\n public getDrawableDynamicFlagOpacityDidChange(\n drawableIndex: number,\n ): boolean {\n const dynamicFlags: Uint8Array = this._model.drawables.dynamicFlags;\n return Live2DCubismCore.Utils.hasOpacityDidChangeBit(\n dynamicFlags[drawableIndex],\n );\n }\n\n /**\n * Drawableの描画順序の変化情報の取得\n *\n * 直近のCubismModel.update関数でDrawableの描画の順序が変化したかを取得する。\n *\n * @param drawableIndex Drawableのインデックス\n * @return true Drawableの描画の順序が直近のCubismModel.update関数で変化した\n * @return false Drawableの描画の順序が直近のCubismModel.update関数で変化してない\n */\n public getDrawableDynamicFlagRenderOrderDidChange(\n drawableIndex: number,\n ): boolean {\n const dynamicFlags: Uint8Array = this._model.drawables.dynamicFlags;\n return Live2DCubismCore.Utils.hasRenderOrderDidChangeBit(\n dynamicFlags[drawableIndex],\n );\n }\n\n /**\n * 保存されたパラメータの読み込み\n */\n public loadParameters(): void {\n let parameterCount: number = this._model.parameters.count;\n const savedParameterCount: number = this._savedParameters.length;\n\n if (parameterCount > savedParameterCount) {\n parameterCount = savedParameterCount;\n }\n\n for (let i = 0; i < parameterCount; ++i) {\n this._parameterValues[i] = this._savedParameters[i];\n }\n }\n\n /**\n * 初期化する\n */\n public initialize(): void {\n this._parameterValues = this._model.parameters.values;\n this._partOpacities = this._model.parts.opacities;\n this._parameterMaximumValues = this._model.parameters.maximumValues;\n this._parameterMinimumValues = this._model.parameters.minimumValues;\n\n {\n const parameterIds: string[] = this._model.parameters.ids;\n const parameterCount: number = this._model.parameters.count;\n\n for (let i = 0; i < parameterCount; ++i) {\n this._parameterIds.push(parameterIds[i]);\n }\n }\n\n {\n const partIds: string[] = this._model.parts.ids;\n const partCount: number = this._model.parts.count;\n\n for (let i = 0; i < partCount; ++i) {\n this._partIds.push(partIds[i]);\n }\n }\n\n {\n const drawableIds: string[] = this._model.drawables.ids;\n const drawableCount: number = this._model.drawables.count;\n\n for (let i = 0; i < drawableCount; ++i) {\n this._drawableIds.push(drawableIds[i]);\n }\n }\n }\n\n /**\n * コンストラクタ\n * @param model モデル\n */\n public constructor(model: Live2DCubismCore.Model) {\n this._model = model;\n this._savedParameters = [];\n this._parameterIds = [];\n this._drawableIds = [];\n this._partIds = [];\n\n this._notExistPartId = {};\n this._notExistParameterId = {};\n this._notExistParameterValues = {};\n this._notExistPartOpacities = {};\n\n this.initialize();\n }\n\n /**\n * デストラクタ相当の処理\n */\n public release(): void {\n this._model.release();\n (this as any)._model = undefined;\n }\n\n private _notExistPartOpacities: Record<number, number>; // 存在していないパーツの不透明度のリスト\n private _notExistPartId: Record<string, number>; // 存在していないパーツIDのリスト\n\n private _notExistParameterValues: Record<number, number>; // 存在していないパラメータの値のリスト\n private _notExistParameterId: Record<string, number>; // 存在していないパラメータIDのリスト\n\n private _savedParameters: number[]; // 保存されたパラメータ\n\n private _model: Live2DCubismCore.Model; // モデル\n\n private _parameterValues!: Float32Array; // パラメータの値のリスト\n private _parameterMaximumValues!: Float32Array; // パラメータの最大値のリスト\n private _parameterMinimumValues!: Float32Array; // パラメータの最小値のリスト\n\n private _partOpacities!: Float32Array; // パーツの不透明度のリスト\n\n private _parameterIds: string[];\n private _partIds: string[];\n private _drawableIds: string[];\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\nimport { CubismModel } from './cubismmodel';\n\n/**\n * Mocデータの管理\n *\n * Mocデータの管理を行うクラス。\n */\nexport class CubismMoc {\n /**\n * Mocデータの作成\n */\n public static create(mocBytes: ArrayBuffer): CubismMoc {\n const moc: Live2DCubismCore.Moc = Live2DCubismCore.Moc.fromArrayBuffer(mocBytes);\n\n if (moc) {\n return new CubismMoc(moc);\n }\n\n throw new Error('Unknown error');\n }\n\n /**\n * モデルを作成する\n *\n * @return Mocデータから作成されたモデル\n */\n createModel(): CubismModel {\n let cubismModel: CubismModel;\n\n const model: Live2DCubismCore.Model = Live2DCubismCore.Model.fromMoc(this._moc);\n\n if (model) {\n cubismModel = new CubismModel(model);\n\n ++this._modelCount;\n\n return cubismModel;\n }\n\n throw new Error('Unknown error');\n }\n\n /**\n * モデルを削除する\n */\n deleteModel(model: CubismModel): void {\n if (model != null) {\n --this._modelCount;\n }\n }\n\n /**\n * コンストラクタ\n */\n private constructor(moc: Live2DCubismCore.Moc) {\n this._moc = moc;\n this._modelCount = 0;\n }\n\n /**\n * デストラクタ相当の処理\n */\n public release(): void {\n this._moc._release();\n (this as Partial<this>)._moc = undefined;\n }\n\n _moc: Live2DCubismCore.Moc; // Mocデータ\n _modelCount: number; // Mocデータから作られたモデルの個数\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\nimport { CubismVector2 } from '../math/cubismvector2';\n\n/**\n * 物理演算の適用先の種類\n */\nexport enum CubismPhysicsTargetType {\n CubismPhysicsTargetType_Parameter // パラメータに対して適用\n}\n\n/**\n * 物理演算の入力の種類\n */\nexport enum CubismPhysicsSource {\n CubismPhysicsSource_X, // X軸の位置から\n CubismPhysicsSource_Y, // Y軸の位置から\n CubismPhysicsSource_Angle // 角度から\n}\n\n/**\n * @brief 物理演算で使用する外部の力\n *\n * 物理演算で使用する外部の力。\n */\nexport class PhysicsJsonEffectiveForces {\n constructor() {\n this.gravity = new CubismVector2(0, 0);\n this.wind = new CubismVector2(0, 0);\n }\n\n gravity: CubismVector2; // 重力\n wind: CubismVector2; // 風\n}\n\n/**\n * 物理演算のパラメータ情報\n */\nexport interface CubismPhysicsParameter {\n id: string; // パラメータ\n targetType: CubismPhysicsTargetType; // 適用先の種類\n}\n\n/**\n * 物理演算の正規化情報\n */\nexport interface CubismPhysicsNormalization {\n minimum: number; // 最大値\n maximum: number; // 最小値\n defalut: number; // デフォルト値\n}\n\n/**\n * 物理演算の演算委使用する物理点の情報\n */\nexport class CubismPhysicsParticle {\n constructor() {\n this.initialPosition = new CubismVector2(0, 0);\n this.position = new CubismVector2(0, 0);\n this.lastPosition = new CubismVector2(0, 0);\n this.lastGravity = new CubismVector2(0, 0);\n this.force = new CubismVector2(0, 0);\n this.velocity = new CubismVector2(0, 0);\n }\n\n initialPosition: CubismVector2; // 初期位置\n mobility!: number; // 動きやすさ\n delay!: number; // 遅れ\n acceleration!: number; // 加速度\n radius!: number; // 距離\n position: CubismVector2; // 現在の位置\n lastPosition: CubismVector2; // 最後の位置\n lastGravity: CubismVector2; // 最後の重力\n force: CubismVector2; // 現在かかっている力\n velocity: CubismVector2; // 現在の速度\n}\n\n/**\n * 物理演算の物理点の管理\n */\nexport class CubismPhysicsSubRig {\n inputCount!: number; // 入力の個数\n outputCount!: number; // 出力の個数\n particleCount!: number; // 物理点の個数\n baseInputIndex!: number; // 入力の最初のインデックス\n baseOutputIndex!: number; // 出力の最初のインデックス\n baseParticleIndex!: number; // 物理点の最初のインデックス\n normalizationPosition: CubismPhysicsNormalization = {} as any; // 正規化された位置\n normalizationAngle: CubismPhysicsNormalization = {} as any; // 正規化された角度\n}\n\n/**\n * 正規化されたパラメータの取得関数の宣言\n * @param targetTranslation // 演算結果の移動値\n * @param targetAngle // 演算結果の角度\n * @param value // パラメータの値\n * @param parameterMinimunValue // パラメータの最小値\n * @param parameterMaximumValue // パラメータの最大値\n * @param parameterDefaultValue // パラメータのデフォルト値\n * @param normalizationPosition // 正規化された位置\n * @param normalizationAngle // 正規化された角度\n * @param isInverted // 値が反転されているか?\n * @param weight // 重み\n */\nexport interface normalizedPhysicsParameterValueGetter {\n (\n targetTranslation: CubismVector2,\n targetAngle: { angle: number },\n value: number,\n parameterMinimunValue: number,\n parameterMaximumValue: number,\n parameterDefaultValue: number,\n normalizationPosition: CubismPhysicsNormalization,\n normalizationAngle: CubismPhysicsNormalization,\n isInverted: boolean,\n weight: number,\n ): void;\n}\n\n/**\n * 物理演算の値の取得関数の宣言\n * @param translation 移動値\n * @param particles 物理点のリスト\n * @param isInverted 値が反映されているか\n * @param parentGravity 重力\n * @return 値\n */\nexport interface physicsValueGetter {\n (\n translation: CubismVector2,\n particles: CubismPhysicsParticle[],\n particleIndex: number,\n isInverted: boolean,\n parentGravity: CubismVector2,\n ): number;\n}\n\n/**\n * 物理演算のスケールの取得関数の宣言\n * @param translationScale 移動値のスケール\n * @param angleScale 角度のスケール\n * @return スケール値\n */\nexport interface physicsScaleGetter {\n (translationScale: CubismVector2, angleScale: number): number;\n}\n\n/**\n * 物理演算の入力情報\n */\nexport class CubismPhysicsInput {\n source: CubismPhysicsParameter = {} as any; // 入力元のパラメータ\n sourceParameterIndex!: number; // 入力元のパラメータのインデックス\n weight!: number; // 重み\n type!: number; // 入力の種類\n reflect!: boolean; // 値が反転されているかどうか\n getNormalizedParameterValue!: normalizedPhysicsParameterValueGetter; // 正規化されたパラメータ値の取得関数\n}\n\n/**\n * @brief 物理演算の出力情報\n *\n * 物理演算の出力情報。\n */\nexport class CubismPhysicsOutput {\n destination: CubismPhysicsParameter = {} as any; // 出力先のパラメータ\n destinationParameterIndex!: number; // 出力先のパラメータのインデックス\n vertexIndex!: number; // 振り子のインデックス\n translationScale = new CubismVector2(0, 0); // 移動値のスケール\n angleScale!: number; // 角度のスケール\n weight!: number; // 重み\n type!: CubismPhysicsSource; // 出力の種類\n reflect!: boolean; // 値が反転されているかどうか\n valueBelowMinimum!: number; // 最小値を下回った時の値\n valueExceededMaximum!: number; // 最大値をこえた時の値\n getValue!: physicsValueGetter; // 物理演算の値の取得関数\n getScale!: physicsScaleGetter; // 物理演算のスケール値の取得関数\n}\n\n/**\n * @brief 物理演算のデータ\n *\n * 物理演算のデータ。\n */\nexport class CubismPhysicsRig {\n constructor() {\n this.settings = [];\n this.inputs = [];\n this.outputs = [];\n this.particles = [];\n this.gravity = new CubismVector2(0, 0);\n this.wind = new CubismVector2(0, 0);\n }\n\n subRigCount!: number; // 物理演算の物理点の個数\n settings: CubismPhysicsSubRig[]; // 物理演算の物理点の管理のリスト\n inputs: CubismPhysicsInput[]; // 物理演算の入力のリスト\n outputs: CubismPhysicsOutput[]; // 物理演算の出力のリスト\n particles: CubismPhysicsParticle[]; // 物理演算の物理点のリスト\n gravity: CubismVector2; // 重力\n wind: CubismVector2; // 風\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\nimport { CubismVector2 } from '../math/cubismvector2';\n\n/**\n * physics3.jsonのコンテナ。\n */\nexport class CubismPhysicsJson {\n /**\n * コンストラクタ\n * @param json physics3.jsonが読み込まれているバッファ\n */\n public constructor(json: CubismSpec.PhysicsJSON) {\n this._json = json;\n }\n\n /**\n * デストラクタ相当の処理\n */\n public release(): void {\n (this as Partial<this>)._json = undefined;\n }\n\n /**\n * 重力の取得\n * @return 重力\n */\n public getGravity(): CubismVector2 {\n const ret: CubismVector2 = new CubismVector2(0, 0);\n ret.x = this._json.Meta.EffectiveForces.Gravity.X;\n ret.y = this._json.Meta.EffectiveForces.Gravity.Y;\n return ret;\n }\n\n /**\n * 風の取得\n * @return 風\n */\n public getWind(): CubismVector2 {\n const ret: CubismVector2 = new CubismVector2(0, 0);\n ret.x = this._json.Meta.EffectiveForces.Wind.X;\n ret.y = this._json.Meta.EffectiveForces.Wind.Y;\n return ret;\n }\n\n /**\n * 物理店の管理の個数の取得\n * @return 物理店の管理の個数\n */\n public getSubRigCount(): number {\n return this._json.Meta.PhysicsSettingCount;\n }\n\n /**\n * 入力の総合計の取得\n * @return 入力の総合計\n */\n public getTotalInputCount(): number {\n return this._json.Meta.TotalInputCount;\n }\n\n /**\n * 出力の総合計の取得\n * @return 出力の総合計\n */\n public getTotalOutputCount(): number {\n return this._json.Meta.TotalOutputCount;\n }\n\n /**\n * 物理点の個数の取得\n * @return 物理点の個数\n */\n public getVertexCount(): number {\n return this._json.Meta.VertexCount;\n }\n\n /**\n * 正規化された位置の最小値の取得\n * @param physicsSettingIndex 物理演算の設定のインデックス\n * @return 正規化された位置の最小値\n */\n public getNormalizationPositionMinimumValue(\n physicsSettingIndex: number,\n ): number {\n return this._json.PhysicsSettings[physicsSettingIndex].Normalization.Position.Minimum;\n }\n\n /**\n * 正規化された位置の最大値の取得\n * @param physicsSettingIndex 物理演算の設定のインデックス\n * @return 正規化された位置の最大値\n */\n public getNormalizationPositionMaximumValue(\n physicsSettingIndex: number,\n ): number {\n return this._json.PhysicsSettings[physicsSettingIndex].Normalization.Position.Maximum;\n }\n\n /**\n * 正規化された位置のデフォルト値の取得\n * @param physicsSettingIndex 物理演算の設定のインデックス\n * @return 正規化された位置のデフォルト値\n */\n public getNormalizationPositionDefaultValue(\n physicsSettingIndex: number,\n ): number {\n return this._json.PhysicsSettings[physicsSettingIndex].Normalization.Position.Default;\n }\n\n /**\n * 正規化された角度の最小値の取得\n * @param physicsSettingIndex 物理演算の設定のインデックス\n * @return 正規化された角度の最小値\n */\n public getNormalizationAngleMinimumValue(\n physicsSettingIndex: number,\n ): number {\n return this._json.PhysicsSettings[physicsSettingIndex].Normalization.Angle.Minimum;\n }\n\n /**\n * 正規化された角度の最大値の取得\n * @param physicsSettingIndex\n * @return 正規化された角度の最大値\n */\n public getNormalizationAngleMaximumValue(\n physicsSettingIndex: number,\n ): number {\n return this._json.PhysicsSettings[physicsSettingIndex].Normalization.Angle.Maximum;\n }\n\n /**\n * 正規化された角度のデフォルト値の取得\n * @param physicsSettingIndex 物理演算の設定のインデックス\n * @return 正規化された角度のデフォルト値\n */\n public getNormalizationAngleDefaultValue(\n physicsSettingIndex: number,\n ): number {\n return this._json.PhysicsSettings[physicsSettingIndex].Normalization.Angle.Default;\n }\n\n /**\n * 入力の個数の取得\n * @param physicsSettingIndex 物理演算の設定のインデックス\n * @return 入力の個数\n */\n public getInputCount(physicsSettingIndex: number): number {\n return this._json.PhysicsSettings[physicsSettingIndex].Input.length;\n }\n\n /**\n * 入力の重みの取得\n * @param physicsSettingIndex 物理演算の設定のインデックス\n * @param inputIndex 入力のインデックス\n * @return 入力の重み\n */\n public getInputWeight(\n physicsSettingIndex: number,\n inputIndex: number,\n ): number {\n return this._json.PhysicsSettings[physicsSettingIndex].Input[inputIndex].Weight;\n }\n\n /**\n * 入力の反転の取得\n * @param physicsSettingIndex 物理演算の設定のインデックス\n * @param inputIndex 入力のインデックス\n * @return 入力の反転\n */\n public getInputReflect(\n physicsSettingIndex: number,\n inputIndex: number,\n ): boolean {\n return this._json.PhysicsSettings[physicsSettingIndex].Input[inputIndex].Reflect;\n }\n\n /**\n * 入力の種類の取得\n * @param physicsSettingIndex 物理演算の設定のインデックス\n * @param inputIndex 入力のインデックス\n * @return 入力の種類\n */\n public getInputType(\n physicsSettingIndex: number,\n inputIndex: number,\n ): string {\n return this._json.PhysicsSettings[physicsSettingIndex].Input[inputIndex].Type;\n }\n\n /**\n * 入力元のIDの取得\n * @param physicsSettingIndex 物理演算の設定のインデックス\n * @param inputIndex 入力のインデックス\n * @return 入力元のID\n */\n public getInputSourceId(\n physicsSettingIndex: number,\n inputIndex: number,\n ): string {\n return this._json.PhysicsSettings[physicsSettingIndex].Input[inputIndex].Source.Id;\n }\n\n /**\n * 出力の個数の取得\n * @param physicsSettingIndex 物理演算の設定のインデックス\n * @return 出力の個数\n */\n public getOutputCount(physicsSettingIndex: number): number {\n return this._json.PhysicsSettings[physicsSettingIndex].Output.length;\n }\n\n /**\n * 出力の物理点のインデックスの取得\n * @param physicsSettingIndex 物理演算の設定のインデックス\n * @param outputIndex 出力のインデックス\n * @return 出力の物理点のインデックス\n */\n public getOutputVertexIndex(\n physicsSettingIndex: number,\n outputIndex: number,\n ): number {\n return this._json.PhysicsSettings[physicsSettingIndex].Output[outputIndex].VertexIndex;\n }\n\n /**\n * 出力の角度のスケールを取得する\n * @param physicsSettingIndex 物理演算の設定のインデックス\n * @param outputIndex 出力のインデックス\n * @return 出力の角度のスケール\n */\n public getOutputAngleScale(\n physicsSettingIndex: number,\n outputIndex: number,\n ): number {\n return this._json.PhysicsSettings[physicsSettingIndex].Output[outputIndex].Scale;\n }\n\n /**\n * 出力の重みの取得\n * @param physicsSettingIndex 物理演算の設定のインデックス\n * @param outputIndex 出力のインデックス\n * @return 出力の重み\n */\n public getOutputWeight(\n physicsSettingIndex: number,\n outputIndex: number,\n ): number {\n return this._json.PhysicsSettings[physicsSettingIndex].Output[outputIndex].Weight;\n }\n\n /**\n * 出力先のIDの取得\n * @param physicsSettingIndex 物理演算の設定のインデックス\n * @param outputIndex 出力のインデックス\n * @return 出力先のID\n */\n public getOutputDestinationId(\n physicsSettingIndex: number,\n outputIndex: number,\n ): string {\n return this._json.PhysicsSettings[physicsSettingIndex].Output[outputIndex].Destination.Id;\n }\n\n /**\n * 出力の種類の取得\n * @param physicsSettingIndex 物理演算の設定のインデックス\n * @param outputIndex 出力のインデックス\n * @return 出力の種類\n */\n public getOutputType(\n physicsSettingIndex: number,\n outputIndex: number,\n ): string {\n return this._json.PhysicsSettings[physicsSettingIndex].Output[outputIndex].Type;\n }\n\n /**\n * 出力の反転の取得\n * @param physicsSettingIndex 物理演算のインデックス\n * @param outputIndex 出力のインデックス\n * @return 出力の反転\n */\n public getOutputReflect(\n physicsSettingIndex: number,\n outputIndex: number,\n ): boolean {\n return this._json.PhysicsSettings[physicsSettingIndex].Output[outputIndex].Reflect;\n }\n\n /**\n * 物理点の個数の取得\n * @param physicsSettingIndex 物理演算男設定のインデックス\n * @return 物理点の個数\n */\n public getParticleCount(physicsSettingIndex: number): number {\n return this._json.PhysicsSettings[physicsSettingIndex].Vertices.length;\n }\n\n /**\n * 物理点の動きやすさの取得\n * @param physicsSettingIndex 物理演算の設定のインデックス\n * @param vertexIndex 物理点のインデックス\n * @return 物理点の動きやすさ\n */\n public getParticleMobility(\n physicsSettingIndex: number,\n vertexIndex: number,\n ): number {\n return this._json.PhysicsSettings[physicsSettingIndex].Vertices[vertexIndex].Mobility;\n }\n\n /**\n * 物理点の遅れの取得\n * @param physicsSettingIndex 物理演算の設定のインデックス\n * @param vertexIndex 物理点のインデックス\n * @return 物理点の遅れ\n */\n public getParticleDelay(\n physicsSettingIndex: number,\n vertexIndex: number,\n ): number {\n return this._json.PhysicsSettings[physicsSettingIndex].Vertices[vertexIndex].Delay;\n }\n\n /**\n * 物理点の加速度の取得\n * @param physicsSettingIndex 物理演算の設定\n * @param vertexIndex 物理点のインデックス\n * @return 物理点の加速度\n */\n public getParticleAcceleration(\n physicsSettingIndex: number,\n vertexIndex: number,\n ): number {\n return this._json.PhysicsSettings[physicsSettingIndex].Vertices[vertexIndex].Acceleration;\n }\n\n /**\n * 物理点の距離の取得\n * @param physicsSettingIndex 物理演算の設定のインデックス\n * @param vertexIndex 物理点のインデックス\n * @return 物理点の距離\n */\n public getParticleRadius(\n physicsSettingIndex: number,\n vertexIndex: number,\n ): number {\n return this._json.PhysicsSettings[physicsSettingIndex].Vertices[vertexIndex].Radius;\n }\n\n /**\n * 物理点の位置の取得\n * @param physicsSettingIndex 物理演算の設定のインデックス\n * @param vertexIndex 物理点のインデックス\n * @return 物理点の位置\n */\n public getParticlePosition(\n physicsSettingIndex: number,\n vertexIndex: number,\n ): CubismVector2 {\n const ret: CubismVector2 = new CubismVector2(0, 0);\n ret.x = this._json.PhysicsSettings[physicsSettingIndex].Vertices[vertexIndex].Position.X;\n ret.y = this._json.PhysicsSettings[physicsSettingIndex].Vertices[vertexIndex].Position.Y;\n return ret;\n }\n\n _json: CubismSpec.PhysicsJSON; // physics3.jsonデータ\n}\n","/**\n * Copyright(c) Live2D Inc. All rights reserved.\n *\n * Use of this source code is governed by the Live2D Open Software license\n * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.\n */\n\nimport { CubismMath } from '../math/cubismmath';\nimport { CubismVector2 } from '../math/cubismvector2';\nimport { CubismModel } from '../model/cubismmodel';\nimport {\n CubismPhysicsInput,\n CubismPhysicsNormalization,\n CubismPhysicsOutput,\n CubismPhysicsParticle,\n CubismPhysicsRig,\n CubismPhysicsSource,\n CubismPhysicsSubRig,\n CubismPhysicsTargetType,\n} from './cubismphysicsinternal';\nimport { CubismPhysicsJson } from './cubismphysicsjson';\n\n// physics types tags.\nconst PhysicsTypeTagX = 'X';\nconst PhysicsTypeTagY = 'Y';\nconst PhysicsTypeTagAngle = 'Angle';\n\n// Constant of air resistance.\nconst AirResistance = 5.0;\n\n// Constant of maximum weight of input and output ratio.\nconst MaximumWeight = 100.0;\n\n// Constant of threshold of movement.\nconst MovementThreshold = 0.001;\n\n/**\n * 物理演算クラス\n */\nexport class CubismPhysics {\n /**\n * インスタンスの作成\n * @param json physics3.jsonが読み込まれているバッファ\n * @return 作成されたインスタンス\n */\n public static create(json: CubismSpec.PhysicsJSON): CubismPhysics {\n const ret: CubismPhysics = new CubismPhysics();\n\n ret.parse(json);\n ret._physicsRig.gravity.y = 0;\n\n return ret;\n }\n\n /**\n * 物理演算の評価\n * @param model 物理演算の結果を適用するモデル\n * @param deltaTimeSeconds デルタ時間[秒]\n */\n public evaluate(model: CubismModel, deltaTimeSeconds: number): void {\n let totalAngle: { angle: number };\n let weight: number;\n let radAngle: number;\n let outputValue: number;\n const totalTranslation: CubismVector2 = new CubismVector2();\n let currentSetting: CubismPhysicsSubRig;\n let currentInput: CubismPhysicsInput[];\n let currentOutput: CubismPhysicsOutput[];\n let currentParticles: CubismPhysicsParticle[];\n\n let parameterValue: Float32Array;\n let parameterMaximumValue: Float32Array;\n let parameterMinimumValue: Float32Array;\n let parameterDefaultValue: Float32Array;\n\n parameterValue = model.getModel().parameters.values;\n parameterMaximumValue = model.getModel().parameters.maximumValues;\n parameterMinimumValue = model.getModel().parameters.minimumValues;\n parameterDefaultValue = model.getModel().parameters.defaultValues;\n\n for (\n let settingIndex = 0;\n settingIndex < this._physicsRig.subRigCount;\n ++settingIndex\n ) {\n totalAngle = { angle: 0.0 };\n totalTranslation.x = 0.0;\n totalTranslation.y = 0.0;\n currentSetting = this._physicsRig.settings[settingIndex];\n currentInput = this._physicsRig.inputs.slice(currentSetting.baseInputIndex);\n currentOutput = this._physicsRig.outputs.slice(currentSetting.baseOutputIndex);\n currentParticles = this._physicsRig.particles.slice(currentSetting.baseParticleIndex);\n\n // Load input parameters\n for (let i = 0; i < currentSetting.inputCount; ++i) {\n weight = currentInput[i].weight / MaximumWeight;\n\n if (currentInput[i].sourceParameterIndex == -1) {\n currentInput[i].sourceParameterIndex = model.getParameterIndex(\n currentInput[i].source.id,\n );\n }\n\n currentInput[i].getNormalizedParameterValue(\n totalTranslation,\n totalAngle,\n parameterValue[currentInput[i].sourceParameterIndex],\n parameterMinimumValue[currentInput[i].sourceParameterIndex],\n parameterMaximumValue[currentInput[i].sourceParameterIndex],\n parameterDefaultValue[currentInput[i].sourceParameterIndex],\n currentSetting.normalizationPosition,\n currentSetting.normalizationAngle,\n currentInput[i].reflect,\n weight,\n );\n }\n\n radAngle = CubismMath.degreesToRadian(-totalAngle.angle);\n\n totalTranslation.x =\n totalTranslation.x * CubismMath.cos(radAngle) -\n totalTranslation.y * CubismMath.sin(radAngle);\n totalTranslation.y =\n totalTranslation.x * CubismMath.sin(radAngle) +\n totalTranslation.y * CubismMath.cos(radAngle);\n\n // Calculate particles position.\n updateParticles(\n currentParticles,\n currentSetting.particleCount,\n totalTranslation,\n totalAngle.angle,\n this._options.wind,\n MovementThreshold * currentSetting.normalizationPosition.maximum,\n deltaTimeSeconds,\n AirResistance,\n );\n\n // Update output parameters.\n for (let i = 0; i < currentSetting.outputCount; ++i) {\n const particleIndex = currentOutput[i].vertexIndex;\n\n if (\n particleIndex < 1 ||\n particleIndex >= currentSetting.particleCount\n ) {\n break;\n }\n\n if (currentOutput[i].destinationParameterIndex == -1) {\n currentOutput[\n i\n ].destinationParameterIndex = model.getParameterIndex(\n currentOutput[i].destination.id,\n );\n }\n\n const translation: CubismVector2 = new CubismVector2();\n translation.x =\n currentParticles[particleIndex].position.x -\n currentParticles[particleIndex - 1].position.x;\n translation.y =\n currentParticles[particleIndex].position.y -\n currentParticles[particleIndex - 1].position.y;\n\n outputValue = currentOutput[i].getValue(\n translation,\n currentParticles,\n particleIndex,\n currentOutput[i].reflect,\n this._options.gravity,\n );\n\n const destinationParameterIndex: number =\n currentOutput[i].destinationParameterIndex;\n const outParameterValue: Float32Array =\n !Float32Array.prototype.slice &&\n 'subarray' in Float32Array.prototype\n ? JSON.parse(\n JSON.stringify(\n parameterValue.subarray(destinationParameterIndex),\n ),\n ) // 値渡しするため、JSON.parse, JSON.stringify\n : parameterValue.slice(destinationParameterIndex);\n\n updateOutputParameterValue(\n outParameterValue,\n parameterMinimumValue[destinationParameterIndex],\n parameterMaximumValue[destinationParameterIndex],\n outputValue,\n currentOutput[i],\n );\n\n // 値を反映\n for (\n let offset: number = destinationParameterIndex, outParamIndex = 0;\n offset < parameterValue.length;\n offset++, outParamIndex++\n ) {\n parameterValue[offset] = outParameterValue[outParamIndex];\n }\n }\n }\n }\n\n /**\n * オプションの設定\n * @param options オプション\n */\n public setOptions(options: Options): void {\n this._options = options;\n }\n\n /**\n * オプションの取得\n * @return オプション\n */\n public getOption(): Options {\n return this._options;\n }\n\n /**\n * コンストラクタ\n */\n public constructor() {\n // set default options\n this._options = new Options();\n this._options.gravity.y = -1.0;\n this._options.gravity.x = 0;\n this._options.wind.x = 0;\n this._options.wind.y = 0;\n }\n\n /**\n * デストラクタ相当の処理\n */\n public release(): void {\n (this as Partial<this>)._physicsRig = undefined;\n }\n\n /**\n * physics3.jsonをパースする。\n * @param physicsJson physics3.jsonが読み込まれているバッファ\n */\n public parse(physicsJson: CubismSpec.PhysicsJSON): void {\n this._physicsRig = new CubismPhysicsRig();\n\n let json: CubismPhysicsJson = new CubismPhysicsJson(physicsJson);\n\n this._physicsRig.gravity = json.getGravity();\n this._physicsRig.wind = json.getWind();\n this._physicsRig.subRigCount = json.getSubRigCount();\n\n let inputIndex = 0,\n outputIndex = 0,\n particleIndex = 0;\n\n for (let i = 0; i < this._physicsRig.subRigCount; ++i) {\n const setting = new CubismPhysicsSubRig();\n\n setting.normalizationPosition.minimum = json.getNormalizationPositionMinimumValue(i);\n setting.normalizationPosition.maximum = json.getNormalizationPositionMaximumValue(i);\n setting.normalizationPosition.defalut = json.getNormalizationPositionDefaultValue(i);\n setting.normalizationAngle.minimum = json.getNormalizationAngleMinimumValue(i);\n setting.normalizationAngle.maximum = json.getNormalizationAngleMaximumValue(i);\n setting.normalizationAngle.defalut = json.getNormalizationAngleDefaultValue(i);\n\n // Input\n setting.inputCount = json.getInputCount(i);\n setting.baseInputIndex = inputIndex;\n inputIndex += setting.inputCount;\n\n for (let j = 0; j < setting.inputCount; ++j) {\n const input = new CubismPhysicsInput();\n\n input.sourceParameterIndex = -1;\n input.weight = json.getInputWeight(i, j);\n input.reflect = json.getInputReflect(i, j);\n\n switch (json.getInputType(i, j)) {\n case PhysicsTypeTagX:\n input.type = CubismPhysicsSource.CubismPhysicsSource_X;\n input.getNormalizedParameterValue = getInputTranslationXFromNormalizedParameterValue;\n break;\n\n case PhysicsTypeTagY:\n input.type = CubismPhysicsSource.CubismPhysicsSource_Y;\n input.getNormalizedParameterValue = getInputTranslationYFromNormalizedParamterValue;\n break;\n\n case PhysicsTypeTagAngle:\n input.type = CubismPhysicsSource.CubismPhysicsSource_Angle;\n input.getNormalizedParameterValue = getInputAngleFromNormalizedParameterValue;\n break;\n }\n\n input.source.targetType = CubismPhysicsTargetType.CubismPhysicsTargetType_Parameter;\n input.source.id = json.getInputSourceId(i, j);\n\n this._physicsRig.inputs.push(input);\n }\n\n // Output\n setting.outputCount = json.getOutputCount(i);\n setting.baseOutputIndex = outputIndex;\n outputIndex += setting.outputCount;\n\n for (let j = 0; j < setting.outputCount; ++j) {\n const output = new CubismPhysicsOutput();\n\n output.destinationParameterIndex = -1;\n output.vertexIndex = json.getOutputVertexIndex(i, j);\n output.angleScale = json.getOutputAngleScale(i, j);\n output.weight = json.getOutputWeight(i, j);\n output.destination.targetType = CubismPhysicsTargetType.CubismPhysicsTargetType_Parameter;\n\n output.destination.id = json.getOutputDestinationId(i, j);\n\n switch (json.getOutputType(i, j)) {\n case PhysicsTypeTagX:\n output.type = CubismPhysicsSource.CubismPhysicsSource_X;\n output.getValue = getOutputTranslationX;\n output.getScale = getOutputScaleTranslationX;\n break;\n\n case PhysicsTypeTagY:\n output.type = CubismPhysicsSource.CubismPhysicsSource_Y;\n output.getValue = getOutputTranslationY;\n output.getScale = getOutputScaleTranslationY;\n break;\n\n case PhysicsTypeTagAngle:\n output.type = CubismPhysicsSource.CubismPhysicsSource_Angle;\n output.getValue = getOutputAngle;\n output.getScale = getOutputScaleAngle;\n break;\n }\n\n output.reflect = json.getOutputReflect(i, j);\n\n this._physicsRig.outputs.push(output);\n }\n\n // Particle\n setting.particleCount = json.getParticleCount(i);\n setting.baseParticleIndex = particleIndex;\n particleIndex += setting.particleCount;\n\n for (let j = 0; j < setting.particleCount; ++j) {\n const particle = new CubismPhysicsParticle();\n\n particle.mobility = json.getParticleMobility(i, j);\n particle.delay = json.getParticleDelay(i, j);\n particle.acceleration = json.getParticleAcceleration(i, j);\n particle.radius = json.getParticleRadius(i, j);\n particle.position = json.getParticlePosition(i, j);\n\n this._physicsRig.particles.push(particle);\n }\n\n this._physicsRig.settings.push(setting);\n }\n\n this.initialize();\n\n json.release();\n }\n\n /**\n * 初期化する\n */\n public initialize(): void {\n let strand: CubismPhysicsParticle[];\n let currentSetting: CubismPhysicsSubRig;\n let radius: CubismVector2;\n\n for (\n let settingIndex = 0;\n settingIndex < this._physicsRig.subRigCount;\n ++settingIndex\n ) {\n currentSetting = this._physicsRig.settings[settingIndex];\n strand = this._physicsRig.particles.slice(currentSetting.baseParticleIndex);\n\n // Initialize the top of particle.\n strand[0].initialPosition = new CubismVector2(0.0, 0.0);\n strand[0].lastPosition = new CubismVector2(\n strand[0].initialPosition.x,\n strand[0].initialPosition.y,\n );\n strand[0].lastGravity = new CubismVector2(0.0, -1.0);\n strand[0].lastGravity.y *= -1.0;\n strand[0].velocity = new CubismVector2(0.0, 0.0);\n strand[0].force = new CubismVector2(0.0, 0.0);\n\n // Initialize paritcles.\n for (let i = 1; i < currentSetting.particleCount; ++i) {\n radius = new CubismVector2(0.0, 0.0);\n radius.y = strand[i].radius;\n strand[i].initialPosition = new CubismVector2(\n strand[i - 1].initialPosition.x + radius.x,\n strand[i - 1].initialPosition.y + radius.y,\n );\n strand[i].position = new CubismVector2(\n strand[i].initialPosition.x,\n strand[i].initialPosition.y,\n );\n strand[i].lastPosition = new CubismVector2(\n strand[i].initialPosition.x,\n strand[i].initialPosition.y,\n );\n strand[i].lastGravity = new CubismVector2(0.0, -1.0);\n strand[i].lastGravity.y *= -1.0;\n strand[i].velocity = new CubismVector2(0.0, 0.0);\n strand[i].force = new CubismVector2(0.0, 0.0);\n }\n }\n }\n\n _physicsRig!: CubismPhysicsRig; // 物理演算のデータ\n _options: Options; // オプション\n}\n\n/**\n * 物理演算のオプション\n */\nexport class Options {\n constructor() {\n this.gravity = new CubismVector2(0, 0);\n this.wind = new CubismVector2(0, 0);\n }\n\n gravity: CubismVector2; // 重力方向\n wind: CubismVector2; // 風の方向\n}\n\nfunction getInputTranslationXFromNormalizedParameterValue(\n targetTranslation: CubismVector2,\n targetAngle: { angle: number },\n value: number,\n parameterMinimumValue: number,\n parameterMaximumValue: number,\n parameterDefaultValue: number,\n normalizationPosition: CubismPhysicsNormalization,\n normalizationAngle: CubismPhysicsNormalization,\n isInverted: boolean,\n weight: number,\n): void {\n targetTranslation.x +=\n normalizeParameterValue(\n value,\n parameterMinimumValue,\n parameterMaximumValue,\n parameterDefaultValue,\n normalizationPosition.minimum,\n normalizationPosition.maximum,\n normalizationPosition.defalut,\n isInverted,\n ) * weight;\n}\n\nfunction getInputTranslationYFromNormalizedParamterValue(\n targetTranslation: CubismVector2,\n targetAngle: { angle: number },\n value: number,\n parameterMinimumValue: number,\n parameterMaximumValue: number,\n parameterDefaultValue: number,\n normalizationPosition: CubismPhysicsNormalization,\n normalizationAngle: CubismPhysicsNormalization,\n isInverted: boolean,\n weight: number,\n): void {\n targetTranslation.y +=\n normalizeParameterValue(\n value,\n parameterMinimumValue,\n parameterMaximumValue,\n parameterDefaultValue,\n normalizationPosition.minimum,\n normalizationPosition.maximum,\n normalizationPosition.defalut,\n isInverted,\n ) * weight;\n}\n\nfunction getInputAngleFromNormalizedParameterValue(\n targetTranslation: CubismVector2,\n targetAngle: { angle: number },\n value: number,\n parameterMinimumValue: number,\n parameterMaximumValue: number,\n parameterDefaultValue: number,\n normalizaitionPosition: CubismPhysicsNormalization,\n normalizationAngle: CubismPhysicsNormalization,\n isInverted: boolean,\n weight: number,\n): void {\n targetAngle.angle +=\n normalizeParameterValue(\n value,\n parameterMinimumValue,\n parameterMaximumValue,\n parameterDefaultValue,\n normalizationAngle.minimum,\n normalizationAngle.maximum,\n normalizationAngle.defalut,\n isInverted,\n ) * weight;\n}\n\nfunction getOutputTranslationX(\n translation: CubismVector2,\n particles: CubismPhysicsParticle[],\n particleIndex: number,\n isInverted: boolean,\n parentGravity: CubismVector2,\n): number {\n let outputValue: number = translation.x;\n\n if (isInverted) {\n outputValue *= -1.0;\n }\n\n return outputValue;\n}\n\nfunction getOutputTranslationY(\n translation: CubismVector2,\n particles: CubismPhysicsParticle[],\n particleIndex: number,\n isInverted: boolean,\n parentGravity: CubismVector2,\n): number {\n let outputValue: number = translation.y;\n\n if (isInverted) {\n outputValue *= -1.0;\n }\n return outputValue;\n}\n\nfunction getOutputAngle(\n translation: CubismVector2,\n particles: CubismPhysicsParticle[],\n particleIndex: number,\n isInverted: boolean,\n parentGravity: CubismVector2,\n): number {\n let outputValue: number;\n\n if (particleIndex >= 2) {\n parentGravity = particles[particleIndex - 1].position.substract(\n particles[particleIndex - 2].position,\n );\n } else {\n parentGravity = parentGravity.multiplyByScaler(-1.0);\n }\n\n outputValue = CubismMath.directionToRadian(parentGravity, translation);\n\n if (isInverted) {\n outputValue *= -1.0;\n }\n\n return outputValue;\n}\n\nfunction getRangeValue(min: number, max: number): number {\n return Math.abs(Math.max(min, max) - Math.min(min, max));\n}\n\nfunction getDefaultValue(min: number, max: number): number {\n const minValue: number = Math.min(min, max);\n return minValue + getRangeValue(min, max) / 2.0;\n}\n\nfunction getOutputScaleTranslationX(\n translationScale: CubismVector2,\n angleScale: number,\n): number {\n return translationScale.x;\n}\n\nfunction getOutputScaleTranslationY(\n translationScale: CubismVector2,\n angleScale: number,\n): number {\n return translationScale.y;\n}\n\nfunction getOutputScaleAngle(\n translationScale: CubismVector2,\n angleScale: number,\n): number {\n return angleScale;\n}\n\n/**\n * Updates particles.\n *\n * @param strand Target array of particle.\n * @param strandCount Count of particle.\n * @param totalTranslation Total translation value.\n * @param totalAngle Total angle.\n * @param windDirection Direction of Wind.\n * @param thresholdValue Threshold of movement.\n * @param deltaTimeSeconds Delta time.\n * @param airResistance Air resistance.\n */\nfunction updateParticles(\n strand: CubismPhysicsParticle[],\n strandCount: number,\n totalTranslation: CubismVector2,\n totalAngle: number,\n windDirection: CubismVector2,\n thresholdValue: number,\n deltaTimeSeconds: number,\n airResistance: number,\n) {\n let totalRadian: number;\n let delay: number;\n let radian: number;\n let currentGravity: CubismVector2;\n let direction: CubismVector2 = new CubismVector2(0.0, 0.0);\n let velocity: CubismVector2 = new CubismVector2(0.0, 0.0);\n let force: CubismVector2 = new CubismVector2(0.0, 0.0);\n let newDirection: CubismVector2 = new CubismVector2(0.0, 0.0);\n\n strand[0].position = new CubismVector2(\n totalTranslation.x,\n totalTranslation.y,\n );\n\n totalRadian = CubismMath.degreesToRadian(totalAngle);\n currentGravity = CubismMath.radianToDirection(totalRadian);\n currentGravity.normalize();\n\n for (let i = 1; i < strandCount; ++i) {\n strand[i].force = currentGravity\n .multiplyByScaler(strand[i].acceleration)\n .add(windDirection);\n\n strand[i].lastPosition = new CubismVector2(\n strand[i].position.x,\n strand[i].position.y,\n );\n\n delay = strand[i].delay * deltaTimeSeconds * 30.0;\n\n direction = strand[i].position.substract(strand[i - 1].position);\n\n radian =\n CubismMath.directionToRadian(strand[i].lastGravity, currentGravity) /\n airResistance;\n\n direction.x =\n CubismMath.cos(radian) * direction.x -\n direction.y * CubismMath.sin(radian);\n direction.y =\n CubismMath.sin(radian) * direction.x +\n direction.y * CubismMath.cos(radian);\n\n strand[i].position = strand[i - 1].position.add(direction);\n\n velocity = strand[i].velocity.multiplyByScaler(delay);\n force = strand[i].force.multiplyByScaler(delay).multiplyByScaler(delay);\n\n strand[i].position = strand[i].position.add(velocity).add(force);\n\n newDirection = strand[i].position.substract(strand[i - 1].position);\n newDirection.normalize();\n\n strand[i].position = strand[i - 1].position.add(\n newDirection.multiplyByScaler(strand[i].radius),\n );\n\n if (CubismMath.abs(strand[i].position.x) < thresholdValue) {\n strand[i].position.x = 0.0;\n }\n\n if (delay != 0.0) {\n strand[i].velocity = strand[i].position.substract(\n strand[i].lastPosition,\n );\n strand[i].velocity = strand[i].velocity.divisionByScalar(delay);\n strand[i].velocity = strand[i].velocity.multiplyByScaler(\n strand[i].mobility,\n );\n }\n\n strand[i].force = new CubismVector2(0.0, 0.0);\n strand[i].lastGravity = new CubismVector2(\n currentGravity.x,\n currentGravity.y,\n );\n }\n}\n\n/**\n * Updates output parameter value.\n * @param parameterValue Target parameter value.\n * @param parameterValueMinimum Minimum of parameter value.\n * @param parameterValueMaximum Maximum of parameter value.\n * @param translation Translation value.\n */\nfunction updateOutputParameterValue(\n parameterValue: Float32Array,\n parameterValueMinimum: number,\n parameterValueMaximum: number,\n translation: number,\n output: CubismPhysicsOutput,\n): void {\n let outputScale: number;\n let value: number;\n let weight: number;\n\n outputScale = output.getScale(output.translationScale, output.angleScale);\n\n value = translation * outputScale;\n\n if (value < parameterValueMinimum) {\n if (value < output.valueBelowMinimum) {\n output.valueBelowMinimum = value;\n }\n\n value = parameterValueMinimum;\n } else if (value > parameterValueMaximum) {\n if (value > output.valueExceededMaximum) {\n output.valueExceededMaximum = value;\n }\n\n value = parameterValueMaximum;\n }\n\n weight = output.weight / MaximumWeight;\n\n if (weight >= 1.0) {\n parameterValue[0] = value;\n } else {\n value = parameterValue[0] * (1.0 - weight) + value * weight;\n parameterValue[0] = value;\n }\n}\n\nfunction normalizeParameterValue(\n value: number,\n parameterMinimum: number,\n parameterMaximum: number,\n parameterDefault: number,\n normalizedMinimum: number,\n normalizedMaximum: number,\n normalizedDefault: number,\n isInverted: boolean,\n) {\n let result = 0.0;\n\n const maxValue: number = CubismMath.max(parameterMaximum, parameterMinimum);\n\n if (maxValue < value) {\n value = maxValue;\n }\n\n const minValue: number = CubismMath.min(parameterMaximum, parameterMinimum);\n\n if (minValue > value) {\n value = minValue;\n }\n\n const minNormValue: number = CubismMath.min(\n normalizedMinimum,\n normalizedMaximum,\n );\n const maxNormValue: number = CubismMath.max(\n normalizedMinimum,\n normalizedMaximum,\n );\n const middleNormValue: number = normalizedDefault;\n\n const middleValue: number = getDefaultValue(minValue, maxValue);\n const paramValue: number = value - middleValue;\n\n switch (Math.sign(paramValue)) {\n case 1: {\n const nLength: number = maxNormValue - middleNormValue;\n const pLength: number = maxValue - middleValue;\n\n if (pLength != 0.0) {\n result = paramValue * (nLength / pLength);\n result += middleNormValue;\n }\n\n break;\n }\n case -1: {\n const nLength: number = minNormValue - middleNormValue;\n const pLength: number = minValue - middleValue;\n\n if (pLength != 0.0) {\n result = paramValue * (nLength / pLength);\n result += middleNormValue;\n }\n\n break;\n }\n case 0: {\n result = middleNormValue;\n\n break;\n }\n default: {\n break;\n }\n }\n\n return isInverted ? result : result * -1.0;\n}\n","import { Cubism4InternalModel } from '@/cubism4/Cubism4InternalModel';\nimport { Cubism4ModelSettings } from '@/cubism4/Cubism4ModelSettings';\nimport { cubism4Ready } from '@/cubism4/setup';\nimport { Live2DFactory, Live2DFactoryOptions } from '@/factory/Live2DFactory';\nimport { CubismPose } from '@cubism/effect/cubismpose';\nimport { CubismMoc } from '@cubism/model/cubismmoc';\nimport { CubismModel } from '@cubism/model/cubismmodel';\nimport { CubismPhysics } from '@cubism/physics/cubismphysics';\nimport { config } from '@/config';\nimport { config as cubism4Config } from '@cubism/config';\n\nconfig.cubism4 = cubism4Config;\n\nLive2DFactory.registerRuntime({\n version: 4,\n\n ready: cubism4Ready,\n\n test(source: any): boolean {\n return source instanceof Cubism4ModelSettings || Cubism4ModelSettings.isValidJSON(source);\n },\n\n isValidMoc(modelData: ArrayBuffer): boolean {\n if (modelData.byteLength < 4) {\n return false;\n }\n\n const view = new Int8Array(modelData, 0, 4);\n\n return String.fromCharCode(...view) === 'MOC3';\n },\n\n createModelSettings(json: object): Cubism4ModelSettings {\n return new Cubism4ModelSettings(json as CubismSpec.ModelJSON & { url: string });\n },\n\n createCoreModel(data: ArrayBuffer): CubismModel {\n const moc = CubismMoc.create(data);\n\n try {\n const model = moc.createModel();\n\n // store the moc instance so we can reference it later\n (model as any).__moc = moc;\n\n return model;\n } catch (e) {\n try {\n moc.release();\n } catch (ignored) {\n }\n\n throw e;\n }\n },\n\n createInternalModel(coreModel: CubismModel, settings: Cubism4ModelSettings, options?: Live2DFactoryOptions): Cubism4InternalModel {\n const model = new Cubism4InternalModel(coreModel, settings, options);\n\n const coreModelWithMoc = coreModel as { __moc?: CubismMoc };\n\n if (coreModelWithMoc.__moc) {\n // transfer the moc to InternalModel, because the coreModel will\n // probably have been set to undefined when we receive the \"destroy\" event\n (model as any).__moc = coreModelWithMoc.__moc;\n\n delete coreModelWithMoc.__moc;\n\n // release the moc when destroying\n model.once('destroy', releaseMoc);\n }\n\n return model;\n },\n\n createPhysics(coreModel: CubismModel, data: any): CubismPhysics {\n return CubismPhysics.create(data);\n },\n\n createPose(coreModel: CubismModel, data: any): CubismPose {\n return CubismPose.create(data);\n },\n});\n\nfunction releaseMoc(this: Cubism4InternalModel) {\n ((this as any).__moc as CubismMoc | undefined)?.release();\n}\n","var baseAssignValue = require('./_baseAssignValue'),\n baseForOwn = require('./_baseForOwn'),\n baseIteratee = require('./_baseIteratee');\n\n/**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\nfunction mapKeys(object, iteratee) {\n var result = {};\n iteratee = baseIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n}\n\nmodule.exports = mapKeys;\n","if (!(window as any).Live2DCubismCore) {\n throw new Error('Cannot find Cubism 4 runtime. Did you forget to include the live2dcubismcore.min.js?');\n}\n","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n","var baseFor = require('./_baseFor'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nmodule.exports = baseForOwn;\n","var createBaseFor = require('./_createBaseFor');\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","var baseMatches = require('./_baseMatches'),\n baseMatchesProperty = require('./_baseMatchesProperty'),\n identity = require('./identity'),\n isArray = require('./isArray'),\n property = require('./property');\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\nmodule.exports = baseIteratee;\n","var baseIsMatch = require('./_baseIsMatch'),\n getMatchData = require('./_getMatchData'),\n matchesStrictComparable = require('./_matchesStrictComparable');\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nmodule.exports = baseMatches;\n","var Stack = require('./_Stack'),\n baseIsEqual = require('./_baseIsEqual');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nmodule.exports = baseIsMatch;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n","var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n","var Stack = require('./_Stack'),\n equalArrays = require('./_equalArrays'),\n equalByTag = require('./_equalByTag'),\n equalObjects = require('./_equalObjects'),\n getTag = require('./_getTag'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isTypedArray = require('./isTypedArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n","var MapCache = require('./_MapCache'),\n setCacheAdd = require('./_setCacheAdd'),\n setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nmodule.exports = setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arraySome;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nmodule.exports = cacheHas;\n","var Symbol = require('./_Symbol'),\n Uint8Array = require('./_Uint8Array'),\n eq = require('./eq'),\n equalArrays = require('./_equalArrays'),\n mapToArray = require('./_mapToArray'),\n setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nmodule.exports = mapToArray;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nmodule.exports = setToArray;\n","var getAllKeys = require('./_getAllKeys');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalObjects;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n","var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nmodule.exports = getSymbols;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nmodule.exports = stubArray;\n","var DataView = require('./_DataView'),\n Map = require('./_Map'),\n Promise = require('./_Promise'),\n Set = require('./_Set'),\n WeakMap = require('./_WeakMap'),\n baseGetTag = require('./_baseGetTag'),\n toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nmodule.exports = getTag;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n","var isStrictComparable = require('./_isStrictComparable'),\n keys = require('./keys');\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nmodule.exports = getMatchData;\n","var baseIsEqual = require('./_baseIsEqual'),\n get = require('./get'),\n hasIn = require('./hasIn'),\n isKey = require('./_isKey'),\n isStrictComparable = require('./_isStrictComparable'),\n matchesStrictComparable = require('./_matchesStrictComparable'),\n toKey = require('./_toKey');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nmodule.exports = baseMatchesProperty;\n","var baseGet = require('./_baseGet');\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = get;\n","var memoizeCapped = require('./_memoizeCapped');\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nmodule.exports = stringToPath;\n","var memoize = require('./memoize');\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nmodule.exports = memoizeCapped;\n","var MapCache = require('./_MapCache');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nmodule.exports = memoize;\n","var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var baseHasIn = require('./_baseHasIn'),\n hasPath = require('./_hasPath');\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\nmodule.exports = hasIn;\n","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nmodule.exports = baseHasIn;\n","var castPath = require('./_castPath'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isIndex = require('./_isIndex'),\n isLength = require('./isLength'),\n toKey = require('./_toKey');\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nmodule.exports = hasPath;\n","var baseProperty = require('./_baseProperty'),\n basePropertyDeep = require('./_basePropertyDeep'),\n isKey = require('./_isKey'),\n toKey = require('./_toKey');\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = property;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = baseProperty;\n","var baseGet = require('./_baseGet');\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nmodule.exports = basePropertyDeep;\n","export * from './common';\nexport * from './cubism4';\n"],"sourceRoot":""}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。