dsh-plugin-live2d-stage 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -0
- package/assets/core.js +9 -0
- package/assets/floating.html +1 -0
- package/assets/floating.js +285 -0
- package/assets/icon.webp +0 -0
- package/assets/shaders/fragshadersrcalphablend.frag +54 -0
- package/assets/shaders/fragshadersrccolorblend.frag +298 -0
- package/assets/shaders/fragshadersrccopy.frag +18 -0
- package/assets/shaders/fragshadersrcmaskinvertedpremultipliedalpha.frag +29 -0
- package/assets/shaders/fragshadersrcmaskpremultipliedalpha.frag +29 -0
- package/assets/shaders/fragshadersrcpremultipliedalpha.frag +23 -0
- package/assets/shaders/fragshadersrcpremultipliedalphablend.frag +67 -0
- package/assets/shaders/fragshadersrcsetupmask.frag +25 -0
- package/assets/shaders/vertshadersrc.vert +19 -0
- package/assets/shaders/vertshadersrcblend.vert +31 -0
- package/assets/shaders/vertshadersrccopy.vert +17 -0
- package/assets/shaders/vertshadersrcmasked.vert +22 -0
- package/assets/shaders/vertshadersrcsetupmask.vert +21 -0
- package/character/hiyori/hiyori_free_t08.2048/texture_00.png +0 -0
- package/character/hiyori/hiyori_free_t08.cdi3.json +276 -0
- package/character/hiyori/hiyori_free_t08.moc3 +0 -0
- package/character/hiyori/hiyori_free_t08.model3.json +72 -0
- package/character/hiyori/hiyori_free_t08.physics3.json +631 -0
- package/character/hiyori/motion/hiyori_m01.motion3.json +951 -0
- package/character/hiyori/motion/hiyori_m02.motion3.json +1238 -0
- package/character/hiyori/motion/hiyori_m03.motion3.json +1035 -0
- package/character/hiyori/motion/hiyori_m04.motion3.json +776 -0
- package/character/hiyori/motion/hiyori_m05.motion3.json +1462 -0
- package/character/hiyori/motion/hiyori_m06.motion3.json +727 -0
- package/character/hiyori/motion/hiyori_m07.motion3.json +874 -0
- package/character/hiyori/motion/hiyori_m08.motion3.json +755 -0
- package/cordis.patch.yml +3 -0
- package/lib/chat.mjs +9 -0
- package/lib/client.js +20810 -0
- package/lib/floating.mjs +25 -0
- package/lib/index.mjs +85 -0
- package/lib/native/Live2DFloating.exe +0 -0
- package/lib/native/Microsoft.Web.WebView2.Core.dll +0 -0
- package/lib/native/Microsoft.Web.WebView2.Wpf.dll +0 -0
- package/lib/native/WebView2-LICENSE.txt +27 -0
- package/lib/native/WebView2-NOTICE.txt +85 -0
- package/lib/native/WebView2Loader.dll +0 -0
- package/lib/store.cjs +11064 -0
- package/licenses/Cubism-Core.md +7 -0
- package/licenses/Cubism-Framework.md +45 -0
- package/licenses/Cubism-NOTICE.md +38 -0
- package/licenses/Cubism-Samples.md +67 -0
- package/licenses/bluebird.txt +21 -0
- package/licenses/core-util-is.txt +19 -0
- package/licenses/duplexer2.txt +26 -0
- package/licenses/fs-extra.txt +15 -0
- package/licenses/graceful-fs.txt +15 -0
- package/licenses/inherits.txt +16 -0
- package/licenses/jsonfile.txt +15 -0
- package/licenses/lucide.txt +43 -0
- package/licenses/node-int64.txt +19 -0
- package/licenses/process-nextick-args.txt +19 -0
- package/licenses/react-dom.txt +21 -0
- package/licenses/react.txt +21 -0
- package/licenses/readable-stream.txt +47 -0
- package/licenses/safe-buffer.txt +21 -0
- package/licenses/scheduler.txt +21 -0
- package/licenses/string_decoder.txt +48 -0
- package/licenses/universalify.txt +20 -0
- package/licenses/unzipper.txt +25 -0
- package/licenses/util-deprecate.txt +24 -0
- package/locale/en.json +6 -0
- package/locale/zh-CN.json +6 -0
- package/package.json +77 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
(()=>{var Wf=Object.create;var td=Object.defineProperty;var Hf=Object.getOwnPropertyDescriptor;var $f=Object.getOwnPropertyNames;var jf=Object.getPrototypeOf,Xf=Object.prototype.hasOwnProperty;var At=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}};var Yf=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $f(e))!Xf.call(t,i)&&i!==r&&td(t,i,{get:()=>e[i],enumerable:!(n=Hf(e,i))||n.enumerable});return t};var ce=(t,e,r)=>(r=t!=null?Wf(jf(t)):{},Yf(e||!t||!t.__esModule?td(r,"default",{value:t,enumerable:!0}):r,t));var hd=At(F=>{"use strict";var Pi=Symbol.for("react.element"),Jf=Symbol.for("react.portal"),qf=Symbol.for("react.fragment"),Qf=Symbol.for("react.strict_mode"),Kf=Symbol.for("react.profiler"),Zf=Symbol.for("react.provider"),eg=Symbol.for("react.context"),tg=Symbol.for("react.forward_ref"),rg=Symbol.for("react.suspense"),ng=Symbol.for("react.memo"),ig=Symbol.for("react.lazy"),rd=Symbol.iterator;function sg(t){return t===null||typeof t!="object"?null:(t=rd&&t[rd]||t["@@iterator"],typeof t=="function"?t:null)}var sd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},od=Object.assign,ad={};function sn(t,e,r){this.props=t,this.context=e,this.refs=ad,this.updater=r||sd}sn.prototype.isReactComponent={};sn.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};sn.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function ld(){}ld.prototype=sn.prototype;function Za(t,e,r){this.props=t,this.context=e,this.refs=ad,this.updater=r||sd}var el=Za.prototype=new ld;el.constructor=Za;od(el,sn.prototype);el.isPureReactComponent=!0;var nd=Array.isArray,ud=Object.prototype.hasOwnProperty,tl={current:null},cd={key:!0,ref:!0,__self:!0,__source:!0};function dd(t,e,r){var n,i={},s=null,o=null;if(e!=null)for(n in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)ud.call(e,n)&&!cd.hasOwnProperty(n)&&(i[n]=e[n]);var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){for(var a=Array(l),u=0;u<l;u++)a[u]=arguments[u+2];i.children=a}if(t&&t.defaultProps)for(n in l=t.defaultProps,l)i[n]===void 0&&(i[n]=l[n]);return{$$typeof:Pi,type:t,key:s,ref:o,props:i,_owner:tl.current}}function og(t,e){return{$$typeof:Pi,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function rl(t){return typeof t=="object"&&t!==null&&t.$$typeof===Pi}function ag(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var id=/\/+/g;function Ka(t,e){return typeof t=="object"&&t!==null&&t.key!=null?ag(""+t.key):e.toString(36)}function Hs(t,e,r,n,i){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case Pi:case Jf:o=!0}}if(o)return o=t,i=i(o),t=n===""?"."+Ka(o,0):n,nd(i)?(r="",t!=null&&(r=t.replace(id,"$&/")+"/"),Hs(i,e,r,"",function(u){return u})):i!=null&&(rl(i)&&(i=og(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(id,"$&/")+"/")+t)),e.push(i)),1;if(o=0,n=n===""?".":n+":",nd(t))for(var l=0;l<t.length;l++){s=t[l];var a=n+Ka(s,l);o+=Hs(s,e,r,a,i)}else if(a=sg(t),typeof a=="function")for(t=a.call(t),l=0;!(s=t.next()).done;)s=s.value,a=n+Ka(s,l++),o+=Hs(s,e,r,a,i);else if(s==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function Ws(t,e,r){if(t==null)return t;var n=[],i=0;return Hs(t,n,"","",function(s){return e.call(r,s,i++)}),n}function lg(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Re={current:null},$s={transition:null},ug={ReactCurrentDispatcher:Re,ReactCurrentBatchConfig:$s,ReactCurrentOwner:tl};function pd(){throw Error("act(...) is not supported in production builds of React.")}F.Children={map:Ws,forEach:function(t,e,r){Ws(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return Ws(t,function(){e++}),e},toArray:function(t){return Ws(t,function(e){return e})||[]},only:function(t){if(!rl(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};F.Component=sn;F.Fragment=qf;F.Profiler=Kf;F.PureComponent=Za;F.StrictMode=Qf;F.Suspense=rg;F.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ug;F.act=pd;F.cloneElement=function(t,e,r){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=od({},t.props),i=t.key,s=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=tl.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(a in e)ud.call(e,a)&&!cd.hasOwnProperty(a)&&(n[a]=e[a]===void 0&&l!==void 0?l[a]:e[a])}var a=arguments.length-2;if(a===1)n.children=r;else if(1<a){l=Array(a);for(var u=0;u<a;u++)l[u]=arguments[u+2];n.children=l}return{$$typeof:Pi,type:t.type,key:i,ref:s,props:n,_owner:o}};F.createContext=function(t){return t={$$typeof:eg,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:Zf,_context:t},t.Consumer=t};F.createElement=dd;F.createFactory=function(t){var e=dd.bind(null,t);return e.type=t,e};F.createRef=function(){return{current:null}};F.forwardRef=function(t){return{$$typeof:tg,render:t}};F.isValidElement=rl;F.lazy=function(t){return{$$typeof:ig,_payload:{_status:-1,_result:t},_init:lg}};F.memo=function(t,e){return{$$typeof:ng,type:t,compare:e===void 0?null:e}};F.startTransition=function(t){var e=$s.transition;$s.transition={};try{t()}finally{$s.transition=e}};F.unstable_act=pd;F.useCallback=function(t,e){return Re.current.useCallback(t,e)};F.useContext=function(t){return Re.current.useContext(t)};F.useDebugValue=function(){};F.useDeferredValue=function(t){return Re.current.useDeferredValue(t)};F.useEffect=function(t,e){return Re.current.useEffect(t,e)};F.useId=function(){return Re.current.useId()};F.useImperativeHandle=function(t,e,r){return Re.current.useImperativeHandle(t,e,r)};F.useInsertionEffect=function(t,e){return Re.current.useInsertionEffect(t,e)};F.useLayoutEffect=function(t,e){return Re.current.useLayoutEffect(t,e)};F.useMemo=function(t,e){return Re.current.useMemo(t,e)};F.useReducer=function(t,e,r){return Re.current.useReducer(t,e,r)};F.useRef=function(t){return Re.current.useRef(t)};F.useState=function(t){return Re.current.useState(t)};F.useSyncExternalStore=function(t,e,r){return Re.current.useSyncExternalStore(t,e,r)};F.useTransition=function(){return Re.current.useTransition()};F.version="18.3.1"});var kt=At((Iv,md)=>{"use strict";md.exports=hd()});var Sd=At(H=>{"use strict";function ol(t,e){var r=t.length;t.push(e);e:for(;0<r;){var n=r-1>>>1,i=t[n];if(0<js(i,e))t[n]=e,t[r]=i,r=n;else break e}}function ut(t){return t.length===0?null:t[0]}function Ys(t){if(t.length===0)return null;var e=t[0],r=t.pop();if(r!==e){t[0]=r;e:for(var n=0,i=t.length,s=i>>>1;n<s;){var o=2*(n+1)-1,l=t[o],a=o+1,u=t[a];if(0>js(l,r))a<i&&0>js(u,l)?(t[n]=u,t[a]=r,n=a):(t[n]=l,t[o]=r,n=o);else if(a<i&&0>js(u,r))t[n]=u,t[a]=r,n=a;else break e}}return e}function js(t,e){var r=t.sortIndex-e.sortIndex;return r!==0?r:t.id-e.id}typeof performance=="object"&&typeof performance.now=="function"?(fd=performance,H.unstable_now=function(){return fd.now()}):(nl=Date,gd=nl.now(),H.unstable_now=function(){return nl.now()-gd});var fd,nl,gd,vt=[],rr=[],cg=1,et=null,Se=3,Js=!1,Ir=!1,Ti=!1,yd=typeof setTimeout=="function"?setTimeout:null,Cd=typeof clearTimeout=="function"?clearTimeout:null,bd=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function al(t){for(var e=ut(rr);e!==null;){if(e.callback===null)Ys(rr);else if(e.startTime<=t)Ys(rr),e.sortIndex=e.expirationTime,ol(vt,e);else break;e=ut(rr)}}function ll(t){if(Ti=!1,al(t),!Ir)if(ut(vt)!==null)Ir=!0,cl(ul);else{var e=ut(rr);e!==null&&dl(ll,e.startTime-t)}}function ul(t,e){Ir=!1,Ti&&(Ti=!1,Cd(Li),Li=-1),Js=!0;var r=Se;try{for(al(e),et=ut(vt);et!==null&&(!(et.expirationTime>e)||t&&!Md());){var n=et.callback;if(typeof n=="function"){et.callback=null,Se=et.priorityLevel;var i=n(et.expirationTime<=e);e=H.unstable_now(),typeof i=="function"?et.callback=i:et===ut(vt)&&Ys(vt),al(e)}else Ys(vt);et=ut(vt)}if(et!==null)var s=!0;else{var o=ut(rr);o!==null&&dl(ll,o.startTime-e),s=!1}return s}finally{et=null,Se=r,Js=!1}}var qs=!1,Xs=null,Li=-1,vd=5,xd=-1;function Md(){return!(H.unstable_now()-xd<vd)}function il(){if(Xs!==null){var t=H.unstable_now();xd=t;var e=!0;try{e=Xs(!0,t)}finally{e?wi():(qs=!1,Xs=null)}}else qs=!1}var wi;typeof bd=="function"?wi=function(){bd(il)}:typeof MessageChannel<"u"?(sl=new MessageChannel,_d=sl.port2,sl.port1.onmessage=il,wi=function(){_d.postMessage(null)}):wi=function(){yd(il,0)};var sl,_d;function cl(t){Xs=t,qs||(qs=!0,wi())}function dl(t,e){Li=yd(function(){t(H.unstable_now())},e)}H.unstable_IdlePriority=5;H.unstable_ImmediatePriority=1;H.unstable_LowPriority=4;H.unstable_NormalPriority=3;H.unstable_Profiling=null;H.unstable_UserBlockingPriority=2;H.unstable_cancelCallback=function(t){t.callback=null};H.unstable_continueExecution=function(){Ir||Js||(Ir=!0,cl(ul))};H.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):vd=0<t?Math.floor(1e3/t):5};H.unstable_getCurrentPriorityLevel=function(){return Se};H.unstable_getFirstCallbackNode=function(){return ut(vt)};H.unstable_next=function(t){switch(Se){case 1:case 2:case 3:var e=3;break;default:e=Se}var r=Se;Se=e;try{return t()}finally{Se=r}};H.unstable_pauseExecution=function(){};H.unstable_requestPaint=function(){};H.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var r=Se;Se=t;try{return e()}finally{Se=r}};H.unstable_scheduleCallback=function(t,e,r){var n=H.unstable_now();switch(typeof r=="object"&&r!==null?(r=r.delay,r=typeof r=="number"&&0<r?n+r:n):r=n,t){case 1:var i=-1;break;case 2:i=250;break;case 5:i=1073741823;break;case 4:i=1e4;break;default:i=5e3}return i=r+i,t={id:cg++,callback:e,priorityLevel:t,startTime:r,expirationTime:i,sortIndex:-1},r>n?(t.sortIndex=r,ol(rr,t),ut(vt)===null&&t===ut(rr)&&(Ti?(Cd(Li),Li=-1):Ti=!0,dl(ll,r-n))):(t.sortIndex=i,ol(vt,t),Ir||Js||(Ir=!0,cl(ul))),t};H.unstable_shouldYield=Md;H.unstable_wrapCallback=function(t){var e=Se;return function(){var r=Se;Se=e;try{return t.apply(this,arguments)}finally{Se=r}}}});var wd=At((Ev,Pd)=>{"use strict";Pd.exports=Sd()});var Im=At(qe=>{"use strict";var dg=kt(),Ye=wd();function S(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Ap=new Set,qi={};function Wr(t,e){wn(t,e),wn(t+"Capture",e)}function wn(t,e){for(qi[t]=e,t=0;t<e.length;t++)Ap.add(e[t])}var Ut=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kl=Object.prototype.hasOwnProperty,pg=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Td={},Ld={};function hg(t){return kl.call(Ld,t)?!0:kl.call(Td,t)?!1:pg.test(t)?Ld[t]=!0:(Td[t]=!0,!1)}function mg(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function fg(t,e,r,n){if(e===null||typeof e>"u"||mg(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function ke(t,e,r,n,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Ce={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Ce[t]=new ke(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Ce[e]=new ke(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Ce[t]=new ke(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Ce[t]=new ke(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Ce[t]=new ke(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Ce[t]=new ke(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Ce[t]=new ke(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Ce[t]=new ke(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Ce[t]=new ke(t,5,!1,t.toLowerCase(),null,!1,!1)});var wu=/[\-:]([a-z])/g;function Tu(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(wu,Tu);Ce[e]=new ke(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(wu,Tu);Ce[e]=new ke(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(wu,Tu);Ce[e]=new ke(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Ce[t]=new ke(t,1,!1,t.toLowerCase(),null,!1,!1)});Ce.xlinkHref=new ke("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Ce[t]=new ke(t,1,!1,t.toLowerCase(),null,!0,!0)});function Lu(t,e,r,n){var i=Ce.hasOwnProperty(e)?Ce[e]:null;(i!==null?i.type!==0:n||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(fg(e,r,i,n)&&(r=null),n||i===null?hg(e)&&(r===null?t.removeAttribute(e):t.setAttribute(e,""+r)):i.mustUseProperty?t[i.propertyName]=r===null?i.type===3?!1:"":r:(e=i.attributeName,n=i.attributeNamespace,r===null?t.removeAttribute(e):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,n?t.setAttributeNS(n,e,r):t.setAttribute(e,r))))}var Ht=dg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Qs=Symbol.for("react.element"),ln=Symbol.for("react.portal"),un=Symbol.for("react.fragment"),Bu=Symbol.for("react.strict_mode"),Vl=Symbol.for("react.profiler"),kp=Symbol.for("react.provider"),Vp=Symbol.for("react.context"),Iu=Symbol.for("react.forward_ref"),Ol=Symbol.for("react.suspense"),Dl=Symbol.for("react.suspense_list"),Ru=Symbol.for("react.memo"),ir=Symbol.for("react.lazy"),Op=Symbol.for("react.offscreen"),Bd=Symbol.iterator;function Bi(t){return t===null||typeof t!="object"?null:(t=Bd&&t[Bd]||t["@@iterator"],typeof t=="function"?t:null)}var te=Object.assign,pl;function Di(t){if(pl===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);pl=e&&e[1]||""}return`
|
|
2
|
+
`+pl+t}var hl=!1;function ml(t,e){if(!t||hl)return"";hl=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var n=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){n=u}t.call(e.prototype)}else{try{throw Error()}catch(u){n=u}t()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var i=u.stack.split(`
|
|
3
|
+
`),s=n.stack.split(`
|
|
4
|
+
`),o=i.length-1,l=s.length-1;1<=o&&0<=l&&i[o]!==s[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==s[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==s[l]){var a=`
|
|
5
|
+
`+i[o].replace(" at new "," at ");return t.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",t.displayName)),a}while(1<=o&&0<=l);break}}}finally{hl=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Di(t):""}function gg(t){switch(t.tag){case 5:return Di(t.type);case 16:return Di("Lazy");case 13:return Di("Suspense");case 19:return Di("SuspenseList");case 0:case 2:case 15:return t=ml(t.type,!1),t;case 11:return t=ml(t.type.render,!1),t;case 1:return t=ml(t.type,!0),t;default:return""}}function Fl(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case un:return"Fragment";case ln:return"Portal";case Vl:return"Profiler";case Bu:return"StrictMode";case Ol:return"Suspense";case Dl:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Vp:return(t.displayName||"Context")+".Consumer";case kp:return(t._context.displayName||"Context")+".Provider";case Iu:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Ru:return e=t.displayName||null,e!==null?e:Fl(t.type)||"Memo";case ir:e=t._payload,t=t._init;try{return Fl(t(e))}catch{}}return null}function bg(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Fl(e);case 8:return e===Bu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function _r(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Dp(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function _g(t){var e=Dp(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Ks(t){t._valueTracker||(t._valueTracker=_g(t))}function Fp(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=Dp(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function To(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Nl(t,e){var r=e.checked;return te({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function Id(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=_r(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Np(t,e){e=e.checked,e!=null&&Lu(t,"checked",e,!1)}function Ul(t,e){Np(t,e);var r=_r(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Gl(t,e.type,r):e.hasOwnProperty("defaultValue")&&Gl(t,e.type,_r(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Rd(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function Gl(t,e,r){(e!=="number"||To(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var Fi=Array.isArray;function Cn(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i<r.length;i++)e["$"+r[i]]=!0;for(r=0;r<t.length;r++)i=e.hasOwnProperty("$"+t[r].value),t[r].selected!==i&&(t[r].selected=i),i&&n&&(t[r].defaultSelected=!0)}else{for(r=""+_r(r),e=null,i=0;i<t.length;i++){if(t[i].value===r){t[i].selected=!0,n&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function zl(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(S(91));return te({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Ed(t,e){var r=e.value;if(r==null){if(r=e.children,e=e.defaultValue,r!=null){if(e!=null)throw Error(S(92));if(Fi(r)){if(1<r.length)throw Error(S(93));r=r[0]}e=r}e==null&&(e=""),r=e}t._wrapperState={initialValue:_r(r)}}function Up(t,e){var r=_r(e.value),n=_r(e.defaultValue);r!=null&&(r=""+r,r!==t.value&&(t.value=r),e.defaultValue==null&&t.defaultValue!==r&&(t.defaultValue=r)),n!=null&&(t.defaultValue=""+n)}function Ad(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function Gp(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Wl(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?Gp(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Zs,zp=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,r,n,i){MSApp.execUnsafeLocalFunction(function(){return t(e,r,n,i)})}:t})(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Zs=Zs||document.createElement("div"),Zs.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Zs.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Qi(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Gi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},yg=["Webkit","ms","Moz","O"];Object.keys(Gi).forEach(function(t){yg.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Gi[e]=Gi[t]})});function Wp(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Gi.hasOwnProperty(t)&&Gi[t]?(""+e).trim():e+"px"}function Hp(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=Wp(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var Cg=te({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Hl(t,e){if(e){if(Cg[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(S(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(S(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(S(61))}if(e.style!=null&&typeof e.style!="object")throw Error(S(62))}}function $l(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var jl=null;function Eu(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Xl=null,vn=null,xn=null;function kd(t){if(t=fs(t)){if(typeof Xl!="function")throw Error(S(280));var e=t.stateNode;e&&(e=ta(e),Xl(t.stateNode,t.type,e))}}function $p(t){vn?xn?xn.push(t):xn=[t]:vn=t}function jp(){if(vn){var t=vn,e=xn;if(xn=vn=null,kd(t),e)for(t=0;t<e.length;t++)kd(e[t])}}function Xp(t,e){return t(e)}function Yp(){}var fl=!1;function Jp(t,e,r){if(fl)return t(e,r);fl=!0;try{return Xp(t,e,r)}finally{fl=!1,(vn!==null||xn!==null)&&(Yp(),jp())}}function Ki(t,e){var r=t.stateNode;if(r===null)return null;var n=ta(r);if(n===null)return null;r=n[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(t=t.type,n=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!n;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(S(231,e,typeof r));return r}var Yl=!1;if(Ut)try{on={},Object.defineProperty(on,"passive",{get:function(){Yl=!0}}),window.addEventListener("test",on,on),window.removeEventListener("test",on,on)}catch{Yl=!1}var on;function vg(t,e,r,n,i,s,o,l,a){var u=Array.prototype.slice.call(arguments,3);try{e.apply(r,u)}catch(d){this.onError(d)}}var zi=!1,Lo=null,Bo=!1,Jl=null,xg={onError:function(t){zi=!0,Lo=t}};function Mg(t,e,r,n,i,s,o,l,a){zi=!1,Lo=null,vg.apply(xg,arguments)}function Sg(t,e,r,n,i,s,o,l,a){if(Mg.apply(this,arguments),zi){if(zi){var u=Lo;zi=!1,Lo=null}else throw Error(S(198));Bo||(Bo=!0,Jl=u)}}function Hr(t){var e=t,r=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(r=e.return),t=e.return;while(t)}return e.tag===3?r:null}function qp(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function Vd(t){if(Hr(t)!==t)throw Error(S(188))}function Pg(t){var e=t.alternate;if(!e){if(e=Hr(t),e===null)throw Error(S(188));return e!==t?null:t}for(var r=t,n=e;;){var i=r.return;if(i===null)break;var s=i.alternate;if(s===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===r)return Vd(i),t;if(s===n)return Vd(i),e;s=s.sibling}throw Error(S(188))}if(r.return!==n.return)r=i,n=s;else{for(var o=!1,l=i.child;l;){if(l===r){o=!0,r=i,n=s;break}if(l===n){o=!0,n=i,r=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===r){o=!0,r=s,n=i;break}if(l===n){o=!0,n=s,r=i;break}l=l.sibling}if(!o)throw Error(S(189))}}if(r.alternate!==n)throw Error(S(190))}if(r.tag!==3)throw Error(S(188));return r.stateNode.current===r?t:e}function Qp(t){return t=Pg(t),t!==null?Kp(t):null}function Kp(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Kp(t);if(e!==null)return e;t=t.sibling}return null}var Zp=Ye.unstable_scheduleCallback,Od=Ye.unstable_cancelCallback,wg=Ye.unstable_shouldYield,Tg=Ye.unstable_requestPaint,oe=Ye.unstable_now,Lg=Ye.unstable_getCurrentPriorityLevel,Au=Ye.unstable_ImmediatePriority,eh=Ye.unstable_UserBlockingPriority,Io=Ye.unstable_NormalPriority,Bg=Ye.unstable_LowPriority,th=Ye.unstable_IdlePriority,Qo=null,Pt=null;function Ig(t){if(Pt&&typeof Pt.onCommitFiberRoot=="function")try{Pt.onCommitFiberRoot(Qo,t,void 0,(t.current.flags&128)===128)}catch{}}var mt=Math.clz32?Math.clz32:Ag,Rg=Math.log,Eg=Math.LN2;function Ag(t){return t>>>=0,t===0?32:31-(Rg(t)/Eg|0)|0}var eo=64,to=4194304;function Ni(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Ro(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,s=t.pingedLanes,o=r&268435455;if(o!==0){var l=o&~i;l!==0?n=Ni(l):(s&=o,s!==0&&(n=Ni(s)))}else o=r&~i,o!==0?n=Ni(o):s!==0&&(n=Ni(s));if(n===0)return 0;if(e!==0&&e!==n&&(e&i)===0&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if((n&4)!==0&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0<e;)r=31-mt(e),i=1<<r,n|=t[r],e&=~i;return n}function kg(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Vg(t,e){for(var r=t.suspendedLanes,n=t.pingedLanes,i=t.expirationTimes,s=t.pendingLanes;0<s;){var o=31-mt(s),l=1<<o,a=i[o];a===-1?((l&r)===0||(l&n)!==0)&&(i[o]=kg(l,e)):a<=e&&(t.expiredLanes|=l),s&=~l}}function ql(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function rh(){var t=eo;return eo<<=1,(eo&4194240)===0&&(eo=64),t}function gl(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function hs(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-mt(e),t[e]=r}function Og(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0<r;){var i=31-mt(r),s=1<<i;e[i]=0,n[i]=-1,t[i]=-1,r&=~s}}function ku(t,e){var r=t.entangledLanes|=e;for(t=t.entanglements;r;){var n=31-mt(r),i=1<<n;i&e|t[n]&e&&(t[n]|=e),r&=~i}}var z=0;function nh(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var ih,Vu,sh,oh,ah,Ql=!1,ro=[],cr=null,dr=null,pr=null,Zi=new Map,es=new Map,or=[],Dg="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Dd(t,e){switch(t){case"focusin":case"focusout":cr=null;break;case"dragenter":case"dragleave":dr=null;break;case"mouseover":case"mouseout":pr=null;break;case"pointerover":case"pointerout":Zi.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":es.delete(e.pointerId)}}function Ii(t,e,r,n,i,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:r,eventSystemFlags:n,nativeEvent:s,targetContainers:[i]},e!==null&&(e=fs(e),e!==null&&Vu(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function Fg(t,e,r,n,i){switch(e){case"focusin":return cr=Ii(cr,t,e,r,n,i),!0;case"dragenter":return dr=Ii(dr,t,e,r,n,i),!0;case"mouseover":return pr=Ii(pr,t,e,r,n,i),!0;case"pointerover":var s=i.pointerId;return Zi.set(s,Ii(Zi.get(s)||null,t,e,r,n,i)),!0;case"gotpointercapture":return s=i.pointerId,es.set(s,Ii(es.get(s)||null,t,e,r,n,i)),!0}return!1}function lh(t){var e=Ar(t.target);if(e!==null){var r=Hr(e);if(r!==null){if(e=r.tag,e===13){if(e=qp(r),e!==null){t.blockedOn=e,ah(t.priority,function(){sh(r)});return}}else if(e===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function bo(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var r=Kl(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(r===null){r=t.nativeEvent;var n=new r.constructor(r.type,r);jl=n,r.target.dispatchEvent(n),jl=null}else return e=fs(r),e!==null&&Vu(e),t.blockedOn=r,!1;e.shift()}return!0}function Fd(t,e,r){bo(t)&&r.delete(e)}function Ng(){Ql=!1,cr!==null&&bo(cr)&&(cr=null),dr!==null&&bo(dr)&&(dr=null),pr!==null&&bo(pr)&&(pr=null),Zi.forEach(Fd),es.forEach(Fd)}function Ri(t,e){t.blockedOn===e&&(t.blockedOn=null,Ql||(Ql=!0,Ye.unstable_scheduleCallback(Ye.unstable_NormalPriority,Ng)))}function ts(t){function e(i){return Ri(i,t)}if(0<ro.length){Ri(ro[0],t);for(var r=1;r<ro.length;r++){var n=ro[r];n.blockedOn===t&&(n.blockedOn=null)}}for(cr!==null&&Ri(cr,t),dr!==null&&Ri(dr,t),pr!==null&&Ri(pr,t),Zi.forEach(e),es.forEach(e),r=0;r<or.length;r++)n=or[r],n.blockedOn===t&&(n.blockedOn=null);for(;0<or.length&&(r=or[0],r.blockedOn===null);)lh(r),r.blockedOn===null&&or.shift()}var Mn=Ht.ReactCurrentBatchConfig,Eo=!0;function Ug(t,e,r,n){var i=z,s=Mn.transition;Mn.transition=null;try{z=1,Ou(t,e,r,n)}finally{z=i,Mn.transition=s}}function Gg(t,e,r,n){var i=z,s=Mn.transition;Mn.transition=null;try{z=4,Ou(t,e,r,n)}finally{z=i,Mn.transition=s}}function Ou(t,e,r,n){if(Eo){var i=Kl(t,e,r,n);if(i===null)Ml(t,e,n,Ao,r),Dd(t,n);else if(Fg(i,t,e,r,n))n.stopPropagation();else if(Dd(t,n),e&4&&-1<Dg.indexOf(t)){for(;i!==null;){var s=fs(i);if(s!==null&&ih(s),s=Kl(t,e,r,n),s===null&&Ml(t,e,n,Ao,r),s===i)break;i=s}i!==null&&n.stopPropagation()}else Ml(t,e,n,null,r)}}var Ao=null;function Kl(t,e,r,n){if(Ao=null,t=Eu(n),t=Ar(t),t!==null)if(e=Hr(t),e===null)t=null;else if(r=e.tag,r===13){if(t=qp(e),t!==null)return t;t=null}else if(r===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return Ao=t,null}function uh(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Lg()){case Au:return 1;case eh:return 4;case Io:case Bg:return 16;case th:return 536870912;default:return 16}default:return 16}}var lr=null,Du=null,_o=null;function ch(){if(_o)return _o;var t,e=Du,r=e.length,n,i="value"in lr?lr.value:lr.textContent,s=i.length;for(t=0;t<r&&e[t]===i[t];t++);var o=r-t;for(n=1;n<=o&&e[r-n]===i[s-n];n++);return _o=i.slice(t,1<n?1-n:void 0)}function yo(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function no(){return!0}function Nd(){return!1}function Je(t){function e(r,n,i,s,o){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var l in t)t.hasOwnProperty(l)&&(r=t[l],this[l]=r?r(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?no:Nd,this.isPropagationStopped=Nd,this}return te(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=no)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=no)},persist:function(){},isPersistent:no}),e}var An={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fu=Je(An),ms=te({},An,{view:0,detail:0}),zg=Je(ms),bl,_l,Ei,Ko=te({},ms,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nu,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ei&&(Ei&&t.type==="mousemove"?(bl=t.screenX-Ei.screenX,_l=t.screenY-Ei.screenY):_l=bl=0,Ei=t),bl)},movementY:function(t){return"movementY"in t?t.movementY:_l}}),Ud=Je(Ko),Wg=te({},Ko,{dataTransfer:0}),Hg=Je(Wg),$g=te({},ms,{relatedTarget:0}),yl=Je($g),jg=te({},An,{animationName:0,elapsedTime:0,pseudoElement:0}),Xg=Je(jg),Yg=te({},An,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Jg=Je(Yg),qg=te({},An,{data:0}),Gd=Je(qg),Qg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Kg={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Zg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function eb(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=Zg[t])?!!e[t]:!1}function Nu(){return eb}var tb=te({},ms,{key:function(t){if(t.key){var e=Qg[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=yo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Kg[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nu,charCode:function(t){return t.type==="keypress"?yo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?yo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),rb=Je(tb),nb=te({},Ko,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zd=Je(nb),ib=te({},ms,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nu}),sb=Je(ib),ob=te({},An,{propertyName:0,elapsedTime:0,pseudoElement:0}),ab=Je(ob),lb=te({},Ko,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),ub=Je(lb),cb=[9,13,27,32],Uu=Ut&&"CompositionEvent"in window,Wi=null;Ut&&"documentMode"in document&&(Wi=document.documentMode);var db=Ut&&"TextEvent"in window&&!Wi,dh=Ut&&(!Uu||Wi&&8<Wi&&11>=Wi),Wd=" ",Hd=!1;function ph(t,e){switch(t){case"keyup":return cb.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var cn=!1;function pb(t,e){switch(t){case"compositionend":return hh(e);case"keypress":return e.which!==32?null:(Hd=!0,Wd);case"textInput":return t=e.data,t===Wd&&Hd?null:t;default:return null}}function hb(t,e){if(cn)return t==="compositionend"||!Uu&&ph(t,e)?(t=ch(),_o=Du=lr=null,cn=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return dh&&e.locale!=="ko"?null:e.data;default:return null}}var mb={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function $d(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!mb[t.type]:e==="textarea"}function mh(t,e,r,n){$p(n),e=ko(e,"onChange"),0<e.length&&(r=new Fu("onChange","change",null,r,n),t.push({event:r,listeners:e}))}var Hi=null,rs=null;function fb(t){Ph(t,0)}function Zo(t){var e=hn(t);if(Fp(e))return t}function gb(t,e){if(t==="change")return e}var fh=!1;Ut&&(Ut?(so="oninput"in document,so||(Cl=document.createElement("div"),Cl.setAttribute("oninput","return;"),so=typeof Cl.oninput=="function"),io=so):io=!1,fh=io&&(!document.documentMode||9<document.documentMode));var io,so,Cl;function jd(){Hi&&(Hi.detachEvent("onpropertychange",gh),rs=Hi=null)}function gh(t){if(t.propertyName==="value"&&Zo(rs)){var e=[];mh(e,rs,t,Eu(t)),Jp(fb,e)}}function bb(t,e,r){t==="focusin"?(jd(),Hi=e,rs=r,Hi.attachEvent("onpropertychange",gh)):t==="focusout"&&jd()}function _b(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Zo(rs)}function yb(t,e){if(t==="click")return Zo(e)}function Cb(t,e){if(t==="input"||t==="change")return Zo(e)}function vb(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var gt=typeof Object.is=="function"?Object.is:vb;function ns(t,e){if(gt(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!kl.call(e,i)||!gt(t[i],e[i]))return!1}return!0}function Xd(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Yd(t,e){var r=Xd(t);t=0;for(var n;r;){if(r.nodeType===3){if(n=t+r.textContent.length,t<=e&&n>=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Xd(r)}}function bh(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?bh(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function _h(){for(var t=window,e=To();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=To(t.document)}return e}function Gu(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function xb(t){var e=_h(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&bh(r.ownerDocument.documentElement,r)){if(n!==null&&Gu(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!t.extend&&s>n&&(i=n,n=s,s=i),i=Yd(r,s);var o=Yd(r,n);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<e.length;r++)t=e[r],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var Mb=Ut&&"documentMode"in document&&11>=document.documentMode,dn=null,Zl=null,$i=null,eu=!1;function Jd(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;eu||dn==null||dn!==To(n)||(n=dn,"selectionStart"in n&&Gu(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),$i&&ns($i,n)||($i=n,n=ko(Zl,"onSelect"),0<n.length&&(e=new Fu("onSelect","select",null,e,r),t.push({event:e,listeners:n}),e.target=dn)))}function oo(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var pn={animationend:oo("Animation","AnimationEnd"),animationiteration:oo("Animation","AnimationIteration"),animationstart:oo("Animation","AnimationStart"),transitionend:oo("Transition","TransitionEnd")},vl={},yh={};Ut&&(yh=document.createElement("div").style,"AnimationEvent"in window||(delete pn.animationend.animation,delete pn.animationiteration.animation,delete pn.animationstart.animation),"TransitionEvent"in window||delete pn.transitionend.transition);function ea(t){if(vl[t])return vl[t];if(!pn[t])return t;var e=pn[t],r;for(r in e)if(e.hasOwnProperty(r)&&r in yh)return vl[t]=e[r];return t}var Ch=ea("animationend"),vh=ea("animationiteration"),xh=ea("animationstart"),Mh=ea("transitionend"),Sh=new Map,qd="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Cr(t,e){Sh.set(t,e),Wr(e,[t])}for(ao=0;ao<qd.length;ao++)lo=qd[ao],Qd=lo.toLowerCase(),Kd=lo[0].toUpperCase()+lo.slice(1),Cr(Qd,"on"+Kd);var lo,Qd,Kd,ao;Cr(Ch,"onAnimationEnd");Cr(vh,"onAnimationIteration");Cr(xh,"onAnimationStart");Cr("dblclick","onDoubleClick");Cr("focusin","onFocus");Cr("focusout","onBlur");Cr(Mh,"onTransitionEnd");wn("onMouseEnter",["mouseout","mouseover"]);wn("onMouseLeave",["mouseout","mouseover"]);wn("onPointerEnter",["pointerout","pointerover"]);wn("onPointerLeave",["pointerout","pointerover"]);Wr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Wr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Wr("onBeforeInput",["compositionend","keypress","textInput","paste"]);Wr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Wr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Wr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ui="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Sb=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ui));function Zd(t,e,r){var n=t.type||"unknown-event";t.currentTarget=r,Sg(n,e,void 0,t),t.currentTarget=null}function Ph(t,e){e=(e&4)!==0;for(var r=0;r<t.length;r++){var n=t[r],i=n.event;n=n.listeners;e:{var s=void 0;if(e)for(var o=n.length-1;0<=o;o--){var l=n[o],a=l.instance,u=l.currentTarget;if(l=l.listener,a!==s&&i.isPropagationStopped())break e;Zd(i,l,u),s=a}else for(o=0;o<n.length;o++){if(l=n[o],a=l.instance,u=l.currentTarget,l=l.listener,a!==s&&i.isPropagationStopped())break e;Zd(i,l,u),s=a}}}if(Bo)throw t=Jl,Bo=!1,Jl=null,t}function j(t,e){var r=e[su];r===void 0&&(r=e[su]=new Set);var n=t+"__bubble";r.has(n)||(wh(e,t,2,!1),r.add(n))}function xl(t,e,r){var n=0;e&&(n|=4),wh(r,t,n,e)}var uo="_reactListening"+Math.random().toString(36).slice(2);function is(t){if(!t[uo]){t[uo]=!0,Ap.forEach(function(r){r!=="selectionchange"&&(Sb.has(r)||xl(r,!1,t),xl(r,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[uo]||(e[uo]=!0,xl("selectionchange",!1,e))}}function wh(t,e,r,n){switch(uh(e)){case 1:var i=Ug;break;case 4:i=Gg;break;default:i=Ou}r=i.bind(null,e,r,t),i=void 0,!Yl||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),n?i!==void 0?t.addEventListener(e,r,{capture:!0,passive:i}):t.addEventListener(e,r,!0):i!==void 0?t.addEventListener(e,r,{passive:i}):t.addEventListener(e,r,!1)}function Ml(t,e,r,n,i){var s=n;if((e&1)===0&&(e&2)===0&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var l=n.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=n.return;o!==null;){var a=o.tag;if((a===3||a===4)&&(a=o.stateNode.containerInfo,a===i||a.nodeType===8&&a.parentNode===i))return;o=o.return}for(;l!==null;){if(o=Ar(l),o===null)return;if(a=o.tag,a===5||a===6){n=s=o;continue e}l=l.parentNode}}n=n.return}Jp(function(){var u=s,d=Eu(r),c=[];e:{var p=Sh.get(t);if(p!==void 0){var _=Fu,m=t;switch(t){case"keypress":if(yo(r)===0)break e;case"keydown":case"keyup":_=rb;break;case"focusin":m="focus",_=yl;break;case"focusout":m="blur",_=yl;break;case"beforeblur":case"afterblur":_=yl;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":_=Ud;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_=Hg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_=sb;break;case Ch:case vh:case xh:_=Xg;break;case Mh:_=ab;break;case"scroll":_=zg;break;case"wheel":_=ub;break;case"copy":case"cut":case"paste":_=Jg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_=zd}var f=(e&4)!==0,y=!f&&t==="scroll",b=f?p!==null?p+"Capture":null:p;f=[];for(var g=u,h;g!==null;){h=g;var C=h.stateNode;if(h.tag===5&&C!==null&&(h=C,b!==null&&(C=Ki(g,b),C!=null&&f.push(ss(g,C,h)))),y)break;g=g.return}0<f.length&&(p=new _(p,m,null,r,d),c.push({event:p,listeners:f}))}}if((e&7)===0){e:{if(p=t==="mouseover"||t==="pointerover",_=t==="mouseout"||t==="pointerout",p&&r!==jl&&(m=r.relatedTarget||r.fromElement)&&(Ar(m)||m[Gt]))break e;if((_||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,_?(m=r.relatedTarget||r.toElement,_=u,m=m?Ar(m):null,m!==null&&(y=Hr(m),m!==y||m.tag!==5&&m.tag!==6)&&(m=null)):(_=null,m=u),_!==m)){if(f=Ud,C="onMouseLeave",b="onMouseEnter",g="mouse",(t==="pointerout"||t==="pointerover")&&(f=zd,C="onPointerLeave",b="onPointerEnter",g="pointer"),y=_==null?p:hn(_),h=m==null?p:hn(m),p=new f(C,g+"leave",_,r,d),p.target=y,p.relatedTarget=h,C=null,Ar(d)===u&&(f=new f(b,g+"enter",m,r,d),f.target=h,f.relatedTarget=y,C=f),y=C,_&&m)t:{for(f=_,b=m,g=0,h=f;h;h=an(h))g++;for(h=0,C=b;C;C=an(C))h++;for(;0<g-h;)f=an(f),g--;for(;0<h-g;)b=an(b),h--;for(;g--;){if(f===b||b!==null&&f===b.alternate)break t;f=an(f),b=an(b)}f=null}else f=null;_!==null&&ep(c,p,_,f,!1),m!==null&&y!==null&&ep(c,y,m,f,!0)}}e:{if(p=u?hn(u):window,_=p.nodeName&&p.nodeName.toLowerCase(),_==="select"||_==="input"&&p.type==="file")var x=gb;else if($d(p))if(fh)x=Cb;else{x=_b;var v=bb}else(_=p.nodeName)&&_.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(x=yb);if(x&&(x=x(t,u))){mh(c,x,r,d);break e}v&&v(t,p,u),t==="focusout"&&(v=p._wrapperState)&&v.controlled&&p.type==="number"&&Gl(p,"number",p.value)}switch(v=u?hn(u):window,t){case"focusin":($d(v)||v.contentEditable==="true")&&(dn=v,Zl=u,$i=null);break;case"focusout":$i=Zl=dn=null;break;case"mousedown":eu=!0;break;case"contextmenu":case"mouseup":case"dragend":eu=!1,Jd(c,r,d);break;case"selectionchange":if(Mb)break;case"keydown":case"keyup":Jd(c,r,d)}var M;if(Uu)e:{switch(t){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else cn?ph(t,r)&&(P="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(P="onCompositionStart");P&&(dh&&r.locale!=="ko"&&(cn||P!=="onCompositionStart"?P==="onCompositionEnd"&&cn&&(M=ch()):(lr=d,Du="value"in lr?lr.value:lr.textContent,cn=!0)),v=ko(u,P),0<v.length&&(P=new Gd(P,t,null,r,d),c.push({event:P,listeners:v}),M?P.data=M:(M=hh(r),M!==null&&(P.data=M)))),(M=db?pb(t,r):hb(t,r))&&(u=ko(u,"onBeforeInput"),0<u.length&&(d=new Gd("onBeforeInput","beforeinput",null,r,d),c.push({event:d,listeners:u}),d.data=M))}Ph(c,e)})}function ss(t,e,r){return{instance:t,listener:e,currentTarget:r}}function ko(t,e){for(var r=e+"Capture",n=[];t!==null;){var i=t,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Ki(t,r),s!=null&&n.unshift(ss(t,s,i)),s=Ki(t,e),s!=null&&n.push(ss(t,s,i))),t=t.return}return n}function an(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function ep(t,e,r,n,i){for(var s=e._reactName,o=[];r!==null&&r!==n;){var l=r,a=l.alternate,u=l.stateNode;if(a!==null&&a===n)break;l.tag===5&&u!==null&&(l=u,i?(a=Ki(r,s),a!=null&&o.unshift(ss(r,a,l))):i||(a=Ki(r,s),a!=null&&o.push(ss(r,a,l)))),r=r.return}o.length!==0&&t.push({event:e,listeners:o})}var Pb=/\r\n?/g,wb=/\u0000|\uFFFD/g;function tp(t){return(typeof t=="string"?t:""+t).replace(Pb,`
|
|
6
|
+
`).replace(wb,"")}function co(t,e,r){if(e=tp(e),tp(t)!==e&&r)throw Error(S(425))}function Vo(){}var tu=null,ru=null;function nu(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var iu=typeof setTimeout=="function"?setTimeout:void 0,Tb=typeof clearTimeout=="function"?clearTimeout:void 0,rp=typeof Promise=="function"?Promise:void 0,Lb=typeof queueMicrotask=="function"?queueMicrotask:typeof rp<"u"?function(t){return rp.resolve(null).then(t).catch(Bb)}:iu;function Bb(t){setTimeout(function(){throw t})}function Sl(t,e){var r=e,n=0;do{var i=r.nextSibling;if(t.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){t.removeChild(i),ts(e);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);ts(e)}function hr(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function np(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"){if(e===0)return t;e--}else r==="/$"&&e++}t=t.previousSibling}return null}var kn=Math.random().toString(36).slice(2),St="__reactFiber$"+kn,os="__reactProps$"+kn,Gt="__reactContainer$"+kn,su="__reactEvents$"+kn,Ib="__reactListeners$"+kn,Rb="__reactHandles$"+kn;function Ar(t){var e=t[St];if(e)return e;for(var r=t.parentNode;r;){if(e=r[Gt]||r[St]){if(r=e.alternate,e.child!==null||r!==null&&r.child!==null)for(t=np(t);t!==null;){if(r=t[St])return r;t=np(t)}return e}t=r,r=t.parentNode}return null}function fs(t){return t=t[St]||t[Gt],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function hn(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(S(33))}function ta(t){return t[os]||null}var ou=[],mn=-1;function vr(t){return{current:t}}function X(t){0>mn||(t.current=ou[mn],ou[mn]=null,mn--)}function $(t,e){mn++,ou[mn]=t.current,t.current=e}var yr={},Le=vr(yr),Ge=vr(!1),Fr=yr;function Tn(t,e){var r=t.type.contextTypes;if(!r)return yr;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function ze(t){return t=t.childContextTypes,t!=null}function Oo(){X(Ge),X(Le)}function ip(t,e,r){if(Le.current!==yr)throw Error(S(168));$(Le,e),$(Ge,r)}function Th(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(S(108,bg(t)||"Unknown",i));return te({},r,n)}function Do(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||yr,Fr=Le.current,$(Le,t),$(Ge,Ge.current),!0}function sp(t,e,r){var n=t.stateNode;if(!n)throw Error(S(169));r?(t=Th(t,e,Fr),n.__reactInternalMemoizedMergedChildContext=t,X(Ge),X(Le),$(Le,t)):X(Ge),$(Ge,r)}var Ot=null,ra=!1,Pl=!1;function Lh(t){Ot===null?Ot=[t]:Ot.push(t)}function Eb(t){ra=!0,Lh(t)}function xr(){if(!Pl&&Ot!==null){Pl=!0;var t=0,e=z;try{var r=Ot;for(z=1;t<r.length;t++){var n=r[t];do n=n(!0);while(n!==null)}Ot=null,ra=!1}catch(i){throw Ot!==null&&(Ot=Ot.slice(t+1)),Zp(Au,xr),i}finally{z=e,Pl=!1}}return null}var fn=[],gn=0,Fo=null,No=0,tt=[],rt=0,Nr=null,Dt=1,Ft="";function Rr(t,e){fn[gn++]=No,fn[gn++]=Fo,Fo=t,No=e}function Bh(t,e,r){tt[rt++]=Dt,tt[rt++]=Ft,tt[rt++]=Nr,Nr=t;var n=Dt;t=Ft;var i=32-mt(n)-1;n&=~(1<<i),r+=1;var s=32-mt(e)+i;if(30<s){var o=i-i%5;s=(n&(1<<o)-1).toString(32),n>>=o,i-=o,Dt=1<<32-mt(e)+i|r<<i|n,Ft=s+t}else Dt=1<<s|r<<i|n,Ft=t}function zu(t){t.return!==null&&(Rr(t,1),Bh(t,1,0))}function Wu(t){for(;t===Fo;)Fo=fn[--gn],fn[gn]=null,No=fn[--gn],fn[gn]=null;for(;t===Nr;)Nr=tt[--rt],tt[rt]=null,Ft=tt[--rt],tt[rt]=null,Dt=tt[--rt],tt[rt]=null}var Xe=null,je=null,Q=!1,ht=null;function Ih(t,e){var r=nt(5,null,null,0);r.elementType="DELETED",r.stateNode=e,r.return=t,e=t.deletions,e===null?(t.deletions=[r],t.flags|=16):e.push(r)}function op(t,e){switch(t.tag){case 5:var r=t.type;return e=e.nodeType!==1||r.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Xe=t,je=hr(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Xe=t,je=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(r=Nr!==null?{id:Dt,overflow:Ft}:null,t.memoizedState={dehydrated:e,treeContext:r,retryLane:1073741824},r=nt(18,null,null,0),r.stateNode=e,r.return=t,t.child=r,Xe=t,je=null,!0):!1;default:return!1}}function au(t){return(t.mode&1)!==0&&(t.flags&128)===0}function lu(t){if(Q){var e=je;if(e){var r=e;if(!op(t,e)){if(au(t))throw Error(S(418));e=hr(r.nextSibling);var n=Xe;e&&op(t,e)?Ih(n,r):(t.flags=t.flags&-4097|2,Q=!1,Xe=t)}}else{if(au(t))throw Error(S(418));t.flags=t.flags&-4097|2,Q=!1,Xe=t}}}function ap(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Xe=t}function po(t){if(t!==Xe)return!1;if(!Q)return ap(t),Q=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!nu(t.type,t.memoizedProps)),e&&(e=je)){if(au(t))throw Rh(),Error(S(418));for(;e;)Ih(t,e),e=hr(e.nextSibling)}if(ap(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(S(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"){if(e===0){je=hr(t.nextSibling);break e}e--}else r!=="$"&&r!=="$!"&&r!=="$?"||e++}t=t.nextSibling}je=null}}else je=Xe?hr(t.stateNode.nextSibling):null;return!0}function Rh(){for(var t=je;t;)t=hr(t.nextSibling)}function Ln(){je=Xe=null,Q=!1}function Hu(t){ht===null?ht=[t]:ht.push(t)}var Ab=Ht.ReactCurrentBatchConfig;function Ai(t,e,r){if(t=r.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(S(309));var n=r.stateNode}if(!n)throw Error(S(147,t));var i=n,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var l=i.refs;o===null?delete l[s]:l[s]=o},e._stringRef=s,e)}if(typeof t!="string")throw Error(S(284));if(!r._owner)throw Error(S(290,t))}return t}function ho(t,e){throw t=Object.prototype.toString.call(e),Error(S(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function lp(t){var e=t._init;return e(t._payload)}function Eh(t){function e(b,g){if(t){var h=b.deletions;h===null?(b.deletions=[g],b.flags|=16):h.push(g)}}function r(b,g){if(!t)return null;for(;g!==null;)e(b,g),g=g.sibling;return null}function n(b,g){for(b=new Map;g!==null;)g.key!==null?b.set(g.key,g):b.set(g.index,g),g=g.sibling;return b}function i(b,g){return b=br(b,g),b.index=0,b.sibling=null,b}function s(b,g,h){return b.index=h,t?(h=b.alternate,h!==null?(h=h.index,h<g?(b.flags|=2,g):h):(b.flags|=2,g)):(b.flags|=1048576,g)}function o(b){return t&&b.alternate===null&&(b.flags|=2),b}function l(b,g,h,C){return g===null||g.tag!==6?(g=El(h,b.mode,C),g.return=b,g):(g=i(g,h),g.return=b,g)}function a(b,g,h,C){var x=h.type;return x===un?d(b,g,h.props.children,C,h.key):g!==null&&(g.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===ir&&lp(x)===g.type)?(C=i(g,h.props),C.ref=Ai(b,g,h),C.return=b,C):(C=wo(h.type,h.key,h.props,null,b.mode,C),C.ref=Ai(b,g,h),C.return=b,C)}function u(b,g,h,C){return g===null||g.tag!==4||g.stateNode.containerInfo!==h.containerInfo||g.stateNode.implementation!==h.implementation?(g=Al(h,b.mode,C),g.return=b,g):(g=i(g,h.children||[]),g.return=b,g)}function d(b,g,h,C,x){return g===null||g.tag!==7?(g=Dr(h,b.mode,C,x),g.return=b,g):(g=i(g,h),g.return=b,g)}function c(b,g,h){if(typeof g=="string"&&g!==""||typeof g=="number")return g=El(""+g,b.mode,h),g.return=b,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Qs:return h=wo(g.type,g.key,g.props,null,b.mode,h),h.ref=Ai(b,null,g),h.return=b,h;case ln:return g=Al(g,b.mode,h),g.return=b,g;case ir:var C=g._init;return c(b,C(g._payload),h)}if(Fi(g)||Bi(g))return g=Dr(g,b.mode,h,null),g.return=b,g;ho(b,g)}return null}function p(b,g,h,C){var x=g!==null?g.key:null;if(typeof h=="string"&&h!==""||typeof h=="number")return x!==null?null:l(b,g,""+h,C);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Qs:return h.key===x?a(b,g,h,C):null;case ln:return h.key===x?u(b,g,h,C):null;case ir:return x=h._init,p(b,g,x(h._payload),C)}if(Fi(h)||Bi(h))return x!==null?null:d(b,g,h,C,null);ho(b,h)}return null}function _(b,g,h,C,x){if(typeof C=="string"&&C!==""||typeof C=="number")return b=b.get(h)||null,l(g,b,""+C,x);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case Qs:return b=b.get(C.key===null?h:C.key)||null,a(g,b,C,x);case ln:return b=b.get(C.key===null?h:C.key)||null,u(g,b,C,x);case ir:var v=C._init;return _(b,g,h,v(C._payload),x)}if(Fi(C)||Bi(C))return b=b.get(h)||null,d(g,b,C,x,null);ho(g,C)}return null}function m(b,g,h,C){for(var x=null,v=null,M=g,P=g=0,A=null;M!==null&&P<h.length;P++){M.index>P?(A=M,M=null):A=M.sibling;var k=p(b,M,h[P],C);if(k===null){M===null&&(M=A);break}t&&M&&k.alternate===null&&e(b,M),g=s(k,g,P),v===null?x=k:v.sibling=k,v=k,M=A}if(P===h.length)return r(b,M),Q&&Rr(b,P),x;if(M===null){for(;P<h.length;P++)M=c(b,h[P],C),M!==null&&(g=s(M,g,P),v===null?x=M:v.sibling=M,v=M);return Q&&Rr(b,P),x}for(M=n(b,M);P<h.length;P++)A=_(M,b,P,h[P],C),A!==null&&(t&&A.alternate!==null&&M.delete(A.key===null?P:A.key),g=s(A,g,P),v===null?x=A:v.sibling=A,v=A);return t&&M.forEach(function(w){return e(b,w)}),Q&&Rr(b,P),x}function f(b,g,h,C){var x=Bi(h);if(typeof x!="function")throw Error(S(150));if(h=x.call(h),h==null)throw Error(S(151));for(var v=x=null,M=g,P=g=0,A=null,k=h.next();M!==null&&!k.done;P++,k=h.next()){M.index>P?(A=M,M=null):A=M.sibling;var w=p(b,M,k.value,C);if(w===null){M===null&&(M=A);break}t&&M&&w.alternate===null&&e(b,M),g=s(w,g,P),v===null?x=w:v.sibling=w,v=w,M=A}if(k.done)return r(b,M),Q&&Rr(b,P),x;if(M===null){for(;!k.done;P++,k=h.next())k=c(b,k.value,C),k!==null&&(g=s(k,g,P),v===null?x=k:v.sibling=k,v=k);return Q&&Rr(b,P),x}for(M=n(b,M);!k.done;P++,k=h.next())k=_(M,b,P,k.value,C),k!==null&&(t&&k.alternate!==null&&M.delete(k.key===null?P:k.key),g=s(k,g,P),v===null?x=k:v.sibling=k,v=k);return t&&M.forEach(function(D){return e(b,D)}),Q&&Rr(b,P),x}function y(b,g,h,C){if(typeof h=="object"&&h!==null&&h.type===un&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case Qs:e:{for(var x=h.key,v=g;v!==null;){if(v.key===x){if(x=h.type,x===un){if(v.tag===7){r(b,v.sibling),g=i(v,h.props.children),g.return=b,b=g;break e}}else if(v.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===ir&&lp(x)===v.type){r(b,v.sibling),g=i(v,h.props),g.ref=Ai(b,v,h),g.return=b,b=g;break e}r(b,v);break}else e(b,v);v=v.sibling}h.type===un?(g=Dr(h.props.children,b.mode,C,h.key),g.return=b,b=g):(C=wo(h.type,h.key,h.props,null,b.mode,C),C.ref=Ai(b,g,h),C.return=b,b=C)}return o(b);case ln:e:{for(v=h.key;g!==null;){if(g.key===v)if(g.tag===4&&g.stateNode.containerInfo===h.containerInfo&&g.stateNode.implementation===h.implementation){r(b,g.sibling),g=i(g,h.children||[]),g.return=b,b=g;break e}else{r(b,g);break}else e(b,g);g=g.sibling}g=Al(h,b.mode,C),g.return=b,b=g}return o(b);case ir:return v=h._init,y(b,g,v(h._payload),C)}if(Fi(h))return m(b,g,h,C);if(Bi(h))return f(b,g,h,C);ho(b,h)}return typeof h=="string"&&h!==""||typeof h=="number"?(h=""+h,g!==null&&g.tag===6?(r(b,g.sibling),g=i(g,h),g.return=b,b=g):(r(b,g),g=El(h,b.mode,C),g.return=b,b=g),o(b)):r(b,g)}return y}var Bn=Eh(!0),Ah=Eh(!1),Uo=vr(null),Go=null,bn=null,$u=null;function ju(){$u=bn=Go=null}function Xu(t){var e=Uo.current;X(Uo),t._currentValue=e}function uu(t,e,r){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function Sn(t,e){Go=t,$u=bn=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&e)!==0&&(Ue=!0),t.firstContext=null)}function st(t){var e=t._currentValue;if($u!==t)if(t={context:t,memoizedValue:e,next:null},bn===null){if(Go===null)throw Error(S(308));bn=t,Go.dependencies={lanes:0,firstContext:t}}else bn=bn.next=t;return e}var kr=null;function Yu(t){kr===null?kr=[t]:kr.push(t)}function kh(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,Yu(e)):(r.next=i.next,i.next=r),e.interleaved=r,zt(t,n)}function zt(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var sr=!1;function Ju(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Vh(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Nt(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function mr(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,(G&2)!==0){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,zt(t,r)}return i=n.interleaved,i===null?(e.next=e,Yu(n)):(e.next=i.next,i.next=e),n.interleaved=e,zt(t,r)}function Co(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,ku(t,r)}}function up(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=o:s=s.next=o,r=r.next}while(r!==null);s===null?i=s=e:s=s.next=e}else i=s=e;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function zo(t,e,r,n){var i=t.updateQueue;sr=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var a=l,u=a.next;a.next=null,o===null?s=u:o.next=u,o=a;var d=t.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=a))}if(s!==null){var c=i.baseState;o=0,d=u=a=null,l=s;do{var p=l.lane,_=l.eventTime;if((n&p)===p){d!==null&&(d=d.next={eventTime:_,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=t,f=l;switch(p=e,_=r,f.tag){case 1:if(m=f.payload,typeof m=="function"){c=m.call(_,c,p);break e}c=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=f.payload,p=typeof m=="function"?m.call(_,c,p):m,p==null)break e;c=te({},c,p);break e;case 2:sr=!0}}l.callback!==null&&l.lane!==0&&(t.flags|=64,p=i.effects,p===null?i.effects=[l]:p.push(l))}else _={eventTime:_,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=_,a=c):d=d.next=_,o|=p;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;p=l,l=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(d===null&&(a=c),i.baseState=a,i.firstBaseUpdate=u,i.lastBaseUpdate=d,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);Gr|=o,t.lanes=o,t.memoizedState=c}}function cp(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var n=t[e],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(S(191,i));i.call(n)}}}var gs={},wt=vr(gs),as=vr(gs),ls=vr(gs);function Vr(t){if(t===gs)throw Error(S(174));return t}function qu(t,e){switch($(ls,e),$(as,t),$(wt,gs),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Wl(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Wl(e,t)}X(wt),$(wt,e)}function In(){X(wt),X(as),X(ls)}function Oh(t){Vr(ls.current);var e=Vr(wt.current),r=Wl(e,t.type);e!==r&&($(as,t),$(wt,r))}function Qu(t){as.current===t&&(X(wt),X(as))}var Z=vr(0);function Wo(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var wl=[];function Ku(){for(var t=0;t<wl.length;t++)wl[t]._workInProgressVersionPrimary=null;wl.length=0}var vo=Ht.ReactCurrentDispatcher,Tl=Ht.ReactCurrentBatchConfig,Ur=0,ee=null,de=null,me=null,Ho=!1,ji=!1,us=0,kb=0;function Pe(){throw Error(S(321))}function Zu(t,e){if(e===null)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(!gt(t[r],e[r]))return!1;return!0}function ec(t,e,r,n,i,s){if(Ur=s,ee=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,vo.current=t===null||t.memoizedState===null?Fb:Nb,t=r(n,i),ji){s=0;do{if(ji=!1,us=0,25<=s)throw Error(S(301));s+=1,me=de=null,e.updateQueue=null,vo.current=Ub,t=r(n,i)}while(ji)}if(vo.current=$o,e=de!==null&&de.next!==null,Ur=0,me=de=ee=null,Ho=!1,e)throw Error(S(300));return t}function tc(){var t=us!==0;return us=0,t}function Mt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return me===null?ee.memoizedState=me=t:me=me.next=t,me}function ot(){if(de===null){var t=ee.alternate;t=t!==null?t.memoizedState:null}else t=de.next;var e=me===null?ee.memoizedState:me.next;if(e!==null)me=e,de=t;else{if(t===null)throw Error(S(310));de=t,t={memoizedState:de.memoizedState,baseState:de.baseState,baseQueue:de.baseQueue,queue:de.queue,next:null},me===null?ee.memoizedState=me=t:me=me.next=t}return me}function cs(t,e){return typeof e=="function"?e(t):e}function Ll(t){var e=ot(),r=e.queue;if(r===null)throw Error(S(311));r.lastRenderedReducer=t;var n=de,i=n.baseQueue,s=r.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}n.baseQueue=i=s,r.pending=null}if(i!==null){s=i.next,n=n.baseState;var l=o=null,a=null,u=s;do{var d=u.lane;if((Ur&d)===d)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:t(n,u.action);else{var c={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(l=a=c,o=n):a=a.next=c,ee.lanes|=d,Gr|=d}u=u.next}while(u!==null&&u!==s);a===null?o=n:a.next=l,gt(n,e.memoizedState)||(Ue=!0),e.memoizedState=n,e.baseState=o,e.baseQueue=a,r.lastRenderedState=n}if(t=r.interleaved,t!==null){i=t;do s=i.lane,ee.lanes|=s,Gr|=s,i=i.next;while(i!==t)}else i===null&&(r.lanes=0);return[e.memoizedState,r.dispatch]}function Bl(t){var e=ot(),r=e.queue;if(r===null)throw Error(S(311));r.lastRenderedReducer=t;var n=r.dispatch,i=r.pending,s=e.memoizedState;if(i!==null){r.pending=null;var o=i=i.next;do s=t(s,o.action),o=o.next;while(o!==i);gt(s,e.memoizedState)||(Ue=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),r.lastRenderedState=s}return[s,n]}function Dh(){}function Fh(t,e){var r=ee,n=ot(),i=e(),s=!gt(n.memoizedState,i);if(s&&(n.memoizedState=i,Ue=!0),n=n.queue,rc(Gh.bind(null,r,n,t),[t]),n.getSnapshot!==e||s||me!==null&&me.memoizedState.tag&1){if(r.flags|=2048,ds(9,Uh.bind(null,r,n,i,e),void 0,null),fe===null)throw Error(S(349));(Ur&30)!==0||Nh(r,e,i)}return i}function Nh(t,e,r){t.flags|=16384,t={getSnapshot:e,value:r},e=ee.updateQueue,e===null?(e={lastEffect:null,stores:null},ee.updateQueue=e,e.stores=[t]):(r=e.stores,r===null?e.stores=[t]:r.push(t))}function Uh(t,e,r,n){e.value=r,e.getSnapshot=n,zh(e)&&Wh(t)}function Gh(t,e,r){return r(function(){zh(e)&&Wh(t)})}function zh(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!gt(t,r)}catch{return!0}}function Wh(t){var e=zt(t,1);e!==null&&ft(e,t,1,-1)}function dp(t){var e=Mt();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:t},e.queue=t,t=t.dispatch=Db.bind(null,ee,t),[e.memoizedState,t]}function ds(t,e,r,n){return t={tag:t,create:e,destroy:r,deps:n,next:null},e=ee.updateQueue,e===null?(e={lastEffect:null,stores:null},ee.updateQueue=e,e.lastEffect=t.next=t):(r=e.lastEffect,r===null?e.lastEffect=t.next=t:(n=r.next,r.next=t,t.next=n,e.lastEffect=t)),t}function Hh(){return ot().memoizedState}function xo(t,e,r,n){var i=Mt();ee.flags|=t,i.memoizedState=ds(1|e,r,void 0,n===void 0?null:n)}function na(t,e,r,n){var i=ot();n=n===void 0?null:n;var s=void 0;if(de!==null){var o=de.memoizedState;if(s=o.destroy,n!==null&&Zu(n,o.deps)){i.memoizedState=ds(e,r,s,n);return}}ee.flags|=t,i.memoizedState=ds(1|e,r,s,n)}function pp(t,e){return xo(8390656,8,t,e)}function rc(t,e){return na(2048,8,t,e)}function $h(t,e){return na(4,2,t,e)}function jh(t,e){return na(4,4,t,e)}function Xh(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function Yh(t,e,r){return r=r!=null?r.concat([t]):null,na(4,4,Xh.bind(null,e,t),r)}function nc(){}function Jh(t,e){var r=ot();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&Zu(e,n[1])?n[0]:(r.memoizedState=[t,e],t)}function qh(t,e){var r=ot();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&Zu(e,n[1])?n[0]:(t=t(),r.memoizedState=[t,e],t)}function Qh(t,e,r){return(Ur&21)===0?(t.baseState&&(t.baseState=!1,Ue=!0),t.memoizedState=r):(gt(r,e)||(r=rh(),ee.lanes|=r,Gr|=r,t.baseState=!0),e)}function Vb(t,e){var r=z;z=r!==0&&4>r?r:4,t(!0);var n=Tl.transition;Tl.transition={};try{t(!1),e()}finally{z=r,Tl.transition=n}}function Kh(){return ot().memoizedState}function Ob(t,e,r){var n=gr(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Zh(t))em(e,r);else if(r=kh(t,e,r,n),r!==null){var i=Ae();ft(r,t,n,i),tm(r,e,n)}}function Db(t,e,r){var n=gr(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Zh(t))em(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,l=s(o,r);if(i.hasEagerState=!0,i.eagerState=l,gt(l,o)){var a=e.interleaved;a===null?(i.next=i,Yu(e)):(i.next=a.next,a.next=i),e.interleaved=i;return}}catch{}r=kh(t,e,i,n),r!==null&&(i=Ae(),ft(r,t,n,i),tm(r,e,n))}}function Zh(t){var e=t.alternate;return t===ee||e!==null&&e===ee}function em(t,e){ji=Ho=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function tm(t,e,r){if((r&4194240)!==0){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,ku(t,r)}}var $o={readContext:st,useCallback:Pe,useContext:Pe,useEffect:Pe,useImperativeHandle:Pe,useInsertionEffect:Pe,useLayoutEffect:Pe,useMemo:Pe,useReducer:Pe,useRef:Pe,useState:Pe,useDebugValue:Pe,useDeferredValue:Pe,useTransition:Pe,useMutableSource:Pe,useSyncExternalStore:Pe,useId:Pe,unstable_isNewReconciler:!1},Fb={readContext:st,useCallback:function(t,e){return Mt().memoizedState=[t,e===void 0?null:e],t},useContext:st,useEffect:pp,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,xo(4194308,4,Xh.bind(null,e,t),r)},useLayoutEffect:function(t,e){return xo(4194308,4,t,e)},useInsertionEffect:function(t,e){return xo(4,2,t,e)},useMemo:function(t,e){var r=Mt();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=Mt();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=Ob.bind(null,ee,t),[n.memoizedState,t]},useRef:function(t){var e=Mt();return t={current:t},e.memoizedState=t},useState:dp,useDebugValue:nc,useDeferredValue:function(t){return Mt().memoizedState=t},useTransition:function(){var t=dp(!1),e=t[0];return t=Vb.bind(null,t[1]),Mt().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=ee,i=Mt();if(Q){if(r===void 0)throw Error(S(407));r=r()}else{if(r=e(),fe===null)throw Error(S(349));(Ur&30)!==0||Nh(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,pp(Gh.bind(null,n,s,t),[t]),n.flags|=2048,ds(9,Uh.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=Mt(),e=fe.identifierPrefix;if(Q){var r=Ft,n=Dt;r=(n&~(1<<32-mt(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=us++,0<r&&(e+="H"+r.toString(32)),e+=":"}else r=kb++,e=":"+e+"r"+r.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},Nb={readContext:st,useCallback:Jh,useContext:st,useEffect:rc,useImperativeHandle:Yh,useInsertionEffect:$h,useLayoutEffect:jh,useMemo:qh,useReducer:Ll,useRef:Hh,useState:function(){return Ll(cs)},useDebugValue:nc,useDeferredValue:function(t){var e=ot();return Qh(e,de.memoizedState,t)},useTransition:function(){var t=Ll(cs)[0],e=ot().memoizedState;return[t,e]},useMutableSource:Dh,useSyncExternalStore:Fh,useId:Kh,unstable_isNewReconciler:!1},Ub={readContext:st,useCallback:Jh,useContext:st,useEffect:rc,useImperativeHandle:Yh,useInsertionEffect:$h,useLayoutEffect:jh,useMemo:qh,useReducer:Bl,useRef:Hh,useState:function(){return Bl(cs)},useDebugValue:nc,useDeferredValue:function(t){var e=ot();return de===null?e.memoizedState=t:Qh(e,de.memoizedState,t)},useTransition:function(){var t=Bl(cs)[0],e=ot().memoizedState;return[t,e]},useMutableSource:Dh,useSyncExternalStore:Fh,useId:Kh,unstable_isNewReconciler:!1};function dt(t,e){if(t&&t.defaultProps){e=te({},e),t=t.defaultProps;for(var r in t)e[r]===void 0&&(e[r]=t[r]);return e}return e}function cu(t,e,r,n){e=t.memoizedState,r=r(n,e),r=r==null?e:te({},e,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var ia={isMounted:function(t){return(t=t._reactInternals)?Hr(t)===t:!1},enqueueSetState:function(t,e,r){t=t._reactInternals;var n=Ae(),i=gr(t),s=Nt(n,i);s.payload=e,r!=null&&(s.callback=r),e=mr(t,s,i),e!==null&&(ft(e,t,i,n),Co(e,t,i))},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var n=Ae(),i=gr(t),s=Nt(n,i);s.tag=1,s.payload=e,r!=null&&(s.callback=r),e=mr(t,s,i),e!==null&&(ft(e,t,i,n),Co(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=Ae(),n=gr(t),i=Nt(r,n);i.tag=2,e!=null&&(i.callback=e),e=mr(t,i,n),e!==null&&(ft(e,t,n,r),Co(e,t,n))}};function hp(t,e,r,n,i,s,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(n,s,o):e.prototype&&e.prototype.isPureReactComponent?!ns(r,n)||!ns(i,s):!0}function rm(t,e,r){var n=!1,i=yr,s=e.contextType;return typeof s=="object"&&s!==null?s=st(s):(i=ze(e)?Fr:Le.current,n=e.contextTypes,s=(n=n!=null)?Tn(t,i):yr),e=new e(r,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=ia,t.stateNode=e,e._reactInternals=t,n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=s),e}function mp(t,e,r,n){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(r,n),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(r,n),e.state!==t&&ia.enqueueReplaceState(e,e.state,null)}function du(t,e,r,n){var i=t.stateNode;i.props=r,i.state=t.memoizedState,i.refs={},Ju(t);var s=e.contextType;typeof s=="object"&&s!==null?i.context=st(s):(s=ze(e)?Fr:Le.current,i.context=Tn(t,s)),i.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(cu(t,e,s,r),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&ia.enqueueReplaceState(i,i.state,null),zo(t,r,i,n),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function Rn(t,e){try{var r="",n=e;do r+=gg(n),n=n.return;while(n);var i=r}catch(s){i=`
|
|
7
|
+
Error generating stack: `+s.message+`
|
|
8
|
+
`+s.stack}return{value:t,source:e,stack:i,digest:null}}function Il(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function pu(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var Gb=typeof WeakMap=="function"?WeakMap:Map;function nm(t,e,r){r=Nt(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){Xo||(Xo=!0,xu=n),pu(t,e)},r}function im(t,e,r){r=Nt(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var i=e.value;r.payload=function(){return n(i)},r.callback=function(){pu(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){pu(t,e),typeof n!="function"&&(fr===null?fr=new Set([this]):fr.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function fp(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new Gb;var i=new Set;n.set(e,i)}else i=n.get(e),i===void 0&&(i=new Set,n.set(e,i));i.has(r)||(i.add(r),t=t_.bind(null,t,e,r),e.then(t,t))}function gp(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function bp(t,e,r,n,i){return(t.mode&1)===0?(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=Nt(-1,1),e.tag=2,mr(r,e,1))),r.lanes|=1),t):(t.flags|=65536,t.lanes=i,t)}var zb=Ht.ReactCurrentOwner,Ue=!1;function Ee(t,e,r,n){e.child=t===null?Ah(e,null,r,n):Bn(e,t.child,r,n)}function _p(t,e,r,n,i){r=r.render;var s=e.ref;return Sn(e,i),n=ec(t,e,r,n,s,i),r=tc(),t!==null&&!Ue?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Wt(t,e,i)):(Q&&r&&zu(e),e.flags|=1,Ee(t,e,n,i),e.child)}function yp(t,e,r,n,i){if(t===null){var s=r.type;return typeof s=="function"&&!dc(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=s,sm(t,e,s,n,i)):(t=wo(r.type,null,n,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,(t.lanes&i)===0){var o=s.memoizedProps;if(r=r.compare,r=r!==null?r:ns,r(o,n)&&t.ref===e.ref)return Wt(t,e,i)}return e.flags|=1,t=br(s,n),t.ref=e.ref,t.return=e,e.child=t}function sm(t,e,r,n,i){if(t!==null){var s=t.memoizedProps;if(ns(s,n)&&t.ref===e.ref)if(Ue=!1,e.pendingProps=n=s,(t.lanes&i)!==0)(t.flags&131072)!==0&&(Ue=!0);else return e.lanes=t.lanes,Wt(t,e,i)}return hu(t,e,r,n,i)}function om(t,e,r){var n=e.pendingProps,i=n.children,s=t!==null?t.memoizedState:null;if(n.mode==="hidden")if((e.mode&1)===0)e.memoizedState={baseLanes:0,cachePool:null,transitions:null},$(yn,$e),$e|=r;else{if((r&1073741824)===0)return t=s!==null?s.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,$(yn,$e),$e|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=s!==null?s.baseLanes:r,$(yn,$e),$e|=n}else s!==null?(n=s.baseLanes|r,e.memoizedState=null):n=r,$(yn,$e),$e|=n;return Ee(t,e,i,r),e.child}function am(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function hu(t,e,r,n,i){var s=ze(r)?Fr:Le.current;return s=Tn(e,s),Sn(e,i),r=ec(t,e,r,n,s,i),n=tc(),t!==null&&!Ue?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Wt(t,e,i)):(Q&&n&&zu(e),e.flags|=1,Ee(t,e,r,i),e.child)}function Cp(t,e,r,n,i){if(ze(r)){var s=!0;Do(e)}else s=!1;if(Sn(e,i),e.stateNode===null)Mo(t,e),rm(e,r,n),du(e,r,n,i),n=!0;else if(t===null){var o=e.stateNode,l=e.memoizedProps;o.props=l;var a=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=st(u):(u=ze(r)?Fr:Le.current,u=Tn(e,u));var d=r.getDerivedStateFromProps,c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||a!==u)&&mp(e,o,n,u),sr=!1;var p=e.memoizedState;o.state=p,zo(e,n,o,i),a=e.memoizedState,l!==n||p!==a||Ge.current||sr?(typeof d=="function"&&(cu(e,r,d,n),a=e.memoizedState),(l=sr||hp(e,r,l,n,p,a,u))?(c||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=a),o.props=n,o.state=a,o.context=u,n=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{o=e.stateNode,Vh(t,e),l=e.memoizedProps,u=e.type===e.elementType?l:dt(e.type,l),o.props=u,c=e.pendingProps,p=o.context,a=r.contextType,typeof a=="object"&&a!==null?a=st(a):(a=ze(r)?Fr:Le.current,a=Tn(e,a));var _=r.getDerivedStateFromProps;(d=typeof _=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==c||p!==a)&&mp(e,o,n,a),sr=!1,p=e.memoizedState,o.state=p,zo(e,n,o,i);var m=e.memoizedState;l!==c||p!==m||Ge.current||sr?(typeof _=="function"&&(cu(e,r,_,n),m=e.memoizedState),(u=sr||hp(e,r,u,n,p,m,a)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,m,a),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,m,a)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=m),o.props=n,o.state=m,o.context=a,n=u):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),n=!1)}return mu(t,e,r,n,s,i)}function mu(t,e,r,n,i,s){am(t,e);var o=(e.flags&128)!==0;if(!n&&!o)return i&&sp(e,r,!1),Wt(t,e,s);n=e.stateNode,zb.current=e;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&o?(e.child=Bn(e,t.child,null,s),e.child=Bn(e,null,l,s)):Ee(t,e,l,s),e.memoizedState=n.state,i&&sp(e,r,!0),e.child}function lm(t){var e=t.stateNode;e.pendingContext?ip(t,e.pendingContext,e.pendingContext!==e.context):e.context&&ip(t,e.context,!1),qu(t,e.containerInfo)}function vp(t,e,r,n,i){return Ln(),Hu(i),e.flags|=256,Ee(t,e,r,n),e.child}var fu={dehydrated:null,treeContext:null,retryLane:0};function gu(t){return{baseLanes:t,cachePool:null,transitions:null}}function um(t,e,r){var n=e.pendingProps,i=Z.current,s=!1,o=(e.flags&128)!==0,l;if((l=o)||(l=t!==null&&t.memoizedState===null?!1:(i&2)!==0),l?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),$(Z,i&1),t===null)return lu(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((e.mode&1)===0?e.lanes=1:t.data==="$!"?e.lanes=8:e.lanes=1073741824,null):(o=n.children,t=n.fallback,s?(n=e.mode,s=e.child,o={mode:"hidden",children:o},(n&1)===0&&s!==null?(s.childLanes=0,s.pendingProps=o):s=aa(o,n,0,null),t=Dr(t,n,r,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=gu(r),e.memoizedState=fu,t):ic(e,o));if(i=t.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return Wb(t,e,o,n,l,i,r);if(s){s=n.fallback,o=e.mode,i=t.child,l=i.sibling;var a={mode:"hidden",children:n.children};return(o&1)===0&&e.child!==i?(n=e.child,n.childLanes=0,n.pendingProps=a,e.deletions=null):(n=br(i,a),n.subtreeFlags=i.subtreeFlags&14680064),l!==null?s=br(l,s):(s=Dr(s,o,r,null),s.flags|=2),s.return=e,n.return=e,n.sibling=s,e.child=n,n=s,s=e.child,o=t.child.memoizedState,o=o===null?gu(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~r,e.memoizedState=fu,n}return s=t.child,t=s.sibling,n=br(s,{mode:"visible",children:n.children}),(e.mode&1)===0&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=n,e.memoizedState=null,n}function ic(t,e){return e=aa({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function mo(t,e,r,n){return n!==null&&Hu(n),Bn(e,t.child,null,r),t=ic(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Wb(t,e,r,n,i,s,o){if(r)return e.flags&256?(e.flags&=-257,n=Il(Error(S(422))),mo(t,e,o,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=n.fallback,i=e.mode,n=aa({mode:"visible",children:n.children},i,0,null),s=Dr(s,i,o,null),s.flags|=2,n.return=e,s.return=e,n.sibling=s,e.child=n,(e.mode&1)!==0&&Bn(e,t.child,null,o),e.child.memoizedState=gu(o),e.memoizedState=fu,s);if((e.mode&1)===0)return mo(t,e,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var l=n.dgst;return n=l,s=Error(S(419)),n=Il(s,n,void 0),mo(t,e,o,n)}if(l=(o&t.childLanes)!==0,Ue||l){if(n=fe,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=(i&(n.suspendedLanes|o))!==0?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,zt(t,i),ft(n,t,i,-1))}return cc(),n=Il(Error(S(421))),mo(t,e,o,n)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=r_.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,je=hr(i.nextSibling),Xe=e,Q=!0,ht=null,t!==null&&(tt[rt++]=Dt,tt[rt++]=Ft,tt[rt++]=Nr,Dt=t.id,Ft=t.overflow,Nr=e),e=ic(e,n.children),e.flags|=4096,e)}function xp(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),uu(t.return,e,r)}function Rl(t,e,r,n,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i)}function cm(t,e,r){var n=e.pendingProps,i=n.revealOrder,s=n.tail;if(Ee(t,e,n.children,r),n=Z.current,(n&2)!==0)n=n&1|2,e.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&xp(t,r,e);else if(t.tag===19)xp(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if($(Z,n),(e.mode&1)===0)e.memoizedState=null;else switch(i){case"forwards":for(r=e.child,i=null;r!==null;)t=r.alternate,t!==null&&Wo(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),Rl(e,!1,i,r,s);break;case"backwards":for(r=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&Wo(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}Rl(e,!0,r,null,s);break;case"together":Rl(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Mo(t,e){(e.mode&1)===0&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Wt(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Gr|=e.lanes,(r&e.childLanes)===0)return null;if(t!==null&&e.child!==t.child)throw Error(S(153));if(e.child!==null){for(t=e.child,r=br(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=br(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function Hb(t,e,r){switch(e.tag){case 3:lm(e),Ln();break;case 5:Oh(e);break;case 1:ze(e.type)&&Do(e);break;case 4:qu(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,i=e.memoizedProps.value;$(Uo,n._currentValue),n._currentValue=i;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?($(Z,Z.current&1),e.flags|=128,null):(r&e.child.childLanes)!==0?um(t,e,r):($(Z,Z.current&1),t=Wt(t,e,r),t!==null?t.sibling:null);$(Z,Z.current&1);break;case 19:if(n=(r&e.childLanes)!==0,(t.flags&128)!==0){if(n)return cm(t,e,r);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),$(Z,Z.current),n)break;return null;case 22:case 23:return e.lanes=0,om(t,e,r)}return Wt(t,e,r)}var dm,bu,pm,hm;dm=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};bu=function(){};pm=function(t,e,r,n){var i=t.memoizedProps;if(i!==n){t=e.stateNode,Vr(wt.current);var s=null;switch(r){case"input":i=Nl(t,i),n=Nl(t,n),s=[];break;case"select":i=te({},i,{value:void 0}),n=te({},n,{value:void 0}),s=[];break;case"textarea":i=zl(t,i),n=zl(t,n),s=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=Vo)}Hl(r,n);var o;r=null;for(u in i)if(!n.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var l=i[u];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(qi.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in n){var a=n[u];if(l=i?.[u],n.hasOwnProperty(u)&&a!==l&&(a!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||a&&a.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in a)a.hasOwnProperty(o)&&l[o]!==a[o]&&(r||(r={}),r[o]=a[o])}else r||(s||(s=[]),s.push(u,r)),r=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(s=s||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(s=s||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(qi.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&j("scroll",t),s||l===a||(s=[])):(s=s||[]).push(u,a))}r&&(s=s||[]).push("style",r);var u=s;(e.updateQueue=u)&&(e.flags|=4)}};hm=function(t,e,r,n){r!==n&&(e.flags|=4)};function ki(t,e){if(!Q)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function we(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,n=0;if(e)for(var i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function $b(t,e,r){var n=e.pendingProps;switch(Wu(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return we(e),null;case 1:return ze(e.type)&&Oo(),we(e),null;case 3:return n=e.stateNode,In(),X(Ge),X(Le),Ku(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(po(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,ht!==null&&(Pu(ht),ht=null))),bu(t,e),we(e),null;case 5:Qu(e);var i=Vr(ls.current);if(r=e.type,t!==null&&e.stateNode!=null)pm(t,e,r,n,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(S(166));return we(e),null}if(t=Vr(wt.current),po(e)){n=e.stateNode,r=e.type;var s=e.memoizedProps;switch(n[St]=e,n[os]=s,t=(e.mode&1)!==0,r){case"dialog":j("cancel",n),j("close",n);break;case"iframe":case"object":case"embed":j("load",n);break;case"video":case"audio":for(i=0;i<Ui.length;i++)j(Ui[i],n);break;case"source":j("error",n);break;case"img":case"image":case"link":j("error",n),j("load",n);break;case"details":j("toggle",n);break;case"input":Id(n,s),j("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!s.multiple},j("invalid",n);break;case"textarea":Ed(n,s),j("invalid",n)}Hl(r,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="children"?typeof l=="string"?n.textContent!==l&&(s.suppressHydrationWarning!==!0&&co(n.textContent,l,t),i=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(s.suppressHydrationWarning!==!0&&co(n.textContent,l,t),i=["children",""+l]):qi.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&j("scroll",n)}switch(r){case"input":Ks(n),Rd(n,s,!0);break;case"textarea":Ks(n),Ad(n);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(n.onclick=Vo)}n=i,e.updateQueue=n,n!==null&&(e.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=Gp(r)),t==="http://www.w3.org/1999/xhtml"?r==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[St]=e,t[os]=n,dm(t,e,!1,!1),e.stateNode=t;e:{switch(o=$l(r,n),r){case"dialog":j("cancel",t),j("close",t),i=n;break;case"iframe":case"object":case"embed":j("load",t),i=n;break;case"video":case"audio":for(i=0;i<Ui.length;i++)j(Ui[i],t);i=n;break;case"source":j("error",t),i=n;break;case"img":case"image":case"link":j("error",t),j("load",t),i=n;break;case"details":j("toggle",t),i=n;break;case"input":Id(t,n),i=Nl(t,n),j("invalid",t);break;case"option":i=n;break;case"select":t._wrapperState={wasMultiple:!!n.multiple},i=te({},n,{value:void 0}),j("invalid",t);break;case"textarea":Ed(t,n),i=zl(t,n),j("invalid",t);break;default:i=n}Hl(r,i),l=i;for(s in l)if(l.hasOwnProperty(s)){var a=l[s];s==="style"?Hp(t,a):s==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&zp(t,a)):s==="children"?typeof a=="string"?(r!=="textarea"||a!=="")&&Qi(t,a):typeof a=="number"&&Qi(t,""+a):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(qi.hasOwnProperty(s)?a!=null&&s==="onScroll"&&j("scroll",t):a!=null&&Lu(t,s,a,o))}switch(r){case"input":Ks(t),Rd(t,n,!1);break;case"textarea":Ks(t),Ad(t);break;case"option":n.value!=null&&t.setAttribute("value",""+_r(n.value));break;case"select":t.multiple=!!n.multiple,s=n.value,s!=null?Cn(t,!!n.multiple,s,!1):n.defaultValue!=null&&Cn(t,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=Vo)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return we(e),null;case 6:if(t&&e.stateNode!=null)hm(t,e,t.memoizedProps,n);else{if(typeof n!="string"&&e.stateNode===null)throw Error(S(166));if(r=Vr(ls.current),Vr(wt.current),po(e)){if(n=e.stateNode,r=e.memoizedProps,n[St]=e,(s=n.nodeValue!==r)&&(t=Xe,t!==null))switch(t.tag){case 3:co(n.nodeValue,r,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&co(n.nodeValue,r,(t.mode&1)!==0)}s&&(e.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[St]=e,e.stateNode=n}return we(e),null;case 13:if(X(Z),n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Q&&je!==null&&(e.mode&1)!==0&&(e.flags&128)===0)Rh(),Ln(),e.flags|=98560,s=!1;else if(s=po(e),n!==null&&n.dehydrated!==null){if(t===null){if(!s)throw Error(S(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(S(317));s[St]=e}else Ln(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;we(e),s=!1}else ht!==null&&(Pu(ht),ht=null),s=!0;if(!s)return e.flags&65536?e:null}return(e.flags&128)!==0?(e.lanes=r,e):(n=n!==null,n!==(t!==null&&t.memoizedState!==null)&&n&&(e.child.flags|=8192,(e.mode&1)!==0&&(t===null||(Z.current&1)!==0?pe===0&&(pe=3):cc())),e.updateQueue!==null&&(e.flags|=4),we(e),null);case 4:return In(),bu(t,e),t===null&&is(e.stateNode.containerInfo),we(e),null;case 10:return Xu(e.type._context),we(e),null;case 17:return ze(e.type)&&Oo(),we(e),null;case 19:if(X(Z),s=e.memoizedState,s===null)return we(e),null;if(n=(e.flags&128)!==0,o=s.rendering,o===null)if(n)ki(s,!1);else{if(pe!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(o=Wo(t),o!==null){for(e.flags|=128,ki(s,!1),n=o.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),e.subtreeFlags=0,n=r,r=e.child;r!==null;)s=r,t=n,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,t=o.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),r=r.sibling;return $(Z,Z.current&1|2),e.child}t=t.sibling}s.tail!==null&&oe()>En&&(e.flags|=128,n=!0,ki(s,!1),e.lanes=4194304)}else{if(!n)if(t=Wo(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),ki(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Q)return we(e),null}else 2*oe()-s.renderingStartTime>En&&r!==1073741824&&(e.flags|=128,n=!0,ki(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(r=s.last,r!==null?r.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=oe(),e.sibling=null,r=Z.current,$(Z,n?r&1|2:r&1),e):(we(e),null);case 22:case 23:return uc(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&(e.mode&1)!==0?($e&1073741824)!==0&&(we(e),e.subtreeFlags&6&&(e.flags|=8192)):we(e),null;case 24:return null;case 25:return null}throw Error(S(156,e.tag))}function jb(t,e){switch(Wu(e),e.tag){case 1:return ze(e.type)&&Oo(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return In(),X(Ge),X(Le),Ku(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 5:return Qu(e),null;case 13:if(X(Z),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(S(340));Ln()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return X(Z),null;case 4:return In(),null;case 10:return Xu(e.type._context),null;case 22:case 23:return uc(),null;case 24:return null;default:return null}}var fo=!1,Te=!1,Xb=typeof WeakSet=="function"?WeakSet:Set,T=null;function _n(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){ne(t,e,n)}else r.current=null}function _u(t,e,r){try{r()}catch(n){ne(t,e,n)}}var Mp=!1;function Yb(t,e){if(tu=Eo,t=_h(),Gu(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,l=-1,a=-1,u=0,d=0,c=t,p=null;t:for(;;){for(var _;c!==r||i!==0&&c.nodeType!==3||(l=o+i),c!==s||n!==0&&c.nodeType!==3||(a=o+n),c.nodeType===3&&(o+=c.nodeValue.length),(_=c.firstChild)!==null;)p=c,c=_;for(;;){if(c===t)break t;if(p===r&&++u===i&&(l=o),p===s&&++d===n&&(a=o),(_=c.nextSibling)!==null)break;c=p,p=c.parentNode}c=_}r=l===-1||a===-1?null:{start:l,end:a}}else r=null}r=r||{start:0,end:0}}else r=null;for(ru={focusedElem:t,selectionRange:r},Eo=!1,T=e;T!==null;)if(e=T,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,T=t;else for(;T!==null;){e=T;try{var m=e.alternate;if((e.flags&1024)!==0)switch(e.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var f=m.memoizedProps,y=m.memoizedState,b=e.stateNode,g=b.getSnapshotBeforeUpdate(e.elementType===e.type?f:dt(e.type,f),y);b.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var h=e.stateNode.containerInfo;h.nodeType===1?h.textContent="":h.nodeType===9&&h.documentElement&&h.removeChild(h.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(S(163))}}catch(C){ne(e,e.return,C)}if(t=e.sibling,t!==null){t.return=e.return,T=t;break}T=e.return}return m=Mp,Mp=!1,m}function Xi(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&_u(e,r,s)}i=i.next}while(i!==n)}}function sa(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function yu(t){var e=t.ref;if(e!==null){var r=t.stateNode;t.tag,t=r,typeof e=="function"?e(t):e.current=t}}function mm(t){var e=t.alternate;e!==null&&(t.alternate=null,mm(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[St],delete e[os],delete e[su],delete e[Ib],delete e[Rb])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function fm(t){return t.tag===5||t.tag===3||t.tag===4}function Sp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||fm(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Cu(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=Vo));else if(n!==4&&(t=t.child,t!==null))for(Cu(t,e,r),t=t.sibling;t!==null;)Cu(t,e,r),t=t.sibling}function vu(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(vu(t,e,r),t=t.sibling;t!==null;)vu(t,e,r),t=t.sibling}var _e=null,pt=!1;function nr(t,e,r){for(r=r.child;r!==null;)gm(t,e,r),r=r.sibling}function gm(t,e,r){if(Pt&&typeof Pt.onCommitFiberUnmount=="function")try{Pt.onCommitFiberUnmount(Qo,r)}catch{}switch(r.tag){case 5:Te||_n(r,e);case 6:var n=_e,i=pt;_e=null,nr(t,e,r),_e=n,pt=i,_e!==null&&(pt?(t=_e,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):_e.removeChild(r.stateNode));break;case 18:_e!==null&&(pt?(t=_e,r=r.stateNode,t.nodeType===8?Sl(t.parentNode,r):t.nodeType===1&&Sl(t,r),ts(t)):Sl(_e,r.stateNode));break;case 4:n=_e,i=pt,_e=r.stateNode.containerInfo,pt=!0,nr(t,e,r),_e=n,pt=i;break;case 0:case 11:case 14:case 15:if(!Te&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&((s&2)!==0||(s&4)!==0)&&_u(r,e,o),i=i.next}while(i!==n)}nr(t,e,r);break;case 1:if(!Te&&(_n(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){ne(r,e,l)}nr(t,e,r);break;case 21:nr(t,e,r);break;case 22:r.mode&1?(Te=(n=Te)||r.memoizedState!==null,nr(t,e,r),Te=n):nr(t,e,r);break;default:nr(t,e,r)}}function Pp(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new Xb),e.forEach(function(n){var i=n_.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function ct(t,e){var r=e.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var s=t,o=e,l=o;e:for(;l!==null;){switch(l.tag){case 5:_e=l.stateNode,pt=!1;break e;case 3:_e=l.stateNode.containerInfo,pt=!0;break e;case 4:_e=l.stateNode.containerInfo,pt=!0;break e}l=l.return}if(_e===null)throw Error(S(160));gm(s,o,i),_e=null,pt=!1;var a=i.alternate;a!==null&&(a.return=null),i.return=null}catch(u){ne(i,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)bm(e,t),e=e.sibling}function bm(t,e){var r=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(ct(e,t),xt(t),n&4){try{Xi(3,t,t.return),sa(3,t)}catch(f){ne(t,t.return,f)}try{Xi(5,t,t.return)}catch(f){ne(t,t.return,f)}}break;case 1:ct(e,t),xt(t),n&512&&r!==null&&_n(r,r.return);break;case 5:if(ct(e,t),xt(t),n&512&&r!==null&&_n(r,r.return),t.flags&32){var i=t.stateNode;try{Qi(i,"")}catch(f){ne(t,t.return,f)}}if(n&4&&(i=t.stateNode,i!=null)){var s=t.memoizedProps,o=r!==null?r.memoizedProps:s,l=t.type,a=t.updateQueue;if(t.updateQueue=null,a!==null)try{l==="input"&&s.type==="radio"&&s.name!=null&&Np(i,s),$l(l,o);var u=$l(l,s);for(o=0;o<a.length;o+=2){var d=a[o],c=a[o+1];d==="style"?Hp(i,c):d==="dangerouslySetInnerHTML"?zp(i,c):d==="children"?Qi(i,c):Lu(i,d,c,u)}switch(l){case"input":Ul(i,s);break;case"textarea":Up(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var _=s.value;_!=null?Cn(i,!!s.multiple,_,!1):p!==!!s.multiple&&(s.defaultValue!=null?Cn(i,!!s.multiple,s.defaultValue,!0):Cn(i,!!s.multiple,s.multiple?[]:"",!1))}i[os]=s}catch(f){ne(t,t.return,f)}}break;case 6:if(ct(e,t),xt(t),n&4){if(t.stateNode===null)throw Error(S(162));i=t.stateNode,s=t.memoizedProps;try{i.nodeValue=s}catch(f){ne(t,t.return,f)}}break;case 3:if(ct(e,t),xt(t),n&4&&r!==null&&r.memoizedState.isDehydrated)try{ts(e.containerInfo)}catch(f){ne(t,t.return,f)}break;case 4:ct(e,t),xt(t);break;case 13:ct(e,t),xt(t),i=t.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(ac=oe())),n&4&&Pp(t);break;case 22:if(d=r!==null&&r.memoizedState!==null,t.mode&1?(Te=(u=Te)||d,ct(e,t),Te=u):ct(e,t),xt(t),n&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!d&&(t.mode&1)!==0)for(T=t,d=t.child;d!==null;){for(c=T=d;T!==null;){switch(p=T,_=p.child,p.tag){case 0:case 11:case 14:case 15:Xi(4,p,p.return);break;case 1:_n(p,p.return);var m=p.stateNode;if(typeof m.componentWillUnmount=="function"){n=p,r=p.return;try{e=n,m.props=e.memoizedProps,m.state=e.memoizedState,m.componentWillUnmount()}catch(f){ne(n,r,f)}}break;case 5:_n(p,p.return);break;case 22:if(p.memoizedState!==null){Tp(c);continue}}_!==null?(_.return=p,T=_):Tp(c)}d=d.sibling}e:for(d=null,c=t;;){if(c.tag===5){if(d===null){d=c;try{i=c.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(l=c.stateNode,a=c.memoizedProps.style,o=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=Wp("display",o))}catch(f){ne(t,t.return,f)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(f){ne(t,t.return,f)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===t)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}}break;case 19:ct(e,t),xt(t),n&4&&Pp(t);break;case 21:break;default:ct(e,t),xt(t)}}function xt(t){var e=t.flags;if(e&2){try{e:{for(var r=t.return;r!==null;){if(fm(r)){var n=r;break e}r=r.return}throw Error(S(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(Qi(i,""),n.flags&=-33);var s=Sp(t);vu(t,s,i);break;case 3:case 4:var o=n.stateNode.containerInfo,l=Sp(t);Cu(t,l,o);break;default:throw Error(S(161))}}catch(a){ne(t,t.return,a)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function Jb(t,e,r){T=t,_m(t,e,r)}function _m(t,e,r){for(var n=(t.mode&1)!==0;T!==null;){var i=T,s=i.child;if(i.tag===22&&n){var o=i.memoizedState!==null||fo;if(!o){var l=i.alternate,a=l!==null&&l.memoizedState!==null||Te;l=fo;var u=Te;if(fo=o,(Te=a)&&!u)for(T=i;T!==null;)o=T,a=o.child,o.tag===22&&o.memoizedState!==null?Lp(i):a!==null?(a.return=o,T=a):Lp(i);for(;s!==null;)T=s,_m(s,e,r),s=s.sibling;T=i,fo=l,Te=u}wp(t,e,r)}else(i.subtreeFlags&8772)!==0&&s!==null?(s.return=i,T=s):wp(t,e,r)}}function wp(t){for(;T!==null;){var e=T;if((e.flags&8772)!==0){var r=e.alternate;try{if((e.flags&8772)!==0)switch(e.tag){case 0:case 11:case 15:Te||sa(5,e);break;case 1:var n=e.stateNode;if(e.flags&4&&!Te)if(r===null)n.componentDidMount();else{var i=e.elementType===e.type?r.memoizedProps:dt(e.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&cp(e,s,n);break;case 3:var o=e.updateQueue;if(o!==null){if(r=null,e.child!==null)switch(e.child.tag){case 5:r=e.child.stateNode;break;case 1:r=e.child.stateNode}cp(e,o,r)}break;case 5:var l=e.stateNode;if(r===null&&e.flags&4){r=l;var a=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break;case"img":a.src&&(r.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var c=d.dehydrated;c!==null&&ts(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(S(163))}Te||e.flags&512&&yu(e)}catch(p){ne(e,e.return,p)}}if(e===t){T=null;break}if(r=e.sibling,r!==null){r.return=e.return,T=r;break}T=e.return}}function Tp(t){for(;T!==null;){var e=T;if(e===t){T=null;break}var r=e.sibling;if(r!==null){r.return=e.return,T=r;break}T=e.return}}function Lp(t){for(;T!==null;){var e=T;try{switch(e.tag){case 0:case 11:case 15:var r=e.return;try{sa(4,e)}catch(a){ne(e,r,a)}break;case 1:var n=e.stateNode;if(typeof n.componentDidMount=="function"){var i=e.return;try{n.componentDidMount()}catch(a){ne(e,i,a)}}var s=e.return;try{yu(e)}catch(a){ne(e,s,a)}break;case 5:var o=e.return;try{yu(e)}catch(a){ne(e,o,a)}}}catch(a){ne(e,e.return,a)}if(e===t){T=null;break}var l=e.sibling;if(l!==null){l.return=e.return,T=l;break}T=e.return}}var qb=Math.ceil,jo=Ht.ReactCurrentDispatcher,sc=Ht.ReactCurrentOwner,it=Ht.ReactCurrentBatchConfig,G=0,fe=null,ae=null,ye=0,$e=0,yn=vr(0),pe=0,ps=null,Gr=0,oa=0,oc=0,Yi=null,Ne=null,ac=0,En=1/0,Vt=null,Xo=!1,xu=null,fr=null,go=!1,ur=null,Yo=0,Ji=0,Mu=null,So=-1,Po=0;function Ae(){return(G&6)!==0?oe():So!==-1?So:So=oe()}function gr(t){return(t.mode&1)===0?1:(G&2)!==0&&ye!==0?ye&-ye:Ab.transition!==null?(Po===0&&(Po=rh()),Po):(t=z,t!==0||(t=window.event,t=t===void 0?16:uh(t.type)),t)}function ft(t,e,r,n){if(50<Ji)throw Ji=0,Mu=null,Error(S(185));hs(t,r,n),((G&2)===0||t!==fe)&&(t===fe&&((G&2)===0&&(oa|=r),pe===4&&ar(t,ye)),We(t,n),r===1&&G===0&&(e.mode&1)===0&&(En=oe()+500,ra&&xr()))}function We(t,e){var r=t.callbackNode;Vg(t,e);var n=Ro(t,t===fe?ye:0);if(n===0)r!==null&&Od(r),t.callbackNode=null,t.callbackPriority=0;else if(e=n&-n,t.callbackPriority!==e){if(r!=null&&Od(r),e===1)t.tag===0?Eb(Bp.bind(null,t)):Lh(Bp.bind(null,t)),Lb(function(){(G&6)===0&&xr()}),r=null;else{switch(nh(n)){case 1:r=Au;break;case 4:r=eh;break;case 16:r=Io;break;case 536870912:r=th;break;default:r=Io}r=wm(r,ym.bind(null,t))}t.callbackPriority=e,t.callbackNode=r}}function ym(t,e){if(So=-1,Po=0,(G&6)!==0)throw Error(S(327));var r=t.callbackNode;if(Pn()&&t.callbackNode!==r)return null;var n=Ro(t,t===fe?ye:0);if(n===0)return null;if((n&30)!==0||(n&t.expiredLanes)!==0||e)e=Jo(t,n);else{e=n;var i=G;G|=2;var s=vm();(fe!==t||ye!==e)&&(Vt=null,En=oe()+500,Or(t,e));do try{Zb();break}catch(l){Cm(t,l)}while(!0);ju(),jo.current=s,G=i,ae!==null?e=0:(fe=null,ye=0,e=pe)}if(e!==0){if(e===2&&(i=ql(t),i!==0&&(n=i,e=Su(t,i))),e===1)throw r=ps,Or(t,0),ar(t,n),We(t,oe()),r;if(e===6)ar(t,n);else{if(i=t.current.alternate,(n&30)===0&&!Qb(i)&&(e=Jo(t,n),e===2&&(s=ql(t),s!==0&&(n=s,e=Su(t,s))),e===1))throw r=ps,Or(t,0),ar(t,n),We(t,oe()),r;switch(t.finishedWork=i,t.finishedLanes=n,e){case 0:case 1:throw Error(S(345));case 2:Er(t,Ne,Vt);break;case 3:if(ar(t,n),(n&130023424)===n&&(e=ac+500-oe(),10<e)){if(Ro(t,0)!==0)break;if(i=t.suspendedLanes,(i&n)!==n){Ae(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=iu(Er.bind(null,t,Ne,Vt),e);break}Er(t,Ne,Vt);break;case 4:if(ar(t,n),(n&4194240)===n)break;for(e=t.eventTimes,i=-1;0<n;){var o=31-mt(n);s=1<<o,o=e[o],o>i&&(i=o),n&=~s}if(n=i,n=oe()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*qb(n/1960))-n,10<n){t.timeoutHandle=iu(Er.bind(null,t,Ne,Vt),n);break}Er(t,Ne,Vt);break;case 5:Er(t,Ne,Vt);break;default:throw Error(S(329))}}}return We(t,oe()),t.callbackNode===r?ym.bind(null,t):null}function Su(t,e){var r=Yi;return t.current.memoizedState.isDehydrated&&(Or(t,e).flags|=256),t=Jo(t,e),t!==2&&(e=Ne,Ne=r,e!==null&&Pu(e)),t}function Pu(t){Ne===null?Ne=t:Ne.push.apply(Ne,t)}function Qb(t){for(var e=t;;){if(e.flags&16384){var r=e.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var i=r[n],s=i.getSnapshot;i=i.value;try{if(!gt(s(),i))return!1}catch{return!1}}}if(r=e.child,e.subtreeFlags&16384&&r!==null)r.return=e,e=r;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function ar(t,e){for(e&=~oc,e&=~oa,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var r=31-mt(e),n=1<<r;t[r]=-1,e&=~n}}function Bp(t){if((G&6)!==0)throw Error(S(327));Pn();var e=Ro(t,0);if((e&1)===0)return We(t,oe()),null;var r=Jo(t,e);if(t.tag!==0&&r===2){var n=ql(t);n!==0&&(e=n,r=Su(t,n))}if(r===1)throw r=ps,Or(t,0),ar(t,e),We(t,oe()),r;if(r===6)throw Error(S(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Er(t,Ne,Vt),We(t,oe()),null}function lc(t,e){var r=G;G|=1;try{return t(e)}finally{G=r,G===0&&(En=oe()+500,ra&&xr())}}function zr(t){ur!==null&&ur.tag===0&&(G&6)===0&&Pn();var e=G;G|=1;var r=it.transition,n=z;try{if(it.transition=null,z=1,t)return t()}finally{z=n,it.transition=r,G=e,(G&6)===0&&xr()}}function uc(){$e=yn.current,X(yn)}function Or(t,e){t.finishedWork=null,t.finishedLanes=0;var r=t.timeoutHandle;if(r!==-1&&(t.timeoutHandle=-1,Tb(r)),ae!==null)for(r=ae.return;r!==null;){var n=r;switch(Wu(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Oo();break;case 3:In(),X(Ge),X(Le),Ku();break;case 5:Qu(n);break;case 4:In();break;case 13:X(Z);break;case 19:X(Z);break;case 10:Xu(n.type._context);break;case 22:case 23:uc()}r=r.return}if(fe=t,ae=t=br(t.current,null),ye=$e=e,pe=0,ps=null,oc=oa=Gr=0,Ne=Yi=null,kr!==null){for(e=0;e<kr.length;e++)if(r=kr[e],n=r.interleaved,n!==null){r.interleaved=null;var i=n.next,s=r.pending;if(s!==null){var o=s.next;s.next=i,n.next=o}r.pending=n}kr=null}return t}function Cm(t,e){do{var r=ae;try{if(ju(),vo.current=$o,Ho){for(var n=ee.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Ho=!1}if(Ur=0,me=de=ee=null,ji=!1,us=0,sc.current=null,r===null||r.return===null){pe=1,ps=e,ae=null;break}e:{var s=t,o=r.return,l=r,a=e;if(e=ye,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,d=l,c=d.tag;if((d.mode&1)===0&&(c===0||c===11||c===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var _=gp(o);if(_!==null){_.flags&=-257,bp(_,o,l,s,e),_.mode&1&&fp(s,u,e),e=_,a=u;var m=e.updateQueue;if(m===null){var f=new Set;f.add(a),e.updateQueue=f}else m.add(a);break e}else{if((e&1)===0){fp(s,u,e),cc();break e}a=Error(S(426))}}else if(Q&&l.mode&1){var y=gp(o);if(y!==null){(y.flags&65536)===0&&(y.flags|=256),bp(y,o,l,s,e),Hu(Rn(a,l));break e}}s=a=Rn(a,l),pe!==4&&(pe=2),Yi===null?Yi=[s]:Yi.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var b=nm(s,a,e);up(s,b);break e;case 1:l=a;var g=s.type,h=s.stateNode;if((s.flags&128)===0&&(typeof g.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(fr===null||!fr.has(h)))){s.flags|=65536,e&=-e,s.lanes|=e;var C=im(s,l,e);up(s,C);break e}}s=s.return}while(s!==null)}Mm(r)}catch(x){e=x,ae===r&&r!==null&&(ae=r=r.return);continue}break}while(!0)}function vm(){var t=jo.current;return jo.current=$o,t===null?$o:t}function cc(){(pe===0||pe===3||pe===2)&&(pe=4),fe===null||(Gr&268435455)===0&&(oa&268435455)===0||ar(fe,ye)}function Jo(t,e){var r=G;G|=2;var n=vm();(fe!==t||ye!==e)&&(Vt=null,Or(t,e));do try{Kb();break}catch(i){Cm(t,i)}while(!0);if(ju(),G=r,jo.current=n,ae!==null)throw Error(S(261));return fe=null,ye=0,pe}function Kb(){for(;ae!==null;)xm(ae)}function Zb(){for(;ae!==null&&!wg();)xm(ae)}function xm(t){var e=Pm(t.alternate,t,$e);t.memoizedProps=t.pendingProps,e===null?Mm(t):ae=e,sc.current=null}function Mm(t){var e=t;do{var r=e.alternate;if(t=e.return,(e.flags&32768)===0){if(r=$b(r,e,$e),r!==null){ae=r;return}}else{if(r=jb(r,e),r!==null){r.flags&=32767,ae=r;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{pe=6,ae=null;return}}if(e=e.sibling,e!==null){ae=e;return}ae=e=t}while(e!==null);pe===0&&(pe=5)}function Er(t,e,r){var n=z,i=it.transition;try{it.transition=null,z=1,e_(t,e,r,n)}finally{it.transition=i,z=n}return null}function e_(t,e,r,n){do Pn();while(ur!==null);if((G&6)!==0)throw Error(S(327));r=t.finishedWork;var i=t.finishedLanes;if(r===null)return null;if(t.finishedWork=null,t.finishedLanes=0,r===t.current)throw Error(S(177));t.callbackNode=null,t.callbackPriority=0;var s=r.lanes|r.childLanes;if(Og(t,s),t===fe&&(ae=fe=null,ye=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||go||(go=!0,wm(Io,function(){return Pn(),null})),s=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||s){s=it.transition,it.transition=null;var o=z;z=1;var l=G;G|=4,sc.current=null,Yb(t,r),bm(r,t),xb(ru),Eo=!!tu,ru=tu=null,t.current=r,Jb(r,t,i),Tg(),G=l,z=o,it.transition=s}else t.current=r;if(go&&(go=!1,ur=t,Yo=i),s=t.pendingLanes,s===0&&(fr=null),Ig(r.stateNode,n),We(t,oe()),e!==null)for(n=t.onRecoverableError,r=0;r<e.length;r++)i=e[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(Xo)throw Xo=!1,t=xu,xu=null,t;return(Yo&1)!==0&&t.tag!==0&&Pn(),s=t.pendingLanes,(s&1)!==0?t===Mu?Ji++:(Ji=0,Mu=t):Ji=0,xr(),null}function Pn(){if(ur!==null){var t=nh(Yo),e=it.transition,r=z;try{if(it.transition=null,z=16>t?16:t,ur===null)var n=!1;else{if(t=ur,ur=null,Yo=0,(G&6)!==0)throw Error(S(331));var i=G;for(G|=4,T=t.current;T!==null;){var s=T,o=s.child;if((T.flags&16)!==0){var l=s.deletions;if(l!==null){for(var a=0;a<l.length;a++){var u=l[a];for(T=u;T!==null;){var d=T;switch(d.tag){case 0:case 11:case 15:Xi(8,d,s)}var c=d.child;if(c!==null)c.return=d,T=c;else for(;T!==null;){d=T;var p=d.sibling,_=d.return;if(mm(d),d===u){T=null;break}if(p!==null){p.return=_,T=p;break}T=_}}}var m=s.alternate;if(m!==null){var f=m.child;if(f!==null){m.child=null;do{var y=f.sibling;f.sibling=null,f=y}while(f!==null)}}T=s}}if((s.subtreeFlags&2064)!==0&&o!==null)o.return=s,T=o;else e:for(;T!==null;){if(s=T,(s.flags&2048)!==0)switch(s.tag){case 0:case 11:case 15:Xi(9,s,s.return)}var b=s.sibling;if(b!==null){b.return=s.return,T=b;break e}T=s.return}}var g=t.current;for(T=g;T!==null;){o=T;var h=o.child;if((o.subtreeFlags&2064)!==0&&h!==null)h.return=o,T=h;else e:for(o=g;T!==null;){if(l=T,(l.flags&2048)!==0)try{switch(l.tag){case 0:case 11:case 15:sa(9,l)}}catch(x){ne(l,l.return,x)}if(l===o){T=null;break e}var C=l.sibling;if(C!==null){C.return=l.return,T=C;break e}T=l.return}}if(G=i,xr(),Pt&&typeof Pt.onPostCommitFiberRoot=="function")try{Pt.onPostCommitFiberRoot(Qo,t)}catch{}n=!0}return n}finally{z=r,it.transition=e}}return!1}function Ip(t,e,r){e=Rn(r,e),e=nm(t,e,1),t=mr(t,e,1),e=Ae(),t!==null&&(hs(t,1,e),We(t,e))}function ne(t,e,r){if(t.tag===3)Ip(t,t,r);else for(;e!==null;){if(e.tag===3){Ip(e,t,r);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(fr===null||!fr.has(n))){t=Rn(r,t),t=im(e,t,1),e=mr(e,t,1),t=Ae(),e!==null&&(hs(e,1,t),We(e,t));break}}e=e.return}}function t_(t,e,r){var n=t.pingCache;n!==null&&n.delete(e),e=Ae(),t.pingedLanes|=t.suspendedLanes&r,fe===t&&(ye&r)===r&&(pe===4||pe===3&&(ye&130023424)===ye&&500>oe()-ac?Or(t,0):oc|=r),We(t,e)}function Sm(t,e){e===0&&((t.mode&1)===0?e=1:(e=to,to<<=1,(to&130023424)===0&&(to=4194304)));var r=Ae();t=zt(t,e),t!==null&&(hs(t,e,r),We(t,r))}function r_(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),Sm(t,r)}function n_(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(S(314))}n!==null&&n.delete(e),Sm(t,r)}var Pm;Pm=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ge.current)Ue=!0;else{if((t.lanes&r)===0&&(e.flags&128)===0)return Ue=!1,Hb(t,e,r);Ue=(t.flags&131072)!==0}else Ue=!1,Q&&(e.flags&1048576)!==0&&Bh(e,No,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;Mo(t,e),t=e.pendingProps;var i=Tn(e,Le.current);Sn(e,r),i=ec(null,e,n,t,i,r);var s=tc();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ze(n)?(s=!0,Do(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Ju(e),i.updater=ia,e.stateNode=i,i._reactInternals=e,du(e,n,t,r),e=mu(null,e,n,!0,s,r)):(e.tag=0,Q&&s&&zu(e),Ee(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(Mo(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=s_(n),t=dt(n,t),i){case 0:e=hu(null,e,n,t,r);break e;case 1:e=Cp(null,e,n,t,r);break e;case 11:e=_p(null,e,n,t,r);break e;case 14:e=yp(null,e,n,dt(n.type,t),r);break e}throw Error(S(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:dt(n,i),hu(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:dt(n,i),Cp(t,e,n,i,r);case 3:e:{if(lm(e),t===null)throw Error(S(387));n=e.pendingProps,s=e.memoizedState,i=s.element,Vh(t,e),zo(e,n,null,r);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Rn(Error(S(423)),e),e=vp(t,e,n,r,i);break e}else if(n!==i){i=Rn(Error(S(424)),e),e=vp(t,e,n,r,i);break e}else for(je=hr(e.stateNode.containerInfo.firstChild),Xe=e,Q=!0,ht=null,r=Ah(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ln(),n===i){e=Wt(t,e,r);break e}Ee(t,e,n,r)}e=e.child}return e;case 5:return Oh(e),t===null&&lu(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,nu(n,i)?o=null:s!==null&&nu(n,s)&&(e.flags|=32),am(t,e),Ee(t,e,o,r),e.child;case 6:return t===null&&lu(e),null;case 13:return um(t,e,r);case 4:return qu(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Bn(e,null,n,r):Ee(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:dt(n,i),_p(t,e,n,i,r);case 7:return Ee(t,e,e.pendingProps,r),e.child;case 8:return Ee(t,e,e.pendingProps.children,r),e.child;case 12:return Ee(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,$(Uo,n._currentValue),n._currentValue=o,s!==null)if(gt(s.value,o)){if(s.children===i.children&&!Ge.current){e=Wt(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var a=l.firstContext;a!==null;){if(a.context===n){if(s.tag===1){a=Nt(-1,r&-r),a.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?a.next=a:(a.next=d.next,d.next=a),u.pending=a}}s.lanes|=r,a=s.alternate,a!==null&&(a.lanes|=r),uu(s.return,r,e),l.lanes|=r;break}a=a.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(S(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),uu(o,r,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Ee(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Sn(e,r),i=st(i),n=n(i),e.flags|=1,Ee(t,e,n,r),e.child;case 14:return n=e.type,i=dt(n,e.pendingProps),i=dt(n.type,i),yp(t,e,n,i,r);case 15:return sm(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:dt(n,i),Mo(t,e),e.tag=1,ze(n)?(t=!0,Do(e)):t=!1,Sn(e,r),rm(e,n,i),du(e,n,i,r),mu(null,e,n,!0,t,r);case 19:return cm(t,e,r);case 22:return om(t,e,r)}throw Error(S(156,e.tag))};function wm(t,e){return Zp(t,e)}function i_(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nt(t,e,r,n){return new i_(t,e,r,n)}function dc(t){return t=t.prototype,!(!t||!t.isReactComponent)}function s_(t){if(typeof t=="function")return dc(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Iu)return 11;if(t===Ru)return 14}return 2}function br(t,e){var r=t.alternate;return r===null?(r=nt(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function wo(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")dc(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case un:return Dr(r.children,i,s,e);case Bu:o=8,i|=8;break;case Vl:return t=nt(12,r,e,i|2),t.elementType=Vl,t.lanes=s,t;case Ol:return t=nt(13,r,e,i),t.elementType=Ol,t.lanes=s,t;case Dl:return t=nt(19,r,e,i),t.elementType=Dl,t.lanes=s,t;case Op:return aa(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case kp:o=10;break e;case Vp:o=9;break e;case Iu:o=11;break e;case Ru:o=14;break e;case ir:o=16,n=null;break e}throw Error(S(130,t==null?t:typeof t,""))}return e=nt(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function Dr(t,e,r,n){return t=nt(7,t,n,e),t.lanes=r,t}function aa(t,e,r,n){return t=nt(22,t,n,e),t.elementType=Op,t.lanes=r,t.stateNode={isHidden:!1},t}function El(t,e,r){return t=nt(6,t,null,e),t.lanes=r,t}function Al(t,e,r){return e=nt(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function o_(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gl(0),this.expirationTimes=gl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gl(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function pc(t,e,r,n,i,s,o,l,a){return t=new o_(t,e,r,l,a),e===1?(e=1,s===!0&&(e|=8)):e=0,s=nt(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ju(s),t}function a_(t,e,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ln,key:n==null?null:""+n,children:t,containerInfo:e,implementation:r}}function Tm(t){if(!t)return yr;t=t._reactInternals;e:{if(Hr(t)!==t||t.tag!==1)throw Error(S(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(ze(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(S(171))}if(t.tag===1){var r=t.type;if(ze(r))return Th(t,r,e)}return e}function Lm(t,e,r,n,i,s,o,l,a){return t=pc(r,n,!0,t,i,s,o,l,a),t.context=Tm(null),r=t.current,n=Ae(),i=gr(r),s=Nt(n,i),s.callback=e??null,mr(r,s,i),t.current.lanes=i,hs(t,i,n),We(t,n),t}function la(t,e,r,n){var i=e.current,s=Ae(),o=gr(i);return r=Tm(r),e.context===null?e.context=r:e.pendingContext=r,e=Nt(s,o),e.payload={element:t},n=n===void 0?null:n,n!==null&&(e.callback=n),t=mr(i,e,o),t!==null&&(ft(t,i,o,s),Co(t,i,o)),o}function qo(t){return t=t.current,t.child?(t.child.tag===5,t.child.stateNode):null}function Rp(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<e?r:e}}function hc(t,e){Rp(t,e),(t=t.alternate)&&Rp(t,e)}function l_(){return null}var Bm=typeof reportError=="function"?reportError:function(t){console.error(t)};function mc(t){this._internalRoot=t}ua.prototype.render=mc.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(S(409));la(t,e,null,null)};ua.prototype.unmount=mc.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;zr(function(){la(null,t,null,null)}),e[Gt]=null}};function ua(t){this._internalRoot=t}ua.prototype.unstable_scheduleHydration=function(t){if(t){var e=oh();t={blockedOn:null,target:t,priority:e};for(var r=0;r<or.length&&e!==0&&e<or[r].priority;r++);or.splice(r,0,t),r===0&&lh(t)}};function fc(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function ca(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Ep(){}function u_(t,e,r,n,i){if(i){if(typeof n=="function"){var s=n;n=function(){var u=qo(o);s.call(u)}}var o=Lm(e,n,t,0,null,!1,!1,"",Ep);return t._reactRootContainer=o,t[Gt]=o.current,is(t.nodeType===8?t.parentNode:t),zr(),o}for(;i=t.lastChild;)t.removeChild(i);if(typeof n=="function"){var l=n;n=function(){var u=qo(a);l.call(u)}}var a=pc(t,0,!1,null,null,!1,!1,"",Ep);return t._reactRootContainer=a,t[Gt]=a.current,is(t.nodeType===8?t.parentNode:t),zr(function(){la(e,a,r,n)}),a}function da(t,e,r,n,i){var s=r._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var l=i;i=function(){var a=qo(o);l.call(a)}}la(e,o,t,i)}else o=u_(r,e,t,i,n);return qo(o)}ih=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var r=Ni(e.pendingLanes);r!==0&&(ku(e,r|1),We(e,oe()),(G&6)===0&&(En=oe()+500,xr()))}break;case 13:zr(function(){var n=zt(t,1);if(n!==null){var i=Ae();ft(n,t,1,i)}}),hc(t,1)}};Vu=function(t){if(t.tag===13){var e=zt(t,134217728);if(e!==null){var r=Ae();ft(e,t,134217728,r)}hc(t,134217728)}};sh=function(t){if(t.tag===13){var e=gr(t),r=zt(t,e);if(r!==null){var n=Ae();ft(r,t,e,n)}hc(t,e)}};oh=function(){return z};ah=function(t,e){var r=z;try{return z=t,e()}finally{z=r}};Xl=function(t,e,r){switch(e){case"input":if(Ul(t,r),e=r.name,r.type==="radio"&&e!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<r.length;e++){var n=r[e];if(n!==t&&n.form===t.form){var i=ta(n);if(!i)throw Error(S(90));Fp(n),Ul(n,i)}}}break;case"textarea":Up(t,r);break;case"select":e=r.value,e!=null&&Cn(t,!!r.multiple,e,!1)}};Xp=lc;Yp=zr;var c_={usingClientEntryPoint:!1,Events:[fs,hn,ta,$p,jp,lc]},Vi={findFiberByHostInstance:Ar,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},d_={bundleType:Vi.bundleType,version:Vi.version,rendererPackageName:Vi.rendererPackageName,rendererConfig:Vi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ht.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Qp(t),t===null?null:t.stateNode},findFiberByHostInstance:Vi.findFiberByHostInstance||l_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Oi=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Oi.isDisabled&&Oi.supportsFiber))try{Qo=Oi.inject(d_),Pt=Oi}catch{}var Oi;qe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=c_;qe.createPortal=function(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!fc(e))throw Error(S(200));return a_(t,e,null,r)};qe.createRoot=function(t,e){if(!fc(t))throw Error(S(299));var r=!1,n="",i=Bm;return e!=null&&(e.unstable_strictMode===!0&&(r=!0),e.identifierPrefix!==void 0&&(n=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=pc(t,1,!1,null,null,r,!1,n,i),t[Gt]=e.current,is(t.nodeType===8?t.parentNode:t),new mc(e)};qe.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(S(188)):(t=Object.keys(t).join(","),Error(S(268,t)));return t=Qp(e),t=t===null?null:t.stateNode,t};qe.flushSync=function(t){return zr(t)};qe.hydrate=function(t,e,r){if(!ca(e))throw Error(S(200));return da(null,t,e,!0,r)};qe.hydrateRoot=function(t,e,r){if(!fc(t))throw Error(S(405));var n=r!=null&&r.hydratedSources||null,i=!1,s="",o=Bm;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(s=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),e=Lm(e,null,t,1,r??null,i,!1,s,o),t[Gt]=e.current,is(t),n)for(t=0;t<n.length;t++)r=n[t],i=r._getVersion,i=i(r._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[r,i]:e.mutableSourceEagerHydrationData.push(r,i);return new ua(e)};qe.render=function(t,e,r){if(!ca(e))throw Error(S(200));return da(null,t,e,!1,r)};qe.unmountComponentAtNode=function(t){if(!ca(t))throw Error(S(40));return t._reactRootContainer?(zr(function(){da(null,null,t,!1,function(){t._reactRootContainer=null,t[Gt]=null})}),!0):!1};qe.unstable_batchedUpdates=lc;qe.unstable_renderSubtreeIntoContainer=function(t,e,r,n){if(!ca(r))throw Error(S(200));if(t==null||t._reactInternals===void 0)throw Error(S(38));return da(t,e,r,!1,n)};qe.version="18.3.1-next-f1338f8080-20240426"});var Am=At((kv,Em)=>{"use strict";function Rm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Rm)}catch(t){console.error(t)}}Rm(),Em.exports=Im()});var Vm=At(gc=>{"use strict";var km=Am();gc.createRoot=km.createRoot,gc.hydrateRoot=km.hydrateRoot;var Vv});var Vf=At(qa=>{"use strict";var iv=kt(),sv=Symbol.for("react.element"),ov=Symbol.for("react.fragment"),av=Object.prototype.hasOwnProperty,lv=iv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,uv={key:!0,ref:!0,__self:!0,__source:!0};function kf(t,e,r){var n,i={},s=null,o=null;r!==void 0&&(s=""+r),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(n in e)av.call(e,n)&&!uv.hasOwnProperty(n)&&(i[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:sv,type:t,key:s,ref:o,props:i,_owner:lv.current}}qa.Fragment=ov;qa.jsx=kf;qa.jsxs=kf});var Ze=At((OP,Of)=>{"use strict";Of.exports=Vf()});var nn=ce(kt(),1),zf=ce(Vm(),1);var er=ce(kt(),1);var p_={"\u62D6\u62FD\u79FB\u52A8\u753B\u9762 \xB7 \u6EDA\u8F6E\u7F29\u653E":"Drag to move \xB7 Scroll to zoom","Live2D \u89D2\u8272\u821E\u53F0":"Live2D character stage",\u8BF7\u5728\u52A8\u753B\u8D44\u6E90\u4E2D\u4E3A\u5F53\u524D\u89D2\u8272\u9009\u62E9\u6A21\u578B:"Select a model for this character","\u89D2\u8272\u52A0\u8F7D\u4E2D...":"Loading character\u2026",\u7B49\u5F85\u521D\u59CB\u5316:"Waiting to initialize","\u6B63\u5728\u52A0\u8F7D Live2D \u89D2\u8272...":"Loading Live2D character\u2026","Live2D \u521D\u59CB\u5316\u5931\u8D25\uFF0C\u8BF7\u786E\u8BA4\u6D4F\u89C8\u5668\u652F\u6301 WebGL2":"Live2D initialization failed; WebGL2 is required","{0} \u5DF2\u5C31\u7EEA":"{0} is ready",\u5DF2\u5378\u8F7D:"Unloaded","\u6B63\u5728\u5207\u6362\u81F3 {0}...":"Switching to {0}\u2026"},pa=(t,e=[])=>(p_[t]??t).replace(/\{(\d+)\}/g,(r,n)=>Number(n)<e.length?String(e[Number(n)]):r);var Ct=ce(kt(),1);var lt=ce(kt(),1);var Vn=class t{static createIdInternal(e){return new t(e)}getString(){return this._id}isEqual(e){return typeof e=="string"?this._id==e:e instanceof t?this._id==e._id:!1}isNotEqual(e){return typeof e=="string"?this._id!=e:e instanceof t?this._id!=e._id:!1}constructor(e){this._id=e}_id},h_;(e=>e.CubismId=Vn)(h_||={});var On=class{constructor(){this._ids=new Array}release(){for(let e=0;e<this._ids.length;++e)this._ids[e]=void 0;this._ids=null}registerIds(e){for(let r=0;r<e.length;r++)this.registerId(e[r])}registerId(e){let r=null;if(typeof e=="string"){if((r=this.findId(e))!=null)return r;r=Vn.createIdInternal(e),this._ids.push(r)}else return this.registerId(e);return r}getId(e){return this.registerId(e)}isExist(e){return typeof e=="string"?this.findId(e)!=null:this.isExist(e)}findId(e){for(let r=0;r<this._ids.length;++r)if(this._ids[r].getString()==e)return this._ids[r];return null}_ids},f_;(e=>e.CubismIdManager=On)(f_||={});var E=class t{constructor(e,r){this.x=e;this.y=r;this.x=e??0,this.y=r??0}x;y;add(e){let r=new t(0,0);return r.x=this.x+e.x,r.y=this.y+e.y,r}substract(e){let r=new t(0,0);return r.x=this.x-e.x,r.y=this.y-e.y,r}multiply(e){let r=new t(0,0);return r.x=this.x*e.x,r.y=this.y*e.y,r}multiplyByScaler(e){return this.multiply(new t(e,e))}division(e){let r=new t(0,0);return r.x=this.x/e.x,r.y=this.y/e.y,r}divisionByScalar(e){return this.division(new t(e,e))}getLength(){return Math.sqrt(this.x*this.x+this.y*this.y)}getDistanceWith(e){return Math.sqrt((this.x-e.x)*(this.x-e.x)+(this.y-e.y)*(this.y-e.y))}dot(e){return this.x*e.x+this.y*e.y}normalize(){let e=Math.pow(this.x*this.x+this.y*this.y,.5);this.x=this.x/e,this.y=this.y/e}isEqual(e){return this.x==e.x&&this.y==e.y}isNotEqual(e){return!this.isEqual(e)}},b_;(e=>e.CubismVector2=E)(b_||={});var L=class t{static Epsilon=1e-5;static range(e,r,n){return e<r?e=r:e>n&&(e=n),e}static sin(e){return Math.sin(e)}static cos(e){return Math.cos(e)}static abs(e){return Math.abs(e)}static sqrt(e){return Math.sqrt(e)}static cbrt(e){if(e===0)return e;let r=e,n=r<0;n&&(r=-r);let i;return r===1/0?i=1/0:(i=Math.exp(Math.log(r)/3),i=(r/(i*i)+2*i)/3),n?-i:i}static getEasingSine(e){return e<0?0:e>1?1:.5-.5*this.cos(e*Math.PI)}static max(e,r){return e>r?e:r}static min(e,r){return e>r?r:e}static clamp(e,r,n){return e<r?r:n<e?n:e}static degreesToRadian(e){return e/180*Math.PI}static radianToDegrees(e){return e*180/Math.PI}static directionToRadian(e,r){let n=Math.atan2(r.y,r.x),i=Math.atan2(e.y,e.x),s=n-i;for(;s<-Math.PI;)s+=Math.PI*2;for(;s>Math.PI;)s-=Math.PI*2;return s}static directionToDegrees(e,r){let n=this.directionToRadian(e,r),i=this.radianToDegrees(n);return r.x-e.x>0&&(i=-i),i}static radianToDirection(e){let r=new E;return r.x=this.sin(e),r.y=this.cos(e),r}static quadraticEquation(e,r,n){return this.abs(e)<t.Epsilon?this.abs(r)<t.Epsilon?-n:-n/r:-(r+this.sqrt(r*r-4*e*n))/(2*e)}static cardanoAlgorithmForBezier(e,r,n,i){if(this.abs(e)<t.Epsilon)return this.range(this.quadraticEquation(r,n,i),0,1);let s=r/e,o=n/e,l=i/e,a=(3*o-s*s)/3,u=a/3,d=(2*s*s*s-9*s*o+27*l)/27,c=d/2,p=c*c+u*u*u,_=.5,m=_+.01;if(p<0){let h=-a/3,C=h*h*h,x=this.sqrt(C),v=-d/(2*x),M=this.range(v,-1,1),P=Math.acos(M),k=2*this.cbrt(x),w=k*this.cos(P/3)-s/3;if(this.abs(w-_)<m)return this.range(w,0,1);let D=k*this.cos((P+2*Math.PI)/3)-s/3;if(this.abs(D-_)<m)return this.range(D,0,1);let re=k*this.cos((P+4*Math.PI)/3)-s/3;return this.range(re,0,1)}if(p==0){let h;c<0?h=this.cbrt(-c):h=-this.cbrt(c);let C=2*h-s/3;if(this.abs(C-_)<m)return this.range(C,0,1);let x=-h-s/3;return this.range(x,0,1)}let f=this.sqrt(p),y=this.cbrt(f-c),b=this.cbrt(f+c),g=y-b-s/3;return this.range(g,0,1)}static mod(e,r){if(!isFinite(e)||r===0||isNaN(e)||isNaN(r))return console.warn(`divided: ${e}, divisor: ${r} mod() returns 'NaN'.`),NaN;let n=Math.abs(e),i=Math.abs(r),s=n-Math.floor(n/i)*i;return s*=Math.sign(e),s}constructor(){}},y_;(e=>e.CubismMath=L)(y_||={});var W=class t{constructor(){this._tr=new Float32Array(16),this.loadIdentity()}static multiply(e,r,n){let i=new Float32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),s=4;for(let o=0;o<s;++o)for(let l=0;l<s;++l)for(let a=0;a<s;++a)i[l+o*4]+=e[a+o*4]*r[l+a*4];for(let o=0;o<16;++o)n[o]=i[o]}loadIdentity(){let e=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);this.setMatrix(e)}setMatrix(e){for(let r=0;r<16;++r)this._tr[r]=e[r]}getArray(){return this._tr}getScaleX(){return this._tr[0]}getScaleY(){return this._tr[5]}getTranslateX(){return this._tr[12]}getTranslateY(){return this._tr[13]}transformX(e){return this._tr[0]*e+this._tr[12]}transformY(e){return this._tr[5]*e+this._tr[13]}invertTransformX(e){return(e-this._tr[12])/this._tr[0]}invertTransformY(e){return(e-this._tr[13])/this._tr[5]}translateRelative(e,r){let n=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,e,r,0,1]);t.multiply(n,this._tr,this._tr)}translate(e,r){this._tr[12]=e,this._tr[13]=r}translateX(e){this._tr[12]=e}translateY(e){this._tr[13]=e}scaleRelative(e,r){let n=new Float32Array([e,0,0,0,0,r,0,0,0,0,1,0,0,0,0,1]);t.multiply(n,this._tr,this._tr)}scale(e,r){this._tr[0]=e,this._tr[5]=r}multiplyByMatrix(e){t.multiply(e.getArray(),this._tr,this._tr)}getInvert(){let e=this._tr[0],r=this._tr[1],n=this._tr[2],i=this._tr[4],s=this._tr[5],o=this._tr[6],l=this._tr[8],a=this._tr[9],u=this._tr[10],d=this._tr[12],c=this._tr[13],p=this._tr[14],_=e*(s*u-a*o)-i*(r*u-a*n)+l*(r*o-s*n),m=new t;if(L.abs(_)<L.Epsilon)return m.loadIdentity(),m;let f=1/_,y=(s*u-a*o)*f,b=-(i*u-l*o)*f,g=(i*a-l*s)*f,h=-(r*u-a*n)*f,C=(e*u-l*n)*f,x=-(e*a-l*r)*f,v=(r*o-s*n)*f,M=-(e*o-i*n)*f,P=(e*s-i*r)*f;return m._tr[0]=y,m._tr[1]=h,m._tr[2]=v,m._tr[3]=0,m._tr[4]=b,m._tr[5]=C,m._tr[6]=M,m._tr[7]=0,m._tr[8]=g,m._tr[9]=x,m._tr[10]=P,m._tr[11]=0,m._tr[12]=-(y*d+b*c+g*p),m._tr[13]=-(h*d+C*c+x*p),m._tr[14]=-(v*d+M*c+P*p),m._tr[15]=1,m}clone(){let e=new t;for(let r=0;r<this._tr.length;r++)e._tr[r]=this._tr[r];return e}_tr},v_;(e=>e.CubismMatrix44=W)(v_||={});var $t=class{constructor(e,r,n,i){this.x=e,this.y=r,this.width=n,this.height=i}getCenterX(){return this.x+.5*this.width}getCenterY(){return this.y+.5*this.height}getRight(){return this.x+this.width}getBottom(){return this.y+this.height}setRect(e){this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height}expand(e,r){this.x-=e,this.y-=r,this.width+=e*2,this.height+=r*2}x;y;width;height},M_;(e=>e.csmRect=$t)(M_||={});var I_=(t,e,r)=>{$r.print(t,"[CSM]"+e,r)},Ve=(t,e,r)=>{I_(t,e+`
|
|
9
|
+
`,r)},ie=t=>{console.assert(t)},R_,_s,he,Y,R;R_=(t,...e)=>{Ve(0,"[V]"+t,e)},_s=(t,...e)=>{Ve(1,"[D]"+t,e)},he=(t,...e)=>{Ve(2,"[I]"+t,e)},Y=(t,...e)=>{Ve(3,"[W]"+t,e)},R=(t,...e)=>{Ve(4,"[E]"+t,e)};var $r=class{static print(e,r,n){if(e<B.getLoggingLevel())return;let i=B.coreLogFunction;if(!i)return;let s=r.replace(/\{(\d+)\}/g,(o,l)=>n[l]);i(s)}static dumpBytes(e,r,n){for(let i=0;i<n;i++)i%16==0&&i>0?this.print(e,`
|
|
10
|
+
`):i%8==0&&i>0&&this.print(e," "),this.print(e,"{0} ",[r[i]&255]);this.print(e,`
|
|
11
|
+
`)}constructor(){}},E_;(e=>e.CubismDebug=$r)(E_||={});var jt=class{static create(){return null}static delete(e){e=null}initialize(e){this._model=e,e.isBlendModeEnabled()&&(this.useHighPrecisionMask(!0),he("This model uses a high-resolution mask because it operates in blend mode."))}drawModel(e=null){this.getModel()!=null&&this.doDrawModel(e)}setMvpMatrix(e){this._mvpMatrix4x4.setMatrix(e.getArray())}getMvpMatrix(){return this._mvpMatrix4x4}setModelColor(e,r,n,i){this._modelColor.r=L.clamp(e,0,1),this._modelColor.g=L.clamp(r,0,1),this._modelColor.b=L.clamp(n,0,1),this._modelColor.a=L.clamp(i,0,1)}getModelColor(){return JSON.parse(JSON.stringify(this._modelColor))}getModelColorWithOpacity(e){let r=this.getModelColor();return r.a*=e,this.isPremultipliedAlpha()&&(r.r*=r.a,r.g*=r.a,r.b*=r.a),r}setIsPremultipliedAlpha(e){this._isPremultipliedAlpha=e}isPremultipliedAlpha(){return this._isPremultipliedAlpha}setIsCulling(e){this._isCulling=e}isCulling(){return this._isCulling}setAnisotropy(e){this._anisotropy=e}getAnisotropy(){return this._anisotropy}getModel(){return this._model}useHighPrecisionMask(e){this._useHighPrecisionMask=e}isUsingHighPrecisionMask(){return this._useHighPrecisionMask}setRenderTargetSize(e,r){this._modelRenderTargetWidth=e,this._modelRenderTargetHeight=r}constructor(e,r){this._modelRenderTargetWidth=e,this._modelRenderTargetHeight=r,this._isCulling=!1,this._isPremultipliedAlpha=!1,this._anisotropy=0,this._model=null,this._modelColor=new U,this._useHighPrecisionMask=!1,this._mvpMatrix4x4=new W,this._mvpMatrix4x4.loadIdentity()}static staticRelease;_mvpMatrix4x4;_modelColor;_isCulling;_isPremultipliedAlpha;_anisotropy;_model;_useHighPrecisionMask;_modelRenderTargetWidth;_modelRenderTargetHeight},ys=(n=>(n[n.CubismBlendMode_Normal=0]="CubismBlendMode_Normal",n[n.CubismBlendMode_Additive=1]="CubismBlendMode_Additive",n[n.CubismBlendMode_Multiplicative=2]="CubismBlendMode_Multiplicative",n))(ys||{});var U=class{constructor(e=1,r=1,n=1,i=1){this.r=e,this.g=r,this.b=n,this.a=i}r;g;b;a},ha=class{constructor(e,r){this._clippingIdList=e,this._clippingIdCount=r,this._allClippedDrawRect=new $t,this._layoutBounds=new $t,this._clippedDrawableIndexList=[],this._clippedOffscreenIndexList=[],this._matrixForMask=new W,this._matrixForDraw=new W,this._bufferIndex=0,this._layoutChannelIndex=0}release(){this._layoutBounds!=null&&(this._layoutBounds=null),this._allClippedDrawRect!=null&&(this._allClippedDrawRect=null),this._clippedDrawableIndexList!=null&&(this._clippedDrawableIndexList=null),this._clippedOffscreenIndexList!=null&&(this._clippedOffscreenIndexList=null)}addClippedDrawable(e){this._clippedDrawableIndexList.push(e)}addClippedOffscreen(e){this._clippedOffscreenIndexList.push(e)}_isUsing;_clippingIdList;_clippingIdCount;_layoutChannelIndex;_layoutBounds;_allClippedDrawRect;_matrixForMask;_matrixForDraw;_clippedDrawableIndexList;_clippedOffscreenIndexList;_bufferIndex},k_;(n=>(n.CubismBlendMode=ys,n.CubismRenderer=jt,n.CubismTextureColor=U))(k_||={});var ma=class t{static parseJsonObject(e,r){return Object.keys(e).forEach(n=>{if(typeof e[n]=="boolean"){let i=!!e[n];r.put(n,new Oe(i))}else if(typeof e[n]=="string"){let i=String(e[n]);r.put(n,new Bt(i))}else if(typeof e[n]=="number"){let i=Number(e[n]);r.put(n,new Mr(i))}else e[n]instanceof Array?r.put(n,t.parseJsonArray(e[n])):e[n]instanceof Object?r.put(n,t.parseJsonObject(e[n],new Lt)):e[n]==null?r.put(n,new Tt):r.put(n,e[n])}),r}static parseJsonArray(e){let r=new jr;return Object.keys(e).forEach(n=>{if(typeof Number(n)=="number")if(typeof e[n]=="boolean"){let s=!!e[n];r.add(new Oe(s))}else if(typeof e[n]=="string"){let s=String(e[n]);r.add(new Bt(s))}else if(typeof e[n]=="number"){let s=Number(e[n]);r.add(new Mr(s))}else e[n]instanceof Array?r.add(this.parseJsonArray(e[n])):e[n]instanceof Object?r.add(this.parseJsonObject(e[n],new Lt)):e[n]==null?r.add(new Tt):r.add(e[n]);else if(e[n]instanceof Array)r.add(this.parseJsonArray(e[n]));else if(e[n]instanceof Object)r.add(this.parseJsonObject(e[n],new Lt));else if(e[n]==null)r.add(new Tt);else{let s=Array(e[n]);for(let o=0;o<s.length;o++)r.add(s[o])}}),r}};var fa="Error: type mismatch",O_="Error: index out of bounds",ge=class t{constructor(){}getRawString(e,r){return this.getString(e,r)}toInt(e=0){return e}toFloat(e=0){return e}toBoolean(e=!1){return e}getSize(){return 0}getArray(e=null){return e}getVector(e=new Array){return e}getMap(e){return e}getValueByIndex(e){return t.errorValue.setErrorNotForClientCall(fa)}getValueByString(e){return t.nullValue.setErrorNotForClientCall(fa)}getKeys(){return t.dummyKeys}isError(){return!1}isNull(){return!1}isBool(){return!1}isFloat(){return!1}isString(){return!1}isArray(){return!1}isMap(){return!1}equals(e){return!1}isStatic(){return!1}setErrorNotForClientCall(e){return Sr.errorValue}static staticInitializeNotForClientCall(){Oe.trueValue=new Oe(!0),Oe.falseValue=new Oe(!1),t.errorValue=new Sr("ERROR",!0),t.nullValue=new Tt,t.dummyKeys=new Array}static staticReleaseNotForClientCall(){Oe.trueValue=null,Oe.falseValue=null,t.errorValue=null,t.nullValue=null,t.dummyKeys=null}_stringBuffer;static dummyKeys;static errorValue;static nullValue},se=class t{constructor(e,r){this._error=null,this._lineCount=0,this._root=null,e!=null&&this.parseBytes(e,r,this._parseCallback)}static create(e,r){let n=new t;return n.parseBytes(e,r,n._parseCallback)?n:(t.delete(n),null)}static delete(e){e=null}getRoot(){return this._root}static arrayBufferToString(e){let r=new Uint8Array(e),n="";for(let i=0,s=r.length;i<s;++i)n+="%"+this.pad(r[i].toString(16));return n=decodeURIComponent(n),n}static pad(e){return e.length<2?"0"+e:e}parseBytes(e,r,n){let i=new Array(1),s=t.arrayBufferToString(e);if(n==null?this._root=this.parseValue(s,r,0,i):this._root=n(JSON.parse(s),new Lt),this._error){let o="\0";return o="Json parse error : @line "+(this._lineCount+1)+`
|
|
12
|
+
`,this._root=new Bt(o),he("{0}",this._root.getRawString()),!1}else if(this._root==null)return this._root=new Sr(this._error,!1),!1;return!0}getParseError(){return this._error}checkEndOfFile(){return this._root.getArray()[1].equals("EOF")}parseValue(e,r,n,i){if(this._error)return null;let s=null,o=n,l;for(;o<r;o++)switch(e[o]){case"-":case".":case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{let u=new Array(1);return l=Dm(e.slice(o),u),i[0]=e.indexOf(u[0]),new Mr(l)}case'"':return new Bt(this.parseString(e,r,o+1,i));case"[":return s=this.parseArray(e,r,o+1,i),s;case"{":return s=this.parseObject(e,r,o+1,i),s;case"n":return o+3<r?(s=new Tt,i[0]=o+4):this._error="parse null",s;case"t":return o+3<r?(s=Oe.trueValue,i[0]=o+4):this._error="parse true",s;case"f":return o+4<r?(s=Oe.falseValue,i[0]=o+5):this._error="illegal ',' position",s;case",":return this._error="illegal ',' position",null;case"]":return i[0]=o,null;case`
|
|
13
|
+
`:this._lineCount++;default:break}return this._error="illegal end of value",null}parseString(e,r,n,i){if(this._error)return null;if(!e)return this._error="string is null",null;let s=n,o,l,a="",u=n;for(;s<r;s++)switch(o=e[s],o){case'"':return i[0]=s+1,a+=e.substr(u,s-u),a;case"//":if(s++,s-1>u&&(a+=e.substr(u,s-u)),u=s+1,s<r)switch(l=e[s],l){case"\\":a+="\\";break;case'"':a+='"';break;case"/":a+="/";break;case"b":a+="\b";break;case"f":a+="\f";break;case"n":a+=`
|
|
14
|
+
`;break;case"r":a+="\r";break;case"t":a+=" ";break;case"u":this._error="parse string/unicord escape not supported";break;default:break}else this._error="parse string/escape error";default:break}return this._error="parse string/illegal end",null}parseObject(e,r,n,i){if(this._error)return null;if(!e)return this._error="buffer is null",null;let s=new Lt,o="",l=n,a="",u=Array(1),d=!1;for(;l<r;l++){e:for(;l<r;l++)switch(a=e[l],a){case'"':if(o=this.parseString(e,r,l+1,u),this._error)return null;l=u[0],d=!0;break e;case"}":return i[0]=l+1,s;case":":this._error="illegal ':' position";break;case`
|
|
15
|
+
`:this._lineCount++;default:break}if(!d)return this._error="key not found",null;d=!1;e:for(;l<r;l++)switch(a=e[l],a){case":":d=!0,l++;break e;case"}":this._error="illegal '}' position";break;case`
|
|
16
|
+
`:this._lineCount++;default:break}if(!d)return this._error="':' not found",null;let c=this.parseValue(e,r,l,u);if(this._error)return null;l=u[0],s.put(o,c);e:for(;l<r;l++)switch(a=e[l],a){case",":break e;case"}":return i[0]=l+1,s;case`
|
|
17
|
+
`:this._lineCount++;default:break}}return this._error="illegal end of perseObject",null}parseArray(e,r,n,i){if(this._error)return null;if(!e)return this._error="buffer is null",null;let s=new jr,o=n,l,a=new Array(1);for(;o<r;o++){let u=this.parseValue(e,r,o,a);if(this._error)return null;o=a[0],u&&s.add(u);e:for(;o<r;o++)switch(l=e[o],l){case",":break e;case"]":return i[0]=o+1,s;case`
|
|
18
|
+
`:++this._lineCount;default:break}}return s=void 0,this._error="illegal end of parseObject",null}_parseCallback=ma.parseJsonObject;_error;_lineCount;_root},Mr=class extends ge{constructor(e){super(),this._value=e}isFloat(){return!0}getString(e,r){return this._value=parseFloat("\0"),this._stringBuffer="\0",this._stringBuffer}toInt(e=0){return parseInt(this._value.toString())}toFloat(e=0){return this._value}equals(e){return typeof e=="number"?Math.round(e)?!1:e==this._value:!1}_value},Oe=class extends ge{isBool(){return!0}toBoolean(e=!1){return this._boolValue}getString(e,r){return this._stringBuffer=this._boolValue?"true":"false",this._stringBuffer}equals(e){return typeof e=="boolean"?e==this._boolValue:!1}isStatic(){return!0}constructor(e){super(),this._boolValue=e}static trueValue;static falseValue;_boolValue},Bt=class extends ge{constructor(e){super(),this._stringBuffer=e}isString(){return!0}getString(e,r){return this._stringBuffer}equals(e){return typeof e=="string"?this._stringBuffer==e:!1}},Sr=class extends Bt{isStatic(){return this._isStatic}setErrorNotForClientCall(e){return this._stringBuffer=e,this}constructor(e,r){typeof e=="string"?super(e):super(e),this._isStatic=r}isError(){return!0}_isStatic},Tt=class extends ge{isNull(){return!0}getString(e,r){return this._stringBuffer}isStatic(){return!0}setErrorNotForClientCall(e){return this._stringBuffer=e,Sr.nullValue}constructor(){super(),this._stringBuffer="NullValue"}},jr=class extends ge{constructor(){super(),this._array=new Array}release(){for(let e=0;e<this._array.length;e++){let r=this._array[e];r&&!r.isStatic()&&(r=void 0,r=null)}}isArray(){return!0}getValueByIndex(e){if(e<0||this._array.length<=e)return ge.errorValue.setErrorNotForClientCall(O_);let r=this._array[e];return r??ge.nullValue}getValueByString(e){return ge.errorValue.setErrorNotForClientCall(fa)}getString(e,r){let n=r+`[
|
|
19
|
+
`;for(let i=0;i<this._array.length;i++){let s=this._array[i];this._stringBuffer+=r+""+s.getString(r+" ")+`
|
|
20
|
+
`}return this._stringBuffer=n+r+`]
|
|
21
|
+
`,this._stringBuffer}add(e){this._array.push(e)}getVector(e=null){return this._array}getSize(){return this._array.length}_array},Lt=class extends ge{constructor(){super(),this._map=new Map}release(){this._map.clear()}isMap(){return!0}getValueByString(e){let r=this._map.get(e);return r??ge.nullValue}getValueByIndex(e){return ge.errorValue.setErrorNotForClientCall(fa)}getString(e,r){this._stringBuffer=r+`{
|
|
22
|
+
`;for(let n of this._map){let i=n[0],s=n[1];this._stringBuffer+=r+" "+i+" : "+s.getString(r+" ")+`
|
|
23
|
+
`}return this._stringBuffer+=r+`}
|
|
24
|
+
`,this._stringBuffer}getMap(e){return this._map}put(e,r){this._map.set(e,r)}getKeys(){return this._keys||(this._keys=[...this._map.keys()]),this._keys}getSize(){return this._keys.length}_map;_keys},D_;(u=>(u.CubismJson=se,u.JsonArray=jr,u.JsonBoolean=Oe,u.JsonError=Sr,u.JsonFloat=Mr,u.JsonMap=Lt,u.JsonNullvalue=Tt,u.JsonString=Bt,u.Value=ge))(D_||={});function Dm(t,e){let r=0;for(let i=1;;i++){let s=t.slice(i-1,i);if(s=="e"||s=="-"||s=="E")continue;let o=t.substring(0,i),l=Number(o);if(isNaN(l))break;r=i}let n=parseFloat(t);return isNaN(n)&&(n=NaN),e[0]=t.slice(r),n}var bt=!1,Dn=!1,Fn=null,Cs=null,He=Object.freeze({vertexOffset:0,vertexStep:2});function Xt(t){t&&(t=void 0)}var B=class{static startUp(e=null){if(bt)return he("CubismFramework.startUp() is already done."),bt;if(Fn=e,Fn!=null&&Live2DCubismCore.Logging.csmSetLogFunction(Fn.logFunction),bt=!0,bt){let r=Live2DCubismCore.Version.csmGetVersion(),n=(r&4278190080)>>24,i=(r&16711680)>>16,s=r&65535,o=r;he("Live2D Cubism Core version: {0}.{1}.{2} ({3})",("00"+n).slice(-2),("00"+i).slice(-2),("0000"+s).slice(-4),o)}return he("CubismFramework.startUp() is complete."),bt}static cleanUp(){bt=!1,Dn=!1,Fn=null,Cs=null}static initialize(e=0){if(ie(bt),!bt){Y("CubismFramework is not started.");return}if(Dn){Y("CubismFramework.initialize() skipped, already initialized.");return}ge.staticInitializeNotForClientCall(),Cs=new On,Live2DCubismCore.Memory.initializeAmountOfMemory(e),Dn=!0,he("CubismFramework.initialize() is complete.")}static dispose(){if(ie(bt),!bt){Y("CubismFramework is not started.");return}if(!Dn){Y("CubismFramework.dispose() skipped, not initialized.");return}ge.staticReleaseNotForClientCall(),Cs.release(),Cs=null,jt.staticRelease(),Dn=!1,he("CubismFramework.dispose() is complete.")}static isStarted(){return bt}static isInitialized(){return Dn}static coreLogFunction(e){Live2DCubismCore.Logging.csmGetLogFunction()&&Live2DCubismCore.Logging.csmGetLogFunction()(e)}static getLoggingLevel(){return Fn!=null?Fn.loggingLevel:5}static getIdManager(){return Cs}constructor(){}},ga=class{logFunction;loggingLevel};var N_;(n=>(n.Constant=He,n.csmDelete=Xt,n.CubismFramework=B))(N_||={});var N=class{static loadFileAsBytes(e,r){fetch(e).then(n=>n.arrayBuffer()).then(n=>r(n,n.byteLength))}static getDeltaTime(){return this.deltaTime}static updateTime(){this.currentFrame=Date.now(),this.deltaTime=(this.currentFrame-this.lastFrame)/1e3,this.lastFrame=this.currentFrame}static printMessage(e){console.log(e)}static lastUpdate=Date.now();static currentFrame=0;static lastFrame=0;static deltaTime=0};var xs="/character/hiyori/",_a="/live2d-stage/assets/shaders/",Fm="back_transparent.png",Nm="back_transparent.png";var vs=["hiyori_free_t08"],bc=vs.length,_c=["hiyori_free_t08.model3.json"],ba="Idle",yc="Tap@Body",Cc="Head",vc="Body",Um=!0,Gm=!1,Nn=null;function Ms(t){Nn=t,xs=t.resourcesPath,vs=t.modelDir==="."?[""]:[t.modelDir],_c=[t.model3Json],bc=vs.length,ba=t.idleGroup??"Idle",yc=G_(t.motionGroups)??ba,Cc=t.hitAreas[0]?.name??"Head",vc=t.hitAreas[1]?.name??t.hitAreas[0]?.name??"Body"}function G_(t){let e=Object.keys(t);return e.find(n=>/^Tap/i.test(n)||n.includes("Body")||n.includes("\u8138"))??e.find(n=>n!=="Idle")??null}var Ss="auto";var xc=1,zm=2,Wm=.8,Hm=-1,$m=1;var jm=-2,Xm=2,Ym=-2,Jm=2,ya=0,Ca=1,Mc=2,va=3,qm=!0,Qm=!0,Ps=!0,Km=!1,Zm=3;var xa=class{initialize(e){return this._gl=e.getContext("webgl2",{alpha:!0,premultipliedAlpha:!0,antialias:!0}),this._gl?!0:(alert("Cannot initialize WebGL. This browser does not support."),this._gl=null,!1)}release(){}getGl(){if(!this._gl)throw new Error("WebGL context has not been initialized");return this._gl}_gl=null};var Qe=class{static delete(e){e.release(),e=null}constructor(){this._fadeInSeconds=-1,this._fadeOutSeconds=-1,this._weight=1,this._offsetSeconds=0,this._isLoop=!1,this._isLoopFadeIn=!0,this._previousLoopState=this._isLoop,this._firedEventValues=new Array}release(){this._weight=0}updateParameters(e,r,n){if(!r.isAvailable()||r.isFinished())return;this.setupMotionQueueEntry(r,n);let i=this.updateFadeWeight(r,n);this.doUpdateParameters(e,n,i,r),r.getEndTime()>0&&r.getEndTime()<n&&r.setIsFinished(!0)}setupMotionQueueEntry(e,r){e==null||e.isStarted()||e.isAvailable()&&(e.setIsStarted(!0),e.setStartTime(r-this._offsetSeconds),e.setFadeInStartTime(r),e.getEndTime()<0&&this.adjustEndTime(e),e._motion._onBeganMotion&&e._motion._onBeganMotion(e._motion))}updateFadeWeight(e,r){e==null&&$r.print(4,"motionQueueEntry is null.");let n=this._weight,i=this._fadeInSeconds==0?1:L.getEasingSine((r-e.getFadeInStartTime())/this._fadeInSeconds),s=this._fadeOutSeconds==0||e.getEndTime()<0?1:L.getEasingSine((e.getEndTime()-r)/this._fadeOutSeconds);return n=n*i*s,e.setState(r,n),ie(0<=n&&n<=1),n}setFadeInTime(e){this._fadeInSeconds=e}setFadeOutTime(e){this._fadeOutSeconds=e}getFadeOutTime(){return this._fadeOutSeconds}getFadeInTime(){return this._fadeInSeconds}setWeight(e){this._weight=e}getWeight(){return this._weight}getDuration(){return-1}getLoopDuration(){return-1}setOffsetTime(e){this._offsetSeconds=e}setLoop(e){this._isLoop=e}getLoop(){return this._isLoop}setLoopFadeIn(e){this._isLoopFadeIn=e}getLoopFadeIn(){return this._isLoopFadeIn}getFiredEvent(e,r){return this._firedEventValues}setBeganMotionHandler=e=>this._onBeganMotion=e;getBeganMotionHandler=()=>this._onBeganMotion;setFinishedMotionHandler=e=>this._onFinishedMotion=e;getFinishedMotionHandler=()=>this._onFinishedMotion;isExistModelOpacity(){return!1}getModelOpacityIndex(){return-1}getModelOpacityId(e){return null}getModelOpacityValue(){return 1}adjustEndTime(e){let r=this.getDuration(),n=r<=0?-1:e.getStartTime()+r;e.setEndTime(n)}_fadeInSeconds;_fadeOutSeconds;_weight;_offsetSeconds;_isLoop;_isLoopFadeIn;_previousLoopState;_firedEventValues;_onBeganMotion;_onFinishedMotion},z_;(e=>e.ACubismMotion=Qe)(z_||={});var Un=class{constructor(){this._autoDelete=!1,this._motion=null,this._available=!0,this._finished=!1,this._started=!1,this._startTimeSeconds=-1,this._fadeInStartTimeSeconds=0,this._endTimeSeconds=-1,this._stateTimeSeconds=0,this._stateWeight=0,this._lastEventCheckSeconds=0,this._motionQueueEntryHandle=this,this._fadeOutSeconds=0,this._isTriggeredFadeOut=!1}release(){this._autoDelete&&this._motion&&Qe.delete(this._motion)}setFadeOut(e){this._fadeOutSeconds=e,this._isTriggeredFadeOut=!0}startFadeOut(e,r){let n=r+e;this._isTriggeredFadeOut=!0,(this._endTimeSeconds<0||n<this._endTimeSeconds)&&(this._endTimeSeconds=n)}isFinished(){return this._finished}isStarted(){return this._started}getStartTime(){return this._startTimeSeconds}getFadeInStartTime(){return this._fadeInStartTimeSeconds}getEndTime(){return this._endTimeSeconds}setStartTime(e){this._startTimeSeconds=e}setFadeInStartTime(e){this._fadeInStartTimeSeconds=e}setEndTime(e){this._endTimeSeconds=e}setIsFinished(e){this._finished=e}setIsStarted(e){this._started=e}isAvailable(){return this._available}setIsAvailable(e){this._available=e}setState(e,r){this._stateTimeSeconds=e,this._stateWeight=r}getStateTime(){return this._stateTimeSeconds}getStateWeight(){return this._stateWeight}getLastCheckEventSeconds(){return this._lastEventCheckSeconds}setLastCheckEventSeconds(e){this._lastEventCheckSeconds=e}isTriggeredFadeOut(){return this._isTriggeredFadeOut}getFadeOutSeconds(){return this._fadeOutSeconds}getCubismMotion(){return this._motion}_autoDelete;_motion;_available;_finished;_started;_startTimeSeconds;_fadeInStartTimeSeconds;_endTimeSeconds;_stateTimeSeconds;_stateWeight;_lastEventCheckSeconds;_fadeOutSeconds;_isTriggeredFadeOut;_motionQueueEntryHandle},H_;(e=>e.CubismMotionQueueEntry=Un)(H_||={});var Pr=class{constructor(){this._userTimeSeconds=0,this._eventCallBack=null,this._eventCustomData=null,this._motions=new Array}release(){for(let e=0;e<this._motions.length;++e)this._motions[e]&&(this._motions[e].release(),this._motions[e]=null);this._motions=null}startMotion(e,r,n){if(e==null)return Yt;let i=null;for(let s=0;s<this._motions.length;++s)i=this._motions[s],i?.setFadeOut(i._motion.getFadeOutTime());return i=new Un,i._autoDelete=r,i._motion=e,this._motions.push(i),i._motionQueueEntryHandle}isFinished(){for(let e=0;e<this._motions.length;){let r=this._motions[e];if(r==null){this._motions.splice(e,1);continue}if(r._motion==null){r.release(),r=null,this._motions.splice(e,1);continue}if(r.isFinished())e++;else return!1}return!0}isFinishedByHandle(e){for(let r=0;r<this._motions.length;r++){let n=this._motions[r];if(n!=null&&n._motionQueueEntryHandle==e&&!n.isFinished())return!1}return!0}stopAllMotions(){for(let e=0;e<this._motions.length;e++){let r=this._motions[e];if(r==null){this._motions.splice(e,1);continue}r.release(),this._motions.splice(e,1)}}getCubismMotionQueueEntries(){return this._motions}getCubismMotionQueueEntry(e){for(let r=0;r<this._motions.length;r++){let n=this._motions[r];if(n!=null&&n._motionQueueEntryHandle==e)return n}return null}setEventCallback(e,r=null){this._eventCallBack=e,this._eventCustomData=r}doUpdateMotion(e,r){let n=!1;for(let i=0;i<this._motions.length;){let s=this._motions[i];if(s==null){this._motions.splice(i,1);continue}let o=s._motion;if(o==null){s.release(),s=null,this._motions.splice(i,1);continue}o.updateParameters(e,s,r),n=!0;let l=o.getFiredEvent(s.getLastCheckEventSeconds()-s.getStartTime(),r-s.getStartTime());for(let a=0;a<l.length;++a)this._eventCallBack(this,l[a],this._eventCustomData);s.setLastCheckEventSeconds(r),s.isFinished()?(s.release(),s=null,this._motions.splice(i,1)):(s.isTriggeredFadeOut()&&s.startFadeOut(s.getFadeOutSeconds(),r),i++)}return n}_userTimeSeconds;_motions;_eventCallBack;_eventCustomData},Yt=-1,j_;(r=>(r.CubismMotionQueueManager=Pr,r.InvalidMotionQueueEntryHandleValue=Yt))(j_||={});function be(t,e,r=null,n=null){if(t.length<e)if(n)for(let s=t.length;s<e;s++)typeof r=="function"?t[s]=JSON.parse(JSON.stringify(new r)):t[s]=r;else for(let s=t.length;s<e;s++)t[s]=r;else t.length=e}var De=class{static copyBuffer(e,r,n){if(r==null||n==null)return;if(!(e instanceof WebGL2RenderingContext))throw new Error("WebGL2RenderingContext is required for buffer copy.");let i=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.READ_FRAMEBUFFER,r.getRenderTexture()),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,n.getRenderTexture()),e.blitFramebuffer(0,0,r.getBufferWidth(),r.getBufferHeight(),0,0,n.getBufferWidth(),n.getBufferHeight(),e.COLOR_BUFFER_BIT,e.NEAREST),e.bindFramebuffer(e.FRAMEBUFFER,i)}beginDraw(e=null){if(this._renderTexture==null){console.error("_renderTexture is null");return}e==null?this._oldFbo=this._gl.getParameter(this._gl.FRAMEBUFFER_BINDING):this._oldFbo=e,this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,this._renderTexture)}endDraw(){this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,this._oldFbo)}clear(e,r,n,i){this._gl.clearColor(e,r,n,i),this._gl.clear(this._gl.COLOR_BUFFER_BIT)}createRenderTarget(e,r,n,i){this.destroyRenderTarget(),this._colorBuffer=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this._colorBuffer),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,r,n,0,e.RGBA,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.bindTexture(e.TEXTURE_2D,null);let s=e.createFramebuffer();return s==null?(R("Failed to create framebuffer"),!1):(e.bindFramebuffer(e.FRAMEBUFFER,s),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this._colorBuffer,0),e.checkFramebufferStatus(e.FRAMEBUFFER)!==e.FRAMEBUFFER_COMPLETE?(R("Framebuffer is not complete"),e.bindFramebuffer(e.FRAMEBUFFER,i),e.deleteFramebuffer(s),this.destroyRenderTarget(),!1):(this._renderTexture=s,this._bufferWidth=r,this._bufferHeight=n,this._gl=e,!0))}destroyRenderTarget(){this._colorBuffer&&(this._gl.bindTexture(this._gl.TEXTURE_2D,null),this._gl.deleteTexture(this._colorBuffer),this._colorBuffer=null),this._renderTexture&&(this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,null),this._gl.deleteFramebuffer(this._renderTexture),this._renderTexture=null)}getGL(){return this._gl}getRenderTexture(){return this._renderTexture}getColorBuffer(){return this._colorBuffer}getBufferWidth(){return this._bufferWidth}getBufferHeight(){return this._bufferHeight}isValid(){return this._renderTexture!=null}getOldFBO(){return this._oldFbo}constructor(){this._gl=null,this._colorBuffer=null,this._renderTexture=null,this._bufferWidth=0,this._bufferHeight=0,this._oldFbo=null}_gl;_colorBuffer;_renderTexture;_bufferWidth;_bufferHeight;_oldFbo},Y_;(e=>e.CubismOffscreenSurface_WebGL=De)(Y_||={});var Sc=class{constructor(e=null,r=null,n=!1){this.colorBuffer=e,this.renderTexture=r,this.inUse=n}clear(){this.colorBuffer=null,this.renderTexture=null,this.inUse=!1}getColorBuffer(){return this.colorBuffer}getRenderTexture(){return this.renderTexture}colorBuffer;renderTexture;inUse},Pc=class{constructor(e){this.gl=e,this.offscreenRenderTargetContainers=new Array,this.previousActiveRenderTextureMaxCount=0,this.currentActiveRenderTextureCount=0,this.hasResetThisFrame=!1,this.width=0,this.height=0}release(){if(this.offscreenRenderTargetContainers!=null){for(let e=0;e<this.offscreenRenderTargetContainers.length;++e){let r=this.offscreenRenderTargetContainers[e];this.gl.deleteTexture(r.colorBuffer),this.gl.deleteFramebuffer(r.renderTexture)}this.offscreenRenderTargetContainers.length=0,this.offscreenRenderTargetContainers=null}}gl;offscreenRenderTargetContainers;previousActiveRenderTextureMaxCount;currentActiveRenderTextureCount;hasResetThisFrame;width;height},Jt=class t{constructor(){this._contextManagers=new Map}release(){if(this._contextManagers!=null){for(let e of this._contextManagers.values())e.release();this._contextManagers.clear(),this._contextManagers=null}t._instance=null}static getInstance(){return this._instance==null&&(this._instance=new t),this._instance}getContextManager(e){return this._contextManagers.has(e)||this._contextManagers.set(e,new Pc(e)),this._contextManagers.get(e)}removeContext(e){this._contextManagers.has(e)&&(this._contextManagers.get(e).release(),this._contextManagers.delete(e))}initialize(e,r,n){let i=this.getContextManager(e);if(i.offscreenRenderTargetContainers!=null){for(let s=0;s<i.offscreenRenderTargetContainers.length;++s){let o=i.offscreenRenderTargetContainers[s];i.gl.deleteTexture(o.colorBuffer),i.gl.deleteFramebuffer(o.renderTexture),o.clear()}i.offscreenRenderTargetContainers.length=0}else i.offscreenRenderTargetContainers=new Array;i.width=r,i.height=n,i.previousActiveRenderTextureMaxCount=0,i.currentActiveRenderTextureCount=0,i.hasResetThisFrame=!1}beginFrameProcess(e){let r=this.getContextManager(e);r.hasResetThisFrame||(r.previousActiveRenderTextureMaxCount=0,r.hasResetThisFrame=!0)}endFrameProcess(e){let r=this.getContextManager(e);r.hasResetThisFrame=!1}getContainerSize(e){let r=this.getContextManager(e);return r.offscreenRenderTargetContainers==null?0:r.offscreenRenderTargetContainers.length}getOffscreenRenderTargetContainers(e,r,n,i){let s=this.getContextManager(e);(s.width!=r||s.height!=n||s.offscreenRenderTargetContainers==null)&&this.initialize(e,r,n),this.updateRenderTargetContainerCount(e);let o=this.getUnusedOffscreenRenderTargetContainer(e);return o??this.createOffscreenRenderTargetContainer(e,r,n,i)}getUsingRenderTextureState(e,r){let n=this.getContextManager(e);for(let i=0;i<n.offscreenRenderTargetContainers.length;++i)if(n.offscreenRenderTargetContainers[i].renderTexture==r)return n.offscreenRenderTargetContainers[i].inUse;return!0}startUsingRenderTexture(e,r){let n=this.getContextManager(e);for(let i=0;i<n.offscreenRenderTargetContainers.length;++i)if(n.offscreenRenderTargetContainers[i].renderTexture==r){n.offscreenRenderTargetContainers[i].inUse=!0,this.updateRenderTargetContainerCount(e);break}}stopUsingRenderTexture(e,r){let n=this.getContextManager(e);for(let i=0;i<n.offscreenRenderTargetContainers.length;++i)if(n.offscreenRenderTargetContainers[i].renderTexture==r){n.offscreenRenderTargetContainers[i].inUse=!1,n.currentActiveRenderTextureCount--,n.currentActiveRenderTextureCount<0&&(n.currentActiveRenderTextureCount=0);break}}stopUsingAllRenderTextures(e){let r=this.getContextManager(e);for(let n=0;n<r.offscreenRenderTargetContainers.length;++n)r.offscreenRenderTargetContainers[n].inUse=!1;r.currentActiveRenderTextureCount=0}releaseStaleRenderTextures(e){let r=this.getContextManager(e),n=r.offscreenRenderTargetContainers.length;if(r.hasResetThisFrame||n===0)return;let i=0,s=r.previousActiveRenderTextureMaxCount;for(let o=n;r.previousActiveRenderTextureMaxCount<o;--o){let l=o-1;if(r.offscreenRenderTargetContainers[l].inUse){let u=!1;for(;i<r.previousActiveRenderTextureMaxCount;++i)if(!r.offscreenRenderTargetContainers[i].inUse){let d=r.offscreenRenderTargetContainers[i];r.offscreenRenderTargetContainers[i]=r.offscreenRenderTargetContainers[l],r.offscreenRenderTargetContainers[i].inUse=!0,r.offscreenRenderTargetContainers[l]=d,r.offscreenRenderTargetContainers[l].inUse=!1,u=!0;break}if(!u){s=o;break}}let a=r.offscreenRenderTargetContainers[l];r.gl.bindTexture(r.gl.TEXTURE_2D,null),r.gl.deleteTexture(a.colorBuffer),r.gl.bindFramebuffer(r.gl.FRAMEBUFFER,null),r.gl.deleteFramebuffer(a.renderTexture),a.clear()}be(r.offscreenRenderTargetContainers,s)}getPreviousActiveRenderTextureCount(e){return this.getContextManager(e).previousActiveRenderTextureMaxCount}getCurrentActiveRenderTextureCount(e){return this.getContextManager(e).currentActiveRenderTextureCount}updateRenderTargetContainerCount(e){let r=this.getContextManager(e);++r.currentActiveRenderTextureCount,r.previousActiveRenderTextureMaxCount=r.currentActiveRenderTextureCount>r.previousActiveRenderTextureMaxCount?r.currentActiveRenderTextureCount:r.previousActiveRenderTextureMaxCount}getUnusedOffscreenRenderTargetContainer(e){let r=this.getContextManager(e);for(let n=0;n<r.offscreenRenderTargetContainers.length;++n){let i=r.offscreenRenderTargetContainers[n];if(i.inUse==!1)return i.inUse=!0,i}return null}createOffscreenRenderTargetContainer(e,r,n,i){let s=new De;if(!s.createRenderTarget(e,r,n,i))return R("Failed to create offscreen render texture."),null;let o=new Sc(s.getColorBuffer(),s.getRenderTexture(),!0);return this.getContextManager(e).offscreenRenderTargetContainers.push(o),o}static _instance;_contextManagers};var I=Object.freeze({HitAreaPrefix:"HitArea",HitAreaHead:"Head",HitAreaBody:"Body",PartsIdCore:"Parts01Core",PartsArmPrefix:"Parts01Arm_",PartsArmLPrefix:"Parts01ArmL_",PartsArmRPrefix:"Parts01ArmR_",ParamAngleX:"ParamAngleX",ParamAngleY:"ParamAngleY",ParamAngleZ:"ParamAngleZ",ParamEyeLOpen:"ParamEyeLOpen",ParamEyeLSmile:"ParamEyeLSmile",ParamEyeROpen:"ParamEyeROpen",ParamEyeRSmile:"ParamEyeRSmile",ParamEyeBallX:"ParamEyeBallX",ParamEyeBallY:"ParamEyeBallY",ParamEyeBallForm:"ParamEyeBallForm",ParamBrowLY:"ParamBrowLY",ParamBrowRY:"ParamBrowRY",ParamBrowLX:"ParamBrowLX",ParamBrowRX:"ParamBrowRX",ParamBrowLAngle:"ParamBrowLAngle",ParamBrowRAngle:"ParamBrowRAngle",ParamBrowLForm:"ParamBrowLForm",ParamBrowRForm:"ParamBrowRForm",ParamMouthForm:"ParamMouthForm",ParamMouthOpenY:"ParamMouthOpenY",ParamCheek:"ParamCheek",ParamBodyAngleX:"ParamBodyAngleX",ParamBodyAngleY:"ParamBodyAngleY",ParamBodyAngleZ:"ParamBodyAngleZ",ParamBreath:"ParamBreath",ParamArmLA:"ParamArmLA",ParamArmRA:"ParamArmRA",ParamArmLB:"ParamArmLB",ParamArmRB:"ParamArmRB",ParamHandL:"ParamHandL",ParamHandR:"ParamHandR",ParamHairFront:"ParamHairFront",ParamHairSide:"ParamHairSide",ParamHairBack:"ParamHairBack",ParamHairFluffy:"ParamHairFluffy",ParamShoulderY:"ParamShoulderY",ParamBustX:"ParamBustX",ParamBustY:"ParamBustY",ParamBaseX:"ParamBaseX",ParamBaseY:"ParamBaseY",ParamNONE:"NONE:"}),q_;(V=>(V.HitAreaBody=I.HitAreaBody,V.HitAreaHead=I.HitAreaHead,V.HitAreaPrefix=I.HitAreaPrefix,V.ParamAngleX=I.ParamAngleX,V.ParamAngleY=I.ParamAngleY,V.ParamAngleZ=I.ParamAngleZ,V.ParamArmLA=I.ParamArmLA,V.ParamArmLB=I.ParamArmLB,V.ParamArmRA=I.ParamArmRA,V.ParamArmRB=I.ParamArmRB,V.ParamBaseX=I.ParamBaseX,V.ParamBaseY=I.ParamBaseY,V.ParamBodyAngleX=I.ParamBodyAngleX,V.ParamBodyAngleY=I.ParamBodyAngleY,V.ParamBodyAngleZ=I.ParamBodyAngleZ,V.ParamBreath=I.ParamBreath,V.ParamBrowLAngle=I.ParamBrowLAngle,V.ParamBrowLForm=I.ParamBrowLForm,V.ParamBrowLX=I.ParamBrowLX,V.ParamBrowLY=I.ParamBrowLY,V.ParamBrowRAngle=I.ParamBrowRAngle,V.ParamBrowRForm=I.ParamBrowRForm,V.ParamBrowRX=I.ParamBrowRX,V.ParamBrowRY=I.ParamBrowRY,V.ParamBustX=I.ParamBustX,V.ParamBustY=I.ParamBustY,V.ParamCheek=I.ParamCheek,V.ParamEyeBallForm=I.ParamEyeBallForm,V.ParamEyeBallX=I.ParamEyeBallX,V.ParamEyeBallY=I.ParamEyeBallY,V.ParamEyeLOpen=I.ParamEyeLOpen,V.ParamEyeLSmile=I.ParamEyeLSmile,V.ParamEyeROpen=I.ParamEyeROpen,V.ParamEyeRSmile=I.ParamEyeRSmile,V.ParamHairBack=I.ParamHairBack,V.ParamHairFluffy=I.ParamHairFluffy,V.ParamHairFront=I.ParamHairFront,V.ParamHairSide=I.ParamHairSide,V.ParamHandL=I.ParamHandL,V.ParamHandR=I.ParamHandR,V.ParamMouthForm=I.ParamMouthForm,V.ParamMouthOpenY=I.ParamMouthOpenY,V.ParamNONE=I.ParamNONE,V.ParamShoulderY=I.ParamShoulderY,V.PartsArmLPrefix=I.PartsArmLPrefix,V.PartsArmPrefix=I.PartsArmPrefix,V.PartsArmRPrefix=I.PartsArmRPrefix,V.PartsIdCore=I.PartsIdCore))(q_||={});var Gn=class{},K_;(e=>e.ICubismModelSetting=Gn)(K_||={});var wc=(a=>(a[a.FrequestNode_Groups=0]="FrequestNode_Groups",a[a.FrequestNode_Moc=1]="FrequestNode_Moc",a[a.FrequestNode_Motions=2]="FrequestNode_Motions",a[a.FrequestNode_Expressions=3]="FrequestNode_Expressions",a[a.FrequestNode_Textures=4]="FrequestNode_Textures",a[a.FrequestNode_Physics=5]="FrequestNode_Physics",a[a.FrequestNode_Pose=6]="FrequestNode_Pose",a[a.FrequestNode_HitAreas=7]="FrequestNode_HitAreas",a))(wc||{}),zn=class extends Gn{constructor(e,r){super(),this._json=se.create(e,r),this.getJson()&&(this._jsonValue=[this.getJson().getRoot().getValueByString(this.groups),this.getJson().getRoot().getValueByString(this.fileReferences).getValueByString(this.moc),this.getJson().getRoot().getValueByString(this.fileReferences).getValueByString(this.motions),this.getJson().getRoot().getValueByString(this.fileReferences).getValueByString(this.expressions),this.getJson().getRoot().getValueByString(this.fileReferences).getValueByString(this.textures),this.getJson().getRoot().getValueByString(this.fileReferences).getValueByString(this.physics),this.getJson().getRoot().getValueByString(this.fileReferences).getValueByString(this.pose),this.getJson().getRoot().getValueByString(this.hitAreas)])}release(){se.delete(this._json),this._jsonValue=null}getJson(){return this._json}getModelFileName(){return this.isExistModelFile()?this._jsonValue[1].getRawString():""}getTextureCount(){return this.isExistTextureFiles()?this._jsonValue[4].getSize():0}getTextureDirectory(){let r=this._jsonValue[4].getValueByIndex(0).getRawString().split("/"),n=r.length-1,i="";for(let s=0;s<n;s++)i+=r[s],s<n-1&&(i+="/");return i}getTextureFileName(e){return this._jsonValue[4].getValueByIndex(e).getRawString()}getHitAreasCount(){return this.isExistHitAreas()?this._jsonValue[7].getSize():0}getHitAreaId(e){return B.getIdManager().getId(this._jsonValue[7].getValueByIndex(e).getValueByString(this.id).getRawString())}getHitAreaName(e){return this._jsonValue[7].getValueByIndex(e).getValueByString(this.name).getRawString()}getPhysicsFileName(){return this.isExistPhysicsFile()?this._jsonValue[5].getRawString():""}getPoseFileName(){return this.isExistPoseFile()?this._jsonValue[6].getRawString():""}getExpressionCount(){return this.isExistExpressionFile()?this._jsonValue[3].getSize():0}getExpressionName(e){return this._jsonValue[3].getValueByIndex(e).getValueByString(this.name).getRawString()}getExpressionFileName(e){return this._jsonValue[3].getValueByIndex(e).getValueByString(this.filePath).getRawString()}getMotionGroupCount(){return this.isExistMotionGroups()?this._jsonValue[2].getKeys().length:0}getMotionGroupName(e){return this.isExistMotionGroups()?this._jsonValue[2].getKeys()[e]:null}getMotionCount(e){return this.isExistMotionGroupName(e)?this._jsonValue[2].getValueByString(e).getSize():0}getMotionFileName(e,r){return this.isExistMotionGroupName(e)?this._jsonValue[2].getValueByString(e).getValueByIndex(r).getValueByString(this.filePath).getRawString():""}getMotionSoundFileName(e,r){return this.isExistMotionSoundFile(e,r)?this._jsonValue[2].getValueByString(e).getValueByIndex(r).getValueByString(this.soundPath).getRawString():""}getMotionFadeInTimeValue(e,r){return this.isExistMotionFadeIn(e,r)?this._jsonValue[2].getValueByString(e).getValueByIndex(r).getValueByString(this.fadeInTime).toFloat():-1}getMotionFadeOutTimeValue(e,r){return this.isExistMotionFadeOut(e,r)?this._jsonValue[2].getValueByString(e).getValueByIndex(r).getValueByString(this.fadeOutTime).toFloat():-1}getUserDataFile(){return this.isExistUserDataFile()?this.getJson().getRoot().getValueByString(this.fileReferences).getValueByString(this.userData).getRawString():""}getLayoutMap(e){let r=this.getJson().getRoot().getValueByString(this.layout).getMap();if(r==null)return!1;let n=!1;for(let i of r)e.set(i[0],i[1].toFloat()),n=!0;return n}getEyeBlinkParameterCount(){if(!this.isExistEyeBlinkParameters())return 0;let e=0;for(let r=0;r<this._jsonValue[0].getSize();r++){let n=this._jsonValue[0].getValueByIndex(r);if(!(n.isNull()||n.isError())&&n.getValueByString(this.name).getRawString()==this.eyeBlink){e=n.getValueByString(this.ids).getVector().length;break}}return e}getEyeBlinkParameterId(e){if(!this.isExistEyeBlinkParameters())return null;for(let r=0;r<this._jsonValue[0].getSize();r++){let n=this._jsonValue[0].getValueByIndex(r);if(!(n.isNull()||n.isError())&&n.getValueByString(this.name).getRawString()==this.eyeBlink)return B.getIdManager().getId(n.getValueByString(this.ids).getValueByIndex(e).getRawString())}return null}getLipSyncParameterCount(){if(!this.isExistLipSyncParameters())return 0;let e=0;for(let r=0;r<this._jsonValue[0].getSize();r++){let n=this._jsonValue[0].getValueByIndex(r);if(!(n.isNull()||n.isError())&&n.getValueByString(this.name).getRawString()==this.lipSync){e=n.getValueByString(this.ids).getVector().length;break}}return e}getLipSyncParameterId(e){if(!this.isExistLipSyncParameters())return null;for(let r=0;r<this._jsonValue[0].getSize();r++){let n=this._jsonValue[0].getValueByIndex(r);if(!(n.isNull()||n.isError())&&n.getValueByString(this.name).getRawString()==this.lipSync)return B.getIdManager().getId(n.getValueByString(this.ids).getValueByIndex(e).getRawString())}return null}isExistModelFile(){let e=this._jsonValue[1];return!e.isNull()&&!e.isError()}isExistTextureFiles(){let e=this._jsonValue[4];return!e.isNull()&&!e.isError()}isExistHitAreas(){let e=this._jsonValue[7];return!e.isNull()&&!e.isError()}isExistPhysicsFile(){let e=this._jsonValue[5];return!e.isNull()&&!e.isError()}isExistPoseFile(){let e=this._jsonValue[6];return!e.isNull()&&!e.isError()}isExistExpressionFile(){let e=this._jsonValue[3];return!e.isNull()&&!e.isError()}isExistMotionGroups(){let e=this._jsonValue[2];return!e.isNull()&&!e.isError()}isExistMotionGroupName(e){let r=this._jsonValue[2].getValueByString(e);return!r.isNull()&&!r.isError()}isExistMotionSoundFile(e,r){let n=this._jsonValue[2].getValueByString(e).getValueByIndex(r).getValueByString(this.soundPath);return!n.isNull()&&!n.isError()}isExistMotionFadeIn(e,r){let n=this._jsonValue[2].getValueByString(e).getValueByIndex(r).getValueByString(this.fadeInTime);return!n.isNull()&&!n.isError()}isExistMotionFadeOut(e,r){let n=this._jsonValue[2].getValueByString(e).getValueByIndex(r).getValueByString(this.fadeOutTime);return!n.isNull()&&!n.isError()}isExistUserDataFile(){let e=this.getJson().getRoot().getValueByString(this.fileReferences).getValueByString(this.userData);return!e.isNull()&&!e.isError()}isExistEyeBlinkParameters(){if(this._jsonValue[0].isNull()||this._jsonValue[0].isError())return!1;for(let e=0;e<this._jsonValue[0].getSize();++e)if(this._jsonValue[0].getValueByIndex(e).getValueByString(this.name).getRawString()==this.eyeBlink)return!0;return!1}isExistLipSyncParameters(){if(this._jsonValue[0].isNull()||this._jsonValue[0].isError())return!1;for(let e=0;e<this._jsonValue[0].getSize();++e)if(this._jsonValue[0].getValueByIndex(e).getValueByString(this.name).getRawString()==this.lipSync)return!0;return!1}_json;_jsonValue;version="Version";fileReferences="FileReferences";groups="Groups";layout="Layout";hitAreas="HitAreas";moc="Moc";textures="Textures";physics="Physics";pose="Pose";expressions="Expressions";motions="Motions";userData="UserData";name="Name";filePath="File";id="Id";ids="Ids";target="Target";idle="Idle";tapBody="TapBody";pinchIn="PinchIn";pinchOut="PinchOut";shake="Shake";flickHead="FlickHead";parameter="Parameter";soundPath="Sound";fadeInTime="FadeInTime";fadeOutTime="FadeOutTime";centerX="CenterX";centerY="CenterY";x="X";y="Y";width="Width";height="Height";lipSync="LipSync";eyeBlink="EyeBlink";initParameter="init_param";initPartsVisible="init_parts_visible";val="val"},ey;(r=>(r.CubismModelSettingJson=zn,r.FrequestNode=wc))(ey||={});var wr=class t{static create(){return new t}static delete(e){e!=null&&(e=null)}setParameters(e){this._breathParameters=e}getParameters(){return this._breathParameters}updateParameters(e,r){this._currentTime+=r;let n=this._currentTime*2*Math.PI;for(let i=0;i<this._breathParameters.length;++i){let s=this._breathParameters[i];e.addParameterValueById(s.parameterId,s.offset+s.peak*Math.sin(n/s.cycle),s.weight)}}constructor(){this._currentTime=0}_breathParameters;_currentTime},It=class{constructor(e,r,n,i,s){this.parameterId=e??null,this.offset=r??0,this.peak=n??0,this.cycle=i??0,this.weight=s??0}parameterId;offset;peak;cycle;weight},ry;(r=>(r.BreathParameterData=It,r.CubismBreath=wr))(ry||={});var Xr=class t{static create(){return new t}static delete(e){e!=null&&(e=null)}setParameters(e){this._lookParameters=e}getParameters(){return this._lookParameters}updateParameters(e,r,n){for(let i=0;i<this._lookParameters.length;++i){let s=this._lookParameters[i];e.addParameterValueById(s.parameterId,s.factorX*r+s.factorY*n+s.factorXY*r*n)}}constructor(){this._lookParameters=new Array}_lookParameters},_t=class{constructor(e,r,n,i){this.parameterId=e??null,this.factorX=r??0,this.factorY=n??0,this.factorXY=i??0}parameterId;factorX;factorY;factorXY},iy;(r=>(r.LookParameterData=_t,r.CubismLook=Xr))(iy||={});var Tr=class t{static create(e=null){return new t(e)}static delete(e){e!=null&&(e=null)}setBlinkingInterval(e){this._blinkingIntervalSeconds=e}setBlinkingSetting(e,r,n){this._closingSeconds=e,this._closedSeconds=r,this._openingSeconds=n}setParameterIds(e){this._parameterIds=e}getParameterIds(){return this._parameterIds}updateParameters(e,r){this._userTimeSeconds+=r;let n,i=0;switch(this._blinkingState){case 2:i=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._closingSeconds,i>=1&&(i=1,this._blinkingState=3,this._stateStartTimeSeconds=this._userTimeSeconds),n=1-i;break;case 3:i=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._closedSeconds,i>=1&&(this._blinkingState=4,this._stateStartTimeSeconds=this._userTimeSeconds),n=0;break;case 4:i=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._openingSeconds,i>=1&&(i=1,this._blinkingState=1,this._nextBlinkingTime=this.determinNextBlinkingTiming()),n=i;break;case 1:this._nextBlinkingTime<this._userTimeSeconds&&(this._blinkingState=2,this._stateStartTimeSeconds=this._userTimeSeconds),n=1;break;default:this._blinkingState=1,this._nextBlinkingTime=this.determinNextBlinkingTiming(),n=1;break}t.CloseIfZero||(n=-n);for(let o=0;o<this._parameterIds.length;++o)e.setParameterValueById(this._parameterIds[o],n)}constructor(e){if(this._blinkingState=0,this._nextBlinkingTime=0,this._stateStartTimeSeconds=0,this._blinkingIntervalSeconds=4,this._closingSeconds=.1,this._closedSeconds=.05,this._openingSeconds=.15,this._userTimeSeconds=0,this._parameterIds=new Array,e!=null){this._parameterIds.length=e.getEyeBlinkParameterCount();for(let r=0;r<e.getEyeBlinkParameterCount();++r)this._parameterIds[r]=e.getEyeBlinkParameterId(r)}}determinNextBlinkingTiming(){let e=Math.random();return this._userTimeSeconds+e*(2*this._blinkingIntervalSeconds-1)}_blinkingState;_parameterIds;_nextBlinkingTime;_stateStartTimeSeconds;_blinkingIntervalSeconds;_closingSeconds;_closedSeconds;_openingSeconds;_userTimeSeconds;static CloseIfZero=!0},Tc=(s=>(s[s.EyeState_First=0]="EyeState_First",s[s.EyeState_Interval=1]="EyeState_Interval",s[s.EyeState_Closing=2]="EyeState_Closing",s[s.EyeState_Closed=3]="EyeState_Closed",s[s.EyeState_Opening=4]="EyeState_Opening",s))(Tc||{}),oy;(r=>(r.CubismEyeBlink=Tr,r.EyeState=Tc))(oy||={});var ly=.001,Lc=.5,ef="FadeInTime",tf="Link",uy="Groups",cy="Id",Yr=class t{static create(e,r){let n=se.create(e,r);if(!n)return null;let i=new t,s=n.getRoot();s.getValueByString(ef).isNull()||(i._fadeTimeSeconds=s.getValueByString(ef).toFloat(Lc),i._fadeTimeSeconds<0&&(i._fadeTimeSeconds=Lc));let o=s.getValueByString(uy),l=o.getSize();i._partGroupCounts.length=l;for(let a=0;a<l;++a){let u=o.getValueByIndex(a),d=u.getSize(),c=0;for(let p=0;p<d;++p){let _=u.getValueByIndex(p),m=new Wn,f=B.getIdManager().getId(_.getValueByString(cy).getRawString());if(m.partId=f,!_.getValueByString(tf).isNull()){let y=_.getValueByString(tf),b=y.getSize();for(let g=0;g<b;++g){let h=new Wn,C=B.getIdManager().getId(y.getValueByIndex(g).getString());h.partId=C,m.link.push(h)}}i._partGroups.push(m.clone()),++c}i._partGroupCounts[a]=c}return se.delete(n),i}static delete(e){e!=null&&(e=null)}updateParameters(e,r){e!=this._lastModel&&this.reset(e),this._lastModel=e,r<0&&(r=0);let n=0;for(let i=0;i<this._partGroupCounts.length;i++){let s=this._partGroupCounts[i];this.doFade(e,r,n,s),n+=s}this.copyPartOpacities(e)}reset(e){let r=0;for(let n=0;n<this._partGroupCounts.length;++n){let i=this._partGroupCounts[n];for(let s=r;s<r+i;++s){this._partGroups[s].initialize(e);let o=this._partGroups[s].partIndex,l=this._partGroups[s].parameterIndex;if(!(o<0)){e.setPartOpacityByIndex(o,s==r?1:0),e.setParameterValueByIndex(l,s==r?1:0);for(let a=0;a<this._partGroups[s].link.length;++a)this._partGroups[s].link[a].initialize(e)}}r+=i}}copyPartOpacities(e){for(let r=0;r<this._partGroups.length;++r){let n=this._partGroups[r];if(n.link.length==0)continue;let i=this._partGroups[r].partIndex,s=e.getPartOpacityByIndex(i);for(let o=0;o<n.link.length;++o){let a=n.link[o].partIndex;a<0||e.setPartOpacityByIndex(a,s)}}}doFade(e,r,n,i){let s=-1,o=1,l=.5,a=.15;for(let u=n;u<n+i;++u){let d=this._partGroups[u].partIndex,c=this._partGroups[u].parameterIndex;if(e.getParameterValueByIndex(c)>ly){if(s>=0)break;if(s=u,this._fadeTimeSeconds==0){o=1;continue}o=e.getPartOpacityByIndex(d),o+=r/this._fadeTimeSeconds,o>1&&(o=1)}}s<0&&(s=0,o=1);for(let u=n;u<n+i;++u){let d=this._partGroups[u].partIndex;if(s==u)e.setPartOpacityByIndex(d,o);else{let c=e.getPartOpacityByIndex(d),p;o<l?p=o*(l-1)/l+1:p=(1-o)*l/(1-l),(1-p)*(1-o)>a&&(p=1-a/(1-o)),c>p&&(c=p),e.setPartOpacityByIndex(d,c)}}}constructor(){this._fadeTimeSeconds=Lc,this._lastModel=null,this._partGroups=new Array,this._partGroupCounts=new Array}_partGroups;_partGroupCounts;_fadeTimeSeconds;_lastModel},Wn=class t{constructor(e){if(this.parameterIndex=0,this.partIndex=0,this.link=new Array,e!=null){this.partId=e.partId,this.link.length=e.link.length;for(let r=0;r<e.link.length;r++)this.link[r]=e.link[r].clone()}}assignment(e){this.partId=e.partId;let r=this.link.length;this.link.length+=e.link.length;for(let n of e.link)this.link[r++]=n.clone();return this}initialize(e){this.parameterIndex=e.getParameterIndex(this.partId),this.partIndex=e.getPartIndex(this.partId),e.setParameterValueByIndex(this.parameterIndex,1)}clone(){let e=new t;e.partId=this.partId,e.parameterIndex=this.parameterIndex,e.partIndex=this.partIndex,e.link=new Array,e.link.length=this.link.length;for(let r=0;r<this.link.length;r++)e.link[r]=this.link[r].clone();return e}partId;parameterIndex;partIndex;link},dy;(r=>(r.CubismPose=Yr,r.PartData=Wn))(dy||={});var Hn=class extends W{constructor(e,r){super(),this._width=e!==void 0?e:0,this._height=r!==void 0?r:0,this.setHeight(2)}setWidth(e){let r=e/this._width,n=r;this.scale(r,n)}setHeight(e){let r=e/this._height,n=r;this.scale(r,n)}setPosition(e,r){this.translate(e,r)}setCenterPosition(e,r){this.centerX(e),this.centerY(r)}top(e){this.setY(e)}bottom(e){let r=this._height*this.getScaleY();this.translateY(e-r)}left(e){this.setX(e)}right(e){let r=this._width*this.getScaleX();this.translateX(e-r)}centerX(e){let r=this._width*this.getScaleX();this.translateX(e-r/2)}setX(e){this.translateX(e)}centerY(e){let r=this._height*this.getScaleY();this.translateY(e-r/2)}setY(e){this.translateY(e)}setupFromLayout(e){let r="width",n="height",o="center_x",l="center_y",u="bottom",d="left",c="right";for(let p of e){let _=p[0],m=p[1];_==r?this.setWidth(m):_==n&&this.setHeight(m)}for(let p of e){let _=p[0],m=p[1];_=="x"?this.setX(m):_=="y"?this.setY(m):_==o?this.centerX(m):_==l?this.centerY(m):_=="top"?this.top(m):_==u?this.bottom(m):_==d?this.left(m):_==c&&this.right(m)}}_width;_height},hy;(e=>e.CubismModelMatrix=Hn)(hy||={});var Bc=30,rf=.01,$n=class{constructor(){this._faceTargetX=0,this._faceTargetY=0,this._faceX=0,this._faceY=0,this._faceVX=0,this._faceVY=0,this._lastTimeSeconds=0,this._userTimeSeconds=0}update(e){this._userTimeSeconds+=e;let n=40/10*1/Bc;if(this._lastTimeSeconds==0){this._lastTimeSeconds=this._userTimeSeconds;return}let i=(this._userTimeSeconds-this._lastTimeSeconds)*Bc;this._lastTimeSeconds=this._userTimeSeconds;let o=.15*Bc,l=i*n/o,a=this._faceTargetX-this._faceX,u=this._faceTargetY-this._faceY;if(L.abs(a)<=rf&&L.abs(u)<=rf)return;let d=L.sqrt(a*a+u*u),c=n*a/d,p=n*u/d,_=c-this._faceVX,m=p-this._faceVY,f=L.sqrt(_*_+m*m);(f<-l||f>l)&&(_*=l/f,m*=l/f),this._faceVX+=_,this._faceVY+=m;{let y=.5*(L.sqrt(l*l+16*l*d-8*l*d)-l),b=L.sqrt(this._faceVX*this._faceVX+this._faceVY*this._faceVY);b>y&&(this._faceVX*=y/b,this._faceVY*=y/b)}this._faceX+=this._faceVX,this._faceY+=this._faceVY}getX(){return this._faceX}getY(){return this._faceY}set(e,r){this._faceTargetX=e,this._faceTargetY=r}_faceTargetX;_faceTargetY;_faceX;_faceY;_faceVX;_faceVY;_lastTimeSeconds;_userTimeSeconds},fy;(e=>e.CubismTargetPoint=$n)(fy||={});var by="FadeInTime",_y="FadeOutTime",nf="Parameters",yy="Id",Cy="Value",Ma="Blend",vy="Add",xy="Multiply",My="Overwrite",sf=1,yt=class t extends Qe{static DefaultAdditiveValue=0;static DefaultMultiplyValue=1;static create(e,r){let n=new t;return n.parse(e,r),n}doUpdateParameters(e,r,n,i){for(let s=0;s<this._parameters.length;++s){let o=this._parameters[s];switch(o.blendType){case 0:{e.addParameterValueById(o.parameterId,o.value,n);break}case 1:{e.multiplyParameterValueById(o.parameterId,o.value,n);break}case 2:{e.setParameterValueById(o.parameterId,o.value,n);break}default:break}}}calculateExpressionParameters(e,r,n,i,s,o){if(!(n==null||i==null)&&n.isAvailable())for(let l=0;l<i.length;++l){let a=i[l];if(a.parameterId==null)continue;let u=a.overwriteValue=e.getParameterValueById(a.parameterId),d=this.getExpressionParameters(),c=-1;for(let y=0;y<d.length;++y)if(a.parameterId==d[y].parameterId){c=y;break}if(c<0){s==0?(a.additiveValue=t.DefaultAdditiveValue,a.multiplyValue=t.DefaultMultiplyValue,a.overwriteValue=u):(a.additiveValue=this.calculateValue(a.additiveValue,t.DefaultAdditiveValue,o),a.multiplyValue=this.calculateValue(a.multiplyValue,t.DefaultMultiplyValue,o),a.overwriteValue=this.calculateValue(a.overwriteValue,u,o));continue}let p=d[c].value,_,m,f;switch(d[c].blendType){case 0:_=p,m=t.DefaultMultiplyValue,f=u;break;case 1:_=t.DefaultAdditiveValue,m=p,f=u;break;case 2:_=t.DefaultAdditiveValue,m=t.DefaultMultiplyValue,f=p;break;default:return}s==0?(a.additiveValue=_,a.multiplyValue=m,a.overwriteValue=f):(a.additiveValue=a.additiveValue*(1-o)+_*o,a.multiplyValue=a.multiplyValue*(1-o)+m*o,a.overwriteValue=a.overwriteValue*(1-o)+f*o)}}getExpressionParameters(){return this._parameters}parse(e,r){let n=se.create(e,r);if(!n)return;let i=n.getRoot();this.setFadeInTime(i.getValueByString(by).toFloat(sf)),this.setFadeOutTime(i.getValueByString(_y).toFloat(sf));let s=i.getValueByString(nf).getSize(),o=this._parameters.length;this._parameters.length+=s;for(let l=0;l<s;++l){let a=i.getValueByString(nf).getValueByIndex(l),u=B.getIdManager().getId(a.getValueByString(yy).getRawString()),d=a.getValueByString(Cy).toFloat(),c;a.getValueByString(Ma).isNull()||a.getValueByString(Ma).getString()==vy?c=0:a.getValueByString(Ma).getString()==xy?c=1:a.getValueByString(Ma).getString()==My?c=2:c=0;let p=new Ts;p.parameterId=u,p.blendType=c,p.value=d,this._parameters[o++]=p}se.delete(n)}calculateValue(e,r,n){return e*(1-n)+r*n}constructor(){super(),this._parameters=new Array}_parameters},Ic=(n=>(n[n.Additive=0]="Additive",n[n.Multiply=1]="Multiply",n[n.Overwrite=2]="Overwrite",n))(Ic||{}),Ts=class{parameterId;blendType;value},Sy;(n=>(n.CubismExpressionMotion=yt,n.ExpressionBlendType=Ic,n.ExpressionParameter=Ts))(Sy||={});var Rc=class{parameterId;additiveValue;multiplyValue;overwriteValue},jn=class extends Pr{constructor(){super(),this._expressionParameterValues=new Array,this._fadeWeights=new Array}release(){this._expressionParameterValues&&(Xt(this._expressionParameterValues),this._expressionParameterValues=null),this._fadeWeights&&(Xt(this._fadeWeights),this._fadeWeights=null)}getFadeWeight(e){return e<0||this._fadeWeights.length<1||e>=this._fadeWeights.length?(console.warn("Failed to get the fade weight value. The element at that index does not exist."),-1):this._fadeWeights[e]}setFadeWeight(e,r){if(e<0||this._fadeWeights.length<1||this._fadeWeights.length<=e){console.warn("Failed to set the fade weight value. The element at that index does not exist.");return}this._fadeWeights[e]=r}updateMotion(e,r){this._userTimeSeconds+=r;let n=!1,i=this.getCubismMotionQueueEntries(),s=0,o=0;if(this._fadeWeights.length!==i.length){let l=i.length-this._fadeWeights.length,a=this._fadeWeights.length;this._fadeWeights.length+=l;for(let u=0;u<l;u++)this._fadeWeights[a++]=0}for(let l=0;l<this._motions.length;){let a=this._motions[l];if(a==null){i.splice(l,1);continue}let u=a.getCubismMotion();if(u==null){Xt(a),i.splice(l,1);continue}let d=u.getExpressionParameters();if(a.isAvailable())for(let c=0;c<d.length;++c){if(d[c].parameterId==null)continue;let p=-1;for(let m=0;m<this._expressionParameterValues.length;++m)if(this._expressionParameterValues[m].parameterId==d[c].parameterId){p=m;break}if(p>=0)continue;let _=new Rc;_.parameterId=d[c].parameterId,_.additiveValue=yt.DefaultAdditiveValue,_.multiplyValue=yt.DefaultMultiplyValue,_.overwriteValue=e.getParameterValueById(_.parameterId),this._expressionParameterValues.push(_)}u.setupMotionQueueEntry(a,this._userTimeSeconds),this.setFadeWeight(o,u.updateFadeWeight(a,this._userTimeSeconds)),u.calculateExpressionParameters(e,this._userTimeSeconds,a,this._expressionParameterValues,o,this.getFadeWeight(o)),s+=u.getFadeInTime()==0?1:L.getEasingSine((this._userTimeSeconds-a.getFadeInStartTime())/u.getFadeInTime()),n=!0,a.isTriggeredFadeOut()&&a.startFadeOut(a.getFadeOutSeconds(),this._userTimeSeconds),++l,++o}if(i.length>1&&this.getFadeWeight(this._fadeWeights.length-1)>=1)for(let a=i.length-2;a>=0;--a){let u=i[a];Xt(u),i.splice(a,1),this._fadeWeights.splice(a,1)}s>1&&(s=1);for(let l=0;l<this._expressionParameterValues.length;++l){let a=this._expressionParameterValues[l];e.setParameterValueById(a.parameterId,(a.overwriteValue+a.additiveValue)*a.multiplyValue,s),a.additiveValue=yt.DefaultAdditiveValue,a.multiplyValue=yt.DefaultMultiplyValue}return n}_expressionParameterValues;_fadeWeights;_startExpressionTime},wy;(e=>e.CubismExpressionMotionManager=jn)(wy||={});var Sa=(n=>(n[n.CubismMotionCurveTarget_Model=0]="CubismMotionCurveTarget_Model",n[n.CubismMotionCurveTarget_Parameter=1]="CubismMotionCurveTarget_Parameter",n[n.CubismMotionCurveTarget_PartOpacity=2]="CubismMotionCurveTarget_PartOpacity",n))(Sa||{}),Ls=(i=>(i[i.CubismMotionSegmentType_Linear=0]="CubismMotionSegmentType_Linear",i[i.CubismMotionSegmentType_Bezier=1]="CubismMotionSegmentType_Bezier",i[i.CubismMotionSegmentType_Stepped=2]="CubismMotionSegmentType_Stepped",i[i.CubismMotionSegmentType_InverseStepped=3]="CubismMotionSegmentType_InverseStepped",i))(Ls||{}),qt=class{time=0;value=0},Xn=class{constructor(){this.evaluate=null,this.basePointIndex=0,this.segmentType=0}evaluate;basePointIndex;segmentType},Yn=class{constructor(){this.type=0,this.segmentCount=0,this.baseSegmentIndex=0,this.fadeInTime=0,this.fadeOutTime=0}type;id;segmentCount;baseSegmentIndex;fadeInTime;fadeOutTime},Jn=class{fireTime=0;value},qn=class{constructor(){this.duration=0,this.loop=!1,this.curveCount=0,this.eventCount=0,this.fps=0,this.curves=new Array,this.segments=new Array,this.points=new Array,this.events=new Array}duration;loop;curveCount;eventCount;fps;curves;segments;points;events},Ly;(l=>(l.CubismMotionCurve=Yn,l.CubismMotionCurveTarget=Sa,l.CubismMotionData=qn,l.CubismMotionEvent=Jn,l.CubismMotionPoint=qt,l.CubismMotionSegment=Xn,l.CubismMotionSegmentType=Ls))(Ly||={});var Ke="Meta",Iy="Duration",Ry="Loop",Ey="AreBeziersRestricted",Ay="CurveCount",ky="Fps",Vy="TotalSegmentCount",Oy="TotalPointCount",Qt="Curves",Dy="Target",Fy="Id",Pa="FadeInTime",wa="FadeOutTime",of="Segments",af="UserData",Ny="UserDataCount",Uy="TotalUserDataSize",Gy="Time",zy="Value",Qn=class{constructor(e,r){this._json=se.create(e,r)}release(){se.delete(this._json)}getMotionDuration(){return this._json.getRoot().getValueByString(Ke).getValueByString(Iy).toFloat()}isMotionLoop(){return this._json.getRoot().getValueByString(Ke).getValueByString(Ry).toBoolean()}hasConsistency(){let e=!0;if(!this._json||!this._json.getRoot())return!1;let r=this._json.getRoot().getValueByString(Qt).getVector().length,n=0,i=0;for(let s=0;s<r;++s)for(let o=0;o<this.getMotionCurveSegmentCount(s);){switch(o==0&&(i+=1,o+=2),this.getMotionCurveSegment(s,o)){case 0:i+=1,o+=3;break;case 1:i+=3,o+=7;break;case 2:i+=1,o+=3;break;case 3:i+=1,o+=3;break;default:ie(0);break}++n}return r!=this.getMotionCurveCount()&&(Y("The number of curves does not match the metadata."),e=!1),n!=this.getMotionTotalSegmentCount()&&(Y("The number of segment does not match the metadata."),e=!1),i!=this.getMotionTotalPointCount()&&(Y("The number of point does not match the metadata."),e=!1),e}getEvaluationOptionFlag(e){return e==0?this._json.getRoot().getValueByString(Ke).getValueByString(Ey).toBoolean():!1}getMotionCurveCount(){return this._json.getRoot().getValueByString(Ke).getValueByString(Ay).toInt()}getMotionFps(){return this._json.getRoot().getValueByString(Ke).getValueByString(ky).toFloat()}getMotionTotalSegmentCount(){return this._json.getRoot().getValueByString(Ke).getValueByString(Vy).toInt()}getMotionTotalPointCount(){return this._json.getRoot().getValueByString(Ke).getValueByString(Oy).toInt()}isExistMotionFadeInTime(){return!this._json.getRoot().getValueByString(Ke).getValueByString(Pa).isNull()}isExistMotionFadeOutTime(){return!this._json.getRoot().getValueByString(Ke).getValueByString(wa).isNull()}getMotionFadeInTime(){return this._json.getRoot().getValueByString(Ke).getValueByString(Pa).toFloat()}getMotionFadeOutTime(){return this._json.getRoot().getValueByString(Ke).getValueByString(wa).toFloat()}getMotionCurveTarget(e){return this._json.getRoot().getValueByString(Qt).getValueByIndex(e).getValueByString(Dy).getRawString()}getMotionCurveId(e){return B.getIdManager().getId(this._json.getRoot().getValueByString(Qt).getValueByIndex(e).getValueByString(Fy).getRawString())}isExistMotionCurveFadeInTime(e){return!this._json.getRoot().getValueByString(Qt).getValueByIndex(e).getValueByString(Pa).isNull()}isExistMotionCurveFadeOutTime(e){return!this._json.getRoot().getValueByString(Qt).getValueByIndex(e).getValueByString(wa).isNull()}getMotionCurveFadeInTime(e){return this._json.getRoot().getValueByString(Qt).getValueByIndex(e).getValueByString(Pa).toFloat()}getMotionCurveFadeOutTime(e){return this._json.getRoot().getValueByString(Qt).getValueByIndex(e).getValueByString(wa).toFloat()}getMotionCurveSegmentCount(e){return this._json.getRoot().getValueByString(Qt).getValueByIndex(e).getValueByString(of).getVector().length}getMotionCurveSegment(e,r){return this._json.getRoot().getValueByString(Qt).getValueByIndex(e).getValueByString(of).getValueByIndex(r).toFloat()}getEventCount(){return this._json.getRoot().getValueByString(Ke).getValueByString(Ny).toInt()}getTotalEventValueSize(){return this._json.getRoot().getValueByString(Ke).getValueByString(Uy).toInt()}getEventTime(e){return this._json.getRoot().getValueByString(af).getValueByIndex(e).getValueByString(Gy).toFloat()}getEventValue(e){return this._json.getRoot().getValueByString(af).getValueByIndex(e).getValueByString(zy).getRawString()}_json};var Wy;(e=>e.CubismMotionJson=Qn)(Wy||={});var $y="EyeBlink",jy="LipSync",Xy="Model",Yy="Parameter",Jy="PartOpacity",Ta="Opacity",qy=!1;function at(t,e,r){let n=new qt;return n.time=t.time+(e.time-t.time)*r,n.value=t.value+(e.value-t.value)*r,n}function lf(t,e){let r=(e-t[0].time)/(t[1].time-t[0].time);return r<0&&(r=0),t[0].value+(t[1].value-t[0].value)*r}function Qy(t,e){let r=(e-t[0].time)/(t[3].time-t[0].time);r<0&&(r=0);let n=at(t[0],t[1],r),i=at(t[1],t[2],r),s=at(t[2],t[3],r),o=at(n,i,r),l=at(i,s,r);return at(o,l,r).value}function Ky(t,e){let r=e,n=t[0].time,i=t[3].time,s=t[1].time,o=t[2].time,l=i-3*o+3*s-n,a=3*o-6*s+3*n,u=3*s-3*n,d=n-r,c=L.cardanoAlgorithmForBezier(l,a,u,d),p=at(t[0],t[1],c),_=at(t[1],t[2],c),m=at(t[2],t[3],c),f=at(p,_,c),y=at(_,m,c);return at(f,y,c).value}function uf(t,e){return t[0].value}function cf(t,e){return t[1].value}function Ec(t,e,r,n,i){let s=t.curves[e],o=-1,l=s.baseSegmentIndex+s.segmentCount,a=0;for(let d=s.baseSegmentIndex;d<l;++d)if(a=t.segments[d].basePointIndex+(t.segments[d].segmentType==1?3:1),t.points[a].time>r){o=d;break}if(o==-1)return n&&r<i?Zy(t,l-1,t.segments[s.baseSegmentIndex].basePointIndex,a,r,i):t.points[a].value;let u=t.segments[o];return u.evaluate(t.points.slice(u.basePointIndex),r)}function Zy(t,e,r,n,i,s){let o=[new qt,new qt];{let l=t.points[n];o[0].time=l.time,o[0].value=l.value}{let l=t.points[r];o[1].time=s,o[1].value=l.value}switch(t.segments[e].segmentType){case 0:case 1:default:return lf(o,i);case 2:return uf(o,i);case 3:return cf(o,i)}}var Kn=class t extends Qe{static create(e,r,n,i,s=!1){let o=new t;if(o.parse(e,r,s),o._motionData)o._sourceFrameRate=o._motionData.fps,o._loopDurationSeconds=o._motionData.duration,o._onFinishedMotion=n,o._onBeganMotion=i;else return Xt(o),null;return o}doUpdateParameters(e,r,n,i){this._modelCurveIdEyeBlink==null&&(this._modelCurveIdEyeBlink=B.getIdManager().getId($y)),this._modelCurveIdLipSync==null&&(this._modelCurveIdLipSync=B.getIdManager().getId(jy)),this._modelCurveIdOpacity==null&&(this._modelCurveIdOpacity=B.getIdManager().getId(Ta)),this._motionBehavior===1&&this._previousLoopState!==this._isLoop&&(this.adjustEndTime(i),this._previousLoopState=this._isLoop);let s=r-i.getStartTime();s<0&&(s=0);let o=Number.MAX_VALUE,l=Number.MAX_VALUE,a=64,u=0,d=0;this._eyeBlinkParameterIds.length>a&&_s("too many eye blink targets : {0}",this._eyeBlinkParameterIds.length),this._lipSyncParameterIds.length>a&&_s("too many lip sync targets : {0}",this._lipSyncParameterIds.length);let c=this._fadeInSeconds<=0?1:L.getEasingSine((r-i.getFadeInStartTime())/this._fadeInSeconds),p=this._fadeOutSeconds<=0||i.getEndTime()<0?1:L.getEasingSine((i.getEndTime()-r)/this._fadeOutSeconds),_,m,f,y=s,b=this._motionData.duration,g=this._motionBehavior===1&&this._isLoop;if(this._isLoop)for(this._motionBehavior===1&&(b+=1/this._motionData.fps);y>b;)y-=b;let h=this._motionData.curves;for(m=0;m<this._motionData.curveCount&&h[m].type==0;++m)_=Ec(this._motionData,m,y,g,b),h[m].id==this._modelCurveIdEyeBlink?l=_:h[m].id==this._modelCurveIdLipSync?o=_:h[m].id==this._modelCurveIdOpacity&&(this._modelOpacity=_,e.setModelOapcity(this.getModelOpacityValue()));let C=0;for(;m<this._motionData.curveCount&&h[m].type==1;++m){if(C++,f=e.getParameterIndex(h[m].id),f==-1)continue;let x=e.getParameterValueByIndex(f);if(_=Ec(this._motionData,m,y,g,b),l!=Number.MAX_VALUE){for(let M=0;M<this._eyeBlinkParameterIds.length&&M<a;++M)if(this._eyeBlinkParameterIds[M]==h[m].id){_*=l,d|=1<<M;break}}if(o!=Number.MAX_VALUE){for(let M=0;M<this._lipSyncParameterIds.length&&M<a;++M)if(this._lipSyncParameterIds[M]==h[m].id){_+=o,u|=1<<M;break}}e.isRepeat(f)&&(_=e.getParameterRepeatValue(f,_));let v;if(h[m].fadeInTime<0&&h[m].fadeOutTime<0)v=x+(_-x)*n;else{let M,P;h[m].fadeInTime<0?M=c:M=h[m].fadeInTime==0?1:L.getEasingSine((r-i.getFadeInStartTime())/h[m].fadeInTime),h[m].fadeOutTime<0?P=p:P=h[m].fadeOutTime==0||i.getEndTime()<0?1:L.getEasingSine((i.getEndTime()-r)/h[m].fadeOutTime);let A=this._weight*M*P;v=x+(_-x)*A}e.setParameterValueByIndex(f,v,1)}{if(l!=Number.MAX_VALUE)for(let x=0;x<this._eyeBlinkParameterIds.length&&x<a;++x){let v=e.getParameterValueById(this._eyeBlinkParameterIds[x]);if(d>>x&1)continue;let M=v+(l-v)*n;e.setParameterValueById(this._eyeBlinkParameterIds[x],M)}if(o!=Number.MAX_VALUE)for(let x=0;x<this._lipSyncParameterIds.length&&x<a;++x){let v=e.getParameterValueById(this._lipSyncParameterIds[x]);if(u>>x&1)continue;let M=v+(o-v)*n;e.setParameterValueById(this._lipSyncParameterIds[x],M)}}for(;m<this._motionData.curveCount&&h[m].type==2;++m)f=e.getParameterIndex(h[m].id),f!=-1&&(_=Ec(this._motionData,m,y,g,b),e.setParameterValueByIndex(f,_));s>=b&&(this._isLoop?this.updateForNextLoop(i,r,y):(this._onFinishedMotion&&this._onFinishedMotion(this),i.setIsFinished(!0))),this._lastWeight=n}setMotionBehavior(e){this._motionBehavior=e}getMotionBehavior(){return this._motionBehavior}getDuration(){return this._isLoop?-1:this._loopDurationSeconds}getLoopDuration(){return this._loopDurationSeconds}setParameterFadeInTime(e,r){let n=this._motionData.curves;for(let i=0;i<this._motionData.curveCount;++i)if(e==n[i].id){n[i].fadeInTime=r;return}}setParameterFadeOutTime(e,r){let n=this._motionData.curves;for(let i=0;i<this._motionData.curveCount;++i)if(e==n[i].id){n[i].fadeOutTime=r;return}}getParameterFadeInTime(e){let r=this._motionData.curves;for(let n=0;n<this._motionData.curveCount;++n)if(e==r[n].id)return r[n].fadeInTime;return-1}getParameterFadeOutTime(e){let r=this._motionData.curves;for(let n=0;n<this._motionData.curveCount;++n)if(e==r[n].id)return r[n].fadeOutTime;return-1}setEffectIds(e,r){this._eyeBlinkParameterIds=e,this._lipSyncParameterIds=r}constructor(){super(),this._sourceFrameRate=30,this._loopDurationSeconds=-1,this._isLoop=!1,this._isLoopFadeIn=!0,this._lastWeight=0,this._motionData=null,this._modelCurveIdEyeBlink=null,this._modelCurveIdLipSync=null,this._modelCurveIdOpacity=null,this._eyeBlinkParameterIds=null,this._lipSyncParameterIds=null,this._modelOpacity=1,this._debugMode=!1}release(){this._motionData=void 0,this._motionData=null}updateForNextLoop(e,r,n){switch(this._motionBehavior){case 1:default:e.setStartTime(r-n),this._isLoopFadeIn&&e.setFadeInStartTime(r-n),this._onFinishedMotion!=null&&this._onFinishedMotion(this);break;case 0:e.setStartTime(r),this._isLoopFadeIn&&e.setFadeInStartTime(r);break}}parse(e,r,n=!1){let i=new Qn(e,r);if(!i){i.release(),i=void 0;return}if(n&&!i.hasConsistency()){i.release(),R("Inconsistent motion3.json.");return}this._motionData=new qn,this._motionData.duration=i.getMotionDuration(),this._motionData.loop=i.isMotionLoop(),this._motionData.curveCount=i.getMotionCurveCount(),this._motionData.fps=i.getMotionFps(),this._motionData.eventCount=i.getEventCount();let s=i.getEvaluationOptionFlag(0);i.isExistMotionFadeInTime()?this._fadeInSeconds=i.getMotionFadeInTime()<0?1:i.getMotionFadeInTime():this._fadeInSeconds=1,i.isExistMotionFadeOutTime()?this._fadeOutSeconds=i.getMotionFadeOutTime()<0?1:i.getMotionFadeOutTime():this._fadeOutSeconds=1,be(this._motionData.curves,this._motionData.curveCount,Yn,!0),be(this._motionData.segments,i.getMotionTotalSegmentCount(),Xn,!0),be(this._motionData.points,i.getMotionTotalPointCount(),qt,!0),be(this._motionData.events,this._motionData.eventCount,Jn,!0);let o=0,l=0;for(let a=0;a<this._motionData.curveCount;++a){i.getMotionCurveTarget(a)==Xy?this._motionData.curves[a].type=0:i.getMotionCurveTarget(a)==Yy?this._motionData.curves[a].type=1:i.getMotionCurveTarget(a)==Jy?this._motionData.curves[a].type=2:Y('Warning : Unable to get segment type from Curve! The number of "CurveCount" may be incorrect!'),this._motionData.curves[a].id=i.getMotionCurveId(a),this._motionData.curves[a].baseSegmentIndex=l,this._motionData.curves[a].fadeInTime=i.isExistMotionCurveFadeInTime(a)?i.getMotionCurveFadeInTime(a):-1,this._motionData.curves[a].fadeOutTime=i.isExistMotionCurveFadeOutTime(a)?i.getMotionCurveFadeOutTime(a):-1;for(let u=0;u<i.getMotionCurveSegmentCount(a);){switch(u==0?(this._motionData.segments[l].basePointIndex=o,this._motionData.points[o].time=i.getMotionCurveSegment(a,u),this._motionData.points[o].value=i.getMotionCurveSegment(a,u+1),o+=1,u+=2):this._motionData.segments[l].basePointIndex=o-1,i.getMotionCurveSegment(a,u)){case 0:{this._motionData.segments[l].segmentType=0,this._motionData.segments[l].evaluate=lf,this._motionData.points[o].time=i.getMotionCurveSegment(a,u+1),this._motionData.points[o].value=i.getMotionCurveSegment(a,u+2),o+=1,u+=3;break}case 1:{this._motionData.segments[l].segmentType=1,s||qy?this._motionData.segments[l].evaluate=Qy:this._motionData.segments[l].evaluate=Ky,this._motionData.points[o].time=i.getMotionCurveSegment(a,u+1),this._motionData.points[o].value=i.getMotionCurveSegment(a,u+2),this._motionData.points[o+1].time=i.getMotionCurveSegment(a,u+3),this._motionData.points[o+1].value=i.getMotionCurveSegment(a,u+4),this._motionData.points[o+2].time=i.getMotionCurveSegment(a,u+5),this._motionData.points[o+2].value=i.getMotionCurveSegment(a,u+6),o+=3,u+=7;break}case 2:{this._motionData.segments[l].segmentType=2,this._motionData.segments[l].evaluate=uf,this._motionData.points[o].time=i.getMotionCurveSegment(a,u+1),this._motionData.points[o].value=i.getMotionCurveSegment(a,u+2),o+=1,u+=3;break}case 3:{this._motionData.segments[l].segmentType=3,this._motionData.segments[l].evaluate=cf,this._motionData.points[o].time=i.getMotionCurveSegment(a,u+1),this._motionData.points[o].value=i.getMotionCurveSegment(a,u+2),o+=1,u+=3;break}default:{ie(0);break}}++this._motionData.curves[a].segmentCount,++l}}for(let a=0;a<i.getEventCount();++a)this._motionData.events[a].fireTime=i.getEventTime(a),this._motionData.events[a].value=i.getEventValue(a);i.release(),i=void 0,i=null}getFiredEvent(e,r){be(this._firedEventValues,0);for(let n=0;n<this._motionData.eventCount;++n)this._motionData.events[n].fireTime>e&&this._motionData.events[n].fireTime<=r&&this._firedEventValues.push(this._motionData.events[n].value);return this._firedEventValues}isExistModelOpacity(){for(let e=0;e<this._motionData.curveCount;e++){let r=this._motionData.curves[e];if(r.type==0&&r.id.getString().localeCompare(Ta)==0)return!0}return!1}getModelOpacityIndex(){if(this.isExistModelOpacity())for(let e=0;e<this._motionData.curveCount;e++){let r=this._motionData.curves[e];if(r.type==0&&r.id.getString().localeCompare(Ta)==0)return e}return-1}getModelOpacityId(e){if(e!=-1){let r=this._motionData.curves[e];if(r.type==0&&r.id.getString().localeCompare(Ta)==0)return B.getIdManager().getId(r.id.getString())}return null}getModelOpacityValue(){return this._modelOpacity}setDebugMode(e){this._debugMode=e}_sourceFrameRate;_loopDurationSeconds;_motionBehavior=1;_lastWeight;_motionData;_eyeBlinkParameterIds;_lipSyncParameterIds;_modelCurveIdEyeBlink;_modelCurveIdLipSync;_modelCurveIdOpacity;_modelOpacity;_debugMode},eC;(e=>e.CubismMotion=Kn)(eC||={});var Zn=class extends Pr{constructor(){super(),this._currentPriority=0,this._reservePriority=0}getCurrentPriority(){return this._currentPriority}getReservePriority(){return this._reservePriority}setReservePriority(e){this._reservePriority=e}startMotionPriority(e,r,n){return n==this._reservePriority&&(this._reservePriority=0),this._currentPriority=n,super.startMotion(e,r)}updateMotion(e,r){this._userTimeSeconds+=r;let n=super.doUpdateMotion(e,this._userTimeSeconds);return this.isFinished()&&(this._currentPriority=0),n}reserveMotion(e){return e<=this._reservePriority||e<=this._currentPriority?!1:(this._reservePriority=e,!0)}_currentPriority;_reservePriority},rC;(e=>e.CubismMotionManager=Zn)(rC||={});var Ba=(e=>(e[e.CubismPhysicsTargetType_Parameter=0]="CubismPhysicsTargetType_Parameter",e))(Ba||{}),Ia=(n=>(n[n.CubismPhysicsSource_X=0]="CubismPhysicsSource_X",n[n.CubismPhysicsSource_Y=1]="CubismPhysicsSource_Y",n[n.CubismPhysicsSource_Angle=2]="CubismPhysicsSource_Angle",n))(Ia||{}),La=class{constructor(){this.gravity=new E(0,0),this.wind=new E(0,0)}gravity;wind},ei=class{id;targetType},ti=class{minimum;maximum;defalut},ri=class{constructor(){this.initialPosition=new E(0,0),this.position=new E(0,0),this.lastPosition=new E(0,0),this.lastGravity=new E(0,0),this.force=new E(0,0),this.velocity=new E(0,0)}initialPosition;mobility;delay;acceleration;radius;position;lastPosition;lastGravity;force;velocity},ni=class{constructor(){this.normalizationPosition=new ti,this.normalizationAngle=new ti}inputCount;outputCount;particleCount;baseInputIndex;baseOutputIndex;baseParticleIndex;normalizationPosition;normalizationAngle},ii=class{constructor(){this.source=new ei}source;sourceParameterIndex;weight;type;reflect;getNormalizedParameterValue},si=class{constructor(){this.destination=new ei,this.translationScale=new E(0,0)}destination;destinationParameterIndex;vertexIndex;translationScale;angleScale;weight;type;reflect;valueBelowMinimum;valueExceededMaximum;getValue;getScale},oi=class{constructor(){this.settings=new Array,this.inputs=new Array,this.outputs=new Array,this.particles=new Array,this.gravity=new E(0,0),this.wind=new E(0,0),this.fps=0}subRigCount;settings;inputs;outputs;particles;gravity;wind;fps},iC;(d=>(d.CubismPhysicsInput=ii,d.CubismPhysicsNormalization=ti,d.CubismPhysicsOutput=si,d.CubismPhysicsParameter=ei,d.CubismPhysicsParticle=ri,d.CubismPhysicsRig=oi,d.CubismPhysicsSource=Ia,d.CubismPhysicsSubRig=ni,d.CubismPhysicsTargetType=Ba,d.PhysicsJsonEffectiveForces=La))(iC||={});var Bs="Position",Ac="X",kc="Y",Vc="Angle",df="Type",pf="Id",Kt="Meta",Ra="EffectiveForces",oC="TotalInputCount",aC="TotalOutputCount",lC="PhysicsSettingCount",hf="Gravity",mf="Wind",uC="VertexCount",cC="Fps",J="PhysicsSettings",ai="Normalization",ff="Minimum",gf="Maximum",bf="Default",_f="Reflect",yf="Weight",Is="Input",dC="Source",Jr="Output",pC="Scale",hC="VertexIndex",mC="Destination",qr="Vertices",fC="Mobility",gC="Delay",bC="Radius",_C="Acceleration",li=class{constructor(e,r){this._json=se.create(e,r)}release(){se.delete(this._json)}getGravity(){let e=new E(0,0);return e.x=this._json.getRoot().getValueByString(Kt).getValueByString(Ra).getValueByString(hf).getValueByString(Ac).toFloat(),e.y=this._json.getRoot().getValueByString(Kt).getValueByString(Ra).getValueByString(hf).getValueByString(kc).toFloat(),e}getWind(){let e=new E(0,0);return e.x=this._json.getRoot().getValueByString(Kt).getValueByString(Ra).getValueByString(mf).getValueByString(Ac).toFloat(),e.y=this._json.getRoot().getValueByString(Kt).getValueByString(Ra).getValueByString(mf).getValueByString(kc).toFloat(),e}getFps(){return this._json.getRoot().getValueByString(Kt).getValueByString(cC).toFloat(0)}getSubRigCount(){return this._json.getRoot().getValueByString(Kt).getValueByString(lC).toInt()}getTotalInputCount(){return this._json.getRoot().getValueByString(Kt).getValueByString(oC).toInt()}getTotalOutputCount(){return this._json.getRoot().getValueByString(Kt).getValueByString(aC).toInt()}getVertexCount(){return this._json.getRoot().getValueByString(Kt).getValueByString(uC).toInt()}getNormalizationPositionMinimumValue(e){return this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(ai).getValueByString(Bs).getValueByString(ff).toFloat()}getNormalizationPositionMaximumValue(e){return this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(ai).getValueByString(Bs).getValueByString(gf).toFloat()}getNormalizationPositionDefaultValue(e){return this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(ai).getValueByString(Bs).getValueByString(bf).toFloat()}getNormalizationAngleMinimumValue(e){return this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(ai).getValueByString(Vc).getValueByString(ff).toFloat()}getNormalizationAngleMaximumValue(e){return this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(ai).getValueByString(Vc).getValueByString(gf).toFloat()}getNormalizationAngleDefaultValue(e){return this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(ai).getValueByString(Vc).getValueByString(bf).toFloat()}getInputCount(e){return this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(Is).getVector().length}getInputWeight(e,r){return this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(Is).getValueByIndex(r).getValueByString(yf).toFloat()}getInputReflect(e,r){return this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(Is).getValueByIndex(r).getValueByString(_f).toBoolean()}getInputType(e,r){return this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(Is).getValueByIndex(r).getValueByString(df).getRawString()}getInputSourceId(e,r){return B.getIdManager().getId(this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(Is).getValueByIndex(r).getValueByString(dC).getValueByString(pf).getRawString())}getOutputCount(e){return this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(Jr).getVector().length}getOutputVertexIndex(e,r){return this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(Jr).getValueByIndex(r).getValueByString(hC).toInt()}getOutputAngleScale(e,r){return this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(Jr).getValueByIndex(r).getValueByString(pC).toFloat()}getOutputWeight(e,r){return this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(Jr).getValueByIndex(r).getValueByString(yf).toFloat()}getOutputDestinationId(e,r){return B.getIdManager().getId(this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(Jr).getValueByIndex(r).getValueByString(mC).getValueByString(pf).getRawString())}getOutputType(e,r){return this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(Jr).getValueByIndex(r).getValueByString(df).getRawString()}getOutputReflect(e,r){return this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(Jr).getValueByIndex(r).getValueByString(_f).toBoolean()}getParticleCount(e){return this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(qr).getVector().length}getParticleMobility(e,r){return this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(qr).getValueByIndex(r).getValueByString(fC).toFloat()}getParticleDelay(e,r){return this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(qr).getValueByIndex(r).getValueByString(gC).toFloat()}getParticleAcceleration(e,r){return this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(qr).getValueByIndex(r).getValueByString(_C).toFloat()}getParticleRadius(e,r){return this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(qr).getValueByIndex(r).getValueByString(bC).toFloat()}getParticlePosition(e,r){let n=new E(0,0);return n.x=this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(qr).getValueByIndex(r).getValueByString(Bs).getValueByString(Ac).toFloat(),n.y=this._json.getRoot().getValueByString(J).getValueByIndex(e).getValueByString(qr).getValueByIndex(r).getValueByString(Bs).getValueByString(kc).toFloat(),n}_json},yC;(e=>e.CubismPhysicsJson=li)(yC||={});var Cf="X",vf="Y",xf="Angle",vC=5,Dc=100,Mf=.001,xC=5,Qr=class t{static create(e,r){let n=new t;return n.parse(e,r),n._physicsRig.gravity.y=0,n}static delete(e){e!=null&&(e.release(),e=null)}parse(e,r){this._physicsRig=new oi;let n=new li(e,r);this._physicsRig.gravity=n.getGravity(),this._physicsRig.wind=n.getWind(),this._physicsRig.subRigCount=n.getSubRigCount(),this._physicsRig.fps=n.getFps(),be(this._physicsRig.settings,this._physicsRig.subRigCount,ni,!0),be(this._physicsRig.inputs,n.getTotalInputCount(),ii,!0),be(this._physicsRig.outputs,n.getTotalOutputCount(),si,!0),be(this._physicsRig.particles,n.getVertexCount(),ri,!0),this._currentRigOutputs.length=0,this._previousRigOutputs.length=0;let i=0,s=0,o=0,l=this._currentRigOutputs.length,a=this._previousRigOutputs.length;this._currentRigOutputs.length+=this._physicsRig.settings.length,this._previousRigOutputs.length+=this._physicsRig.settings.length;for(let u=0;u<this._physicsRig.settings.length;++u){this._physicsRig.settings[u].normalizationPosition.minimum=n.getNormalizationPositionMinimumValue(u),this._physicsRig.settings[u].normalizationPosition.maximum=n.getNormalizationPositionMaximumValue(u),this._physicsRig.settings[u].normalizationPosition.defalut=n.getNormalizationPositionDefaultValue(u),this._physicsRig.settings[u].normalizationAngle.minimum=n.getNormalizationAngleMinimumValue(u),this._physicsRig.settings[u].normalizationAngle.maximum=n.getNormalizationAngleMaximumValue(u),this._physicsRig.settings[u].normalizationAngle.defalut=n.getNormalizationAngleDefaultValue(u),this._physicsRig.settings[u].inputCount=n.getInputCount(u),this._physicsRig.settings[u].baseInputIndex=i;for(let p=0;p<this._physicsRig.settings[u].inputCount;++p)this._physicsRig.inputs[i+p].sourceParameterIndex=-1,this._physicsRig.inputs[i+p].weight=n.getInputWeight(u,p),this._physicsRig.inputs[i+p].reflect=n.getInputReflect(u,p),n.getInputType(u,p)==Cf?(this._physicsRig.inputs[i+p].type=0,this._physicsRig.inputs[i+p].getNormalizedParameterValue=SC):n.getInputType(u,p)==vf?(this._physicsRig.inputs[i+p].type=1,this._physicsRig.inputs[i+p].getNormalizedParameterValue=PC):n.getInputType(u,p)==xf&&(this._physicsRig.inputs[i+p].type=2,this._physicsRig.inputs[i+p].getNormalizedParameterValue=wC),this._physicsRig.inputs[i+p].source.targetType=0,this._physicsRig.inputs[i+p].source.id=n.getInputSourceId(u,p);i+=this._physicsRig.settings[u].inputCount,this._physicsRig.settings[u].outputCount=n.getOutputCount(u),this._physicsRig.settings[u].baseOutputIndex=s;let d=new Ea;be(d.outputs,this._physicsRig.settings[u].outputCount,null,!0);let c=new Ea;be(c.outputs,this._physicsRig.settings[u].outputCount,null,!0);for(let p=0;p<this._physicsRig.settings[u].outputCount;++p)d.outputs[p]=0,c.outputs[p]=0,this._physicsRig.outputs[s+p].destinationParameterIndex=-1,this._physicsRig.outputs[s+p].vertexIndex=n.getOutputVertexIndex(u,p),this._physicsRig.outputs[s+p].angleScale=n.getOutputAngleScale(u,p),this._physicsRig.outputs[s+p].weight=n.getOutputWeight(u,p),this._physicsRig.outputs[s+p].destination.targetType=0,this._physicsRig.outputs[s+p].destination.id=n.getOutputDestinationId(u,p),n.getOutputType(u,p)==Cf?(this._physicsRig.outputs[s+p].type=0,this._physicsRig.outputs[s+p].getValue=TC,this._physicsRig.outputs[s+p].getScale=EC):n.getOutputType(u,p)==vf?(this._physicsRig.outputs[s+p].type=1,this._physicsRig.outputs[s+p].getValue=LC,this._physicsRig.outputs[s+p].getScale=AC):n.getOutputType(u,p)==xf&&(this._physicsRig.outputs[s+p].type=2,this._physicsRig.outputs[s+p].getValue=BC,this._physicsRig.outputs[s+p].getScale=kC),this._physicsRig.outputs[s+p].reflect=n.getOutputReflect(u,p);this._currentRigOutputs[l++]=d,this._previousRigOutputs[a++]=c,s+=this._physicsRig.settings[u].outputCount,this._physicsRig.settings[u].particleCount=n.getParticleCount(u),this._physicsRig.settings[u].baseParticleIndex=o;for(let p=0;p<this._physicsRig.settings[u].particleCount;++p)this._physicsRig.particles[o+p].mobility=n.getParticleMobility(u,p),this._physicsRig.particles[o+p].delay=n.getParticleDelay(u,p),this._physicsRig.particles[o+p].acceleration=n.getParticleAcceleration(u,p),this._physicsRig.particles[o+p].radius=n.getParticleRadius(u,p),this._physicsRig.particles[o+p].position=n.getParticlePosition(u,p);o+=this._physicsRig.settings[u].particleCount}this.initialize(),n.release(),n=void 0,n=null}stabilization(e){let r,n,i,s,o=new E,l,a,u,d,c=e.getModel().parameters.values,p=e.getModel().parameters.maximumValues,_=e.getModel().parameters.minimumValues,m=e.getModel().parameters.defaultValues;(this._parameterCaches?.length??0)<e.getParameterCount()&&(this._parameterCaches=new Float32Array(e.getParameterCount())),(this._parameterInputCaches?.length??0)<e.getParameterCount()&&(this._parameterInputCaches=new Float32Array(e.getParameterCount()));for(let f=0;f<e.getParameterCount();++f)this._parameterCaches[f]=c[f],this._parameterInputCaches[f]=c[f];for(let f=0;f<this._physicsRig.subRigCount;++f){r={angle:0},o.x=0,o.y=0,l=this._physicsRig.settings[f],a=this._physicsRig.inputs.slice(l.baseInputIndex),u=this._physicsRig.outputs.slice(l.baseOutputIndex),d=this._physicsRig.particles.slice(l.baseParticleIndex);for(let y=0;y<l.inputCount;++y)n=a[y].weight/Dc,a[y].sourceParameterIndex==-1&&(a[y].sourceParameterIndex=e.getParameterIndex(a[y].source.id)),a[y].getNormalizedParameterValue(o,r,c[a[y].sourceParameterIndex],_[a[y].sourceParameterIndex],p[a[y].sourceParameterIndex],m[a[y].sourceParameterIndex],l.normalizationPosition,l.normalizationAngle,a[y].reflect,n),this._parameterCaches[a[y].sourceParameterIndex]=c[a[y].sourceParameterIndex];i=L.degreesToRadian(-r.angle),o.x=o.x*L.cos(i)-o.y*L.sin(i),o.y=o.x*L.sin(i)+o.y*L.cos(i),OC(d,l.particleCount,o,r.angle,this._options.wind,Mf*l.normalizationPosition.maximum);for(let y=0;y<l.outputCount;++y){let b=u[y].vertexIndex;if(u[y].destinationParameterIndex==-1&&(u[y].destinationParameterIndex=e.getParameterIndex(u[y].destination.id)),b<1||b>=l.particleCount)continue;let g=new E;g=d[b].position.substract(d[b-1].position),s=u[y].getValue(g,d,b,u[y].reflect,this._options.gravity),this._currentRigOutputs[f].outputs[y]=s,this._previousRigOutputs[f].outputs[y]=s;let h=u[y].destinationParameterIndex,C=!Float32Array.prototype.slice&&"subarray"in Float32Array.prototype?JSON.parse(JSON.stringify(c.subarray(h))):c.slice(h);Oc(C,_[h],p[h],s,u[y]);for(let x=h,v=0;x<this._parameterCaches.length;x++,v++)c[x]=this._parameterCaches[x]=C[v]}}}evaluate(e,r){let n,i,s,o,l=new E,a,u,d,c;if(0>=r)return;let p=e.getModel().parameters.values,_=e.getModel().parameters.maximumValues,m=e.getModel().parameters.minimumValues,f=e.getModel().parameters.defaultValues,y;if(this._currentRemainTime+=r,this._currentRemainTime>xC&&(this._currentRemainTime=0),(this._parameterCaches?.length??0)<e.getParameterCount()&&(this._parameterCaches=new Float32Array(e.getParameterCount())),(this._parameterInputCaches?.length??0)<e.getParameterCount()){this._parameterInputCaches=new Float32Array(e.getParameterCount());for(let g=0;g<e.getParameterCount();++g)this._parameterInputCaches[g]=p[g]}for(this._physicsRig.fps>0?y=1/this._physicsRig.fps:y=r;this._currentRemainTime>=y;){for(let h=0;h<this._physicsRig.subRigCount;++h){a=this._physicsRig.settings[h],d=this._physicsRig.outputs.slice(a.baseOutputIndex);for(let C=0;C<a.outputCount;++C)this._previousRigOutputs[h].outputs[C]=this._currentRigOutputs[h].outputs[C]}let g=y/this._currentRemainTime;for(let h=0;h<e.getParameterCount();++h)this._parameterCaches[h]=this._parameterInputCaches[h]*(1-g)+p[h]*g,this._parameterInputCaches[h]=this._parameterCaches[h];for(let h=0;h<this._physicsRig.subRigCount;++h){n={angle:0},l.x=0,l.y=0,a=this._physicsRig.settings[h],u=this._physicsRig.inputs.slice(a.baseInputIndex),d=this._physicsRig.outputs.slice(a.baseOutputIndex),c=this._physicsRig.particles.slice(a.baseParticleIndex);for(let C=0;C<a.inputCount;++C)i=u[C].weight/Dc,u[C].sourceParameterIndex==-1&&(u[C].sourceParameterIndex=e.getParameterIndex(u[C].source.id)),u[C].getNormalizedParameterValue(l,n,this._parameterCaches[u[C].sourceParameterIndex],m[u[C].sourceParameterIndex],_[u[C].sourceParameterIndex],f[u[C].sourceParameterIndex],a.normalizationPosition,a.normalizationAngle,u[C].reflect,i);s=L.degreesToRadian(-n.angle),l.x=l.x*L.cos(s)-l.y*L.sin(s),l.y=l.x*L.sin(s)+l.y*L.cos(s),VC(c,a.particleCount,l,n.angle,this._options.wind,Mf*a.normalizationPosition.maximum,y,vC);for(let C=0;C<a.outputCount;++C){let x=d[C].vertexIndex;if(d[C].destinationParameterIndex==-1&&(d[C].destinationParameterIndex=e.getParameterIndex(d[C].destination.id)),x<1||x>=a.particleCount)continue;let v=new E;v.x=c[x].position.x-c[x-1].position.x,v.y=c[x].position.y-c[x-1].position.y,o=d[C].getValue(v,c,x,d[C].reflect,this._options.gravity),this._currentRigOutputs[h].outputs[C]=o;let M=d[C].destinationParameterIndex,P=!Float32Array.prototype.slice&&"subarray"in Float32Array.prototype?JSON.parse(JSON.stringify(this._parameterCaches.subarray(M))):this._parameterCaches.slice(M);Oc(P,m[M],_[M],o,d[C]);for(let A=M,k=0;A<this._parameterCaches.length;A++,k++)this._parameterCaches[A]=P[k]}}this._currentRemainTime-=y}let b=this._currentRemainTime/y;this.interpolate(e,b)}interpolate(e,r){let n,i,s=e.getModel().parameters.values,o=e.getModel().parameters.maximumValues,l=e.getModel().parameters.minimumValues;for(let a=0;a<this._physicsRig.subRigCount;++a){i=this._physicsRig.settings[a],n=this._physicsRig.outputs.slice(i.baseOutputIndex);for(let u=0;u<i.outputCount;++u){if(n[u].destinationParameterIndex==-1)continue;let d=n[u].destinationParameterIndex,c=!Float32Array.prototype.slice&&"subarray"in Float32Array.prototype?JSON.parse(JSON.stringify(s.subarray(d))):s.slice(d);Oc(c,l[d],o[d],this._previousRigOutputs[a].outputs[u]*(1-r)+this._currentRigOutputs[a].outputs[u]*r,n[u]);for(let p=d,_=0;p<s.length;p++,_++)s[p]=c[_]}}}setOptions(e){this._options=e}getOption(){return this._options}constructor(){this._physicsRig=null,this._options=new Rs,this._options.gravity.y=-1,this._options.gravity.x=0,this._options.wind.x=0,this._options.wind.y=0,this._currentRigOutputs=new Array,this._previousRigOutputs=new Array,this._currentRemainTime=0,this._parameterCaches=null,this._parameterInputCaches=null}release(){this._physicsRig=void 0,this._physicsRig=null}initialize(){let e,r,n;for(let i=0;i<this._physicsRig.subRigCount;++i){r=this._physicsRig.settings[i],e=this._physicsRig.particles.slice(r.baseParticleIndex),e[0].initialPosition=new E(0,0),e[0].lastPosition=new E(e[0].initialPosition.x,e[0].initialPosition.y),e[0].lastGravity=new E(0,-1),e[0].lastGravity.y*=-1,e[0].velocity=new E(0,0),e[0].force=new E(0,0);for(let s=1;s<r.particleCount;++s)n=new E(0,0),n.y=e[s].radius,e[s].initialPosition=new E(e[s-1].initialPosition.x+n.x,e[s-1].initialPosition.y+n.y),e[s].position=new E(e[s].initialPosition.x,e[s].initialPosition.y),e[s].lastPosition=new E(e[s].initialPosition.x,e[s].initialPosition.y),e[s].lastGravity=new E(0,-1),e[s].lastGravity.y*=-1,e[s].velocity=new E(0,0),e[s].force=new E(0,0)}}_physicsRig;_options;_currentRigOutputs;_previousRigOutputs;_currentRemainTime;_parameterCaches;_parameterInputCaches},Rs=class{constructor(){this.gravity=new E(0,0),this.wind=new E(0,0)}gravity;wind},Ea=class{constructor(){this.outputs=new Array(0)}outputs};function MC(t){let e=0;return t>0?e=1:t<0&&(e=-1),e}function SC(t,e,r,n,i,s,o,l,a,u){t.x+=Fc(r,n,i,s,o.minimum,o.maximum,o.defalut,a)*u}function PC(t,e,r,n,i,s,o,l,a,u){t.y+=Fc(r,n,i,s,o.minimum,o.maximum,o.defalut,a)*u}function wC(t,e,r,n,i,s,o,l,a,u){e.angle+=Fc(r,n,i,s,l.minimum,l.maximum,l.defalut,a)*u}function TC(t,e,r,n,i){let s=t.x;return n&&(s*=-1),s}function LC(t,e,r,n,i){let s=t.y;return n&&(s*=-1),s}function BC(t,e,r,n,i){let s;return r>=2?i=e[r-1].position.substract(e[r-2].position):i=i.multiplyByScaler(-1),s=L.directionToRadian(i,t),n&&(s*=-1),s}function IC(t,e){let r=L.max(t,e),n=L.min(t,e);return L.abs(r-n)}function RC(t,e){return L.min(t,e)+IC(t,e)/2}function EC(t,e){return JSON.parse(JSON.stringify(t.x))}function AC(t,e){return JSON.parse(JSON.stringify(t.y))}function kC(t,e){return JSON.parse(JSON.stringify(e))}function VC(t,e,r,n,i,s,o,l){let a,u,d=new E(0,0),c=new E(0,0),p=new E(0,0),_=new E(0,0);t[0].position=new E(r.x,r.y);let m=L.degreesToRadian(n),f=L.radianToDirection(m);f.normalize();for(let y=1;y<e;++y)t[y].force=f.multiplyByScaler(t[y].acceleration).add(i),t[y].lastPosition=new E(t[y].position.x,t[y].position.y),a=t[y].delay*o*30,d=t[y].position.substract(t[y-1].position),u=L.directionToRadian(t[y].lastGravity,f)/l,d.x=L.cos(u)*d.x-d.y*L.sin(u),d.y=L.sin(u)*d.x+d.y*L.cos(u),t[y].position=t[y-1].position.add(d),c=t[y].velocity.multiplyByScaler(a),p=t[y].force.multiplyByScaler(a).multiplyByScaler(a),t[y].position=t[y].position.add(c).add(p),_=t[y].position.substract(t[y-1].position),_.normalize(),t[y].position=t[y-1].position.add(_.multiplyByScaler(t[y].radius)),L.abs(t[y].position.x)<s&&(t[y].position.x=0),a!=0&&(t[y].velocity=t[y].position.substract(t[y].lastPosition),t[y].velocity=t[y].velocity.divisionByScalar(a),t[y].velocity=t[y].velocity.multiplyByScaler(t[y].mobility)),t[y].force=new E(0,0),t[y].lastGravity=new E(f.x,f.y)}function OC(t,e,r,n,i,s){let o=new E(0,0);t[0].position=new E(r.x,r.y);let l=L.degreesToRadian(n),a=L.radianToDirection(l);a.normalize();for(let u=1;u<e;++u)t[u].force=a.multiplyByScaler(t[u].acceleration).add(i),t[u].lastPosition=new E(t[u].position.x,t[u].position.y),t[u].velocity=new E(0,0),o=t[u].force,o.normalize(),o=o.multiplyByScaler(t[u].radius),t[u].position=t[u-1].position.add(o),L.abs(t[u].position.x)<s&&(t[u].position.x=0),t[u].force=new E(0,0),t[u].lastGravity=new E(a.x,a.y)}function Oc(t,e,r,n,i){let s,o=i.getScale(i.translationScale,i.angleScale);s=n*o,s<e?(s<i.valueBelowMinimum&&(i.valueBelowMinimum=s),s=e):s>r&&(s>i.valueExceededMaximum&&(i.valueExceededMaximum=s),s=r);let l=i.weight/Dc;l>=1||(s=t[0]*(1-l)+s*l),t[0]=s}function Fc(t,e,r,n,i,s,o,l){let a=0,u=L.max(r,e);u<t&&(t=u);let d=L.min(r,e);d>t&&(t=d);let c=L.min(i,s),p=L.max(i,s),_=o,m=RC(d,u),f=t-m;switch(MC(f)){case 1:{let y=p-_,b=u-m;b!=0&&(a=f*(y/b),a+=_);break}case-1:{let y=c-_,b=d-m;b!=0&&(a=f*(y/b),a+=_);break}case 0:{a=_;break}default:break}return l?a:a*-1}var DC;(r=>(r.CubismPhysics=Qr,r.Options=Rs))(DC||={});var Rt=class{constructor(e=!1,r=new U){this.isOverridden=e,this.color=r}isOverridden;color},Aa=class{_model;_isOverriddenModelMultiplyColors;_isOverriddenModelScreenColors;_userPartScreenColors;_userPartMultiplyColors;_userDrawableScreenColors;_userDrawableMultiplyColors;_userOffscreenScreenColors;_userOffscreenMultiplyColors;constructor(e){this._model=e,this._isOverriddenModelMultiplyColors=!1,this._isOverriddenModelScreenColors=!1,this._userPartScreenColors=[],this._userPartMultiplyColors=[],this._userDrawableScreenColors=[],this._userDrawableMultiplyColors=[],this._userOffscreenScreenColors=[],this._userOffscreenMultiplyColors=[]}initialize(e,r,n){let i=new Rt(!1,new U(1,1,1,1)),s=new Rt(!1,new U(0,0,0,1));this._userPartMultiplyColors=new Array(e),this._userPartScreenColors=new Array(e);for(let o=0;o<e;o++)this._userPartMultiplyColors[o]=new Rt(i.isOverridden,new U(i.color.r,i.color.g,i.color.b,i.color.a)),this._userPartScreenColors[o]=new Rt(s.isOverridden,new U(s.color.r,s.color.g,s.color.b,s.color.a));this._userDrawableMultiplyColors=new Array(r),this._userDrawableScreenColors=new Array(r);for(let o=0;o<r;o++)this._userDrawableMultiplyColors[o]=new Rt(i.isOverridden,new U(i.color.r,i.color.g,i.color.b,i.color.a)),this._userDrawableScreenColors[o]=new Rt(s.isOverridden,new U(s.color.r,s.color.g,s.color.b,s.color.a));this._userOffscreenMultiplyColors=new Array(n),this._userOffscreenScreenColors=new Array(n);for(let o=0;o<n;o++)this._userOffscreenMultiplyColors[o]=new Rt(i.isOverridden,new U(i.color.r,i.color.g,i.color.b,i.color.a)),this._userOffscreenScreenColors[o]=new Rt(s.isOverridden,new U(s.color.r,s.color.g,s.color.b,s.color.a))}warnIndexOutOfRange(e,r,n){Y(`${e}: index is out of range. index=${r}, valid range=[0, ${n}].`)}isValidPartIndex(e,r){return e<0||e>=this._model.getPartCount()?(this.warnIndexOutOfRange(r,e,this._model.getPartCount()-1),!1):!0}isValidDrawableIndex(e,r){return e<0||e>=this._model.getDrawableCount()?(this.warnIndexOutOfRange(r,e,this._model.getDrawableCount()-1),!1):!0}isValidOffscreenIndex(e,r){return e<0||e>=this._model.getOffscreenCount()?(this.warnIndexOutOfRange(r,e,this._model.getOffscreenCount()-1),!1):!0}setMultiplyColorEnabled(e){this._isOverriddenModelMultiplyColors=e}getMultiplyColorEnabled(){return this._isOverriddenModelMultiplyColors}setScreenColorEnabled(e){this._isOverriddenModelScreenColors=e}getScreenColorEnabled(){return this._isOverriddenModelScreenColors}setPartMultiplyColorEnabled(e,r){this.isValidPartIndex(e,"setPartMultiplyColorEnabled")&&this.setPartColorEnabled(e,r,this._userPartMultiplyColors,this._userDrawableMultiplyColors,this._userOffscreenMultiplyColors)}getPartMultiplyColorEnabled(e){return this.isValidPartIndex(e,"getPartMultiplyColorEnabled")?this._userPartMultiplyColors[e].isOverridden:!1}setPartScreenColorEnabled(e,r){this.isValidPartIndex(e,"setPartScreenColorEnabled")&&this.setPartColorEnabled(e,r,this._userPartScreenColors,this._userDrawableScreenColors,this._userOffscreenScreenColors)}getPartScreenColorEnabled(e){return this.isValidPartIndex(e,"getPartScreenColorEnabled")?this._userPartScreenColors[e].isOverridden:!1}setPartMultiplyColorByTextureColor(e,r){this.isValidPartIndex(e,"setPartMultiplyColorByTextureColor")&&this.setPartMultiplyColorByRGBA(e,r.r,r.g,r.b,r.a)}setPartMultiplyColorByRGBA(e,r,n,i,s=1){this.isValidPartIndex(e,"setPartMultiplyColorByRGBA")&&this.setPartColor(e,r,n,i,s,this._userPartMultiplyColors,this._userDrawableMultiplyColors,this._userOffscreenMultiplyColors)}getPartMultiplyColor(e){return this.isValidPartIndex(e,"getPartMultiplyColor")?this._userPartMultiplyColors[e].color:new U(1,1,1,1)}setPartScreenColorByTextureColor(e,r){this.isValidPartIndex(e,"setPartScreenColorByTextureColor")&&this.setPartScreenColorByRGBA(e,r.r,r.g,r.b,r.a)}setPartScreenColorByRGBA(e,r,n,i,s=1){this.isValidPartIndex(e,"setPartScreenColorByRGBA")&&this.setPartColor(e,r,n,i,s,this._userPartScreenColors,this._userDrawableScreenColors,this._userOffscreenScreenColors)}getPartScreenColor(e){return this.isValidPartIndex(e,"getPartScreenColor")?this._userPartScreenColors[e].color:new U(0,0,0,1)}setDrawableMultiplyColorEnabled(e,r){this.isValidDrawableIndex(e,"setDrawableMultiplyColorEnabled")&&(this._userDrawableMultiplyColors[e].isOverridden=r)}getDrawableMultiplyColorEnabled(e){return this.isValidDrawableIndex(e,"getDrawableMultiplyColorEnabled")?this._userDrawableMultiplyColors[e].isOverridden:!1}setDrawableScreenColorEnabled(e,r){this.isValidDrawableIndex(e,"setDrawableScreenColorEnabled")&&(this._userDrawableScreenColors[e].isOverridden=r)}getDrawableScreenColorEnabled(e){return this.isValidDrawableIndex(e,"getDrawableScreenColorEnabled")?this._userDrawableScreenColors[e].isOverridden:!1}setDrawableMultiplyColorByTextureColor(e,r){this.isValidDrawableIndex(e,"setDrawableMultiplyColorByTextureColor")&&this.setDrawableMultiplyColorByRGBA(e,r.r,r.g,r.b,r.a)}setDrawableMultiplyColorByRGBA(e,r,n,i,s=1){this.isValidDrawableIndex(e,"setDrawableMultiplyColorByRGBA")&&(this._userDrawableMultiplyColors[e].color.r=r,this._userDrawableMultiplyColors[e].color.g=n,this._userDrawableMultiplyColors[e].color.b=i,this._userDrawableMultiplyColors[e].color.a=s)}getDrawableMultiplyColor(e){return this.isValidDrawableIndex(e,"getDrawableMultiplyColor")?this.getMultiplyColorEnabled()||this.getDrawableMultiplyColorEnabled(e)?this._userDrawableMultiplyColors[e].color:this._model.getDrawableMultiplyColor(e):new U(1,1,1,1)}setDrawableScreenColorByTextureColor(e,r){this.isValidDrawableIndex(e,"setDrawableScreenColorByTextureColor")&&this.setDrawableScreenColorByRGBA(e,r.r,r.g,r.b,r.a)}setDrawableScreenColorByRGBA(e,r,n,i,s=1){this.isValidDrawableIndex(e,"setDrawableScreenColorByRGBA")&&(this._userDrawableScreenColors[e].color.r=r,this._userDrawableScreenColors[e].color.g=n,this._userDrawableScreenColors[e].color.b=i,this._userDrawableScreenColors[e].color.a=s)}getDrawableScreenColor(e){return this.isValidDrawableIndex(e,"getDrawableScreenColor")?this.getScreenColorEnabled()||this.getDrawableScreenColorEnabled(e)?this._userDrawableScreenColors[e].color:this._model.getDrawableScreenColor(e):new U(0,0,0,1)}setOffscreenMultiplyColorEnabled(e,r){this.isValidOffscreenIndex(e,"setOffscreenMultiplyColorEnabled")&&(this._userOffscreenMultiplyColors[e].isOverridden=r)}getOffscreenMultiplyColorEnabled(e){return this.isValidOffscreenIndex(e,"getOffscreenMultiplyColorEnabled")?this._userOffscreenMultiplyColors[e].isOverridden:!1}setOffscreenScreenColorEnabled(e,r){this.isValidOffscreenIndex(e,"setOffscreenScreenColorEnabled")&&(this._userOffscreenScreenColors[e].isOverridden=r)}getOffscreenScreenColorEnabled(e){return this.isValidOffscreenIndex(e,"getOffscreenScreenColorEnabled")?this._userOffscreenScreenColors[e].isOverridden:!1}setOffscreenMultiplyColorByTextureColor(e,r){this.isValidOffscreenIndex(e,"setOffscreenMultiplyColorByTextureColor")&&this.setOffscreenMultiplyColorByRGBA(e,r.r,r.g,r.b,r.a)}setOffscreenMultiplyColorByRGBA(e,r,n,i,s=1){this.isValidOffscreenIndex(e,"setOffscreenMultiplyColorByRGBA")&&(this._userOffscreenMultiplyColors[e].color.r=r,this._userOffscreenMultiplyColors[e].color.g=n,this._userOffscreenMultiplyColors[e].color.b=i,this._userOffscreenMultiplyColors[e].color.a=s)}getOffscreenMultiplyColor(e){return this.isValidOffscreenIndex(e,"getOffscreenMultiplyColor")?this.getMultiplyColorEnabled()||this.getOffscreenMultiplyColorEnabled(e)?this._userOffscreenMultiplyColors[e].color:this._model.getOffscreenMultiplyColor(e):new U(1,1,1,1)}setOffscreenScreenColorByTextureColor(e,r){this.isValidOffscreenIndex(e,"setOffscreenScreenColorByTextureColor")&&this.setOffscreenScreenColorByRGBA(e,r.r,r.g,r.b,r.a)}setOffscreenScreenColorByRGBA(e,r,n,i,s=1){this.isValidOffscreenIndex(e,"setOffscreenScreenColorByRGBA")&&(this._userOffscreenScreenColors[e].color.r=r,this._userOffscreenScreenColors[e].color.g=n,this._userOffscreenScreenColors[e].color.b=i,this._userOffscreenScreenColors[e].color.a=s)}getOffscreenScreenColor(e){return this.isValidOffscreenIndex(e,"getOffscreenScreenColor")?this.getScreenColorEnabled()||this.getOffscreenScreenColorEnabled(e)?this._userOffscreenScreenColors[e].color:this._model.getOffscreenScreenColor(e):new U(0,0,0,1)}setPartColor(e,r,n,i,s,o,l,a){if(o[e].color.r=r,o[e].color.g=n,o[e].color.b=i,o[e].color.a=s,o[e].isOverridden){let d=this._model.getPartOffscreenIndices()[e];if(d==Es){let c=this._model.getPartsHierarchy();if(c&&c[e])for(let p=0;p<c[e].objects.length;++p){let _=c[e].objects[p];if(_.objectType===0){let m=_.objectIndex;l[m].color.r=r,l[m].color.g=n,l[m].color.b=i,l[m].color.a=s}else{let m=_.objectIndex;this.setPartColor(m,r,n,i,s,o,l,a)}}}else a[d].color.r=r,a[d].color.g=n,a[d].color.b=i,a[d].color.a=s}}setPartColorEnabled(e,r,n,i,s){n[e].isOverridden=r;let l=this._model.getPartOffscreenIndices()[e];if(l==Es){let a=this._model.getPartsHierarchy();if(a&&a[e])for(let u=0;u<a[e].objects.length;++u){let d=a[e].objects[u];if(d.objectType===0){let c=d.objectIndex;i[c].isOverridden=r,r&&(i[c].color.r=n[e].color.r,i[c].color.g=n[e].color.g,i[c].color.b=n[e].color.b,i[c].color.a=n[e].color.a)}else{let c=d.objectIndex;r&&(n[c].color.r=n[e].color.r,n[c].color.g=n[e].color.g,n[c].color.b=n[e].color.b,n[c].color.a=n[e].color.a),this.setPartColorEnabled(c,r,n,i,s)}}}else s[l].isOverridden=r,r&&(s[l].color.r=n[e].color.r,s[l].color.g=n[e].color.g,s[l].color.b=n[e].color.b,s[l].color.a=n[e].color.a)}};var Kr=-1,Es=-1,ve=(h=>(h[h.ColorBlend_None=-1]="ColorBlend_None",h[h.ColorBlend_Normal=Live2DCubismCore.ColorBlendType_Normal]="ColorBlend_Normal",h[h.ColorBlend_AddGlow=Live2DCubismCore.ColorBlendType_AddGlow]="ColorBlend_AddGlow",h[h.ColorBlend_Add=Live2DCubismCore.ColorBlendType_Add]="ColorBlend_Add",h[h.ColorBlend_Darken=Live2DCubismCore.ColorBlendType_Darken]="ColorBlend_Darken",h[h.ColorBlend_Multiply=Live2DCubismCore.ColorBlendType_Multiply]="ColorBlend_Multiply",h[h.ColorBlend_ColorBurn=Live2DCubismCore.ColorBlendType_ColorBurn]="ColorBlend_ColorBurn",h[h.ColorBlend_LinearBurn=Live2DCubismCore.ColorBlendType_LinearBurn]="ColorBlend_LinearBurn",h[h.ColorBlend_Lighten=Live2DCubismCore.ColorBlendType_Lighten]="ColorBlend_Lighten",h[h.ColorBlend_Screen=Live2DCubismCore.ColorBlendType_Screen]="ColorBlend_Screen",h[h.ColorBlend_ColorDodge=Live2DCubismCore.ColorBlendType_ColorDodge]="ColorBlend_ColorDodge",h[h.ColorBlend_Overlay=Live2DCubismCore.ColorBlendType_Overlay]="ColorBlend_Overlay",h[h.ColorBlend_SoftLight=Live2DCubismCore.ColorBlendType_SoftLight]="ColorBlend_SoftLight",h[h.ColorBlend_HardLight=Live2DCubismCore.ColorBlendType_HardLight]="ColorBlend_HardLight",h[h.ColorBlend_LinearLight=Live2DCubismCore.ColorBlendType_LinearLight]="ColorBlend_LinearLight",h[h.ColorBlend_Hue=Live2DCubismCore.ColorBlendType_Hue]="ColorBlend_Hue",h[h.ColorBlend_Color=Live2DCubismCore.ColorBlendType_Color]="ColorBlend_Color",h[h.ColorBlend_AddCompatible=Live2DCubismCore.ColorBlendType_AddCompatible]="ColorBlend_AddCompatible",h[h.ColorBlend_MultiplyCompatible=Live2DCubismCore.ColorBlendType_MultiplyCompatible]="ColorBlend_MultiplyCompatible",h))(ve||{}),As=(o=>(o[o.AlphaBlend_None=-1]="AlphaBlend_None",o[o.AlphaBlend_Over=0]="AlphaBlend_Over",o[o.AlphaBlend_Atop=1]="AlphaBlend_Atop",o[o.AlphaBlend_Out=2]="AlphaBlend_Out",o[o.AlphaBlend_ConjointOver=3]="AlphaBlend_ConjointOver",o[o.AlphaBlend_DisjointOver=4]="AlphaBlend_DisjointOver",o))(As||{});var Nc=class{constructor(e=!1,r=!1){this.isOverridden=e,this.isParameterRepeated=r}isOverridden;isParameterRepeated};var ka=class{constructor(e=!1,r=!1){this.isOverridden=e,this.isCulling=r}isOverridden;isCulling},Uc=class{drawableIndices;offscreenIndices;constructor(e=new Array,r=new Array){this.drawableIndices=e,this.offscreenIndices=r}},Va=class{objectType;objectIndex;constructor(e,r){this.objectIndex=e,this.objectType=r}},Gc=class{objects;childDrawObjects;constructor(e=new Array,r=new Uc){this.objects=e,this.childDrawObjects=r}getChildObjectCount(){return this.objects.length}},ui=class{update(){this._model.update(),this._model.drawables.resetDynamicFlags()}getPixelsPerUnit(){return this._model==null?0:this._model.canvasinfo.PixelsPerUnit}getCanvasWidth(){return this._model==null?0:this._model.canvasinfo.CanvasWidth/this._model.canvasinfo.PixelsPerUnit}getCanvasHeight(){return this._model==null?0:this._model.canvasinfo.CanvasHeight/this._model.canvasinfo.PixelsPerUnit}saveParameters(){let e=this._model.parameters.count,r=this._savedParameters.length;for(let n=0;n<e;++n)n<r?this._savedParameters[n]=this._parameterValues[n]:this._savedParameters.push(this._parameterValues[n])}getOverrideMultiplyAndScreenColor(){return this._overrideMultiplyAndScreenColor}getOverrideFlagForModelParameterRepeat(){return this._isOverriddenParameterRepeat}setOverrideFlagForModelParameterRepeat(e){this._isOverriddenParameterRepeat=e}getOverrideFlagForParameterRepeat(e){return this._userParameterRepeatDataList[e].isOverridden}setOverrideFlagForParameterRepeat(e,r){this._userParameterRepeatDataList[e].isOverridden=r}getRepeatFlagForParameterRepeat(e){return this._userParameterRepeatDataList[e].isParameterRepeated}setRepeatFlagForParameterRepeat(e,r){this._userParameterRepeatDataList[e].isParameterRepeated=r}getDrawableCulling(e){if(this.getOverrideFlagForModelCullings()||this.getOverrideFlagForDrawableCullings(e))return this._userDrawableCullings[e].isCulling;let r=this._model.drawables.constantFlags;return!Live2DCubismCore.Utils.hasIsDoubleSidedBit(r[e])}setDrawableCulling(e,r){this._userDrawableCullings[e].isCulling=r}getOffscreenCulling(e){if(this.getOverrideFlagForModelCullings()||this.getOverrideFlagForOffscreenCullings(e))return this._userOffscreenCullings[e].isCulling;let r=this._model.offscreens.constantFlags;return!Live2DCubismCore.Utils.hasIsDoubleSidedBit(r[e])}setOffscreenCulling(e,r){this._userOffscreenCullings[e].isCulling=r}getOverrideFlagForModelCullings(){return this._isOverriddenCullings}setOverrideFlagForModelCullings(e){this._isOverriddenCullings=e}getOverrideFlagForDrawableCullings(e){return this._userDrawableCullings[e].isOverridden}getOverrideFlagForOffscreenCullings(e){return this._userOffscreenCullings[e].isOverridden}setOverrideFlagForDrawableCullings(e,r){this._userDrawableCullings[e].isOverridden=r}getModelOapcity(){return this._modelOpacity}setModelOapcity(e){this._modelOpacity=e}getModel(){return this._model}getPartIndex(e){let r,n=this._model.parts.count;for(r=0;r<n;++r)if(e==this._partIds[r])return r;return this._notExistPartId.has(e)?this._notExistPartId.get(e):(r=n+this._notExistPartId.size,this._notExistPartId.set(e,r),this._notExistPartOpacities.set(r,null),r)}getPartId(e){let r=this._model.parts.ids[e];return B.getIdManager().getId(r)}getPartCount(){return this._model.parts.count}getPartOffscreenIndices(){return this._model.parts.offscreenIndices}getPartParentPartIndices(){return this._model.parts.parentIndices}setPartOpacityByIndex(e,r){if(this._notExistPartOpacities.has(e)){this._notExistPartOpacities.set(e,r);return}ie(0<=e&&e<this.getPartCount()),this._partOpacities[e]=r}setPartOpacityById(e,r){let n=this.getPartIndex(e);n<0||this.setPartOpacityByIndex(n,r)}getPartOpacityByIndex(e){return this._notExistPartOpacities.has(e)?this._notExistPartOpacities.get(e):(ie(0<=e&&e<this.getPartCount()),this._partOpacities[e])}getPartOpacityById(e){let r=this.getPartIndex(e);return r<0?0:this.getPartOpacityByIndex(r)}getParameterIndex(e){let r,n=this._model.parameters.count;for(r=0;r<n;++r)if(e==this._parameterIds[r])return r;return this._notExistParameterId.has(e)?this._notExistParameterId.get(e):(r=this._model.parameters.count+this._notExistParameterId.size,this._notExistParameterId.set(e,r),this._notExistParameterValues.set(r,null),r)}getParameterCount(){return this._model.parameters.count}getParameterType(e){return this._model.parameters.types[e]}getParameterMaximumValue(e){return this._model.parameters.maximumValues[e]}getParameterMinimumValue(e){return this._model.parameters.minimumValues[e]}getParameterDefaultValue(e){return this._model.parameters.defaultValues[e]}getParameterId(e){return B.getIdManager().getId(this._model.parameters.ids[e])}getParameterValueByIndex(e){return this._notExistParameterValues.has(e)?this._notExistParameterValues.get(e):(ie(0<=e&&e<this.getParameterCount()),this._parameterValues[e])}getParameterValueById(e){let r=this.getParameterIndex(e);return this.getParameterValueByIndex(r)}setParameterValueByIndex(e,r,n=1){if(this._notExistParameterValues.has(e)){this._notExistParameterValues.set(e,n==1?r:this._notExistParameterValues.get(e)*(1-n)+r*n);return}ie(0<=e&&e<this.getParameterCount()),this.isRepeat(e)?r=this.getParameterRepeatValue(e,r):r=this.getParameterClampValue(e,r),this._parameterValues[e]=n==1?r:this._parameterValues[e]=this._parameterValues[e]*(1-n)+r*n}setParameterValueById(e,r,n=1){let i=this.getParameterIndex(e);this.setParameterValueByIndex(i,r,n)}addParameterValueByIndex(e,r,n=1){this.setParameterValueByIndex(e,this.getParameterValueByIndex(e)+r*n)}addParameterValueById(e,r,n=1){let i=this.getParameterIndex(e);this.addParameterValueByIndex(i,r,n)}isRepeat(e){if(this._notExistParameterValues.has(e))return!1;ie(0<=e&&e<this.getParameterCount());let r;return this._isOverriddenParameterRepeat||this._userParameterRepeatDataList[e].isOverridden?r=this._userParameterRepeatDataList[e].isParameterRepeated:r=this._model.parameters.repeats[e]!=0,r}getParameterRepeatValue(e,r){if(this._notExistParameterValues.has(e))return r;ie(0<=e&&e<this.getParameterCount());let n=this._model.parameters.maximumValues[e],i=this._model.parameters.minimumValues[e],s=n-i;if(n<r){let o=L.mod(r-n,s);Number.isNaN(o)?r=n:r=i+o}if(r<i){let o=L.mod(i-r,s);Number.isNaN(o)?r=i:r=n-o}return r}getParameterClampValue(e,r){if(this._notExistParameterValues.has(e))return r;ie(0<=e&&e<this.getParameterCount());let n=this._model.parameters.maximumValues[e],i=this._model.parameters.minimumValues[e];return L.clamp(r,i,n)}getParameterRepeats(e){return this._model.parameters.repeats[e]!=0}multiplyParameterValueById(e,r,n=1){let i=this.getParameterIndex(e);this.multiplyParameterValueByIndex(i,r,n)}multiplyParameterValueByIndex(e,r,n=1){this.setParameterValueByIndex(e,this.getParameterValueByIndex(e)*(1+(r-1)*n))}getDrawableIndex(e){let r=this._model.drawables.count;for(let n=0;n<r;++n)if(this._drawableIds[n]==e)return n;return-1}getDrawableCount(){return this._model.drawables.count}getDrawableId(e){let r=this._model.drawables.ids;return B.getIdManager().getId(r[e])}getRenderOrders(){return this._model.getRenderOrders()}getDrawableTextureIndex(e){return this._model.drawables.textureIndices[e]}getDrawableDynamicFlagVertexPositionsDidChange(e){let r=this._model.drawables.dynamicFlags;return Live2DCubismCore.Utils.hasVertexPositionsDidChangeBit(r[e])}getDrawableVertexIndexCount(e){return this._model.drawables.indexCounts[e]}getDrawableVertexCount(e){return this._model.drawables.vertexCounts[e]}getDrawableVertices(e){return this.getDrawableVertexPositions(e)}getDrawableVertexIndices(e){return this._model.drawables.indices[e]}getDrawableVertexPositions(e){return this._model.drawables.vertexPositions[e]}getDrawableVertexUvs(e){return this._model.drawables.vertexUvs[e]}getDrawableOpacity(e){return this._model.drawables.opacities[e]}getDrawableMultiplyColor(e){this._drawableMultiplyColors==null&&(this._drawableMultiplyColors=new Array(this._model.drawables.count),this._drawableMultiplyColors.fill(new U));let r=this._model.drawables.multiplyColors,n=e*4;return this._drawableMultiplyColors[e].r=r[n],this._drawableMultiplyColors[e].g=r[n+1],this._drawableMultiplyColors[e].b=r[n+2],this._drawableMultiplyColors[e].a=r[n+3],this._drawableMultiplyColors[e]}getDrawableScreenColor(e){this._drawableScreenColors==null&&(this._drawableScreenColors=new Array(this._model.drawables.count),this._drawableScreenColors.fill(new U));let r=this._model.drawables.screenColors,n=e*4;return this._drawableScreenColors[e].r=r[n],this._drawableScreenColors[e].g=r[n+1],this._drawableScreenColors[e].b=r[n+2],this._drawableScreenColors[e].a=r[n+3],this._drawableScreenColors[e]}getOffscreenMultiplyColor(e){this._offscreenMultiplyColors==null&&(this._offscreenMultiplyColors=new Array(this._model.offscreens.count),this._offscreenMultiplyColors.fill(new U));let r=this._model.offscreens.multiplyColors,n=e*4;return this._offscreenMultiplyColors[e].r=r[n],this._offscreenMultiplyColors[e].g=r[n+1],this._offscreenMultiplyColors[e].b=r[n+2],this._offscreenMultiplyColors[e].a=r[n+3],this._offscreenMultiplyColors[e]}getOffscreenScreenColor(e){this._offscreenScreenColors==null&&(this._offscreenScreenColors=new Array(this._model.offscreens.count),this._offscreenScreenColors.fill(new U));let r=this._model.offscreens.screenColors,n=e*4;return this._offscreenScreenColors[e].r=r[n],this._offscreenScreenColors[e].g=r[n+1],this._offscreenScreenColors[e].b=r[n+2],this._offscreenScreenColors[e].a=r[n+3],this._offscreenScreenColors[e]}getDrawableParentPartIndex(e){return this._model.drawables.parentPartIndices[e]}getDrawableBlendMode(e){let r=this._model.drawables.constantFlags;return Live2DCubismCore.Utils.hasBlendAdditiveBit(r[e])?1:Live2DCubismCore.Utils.hasBlendMultiplicativeBit(r[e])?2:0}getDrawableColorBlend(e){return this._drawableColorBlends[e]==-1&&(this._drawableColorBlends[e]=this._model.drawables.blendModes[e]&255),this._drawableColorBlends[e]}getDrawableAlphaBlend(e){return this._drawableAlphaBlends[e]==-1&&(this._drawableAlphaBlends[e]=this._model.drawables.blendModes[e]>>8&255),this._drawableAlphaBlends[e]}getDrawableInvertedMaskBit(e){let r=this._model.drawables.constantFlags;return Live2DCubismCore.Utils.hasIsInvertedMaskBit(r[e])}getDrawableMasks(){return this._model.drawables.masks}getDrawableMaskCounts(){return this._model.drawables.maskCounts}isUsingMasking(){for(let e=0;e<this._model.drawables.count;++e)if(!(this._model.drawables.maskCounts[e]<=0))return!0;return!1}isUsingMaskingForOffscreen(){for(let e=0;e<this.getOffscreenCount();++e)if(!(this._model.offscreens.maskCounts[e]<=0))return!0;return!1}getDrawableDynamicFlagIsVisible(e){let r=this._model.drawables.dynamicFlags;return Live2DCubismCore.Utils.hasIsVisibleBit(r[e])}getDrawableDynamicFlagVisibilityDidChange(e){let r=this._model.drawables.dynamicFlags;return Live2DCubismCore.Utils.hasVisibilityDidChangeBit(r[e])}getDrawableDynamicFlagOpacityDidChange(e){let r=this._model.drawables.dynamicFlags;return Live2DCubismCore.Utils.hasOpacityDidChangeBit(r[e])}getDrawableDynamicFlagRenderOrderDidChange(e){let r=this._model.drawables.dynamicFlags;return Live2DCubismCore.Utils.hasRenderOrderDidChangeBit(r[e])}getDrawableDynamicFlagBlendColorDidChange(e){let r=this._model.drawables.dynamicFlags;return Live2DCubismCore.Utils.hasBlendColorDidChangeBit(r[e])}getOffscreenCount(){return this._model.offscreens.count}getOffscreenColorBlend(e){return this._offscreenColorBlends[e]==-1&&(this._offscreenColorBlends[e]=this._model.offscreens.blendModes[e]&255),this._offscreenColorBlends[e]}getOffscreenAlphaBlend(e){return this._offscreenAlphaBlends[e]==-1&&(this._offscreenAlphaBlends[e]=this._model.offscreens.blendModes[e]>>8&255),this._offscreenAlphaBlends[e]}getOffscreenOwnerIndices(){return this._model.offscreens.ownerIndices}getOffscreenOpacity(e){return e<0||e>=this._model.offscreens.count?1:this._model.offscreens.opacities[e]}getOffscreenMasks(){return this._model.offscreens.masks}getOffscreenMaskCounts(){return this._model.offscreens.maskCounts}getOffscreenInvertedMask(e){let r=this._model.offscreens.constantFlags;return Live2DCubismCore.Utils.hasIsInvertedMaskBit(r[e])}isBlendModeEnabled(){return this._isBlendModeEnabled}loadParameters(){let e=this._model.parameters.count,r=this._savedParameters.length;e>r&&(e=r);for(let n=0;n<e;++n)this._parameterValues[n]=this._savedParameters[n]}initialize(){ie(this._model),this._parameterValues=this._model.parameters.values,this._partOpacities=this._model.parts.opacities,this._offscreenOpacities=this._model.offscreens.opacities,this._parameterMaximumValues=this._model.parameters.maximumValues,this._parameterMinimumValues=this._model.parameters.minimumValues;{let r=this._model.parameters.ids,n=this._model.parameters.count;this._parameterIds.length=n,this._userParameterRepeatDataList.length=n;for(let i=0;i<n;++i)this._parameterIds[i]=B.getIdManager().getId(r[i]),this._userParameterRepeatDataList[i]=new Nc(!1,!1)}let e=this._model.parts.count;{let r=this._model.parts.ids;this._partIds.length=e;for(let n=0;n<e;++n)this._partIds[n]=B.getIdManager().getId(r[n])}{let r=this._model.drawables.ids,n=this._model.drawables.count;this._userDrawableCullings.length=n;let i=new ka(!1,!1);this._userOffscreenCullings.length=this._model.offscreens.count;let s=new ka(!1,!1);for(let l=0;l<n;++l)this._drawableIds.push(B.getIdManager().getId(r[l])),this._userDrawableCullings[l]=i;for(let l=0;l<this._model.offscreens.count;++l)this._userOffscreenCullings[l]=s;if(this.getOffscreenCount()>0)this._isBlendModeEnabled=!0;else{let l=this._model.drawables.blendModes;for(let a=0;a<n;++a){let u=this.getDrawableColorBlend(a),d=this.getDrawableAlphaBlend(a);if(!(u==ve.ColorBlend_Normal&&d==0)&&u!=ve.ColorBlend_AddCompatible&&u!=ve.ColorBlend_MultiplyCompatible){this._isBlendModeEnabled=!0;break}}}this.setupPartsHierarchy();let o=this.getOffscreenCount();this._overrideMultiplyAndScreenColor.initialize(e,n,o)}}getPartsHierarchy(){return this._partsHierarchy}setupPartsHierarchy(){this._partsHierarchy.length=0;let e=this.getPartCount();this._partsHierarchy.length=e;for(let n=0;n<e;++n){let i=new Gc;this._partsHierarchy[n]=i}for(let n=0;n<e;++n){let i=this.getPartParentPartIndices()[n];if(i!==Kr){for(let s=0;s<this._partsHierarchy.length;++s)if(s===i){let o=new Va(n,1);this._partsHierarchy[s].objects.push(o);break}}}let r=this.getDrawableCount();for(let n=0;n<r;++n){let i=this.getDrawableParentPartIndex(n);if(i!==Kr){for(let s=0;s<this._partsHierarchy.length;++s)if(s===i){let o=new Va(n,0);this._partsHierarchy[s].objects.push(o);break}}}for(let n=0;n<this._partsHierarchy.length;++n)this.getPartChildDrawObjects(n)}getPartChildDrawObjects(e){if(this._partsHierarchy[e].getChildObjectCount()<1)return this._partsHierarchy[e].childDrawObjects;let r=this._partsHierarchy[e].childDrawObjects;if(r.drawableIndices.length!==0||r.offscreenIndices.length!==0)return r;let n=this._partsHierarchy[e].objects;for(let i=0;i<n.length;++i){let s=n[i];if(s.objectType===1){this.getPartChildDrawObjects(s.objectIndex);let o=this._partsHierarchy[s.objectIndex].childDrawObjects;r.drawableIndices.push(...o.drawableIndices),r.offscreenIndices.push(...o.offscreenIndices);let l=this.getOffscreenIndices(),a=l?l[s.objectIndex]:Es;a!==Es&&r.offscreenIndices.push(a)}else s.objectType===0&&r.drawableIndices.push(s.objectIndex)}return r}getOffscreenIndices(){return this._model.parts.offscreenIndices}constructor(e){this._model=e,this._parameterValues=null,this._parameterMaximumValues=null,this._parameterMinimumValues=null,this._partOpacities=null,this._offscreenOpacities=null,this._savedParameters=new Array,this._parameterIds=new Array,this._drawableIds=new Array,this._partIds=new Array,this._isOverriddenParameterRepeat=!0,this._isOverriddenCullings=!1,this._modelOpacity=1,this._overrideMultiplyAndScreenColor=new Aa(this),this._isBlendModeEnabled=!1,this._drawableColorBlends=null,this._drawableAlphaBlends=null,this._offscreenColorBlends=null,this._offscreenAlphaBlends=null,this._drawableMultiplyColors=null,this._drawableScreenColors=null,this._offscreenMultiplyColors=null,this._offscreenScreenColors=null,this._userParameterRepeatDataList=new Array,this._userDrawableCullings=new Array,this._userOffscreenCullings=new Array,this._partsHierarchy=new Array,this._notExistPartId=new Map,this._notExistParameterId=new Map,this._notExistParameterValues=new Map,this._notExistPartOpacities=new Map,this._drawableColorBlends=new Array(e.drawables.count).fill(-1),this._drawableAlphaBlends=new Array(e.drawables.count).fill(-1),this._offscreenColorBlends=new Array(e.offscreens.count).fill(-1),this._offscreenAlphaBlends=new Array(e.offscreens.count).fill(-1)}release(){this._model.release(),this._model=null,this._drawableColorBlends=null,this._drawableAlphaBlends=null,this._offscreenColorBlends=null,this._offscreenAlphaBlends=null,this._drawableMultiplyColors=null,this._drawableScreenColors=null,this._offscreenMultiplyColors=null,this._offscreenScreenColors=null}_notExistPartOpacities;_notExistPartId;_notExistParameterValues;_notExistParameterId;_savedParameters;_isOverriddenParameterRepeat;_overrideMultiplyAndScreenColor;_userParameterRepeatDataList;_partsHierarchy;_model;_parameterValues;_parameterMaximumValues;_parameterMinimumValues;_partOpacities;_offscreenOpacities;_modelOpacity;_parameterIds;_partIds;_drawableIds;_isOverriddenCullings;_userDrawableCullings;_userOffscreenCullings;_isBlendModeEnabled;_drawableColorBlends;_drawableAlphaBlends;_offscreenColorBlends;_offscreenAlphaBlends;_drawableMultiplyColors;_drawableScreenColors;_offscreenMultiplyColors;_offscreenScreenColors},NC;(e=>e.CubismModel=ui)(NC||={});var zc=4,GC=36,zC=32,Oa=class{constructor(e){this._renderTextureCount=0,this._clippingMaskBufferSize=256,this._clippingContextListForMask=new Array,this._clippingContextListForDraw=new Array,this._clippingContextListForOffscreen=new Array,this._tmpBoundsOnModel=new $t,this._tmpMatrix=new W,this._tmpMatrixForMask=new W,this._tmpMatrixForDraw=new W,this._clearedMaskBufferFlags=new Array,this._clippingContexttConstructor=e,this._channelColors=[new U(1,0,0,0),new U(0,1,0,0),new U(0,0,1,0),new U(0,0,0,1)]}release(){for(let e=0;e<this._clippingContextListForMask.length;e++)this._clippingContextListForMask[e]&&(this._clippingContextListForMask[e].release(),this._clippingContextListForMask[e]=void 0),this._clippingContextListForMask[e]=null;this._clippingContextListForMask=null;for(let e=0;e<this._clippingContextListForDraw.length;e++)this._clippingContextListForDraw[e]=null;this._clippingContextListForDraw=null;for(let e=0;e<this._channelColors.length;e++)this._channelColors[e]=null;this._channelColors=null,this._clearedMaskBufferFlags!=null&&(this._clearedMaskBufferFlags.length=0),this._clearedMaskBufferFlags=null}initializeForDrawable(e,r){r%1!=0&&(Y("The number of render textures must be specified as an integer. The decimal point is rounded down and corrected to an integer."),r=~~r),r<1&&Y("The number of render textures must be an integer greater than or equal to 1. Set the number of render textures to 1."),this._renderTextureCount=r<1?1:r,this._clearedMaskBufferFlags=new Array(this._renderTextureCount),this._clippingContextListForDraw.length=e.getDrawableCount();for(let n=0;n<e.getDrawableCount();n++){if(e.getDrawableMaskCounts()[n]<=0){this._clippingContextListForDraw[n]=null;continue}let i=this.findSameClip(e.getDrawableMasks()[n],e.getDrawableMaskCounts()[n]);i==null&&(i=new this._clippingContexttConstructor(this,e.getDrawableMasks()[n],e.getDrawableMaskCounts()[n]),this._clippingContextListForMask.push(i)),i.addClippedDrawable(n),this._clippingContextListForDraw[n]=i}}initializeForOffscreen(e,r){this._renderTextureCount=r,this._clearedMaskBufferFlags.length=this._renderTextureCount;for(let n=0;n<this._renderTextureCount;++n)this._clearedMaskBufferFlags[n]=!1;this._clippingContextListForOffscreen.length=e.getOffscreenCount();for(let n=0;n<e.getOffscreenCount();++n){if(e.getOffscreenMaskCounts()[n]<=0){this._clippingContextListForOffscreen.push(null);continue}let i=this.findSameClip(e.getOffscreenMasks()[n],e.getOffscreenMaskCounts()[n]);i==null&&(i=new this._clippingContexttConstructor(this,e.getOffscreenMasks()[n],e.getOffscreenMaskCounts()[n]),this._clippingContextListForMask.push(i)),i.addClippedOffscreen(n),this._clippingContextListForOffscreen[n]=i}}findSameClip(e,r){for(let n=0;n<this._clippingContextListForMask.length;n++){let i=this._clippingContextListForMask[n],s=i._clippingIdCount;if(s!=r)continue;let o=0;for(let l=0;l<s;l++){let a=i._clippingIdList[l];for(let u=0;u<s;u++)if(e[u]==a){o++;break}}if(o==s)return i}return null}setupMatrixForHighPrecision(e,r){let n=0;for(let i=0;i<this._clippingContextListForMask.length;i++){let s=this._clippingContextListForMask[i];this.calcClippedDrawableTotalBounds(e,s),s._isUsing&&n++}if(n>0){if(this.setupLayoutBounds(0),this._clearedMaskBufferFlags.length!=this._renderTextureCount){this._clearedMaskBufferFlags.length=this._renderTextureCount;for(let i=0;i<this._renderTextureCount;i++)this._clearedMaskBufferFlags[i]=!1}else for(let i=0;i<this._renderTextureCount;i++)this._clearedMaskBufferFlags[i]=!1;for(let i=0;i<this._clippingContextListForMask.length;i++){let s=this._clippingContextListForMask[i],o=s._allClippedDrawRect,l=s._layoutBounds,a=.05,u=0,d=0,c=e.getPixelsPerUnit(),p=s.getClippingManager().getClippingMaskBufferSize(),_=l.width*p,m=l.height*p;this._tmpBoundsOnModel.setRect(o),this._tmpBoundsOnModel.width*c>_?(this._tmpBoundsOnModel.expand(o.width*a,0),u=l.width/this._tmpBoundsOnModel.width):u=c/_,this._tmpBoundsOnModel.height*c>m?(this._tmpBoundsOnModel.expand(0,o.height*a),d=l.height/this._tmpBoundsOnModel.height):d=c/m,this.createMatrixForMask(r,l,u,d),s._matrixForMask.setMatrix(this._tmpMatrixForMask.getArray()),s._matrixForDraw.setMatrix(this._tmpMatrixForDraw.getArray())}}}setupMatrixForOffscreenHighPrecision(e,r,n){let i=0;for(let s=0;s<this._clippingContextListForMask.length;s++){let o=this._clippingContextListForMask[s];this.calcClippedOffscreenTotalBounds(e,o),o._isUsing&&i++}if(!(i<=0)){if(this.setupLayoutBounds(0),this._clearedMaskBufferFlags.length!=this._renderTextureCount){this._clearedMaskBufferFlags.length=this._renderTextureCount;for(let s=0;s<this._renderTextureCount;++s)this._clearedMaskBufferFlags[s]=!1}else for(let s=0;s<this._renderTextureCount;++s)this._clearedMaskBufferFlags[s]=!1;for(let s=0;s<this._clippingContextListForMask.length;s++){let o=this._clippingContextListForMask[s],l=o._allClippedDrawRect,a=o._layoutBounds,u=.05,d=0,c=0,p=e.getPixelsPerUnit(),_=o.getClippingManager().getClippingMaskBufferSize(),m=a.width*_,f=a.height*_;this._tmpBoundsOnModel.setRect(l),this._tmpBoundsOnModel.width*p>m?(this._tmpBoundsOnModel.expand(l.width*u,0),d=a.width/this._tmpBoundsOnModel.width):d=p/m,this._tmpBoundsOnModel.height*p>f?(this._tmpBoundsOnModel.expand(0,l.height*u),c=a.height/this._tmpBoundsOnModel.height):c=p/f,this.createMatrixForMask(r,a,d,c),o._matrixForMask.setMatrix(this._tmpMatrixForMask.getArray()),o._matrixForDraw.setMatrix(this._tmpMatrixForDraw.getArray());let y=n.getInvert();o._matrixForDraw.multiplyByMatrix(y)}}}calcClippedOffscreenTotalBounds(e,r){let n=Number.MAX_VALUE,i=Number.MAX_VALUE,s=-Number.MAX_VALUE,o=-Number.MAX_VALUE,l=r._clippedOffscreenIndexList.length,a=new Array;for(let d=0;d<l;d++){let c=r._clippedOffscreenIndexList[d];this.getOffscreenChildDrawableIndexList(e,c,a)}let u=a.length;for(let d=0;d<u;d++){let c=e.getDrawableVertexCount(a[d]),p=e.getDrawableVertices(a[d]),_=Number.MAX_VALUE,m=Number.MAX_VALUE,f=-Number.MAX_VALUE,y=-Number.MAX_VALUE,b=c*He.vertexStep;for(let g=He.vertexOffset;g<b;g+=He.vertexStep){let h=p[g],C=p[g+1];h<_&&(_=h),h>f&&(f=h),C<m&&(m=C),C>y&&(y=C)}_!=Number.MAX_VALUE&&(_<n&&(n=_),m<i&&(i=m),f>s&&(s=f),y>o&&(o=y))}if(n==Number.MAX_VALUE)r._allClippedDrawRect.x=0,r._allClippedDrawRect.y=0,r._allClippedDrawRect.width=0,r._allClippedDrawRect.height=0,r._isUsing=!1;else{r._isUsing=!0;let d=s-n,c=o-i;r._allClippedDrawRect.x=n,r._allClippedDrawRect.y=i,r._allClippedDrawRect.width=d,r._allClippedDrawRect.height=c}}getOffscreenChildDrawableIndexList(e,r,n){let i=e.getOffscreenOwnerIndices()[r];this.getPartChildDrawableIndexList(e,i,n)}getPartChildDrawableIndexList(e,r,n){let i=e.getPartsHierarchy()[r].childDrawObjects;n.push(...i.drawableIndices);for(let s=0;s<i.offscreenIndices.length;++s)this.getOffscreenChildDrawableIndexList(e,i.offscreenIndices[s],n)}createMatrixForMask(e,r,n,i){this._tmpMatrix.loadIdentity(),this._tmpMatrix.translateRelative(-1,-1),this._tmpMatrix.scaleRelative(2,2),this._tmpMatrix.translateRelative(r.x,r.y),this._tmpMatrix.scaleRelative(n,i),this._tmpMatrix.translateRelative(-this._tmpBoundsOnModel.x,-this._tmpBoundsOnModel.y),this._tmpMatrixForMask.setMatrix(this._tmpMatrix.getArray()),this._tmpMatrix.loadIdentity(),this._tmpMatrix.translateRelative(r.x,r.y*(e?-1:1)),this._tmpMatrix.scaleRelative(n,i*(e?-1:1)),this._tmpMatrix.translateRelative(-this._tmpBoundsOnModel.x,-this._tmpBoundsOnModel.y),this._tmpMatrixForDraw.setMatrix(this._tmpMatrix.getArray())}setupLayoutBounds(e){let r=this._renderTextureCount<=1?GC:zC*this._renderTextureCount;if(e<=0||e>r){e>r&&R(`not supported mask count : {0}
|
|
25
|
+
[Details] render texture count : {1}, mask count : {2}`,e-r,this._renderTextureCount,e);for(let u=0;u<this._clippingContextListForMask.length;u++){let d=this._clippingContextListForMask[u];d._layoutChannelIndex=0,d._layoutBounds.x=0,d._layoutBounds.y=0,d._layoutBounds.width=1,d._layoutBounds.height=1,d._bufferIndex=0}return}let n=this._renderTextureCount<=1?9:8,i=e/this._renderTextureCount,s=e%this._renderTextureCount;i=Math.ceil(i);let o=i/zc,l=i%zc;o=~~o;let a=0;for(let u=0;u<this._renderTextureCount;u++)for(let d=0;d<zc;d++){let c=o+(d<l?1:0),p=l+(o<1?-1:0);if(d==p&&s>0&&(c-=u<s?0:1),c!=0)if(c==1){let _=this._clippingContextListForMask[a++];_._layoutChannelIndex=d,_._layoutBounds.x=0,_._layoutBounds.y=0,_._layoutBounds.width=1,_._layoutBounds.height=1,_._bufferIndex=u}else if(c==2)for(let _=0;_<c;_++){let m=_%2;m=~~m;let f=this._clippingContextListForMask[a++];f._layoutChannelIndex=d,f._layoutBounds.x=m*.5,f._layoutBounds.y=0,f._layoutBounds.width=.5,f._layoutBounds.height=1,f._bufferIndex=u}else if(c<=4)for(let _=0;_<c;_++){let m=_%2,f=_/2;m=~~m,f=~~f;let y=this._clippingContextListForMask[a++];y._layoutChannelIndex=d,y._layoutBounds.x=m*.5,y._layoutBounds.y=f*.5,y._layoutBounds.width=.5,y._layoutBounds.height=.5,y._bufferIndex=u}else if(c<=n)for(let _=0;_<c;_++){let m=_%3,f=_/3;m=~~m,f=~~f;let y=this._clippingContextListForMask[a++];y._layoutChannelIndex=d,y._layoutBounds.x=m/3,y._layoutBounds.y=f/3,y._layoutBounds.width=1/3,y._layoutBounds.height=1/3,y._bufferIndex=u}else{R(`not supported mask count : {0}
|
|
26
|
+
[Details] render texture count : {1}, mask count : {2}`,e-r,this._renderTextureCount,e);for(let _=0;_<c;_++){let m=this._clippingContextListForMask[a++];m._layoutChannelIndex=0,m._layoutBounds.x=0,m._layoutBounds.y=0,m._layoutBounds.width=1,m._layoutBounds.height=1,m._bufferIndex=0}}}}calcClippedDrawableTotalBounds(e,r){let n=Number.MAX_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=Number.MIN_VALUE,l=r._clippedDrawableIndexList.length;for(let a=0;a<l;a++){let u=r._clippedDrawableIndexList[a],d=e.getDrawableVertexCount(u),c=e.getDrawableVertices(u),p=Number.MAX_VALUE,_=Number.MAX_VALUE,m=-Number.MAX_VALUE,f=-Number.MAX_VALUE,y=d*He.vertexStep;for(let b=He.vertexOffset;b<y;b+=He.vertexStep){let g=c[b],h=c[b+1];g<p&&(p=g),g>m&&(m=g),h<_&&(_=h),h>f&&(f=h)}if(p!=Number.MAX_VALUE)if(p<n&&(n=p),_<i&&(i=_),m>s&&(s=m),f>o&&(o=f),n==Number.MAX_VALUE)r._allClippedDrawRect.x=0,r._allClippedDrawRect.y=0,r._allClippedDrawRect.width=0,r._allClippedDrawRect.height=0,r._isUsing=!1;else{r._isUsing=!0;let b=s-n,g=o-i;r._allClippedDrawRect.x=n,r._allClippedDrawRect.y=i,r._allClippedDrawRect.width=b,r._allClippedDrawRect.height=g}}}getClippingContextListForDraw(){return this._clippingContextListForDraw}getClippingContextListForOffscreen(){return this._clippingContextListForOffscreen}getClippingMaskBufferSize(){return this._clippingMaskBufferSize}getRenderTextureCount(){return this._renderTextureCount}getChannelFlagAsColor(e){return this._channelColors[e]}setClippingMaskBufferSize(e){this._clippingMaskBufferSize=e}_clearedMaskBufferFlags;_channelColors;_clippingContextListForMask;_clippingContextListForDraw;_clippingContextListForOffscreen;_clippingMaskBufferSize;_renderTextureCount;_tmpMatrix;_tmpMatrixForMask;_tmpMatrixForDraw;_tmpBoundsOnModel;_clippingContexttConstructor};var WC="vertshadersrc.vert",HC="vertshadersrcmasked.vert",$C="vertshadersrcsetupmask.vert",jC="fragshadersrcsetupmask.frag",XC="fragshadersrcpremultipliedalpha.frag",YC="fragshadersrcmaskpremultipliedalpha.frag",JC="fragshadersrcmaskinvertedpremultipliedalpha.frag",qC="vertshadersrccopy.vert",QC="fragshadersrccopy.frag",KC="fragshadersrccolorblend.frag",ZC="fragshadersrcalphablend.frag",e0="vertshadersrcblend.vert",t0="fragshadersrcpremultipliedalphablend.frag",Sf="ColorBlend_",Pf="AlphaBlend_",ci,wf=new Float32Array([-1,-1,1,-1,-1,1,1,1]),r0=new Float32Array([0,0,1,0,0,1,1,1]),n0=new Float32Array([0,1,1,1,0,0,1,0]),ks=class{async loadShader(e){return await(await fetch(e)).text()}async loadShaders(){let e=this._shaderPath??this._defaultShaderPath,r=[{path:e+WC,prop:"_vertShaderSrc"},{path:e+HC,prop:"_vertShaderSrcMasked"},{path:e+$C,prop:"_vertShaderSrcSetupMask"},{path:e+jC,prop:"_fragShaderSrcSetupMask"},{path:e+XC,prop:"_fragShaderSrcPremultipliedAlpha"},{path:e+YC,prop:"_fragShaderSrcMaskPremultipliedAlpha"},{path:e+JC,prop:"_fragShaderSrcMaskInvertedPremultipliedAlpha"},{path:e+qC,prop:"_vertShaderSrcCopy"},{path:e+QC,prop:"_fragShaderSrcCopy"},{path:e+KC,prop:"_fragShaderSrcColorBlend"},{path:e+ZC,prop:"_fragShaderSrcAlphaBlend"},{path:e+e0,prop:"_vertShaderSrcBlend"},{path:e+t0,prop:"_fragShaderSrcBlend"}];(await Promise.all(r.map(i=>this.loadShader(i.path).then(s=>({prop:i.prop,data:s})).catch(s=>(console.error(`Error loading ${i.path} shader:`,s),{prop:i.prop,data:""}))))).forEach(i=>{this[i.prop]=i.data})}constructor(){this._shaderSets=new Array,this._isShaderLoading=!1,this._isShaderLoaded=!1,this._colorBlendMap=new Map,this._colorBlendValues=new Array;let e=Object.keys(ve),r=Object.keys(ve).map(s=>ve[s]);for(let s=0;s<e.length;s++){let o=e[s];if(o.includes(Sf)){let l=o.slice(Sf.length),a=parseInt(r[s].toString());this._colorBlendMap.set(a,l),this._colorBlendValues.push(a)}}this._alphaBlendMap=new Map,this._alphaBlendValues=new Array;let n=Object.keys(As),i=Object.keys(As).map(s=>As[s]);for(let s=0;s<n.length;s++){let o=n[s];if(o.includes(Pf)){let l=o.slice(Pf.length),a=parseInt(i[s].toString());this._alphaBlendMap.set(a,l),this._alphaBlendValues.push(a)}}this._blendShaderSetMap=new Map,this._shaderCount=11+(this._colorBlendValues.length-3)*(this._alphaBlendValues.length-1)*3,this._defaultShaderPath="../../Framework/Shaders/WebGL/",this._shaderPath=this._defaultShaderPath}release(){this.releaseShaderProgram()}setupShaderProgramForDrawable(e,r,n){if(e.isPremultipliedAlpha()||R("NoPremultipliedAlpha is not allowed"),this._shaderSets.length==0&&this.generateShaders(),this._isShaderLoaded==!1){Y("Shader program is not initialized.");return}let i,s,o,l,a=e.getClippingContextBufferForDrawable()!=null,u=r.getDrawableInvertedMaskBit(n),d=a?u?2:1:0,c,p=!0;if(r.isBlendModeEnabled()){let M=r.getDrawableColorBlend(n),P=r.getDrawableAlphaBlend(n);if(M==-1||P==-1||M==ve.ColorBlend_Normal&&P==0)c=this._shaderSets[1+d],i=this.gl.ONE,s=this.gl.ONE_MINUS_SRC_ALPHA,o=this.gl.ONE,l=this.gl.ONE_MINUS_SRC_ALPHA;else switch(M){case ve.ColorBlend_AddCompatible:c=this._shaderSets[4+d],i=this.gl.ONE,s=this.gl.ONE,o=this.gl.ZERO,l=this.gl.ONE;break;case ve.ColorBlend_MultiplyCompatible:c=this._shaderSets[7+d],i=this.gl.DST_COLOR,s=this.gl.ONE_MINUS_SRC_ALPHA,o=this.gl.ZERO,l=this.gl.ONE;break;default:{let A=e._currentOffscreen!=null?e._currentOffscreen:e.getModelRenderTarget(0);De.copyBuffer(this.gl,A,e.getModelRenderTarget(1));let k=this._blendShaderSetMap.get(this._colorBlendMap.get(M)+this._alphaBlendMap.get(P));c=this._shaderSets[k+d],i=this.gl.ONE,s=this.gl.ZERO,o=this.gl.ONE,l=this.gl.ZERO,p=!1}break}}else switch(r.getDrawableBlendMode(n)){case 0:default:c=this._shaderSets[1+d],i=this.gl.ONE,s=this.gl.ONE_MINUS_SRC_ALPHA,o=this.gl.ONE,l=this.gl.ONE_MINUS_SRC_ALPHA;break;case 1:c=this._shaderSets[4+d],i=this.gl.ONE,s=this.gl.ONE,o=this.gl.ZERO,l=this.gl.ONE;break;case 2:c=this._shaderSets[7+d],i=this.gl.DST_COLOR,s=this.gl.ONE_MINUS_SRC_ALPHA,o=this.gl.ZERO,l=this.gl.ONE;break}this.gl.useProgram(c.shaderProgram),e._bufferData.vertex==null&&(e._bufferData.vertex=this.gl.createBuffer()),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e._bufferData.vertex);let _=r.getDrawableVertices(n);this.gl.bufferData(this.gl.ARRAY_BUFFER,_,this.gl.DYNAMIC_DRAW),this.gl.enableVertexAttribArray(c.attributePositionLocation),this.gl.vertexAttribPointer(c.attributePositionLocation,2,this.gl.FLOAT,!1,0,0),e._bufferData.uv==null&&(e._bufferData.uv=this.gl.createBuffer()),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e._bufferData.uv);let m=r.getDrawableVertexUvs(n);if(this.gl.bufferData(this.gl.ARRAY_BUFFER,m,this.gl.DYNAMIC_DRAW),this.gl.enableVertexAttribArray(c.attributeTexCoordLocation),this.gl.vertexAttribPointer(c.attributeTexCoordLocation,2,this.gl.FLOAT,!1,0,0),a){this.gl.activeTexture(this.gl.TEXTURE1);let M=e.getDrawableMaskBuffer(e.getClippingContextBufferForDrawable()._bufferIndex).getColorBuffer();this.gl.bindTexture(this.gl.TEXTURE_2D,M),this.gl.uniform1i(c.samplerTexture1Location,1),this.gl.uniformMatrix4fv(c.uniformClipMatrixLocation,!1,e.getClippingContextBufferForDrawable()._matrixForDraw.getArray());let P=e.getClippingContextBufferForDrawable()._layoutChannelIndex,A=e.getClippingContextBufferForDrawable().getClippingManager().getChannelFlagAsColor(P);this.gl.uniform4f(c.uniformChannelFlagLocation,A.r,A.g,A.b,A.a),r.isBlendModeEnabled()&&this.gl.uniform1f(c.uniformInvertMaskFlagLocation,u?1:0)}let f=r.getDrawableTextureIndex(n),y=e.getBindedTextures().get(f);this.gl.activeTexture(this.gl.TEXTURE0),this.gl.bindTexture(this.gl.TEXTURE_2D,y),this.gl.uniform1i(c.samplerTexture0Location,0);let b=e.getMvpMatrix();this.gl.uniformMatrix4fv(c.uniformMatrixLocation,!1,b.getArray());let g=null;if(r.isBlendModeEnabled()){let M=r.getDrawableOpacity(n);g=new U(M,M,M,M)}else g=e.getModelColorWithOpacity(r.getDrawableOpacity(n));let h=r.getOverrideMultiplyAndScreenColor(),C=h.getDrawableMultiplyColor(n),x=h.getDrawableScreenColor(n);if(this.gl.uniform4f(c.uniformBaseColorLocation,g.r,g.g,g.b,g.a),this.gl.uniform4f(c.uniformMultiplyColorLocation,C.r,C.g,C.b,C.a),this.gl.uniform4f(c.uniformScreenColorLocation,x.r,x.g,x.b,x.a),r.isBlendModeEnabled()&&(this.gl.activeTexture(this.gl.TEXTURE2),!p)){let M=e.getModelRenderTarget(1).getColorBuffer();this.gl.bindTexture(this.gl.TEXTURE_2D,M),this.gl.uniform1i(c.samplerFrameBufferTextureLocation,2)}e._bufferData.index==null&&(e._bufferData.index=this.gl.createBuffer());let v=r.getDrawableVertexIndices(n);this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,e._bufferData.index),this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,v,this.gl.DYNAMIC_DRAW),this.gl.blendFuncSeparate(i,s,o,l)}setupShaderProgramForOffscreen(e,r,n){if(e.isPremultipliedAlpha()||R("NoPremultipliedAlpha is not allowed"),this._shaderSets.length==0&&this.generateShaders(),this._isShaderLoaded==!1){Y("Shader program is not initialized.");return}let i,s,o,l,a=n.getOffscreenIndex(),u=e.getClippingContextBufferForOffscreen()!=null,d=r.getOffscreenInvertedMask(a),c=u?d?2:1:0,p,_=!0,m=r.getOffscreenColorBlend(a),f=r.getOffscreenAlphaBlend(a);if(m==-1||f==-1||m==ve.ColorBlend_Normal&&f==0)p=this._shaderSets[1+c],i=this.gl.ONE,s=this.gl.ONE_MINUS_SRC_ALPHA,o=this.gl.ONE,l=this.gl.ONE_MINUS_SRC_ALPHA;else switch(m){case ve.ColorBlend_AddCompatible:p=this._shaderSets[4+c],i=this.gl.ONE,s=this.gl.ONE,o=this.gl.ZERO,l=this.gl.ONE;break;case ve.ColorBlend_MultiplyCompatible:p=this._shaderSets[7+c],i=this.gl.DST_COLOR,s=this.gl.ONE_MINUS_SRC_ALPHA,o=this.gl.ZERO,l=this.gl.ONE;break;default:{let M=n.getOldOffscreen()!=null?n.getOldOffscreen():e.getModelRenderTarget(0);De.copyBuffer(this.gl,M,e.getModelRenderTarget(1));let P=this._blendShaderSetMap.get(this._colorBlendMap.get(m)+this._alphaBlendMap.get(f));p=this._shaderSets[P+c],i=this.gl.ONE,s=this.gl.ZERO,o=this.gl.ONE,l=this.gl.ZERO,_=!1}break}this.gl.useProgram(p.shaderProgram),De.copyBuffer(this.gl,n,e.getModelRenderTarget(2)),this.gl.activeTexture(this.gl.TEXTURE0);let y=e.getModelRenderTarget(2).getColorBuffer();this.gl.bindTexture(this.gl.TEXTURE_2D,y),this.gl.uniform1i(p.samplerTexture0Location,0);let b=new W;b.loadIdentity(),this.gl.uniformMatrix4fv(p.uniformMatrixLocation,!1,b.getArray());let g=r.getOffscreenOpacity(a),h=new U(g,g,g,g),C=r.getOverrideMultiplyAndScreenColor(),x=C.getOffscreenMultiplyColor(a),v=C.getOffscreenScreenColor(a);if(this.gl.uniform4f(p.uniformBaseColorLocation,h.r,h.g,h.b,h.a),this.gl.uniform4f(p.uniformMultiplyColorLocation,x.r,x.g,x.b,x.a),this.gl.uniform4f(p.uniformScreenColorLocation,v.r,v.g,v.b,v.a),this.gl.activeTexture(this.gl.TEXTURE2),!_){let M=e.getModelRenderTarget(1).getColorBuffer();this.gl.bindTexture(this.gl.TEXTURE_2D,M),this.gl.uniform1i(p.samplerFrameBufferTextureLocation,2)}if(u){this.gl.activeTexture(this.gl.TEXTURE1);let M=e.getOffscreenMaskBuffer(e.getClippingContextBufferForOffscreen()._bufferIndex).getColorBuffer();this.gl.bindTexture(this.gl.TEXTURE_2D,M),this.gl.uniform1i(p.samplerTexture1Location,1),this.gl.uniformMatrix4fv(p.uniformClipMatrixLocation,!1,e.getClippingContextBufferForOffscreen()._matrixForDraw.getArray());let P=e.getClippingContextBufferForOffscreen()._layoutChannelIndex,A=e.getClippingContextBufferForOffscreen().getClippingManager().getChannelFlagAsColor(P);this.gl.uniform4f(p.uniformChannelFlagLocation,A.r,A.g,A.b,A.a),r.isBlendModeEnabled()&&this.gl.uniform1f(p.uniformInvertMaskFlagLocation,d?1:0)}e._bufferData.vertex||(e._bufferData.vertex=this.gl.createBuffer()),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e._bufferData.vertex),this.gl.bufferData(this.gl.ARRAY_BUFFER,wf,this.gl.STATIC_DRAW),this.gl.enableVertexAttribArray(p.attributePositionLocation),this.gl.vertexAttribPointer(p.attributePositionLocation,2,this.gl.FLOAT,!1,Float32Array.BYTES_PER_ELEMENT*2,0),e._bufferData.uv||(e._bufferData.uv=this.gl.createBuffer()),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e._bufferData.uv),this.gl.bufferData(this.gl.ARRAY_BUFFER,n0,this.gl.STATIC_DRAW),this.gl.enableVertexAttribArray(p.attributeTexCoordLocation),this.gl.vertexAttribPointer(p.attributeTexCoordLocation,2,this.gl.FLOAT,!1,Float32Array.BYTES_PER_ELEMENT*2,0),this.gl.blendFuncSeparate(i,s,o,l)}setupShaderProgramForMask(e,r,n){if(e.isPremultipliedAlpha()||R("NoPremultipliedAlpha is not allowed"),this._shaderSets.length==0&&this.generateShaders(),this._isShaderLoaded==!1){Y("Shader program is not initialized.");return}let i=this._shaderSets[0];this.gl.useProgram(i.shaderProgram),e._bufferData.vertex==null&&(e._bufferData.vertex=this.gl.createBuffer()),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e._bufferData.vertex);let s=r.getDrawableVertices(n);this.gl.bufferData(this.gl.ARRAY_BUFFER,s,this.gl.DYNAMIC_DRAW),this.gl.enableVertexAttribArray(i.attributePositionLocation),this.gl.vertexAttribPointer(i.attributePositionLocation,2,this.gl.FLOAT,!1,0,0),e._bufferData.uv==null&&(e._bufferData.uv=this.gl.createBuffer()),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e._bufferData.uv);let o=r.getDrawableTextureIndex(n),l=e.getBindedTextures().get(o);this.gl.activeTexture(this.gl.TEXTURE0),this.gl.bindTexture(this.gl.TEXTURE_2D,l),this.gl.uniform1i(i.samplerTexture0Location,0),e._bufferData.uv==null&&(e._bufferData.uv=this.gl.createBuffer()),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e._bufferData.uv);let a=r.getDrawableVertexUvs(n);this.gl.bufferData(this.gl.ARRAY_BUFFER,a,this.gl.DYNAMIC_DRAW),this.gl.enableVertexAttribArray(i.attributeTexCoordLocation),this.gl.vertexAttribPointer(i.attributeTexCoordLocation,2,this.gl.FLOAT,!1,0,0);let u=e.getClippingContextBufferForMask()._layoutChannelIndex,d=e.getClippingContextBufferForMask().getClippingManager().getChannelFlagAsColor(u);this.gl.uniform4f(i.uniformChannelFlagLocation,d.r,d.g,d.b,d.a),this.gl.uniformMatrix4fv(i.uniformClipMatrixLocation,!1,e.getClippingContextBufferForMask()._matrixForMask.getArray());let c=e.getClippingContextBufferForMask()._layoutBounds;this.gl.uniform4f(i.uniformBaseColorLocation,c.x*2-1,c.y*2-1,c.getRight()*2-1,c.getBottom()*2-1);let p=this.gl.ZERO,_=this.gl.ONE_MINUS_SRC_COLOR,m=this.gl.ZERO,f=this.gl.ONE_MINUS_SRC_ALPHA;e._bufferData.index==null&&(e._bufferData.index=this.gl.createBuffer());let y=r.getDrawableVertexIndices(n);this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,e._bufferData.index),this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,y,this.gl.DYNAMIC_DRAW),this.gl.blendFuncSeparate(p,_,m,f)}setupShaderProgramForOffscreenRenderTarget(e){if(this._shaderSets.length==0&&this.generateShaders(),this._isShaderLoaded==!1){Y("Shader program is not initialized.");return}let r=e.getModelColor();r.r*=r.a,r.g*=r.a,r.b*=r.a,this.copyTexture(e,r)}copyTexture(e,r){let n=this.gl.ONE,i=this.gl.ONE_MINUS_SRC_ALPHA,s=this.gl.ONE,o=this.gl.ONE_MINUS_SRC_ALPHA,l=this._shaderSets[10];this.gl.useProgram(l.shaderProgram),this.gl.uniform4f(l.uniformBaseColorLocation,r.r,r.g,r.b,r.a),this.gl.activeTexture(this.gl.TEXTURE0);let a=e.getModelRenderTarget(0).getColorBuffer();this.gl.bindTexture(this.gl.TEXTURE_2D,a),this.gl.uniform1i(l.samplerTexture0Location,0),e._bufferData.vertex||(e._bufferData.vertex=this.gl.createBuffer()),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e._bufferData.vertex),this.gl.bufferData(this.gl.ARRAY_BUFFER,wf,this.gl.STATIC_DRAW),this.gl.enableVertexAttribArray(l.attributePositionLocation),this.gl.vertexAttribPointer(l.attributePositionLocation,2,this.gl.FLOAT,!1,Float32Array.BYTES_PER_ELEMENT*2,0),e._bufferData.uv||(e._bufferData.uv=this.gl.createBuffer()),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e._bufferData.uv),this.gl.bufferData(this.gl.ARRAY_BUFFER,r0,this.gl.STATIC_DRAW),this.gl.enableVertexAttribArray(l.attributeTexCoordLocation),this.gl.vertexAttribPointer(l.attributeTexCoordLocation,2,this.gl.FLOAT,!1,Float32Array.BYTES_PER_ELEMENT*2,0),this.gl.blendFuncSeparate(n,i,s,o)}releaseShaderProgram(){for(let e=0;e<this._shaderSets.length;e++)this.gl.deleteProgram(this._shaderSets[e].shaderProgram),this._shaderSets[e].shaderProgram=0,this._shaderSets[e]=void 0,this._shaderSets[e]=null}generateShaders(){if(!this._isShaderLoading){this._isShaderLoading=!0,this._isShaderLoaded=!1,this._shaderSets.length=this._shaderCount;for(let e=0;e<this._shaderCount;e++)this._shaderSets[e]=new Vs;this.loadShaders().then(()=>{this.registerShader(),this.registerBlendShader(),this._isShaderLoading=!1,this._isShaderLoaded=!0}).catch(e=>{this._isShaderLoading=!1,console.error("Failed to load shaders:",e)})}}registerShader(){let e=this._vertShaderSrc,r=this._vertShaderSrcMasked,n=this._vertShaderSrcSetupMask,i=this._fragShaderSrcSetupMask,s=this._fragShaderSrcPremultipliedAlpha,o=this._fragShaderSrcMaskPremultipliedAlpha,l=this._fragShaderSrcMaskInvertedPremultipliedAlpha;this._shaderSets[0].shaderProgram=this.loadShaderProgram(n,i),this._shaderSets[1].shaderProgram=this.loadShaderProgram(e,s),this._shaderSets[2].shaderProgram=this.loadShaderProgram(r,o),this._shaderSets[3].shaderProgram=this.loadShaderProgram(r,l),this._shaderSets[4].shaderProgram=this._shaderSets[1].shaderProgram,this._shaderSets[5].shaderProgram=this._shaderSets[2].shaderProgram,this._shaderSets[6].shaderProgram=this._shaderSets[3].shaderProgram,this._shaderSets[7].shaderProgram=this._shaderSets[1].shaderProgram,this._shaderSets[8].shaderProgram=this._shaderSets[2].shaderProgram,this._shaderSets[9].shaderProgram=this._shaderSets[3].shaderProgram,this._shaderSets[0].attributePositionLocation=this.gl.getAttribLocation(this._shaderSets[0].shaderProgram,"a_position"),this._shaderSets[0].attributeTexCoordLocation=this.gl.getAttribLocation(this._shaderSets[0].shaderProgram,"a_texCoord"),this._shaderSets[0].samplerTexture0Location=this.gl.getUniformLocation(this._shaderSets[0].shaderProgram,"s_texture0"),this._shaderSets[0].uniformClipMatrixLocation=this.gl.getUniformLocation(this._shaderSets[0].shaderProgram,"u_clipMatrix"),this._shaderSets[0].uniformChannelFlagLocation=this.gl.getUniformLocation(this._shaderSets[0].shaderProgram,"u_channelFlag"),this._shaderSets[0].uniformBaseColorLocation=this.gl.getUniformLocation(this._shaderSets[0].shaderProgram,"u_baseColor"),this._shaderSets[1].attributePositionLocation=this.gl.getAttribLocation(this._shaderSets[1].shaderProgram,"a_position"),this._shaderSets[1].attributeTexCoordLocation=this.gl.getAttribLocation(this._shaderSets[1].shaderProgram,"a_texCoord"),this._shaderSets[1].samplerTexture0Location=this.gl.getUniformLocation(this._shaderSets[1].shaderProgram,"s_texture0"),this._shaderSets[1].uniformMatrixLocation=this.gl.getUniformLocation(this._shaderSets[1].shaderProgram,"u_matrix"),this._shaderSets[1].uniformBaseColorLocation=this.gl.getUniformLocation(this._shaderSets[1].shaderProgram,"u_baseColor"),this._shaderSets[1].uniformMultiplyColorLocation=this.gl.getUniformLocation(this._shaderSets[1].shaderProgram,"u_multiplyColor"),this._shaderSets[1].uniformScreenColorLocation=this.gl.getUniformLocation(this._shaderSets[1].shaderProgram,"u_screenColor"),this._shaderSets[2].attributePositionLocation=this.gl.getAttribLocation(this._shaderSets[2].shaderProgram,"a_position"),this._shaderSets[2].attributeTexCoordLocation=this.gl.getAttribLocation(this._shaderSets[2].shaderProgram,"a_texCoord"),this._shaderSets[2].samplerTexture0Location=this.gl.getUniformLocation(this._shaderSets[2].shaderProgram,"s_texture0"),this._shaderSets[2].samplerTexture1Location=this.gl.getUniformLocation(this._shaderSets[2].shaderProgram,"s_texture1"),this._shaderSets[2].uniformMatrixLocation=this.gl.getUniformLocation(this._shaderSets[2].shaderProgram,"u_matrix"),this._shaderSets[2].uniformClipMatrixLocation=this.gl.getUniformLocation(this._shaderSets[2].shaderProgram,"u_clipMatrix"),this._shaderSets[2].uniformChannelFlagLocation=this.gl.getUniformLocation(this._shaderSets[2].shaderProgram,"u_channelFlag"),this._shaderSets[2].uniformBaseColorLocation=this.gl.getUniformLocation(this._shaderSets[2].shaderProgram,"u_baseColor"),this._shaderSets[2].uniformMultiplyColorLocation=this.gl.getUniformLocation(this._shaderSets[2].shaderProgram,"u_multiplyColor"),this._shaderSets[2].uniformScreenColorLocation=this.gl.getUniformLocation(this._shaderSets[2].shaderProgram,"u_screenColor"),this._shaderSets[3].attributePositionLocation=this.gl.getAttribLocation(this._shaderSets[3].shaderProgram,"a_position"),this._shaderSets[3].attributeTexCoordLocation=this.gl.getAttribLocation(this._shaderSets[3].shaderProgram,"a_texCoord"),this._shaderSets[3].samplerTexture0Location=this.gl.getUniformLocation(this._shaderSets[3].shaderProgram,"s_texture0"),this._shaderSets[3].samplerTexture1Location=this.gl.getUniformLocation(this._shaderSets[3].shaderProgram,"s_texture1"),this._shaderSets[3].uniformMatrixLocation=this.gl.getUniformLocation(this._shaderSets[3].shaderProgram,"u_matrix"),this._shaderSets[3].uniformClipMatrixLocation=this.gl.getUniformLocation(this._shaderSets[3].shaderProgram,"u_clipMatrix"),this._shaderSets[3].uniformChannelFlagLocation=this.gl.getUniformLocation(this._shaderSets[3].shaderProgram,"u_channelFlag"),this._shaderSets[3].uniformBaseColorLocation=this.gl.getUniformLocation(this._shaderSets[3].shaderProgram,"u_baseColor"),this._shaderSets[3].uniformMultiplyColorLocation=this.gl.getUniformLocation(this._shaderSets[3].shaderProgram,"u_multiplyColor"),this._shaderSets[3].uniformScreenColorLocation=this.gl.getUniformLocation(this._shaderSets[3].shaderProgram,"u_screenColor"),this._shaderSets[4].attributePositionLocation=this.gl.getAttribLocation(this._shaderSets[4].shaderProgram,"a_position"),this._shaderSets[4].attributeTexCoordLocation=this.gl.getAttribLocation(this._shaderSets[4].shaderProgram,"a_texCoord"),this._shaderSets[4].samplerTexture0Location=this.gl.getUniformLocation(this._shaderSets[4].shaderProgram,"s_texture0"),this._shaderSets[4].uniformMatrixLocation=this.gl.getUniformLocation(this._shaderSets[4].shaderProgram,"u_matrix"),this._shaderSets[4].uniformBaseColorLocation=this.gl.getUniformLocation(this._shaderSets[4].shaderProgram,"u_baseColor"),this._shaderSets[4].uniformMultiplyColorLocation=this.gl.getUniformLocation(this._shaderSets[4].shaderProgram,"u_multiplyColor"),this._shaderSets[4].uniformScreenColorLocation=this.gl.getUniformLocation(this._shaderSets[4].shaderProgram,"u_screenColor"),this._shaderSets[5].attributePositionLocation=this.gl.getAttribLocation(this._shaderSets[5].shaderProgram,"a_position"),this._shaderSets[5].attributeTexCoordLocation=this.gl.getAttribLocation(this._shaderSets[5].shaderProgram,"a_texCoord"),this._shaderSets[5].samplerTexture0Location=this.gl.getUniformLocation(this._shaderSets[5].shaderProgram,"s_texture0"),this._shaderSets[5].samplerTexture1Location=this.gl.getUniformLocation(this._shaderSets[5].shaderProgram,"s_texture1"),this._shaderSets[5].uniformMatrixLocation=this.gl.getUniformLocation(this._shaderSets[5].shaderProgram,"u_matrix"),this._shaderSets[5].uniformClipMatrixLocation=this.gl.getUniformLocation(this._shaderSets[5].shaderProgram,"u_clipMatrix"),this._shaderSets[5].uniformChannelFlagLocation=this.gl.getUniformLocation(this._shaderSets[5].shaderProgram,"u_channelFlag"),this._shaderSets[5].uniformBaseColorLocation=this.gl.getUniformLocation(this._shaderSets[5].shaderProgram,"u_baseColor"),this._shaderSets[5].uniformMultiplyColorLocation=this.gl.getUniformLocation(this._shaderSets[5].shaderProgram,"u_multiplyColor"),this._shaderSets[5].uniformScreenColorLocation=this.gl.getUniformLocation(this._shaderSets[5].shaderProgram,"u_screenColor"),this._shaderSets[6].attributePositionLocation=this.gl.getAttribLocation(this._shaderSets[6].shaderProgram,"a_position"),this._shaderSets[6].attributeTexCoordLocation=this.gl.getAttribLocation(this._shaderSets[6].shaderProgram,"a_texCoord"),this._shaderSets[6].samplerTexture0Location=this.gl.getUniformLocation(this._shaderSets[6].shaderProgram,"s_texture0"),this._shaderSets[6].samplerTexture1Location=this.gl.getUniformLocation(this._shaderSets[6].shaderProgram,"s_texture1"),this._shaderSets[6].uniformMatrixLocation=this.gl.getUniformLocation(this._shaderSets[6].shaderProgram,"u_matrix"),this._shaderSets[6].uniformClipMatrixLocation=this.gl.getUniformLocation(this._shaderSets[6].shaderProgram,"u_clipMatrix"),this._shaderSets[6].uniformChannelFlagLocation=this.gl.getUniformLocation(this._shaderSets[6].shaderProgram,"u_channelFlag"),this._shaderSets[6].uniformBaseColorLocation=this.gl.getUniformLocation(this._shaderSets[6].shaderProgram,"u_baseColor"),this._shaderSets[6].uniformMultiplyColorLocation=this.gl.getUniformLocation(this._shaderSets[6].shaderProgram,"u_multiplyColor"),this._shaderSets[6].uniformScreenColorLocation=this.gl.getUniformLocation(this._shaderSets[6].shaderProgram,"u_screenColor"),this._shaderSets[7].attributePositionLocation=this.gl.getAttribLocation(this._shaderSets[7].shaderProgram,"a_position"),this._shaderSets[7].attributeTexCoordLocation=this.gl.getAttribLocation(this._shaderSets[7].shaderProgram,"a_texCoord"),this._shaderSets[7].samplerTexture0Location=this.gl.getUniformLocation(this._shaderSets[7].shaderProgram,"s_texture0"),this._shaderSets[7].uniformMatrixLocation=this.gl.getUniformLocation(this._shaderSets[7].shaderProgram,"u_matrix"),this._shaderSets[7].uniformBaseColorLocation=this.gl.getUniformLocation(this._shaderSets[7].shaderProgram,"u_baseColor"),this._shaderSets[7].uniformMultiplyColorLocation=this.gl.getUniformLocation(this._shaderSets[7].shaderProgram,"u_multiplyColor"),this._shaderSets[7].uniformScreenColorLocation=this.gl.getUniformLocation(this._shaderSets[7].shaderProgram,"u_screenColor"),this._shaderSets[8].attributePositionLocation=this.gl.getAttribLocation(this._shaderSets[8].shaderProgram,"a_position"),this._shaderSets[8].attributeTexCoordLocation=this.gl.getAttribLocation(this._shaderSets[8].shaderProgram,"a_texCoord"),this._shaderSets[8].samplerTexture0Location=this.gl.getUniformLocation(this._shaderSets[8].shaderProgram,"s_texture0"),this._shaderSets[8].samplerTexture1Location=this.gl.getUniformLocation(this._shaderSets[8].shaderProgram,"s_texture1"),this._shaderSets[8].uniformMatrixLocation=this.gl.getUniformLocation(this._shaderSets[8].shaderProgram,"u_matrix"),this._shaderSets[8].uniformClipMatrixLocation=this.gl.getUniformLocation(this._shaderSets[8].shaderProgram,"u_clipMatrix"),this._shaderSets[8].uniformChannelFlagLocation=this.gl.getUniformLocation(this._shaderSets[8].shaderProgram,"u_channelFlag"),this._shaderSets[8].uniformBaseColorLocation=this.gl.getUniformLocation(this._shaderSets[8].shaderProgram,"u_baseColor"),this._shaderSets[8].uniformMultiplyColorLocation=this.gl.getUniformLocation(this._shaderSets[8].shaderProgram,"u_multiplyColor"),this._shaderSets[8].uniformScreenColorLocation=this.gl.getUniformLocation(this._shaderSets[8].shaderProgram,"u_screenColor"),this._shaderSets[9].attributePositionLocation=this.gl.getAttribLocation(this._shaderSets[9].shaderProgram,"a_position"),this._shaderSets[9].attributeTexCoordLocation=this.gl.getAttribLocation(this._shaderSets[9].shaderProgram,"a_texCoord"),this._shaderSets[9].samplerTexture0Location=this.gl.getUniformLocation(this._shaderSets[9].shaderProgram,"s_texture0"),this._shaderSets[9].samplerTexture1Location=this.gl.getUniformLocation(this._shaderSets[9].shaderProgram,"s_texture1"),this._shaderSets[9].uniformMatrixLocation=this.gl.getUniformLocation(this._shaderSets[9].shaderProgram,"u_matrix"),this._shaderSets[9].uniformClipMatrixLocation=this.gl.getUniformLocation(this._shaderSets[9].shaderProgram,"u_clipMatrix"),this._shaderSets[9].uniformChannelFlagLocation=this.gl.getUniformLocation(this._shaderSets[9].shaderProgram,"u_channelFlag"),this._shaderSets[9].uniformBaseColorLocation=this.gl.getUniformLocation(this._shaderSets[9].shaderProgram,"u_baseColor"),this._shaderSets[9].uniformMultiplyColorLocation=this.gl.getUniformLocation(this._shaderSets[9].shaderProgram,"u_multiplyColor"),this._shaderSets[9].uniformScreenColorLocation=this.gl.getUniformLocation(this._shaderSets[9].shaderProgram,"u_screenColor")}registerBlendShader(){let e=this._vertShaderSrcCopy,r=this._fragShaderSrcCopy,n=this._shaderSets[10];n.shaderProgram=this.loadShaderProgram(e,r),n.attributeTexCoordLocation=this.gl.getAttribLocation(n.shaderProgram,"a_texCoord"),n.attributePositionLocation=this.gl.getAttribLocation(n.shaderProgram,"a_position"),n.uniformBaseColorLocation=this.gl.getUniformLocation(n.shaderProgram,"u_baseColor");let i=11;for(let s=0;s<this._colorBlendValues.length;s++){if(this._colorBlendValues[s]==-1||this._colorBlendValues[s]==ve.ColorBlend_AddCompatible||this._colorBlendValues[s]==ve.ColorBlend_MultiplyCompatible)continue;let o=this._colorBlendValues[s],a=`#define COLOR_BLEND_${this._colorBlendMap.get(o).toUpperCase()}
|
|
27
|
+
`;for(let u=0;u<this._alphaBlendValues.length;u++){if(this._alphaBlendValues[u]==-1||this._colorBlendValues[s]==ve.ColorBlend_Normal&&this._alphaBlendValues[u]==0)continue;let d=this._alphaBlendValues[u],p=`#define ALPHA_BLEND_${this._alphaBlendMap.get(d).toUpperCase()}
|
|
28
|
+
`;this.generateBlendShader(a,p,i),this._blendShaderSetMap.set(this._colorBlendMap.get(this._colorBlendValues[s])+this._alphaBlendMap.get(this._alphaBlendValues[u]),i),i+=3}}}generateBlendShader(e,r,n){for(let i=0;i<3;i++){let s="",o=`precision mediump float;
|
|
29
|
+
`,l=n+i;if(o+=e,o+=r,o+=this._fragShaderSrcColorBlend,o+=this._fragShaderSrcAlphaBlend,i==1||i==2){let a=`#define CLIPPING_MASK
|
|
30
|
+
`;s+=a,o+=a}s+=this._vertShaderSrcBlend,o+=this._fragShaderSrcBlend,this._shaderSets[l].shaderProgram=this.loadShaderProgram(s,o),this._shaderSets[l].attributePositionLocation=this.gl.getAttribLocation(this._shaderSets[l].shaderProgram,"a_position"),this._shaderSets[l].attributeTexCoordLocation=this.gl.getAttribLocation(this._shaderSets[l].shaderProgram,"a_texCoord"),this._shaderSets[l].samplerTexture0Location=this.gl.getUniformLocation(this._shaderSets[l].shaderProgram,"s_texture0"),this._shaderSets[l].uniformMatrixLocation=this.gl.getUniformLocation(this._shaderSets[l].shaderProgram,"u_matrix"),this._shaderSets[l].uniformBaseColorLocation=this.gl.getUniformLocation(this._shaderSets[l].shaderProgram,"u_baseColor"),this._shaderSets[l].uniformMultiplyColorLocation=this.gl.getUniformLocation(this._shaderSets[l].shaderProgram,"u_multiplyColor"),this._shaderSets[l].uniformScreenColorLocation=this.gl.getUniformLocation(this._shaderSets[l].shaderProgram,"u_screenColor"),this._shaderSets[l].samplerFrameBufferTextureLocation=this.gl.getUniformLocation(this._shaderSets[l].shaderProgram,"s_blendTexture"),(i==1||i==2)&&(this._shaderSets[l].samplerTexture1Location=this.gl.getUniformLocation(this._shaderSets[l].shaderProgram,"s_texture1"),this._shaderSets[l].uniformClipMatrixLocation=this.gl.getUniformLocation(this._shaderSets[l].shaderProgram,"u_clipMatrix"),this._shaderSets[l].uniformChannelFlagLocation=this.gl.getUniformLocation(this._shaderSets[l].shaderProgram,"u_channelFlag"),this._shaderSets[l].uniformInvertMaskFlagLocation=this.gl.getUniformLocation(this._shaderSets[l].shaderProgram,"u_invertClippingMask"))}}loadShaderProgram(e,r){let n=this.gl.createProgram(),i=this.compileShaderSource(this.gl.VERTEX_SHADER,e);if(!i)return R("Vertex shader compile error!"),0;let s=this.compileShaderSource(this.gl.FRAGMENT_SHADER,r);return s?(this.gl.attachShader(n,i),this.gl.attachShader(n,s),this.gl.linkProgram(n),this.gl.getProgramParameter(n,this.gl.LINK_STATUS)?(this.gl.deleteShader(i),this.gl.deleteShader(s),n):(R("Failed to link program: {0}",n),this.gl.deleteShader(i),i=0,this.gl.deleteShader(s),s=0,n&&(this.gl.deleteProgram(n),n=0),0)):(R("Fragment shader compile error!"),0)}compileShaderSource(e,r){let n=r,i=this.gl.createShader(e);if(this.gl.shaderSource(i,n),this.gl.compileShader(i),!i){let o=this.gl.getShaderInfoLog(i);R("Shader compile log: {0} ",o)}if(!this.gl.getShaderParameter(i,this.gl.COMPILE_STATUS)){let o=this.gl.getShaderInfoLog(i);return R("Shader compile log: {0} ",o),this.gl.deleteShader(i),null}return i}setGl(e){this.gl=e}setShaderPath(e){this._shaderPath=e}getShaderPath(){return this._shaderPath}_shaderSets;gl;_colorBlendMap;_alphaBlendMap;_colorBlendValues;_alphaBlendValues;_blendShaderSetMap;_shaderCount;_vertShaderSrc;_vertShaderSrcMasked;_vertShaderSrcSetupMask;_fragShaderSrcSetupMask;_fragShaderSrcPremultipliedAlpha;_fragShaderSrcMaskPremultipliedAlpha;_fragShaderSrcMaskInvertedPremultipliedAlpha;_vertShaderSrcCopy;_fragShaderSrcCopy;_fragShaderSrcColorBlend;_fragShaderSrcAlphaBlend;_vertShaderSrcBlend;_fragShaderSrcBlend;_isShaderLoading;_isShaderLoaded;_defaultShaderPath;_shaderPath},Be=class t{static getInstance(){return ci==null&&(ci=new t),ci}static deleteInstance(){ci&&(ci.release(),ci=null)}constructor(){this._shaderMap=new Map}release(){for(let e of this._shaderMap)e[1].release();this._shaderMap.clear()}getShader(e){return this._shaderMap.get(e)}setGlContext(e){if(!this._shaderMap.has(e)){let r=new ks;r.setGl(e),this._shaderMap.set(e,r)}}_shaderMap},Vs=class{shaderProgram;attributePositionLocation;attributeTexCoordLocation;uniformMatrixLocation;uniformClipMatrixLocation;samplerTexture0Location;samplerTexture1Location;uniformBaseColorLocation;uniformChannelFlagLocation;uniformMultiplyColorLocation;uniformScreenColorLocation;samplerFrameBufferTextureLocation;uniformInvertMaskFlagLocation},Wc=(c=>(c[c.ShaderNames_SetupMask=0]="ShaderNames_SetupMask",c[c.ShaderNames_NormalPremultipliedAlpha=1]="ShaderNames_NormalPremultipliedAlpha",c[c.ShaderNames_NormalMaskedPremultipliedAlpha=2]="ShaderNames_NormalMaskedPremultipliedAlpha",c[c.ShaderNames_NomralMaskedInvertedPremultipliedAlpha=3]="ShaderNames_NomralMaskedInvertedPremultipliedAlpha",c[c.ShaderNames_AddPremultipliedAlpha=4]="ShaderNames_AddPremultipliedAlpha",c[c.ShaderNames_AddMaskedPremultipliedAlpha=5]="ShaderNames_AddMaskedPremultipliedAlpha",c[c.ShaderNames_AddMaskedPremultipliedAlphaInverted=6]="ShaderNames_AddMaskedPremultipliedAlphaInverted",c[c.ShaderNames_MultPremultipliedAlpha=7]="ShaderNames_MultPremultipliedAlpha",c[c.ShaderNames_MultMaskedPremultipliedAlpha=8]="ShaderNames_MultMaskedPremultipliedAlpha",c[c.ShaderNames_MultMaskedPremultipliedAlphaInverted=9]="ShaderNames_MultMaskedPremultipliedAlphaInverted",c[c.ShaderNames_ShaderCount=10]="ShaderNames_ShaderCount",c))(Wc||{});var i0;(i=>(i.CubismShaderSet=Vs,i.CubismShader_WebGL=ks,i.CubismShaderManager_WebGL=Be,i.ShaderNames=Wc))(i0||={});var Os=class extends De{initializeOffscreenManager(e,r,n){this._gl=e,this._webGLOffscreenManager=Jt.getInstance(),this._webGLOffscreenManager.getContainerSize(e)===0&&this._webGLOffscreenManager.initialize(e,r,n)}setOffscreenRenderTarget(e,r,n,i){this._webGLOffscreenManager==null&&this.initializeOffscreenManager(e,r,n);let s=this._webGLOffscreenManager.getOffscreenRenderTargetContainers(e,r,n,i);if(s==null){R("Failed to acquire offscreen render texture container.");return}this._colorBuffer=s.getColorBuffer(),this._renderTexture=s.getRenderTexture(),this._bufferWidth=r,this._bufferHeight=n,this._gl=e,this._renderTexture==null&&(this._renderTexture=i,R("Failed to create offscreen render texture."))}getUsingRenderTextureState(){return this._webGLOffscreenManager==null||this._gl==null?!0:this._webGLOffscreenManager.getUsingRenderTextureState(this._gl,this._renderTexture)}startUsingRenderTexture(){this._webGLOffscreenManager==null||this._gl==null||this._webGLOffscreenManager.startUsingRenderTexture(this._gl,this._renderTexture)}stopUsingRenderTexture(){this._webGLOffscreenManager==null||this._gl==null||this._webGLOffscreenManager.stopUsingRenderTexture(this._gl,this._renderTexture)}setOffscreenIndex(e){this._offscreenIndex=e}getOffscreenIndex(){return this._offscreenIndex}setOldOffscreen(e){this._oldOffscreen=e}getOldOffscreen(){return this._oldOffscreen}setParentPartOffscreen(e){this._parentOffscreenRenderTarget=e}getParentPartOffscreen(){return this._parentOffscreenRenderTarget}constructor(){super(),this._offscreenIndex=-1,this._parentOffscreenRenderTarget=null,this._oldOffscreen=null,this._webGLOffscreenManager=null}release(){this._webGLOffscreenManager!=null&&this._gl!=null&&this._renderTexture!=null&&this._webGLOffscreenManager.stopUsingRenderTexture(this._gl,this._renderTexture),this._colorBuffer&&this._gl&&(this._gl.deleteTexture(this._colorBuffer),this._colorBuffer=null),this._renderTexture&&this._gl&&(this._gl.deleteFramebuffer(this._renderTexture),this._renderTexture=null),this._webGLOffscreenManager!=null&&(this._webGLOffscreenManager=null),this._oldOffscreen=null,this._parentOffscreenRenderTarget=null}_offscreenIndex;_parentOffscreenRenderTarget;_oldOffscreen;_webGLOffscreenManager;_gl};var Da=-1,Fa=new Uint16Array([0,1,2,2,1,3]),Zr=class extends Oa{setGL(e){this.gl=e}constructor(){super(Ds)}setupClippingContext(e,r,n,i,s){let o=0;for(let l=0;l<this._clippingContextListForMask.length;l++){let a=this._clippingContextListForMask[l];switch(s){case 0:default:this.calcClippedDrawableTotalBounds(e,a);break;case 1:this.calcClippedOffscreenTotalBounds(e,a);break}a._isUsing&&o++}if(!(o<=0)){switch(this.gl.viewport(0,0,this._clippingMaskBufferSize,this._clippingMaskBufferSize),s){case 0:default:this._currentMaskBuffer=r.getDrawableMaskBuffer(0);break;case 1:this._currentMaskBuffer=r.getOffscreenMaskBuffer(0);break}if(this._currentMaskBuffer.beginDraw(n),r.preDraw(),this.setupLayoutBounds(o),this._clearedMaskBufferFlags.length!=this._renderTextureCount){this._clearedMaskBufferFlags.length=0,this._clearedMaskBufferFlags=new Array(this._renderTextureCount);for(let l=0;l<this._clearedMaskBufferFlags.length;l++)this._clearedMaskBufferFlags[l]=!1}for(let l=0;l<this._clearedMaskBufferFlags.length;l++)this._clearedMaskBufferFlags[l]=!1;for(let l=0;l<this._clippingContextListForMask.length;l++){let a=this._clippingContextListForMask[l],u=a._allClippedDrawRect,d=a._layoutBounds,c=.05,p=0,_=0,m;switch(s){case 0:default:m=r.getDrawableMaskBuffer(a._bufferIndex);break;case 1:m=r.getOffscreenMaskBuffer(a._bufferIndex);break}if(this._currentMaskBuffer!=m&&(this._currentMaskBuffer.endDraw(),this._currentMaskBuffer=m,this._currentMaskBuffer.beginDraw(n),r.preDraw()),this._tmpBoundsOnModel.setRect(u),this._tmpBoundsOnModel.expand(u.width*c,u.height*c),p=d.width/this._tmpBoundsOnModel.width,_=d.height/this._tmpBoundsOnModel.height,this.createMatrixForMask(!1,d,p,_),a._matrixForMask.setMatrix(this._tmpMatrixForMask.getArray()),a._matrixForDraw.setMatrix(this._tmpMatrixForDraw.getArray()),s==1){let y=r.getMvpMatrix().getInvert();a._matrixForDraw.multiplyByMatrix(y)}let f=a._clippingIdCount;for(let y=0;y<f;y++){let b=a._clippingIdList[y];e.getDrawableDynamicFlagVertexPositionsDidChange(b)&&(r.setIsCulling(e.getDrawableCulling(b)!=!1),this._clearedMaskBufferFlags[a._bufferIndex]||(this.gl.clearColor(1,1,1,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT),this._clearedMaskBufferFlags[a._bufferIndex]=!0),r.setClippingContextBufferForMask(a),r.drawMeshWebGL(e,b))}}this._currentMaskBuffer.endDraw(),r.setClippingContextBufferForMask(null),this.gl.viewport(i[0],i[1],i[2],i[3])}}getClippingMaskCount(){return this._clippingContextListForMask.length}_currentMaskBuffer;gl},Ds=class extends ha{constructor(e,r,n){super(r,n),this._owner=e}getClippingManager(){return this._owner}setGl(e){this._owner.setGL(e)}_owner},Hc=class{setGlEnable(e,r){r?this.gl.enable(e):this.gl.disable(e)}setGlEnableVertexAttribArray(e,r){r?this.gl.enableVertexAttribArray(e):this.gl.disableVertexAttribArray(e)}save(){if(this.gl==null){R(`'gl' is null. WebGLRenderingContext is required.
|
|
31
|
+
Please call 'CubimRenderer_WebGL.startUp' function.`);return}this._lastArrayBufferBinding=this.gl.getParameter(this.gl.ARRAY_BUFFER_BINDING),this._lastElementArrayBufferBinding=this.gl.getParameter(this.gl.ELEMENT_ARRAY_BUFFER_BINDING),this._lastProgram=this.gl.getParameter(this.gl.CURRENT_PROGRAM),this._lastActiveTexture=this.gl.getParameter(this.gl.ACTIVE_TEXTURE),this.gl.activeTexture(this.gl.TEXTURE1),this._lastTexture1Binding2D=this.gl.getParameter(this.gl.TEXTURE_BINDING_2D),this.gl.activeTexture(this.gl.TEXTURE0),this._lastTexture0Binding2D=this.gl.getParameter(this.gl.TEXTURE_BINDING_2D),this._lastVertexAttribArrayEnabled[0]=this.gl.getVertexAttrib(0,this.gl.VERTEX_ATTRIB_ARRAY_ENABLED),this._lastVertexAttribArrayEnabled[1]=this.gl.getVertexAttrib(1,this.gl.VERTEX_ATTRIB_ARRAY_ENABLED),this._lastVertexAttribArrayEnabled[2]=this.gl.getVertexAttrib(2,this.gl.VERTEX_ATTRIB_ARRAY_ENABLED),this._lastVertexAttribArrayEnabled[3]=this.gl.getVertexAttrib(3,this.gl.VERTEX_ATTRIB_ARRAY_ENABLED),this._lastScissorTest=this.gl.isEnabled(this.gl.SCISSOR_TEST),this._lastStencilTest=this.gl.isEnabled(this.gl.STENCIL_TEST),this._lastDepthTest=this.gl.isEnabled(this.gl.DEPTH_TEST),this._lastCullFace=this.gl.isEnabled(this.gl.CULL_FACE),this._lastBlend=this.gl.isEnabled(this.gl.BLEND),this._lastFrontFace=this.gl.getParameter(this.gl.FRONT_FACE),this._lastColorMask=this.gl.getParameter(this.gl.COLOR_WRITEMASK),this._lastBlending[0]=this.gl.getParameter(this.gl.BLEND_SRC_RGB),this._lastBlending[1]=this.gl.getParameter(this.gl.BLEND_DST_RGB),this._lastBlending[2]=this.gl.getParameter(this.gl.BLEND_SRC_ALPHA),this._lastBlending[3]=this.gl.getParameter(this.gl.BLEND_DST_ALPHA)}restore(){if(this.gl==null){R(`'gl' is null. WebGLRenderingContext is required.
|
|
32
|
+
Please call 'CubimRenderer_WebGL.startUp' function.`);return}this.gl.useProgram(this._lastProgram),this.setGlEnableVertexAttribArray(0,this._lastVertexAttribArrayEnabled[0]),this.setGlEnableVertexAttribArray(1,this._lastVertexAttribArrayEnabled[1]),this.setGlEnableVertexAttribArray(2,this._lastVertexAttribArrayEnabled[2]),this.setGlEnableVertexAttribArray(3,this._lastVertexAttribArrayEnabled[3]),this.setGlEnable(this.gl.SCISSOR_TEST,this._lastScissorTest),this.setGlEnable(this.gl.STENCIL_TEST,this._lastStencilTest),this.setGlEnable(this.gl.DEPTH_TEST,this._lastDepthTest),this.setGlEnable(this.gl.CULL_FACE,this._lastCullFace),this.setGlEnable(this.gl.BLEND,this._lastBlend),this.gl.frontFace(this._lastFrontFace),this.gl.colorMask(this._lastColorMask[0],this._lastColorMask[1],this._lastColorMask[2],this._lastColorMask[3]),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this._lastArrayBufferBinding),this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this._lastElementArrayBufferBinding),this.gl.activeTexture(this.gl.TEXTURE1),this.gl.bindTexture(this.gl.TEXTURE_2D,this._lastTexture1Binding2D),this.gl.activeTexture(this.gl.TEXTURE0),this.gl.bindTexture(this.gl.TEXTURE_2D,this._lastTexture0Binding2D),this.gl.activeTexture(this._lastActiveTexture),this.gl.blendFuncSeparate(this._lastBlending[0],this._lastBlending[1],this._lastBlending[2],this._lastBlending[3])}setGl(e){this.gl=e}constructor(){this._lastVertexAttribArrayEnabled=new Array(4),this._lastColorMask=new Array(4),this._lastBlending=new Array(4)}_lastArrayBufferBinding;_lastElementArrayBufferBinding;_lastProgram;_lastActiveTexture;_lastTexture0Binding2D;_lastTexture1Binding2D;_lastVertexAttribArrayEnabled;_lastScissorTest;_lastBlend;_lastStencilTest;_lastDepthTest;_lastCullFace;_lastFrontFace;_lastColorMask;_lastBlending;gl},en=class extends jt{initialize(e,r=1){e.isUsingMasking()&&(this._drawableClippingManager=new Zr,this._drawableClippingManager.initializeForDrawable(e,r)),e.isUsingMaskingForOffscreen()&&(this._offscreenClippingManager=new Zr,this._offscreenClippingManager.initializeForOffscreen(e,r)),be(this._sortedObjectsIndexList,e.getDrawableCount()+(e.getOffscreenCount?e.getOffscreenCount():0),0,!0),be(this._sortedObjectsTypeList,e.getDrawableCount()+(e.getOffscreenCount?e.getOffscreenCount():0),0,!0),super.initialize(e)}setupParentOffscreens(e,r){let n;for(let i=0;i<r;++i){n=null;let s=e.getOffscreenOwnerIndices()[i],o=e.getPartParentPartIndices()[s];for(;o!=Kr;){for(let l=0;l<r;++l)if(e.getOffscreenOwnerIndices()[this._offscreenList[l].getOffscreenIndex()]==o){n=this._offscreenList[l];break}if(n!=null)break;o=e.getPartParentPartIndices()[o]}this._offscreenList[i].setParentPartOffscreen(n)}}bindTexture(e,r){this._textures.set(e,r)}getBindedTextures(){return this._textures}setClippingMaskBufferSize(e){if(!this._model.isUsingMasking())return;let r=this._drawableClippingManager.getRenderTextureCount();this._drawableClippingManager.release(),this._drawableClippingManager=void 0,this._drawableClippingManager=null,this._drawableClippingManager=new Zr,this._drawableClippingManager.setClippingMaskBufferSize(e),this._drawableClippingManager.initializeForDrawable(this.getModel(),r)}getClippingMaskBufferSize(){return this._model.isUsingMasking()?this._drawableClippingManager.getClippingMaskBufferSize():Da}getModelRenderTarget(e){return this._modelRenderTargets[e]}getRenderTextureCount(){return this._model.isUsingMasking()?this._drawableClippingManager.getRenderTextureCount():Da}constructor(e,r){super(e,r),this._clippingContextBufferForMask=null,this._clippingContextBufferForDraw=null,this._rendererProfile=new Hc,this._textures=new Map,this._sortedObjectsIndexList=new Array,this._sortedObjectsTypeList=new Array,this._bufferData={vertex:WebGLBuffer=null,uv:WebGLBuffer=null,index:WebGLBuffer=null},this._modelRenderTargets=new Array,this._drawableMasks=new Array,this._currentFbo=null,this._drawableClippingManager=null,this._offscreenClippingManager=null,this._offscreenMasks=new Array,this._offscreenList=new Array}release(){if(this._drawableClippingManager&&(this._drawableClippingManager.release(),this._drawableClippingManager=void 0,this._drawableClippingManager=null),this.gl!=null){this.gl.deleteBuffer(this._bufferData.vertex),this._bufferData.vertex=null,this.gl.deleteBuffer(this._bufferData.uv),this._bufferData.uv=null,this.gl.deleteBuffer(this._bufferData.index),this._bufferData.index=null,this._bufferData=null,this._textures=null;for(let e=0;e<this._modelRenderTargets.length;e++)this._modelRenderTargets[e]!=null&&this._modelRenderTargets[e].isValid()&&this._modelRenderTargets[e].destroyRenderTarget();this._modelRenderTargets.length=0,this._modelRenderTargets=null;for(let e=0;e<this._drawableMasks.length;e++)this._drawableMasks[e]!=null&&this._drawableMasks[e].isValid()&&this._drawableMasks[e].destroyRenderTarget();this._drawableMasks.length=0,this._drawableMasks=null;for(let e=0;e<this._offscreenMasks.length;e++)this._offscreenMasks[e]!=null&&this._offscreenMasks[e].isValid()&&this._offscreenMasks[e].destroyRenderTarget();this._offscreenMasks.length=0,this._offscreenMasks=null;for(let e=0;e<this._offscreenList.length;e++)this._offscreenList[e]!=null&&this._offscreenList[e].isValid()&&this._offscreenList[e].destroyRenderTarget();this._offscreenList.length=0,this._offscreenList=null,this._offscreenClippingManager=null,this._drawableClippingManager=null,this._clippingContextBufferForMask=null,this._clippingContextBufferForDraw=null,this._rendererProfile=null,this._sortedObjectsIndexList=null,this._sortedObjectsTypeList=null,this._currentFbo=null,this._model=null,this.gl=null}}loadShaders(e=null){if(this.gl==null){R(`'gl' is null. WebGLRenderingContext is required.
|
|
33
|
+
Please call 'CubimRenderer_WebGL.startUp' function.`);return}if(Be.getInstance().getShader(this.gl)._shaderSets.length==0||!Be.getInstance().getShader(this.gl)._isShaderLoaded){let r=Be.getInstance().getShader(this.gl);e!=null&&r.setShaderPath(e),r.generateShaders()}}doDrawModel(e=null){this.loadShaders(e),this.beforeDrawModelRenderTarget();let r=this.gl.getParameter(this.gl.FRAMEBUFFER_BINDING),n=this.gl.getParameter(this.gl.VIEWPORT);if(this._drawableClippingManager!=null){this.preDraw();for(let i=0;i<this._drawableClippingManager.getRenderTextureCount();++i)(this._drawableMasks[i].getBufferWidth()!=this._drawableClippingManager.getClippingMaskBufferSize()||this._drawableMasks[i].getBufferHeight()!=this._drawableClippingManager.getClippingMaskBufferSize())&&this._drawableMasks[i].createRenderTarget(this.gl,this._drawableClippingManager.getClippingMaskBufferSize(),this._drawableClippingManager.getClippingMaskBufferSize(),r);this.isUsingHighPrecisionMask()?this._drawableClippingManager.setupMatrixForHighPrecision(this.getModel(),!1):this._drawableClippingManager.setupClippingContext(this.getModel(),this,r,n,0)}if(this._offscreenClippingManager!=null){this.preDraw();for(let i=0;i<this._offscreenClippingManager.getRenderTextureCount();++i)(this._offscreenMasks[i].getBufferWidth()!=this._offscreenClippingManager.getClippingMaskBufferSize()||this._offscreenMasks[i].getBufferHeight()!=this._offscreenClippingManager.getClippingMaskBufferSize())&&this._offscreenMasks[i].createRenderTarget(this.gl,this._offscreenClippingManager.getClippingMaskBufferSize(),this._offscreenClippingManager.getClippingMaskBufferSize(),r);this.isUsingHighPrecisionMask()?this._offscreenClippingManager.setupMatrixForOffscreenHighPrecision(this.getModel(),!1,this.getMvpMatrix()):this._offscreenClippingManager.setupClippingContext(this.getModel(),this,r,n,1)}this.preDraw(),this.drawObjectLoop(r),this.afterDrawModelRenderTarget()}drawObjectLoop(e){let r=this.getModel(),n=r.getDrawableCount(),i=r.getOffscreenCount(),s=n+i,o=r.getRenderOrders();this._currentOffscreen=null,this._currentFbo=e,this._modelRootFbo=e;for(let l=0;l<s;++l){let a=o[l];l<n?(this._sortedObjectsIndexList[a]=l,this._sortedObjectsTypeList[a]=0):l<s&&(this._sortedObjectsIndexList[a]=l-n,this._sortedObjectsTypeList[a]=1)}for(let l=0;l<s;++l){let a=this._sortedObjectsIndexList[l],u=this._sortedObjectsTypeList[l];this.renderObject(a,u)}for(;this._currentOffscreen!=null;)this.submitDrawToParentOffscreen(this._currentOffscreen.getOffscreenIndex(),1)}renderObject(e,r){switch(r){case 0:this.drawDrawable(e,this._modelRootFbo);break;case 1:this.addOffscreen(e);break;default:R("Unknown object type: "+r);break}}drawDrawable(e,r){if(!this.getModel().getDrawableDynamicFlagIsVisible(e))return;this.submitDrawToParentOffscreen(e,0);let n=this._drawableClippingManager!=null?this._drawableClippingManager.getClippingContextListForDraw()[e]:null;if(n!=null&&this.isUsingHighPrecisionMask()){n._isUsing&&(this.gl.viewport(0,0,this._drawableClippingManager.getClippingMaskBufferSize(),this._drawableClippingManager.getClippingMaskBufferSize()),this.preDraw(),this.getDrawableMaskBuffer(n._bufferIndex).beginDraw(this._currentFbo),this.gl.clearColor(1,1,1,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT));{let i=n._clippingIdCount;for(let s=0;s<i;s++){let o=n._clippingIdList[s];this._model.getDrawableDynamicFlagVertexPositionsDidChange(o)&&(this.setIsCulling(this._model.getDrawableCulling(o)!=!1),this.setClippingContextBufferForMask(n),this.drawMeshWebGL(this._model,o))}this.getDrawableMaskBuffer(n._bufferIndex).endDraw(),this.setClippingContextBufferForMask(null),this.gl.viewport(0,0,this._modelRenderTargetWidth,this._modelRenderTargetHeight),this.preDraw()}}this.setClippingContextBufferForDrawable(n),this.setIsCulling(this.getModel().getDrawableCulling(e)),this.drawMeshWebGL(this._model,e)}drawMeshWebGL(e,r){if(this.isCulling()?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this.gl.frontFace(this.gl.CCW),this.isGeneratingMask()?Be.getInstance().getShader(this.gl).setupShaderProgramForMask(this,e,r):Be.getInstance().getShader(this.gl).setupShaderProgramForDrawable(this,e,r),!!Be.getInstance().getShader(this.gl)._isShaderLoaded){{let n=e.getDrawableVertexIndexCount(r);this.gl.drawElements(this.gl.TRIANGLES,n,this.gl.UNSIGNED_SHORT,0)}this.gl.useProgram(null),this.setClippingContextBufferForDrawable(null),this.setClippingContextBufferForMask(null)}}submitDrawToParentOffscreen(e,r){if(this._currentOffscreen==null||e==Da)return;let n=this.getModel().getOffscreenOwnerIndices()[this._currentOffscreen.getOffscreenIndex()];if(n==Da)return;let i=Kr;switch(r){case 0:i=this.getModel().getDrawableParentPartIndex(e);break;case 1:i=this.getModel().getPartParentPartIndices()[this.getModel().getOffscreenOwnerIndices()[e]];break;default:return}for(;i!=Kr;){if(i==n)return;i=this.getModel().getPartParentPartIndices()[i]}this.drawOffscreen(this._currentOffscreen),this.submitDrawToParentOffscreen(e,r)}addOffscreen(e){if(this._currentOffscreen!=null&&this._currentOffscreen.getOffscreenIndex()!=e){let s=!1,o=this.getModel().getOffscreenOwnerIndices()[e],l=this.getModel().getPartParentPartIndices()[o],a=this._currentOffscreen.getOffscreenIndex(),u=this.getModel().getOffscreenOwnerIndices()[a];for(;l!=Kr;){if(l==u){s=!0;break}l=this.getModel().getPartParentPartIndices()[l]}s||this.submitDrawToParentOffscreen(e,1)}let r=this._offscreenList[e];r.getRenderTexture()==null||r.getBufferWidth()!=this._modelRenderTargetWidth||r.getBufferHeight()!=this._modelRenderTargetHeight||r.getUsingRenderTextureState()?r.setOffscreenRenderTarget(this.gl,this._modelRenderTargetWidth,this._modelRenderTargetHeight,this._currentFbo):r.startUsingRenderTexture();let n=r.getParentPartOffscreen();r.setOldOffscreen(n);let i=null;n!=null&&(i=n.getRenderTexture()),i==null&&(i=this._modelRootFbo),r.beginDraw(i),this.gl.viewport(0,0,this._modelRenderTargetWidth,this._modelRenderTargetHeight),r.clear(0,0,0,0),this._currentOffscreen=r,this._currentFbo=r.getRenderTexture()}drawOffscreen(e){let r=e.getOffscreenIndex(),n=this._offscreenClippingManager!=null?this._offscreenClippingManager.getClippingContextListForOffscreen()[r]:null;if(n!=null&&this.isUsingHighPrecisionMask()){n._isUsing&&(this.gl.viewport(0,0,this._offscreenClippingManager.getClippingMaskBufferSize(),this._offscreenClippingManager.getClippingMaskBufferSize()),this.preDraw(),this.getOffscreenMaskBuffer(n._bufferIndex).beginDraw(this._currentFbo),this.gl.clearColor(1,1,1,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT));{let i=n._clippingIdCount;for(let s=0;s<i;s++){let o=n._clippingIdList[s];this.getModel().getDrawableDynamicFlagVertexPositionsDidChange(o)&&(this.setIsCulling(this.getModel().getDrawableCulling(o)!=!1),this.setClippingContextBufferForMask(n),this.drawMeshWebGL(this.getModel(),o))}}this.getOffscreenMaskBuffer(n._bufferIndex).endDraw(),this.setClippingContextBufferForMask(null),this.gl.viewport(0,0,this._modelRenderTargetWidth,this._modelRenderTargetHeight),this.preDraw()}this.setClippingContextBufferForOffscreen(n),this.setIsCulling(this._model.getOffscreenCulling(r)!=!1),this.drawOffscreenWebGL(this.getModel(),e)}drawOffscreenWebGL(e,r){this.isCulling()?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this.gl.frontFace(this.gl.CCW),Be.getInstance().getShader(this.gl).setupShaderProgramForOffscreen(this,e,r),r.endDraw(),this._currentOffscreen=this._currentOffscreen.getOldOffscreen(),this._currentFbo=r.getOldFBO(),this._currentFbo==null&&(this._currentOffscreen=this._modelRenderTargets[0],this._currentFbo=this._modelRenderTargets[0].getRenderTexture(),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this._currentFbo));{let n=this.gl.createBuffer();this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,n),this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,Fa,this.gl.STATIC_DRAW),this.gl.drawElements(this.gl.TRIANGLES,Fa.length,this.gl.UNSIGNED_SHORT,0),this.gl.deleteBuffer(n)}r.stopUsingRenderTexture(),this.gl.useProgram(null),this.setClippingContextBufferForMask(null),this.setClippingContextBufferForOffscreen(null)}saveProfile(){this._rendererProfile.save()}restoreProfile(){this._rendererProfile.restore()}beforeDrawModelRenderTarget(){if(this._modelRenderTargets.length!=0){for(let e=0;e<this._modelRenderTargets.length;++e)(this._modelRenderTargets[e].getBufferWidth()!=this._modelRenderTargetWidth||this._modelRenderTargets[e].getBufferHeight()!=this._modelRenderTargetHeight)&&this._modelRenderTargets[e].createRenderTarget(this.gl,this._modelRenderTargetWidth,this._modelRenderTargetHeight,this._currentFbo);this._modelRenderTargets[0].beginDraw(),this._modelRenderTargets[0].clear(0,0,0,0)}}afterDrawModelRenderTarget(){if(this._modelRenderTargets.length!=0){if(this._modelRenderTargets[0].endDraw(),Be.getInstance().getShader(this.gl).setupShaderProgramForOffscreenRenderTarget(this),Be.getInstance().getShader(this.gl)._isShaderLoaded){let e=this.gl.createBuffer();this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,e),this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,Fa,this.gl.STATIC_DRAW),this.gl.drawElements(this.gl.TRIANGLES,Fa.length,this.gl.UNSIGNED_SHORT,0),this.gl.deleteBuffer(e)}this.gl.useProgram(null)}}getOffscreenMaskBuffer(e){return this._offscreenMasks[e]}static doStaticRelease(){Be.deleteInstance()}setRenderState(e,r){this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,e),this.gl.viewport(r[0],r[1],r[2],r[3]),(this._modelRenderTargetWidth!=r[2]||this._modelRenderTargetHeight!=r[3])&&(this._modelRenderTargetWidth=r[2],this._modelRenderTargetHeight=r[3])}preDraw(){if(this.gl.disable(this.gl.SCISSOR_TEST),this.gl.disable(this.gl.STENCIL_TEST),this.gl.disable(this.gl.DEPTH_TEST),this.gl.frontFace(this.gl.CW),this.gl.enable(this.gl.BLEND),this.gl.colorMask(!0,!0,!0,!0),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,null),this.getAnisotropy()>0&&this._extension)for(let e=0;e<this._textures.size;++e)this.gl.bindTexture(this.gl.TEXTURE_2D,this._textures.get(e)),this.gl.texParameterf(this.gl.TEXTURE_2D,this._extension.TEXTURE_MAX_ANISOTROPY_EXT,this.getAnisotropy())}getDrawableMaskBuffer(e){return this._drawableMasks[e]}setClippingContextBufferForMask(e){this._clippingContextBufferForMask=e}getClippingContextBufferForMask(){return this._clippingContextBufferForMask}setClippingContextBufferForDrawable(e){this._clippingContextBufferForDraw=e}getClippingContextBufferForDrawable(){return this._clippingContextBufferForDraw}setClippingContextBufferForOffscreen(e){this._clippingContextBufferForOffscreen=e}getClippingContextBufferForOffscreen(){return this._clippingContextBufferForOffscreen}isGeneratingMask(){return this.getClippingContextBufferForMask()!=null}startUp(e){if(this.gl=e,this._drawableClippingManager&&this._drawableClippingManager.setGL(e),this._offscreenClippingManager&&this._offscreenClippingManager.setGL(e),Be.getInstance().setGlContext(e),this._rendererProfile.setGl(e),this._extension=this.gl.getExtension("EXT_texture_filter_anisotropic")||this.gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||this.gl.getExtension("MOZ_EXT_texture_filter_anisotropic"),this._model.isUsingMasking()){this._drawableMasks.length=this._drawableClippingManager.getRenderTextureCount();for(let r=0;r<this._drawableMasks.length;++r){let n=new De;n.createRenderTarget(this.gl,this._drawableClippingManager.getClippingMaskBufferSize(),this._drawableClippingManager.getClippingMaskBufferSize(),this._currentFbo),this._drawableMasks[r]=n}}if(this._model.isBlendModeEnabled()){this._modelRenderTargets.length=0;let r=3;this._modelRenderTargets.length=r;for(let i=0;i<r;++i){let s=new Os;s.createRenderTarget(this.gl,this._modelRenderTargetWidth,this._modelRenderTargetHeight,this._currentFbo),this._modelRenderTargets[i]=s}if(this._model.isUsingMaskingForOffscreen()){this._offscreenMasks.length=this._offscreenClippingManager.getRenderTextureCount();for(let i=0;i<this._offscreenMasks.length;++i){let s=new De;s.createRenderTarget(this.gl,this._offscreenClippingManager.getClippingMaskBufferSize(),this._offscreenClippingManager.getClippingMaskBufferSize(),this._currentFbo),this._offscreenMasks[i]=s}}let n=this._model.getOffscreenCount();if(n>0){this._offscreenList=new Array(n);for(let i=0;i<n;++i){let s=new Os;s.setOffscreenIndex(i),this._offscreenList[i]=s}this.setupParentOffscreens(this._model,n)}}this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this._currentFbo)}_textures;_sortedObjectsIndexList;_sortedObjectsTypeList;_rendererProfile;_drawableClippingManager;_clippingContextBufferForMask;_clippingContextBufferForDraw;_clippingContextBufferForOffscreen;_offscreenClippingManager;_modelRenderTargets;_drawableMasks;_offscreenMasks;_offscreenList;_currentFbo;_currentOffscreen;_modelRootFbo;_bufferData;_extension;gl};jt.staticRelease=()=>{en.doStaticRelease()};var o0;(n=>(n.CubismClippingContext=Ds,n.CubismClippingManager_WebGL=Zr,n.CubismRenderer_WebGL=en))(o0||={});var Zt=class t{static create(e,r){let n=null;if(r&&!this.hasMocConsistency(e))return R("Inconsistent MOC3."),n;let i=Live2DCubismCore.Moc.fromArrayBuffer(e);return i&&(n=new t(i),n._mocVersion=Live2DCubismCore.Version.csmGetMocVersion(e)),n}static delete(e){e._moc._release(),e._moc=null,e=null}createModel(){let e=null,r=Live2DCubismCore.Model.fromMoc(this._moc);return r&&(e=new ui(r),e.initialize(),++this._modelCount),e}deleteModel(e){e!=null&&(e.release(),e=null,--this._modelCount)}constructor(e){this._moc=e,this._modelCount=0,this._mocVersion=0}release(){ie(this._modelCount==0),this._moc._release(),this._moc=null}getLatestMocVersion(){return Live2DCubismCore.Version.csmGetLatestMocVersion()}getMocVersion(){return this._mocVersion}static getMocVersionFromBuffer(e){return Live2DCubismCore.Version.csmGetMocVersion(e)}static hasMocConsistency(e){return Live2DCubismCore.Moc.prototype.hasMocConsistency(e)===1}_moc;_modelCount;_mocVersion},l0;(e=>e.CubismMoc=Zt)(l0||={});var Tf="Meta",c0="UserDataCount",d0="TotalUserDataSize",$c="UserData",p0="Target",h0="Id",m0="Value",di=class{constructor(e,r){this._json=se.create(e,r)}release(){se.delete(this._json)}getUserDataCount(){return this._json.getRoot().getValueByString(Tf).getValueByString(c0).toInt()}getTotalUserDataSize(){return this._json.getRoot().getValueByString(Tf).getValueByString(d0).toInt()}getUserDataTargetType(e){return this._json.getRoot().getValueByString($c).getValueByIndex(e).getValueByString(p0).getRawString()}getUserDataId(e){return B.getIdManager().getId(this._json.getRoot().getValueByString($c).getValueByIndex(e).getValueByString(h0).getRawString())}getUserDataValue(e){return this._json.getRoot().getValueByString($c).getValueByIndex(e).getValueByString(m0).getRawString()}_json},f0;(e=>e.CubismModelUserDataJson=di)(f0||={});var b0="ArtMesh",Fs=class{targetType;targetId;value},tn=class t{static create(e,r){let n=new t;return n.parseUserData(e,r),n}static delete(e){e!=null&&(e.release(),e=null)}getArtMeshUserDatas(){return this._artMeshUserDataNode}parseUserData(e,r){let n=new di(e,r);if(!n){n.release(),n=void 0;return}let i=B.getIdManager().getId(b0),s=n.getUserDataCount(),o=this._userDataNodes.length;this._userDataNodes.length=s;for(let l=0;l<s;l++){let a=new Fs;a.targetId=n.getUserDataId(l),a.targetType=B.getIdManager().getId(n.getUserDataTargetType(l)),a.value=n.getUserDataValue(l),this._userDataNodes[o++]=a,a.targetType==i&&this._artMeshUserDataNode.push(a)}n.release(),n=void 0}constructor(){this._userDataNodes=new Array,this._artMeshUserDataNode=new Array}release(){for(let e=0;e<this._userDataNodes.length;++e)this._userDataNodes[e]=null;this._userDataNodes=null}_userDataNodes;_artMeshUserDataNode},_0;(r=>(r.CubismModelUserData=tn,r.CubismModelUserDataNode=Fs))(_0||={});var pi=class t{isInitialized(){return this._initialized}setInitialized(e){this._initialized=e}isUpdating(){return this._updating}setUpdating(e){this._updating=e}setDragging(e,r){this._dragManager.set(e,r)}getModelMatrix(){return this._modelMatrix}setRenderTargetSize(e,r){this._renderer&&this._renderer.setRenderTargetSize(e,r)}setOpacity(e){this._opacity=e}getOpacity(){return this._opacity}loadModel(e,r=!1){if(this._moc=Zt.create(e,r),this._moc==null){R("Failed to CubismMoc.create().");return}if(this._model=this._moc.createModel(),this._model==null){R("Failed to CreateModel().");return}this._model.saveParameters(),this._modelMatrix=new Hn(this._model.getCanvasWidth(),this._model.getCanvasHeight())}loadMotion(e,r,n,i,s,o,l,a,u=!1){if(e==null||r==0)return R("Failed to loadMotion()."),null;let d=Kn.create(e,r,i,s,u);if(d==null)return R("Failed to create motion from buffer in LoadMotion()"),null;if(o){let c=o.getMotionFadeInTimeValue(l,a);c>=0&&d.setFadeInTime(c);let p=o.getMotionFadeOutTimeValue(l,a);p>=0&&d.setFadeOutTime(p)}return d}loadExpression(e,r,n){return e==null||r==0?(R("Failed to loadExpression()."),null):yt.create(e,r)}loadPose(e,r){if(e==null||r==0){R("Failed to loadPose().");return}this._pose=Yr.create(e,r)}loadUserData(e,r){if(e==null||r==0){R("Failed to loadUserData().");return}this._modelUserData=tn.create(e,r)}loadPhysics(e,r){if(e==null||r==0){R("Failed to loadPhysics().");return}this._physics=Qr.create(e,r)}isHit(e,r,n){let i=this._model.getDrawableIndex(e);if(i<0)return!1;let s=this._model.getDrawableVertexCount(i),o=this._model.getDrawableVertices(i),l=o[0],a=o[0],u=o[1],d=o[1];for(let _=1;_<s;++_){let m=o[He.vertexOffset+_*He.vertexStep],f=o[He.vertexOffset+_*He.vertexStep+1];m<l&&(l=m),m>a&&(a=m),f<u&&(u=f),f>d&&(d=f)}let c=this._modelMatrix.invertTransformX(r),p=this._modelMatrix.invertTransformY(n);return l<=c&&c<=a&&u<=p&&p<=d}getModel(){return this._model}getMocVersionFromBuffer(e){return Zt.getMocVersionFromBuffer(e)}getRenderer(){return this._renderer}createRenderer(e,r,n=1){this._renderer&&this.deleteRenderer(),this._renderer=new en(e,r),this._renderer.initialize(this._model,n)}deleteRenderer(){this._renderer!=null&&(this._renderer.release(),this._renderer=null)}motionEventFired(e){he("{0}",e)}static cubismDefaultMotionEventCallback(e,r,n){let i=n;i?.motionEventFired(r)}constructor(){this._moc=null,this._model=null,this._motionManager=null,this._expressionManager=null,this._eyeBlink=null,this._breath=null,this._modelMatrix=null,this._pose=null,this._dragManager=null,this._physics=null,this._modelUserData=null,this._initialized=!1,this._updating=!1,this._opacity=1,this._mocConsistency=!1,this._debugMode=!1,this._renderer=null,this._motionManager=new Zn,this._motionManager.setEventCallback(t.cubismDefaultMotionEventCallback,this),this._expressionManager=new jn,this._dragManager=new $n}release(){this._motionManager!=null&&(this._motionManager.release(),this._motionManager=null),this._expressionManager!=null&&(this._expressionManager.release(),this._expressionManager=null),this._moc!=null&&(this._moc.deleteModel(this._model),this._moc.release(),this._moc=null),this._modelMatrix=null,Yr.delete(this._pose),Tr.delete(this._eyeBlink),wr.delete(this._breath),this._dragManager=null,Qr.delete(this._physics),tn.delete(this._modelUserData),this.deleteRenderer()}_moc;_model;_motionManager;_expressionManager;_eyeBlink;_breath;_modelMatrix;_pose;_dragManager;_physics;_modelUserData;_initialized;_updating;_opacity;_mocConsistency;_motionConsistency;_debugMode;_renderer},C0;(e=>e.CubismUserModel=pi)(C0||={});var Lr=(a=>(a[a.CubismUpdateOrder_EyeBlink=200]="CubismUpdateOrder_EyeBlink",a[a.CubismUpdateOrder_Expression=300]="CubismUpdateOrder_Expression",a[a.CubismUpdateOrder_Drag=400]="CubismUpdateOrder_Drag",a[a.CubismUpdateOrder_Breath=500]="CubismUpdateOrder_Breath",a[a.CubismUpdateOrder_Physics=600]="CubismUpdateOrder_Physics",a[a.CubismUpdateOrder_LipSync=700]="CubismUpdateOrder_LipSync",a[a.CubismUpdateOrder_Pose=800]="CubismUpdateOrder_Pose",a[a.CubismUpdateOrder_Max=Number.MAX_SAFE_INTEGER]="CubismUpdateOrder_Max",a))(Lr||{}),le=class{static sortFunction(e,r){if(!e||!r){if(!e&&!r)return 0;if(!e)return 1;if(!r)return-1}return e.getExecutionOrder()-r.getExecutionOrder()}_executionOrder;_changeListeners=[];constructor(e=0){this._executionOrder=e}getExecutionOrder(){return this._executionOrder}setExecutionOrder(e){this._executionOrder!==e&&(this._executionOrder=e,this.notifyChangeListeners())}addChangeListener(e){e&&this._changeListeners.indexOf(e)===-1&&this._changeListeners.push(e)}removeChangeListener(e){let r=this._changeListeners.indexOf(e);r>=0&&this._changeListeners.splice(r,1)}notifyChangeListeners(){for(let e of this._changeListeners)e.onUpdaterChanged(this)}},x0;(e=>e.ICubismUpdater=le)(x0||={});var hi=class{_cubismUpdatableList;_needsSort;constructor(){this._cubismUpdatableList=[],this._needsSort=!1}release(){for(let e of this._cubismUpdatableList)e&&e.removeChangeListener(this);this._cubismUpdatableList.length=0}addUpdatableList(e){e&&(this.hasUpdatable(e)||(this._cubismUpdatableList.push(e),e.addChangeListener(this),this._needsSort=!0))}removeUpdatableList(e){if(!e)return!1;let r=this._cubismUpdatableList.indexOf(e);return r>=0?(this._cubismUpdatableList.splice(r,1),e.removeChangeListener(this),!0):!1}sortUpdatableList(){this._cubismUpdatableList.sort(le.sortFunction),this._needsSort=!1}onLateUpdate(e,r){if(e){this._needsSort&&this.sortUpdatableList();for(let n=0;n<this._cubismUpdatableList.length;++n){let i=this._cubismUpdatableList[n];i&&i.onLateUpdate(e,r)}}}getUpdatableCount(){return this._cubismUpdatableList.length}getUpdatable(e){return e<0||e>=this._cubismUpdatableList.length?null:this._cubismUpdatableList[e]}hasUpdatable(e){return this._cubismUpdatableList.indexOf(e)>=0}clearUpdatableList(){for(let e of this._cubismUpdatableList)e&&e.removeChangeListener(this);this._cubismUpdatableList.length=0,this._needsSort=!1}onUpdaterChanged(e){this._needsSort=!0}},S0;(e=>e.CubismUpdateScheduler=hi)(S0||={});var mi=class extends le{_breath;constructor(e,r){super(r??500),this._breath=e}onLateUpdate(e,r){e&&this._breath.updateParameters(e,r)}},w0;(e=>e.CubismBreathUpdater=mi)(w0||={});var fi=class extends le{_look;_dragManager;constructor(e,r,n){super(n??400),this._look=e,this._dragManager=r}onLateUpdate(e,r){if(!e)return;this._dragManager.update(r);let n=this._dragManager.getX(),i=this._dragManager.getY();this._look.updateParameters(e,n,i)}},L0;(e=>e.CubismLookUpdater=fi)(L0||={});var gi=class extends le{_motionUpdated;_eyeBlink;constructor(e,r,n){super(n??200),this._motionUpdated=e,this._eyeBlink=r}onLateUpdate(e,r){e&&(this._motionUpdated()||this._eyeBlink.updateParameters(e,r))}},I0;(e=>e.CubismEyeBlinkUpdater=gi)(I0||={});var bi=class extends le{_expressionManager;constructor(e,r){super(r??300),this._expressionManager=e}onLateUpdate(e,r){e&&this._expressionManager.updateMotion(e,r)}},E0;(e=>e.CubismExpressionUpdater=bi)(E0||={});var _i=class extends le{_physics;constructor(e,r){super(r??600),this._physics=e}onLateUpdate(e,r){e&&this._physics.evaluate(e,r)}},k0;(e=>e.CubismPhysicsUpdater=_i)(k0||={});var yi=class extends le{_pose;constructor(e,r){super(r??800),this._pose=e}onLateUpdate(e,r){e&&this._pose.updateParameters(e,r)}},O0;(e=>e.CubismPoseUpdater=yi)(O0||={});var Ci=class extends le{_lipSyncIds;_audioProvider;constructor(e,r,n){super(n??700),this._lipSyncIds=[...e],this._audioProvider=r}onLateUpdate(e,r){if(e&&this._audioProvider&&this._audioProvider.update(r)){let i=this._audioProvider.getParameter();for(let s=0;s<this._lipSyncIds.length;s++)e.addParameterValueById(this._lipSyncIds[s],i)}}setAudioProvider(e){this._audioProvider=e}getAudioProvider(){return this._audioProvider}},F0;(e=>e.CubismLipSyncUpdater=Ci)(F0||={});var vi=class{constructor(){}},U0;(e=>e.IParameterProvider=vi)(U0||={});var Na=class extends vi{update(e){let r,n;if(this._pcmData==null||this._sampleOffset>=this._wavFileInfo._samplesPerChannel)return this._lastRms=0,!1;let i=e??1/60;this._userTimeSeconds+=i,r=Math.floor(this._userTimeSeconds*this._wavFileInfo._samplingRate),r>this._wavFileInfo._samplesPerChannel&&(r=this._wavFileInfo._samplesPerChannel),n=0;for(let s=0;s<this._wavFileInfo._numberOfChannels;s++)for(let o=this._sampleOffset;o<r;o++){let l=this._pcmData[s][o];n+=l*l}return n=Math.sqrt(n/(this._wavFileInfo._numberOfChannels*(r-this._sampleOffset))),this._lastRms=n,this._sampleOffset=r,!0}start(e){this._sampleOffset=0,this._userTimeSeconds=0,this._lastRms=0,this.loadWavFile(e)}getParameter(){return this.getRms()}getRms(){return this._lastRms}loadWavFile(e){return new Promise(r=>{let n=!1;this._pcmData!=null&&this.releasePcmData();let i=async()=>fetch(e).then(o=>o.arrayBuffer()),s=(async()=>{if(this._byteReader._fileByte=await i(),this._byteReader._fileDataView=new DataView(this._byteReader._fileByte),this._byteReader._fileSize=this._byteReader._fileByte.byteLength,this._byteReader._readOffset=0,this._byteReader._fileByte==null||this._byteReader._fileSize<4){r(!1);return}this._wavFileInfo._fileName=e;try{if(!this._byteReader.getCheckSignature("RIFF"))throw n=!1,new Error('Cannot find Signeture "RIFF".');if(this._byteReader.get32LittleEndian(),!this._byteReader.getCheckSignature("WAVE"))throw n=!1,new Error('Cannot find Signeture "WAVE".');if(!this._byteReader.getCheckSignature("fmt "))throw n=!1,new Error('Cannot find Signeture "fmt".');let o=this._byteReader.get32LittleEndian();if(this._byteReader.get16LittleEndian()!=1)throw n=!1,new Error("File is not linear PCM.");for(this._wavFileInfo._numberOfChannels=this._byteReader.get16LittleEndian(),this._wavFileInfo._samplingRate=this._byteReader.get32LittleEndian(),this._byteReader.get32LittleEndian(),this._byteReader.get16LittleEndian(),this._wavFileInfo._bitsPerSample=this._byteReader.get16LittleEndian(),o>16&&(this._byteReader._readOffset+=o-16);!this._byteReader.getCheckSignature("data")&&this._byteReader._readOffset<this._byteReader._fileSize;)this._byteReader._readOffset+=this._byteReader.get32LittleEndian()+4;if(this._byteReader._readOffset>=this._byteReader._fileSize)throw n=!1,new Error('Cannot find "data" Chunk.');{let l=this._byteReader.get32LittleEndian();this._wavFileInfo._samplesPerChannel=l*8/(this._wavFileInfo._bitsPerSample*this._wavFileInfo._numberOfChannels)}this._pcmData=new Array(this._wavFileInfo._numberOfChannels);for(let l=0;l<this._wavFileInfo._numberOfChannels;l++)this._pcmData[l]=new Float32Array(this._wavFileInfo._samplesPerChannel);for(let l=0;l<this._wavFileInfo._samplesPerChannel;l++)for(let a=0;a<this._wavFileInfo._numberOfChannels;a++)this._pcmData[a][l]=this.getPcmSample();n=!0,r(n)}catch(o){console.log(o)}})().then(()=>{r(n)})})}getPcmSample(){let e;switch(this._wavFileInfo._bitsPerSample){case 8:e=this._byteReader.get8()-128,e<<=24;break;case 16:e=this._byteReader.get16LittleEndian()<<16;break;case 24:e=this._byteReader.get24LittleEndian()<<8;break;default:e=0;break}return e/2147483647}getPcmDataChannel(e){return!this._pcmData||!(e<this._pcmData.length)?null:Float32Array.from(this._pcmData[e])}getWavSamplingRate(){return!this._wavFileInfo||this._wavFileInfo._samplingRate<1?null:this._wavFileInfo._samplingRate}releasePcmData(){for(let e=0;e<this._wavFileInfo._numberOfChannels;e++)this._pcmData[e]=null;delete this._pcmData,this._pcmData=null}constructor(){super(),this._pcmData=null,this._userTimeSeconds=0,this._lastRms=0,this._sampleOffset=0,this._wavFileInfo=new jc,this._byteReader=new Xc}_pcmData;_userTimeSeconds;_lastRms;_sampleOffset;_wavFileInfo;_byteReader;loadFiletoBytes=(e,r)=>{this._byteReader._fileByte=e,this._byteReader._fileDataView=new DataView(this._byteReader._fileByte),this._byteReader._fileSize=r}},jc=class{constructor(){this._fileName="",this._numberOfChannels=0,this._bitsPerSample=0,this._samplingRate=0,this._samplesPerChannel=0}_fileName;_numberOfChannels;_bitsPerSample;_samplingRate;_samplesPerChannel},Xc=class{constructor(){this._fileByte=null,this._fileDataView=null,this._fileSize=0,this._readOffset=0}get8(){let e=this._fileDataView.getUint8(this._readOffset);return this._readOffset++,e}get16LittleEndian(){let e=this._fileDataView.getUint8(this._readOffset+1)<<8|this._fileDataView.getUint8(this._readOffset);return this._readOffset+=2,e}get24LittleEndian(){let e=this._fileDataView.getUint8(this._readOffset+2)<<16|this._fileDataView.getUint8(this._readOffset+1)<<8|this._fileDataView.getUint8(this._readOffset);return this._readOffset+=3,e}get32LittleEndian(){let e=this._fileDataView.getUint8(this._readOffset+3)<<24|this._fileDataView.getUint8(this._readOffset+2)<<16|this._fileDataView.getUint8(this._readOffset+1)<<8|this._fileDataView.getUint8(this._readOffset);return this._readOffset+=4,e}getCheckSignature(e){let r=new Uint8Array(4),n=new TextEncoder().encode(e);if(e.length!=4)return!1;for(let i=0;i<4;i++)r[i]=this.get8();return r[0]==n[0]&&r[1]==n[1]&&r[2]==n[2]&&r[3]==n[3]}_fileByte;_fileDataView;_fileSize;_readOffset};var Ua=class extends pi{loadAssets(e,r){this._modelHomeDir=e,fetch(`${this._modelHomeDir}${r}`).then(n=>n.arrayBuffer()).then(n=>{let i=new zn(n,n.byteLength);this._state=1,this.setupModel(i)}).catch(n=>{R(`Failed to load file ${this._modelHomeDir}${r}`)})}setupModel(e){if(this._updating=!0,this._initialized=!1,this._modelSetting=e,this._modelSetting.getModelFileName()!=""){let m=this._modelSetting.getModelFileName();fetch(`${this._modelHomeDir}${m}`).then(f=>{if(f.ok)return f.arrayBuffer();if(f.status>=400)return R(`Failed to load file ${this._modelHomeDir}${m}`),new ArrayBuffer(0)}).then(f=>{this.loadModel(f,this._mocConsistency),this._state=3,r()}),this._state=2}else N.printMessage("Model data does not exist.");let r=()=>{if(this._modelSetting.getExpressionCount()>0){let m=this._modelSetting.getExpressionCount();for(let f=0;f<m;f++){let y=this._modelSetting.getExpressionName(f),b=this._modelSetting.getExpressionFileName(f);fetch(`${this._modelHomeDir}${b}`).then(g=>{if(g.ok)return g.arrayBuffer();if(g.status>=400)return R(`Failed to load file ${this._modelHomeDir}${b}`),new ArrayBuffer(0)}).then(g=>{let h=this.loadExpression(g,g.byteLength,y);if(this._expressions.get(y)!=null&&(Qe.delete(this._expressions.get(y)),this._expressions.set(y,null)),this._expressions.set(y,h),this._expressionCount++,this._expressionCount>=m){if(this._expressionManager!=null){let C=new bi(this._expressionManager);this._updateScheduler.addUpdatableList(C)}this._state=5,n()}})}this._state=4}else this._state=5,n()},n=()=>{if(this._modelSetting.getPhysicsFileName()!=""){let m=this._modelSetting.getPhysicsFileName();fetch(`${this._modelHomeDir}${m}`).then(f=>{if(f.ok)return f.arrayBuffer();if(f.status>=400)return R(`Failed to load file ${this._modelHomeDir}${m}`),new ArrayBuffer(0)}).then(f=>{if(this.loadPhysics(f,f.byteLength),this._physics){let y=new _i(this._physics);this._updateScheduler.addUpdatableList(y)}this._state=7,i()}),this._state=6}else this._state=7,i()},i=()=>{if(this._modelSetting.getPoseFileName()!=""){let m=this._modelSetting.getPoseFileName();fetch(`${this._modelHomeDir}${m}`).then(f=>{if(f.ok)return f.arrayBuffer();if(f.status>=400)return R(`Failed to load file ${this._modelHomeDir}${m}`),new ArrayBuffer(0)}).then(f=>{if(this.loadPose(f,f.byteLength),this._pose){let y=new yi(this._pose);this._updateScheduler.addUpdatableList(y)}this._state=9,s()}),this._state=8}else this._state=9,s()},s=()=>{if(this._modelSetting.getEyeBlinkParameterCount()>0){this._eyeBlink=Tr.create(this._modelSetting);let m=new gi(()=>this._motionUpdated,this._eyeBlink);this._updateScheduler.addUpdatableList(m)}this._state=10,o()},o=()=>{this._breath=wr.create();let m=[new It(this._idParamAngleX,0,15,6.5345,.5),new It(this._idParamAngleY,0,8,3.5345,.5),new It(this._idParamAngleZ,0,10,5.5345,.5),new It(this._idParamBodyAngleX,0,4,15.5345,.5),new It(B.getIdManager().getId(I.ParamBreath),.5,.5,3.2345,1)];this._breath.setParameters(m);let f=new mi(this._breath);this._updateScheduler.addUpdatableList(f),this._state=11,l()},l=()=>{if(this._modelSetting.getUserDataFile()!=""){let m=this._modelSetting.getUserDataFile();fetch(`${this._modelHomeDir}${m}`).then(f=>{if(f.ok)return f.arrayBuffer();if(f.status>=400)return R(`Failed to load file ${this._modelHomeDir}${m}`),new ArrayBuffer(0)}).then(f=>{this.loadUserData(f,f.byteLength),this._state=13,a()}),this._state=12}else this._state=13,a()},a=()=>{let m=this._modelSetting.getEyeBlinkParameterCount();this._eyeBlinkIds.length=m;for(let f=0;f<m;++f)this._eyeBlinkIds[f]=this._modelSetting.getEyeBlinkParameterId(f);this._state=14,u()},u=()=>{let m=this._modelSetting.getLipSyncParameterCount();this._lipSyncIds.length=m;for(let f=0;f<m;++f)this._lipSyncIds[f]=this._modelSetting.getLipSyncParameterId(f);if(this._lipSyncIds.length>0){let f=new Ci(this._lipSyncIds,this._wavFileHandler);this._updateScheduler.addUpdatableList(f)}this._state=15,d()},d=()=>{this._look=Xr.create();let m=[new _t(this._idParamAngleX,30,0,0),new _t(this._idParamAngleY,0,30,0),new _t(this._idParamAngleZ,0,0,-30),new _t(this._idParamBodyAngleX,10,0,0),new _t(B.getIdManager().getId(I.ParamEyeBallX),1,0,0),new _t(B.getIdManager().getId(I.ParamEyeBallY),0,1,0)];this._look.setParameters(m);let f=new fi(this._look,this._dragManager);this._updateScheduler.addUpdatableList(f),c()},c=()=>{this._updateScheduler.sortUpdatableList(),this._state=16,p()},p=()=>{let m=new Map;if(this._modelSetting==null||this._modelMatrix==null){R("Failed to setupLayout().");return}this._modelSetting.getLayoutMap(m),this._modelMatrix.setupFromLayout(m),this._state=17,_()},_=()=>{this._state=18,this._model.saveParameters(),this._allMotionCount=0,this._motionCount=0;let m=[],f=this._modelSetting.getMotionGroupCount();for(let y=0;y<f;y++)m[y]=this._modelSetting.getMotionGroupName(y),this._allMotionCount+=this._modelSetting.getMotionCount(m[y]);for(let y=0;y<f;y++)this.preLoadMotionGroup(m[y]);f==0&&(this._state=21,this._motionManager.stopAllMotions(),this._updating=!1,this._initialized=!0,this.createRenderer(this._subdelegate.getCanvas().width,this._subdelegate.getCanvas().height),this.setupTextures(),this.getRenderer().startUp(this._subdelegate.getGlManager().getGl()),this.getRenderer().loadShaders(_a))}}setupTextures(){if(this._state==21){let r=this._modelSetting.getTextureCount();for(let n=0;n<r;n++){if(this._modelSetting.getTextureFileName(n)==""){console.log("getTextureFileName null");continue}let i=this._modelSetting.getTextureFileName(n);i=this._modelHomeDir+i;let s=o=>{this.getRenderer().bindTexture(n,o.id),this._textureCount++,this._textureCount>=r&&(this._state=23)};this._subdelegate.getTextureManager().createTextureFromPngFile(i,!0,s),this.getRenderer().setIsPremultipliedAlpha(!0)}this._state=22}}reloadRenderer(){this.deleteRenderer(),this.createRenderer(this._subdelegate.getCanvas().width,this._subdelegate.getCanvas().height),this.setupTextures()}update(){if(this._state!=23)return;let e=N.getDeltaTime();this._userTimeSeconds+=e,this._model.loadParameters(),this._motionUpdated=!1,this._motionManager.isFinished()?Um&&this.startRandomMotion(ba,Ca):this._motionUpdated=this._motionManager.updateMotion(this._model,e),this._model.saveParameters(),this._updateScheduler.onLateUpdate(this._model,e),this._model.update()}startMotion(e,r,n,i,s){if(n==va)this._motionManager.setReservePriority(n);else if(!this._motionManager.reserveMotion(n))return this._debugMode&&N.printMessage("[APP]can't start motion."),Yt;let o=this._modelSetting.getMotionFileName(e,r),l=`${e}_${r}`,a=this._motions.get(l),u=!1;if(a==null)if(fetch(`${this._modelHomeDir}${o}`).then(c=>{if(c.ok)return c.arrayBuffer();if(c.status>=400)return R(`Failed to load file ${this._modelHomeDir}${o}`),new ArrayBuffer(0)}).then(c=>{a=this.loadMotion(c,c.byteLength,null,i,s,this._modelSetting,e,r,this._motionConsistency)}),a)a.setEffectIds(this._eyeBlinkIds,this._lipSyncIds),u=!0;else return R("Can't start motion {0} .",o),this._motionManager.setReservePriority(ya),Yt;else a.setBeganMotionHandler(s),a.setFinishedMotionHandler(i);let d=this._modelSetting.getMotionSoundFileName(e,r);if(d.localeCompare("")!=0){let c=d;c=this._modelHomeDir+c,this._wavFileHandler.start(c)}return this._debugMode&&N.printMessage(`[APP]start motion: [${e}_${r}]`),this._motionManager.startMotionPriority(a,u,n)}startRandomMotion(e,r,n,i){if(this._modelSetting.getMotionCount(e)==0)return Yt;let s=Math.floor(Math.random()*this._modelSetting.getMotionCount(e));return this.startMotion(e,s,r,n,i)}setExpression(e){let r=this._expressions.get(e);this._debugMode&&N.printMessage(`[APP]expression: [${e}]`),r!=null?this._expressionManager.startMotion(r,!1):this._debugMode&&N.printMessage(`[APP]expression[${e}] is null`)}setRandomExpression(){if(this._expressions.size==0)return;let e=Math.floor(Math.random()*this._expressions.size);for(let r=0;r<this._expressions.size;r++)if(r==e){let i=[...this._expressions.entries()][r][0];this.setExpression(i);return}}motionEventFired(e){he("{0} is fired on LAppModel!!",e)}hitTest(e,r,n){if(this._opacity<1)return!1;let i=this._modelSetting.getHitAreasCount();for(let s=0;s<i;s++)if(this._modelSetting.getHitAreaName(s)==e){let o=this._modelSetting.getHitAreaId(s);return this.isHit(o,r,n)}return!1}preLoadMotionGroup(e){for(let r=0;r<this._modelSetting.getMotionCount(e);r++){let n=this._modelSetting.getMotionFileName(e,r),i=`${e}_${r}`;this._debugMode&&N.printMessage(`[APP]load motion: ${n} => [${i}]`),fetch(`${this._modelHomeDir}${n}`).then(s=>{if(s.ok)return s.arrayBuffer();if(s.status>=400)return R(`Failed to load file ${this._modelHomeDir}${n}`),new ArrayBuffer(0)}).then(s=>{let o=this.loadMotion(s,s.byteLength,i,null,null,this._modelSetting,e,r,this._motionConsistency);o!=null?(o.setEffectIds(this._eyeBlinkIds,this._lipSyncIds),this._motions.get(i)!=null&&Qe.delete(this._motions.get(i)),this._motions.set(i,o),this._motionCount++):this._allMotionCount--,this._motionCount>=this._allMotionCount&&(this._state=21,this._motionManager.stopAllMotions(),this._updating=!1,this._initialized=!0,this.createRenderer(this._subdelegate.getCanvas().width,this._subdelegate.getCanvas().height),this.setupTextures(),this.getRenderer().startUp(this._subdelegate.getGlManager().getGl()),this.getRenderer().loadShaders(_a))})}}releaseMotions(){this._motions.clear()}releaseExpressions(){this._expressions.clear()}doDraw(){if(this._model==null)return;let e=this._subdelegate.getCanvas(),r=[0,0,e.width,e.height];this.getRenderer().setRenderState(this._subdelegate.getFrameBuffer(),r),this.getRenderer().drawModel(_a)}draw(e){this._model!=null&&this._state==23&&(e.multiplyByMatrix(this._modelMatrix),this.getRenderer().setMvpMatrix(e),this.doDraw())}async hasMocConsistencyFromFile(){if(ie(this._modelSetting.getModelFileName().localeCompare("")),this._modelSetting.getModelFileName()!=""){let e=this._modelSetting.getModelFileName(),n=await(await fetch(`${this._modelHomeDir}${e}`)).arrayBuffer();return this._consistency=Zt.hasMocConsistency(n),this._consistency?he("Consistent MOC3."):he("Inconsistent MOC3."),this._consistency}else N.printMessage("Model data does not exist.")}setSubdelegate(e){this._subdelegate=e}release(){this._look&&(Xr.delete(this._look),this._look=null),this._updateScheduler&&this._updateScheduler.release(),super.release()}constructor(){super(),this._modelSetting=null,this._modelHomeDir=null,this._userTimeSeconds=0,this._eyeBlinkIds=new Array,this._lipSyncIds=new Array,this._motions=new Map,this._expressions=new Map,this._hitArea=new Array,this._userArea=new Array,this._idParamAngleX=B.getIdManager().getId(I.ParamAngleX),this._idParamAngleY=B.getIdManager().getId(I.ParamAngleY),this._idParamAngleZ=B.getIdManager().getId(I.ParamAngleZ),this._idParamBodyAngleX=B.getIdManager().getId(I.ParamBodyAngleX),qm&&(this._mocConsistency=!0),Qm&&(this._motionConsistency=!0),this._state=0,this._expressionCount=0,this._textureCount=0,this._motionCount=0,this._allMotionCount=0,this._wavFileHandler=new Na,this._consistency=!1,this._look=null,this._updateScheduler=new hi,this._motionUpdated=!1}_updateScheduler;_motionUpdated;_subdelegate;_modelSetting;_modelHomeDir;_userTimeSeconds;_eyeBlinkIds;_lipSyncIds;_motions;_expressions;_hitArea;_userArea;_idParamAngleX;_idParamAngleY;_idParamAngleZ;_idParamBodyAngleX;_look;_state;_expressionCount;_textureCount;_motionCount;_allMotionCount;_wavFileHandler;_consistency};var z0=/水印|watermark|logo/i;function Lf(t){return!!(t&&z0.test(t))}function W0(t){let e=[],r=[];if(!t||typeof t!="object")return{parameters:e,parts:r};let n=t;if(Array.isArray(n.Parameters))for(let i of n.Parameters){if(!i||typeof i!="object")continue;let s=i;typeof s.Id=="string"&&Lf(String(s.Name??""))&&e.push({id:s.Id,value:null})}if(Array.isArray(n.Parts))for(let i of n.Parts){if(!i||typeof i!="object")continue;let s=i;typeof s.Id=="string"&&Lf(String(s.Name??""))&&r.push(s.Id)}return{parameters:e,parts:r}}function H0(t){if(!t||typeof t!="object")return null;let e=t.Hotkeys;if(!Array.isArray(e))return null;for(let r of e){if(!r||typeof r!="object")continue;let n=r,i=n.Triggers;if(!(!i||typeof i!="object"||!Object.values(i).filter(o=>typeof o=="string").some(o=>o.toLowerCase()==="space"))&&typeof n.File=="string"&&n.File.toLowerCase().endsWith(".exp3.json"))return n.File.replace(/\\/g,"/")}return null}function $0(t){if(!t||typeof t!="object")return[];let e=t.Parameters;if(!Array.isArray(e))return[];let r=[];for(let n of e){if(!n||typeof n!="object")continue;let i=n;if(typeof i.Id!="string")continue;let s=typeof i.Value=="number"?i.Value:null;r.push({id:i.Id,value:s})}return r}function j0(t,e){let r=new Map;for(let i of t.parameters)r.set(i.id,{...i});let n=new Set(r.keys());for(let i of e)n.has(i.id)&&r.set(i.id,{id:i.id,value:i.value});return{parameters:[...r.values()],parts:[...t.parts]}}function Yc(t){return t.parameters.length>0||t.parts.length>0}async function Ga(t){try{let e=await fetch(t,{cache:"no-store"});return e.ok?await e.json():null}catch{return null}}function za(t,e){return`${t.endsWith("/")?t:`${t}/`}${e.replace(/^\/+/,"")}`}async function Bf(t,e){let r=await Ga(za(t,e)),n=r&&typeof r=="object"?r.FileReferences?.DisplayInfo:null,i=typeof n=="string"&&n?await Ga(za(t,n)):null,s=W0(i),o=e.replace(/\.model3\.json$/i,".vtube.json"),l=await Ga(za(t,o)),a=H0(l),u=a?await Ga(za(t,a)):null,d=$0(u);return j0(s,d)}function If(t,e,r){for(let n of r.parameters){let i=e.getId(n.id),s=t.getParameterIndex(i);if(s<0)continue;let o=n.value==null?t.getParameterMaximumValue(s):n.value;t.setParameterValueByIndex(s,o)}for(let n of r.parts)t.setPartOpacityById(e.getId(n),0)}var X0=75,Jc=150,Y0=300,Rf=3e3,J0=8e3,q0=900,Wa=class{phase="idle";phaseStart=0;openDuration=Jc;nextBlinkAt=performance.now()+this.nextInterval();lookX=0;lookY=0;gazeX=0;gazeY=0;lookUntil=0;nextSaccadeAt=performance.now()+1200;saccadeX=0;saccadeY=0;shouldYield(e){return e>Ca}setLook(e,r,n){this.lookX=Ef(e,-1,1),this.lookY=Ef(r,-1,1),this.lookUntil=n+q0}frame(e,r){let n=e<this.lookUntil,i=n?this.lookX:this.saccade(e,"x"),s=n?this.lookY:this.saccade(e,"y");this.gazeX+=(i-this.gazeX)*.18,this.gazeY+=(s-this.gazeY)*.18;let o=Math.max(r,1)*this.blinkFactor(e);return[["ParamEyeLOpen",o],["ParamEyeROpen",o],["ParamEyeBallX",this.gazeX*.85],["ParamEyeBallY",this.gazeY*.65],["ParamAngleX",this.gazeX*12],["ParamAngleY",this.gazeY*8]]}saccade(e,r){return e>=this.nextSaccadeAt&&(this.saccadeX=(Math.random()*2-1)*.35,this.saccadeY=(Math.random()*2-1)*.22,this.nextSaccadeAt=e+1400+Math.random()*1800),r==="x"?this.saccadeX:this.saccadeY}blinkFactor(e){if(this.phase==="idle"){if(e<this.nextBlinkAt)return 1;this.phase="closing",this.phaseStart=e}if(this.phase==="closing"){let n=Math.min(1,(e-this.phaseStart)/X0);if(n>=1)return this.phase="opening",this.phaseStart=e,this.openDuration=Jc+Math.random()*(Y0-Jc),0;let i=1-n;return i*i}let r=Math.min(1,(e-this.phaseStart)/this.openDuration);return r>=1?(this.phase="idle",this.nextBlinkAt=e+this.nextInterval(),1):r*r}nextInterval(){return Rf+Math.random()*(J0-Rf)}};function Ef(t,e,r){return Math.min(r,Math.max(e,t))}var Ha=class{portraitHead=null;_lipSyncValue=0;_watermarkPlan={parameters:[],parts:[]};_watermarkLoadToken=0;_paramOverlay=null;_idleLife=new Wa;releaseAllModel(){this._models.length=0}setOffscreenSize(e,r){for(let n=0;n<this._models.length;n++)this._models[n]?.setRenderTargetSize(e,r)}onDrag(e,r){let n=this._models[0];n&&n.setDragging(0,0)}onTap(e,r){if(!Gm)return;Ps&&N.printMessage(`[APP]tap point: {x: ${e.toFixed(2)} y: ${r.toFixed(2)}}`);let n=this._models[0];if(!n)return;let i=Nn,s=i?.hitAreas??[{name:Cc,id:"Head"},{name:vc,id:"Body"}],o=i?.motionGroups??{};for(let a of s){if(!n.hitTest(a.name,e,r))continue;Ps&&N.printMessage(`[APP]hit area: [${a.name}]`);let u=Z0(a.name,o);if(u){n.startRandomMotion(u,Mc,this.finishedMotion,this.beganMotion);return}n.setRandomExpression();return}let l=yc??Object.keys(o).find(a=>/^Tap/i.test(a));l&&n.startRandomMotion(l,Mc,this.finishedMotion,this.beganMotion)}playMotion(e,r=0,n=15e3){let i=this._models[0];if(!i||!e)return console.warn("[live2d] playMotion: no model",e),Promise.resolve(!1);let s=Nn,o=s?.motionGroups?.[e];if(!o||o.length===0)return console.warn("[live2d] playMotion: group missing in runtime",e,s?.id),N.printMessage(`[APP]motion group not found: ${e}`),Promise.resolve(!1);let l=Math.max(0,Math.min(r,o.length-1)),a=o[l]??"";if(/\.exp3(\.json)?$/i.test(a)){let u=a.split(/[\\/]/).pop()?.replace(/\.exp3(\.json)?$/i,"")??a;Q0(i);let d=this.setExpression(u)||this.setExpression(a);return N.printMessage(`[APP]play expression: ${u} ok=${d}`),Promise.resolve(d)}return N.printMessage(`[APP]play motion: ${e}[${l}]`),new Promise(u=>{let d=!1,c=y=>{d||(d=!0,window.clearTimeout(p),u(y))},p=window.setTimeout(()=>{N.printMessage(`[APP]motion timeout: ${e}[${l}]`),c(!0)},n),_=y=>{this.finishedMotion(y),c(!0)},m=y=>{this.beganMotion(y)};i.startMotion(e,l,va,_,m)===Yt&&N.printMessage(`[APP]motion start pending/async: ${e}[${l}]`)})}resetFacing(){let e=this._models[0];e&&e.setDragging(0,0)}setLipSyncValue(e){this._lipSyncValue=Math.max(0,Math.min(1,e))}setParamOverlay(e){this._paramOverlay=e}getParameterValue(e){let n=this._models[0]?.getModel();if(!n||!e)return 0;try{let i=B.getIdManager().getId(e);return n.getParameterValueById(i)}catch{return 0}}setParameterValue(e,r){let i=this._models[0]?.getModel();if(!(!i||!e))try{let s=B.getIdManager().getId(e);i.setParameterValueById(s,r)}catch{}}setLookTarget(e,r){this._idleLife.setLook(e,r,performance.now())}applyIdleLife(e){let r=e._motionManager?.getCurrentPriority?.()??ya;if(this._idleLife.shouldYield(r))return;let n=e.getModel();if(!n)return;let i=B.getIdManager(),s=n.getParameterCount(),o=i.getId("ParamEyeLOpen"),l=n.getParameterIndex(o),a=l>=0&&l<s?n.getParameterDefaultValue(l):1;for(let[u,d]of this._idleLife.frame(performance.now(),a>.2?a:1)){let c=i.getId(u),p=n.getParameterIndex(c);p<0||p>=s||n.setParameterValueById(c,d)}}setExpression(e){e=Nn?.expressionNames?.[e]||e;let r=this._models[0];return!r||!r._expressions.has(e)?!1:(r.setExpression(e),!0)}onUpdate(){let e=this._subdelegate.getGl();Jt.getInstance().beginFrameProcess(e);let{width:r,height:n}=this._subdelegate.getCanvas(),i=new W,s=this._models[0];if(!s){Jt.getInstance().endFrameProcess(e);return}s.getModel()&&(s.getModel().getCanvasWidth()>1&&r<n?(s.getModelMatrix().setWidth(2),i.scale(1,r/n)):i.scale(n/r,1),this._viewMatrix!=null&&i.multiplyByMatrix(this._viewMatrix));let o=this._subdelegate.getCanvas().dataset.portrait==="true";o||s.update();let l=s.getModel();o&&l&&l.update();for(let a of s._lipSyncIds)l.setParameterValueById(a,this._lipSyncValue);if(this._paramOverlay){let a=B.getIdManager();this._paramOverlay(u=>{try{return l.getParameterValueById(a.getId(u))}catch{return 0}},(u,d)=>{try{l.setParameterValueById(a.getId(u),d)}catch{}})}if(o||this.applyIdleLife(s),Yc(this._watermarkPlan)&&If(l,B.getIdManager(),this._watermarkPlan),s.draw(i),o&&l){let a=Nn?.hitAreas.find(u=>/head|face|头|脸/i.test(u.name));if(a){let u=l.getDrawableIndex(B.getIdManager().getId(a.id));if(u>=0){let d=l.getDrawableVertices(u),c=1/0,p=-1/0,_=1/0,m=-1/0;for(let f=0;f<d.length;f+=2){let y=(i.transformX(d[f])+1)*r/2,b=(1-i.transformY(d[f+1]))*n/2;c=Math.min(c,y),p=Math.max(p,y),_=Math.min(_,b),m=Math.max(m,b)}p>c&&m>_&&(this.portraitHead={x:c,y:_,width:p-c,height:m-_})}}}Jt.getInstance().endFrameProcess(e),Jt.getInstance().releaseStaleRenderTextures(e)}nextScene(){let e=(this._sceneIndex+1)%bc;this.changeScene(e)}changeScene(e){this._sceneIndex=e,Ps&&N.printMessage(`[APP]model index: ${this._sceneIndex}`);let r=this._modelDir??vs[e]??".",n=this._resourcesPath??xs,i=K0(n,r),s=this._model3Json??_c[e]??`${r==="."||r===""?"model":r}.model3.json`;this.releaseAllModel();let o=new Ua;o.setSubdelegate(this._subdelegate),o.loadAssets(i,s),this._models.push(o),this.beginWatermarkSkip(i,s)}beginWatermarkSkip(e,r){let n=++this._watermarkLoadToken;this._watermarkPlan={parameters:[],parts:[]},Bf(e,r).then(i=>{n===this._watermarkLoadToken&&(this._watermarkPlan=i,Yc(i)&&Ps&&N.printMessage("[APP]auto skip watermark (space)"))})}switchCharacter(e,r,n){this._resourcesPath=e.endsWith("/")?e:`${e}/`,this._modelDir=r,this._model3Json=n,this._sceneIndex=0,this.changeScene(0)}setViewMatrix(e){for(let r=0;r<16;r++)this._viewMatrix.getArray()[r]=e.getArray()[r]}addModel(e=0){this._sceneIndex=e,this.changeScene(this._sceneIndex)}constructor(){this._viewMatrix=new W,this._models=new Array,this._sceneIndex=0}release(){}initialize(e){this._subdelegate=e,this.changeScene(this._sceneIndex)}_subdelegate;_viewMatrix;_models;_sceneIndex;_resourcesPath=null;_modelDir=null;_model3Json=null;beganMotion=e=>{N.printMessage("Motion Began:"),console.log(e)};finishedMotion=e=>{N.printMessage("Motion Finished:"),console.log(e)}};function Q0(t){let e=t._expressionManager;if(!e)return;let r=e.getCubismMotionQueueEntries?.();if(Array.isArray(r)){for(let n=r.length-1;n>=0;n--)r[n]?.release?.(),r.splice(n,1);return}e.stopAllMotions?.()}function K0(t,e){let r=t.endsWith("/")?t:`${t}/`;return!e||e==="."?r:`${r}${e}/`}function Z0(t,e){let r=Object.keys(e),n=r.find(i=>i===`Tap${t}`||i===`Tap@${t}`||i==="Tap");return n||(r.find(i=>i.replace(/^Tap@?/i,"")===t||i.includes(t))??null)}var $a=class{constructor(){this._textures=new Array}release(){for(let e=0;e<this._textures.length;e++)this._glManager.getGl().deleteTexture(this._textures[e].id);this._textures=null}createTextureFromPngFile(e,r,n){for(let s=0;s<this._textures.length;s++)if(this._textures[s].fileName==e&&this._textures[s].usePremultply==r){this._textures[s].img=new Image,this._textures[s].img.addEventListener("load",()=>n(this._textures[s]),{passive:!0}),this._textures[s].img.src=e;return}let i=new Image;i.addEventListener("load",()=>{let s=this._glManager.getGl().createTexture();this._glManager.getGl().bindTexture(this._glManager.getGl().TEXTURE_2D,s),this._glManager.getGl().texParameteri(this._glManager.getGl().TEXTURE_2D,this._glManager.getGl().TEXTURE_MIN_FILTER,this._glManager.getGl().LINEAR_MIPMAP_LINEAR),this._glManager.getGl().texParameteri(this._glManager.getGl().TEXTURE_2D,this._glManager.getGl().TEXTURE_MAG_FILTER,this._glManager.getGl().LINEAR),r&&this._glManager.getGl().pixelStorei(this._glManager.getGl().UNPACK_PREMULTIPLY_ALPHA_WEBGL,1),this._glManager.getGl().texImage2D(this._glManager.getGl().TEXTURE_2D,0,this._glManager.getGl().RGBA,this._glManager.getGl().RGBA,this._glManager.getGl().UNSIGNED_BYTE,i),this._glManager.getGl().generateMipmap(this._glManager.getGl().TEXTURE_2D),this._glManager.getGl().bindTexture(this._glManager.getGl().TEXTURE_2D,null);let o=new qc;o!=null&&(o.fileName=e,o.width=i.width,o.height=i.height,o.id=s,o.img=i,o.usePremultply=r,this._textures!=null&&this._textures.push(o)),n(o)},{passive:!0}),i.src=e}releaseTextures(){for(let e=0;e<this._textures.length;e++)this._glManager.getGl().deleteTexture(this._textures[e].id),this._textures[e]=null;this._textures.length=0}releaseTextureByTexture(e){for(let r=0;r<this._textures.length;r++)if(this._textures[r].id==e){this._glManager.getGl().deleteTexture(this._textures[r].id),this._textures[r]=null,this._textures.splice(r,1);break}}releaseTextureByFilePath(e){for(let r=0;r<this._textures.length;r++)if(this._textures[r].fileName==e){this._glManager.getGl().deleteTexture(this._textures[r].id),this._textures[r]=null,this._textures.splice(r,1);break}}setGlManager(e){this._glManager=e}_textures;_glManager},qc=class{img;id=null;width=0;height=0;usePremultply;fileName};var xi=class extends W{constructor(){super(),this._screenLeft=0,this._screenRight=0,this._screenTop=0,this._screenBottom=0,this._maxLeft=0,this._maxRight=0,this._maxTop=0,this._maxBottom=0,this._maxScale=0,this._minScale=0}adjustTranslate(e,r){this._tr[0]*this._maxLeft+(this._tr[12]+e)>this._screenLeft&&(e=this._screenLeft-this._tr[0]*this._maxLeft-this._tr[12]),this._tr[0]*this._maxRight+(this._tr[12]+e)<this._screenRight&&(e=this._screenRight-this._tr[0]*this._maxRight-this._tr[12]),this._tr[5]*this._maxTop+(this._tr[13]+r)<this._screenTop&&(r=this._screenTop-this._tr[5]*this._maxTop-this._tr[13]),this._tr[5]*this._maxBottom+(this._tr[13]+r)>this._screenBottom&&(r=this._screenBottom-this._tr[5]*this._maxBottom-this._tr[13]);let n=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,e,r,0,1]);W.multiply(n,this._tr,this._tr)}adjustScale(e,r,n){let i=this.getMaxScale(),s=this.getMinScale(),o=n*this._tr[0];o<s?this._tr[0]>0&&(n=s/this._tr[0]):o>i&&this._tr[0]>0&&(n=i/this._tr[0]);let l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,e,r,0,1]),a=new Float32Array([n,0,0,0,0,n,0,0,0,0,1,0,0,0,0,1]),u=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,-e,-r,0,1]);W.multiply(u,this._tr,this._tr),W.multiply(a,this._tr,this._tr),W.multiply(l,this._tr,this._tr)}setScreenRect(e,r,n,i){this._screenLeft=e,this._screenRight=r,this._screenBottom=n,this._screenTop=i}setMaxScreenRect(e,r,n,i){this._maxLeft=e,this._maxRight=r,this._maxTop=i,this._maxBottom=n}setMaxScale(e){this._maxScale=e}setMinScale(e){this._minScale=e}getMaxScale(){return this._maxScale}getMinScale(){return this._minScale}isMaxScale(){return this.getScaleX()>=this._maxScale}isMinScale(){return this.getScaleX()<=this._minScale}getScreenLeft(){return this._screenLeft}getScreenRight(){return this._screenRight}getScreenBottom(){return this._screenBottom}getScreenTop(){return this._screenTop}getMaxLeft(){return this._maxLeft}getMaxRight(){return this._maxRight}getMaxBottom(){return this._maxBottom}getMaxTop(){return this._maxTop}_screenLeft;_screenRight;_screenTop;_screenBottom;_maxLeft;_maxRight;_maxTop;_maxBottom;_maxScale;_minScale},ev;(e=>e.CubismViewMatrix=xi)(ev||={});var Ns=class{constructor(e,r,n,i,s){this._rect=new Qc,this._rect.left=e-n*.5,this._rect.right=e+n*.5,this._rect.up=r+i*.5,this._rect.down=r-i*.5,this._texture=s,this._vertexBuffer=null,this._uvBuffer=null,this._indexBuffer=null,this._positionLocation=null,this._uvLocation=null,this._textureLocation=null,this._positionArray=null,this._uvArray=null,this._indexArray=null,this._firstDraw=!0}release(){this._rect=null;let e=this._subdelegate.getGlManager().getGl();e.deleteTexture(this._texture),this._texture=null,e.deleteBuffer(this._uvBuffer),this._uvBuffer=null,e.deleteBuffer(this._vertexBuffer),this._vertexBuffer=null,e.deleteBuffer(this._indexBuffer),this._indexBuffer=null}getTexture(){return this._texture}render(e){if(this._texture==null)return;let r=this._subdelegate.getGlManager().getGl();if(this._firstDraw){this._positionLocation=r.getAttribLocation(e,"position"),r.enableVertexAttribArray(this._positionLocation),this._uvLocation=r.getAttribLocation(e,"uv"),r.enableVertexAttribArray(this._uvLocation),this._textureLocation=r.getUniformLocation(e,"texture"),r.uniform1i(this._textureLocation,0),this._uvArray=new Float32Array([1,0,0,0,0,1,1,1]),this._uvBuffer=r.createBuffer();{let n=this._subdelegate.getCanvas().width,i=this._subdelegate.getCanvas().height;this._positionArray=new Float32Array([(this._rect.right-n*.5)/(n*.5),(this._rect.up-i*.5)/(i*.5),(this._rect.left-n*.5)/(n*.5),(this._rect.up-i*.5)/(i*.5),(this._rect.left-n*.5)/(n*.5),(this._rect.down-i*.5)/(i*.5),(this._rect.right-n*.5)/(n*.5),(this._rect.down-i*.5)/(i*.5)]),this._vertexBuffer=r.createBuffer()}this._indexArray=new Uint16Array([0,1,2,3,2,0]),this._indexBuffer=r.createBuffer(),this._firstDraw=!1}r.bindBuffer(r.ARRAY_BUFFER,this._uvBuffer),r.bufferData(r.ARRAY_BUFFER,this._uvArray,r.STATIC_DRAW),r.vertexAttribPointer(this._uvLocation,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,this._vertexBuffer),r.bufferData(r.ARRAY_BUFFER,this._positionArray,r.STATIC_DRAW),r.vertexAttribPointer(this._positionLocation,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,this._indexBuffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,this._indexArray,r.DYNAMIC_DRAW),r.bindTexture(r.TEXTURE_2D,this._texture),r.drawElements(r.TRIANGLES,this._indexArray.length,r.UNSIGNED_SHORT,0)}isHit(e,r){let{height:n}=this._subdelegate.getCanvas(),i=n-r;return e>=this._rect.left&&e<=this._rect.right&&i<=this._rect.up&&i>=this._rect.down}setSubdelegate(e){this._subdelegate=e}_texture;_vertexBuffer;_uvBuffer;_indexBuffer;_rect;_positionLocation;_uvLocation;_textureLocation;_positionArray;_uvArray;_indexArray;_firstDraw;_subdelegate},Qc=class{left;right;up;down};var ja=class{constructor(){this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this._lastX1=0,this._lastY1=0,this._lastX2=0,this._lastY2=0,this._lastTouchDistance=0,this._deltaX=0,this._deltaY=0,this._scale=1,this._touchSingle=!1,this._flipAvailable=!1}getCenterX(){return this._lastX}getCenterY(){return this._lastY}getDeltaX(){return this._deltaX}getDeltaY(){return this._deltaY}getStartX(){return this._startX}getStartY(){return this._startY}getScale(){return this._scale}getX(){return this._lastX}getY(){return this._lastY}getX1(){return this._lastX1}getY1(){return this._lastY1}getX2(){return this._lastX2}getY2(){return this._lastY2}isSingleTouch(){return this._touchSingle}isFlickAvailable(){return this._flipAvailable}disableFlick(){this._flipAvailable=!1}touchesBegan(e,r){this._lastX=e,this._lastY=r,this._startX=e,this._startY=r,this._lastTouchDistance=-1,this._flipAvailable=!0,this._touchSingle=!0}touchesMoved(e,r){this._lastX=e,this._lastY=r,this._lastTouchDistance=-1,this._touchSingle=!0}getFlickDistance(){return this.calculateDistance(this._startX,this._startY,this._lastX,this._lastY)}calculateDistance(e,r,n,i){return Math.sqrt((e-n)*(e-n)+(r-i)*(r-i))}calculateMovingAmount(e,r){if(e>0!=r>0)return 0;let n=e>0?1:-1,i=Math.abs(e),s=Math.abs(r);return n*(i<s?i:s)}_startY;_startX;_lastX;_lastY;_lastX1;_lastY1;_lastX2;_lastY2;_lastTouchDistance;_deltaX;_deltaY;_scale;_touchSingle;_flipAvailable};var Xa=class{constructor(){this._programId=null,this._back=null,this._gear=null,this._touchManager=new ja,this._deviceToScreen=new W,this._viewMatrix=new xi}initialize(e){this._subdelegate=e;let{width:r,height:n}=e.getCanvas(),i=r/n,s=-i,o=i,l=Hm,a=$m;if(this._viewMatrix.setScreenRect(s,o,l,a),this._viewMatrix.scale(xc,xc),this._deviceToScreen.loadIdentity(),r>n){let u=Math.abs(o-s);this._deviceToScreen.scaleRelative(u/r,-u/r)}else{let u=Math.abs(a-l);this._deviceToScreen.scaleRelative(u/n,-u/n)}this._deviceToScreen.translateRelative(-r*.5,-n*.5),this._viewMatrix.setMaxScale(zm),this._viewMatrix.setMinScale(Wm),this._viewMatrix.setMaxScreenRect(jm,Xm,Ym,Jm)}release(){this._viewMatrix=null,this._touchManager=null,this._deviceToScreen=null,this._gear.release(),this._gear=null,this._back.release(),this._back=null,this._subdelegate.getGlManager().getGl().deleteProgram(this._programId),this._programId=null}render(){this._subdelegate.getGlManager().getGl().useProgram(this._programId),this._back&&this._back.render(this._programId),this._gear&&this._gear.render(this._programId),this._subdelegate.getGlManager().getGl().flush();let e=this._subdelegate.getLive2DManager();e!=null&&(e.setViewMatrix(this._viewMatrix),e.onUpdate())}initializeSprite(){let e=this._subdelegate.getCanvas().width,r=this._subdelegate.getCanvas().height,n=this._subdelegate.getTextureManager(),i=xs,s="";s=Fm;let o=a=>{let u=e*.5,d=r*.5,c=r*.95,p=c/a.height,_=a.width*p;this._back=new Ns(u,d,_,c,a.id),this._back.setSubdelegate(this._subdelegate)};n.createTextureFromPngFile(i+s,!1,o),s=Nm;let l=a=>{let u=e-a.width*.5,d=r-a.height*.5,c=a.width,p=a.height;this._gear=new Ns(u,d,c,p,a.id),this._gear.setSubdelegate(this._subdelegate)};n.createTextureFromPngFile(i+s,!1,l),this._programId==null&&(this._programId=this._subdelegate.createShader())}onTouchesBegan(e,r){this._touchManager.touchesBegan(e*window.devicePixelRatio,r*window.devicePixelRatio)}onTouchesMoved(e,r){let n=e*window.devicePixelRatio,i=r*window.devicePixelRatio,s=this._subdelegate.getLive2DManager(),o=this.transformViewX(this._touchManager.getX()),l=this.transformViewY(this._touchManager.getY());this._touchManager.touchesMoved(n,i),s.onDrag(o,l)}onTouchesEnded(e,r){let n=e*window.devicePixelRatio,i=r*window.devicePixelRatio,s=this._subdelegate.getLive2DManager();s.onDrag(0,0);let o=this.transformViewX(n),l=this.transformViewY(i);Km&&N.printMessage(`[APP]touchesEnded x: ${o} y: ${l}`),s.onTap(o,l),this._gear.isHit(n,i)&&s.nextScene()}transformViewX(e){let r=this._deviceToScreen.transformX(e);return this._viewMatrix.invertTransformX(r)}transformViewY(e){let r=this._deviceToScreen.transformY(e);return this._viewMatrix.invertTransformY(r)}transformScreenX(e){return this._deviceToScreen.transformX(e)}transformScreenY(e){return this._deviceToScreen.transformY(e)}_touchManager;_deviceToScreen;_viewMatrix;_programId;_back;_gear;_changeModel;_isClick;_subdelegate};var Kc=class extends Xa{initializeSprite(){}onTouchesEnded(e,r){let n=this._subdelegate.getLive2DManager();n.onDrag(0,0);let i=this.transformViewX(e*window.devicePixelRatio),s=this.transformViewY(r*window.devicePixelRatio);n.onTap(i,s)}render(){let e=this._subdelegate.getLive2DManager();e.setViewMatrix(this._viewMatrix),e.onUpdate()}release(){this._viewMatrix=null,this._touchManager=null,this._deviceToScreen=null}},Ya=class{constructor(){this._glManager=new xa,this._textureManager=new $a,this._live2dManager=new Ha,this._view=new Kc,this._captured=!1,this._lastPointX=0,this._lastPointY=0,this._dragDistance=0}release(){this._resizeObserver?.unobserve(this._canvas),this._resizeObserver?.disconnect(),this._resizeObserver=null,this._live2dManager.release(),this._view.release(),this._textureManager.release(),this._glManager.release()}initialize(e){if(!this._glManager.initialize(e))return!1;this._canvas=e,Ss==="auto"?this.resizeCanvas():(e.width=Ss.width,e.height=Ss.height),this._textureManager.setGlManager(this._glManager);let r=this._glManager.getGl();return this._frameBuffer||(this._frameBuffer=r.getParameter(r.FRAMEBUFFER_BINDING)),r.enable(r.BLEND),r.blendFunc(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA),this._view.initialize(this),this._live2dManager.setOffscreenSize(this._canvas.width,this._canvas.height),this._view.initializeSprite(),this._live2dManager.initialize(this),this._resizeObserver=new ResizeObserver((n,i)=>this.resizeObserverCallback.call(this,n,i)),this._resizeObserver.observe(this._canvas),!0}onResize(){let e=new Float32Array(this._view._viewMatrix.getArray());this.resizeCanvas(),this._view.initialize(this),this._view._viewMatrix.setMatrix(e),this._view.initializeSprite()}resizeObserverCallback(e,r){Ss==="auto"&&(this._needResize=!0)}update(){if(this._glManager.getGl().isContextLost())return;this._needResize&&(this.onResize(),this._needResize=!1);let e=this._glManager.getGl();e.bindFramebuffer(e.FRAMEBUFFER,this._frameBuffer),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),e.clearDepth(1),e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),this._view.render()}createShader(){let e=this._glManager.getGl(),r=e.createShader(e.VERTEX_SHADER);if(r==null)return N.printMessage("failed to create vertexShader"),null;e.shaderSource(r,"precision mediump float;attribute vec3 position;attribute vec2 uv;varying vec2 vuv;void main(void){ gl_Position = vec4(position, 1.0); vuv = uv;}"),e.compileShader(r);let i=e.createShader(e.FRAGMENT_SHADER);if(i==null)return N.printMessage("failed to create fragmentShader"),null;e.shaderSource(i,"precision mediump float;varying vec2 vuv;uniform sampler2D texture;void main(void){ gl_FragColor = texture2D(texture, vuv);}"),e.compileShader(i);let o=e.createProgram();return o==null?(N.printMessage("failed to create WebGL program"),null):(e.attachShader(o,r),e.attachShader(o,i),e.deleteShader(r),e.deleteShader(i),e.linkProgram(o),e.useProgram(o),o)}getTextureManager(){return this._textureManager}getFrameBuffer(){return this._frameBuffer}getCanvas(){return this._canvas}getGlManager(){return this._glManager}getGl(){return this._glManager.getGl()}getLive2DManager(){return this._live2dManager}resizeCanvas(){this._canvas.width=this._canvas.clientWidth*window.devicePixelRatio,this._canvas.height=this._canvas.clientHeight*window.devicePixelRatio;let e=this._glManager.getGl();e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight)}onPointBegan(e,r){if(!this._view){N.printMessage("view notfound");return}this._captured=!0;let{x:n,y:i}=this.toLocalPoint(e,r);this._lastPointX=n,this._lastPointY=i,this._dragDistance=0,this._view.onTouchesBegan(n,i)}noteLook(e,r){let n=this.getCanvas();if(!n||!this._live2dManager)return;let i=n.getBoundingClientRect();if(i.width<=0||i.height<=0)return;let s=(e-i.left)/i.width*2-1,o=-((r-i.top)/i.height*2-1);this._live2dManager.setLookTarget(s,o)}onPointMoved(e,r){if(!this._captured)return;let{x:n,y:i}=this.toLocalPoint(e,r),s=n-this._lastPointX,o=i-this._lastPointY;this._lastPointX=n,this._lastPointY=i,this._dragDistance+=Math.hypot(s,o),this._view.onTouchesMoved(n,i),this.panView(s,o)}onPointEnded(e,r){if(this._captured=!1,!this._view){N.printMessage("view notfound");return}let{x:n,y:i}=this.toLocalPoint(e,r);this._dragDistance<5?this._view.onTouchesEnded(n,i):this._live2dManager.onDrag(0,0),this._dragDistance=0}onTouchCancel(e,r){if(this._captured=!1,!this._view){N.printMessage("view notfound");return}this._live2dManager.onDrag(0,0),this._dragDistance=0}onWheel(e,r,n){if(!this._view)return;let{x:i,y:s}=this.toLocalPoint(e,r),o=window.devicePixelRatio,l=this._view.transformScreenX(i*o),a=this._view.transformScreenY(s*o),u=Math.exp(-n*.001);this._view._viewMatrix.adjustScale(l,a,u)}panView(e,r){let n=window.devicePixelRatio,i=this._view.transformScreenX(0),s=this._view.transformScreenY(0),o=this._view.transformScreenX(e*n)-i,l=this._view.transformScreenY(r*n)-s;this._view._viewMatrix.adjustTranslate(o,l)}toLocalPoint(e,r){let n=this._canvas.getBoundingClientRect();return{x:e-n.left,y:r-n.top}}isContextLost(){return this._glManager.getGl().isContextLost()}_canvas;_view;_textureManager;_frameBuffer=null;_glManager;_live2dManager;_resizeObserver=null;_captured;_lastPointX;_lastPointY;_dragDistance;_needResize=!1};var Mi=null,xe=class t{cubismOption=new ga;subdelegate=null;canvas=null;rafId=0;pointerDown=null;pointerMove=null;pointerUp=null;pointerCancel=null;wheel=null;static getInstance(){return Mi||(Mi=new t),Mi}static releaseInstance(){Mi?.release(),Mi=null}initialize(e){return this.canvas=e,N.updateTime(),this.cubismOption.logFunction=N.printMessage,this.cubismOption.loggingLevel=Zm,B.startUp(this.cubismOption),B.initialize(),this.subdelegate=new Ya,this.subdelegate.initialize(e)?this.subdelegate.isContextLost()?(R("WebGL context was lost during Live2D initialization."),!1):(this.bindPointerEvents(),!0):!1}run(){let e=()=>{!Mi||!this.subdelegate||(N.updateTime(),this.subdelegate.update(),this.rafId=requestAnimationFrame(e))};this.rafId=requestAnimationFrame(e)}onResize(){this.subdelegate?.onResize()}snapshot(){if(!this.canvas||!this.subdelegate)return null;N.updateTime(),this.subdelegate.update();let e=document.createElement("canvas");return e.width=this.canvas.width,e.height=this.canvas.height,e.getContext("2d").drawImage(this.canvas,0,0),e}portraitHead(){return this.subdelegate?.getLive2DManager().portraitHead??null}switchCharacter(e){Ms(e),this.subdelegate?.getLive2DManager().switchCharacter(e.resourcesPath,e.modelDir,e.model3Json),this.subdelegate?.getLive2DManager().resetFacing()}playMotion(e,r=0){return this.subdelegate?.getLive2DManager().playMotion(e,r)??Promise.resolve(!1)}resetFacing(){this.subdelegate?.getLive2DManager().resetFacing()}setLipSyncValue(e){this.subdelegate?.getLive2DManager().setLipSyncValue(e)}setParamOverlay(e){this.subdelegate?.getLive2DManager().setParamOverlay(e)}getParameterValue(e){return this.subdelegate?.getLive2DManager().getParameterValue(e)??0}setParameterValue(e,r){this.subdelegate?.getLive2DManager().setParameterValue(e,r)}setExpression(e){return this.subdelegate?.getLive2DManager().setExpression(e)??!1}bindPointerEvents(){this.pointerDown=e=>{this.canvas?.dataset.interactive!=="false"&&(e.pointerType==="mouse"&&e.button!==0||(this.canvas?.setPointerCapture(e.pointerId),this.subdelegate?.onPointBegan(e.clientX,e.clientY)))},this.pointerMove=e=>{this.canvas?.dataset.interactive!=="false"&&(this.subdelegate?.noteLook(e.clientX,e.clientY),this.subdelegate?.onPointMoved(e.clientX,e.clientY))},this.pointerUp=e=>{this.subdelegate?.onPointEnded(e.clientX,e.clientY),this.canvas?.hasPointerCapture(e.pointerId)&&this.canvas.releasePointerCapture(e.pointerId)},this.pointerCancel=e=>{this.subdelegate?.onTouchCancel(e.clientX,e.clientY)},this.wheel=e=>{this.canvas?.dataset.interactive!=="false"&&(e.preventDefault(),this.subdelegate?.onWheel(e.clientX,e.clientY,e.deltaY))},this.canvas?.addEventListener("pointerdown",this.pointerDown,{passive:!0}),this.canvas?.addEventListener("pointermove",this.pointerMove,{passive:!0}),this.canvas?.addEventListener("pointerup",this.pointerUp,{passive:!0}),this.canvas?.addEventListener("pointercancel",this.pointerCancel,{passive:!0}),this.canvas?.addEventListener("wheel",this.wheel,{passive:!1})}releasePointerEvents(){this.pointerDown&&this.canvas?.removeEventListener("pointerdown",this.pointerDown),this.pointerMove&&this.canvas?.removeEventListener("pointermove",this.pointerMove),this.pointerUp&&this.canvas?.removeEventListener("pointerup",this.pointerUp),this.pointerCancel&&this.canvas?.removeEventListener("pointercancel",this.pointerCancel),this.wheel&&this.canvas?.removeEventListener("wheel",this.wheel),this.pointerDown=null,this.pointerMove=null,this.pointerUp=null,this.pointerCancel=null,this.wheel=null}release(){this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=0),this.releasePointerEvents(),this.subdelegate?.release(),this.subdelegate=null,B.dispose(),this.canvas=null}};function Zc(t){return{expressionNames:t.expressionNames,id:t.id,name:t.name,resourcesPath:t.resourcesPath,modelDir:t.defaultModelDir,model3Json:t.defaultModel3Json,idleGroup:t.idleGroup,motionGroups:t.motionGroups,hitAreas:t.hitAreas}}function rv(t,e){return new Promise(r=>{let n=0,i=()=>{cancelAnimationFrame(n),r(!1)};e.addEventListener("abort",i,{once:!0});let s=()=>{if(e.aborted){i();return}let{clientWidth:o,clientHeight:l}=t;if(o>0&&l>0){e.removeEventListener("abort",i),r(!0);return}n=requestAnimationFrame(s)};s()})}function Af(t,e=pa){let r=(0,lt.useRef)(e);r.current=e;let n=(m,f)=>r.current(m,f),i=(0,lt.useRef)(null),s=(0,lt.useRef)(!1),o=(0,lt.useRef)(null);t?.defaultModel3Json&&!o.current&&(o.current=t);let l=o.current,[a,u]=(0,lt.useState)(null),[d,c]=(0,lt.useState)({status:"idle",message:n("\u7B49\u5F85\u521D\u59CB\u5316")});(0,lt.useEffect)(()=>{let m=i.current,f=o.current;if(!m||!f)return;let y=!1,b=new AbortController;(async()=>{if(c({status:"initializing",message:n("\u6B63\u5728\u52A0\u8F7D Live2D \u89D2\u8272...")}),!await rv(m,b.signal)||y)return;let C=Zc(f);Ms(C),u(C.id);let x=xe.getInstance();if(!x.initialize(m)){c({status:"error",message:n("Live2D \u521D\u59CB\u5316\u5931\u8D25\uFF0C\u8BF7\u786E\u8BA4\u6D4F\u89C8\u5668\u652F\u6301 WebGL2")});return}x.switchCharacter(C),x.onResize(),x.run(),s.current=!0,c({status:"ready",message:n("{0} \u5DF2\u5C31\u7EEA",[C.name])})})().catch(C=>{y||c({status:"error",message:C instanceof Error?C.message:String(C)})});let h=()=>{xe.getInstance().onResize()};return window.addEventListener("resize",h),()=>{y=!0,b.abort(),s.current=!1,window.removeEventListener("resize",h),xe.releaseInstance(),c({status:"idle",message:n("\u5DF2\u5378\u8F7D")})}},[l?.id]);let p=(0,lt.useCallback)(m=>{if(!s.current||!m.defaultModel3Json)return;let f=Zc(m);Ms(f),u(f.id),c({status:"initializing",message:n("\u6B63\u5728\u5207\u6362\u81F3 {0}...",[f.name])});let y=xe.getInstance();y.switchCharacter(f),y.onResize(),c({status:"ready",message:n("{0} \u5DF2\u5C31\u7EEA",[f.name])})},[]);return{canvasRef:i,diagnostics:d,activeCharacterId:a,switchCharacter:p,actor:{playMotion:async(m,f=0)=>s.current?xe.getInstance().playMotion(m,f):!1,resetFacing:()=>{s.current&&xe.getInstance().resetFacing()},setLipSyncValue:m=>{s.current&&xe.getInstance().setLipSyncValue(m)},setExpression:m=>s.current?xe.getInstance().setExpression(m):!1,setParamOverlay:m=>{s.current&&xe.getInstance().setParamOverlay(m)},getParameterValue:m=>s.current?xe.getInstance().getParameterValue(m):0,setParameterValue:(m,f)=>{s.current&&xe.getInstance().setParameterValue(m,f)}}}}var nv=`.live2d-player {\r
|
|
34
|
+
position: absolute;\r
|
|
35
|
+
inset: 0;\r
|
|
36
|
+
width: 100%;\r
|
|
37
|
+
height: 100%;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
container: live2d-stage / size;
|
|
40
|
+
z-index: 1;
|
|
41
|
+
}\r
|
|
42
|
+
\r
|
|
43
|
+
.live2d-player__canvas {\r
|
|
44
|
+
position: absolute;\r
|
|
45
|
+
inset: 0;\r
|
|
46
|
+
z-index: 1;\r
|
|
47
|
+
width: 100%;\r
|
|
48
|
+
height: 100%;\r
|
|
49
|
+
display: block;\r
|
|
50
|
+
background: transparent;\r
|
|
51
|
+
touch-action: none;\r
|
|
52
|
+
cursor: grab;\r
|
|
53
|
+
}\r
|
|
54
|
+
\r
|
|
55
|
+
.live2d-player__canvas:active {\r
|
|
56
|
+
cursor: grabbing;\r
|
|
57
|
+
}\r
|
|
58
|
+
\r
|
|
59
|
+
.live2d-player__hint {\r
|
|
60
|
+
position: absolute;\r
|
|
61
|
+
left: 50%;\r
|
|
62
|
+
bottom: 92px;\r
|
|
63
|
+
z-index: 3;\r
|
|
64
|
+
transform: translateX(-50%);\r
|
|
65
|
+
padding: 5px 11px;\r
|
|
66
|
+
border-radius: 999px;\r
|
|
67
|
+
color: color-mix(in srgb,var(--blue) 62%,transparent);\r
|
|
68
|
+
background: rgba(255, 255, 255, 0.48);\r
|
|
69
|
+
font-size: 0.72rem;\r
|
|
70
|
+
letter-spacing: 0.03em;\r
|
|
71
|
+
pointer-events: none;\r
|
|
72
|
+
backdrop-filter: blur(8px);\r
|
|
73
|
+
}\r
|
|
74
|
+
\r
|
|
75
|
+
.live2d-player__status {\r
|
|
76
|
+
position: absolute;\r
|
|
77
|
+
inset: 0;\r
|
|
78
|
+
display: grid;\r
|
|
79
|
+
place-items: center;\r
|
|
80
|
+
font-size: 0.95rem;\r
|
|
81
|
+
color: var(--ink-soft);\r
|
|
82
|
+
pointer-events: none;\r
|
|
83
|
+
z-index: 2;\r
|
|
84
|
+
}\r
|
|
85
|
+
\r
|
|
86
|
+
.live2d-player__status--error {\r
|
|
87
|
+
color: var(--danger);\r
|
|
88
|
+
}\r
|
|
89
|
+
\r
|
|
90
|
+
@media (max-width: 900px) {\r
|
|
91
|
+
.live2d-player__hint {\r
|
|
92
|
+
bottom: 82px;\r
|
|
93
|
+
}\r
|
|
94
|
+
}\r
|
|
95
|
+
`,Ja=document.createElement("style");Ja.dataset.plugin="dsh-plugin-live2d-stage";Ja.dataset.pluginCss="E:\\DSHLive2d-plugin\\vendor\\live2d\\live2d-player\\Live2DPlayer.css";Ja.textContent=nv;document.head.append(Ja);var Br=ce(Ze(),1),Df=(0,Ct.forwardRef)(function({character:e,className:r,translate:n=pa,hint:i=n("\u62D6\u62FD\u79FB\u52A8\u753B\u9762 \xB7 \u6EDA\u8F6E\u7F29\u653E"),children:s,interactive:o=!0},l){let{canvasRef:a,diagnostics:u,activeCharacterId:d,switchCharacter:c,actor:p}=Af(e,n),_=(0,Ct.useRef)(p);_.current=p;let m=(0,Ct.useRef)(c);m.current=c;let f=(0,Ct.useRef)(u);f.current=u;let y=(0,Ct.useRef)(""),b=e?.defaultModel3Json?JSON.stringify([e.id,e.resourcesPath,e.defaultModelDir,e.defaultModel3Json]):"";!y.current&&b&&(y.current=b),(0,Ct.useEffect)(()=>{!e||!b||!d||u.status!=="ready"||y.current===b||(y.current=b,m.current(e))},[e,d,u.status,b]),(0,Ct.useImperativeHandle)(l,()=>({playMotion:(h,C)=>_.current.playMotion(h,C),resetFacing:()=>_.current.resetFacing(),setLipSyncValue:h=>_.current.setLipSyncValue(h),setExpression:h=>_.current.setExpression(h),setParamOverlay:h=>_.current.setParamOverlay?.(h??null),getParameterValue:h=>_.current.getParameterValue?.(h)??0,setParameterValue:(h,C)=>_.current.setParameterValue?.(h,C),switchCharacter:h=>m.current(h),getDiagnostics:()=>f.current}),[]);let g=["live2d-player",r].filter(Boolean).join(" ");return(0,Br.jsxs)("div",{className:g,"aria-label":n("Live2D \u89D2\u8272\u821E\u53F0"),children:[(0,Br.jsx)("canvas",{ref:a,className:"live2d-player__canvas",style:{visibility:e?.defaultModel3Json?"visible":"hidden"},"data-interactive":o&&!!e?.defaultModel3Json}),e&&!e.defaultModel3Json&&(0,Br.jsx)("div",{className:"live2d-player__status",children:n("\u8BF7\u5728\u52A8\u753B\u8D44\u6E90\u4E2D\u4E3A\u5F53\u524D\u89D2\u8272\u9009\u62E9\u6A21\u578B")}),s,i?(0,Br.jsx)("div",{className:"live2d-player__hint","aria-hidden":!0,children:i}):null,u.status==="initializing"&&(0,Br.jsx)("div",{className:"live2d-player__status",children:n("\u89D2\u8272\u52A0\u8F7D\u4E2D...")}),u.status==="error"&&(0,Br.jsx)("div",{className:"live2d-player__status live2d-player__status--error",children:u.message})]})});var cv="/live2d-stage/";async function Fe(t,e){let r=await fetch(cv+t,e===void 0?{}:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await r.json();if(!r.ok)throw new Error(n.message??"\u8BF7\u6C42\u5931\u8D25");return n}var Ff=ce(Ze(),1);function ed({character:t,onStatus:e}){let r=(0,er.useRef)(null),n=(0,er.useRef)([]);(0,er.useEffect)(()=>{let s=l=>{n.current.push(String(l.error?.stack||l.message).slice(0,2e3)),n.current=n.current.slice(-5)},o=l=>{n.current.push(String(l.reason?.stack||l.reason).slice(0,2e3)),n.current=n.current.slice(-5)};return window.addEventListener("error",s),window.addEventListener("unhandledrejection",o),()=>{window.removeEventListener("error",s),window.removeEventListener("unhandledrejection",o)}},[]),(0,er.useEffect)(()=>{let s;function o(){r.current?.getDiagnostics()?.status==="ready"&&window.dispatchEvent(new Event("resize")),l()}function l(){s?.removeEventListener("change",o),s=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),s.addEventListener("change",o)}return l(),()=>s.removeEventListener("change",o)},[]);let i=(0,er.useMemo)(()=>{let s=t.modelPath.lastIndexOf("/"),o=s<0?"":t.modelPath.slice(0,s+1),l=t.model.FileReferences;return{id:t.id,name:t.name,resourcesPath:"/live2d-stage/models/"+t.id+"/"+o,defaultModelDir:".",defaultModel3Json:t.modelPath.slice(s+1),icon:"",models:[],idleGroup:Object.keys(l.Motions??{}).find(a=>/^idle$/i.test(a))??null,motionGroups:Object.fromEntries(Object.entries(l.Motions??{}).map(([a,u])=>[a,u.map(d=>d.File)])),hitAreas:(t.model.HitAreas??[]).map(a=>({id:a.Id,name:a.Name}))}},[t.id,t.modelPath]);return(0,er.useEffect)(()=>{let s=!1,o,l,a=crypto.randomUUID(),u,d=0;async function c(){try{let p=r.current?.getDiagnostics(),_=p?.status==="ready";if(e(p?.message??"\u6A21\u578B\u52A0\u8F7D\u4E2D\u2026"),Date.now()-d>5e3){d=Date.now();let f=document.querySelector(".l2ds canvas"),y=0,b="";try{let P=_?xe.getInstance().snapshot():null;if(P){let A=document.createElement("canvas");A.width=64,A.height=64;let k=A.getContext("2d");k.drawImage(P,0,0,64,64);let w=k.getImageData(0,0,64,64).data;for(let D=3;D<w.length;D+=4)w[D]>10&&y++}}catch(P){b=String(P.stack||P)}let g=xe.getInstance(),h=g.subdelegate,C=h?._live2dManager,x=C?._models?.[0],v=h?._glManager?.getGl(),M={modelState:x?._state,modelLoaded:!!x?._model,textureCount:h?._textureManager?._textures?.length,gpu:v?.getParameter(v.RENDERER),contextLost:v?.isContextLost(),glError:v?.getError()};Fe("diagnostics",{render:M,client:a,characterId:t.id,protocol:location.protocol,status:p,pixels:y,drawError:b,issues:n.current,canvas:f?{width:f.width,height:f.height,rect:f.getBoundingClientRect().toJSON()}:null}).catch(()=>{})}let m=await Fe("events?client="+a+"&character="+t.id+"&ready="+_+(o===void 0?"":"&after="+o));if(s)return;if(l&&l!==m.epoch){o=m.sequence,l=m.epoch;return}l=m.epoch;for(let f of m.events)(async()=>{if(s)return;let y=!1;if(_){let b=f.action;y=b.kind==="motion"?await r.current.playMotion(b.group,b.index):r.current.setExpression(b.expressionId)}await Fe("receipt",{eventId:f.id,status:y?"played":"failed"}),s||e(y?"\u5DF2\u64AD\u653E\uFF1A"+f.action.name:"\u52A8\u4F5C\u64AD\u653E\u5931\u8D25")})().catch(y=>{s||e(y.message)});o=m.sequence}catch(p){s||e(p.message)}finally{s||(u=setTimeout(c,650))}}return c(),()=>{s=!0,clearTimeout(u)}},[t.id,e]),(0,Ff.jsx)(Df,{ref:r,character:i,translate:(s,o=[])=>s.replace(/\{(\d+)\}/g,(l,a)=>Number(a)<o.length?String(o[Number(a)]):l),hint:null,interactive:!1})}var Nf=ce(Ze(),1),dv={type:`<!-- @license lucide-static v1.49.0 - ISC -->
|
|
96
|
+
<svg
|
|
97
|
+
class="lucide lucide-type"
|
|
98
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
99
|
+
width="24"
|
|
100
|
+
height="24"
|
|
101
|
+
viewBox="0 0 24 24"
|
|
102
|
+
fill="none"
|
|
103
|
+
stroke="currentColor"
|
|
104
|
+
stroke-width="2"
|
|
105
|
+
stroke-linecap="round"
|
|
106
|
+
stroke-linejoin="round"
|
|
107
|
+
>
|
|
108
|
+
<path d="M12 4v16" />
|
|
109
|
+
<path d="M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2" />
|
|
110
|
+
<path d="M9 20h6" />
|
|
111
|
+
</svg>
|
|
112
|
+
`,"face-slightly-smiling-plus":`<!-- @license lucide-static v1.49.0 - ISC -->
|
|
113
|
+
<svg
|
|
114
|
+
class="lucide lucide-face-slightly-smiling-plus"
|
|
115
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
116
|
+
width="24"
|
|
117
|
+
height="24"
|
|
118
|
+
viewBox="0 0 24 24"
|
|
119
|
+
fill="none"
|
|
120
|
+
stroke="currentColor"
|
|
121
|
+
stroke-width="2"
|
|
122
|
+
stroke-linecap="round"
|
|
123
|
+
stroke-linejoin="round"
|
|
124
|
+
>
|
|
125
|
+
<path d="M13.267 2.08a10 10 0 108.653 8.653" />
|
|
126
|
+
<path d="M15 10V9" />
|
|
127
|
+
<path d="M16 5h6" />
|
|
128
|
+
<path d="M16.472 15a6 6 0 01-8.943 0" />
|
|
129
|
+
<path d="M19 2v6" />
|
|
130
|
+
<path d="M9 10V9" />
|
|
131
|
+
</svg>
|
|
132
|
+
`,move:`<!-- @license lucide-static v1.49.0 - ISC -->
|
|
133
|
+
<svg
|
|
134
|
+
class="lucide lucide-move"
|
|
135
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
136
|
+
width="24"
|
|
137
|
+
height="24"
|
|
138
|
+
viewBox="0 0 24 24"
|
|
139
|
+
fill="none"
|
|
140
|
+
stroke="currentColor"
|
|
141
|
+
stroke-width="2"
|
|
142
|
+
stroke-linecap="round"
|
|
143
|
+
stroke-linejoin="round"
|
|
144
|
+
>
|
|
145
|
+
<path d="M12 2v20" />
|
|
146
|
+
<path d="m15 19-3 3-3-3" />
|
|
147
|
+
<path d="m19 9 3 3-3 3" />
|
|
148
|
+
<path d="M2 12h20" />
|
|
149
|
+
<path d="m5 9-3 3 3 3" />
|
|
150
|
+
<path d="m9 5 3-3 3 3" />
|
|
151
|
+
</svg>
|
|
152
|
+
`,reload:`<!-- @license lucide-static v1.49.0 - ISC -->
|
|
153
|
+
<svg
|
|
154
|
+
class="lucide lucide-rotate-cw"
|
|
155
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
156
|
+
width="24"
|
|
157
|
+
height="24"
|
|
158
|
+
viewBox="0 0 24 24"
|
|
159
|
+
fill="none"
|
|
160
|
+
stroke="currentColor"
|
|
161
|
+
stroke-width="2"
|
|
162
|
+
stroke-linecap="round"
|
|
163
|
+
stroke-linejoin="round"
|
|
164
|
+
>
|
|
165
|
+
<path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8" />
|
|
166
|
+
<path d="M21 3v5h-5" />
|
|
167
|
+
</svg>
|
|
168
|
+
`,"square-arrow-right-exit":`<!-- @license lucide-static v1.49.0 - ISC -->
|
|
169
|
+
<svg
|
|
170
|
+
class="lucide lucide-square-arrow-right-exit"
|
|
171
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
172
|
+
width="24"
|
|
173
|
+
height="24"
|
|
174
|
+
viewBox="0 0 24 24"
|
|
175
|
+
fill="none"
|
|
176
|
+
stroke="currentColor"
|
|
177
|
+
stroke-width="2"
|
|
178
|
+
stroke-linecap="round"
|
|
179
|
+
stroke-linejoin="round"
|
|
180
|
+
>
|
|
181
|
+
<path d="M10 12h11" />
|
|
182
|
+
<path d="m17 16 4-4-4-4" />
|
|
183
|
+
<path d="M21 6.344V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-1.344" />
|
|
184
|
+
</svg>
|
|
185
|
+
`,"square-arrow-right-enter":`<!-- @license lucide-static v1.49.0 - ISC -->
|
|
186
|
+
<svg
|
|
187
|
+
class="lucide lucide-square-arrow-right-enter"
|
|
188
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
189
|
+
width="24"
|
|
190
|
+
height="24"
|
|
191
|
+
viewBox="0 0 24 24"
|
|
192
|
+
fill="none"
|
|
193
|
+
stroke="currentColor"
|
|
194
|
+
stroke-width="2"
|
|
195
|
+
stroke-linecap="round"
|
|
196
|
+
stroke-linejoin="round"
|
|
197
|
+
>
|
|
198
|
+
<path d="m10 16 4-4-4-4" />
|
|
199
|
+
<path d="M3 12h11" />
|
|
200
|
+
<path d="M3 8V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3" />
|
|
201
|
+
</svg>
|
|
202
|
+
`,x:`<!-- @license lucide-static v1.49.0 - ISC -->
|
|
203
|
+
<svg
|
|
204
|
+
class="lucide lucide-x"
|
|
205
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
206
|
+
width="24"
|
|
207
|
+
height="24"
|
|
208
|
+
viewBox="0 0 24 24"
|
|
209
|
+
fill="none"
|
|
210
|
+
stroke="currentColor"
|
|
211
|
+
stroke-width="2"
|
|
212
|
+
stroke-linecap="round"
|
|
213
|
+
stroke-linejoin="round"
|
|
214
|
+
>
|
|
215
|
+
<path d="M18 6 6 18" />
|
|
216
|
+
<path d="m6 6 12 12" />
|
|
217
|
+
</svg>
|
|
218
|
+
`};function rn({name:t}){return(0,Nf.jsx)("span",{"aria-hidden":"true","data-icon":t,dangerouslySetInnerHTML:{__html:dv[t]}})}var ue=ce(kt(),1);var O=ce(Ze(),1);function pv(){let[t,e]=(0,ue.useState)([]),[r,n]=(0,ue.useState)([]),[i,s]=(0,ue.useState)(""),[o,l]=(0,ue.useState)(""),[a,u]=(0,ue.useState)(!1),[d,c]=(0,ue.useState)(""),[p,_]=(0,ue.useState)({messages:[]}),[m,f]=(0,ue.useState)(""),[y,b]=(0,ue.useState)(!1),g=(0,ue.useRef)(null),h=(0,ue.useRef)(null);async function C(){let v=await Fe("chat/sessions");return e(v.items??[]),n(v.workspaces??[]),u(!0),v}(0,ue.useEffect)(()=>{let v=!0;async function M(){try{let A=await Fe("chat/sessions");if(!v)return;e(A.items??[]),n(A.workspaces??[]),u(!0)}catch(A){v&&f(A.message)}}M();let P=setInterval(M,3e3);return()=>{v=!1,clearInterval(P)}},[]),(0,ue.useEffect)(()=>{a&&(i&&!r.some(v=>v.workspaceId===i)?(s(""),l("")):o&&!t.some(v=>v.sessionId===o&&(!i||v.workspaceId===i))&&l(""))},[t,r,i,o,a]),(0,ue.useEffect)(()=>{if(_({messages:[]}),!o)return;let v=!0,M;async function P(){try{let A=await Fe("chat/history?session="+encodeURIComponent(o));v&&_(A)}catch(A){v&&f(A.message)}finally{v&&(M=setTimeout(P,1e3))}}return P(),()=>{v=!1,clearTimeout(M)}},[o]),(0,ue.useEffect)(()=>{h.current&&(h.current.scrollTop=h.current.scrollHeight)},[p.messages?.length]);async function x(){if(!(y||!a||!d.trim()||!o&&!i)){b(!0),f(""),(!g.current||g.current.text!==d||g.current.sessionId!==o||(g.current.workspaceId||"")!==i)&&(g.current={text:d,sessionId:o,workspaceId:i||void 0,requestId:crypto.randomUUID(),timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone});try{let v=await Fe("chat/send",g.current);await C(),l(v.sessionId),c(""),g.current=null}catch(v){f(v.message)}finally{b(!1)}}}return(0,O.jsxs)("div",{className:"l2ds-chat",children:[(0,O.jsx)("strong",{children:"Harness \u6587\u672C\u5BF9\u8BDD"}),(0,O.jsxs)("select",{"aria-label":"\u9009\u62E9\u5DE5\u4F5C\u533A",value:i,disabled:y||!a,onChange:v=>{s(v.target.value),l(""),f(""),g.current=null},children:[(0,O.jsx)("option",{value:"",children:"\u5168\u90E8 Harness \u4F1A\u8BDD"}),r.map(v=>(0,O.jsx)("option",{value:v.workspaceId,children:v.title||v.path},v.workspaceId))]}),i&&(0,O.jsx)("small",{className:"l2ds-workspace-path",children:r.find(v=>v.workspaceId===i)?.path}),(0,O.jsxs)("select",{"aria-label":"\u9009\u62E9\u5BF9\u8BDD",value:o,disabled:y,onChange:v=>{l(v.target.value),f("")},children:[(0,O.jsx)("option",{value:"",children:i?"\u5728\u6B64\u5DE5\u4F5C\u533A\u65B0\u5EFA\u5BF9\u8BDD":"\u8BF7\u9009\u62E9\u5DF2\u6709\u4F1A\u8BDD"}),t.filter(v=>!i||v.workspaceId===i).map(v=>(0,O.jsx)("option",{value:v.sessionId,children:v.title||v.sessionId},v.sessionId))]}),!i&&!o&&(0,O.jsx)("small",{children:"\u9009\u62E9 Harness \u5DE5\u4F5C\u533A\u4EE5\u65B0\u5EFA\u5BF9\u8BDD\uFF0C\u6216\u9009\u62E9\u5DF2\u6709\u4F1A\u8BDD\u7EE7\u7EED\u3002"}),(0,O.jsxs)("div",{ref:h,className:"l2ds-messages",children:[p.messages.map(v=>(0,O.jsxs)("div",{className:"l2ds-message "+v.role,children:[(0,O.jsx)("small",{children:v.role==="user"?"\u4F60":"Agent"}),(0,O.jsx)("div",{children:v.text})]},v.id)),p.running&&(0,O.jsx)("p",{children:"\u6B63\u5728\u5904\u7406\u2026"}),p.error&&(0,O.jsx)("p",{role:"alert",children:p.error})]}),m&&(0,O.jsx)("p",{role:"alert",children:m}),(0,O.jsx)("textarea",{"aria-label":"\u5BF9\u8BDD\u5185\u5BB9",value:d,maxLength:32e3,onChange:v=>c(v.target.value),placeholder:"\u8F93\u5165\u6D88\u606F\uFF0CCtrl+Enter \u53D1\u9001",onKeyDown:v=>{v.key==="Enter"&&(v.ctrlKey||v.metaKey)&&!v.nativeEvent.isComposing&&(v.preventDefault(),x())}}),(0,O.jsx)("button",{disabled:y||!a||!d.trim()||!o&&!i,onClick:()=>{x()},children:y?"\u53D1\u9001\u4E2D\u2026":"\u53D1\u9001"})]})}function Uf({character:t,native:e,panel:r,setPanel:n,reset:i,startDrag:s}){let[o,l]=(0,ue.useState)(""),[a,u]=(0,ue.useState)(!1);async function d(c){l(""),u(!0);try{await c()}catch(p){l(p.message)}finally{u(!1)}}return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)("div",{className:"l2ds-toolbar","aria-label":"\u4EBA\u7269\u63A7\u5236",children:[(0,O.jsx)("button",{title:"\u6587\u672C","aria-label":"\u6587\u672C",disabled:a,onClick:()=>e?n(r==="chat"?"":"chat"):void d(()=>Fe("chat/open",{})),children:(0,O.jsx)(rn,{name:"type"})}),(0,O.jsx)("button",{title:"\u52A8\u4F5C","aria-label":"\u52A8\u4F5C",onClick:()=>n(r==="actions"?"":"actions"),children:(0,O.jsx)(rn,{name:"face-slightly-smiling-plus"})}),(0,O.jsx)("button",{className:"l2ds-drag-handle",title:"\u62D6\u62FD\u753B\u5E03","aria-label":"\u62D6\u62FD\u753B\u5E03",onPointerDown:s,children:(0,O.jsx)(rn,{name:"move"})}),(0,O.jsx)("button",{title:"\u91CD\u7F6E","aria-label":"\u91CD\u7F6E",onClick:i,children:(0,O.jsx)(rn,{name:"reload"})}),(0,O.jsx)("button",{title:e?"\u79FB\u5165 Harness":"\u79FB\u51FA Harness","aria-label":e?"\u79FB\u5165 Harness":"\u79FB\u51FA Harness",disabled:a,onClick:()=>{d(()=>Fe("dock",{outside:!e}))},children:(0,O.jsx)(rn,{name:e?"square-arrow-right-enter":"square-arrow-right-exit"})}),(0,O.jsx)("button",{title:"\u5173\u95ED","aria-label":"\u5173\u95ED",disabled:a,onClick:()=>{d(()=>Fe("close",{}))},children:(0,O.jsx)(rn,{name:"x"})})]}),r&&(0,O.jsxs)("aside",{className:"l2ds-sidepanel",children:[(0,O.jsx)("button",{className:"l2ds-panel-close","aria-label":"\u6536\u8D77\u9762\u677F",onClick:()=>n(""),children:"\xD7"}),r==="chat"?(0,O.jsx)(pv,{}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("strong",{children:"\u52A8\u4F5C\u9884\u89C8"}),(0,O.jsx)("div",{className:"l2ds-preview-actions",children:t.actions.map(c=>(0,O.jsx)("button",{disabled:a,onClick:()=>{d(()=>Fe("play",{characterId:t.id,actionId:c.id}))},children:c.name},c.id))})]})]}),o&&(0,O.jsx)("div",{role:"alert",className:"l2ds-toolbar-error",children:o})]})}var Me=ce(kt(),1),Et=ce(Ze(),1),Ie=(t,e,r)=>Math.max(e,Math.min(r,t)),hv=["n","ne","e","se","s","sw","w","nw"];function Gf({characterId:t,character:e,chatRequest:r=0,native:n=!1,children:i}){let s="live2d-stage.layout."+(n?"native.":"app.")+t,o={width:350,height:470,scale:1,x:0,y:0,left:Math.max(0,window.innerWidth-426),top:Math.max(0,window.innerHeight-494)},l=()=>{try{let w=JSON.parse(localStorage.getItem(s)||"{}");return{...o,width:Ie(Number(w.width)||350,240,1e3),height:Ie(Number(w.height)||470,300,1200),scale:Ie(Number(w.scale)||1,.3,3),x:Ie(Number(w.x)||0,-800,800),y:Ie(Number(w.y)||0,-800,800),left:Ie(Number(w.left??o.left),0,Math.max(0,window.innerWidth-80)),top:Ie(Number(w.top??o.top),0,Math.max(0,window.innerHeight-80))}}catch{return o}},[a,u]=(0,Me.useState)(l),[d,c]=(0,Me.useState)(!1),[p,_]=(0,Me.useState)(""),m=(0,Me.useRef)(null),f=(0,Me.useRef)(null),y=(0,Me.useRef)(null),b=(0,Me.useRef)(-1e3),g=(0,Me.useRef)(-1e3),h=(0,Me.useRef)(a);h.current=a;let C=w=>window.chrome?.webview?.postMessage(w),x=w=>{h.current=w,u(w)},v=()=>{try{localStorage.setItem(s,JSON.stringify(h.current))}catch{}n&&(C("layout:"+JSON.stringify({key:s,value:JSON.stringify(h.current)})),C("save"))};(0,Me.useEffect)(()=>{n?C("resize:"+(a.width+52+(p?320:0))+":"+a.height):u(w=>({...w,left:Ie(w.left,0,Math.max(0,window.innerWidth-w.width-52-(p?320:0))),top:Ie(w.top,0,Math.max(0,window.innerHeight-w.height))}))},[a.width,a.height,n,p]),(0,Me.useEffect)(()=>{n&&r&&_("chat")},[n,r]);function M(){x({...o,left:Math.max(0,window.innerWidth-426),top:Math.max(0,window.innerHeight-494)}),_(""),c(!1),y.current=null,v(),n&&C("reset")}function P(w,D=!1,re=""){w.button===0&&(w.stopPropagation(),f.current={x:w.screenX,y:w.screenY,pointerId:w.pointerId,start:h.current,canvas:D,edge:re,moved:!1,offsetX:0,offsetY:0},w.currentTarget.closest(".l2ds-adjust").setPointerCapture(w.pointerId))}function A(w){let D=f.current;if(!D)return;let re=w.screenX-D.x,K=w.screenY-D.y;if(!D.moved&&Math.hypot(re,K)<4)return;D.moved=!0,y.current=null;let q=D.start;if(D.edge){let tr=Ie(q.width+(D.edge.includes("e")?re:D.edge.includes("w")?-re:0),240,1e3),Si=Ie(q.height+(D.edge.includes("s")?K:D.edge.includes("n")?-K:0),300,1200),Gs=D.edge.includes("w")?q.width-tr:0,zs=D.edge.includes("n")?q.height-Si:0;n&&(C("move:"+(Gs-D.offsetX)+":"+(zs-D.offsetY)),D.offsetX=Gs,D.offsetY=zs),x({...q,width:tr,height:Si,left:n?q.left:Math.max(0,q.left+Gs),top:n?q.top:Math.max(0,q.top+zs)})}else D.canvas||!d?n?(C("move:"+(re-D.offsetX)+":"+(K-D.offsetY)),D.offsetX=re,D.offsetY=K):x({...q,left:Ie(q.left+re,0,Math.max(0,window.innerWidth-80)),top:Ie(q.top+K,0,Math.max(0,window.innerHeight-80))}):x({...q,x:Ie(q.x+re,-800,800),y:Ie(q.y+K,-800,800)})}function k(w,D=!1){let re=f.current;if(f.current=null,!!re){if(w.currentTarget.hasPointerCapture(w.pointerId)&&w.currentTarget.releasePointerCapture(w.pointerId),!D&&!re.moved&&!re.canvas&&!re.edge){let K=y.current,q=performance.now();K&&q-K.time<500&&Math.hypot(w.screenX-K.x,w.screenY-K.y)<8?((!n||q-b.current>250)&&(c(tr=>!tr),g.current=q),y.current=null):y.current={time:q,x:w.screenX,y:w.screenY}}else y.current=null;v()}}return(0,Me.useEffect)(()=>{if(!n)return;function w(D){let{x:re,y:K}=D.detail||{},q=document.elementFromPoint(re,K);if(!q?.closest(".l2ds-adjust")||q.closest(".l2ds-toolbar,.l2ds-sidepanel,.l2ds-resize"))return;let tr=performance.now();b.current=tr,y.current=null,tr-g.current>250&&(v(),c(Si=>!Si))}return window.addEventListener("live2d-native-doubleclick",w),()=>window.removeEventListener("live2d-native-doubleclick",w)},[n]),(0,Me.useEffect)(()=>{d&&(m.current?.focus({preventScroll:!0}),n&&C("focus"))},[d,n]),(0,Me.useEffect)(()=>{function w(){let K=f.current;f.current=null,K&&m.current?.hasPointerCapture(K.pointerId)&&m.current.releasePointerCapture(K.pointerId),v(),c(!1),y.current=null}function D(K){K.key==="Escape"&&d&&(K.preventDefault(),K.stopImmediatePropagation(),w())}function re(){d&&w()}return window.addEventListener("keydown",D,!0),window.addEventListener("live2d-native-escape",re),()=>{window.removeEventListener("keydown",D,!0),window.removeEventListener("live2d-native-escape",re)}},[d]),(0,Et.jsxs)("div",{ref:m,tabIndex:-1,className:"l2ds-adjust"+(d?" is-editing":""),"aria-label":"Live2D \u753B\u5E03",style:n?{width:"100%",height:"100%"}:{position:"fixed",left:a.left,top:a.top,width:a.width+52+(p?320:0),height:a.height},onDoubleClick:w=>w.preventDefault(),onPointerDown:w=>{w.target.closest(".l2ds-toolbar,.l2ds-sidepanel,.l2ds-resize")||P(w)},onPointerMove:A,onPointerUp:w=>k(w),onPointerCancel:w=>k(w,!0),onWheel:w=>{!d||w.target.closest(".l2ds-toolbar,.l2ds-sidepanel")||(x({...h.current,scale:Ie(h.current.scale*(w.deltaY<0?1.05:1/1.05),.3,3)}),v())},children:[(0,Et.jsx)("div",{className:"l2ds-viewport",style:{width:a.width,height:a.height},children:(0,Et.jsx)("div",{className:"l2ds-model",style:{width:`${a.scale*100}%`,height:`${a.scale*100}%`,left:`calc(${(1-a.scale)*50}% + ${a.x}px)`,top:`calc(${(1-a.scale)*50}% + ${a.y}px)`,right:"auto",bottom:"auto"},children:i})}),d&&(0,Et.jsxs)("div",{className:"l2ds-resize-frame",style:{width:a.width,height:a.height},children:[(0,Et.jsx)("small",{className:"l2ds-adjust-hint",children:"Esc \u9000\u51FA\u4FDD\u5B58\uFF0C\u6EDA\u8F6E\u63A7\u5236\u4EBA\u7269\u653E\u5927"}),hv.map(w=>(0,Et.jsx)("div",{className:"l2ds-resize l2ds-resize-"+w,"aria-label":"\u8C03\u6574\u753B\u5E03 "+w,onPointerDown:D=>P(D,!1,w)},w))]}),(0,Et.jsx)("div",{className:"l2ds-controls",style:{left:a.width},children:(0,Et.jsx)(Uf,{character:e,native:n,panel:p,setPanel:_,reset:M,startDrag:w=>P(w,!0)})})]})}var mv=`.l2ds{position:fixed;z-index:90;width:320px;max-width:95vw;pointer-events:auto;color:var(--foreground,#ddd);font:13px system-ui;background:transparent;border:0;border-radius:0;box-shadow:none;overflow:hidden}.l2ds header{display:flex;justify-content:space-between;gap:6px;align-items:center;padding:9px;cursor:move;touch-action:none;font-weight:600}.l2ds button{border:0;border-radius:0;padding:4px 7px;background:transparent;color:inherit;cursor:pointer;font-size:12px}.l2ds-stage{height:310px;position:relative;background:transparent}.l2ds-stage>p{padding:30px}.l2ds>small{display:block;padding:5px 10px}.l2ds .live2d-player__hint{bottom:10px;white-space:nowrap;background:transparent;border:0;box-shadow:none;backdrop-filter:none}\r
|
|
219
|
+
.l2ds-config{color:inherit;font-family:inherit;font-size:14px;line-height:1.55;max-width:850px;min-width:0;padding-bottom:24px}.l2ds-config h2{font-size:20px;font-weight:600;margin:0 0 8px}.l2ds-config h3{font-size:15px;font-weight:600;margin:0}.l2ds-muted{font-size:13px;opacity:1;margin:7px 0 16px;line-height:1.65}.l2ds-config-card{border:1px solid #8884;border-radius:12px;padding:16px;margin:18px 0}.l2ds-config-card p{margin-bottom:0}.l2ds-toggle{display:flex;align-items:center;justify-content:space-between;gap:16px}.l2ds-toggle label{display:flex;align-items:center;gap:7px;white-space:nowrap}.l2ds-config-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:25px 0 10px}.l2ds-config-heading h3 span{font-size:12px;opacity:1;margin-left:6px}.l2ds-config button,.l2ds-config input:not([type=checkbox]),.l2ds-config select{font:inherit;color:inherit;background:transparent;border:1px solid #8885;border-radius:8px;padding:8px 10px;box-sizing:border-box;min-width:0}.l2ds-config button{cursor:pointer;white-space:nowrap;font-size:13px}.l2ds-config button:hover{background:#8881}.l2ds-config button:disabled{opacity:1;cursor:default}.l2ds-config input:focus,.l2ds-config select:focus{outline:2px solid #6d8be0;outline-offset:1px}.l2ds-fields{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:18px 0}.l2ds-fields label{display:grid;gap:7px;font-size:13px}.l2ds-config select option{background:Canvas;color:CanvasText}.l2ds-file{display:none}.l2ds-empty{padding:28px 16px;border:1px dashed #8885;border-radius:10px;text-align:center;font-size:13px;opacity:1}.l2ds-action-list{display:grid;gap:8px}.l2ds-action{display:grid;grid-template-columns:38px minmax(0,1fr) auto;align-items:center;gap:10px}.l2ds-kind{font-size:11px;opacity:1}.l2ds-config-heading input{width:160px;font-size:12px!important}.l2ds-error{color:#cf4444;font-size:13px}.l2ds-save{min-height:24px;margin:10px 0;font-size:12px;color:#43835b}@media(max-width:620px){.l2ds-fields{grid-template-columns:1fr}.l2ds-config-heading{flex-wrap:wrap}}\r
|
|
220
|
+
\r
|
|
221
|
+
\r
|
|
222
|
+
\r
|
|
223
|
+
.l2ds{color:#16191f;text-shadow:0 0 2px #fff,1px 0 #fff,-1px 0 #fff,0 1px #fff,0 -1px #fff}.l2ds .live2d-player__hint{color:#16191f;opacity:1}.l2ds-config{color:CanvasText}.l2ds-config input::placeholder{color:CanvasText;opacity:1}.l2ds-native{position:absolute;inset:0;width:100%;max-width:none}.l2ds-native .l2ds-stage{height:calc(100% - 28px)}\r
|
|
224
|
+
\r
|
|
225
|
+
.l2ds-action:has(button:nth-of-type(2)){grid-template-columns:38px minmax(0,1fr) auto auto}\r
|
|
226
|
+
\r
|
|
227
|
+
.l2ds-native{inset:0;width:100%;height:100%}.l2ds-app{inset:0;width:0;height:0;overflow:visible}.l2ds-adjust{position:relative;overflow:hidden;touch-action:none;cursor:move}.l2ds-model{position:absolute;inset:0;transform-origin:center;pointer-events:none}.l2ds-model .live2d-player{width:100%;height:100%}.l2ds .live2d-player__hint,.l2ds .live2d-player__status{display:none}.l2ds-adjust.is-editing{outline:1px dashed #6078a0;outline-offset:-1px;background:#b4c4dd18}\r
|
|
228
|
+
\r
|
|
229
|
+
/* Keep a real compositor layer; only the character canvas receives pointer input. */\r
|
|
230
|
+
.l2ds-app{width:100vw;height:100vh;max-width:none;pointer-events:none;overflow:visible}.l2ds-app .l2ds-adjust{pointer-events:auto}\r
|
|
231
|
+
\r
|
|
232
|
+
.l2ds-viewport{position:absolute;left:0;top:0;overflow:hidden;pointer-events:none}.l2ds-controls{position:absolute;top:0;height:100%;width:52px;pointer-events:none}.l2ds-toolbar{position:absolute;left:5px;top:25%;display:flex;flex-direction:column;gap:7px;pointer-events:auto;text-shadow:none}.l2ds-toolbar button{width:42px;min-height:34px;display:grid;place-items:center;background:#fff;color:#202636;border:1px solid #cbd1dc;border-radius:7px;font:12px system-ui;box-shadow:0 1px 4px #0002}.l2ds-toolbar .l2ds-drag-handle{cursor:move;touch-action:none}.l2ds-sidepanel{position:absolute;left:52px;top:0;bottom:0;width:320px;box-sizing:border-box;background:#fff;color:#202636;text-shadow:none;pointer-events:auto;border-radius:12px;padding:14px;overflow:auto;font:13px system-ui;cursor:default}.l2ds-sidepanel button{border:1px solid #cad0db;border-radius:5px;color:#202636;background:#f6f8fc;padding:7px}.l2ds-panel-close{position:absolute;right:8px;top:8px}.l2ds-chat{height:100%;display:flex;flex-direction:column;gap:10px}.l2ds-chat strong{padding-right:32px}.l2ds-chat select,.l2ds-chat textarea{color:#202636;background:#fff;border:1px solid #c5cbd7;border-radius:5px;padding:7px;font:13px system-ui;min-width:0}.l2ds-chat textarea{height:65px;resize:none}.l2ds-messages{flex:1;min-height:90px;overflow:auto}.l2ds-message{white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0;padding:8px;background:#f2f4f8;border-radius:6px}.l2ds-message.user{background:#eaf1ff}.l2ds-message small{display:block;color:#505b70;margin-bottom:4px}.l2ds-preview-actions{display:grid;gap:8px;margin-top:22px}.l2ds-toolbar-error{position:absolute;right:0;bottom:8px;width:250px;background:#fff;color:#b12424;text-shadow:none;font:12px system-ui;padding:8px;pointer-events:auto}.l2ds-sidepanel [role=alert]{color:#b12424}\r
|
|
233
|
+
\r
|
|
234
|
+
.l2ds-adjust.is-editing{outline:none;background:transparent}.l2ds-resize-frame{position:absolute;left:0;top:0;pointer-events:none;box-sizing:border-box;border:1px dashed #6078a0;z-index:2}.l2ds-resize{position:absolute;pointer-events:auto;touch-action:none}.l2ds-resize-n,.l2ds-resize-s{left:10px;right:10px;height:8px;cursor:ns-resize}.l2ds-resize-n{top:0}.l2ds-resize-s{bottom:0}.l2ds-resize-e,.l2ds-resize-w{top:10px;bottom:10px;width:8px;cursor:ew-resize}.l2ds-resize-e{right:0}.l2ds-resize-w{left:0}.l2ds-resize-ne,.l2ds-resize-nw,.l2ds-resize-se,.l2ds-resize-sw{width:10px;height:10px;border:1px solid #6078a0;background:#fff;box-sizing:border-box}.l2ds-resize-ne{right:0;top:0;cursor:nesw-resize}.l2ds-resize-nw{left:0;top:0;cursor:nwse-resize}.l2ds-resize-se{right:0;bottom:0;cursor:nwse-resize}.l2ds-resize-sw{left:0;bottom:0;cursor:nesw-resize}.l2ds-toolbar svg{display:block;width:21px;height:21px}.l2ds-toolbar button:focus-visible{outline:2px solid #557bd5;outline-offset:1px}\r
|
|
235
|
+
\r
|
|
236
|
+
.l2ds-resize{background:rgba(96,120,160,.01)}.l2ds-resize-ne,.l2ds-resize-nw,.l2ds-resize-se,.l2ds-resize-sw{background:#fff}\r
|
|
237
|
+
\r
|
|
238
|
+
.l2ds-adjust:focus{outline:none}.l2ds-adjust-hint{position:absolute;bottom:12px;left:12px;right:12px;text-align:center;font:11px/1.5 system-ui;color:#202636;opacity:1;text-shadow:0 0 3px #fff,1px 0 #fff,-1px 0 #fff,0 1px #fff,0 -1px #fff;pointer-events:none}\r
|
|
239
|
+
`,Qa=document.createElement("style");Qa.dataset.plugin="dsh-plugin-live2d-stage";Qa.dataset.pluginCss="E:\\DSHLive2d-plugin\\src\\client\\stage.css";Qa.textContent=mv;document.head.append(Qa);var Us=ce(Ze(),1);function fv(){let[t,e]=(0,nn.useState)(null),[r,n]=(0,nn.useState)("\u6A21\u578B\u52A0\u8F7D\u4E2D\u2026"),i=(0,nn.useCallback)(o=>{n(o),o.includes("\u5DF2\u5C31\u7EEA")&&window.chrome?.webview?.postMessage("ready")},[]);(0,nn.useEffect)(()=>{let o=!0;async function l(){try{let u=await Fe("state");o&&e(u)}catch(u){o&&n(u.message)}}l();let a=setInterval(l,2e3);return()=>{o=!1,clearInterval(a)}},[]);let s=t?.characters.find(o=>o.id===t.selectedId);return(0,Us.jsx)("section",{className:"l2ds l2ds-native",children:s&&(0,Us.jsx)(Gf,{characterId:s.id,character:s,chatRequest:t?.chatRequest,native:!0,children:(0,Us.jsx)(ed,{character:s,onStatus:i})},s.id)})}(0,zf.createRoot)(document.getElementById("root")).render((0,Us.jsx)(fv,{}));})();
|
|
240
|
+
/*! Bundled license information:
|
|
241
|
+
|
|
242
|
+
react/cjs/react.production.min.js:
|
|
243
|
+
(**
|
|
244
|
+
* @license React
|
|
245
|
+
* react.production.min.js
|
|
246
|
+
*
|
|
247
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
248
|
+
*
|
|
249
|
+
* This source code is licensed under the MIT license found in the
|
|
250
|
+
* LICENSE file in the root directory of this source tree.
|
|
251
|
+
*)
|
|
252
|
+
|
|
253
|
+
scheduler/cjs/scheduler.production.min.js:
|
|
254
|
+
(**
|
|
255
|
+
* @license React
|
|
256
|
+
* scheduler.production.min.js
|
|
257
|
+
*
|
|
258
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
259
|
+
*
|
|
260
|
+
* This source code is licensed under the MIT license found in the
|
|
261
|
+
* LICENSE file in the root directory of this source tree.
|
|
262
|
+
*)
|
|
263
|
+
|
|
264
|
+
react-dom/cjs/react-dom.production.min.js:
|
|
265
|
+
(**
|
|
266
|
+
* @license React
|
|
267
|
+
* react-dom.production.min.js
|
|
268
|
+
*
|
|
269
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
270
|
+
*
|
|
271
|
+
* This source code is licensed under the MIT license found in the
|
|
272
|
+
* LICENSE file in the root directory of this source tree.
|
|
273
|
+
*)
|
|
274
|
+
|
|
275
|
+
react/cjs/react-jsx-runtime.production.min.js:
|
|
276
|
+
(**
|
|
277
|
+
* @license React
|
|
278
|
+
* react-jsx-runtime.production.min.js
|
|
279
|
+
*
|
|
280
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
281
|
+
*
|
|
282
|
+
* This source code is licensed under the MIT license found in the
|
|
283
|
+
* LICENSE file in the root directory of this source tree.
|
|
284
|
+
*)
|
|
285
|
+
*/
|