1/*! For license information please see 2.b8d9e0d3.chunk.js.LICENSE.txt */ 2(this.webpackJsonpbodymation=this.webpackJsonpbodymation||[]).push([[2],[function(e,t,n){"use strict";n.r(t),n.d(t,"AdadeltaOptimizer",(function(){return ct})),n.d(t,"AdagradOptimizer",(function(){return ht})),n.d(t,"AdamOptimizer",(function(){return pt})),n.d(t,"AdamaxOptimizer",(function(){return gt})),n.d(t,"MomentumOptimizer",(function(){return yt})),n.d(t,"Optimizer",(function(){return ut})),n.d(t,"RMSPropOptimizer",(function(){return xt})),n.d(t,"SGDOptimizer",(function(){return bt})),n.d(t,"Tensor",(function(){return ae.a})),n.d(t,"TensorBuffer",(function(){return ae.b})),n.d(t,"Variable",(function(){return ae.c})),n.d(t,"Rank",(function(){return wt.a})),n.d(t,"sumOutType",(function(){return wt.b})),n.d(t,"upcastType",(function(){return wt.c})),n.d(t,"abs",(function(){return Ot.b})),n.d(t,"acos",(function(){return Ot.c})),n.d(t,"acosh",(function(){return Ot.d})),n.d(t,"add",(function(){return Ot.e})),n.d(t,"addN",(function(){return Ot.f})),n.d(t,"all",(function(){return Ot.h})),n.d(t,"any",(function(){return Ot.i})),n.d(t,"argMax",(function(){return Ot.j})),n.d(t,"argMin",(function(){return Ot.k})),n.d(t,"asin",(function(){return Ot.l})),n.d(t,"asinh",(function(){return Ot.m})),n.d(t,"atan",(function(){return Ot.n})),n.d(t,"atan2",(function(){return Ot.o})),n.d(t,"atanh",(function(){return Ot.p})),n.d(t,"avgPool",(function(){return Ot.q})),n.d(t,"avgPool3d",(function(){return Ot.r})),n.d(t,"basicLSTMCell",(function(){return Ot.s})),n.d(t,"batchToSpaceND",(function(){return Ot.x})),n.d(t,"batchNorm",(function(){return Ot.t})),n.d(t,"batchNorm2d",(function(){return Ot.u})),n.d(t,"batchNorm3d",(function(){return Ot.v})),n.d(t,"batchNorm4d",(function(){return Ot.w})),n.d(t,"broadcastTo",(function(){return Ot.z})),n.d(t,"buffer",(function(){return Ot.A})),n.d(t,"cast",(function(){return Ot.B})),n.d(t,"ceil",(function(){return Ot.C})),n.d(t,"clipByValue",(function(){return Ot.D})),n.d(t,"clone",(function(){return Ot.E})),n.d(t,"complex",(function(){return Ot.F})),n.d(t,"concat",(function(){return Ot.G})),n.d(t,"concat1d",(function(){return Ot.H})),n.d(t,"concat2d",(function(){return Ot.I})),n.d(t,"concat3d",(function(){return Ot.J})),n.d(t,"concat4d",(function(){return Ot.K})),n.d(t,"conv1d",(function(){return Ot.L})),n.d(t,"conv2d",(function(){return Ot.M})),n.d(t,"conv2dTranspose",(function(){return Ot.N})),n.d(t,"conv3d",(function(){return Ot.O})),n.d(t,"conv3dTranspose",(function(){return Ot.P})),n.d(t,"cos",(function(){return Ot.Q})),n.d(t,"cosh",(function(){return Ot.R})),n.d(t,"cumsum",(function(){return Ot.T})),n.d(t,"depthToSpace",(function(){return Ot.U})),n.d(t,"depthwiseConv2d",(function(){return Ot.V})),n.d(t,"diag",(function(){return Ot.W})),n.d(t,"dilation2d",(function(){return Ot.X})),n.d(t,"div",(function(){return Ot.Y})),n.d(t,"divNoNan",(function(){return Ot.Z})),n.d(t,"dot",(function(){return Ot.bb})),n.d(t,"elu",(function(){return Ot.db})),n.d(t,"equal",(function(){return Ot.fb})),n.d(t,"erf",(function(){return Ot.hb})),n.d(t,"exp",(function(){return Ot.ib})),n.d(t,"expandDims",(function(){return Ot.jb})),n.d(t,"expm1",(function(){return Ot.kb})),n.d(t,"eye",(function(){return Ot.lb})),n.d(t,"fill",(function(){return Ot.nb})),n.d(t,"floor",(function(){return Ot.ob})),n.d(t,"floorDiv",(function(){return Ot.pb})),n.d(t,"gather",(function(){return Ot.rb})),n.d(t,"greater",(function(){return Ot.tb})),n.d(t,"greaterEqual",(function(){return Ot.ub})),n.d(t,"imag",(function(){return Ot.yb})),n.d(t,"isFinite",(function(){return Ot.Cb})),n.d(t,"isInf",(function(){return Ot.Db})),n.d(t,"isNaN",(function(){return Ot.Eb})),n.d(t,"leakyRelu",(function(){return Ot.Fb})),n.d(t,"less",(function(){return Ot.Gb})),n.d(t,"lessEqual",(function(){return Ot.Hb})),n.d(t,"linspace",(function(){return Ot.Lb})),n.d(t,"localResponseNormalization",(function(){return Ot.Mb})),n.d(t,"log",(function(){return Ot.Nb})),n.d(t,"log1p",(function(){return Ot.Ob})),n.d(t,"logSigmoid",(function(){return Ot.Pb})),n.d(t,"logSoftmax",(function(){return Ot.Qb})),n.d(t,"logSumExp",(function(){return Ot.Rb})),n.d(t,"logicalAnd",(function(){return Ot.Sb})),n.d(t,"logicalNot",(function(){return Ot.Tb})),n.d(t,"logicalOr",(function(){return Ot.Ub})),n.d(t,"logicalXor",(function(){return Ot.Vb})),n.d(t,"matMul",(function(){return Ot.Xb})),n.d(t,"max",(function(){return Ot.Yb})),n.d(t,"maxPool",(function(){return Ot.Zb})),n.d(t,"maxPool3d",(function(){return Ot.ac})),n.d(t,"maxPoolWithArgmax",(function(){return Ot.bc})),n.d(t,"maximum",(function(){return Ot.cc})),n.d(t,"mean",(function(){return Ot.ec})),n.d(t,"min",(function(){return Ot.fc})),n.d(t,"minimum",(function(){return Ot.gc})),n.d(t,"mod",(function(){return Ot.ic})),n.d(t,"moments",(function(){return Ot.kc})),n.d(t,"mul",(function(){return Ot.mc})),n.d(t,"multiRNNCell",(function(){return Ot.oc})),n.d(t,"multinomial",(function(){return Ot.pc})),n.d(t,"neg",(function(){return Ot.qc})),n.d(t,"notEqual",(function(){return Ot.sc})),n.d(t,"oneHot",(function(){return Ot.uc})),n.d(t,"ones",(function(){return Ot.vc})),n.d(t,"onesLike",(function(){return Ot.wc})),n.d(t,"outerProduct",(function(){return Ot.yc})),n.d(t,"pad",(function(){return Ot.zc})),n.d(t,"pad1d",(function(){return Ot.Ac})),n.d(t,"pad2d",(function(){return Ot.Bc})),n.d(t,"pad3d",(function(){return Ot.Cc})),n.d(t,"pad4d",(function(){return Ot.Dc})),n.d(t,"pool",(function(){return Ot.Ec})),n.d(t,"pow",(function(){return Ot.Fc})),n.d(t,"prelu",(function(){return Ot.Hc})),n.d(t,"print",(function(){return Ot.Ic})),n.d(t,"prod",(function(){return Ot.Jc})),n.d(t,"rand",(function(){return Ot.Kc})),n.d(t,"randomGamma",(function(){return Ot.Lc})),n.d(t,"randomNormal",(function(){return Ot.Mc})),n.d(t,"randomUniform",(function(){return Ot.Nc})),n.d(t,"range",(function(){return Ot.Oc})),n.d(t,"real",(function(){return Ot.Pc})),n.d(t,"reciprocal",(function(){return Ot.Qc})),n.d(t,"relu",(function(){return Ot.Rc})),n.d(t,"relu6",(function(){return Ot.Sc})),n.d(t,"reshape",(function(){return Ot.Tc})),n.d(t,"reverse",(function(){return Ot.Uc})),n.d(t,"reverse1d",(function(){return Ot.Vc}
2)),n.d(t,"reverse2d",(function(){return Ot.Wc})),n.d(t,"reverse3d",(function(){return Ot.Xc})),n.d(t,"reverse4d",(function(){return Ot.Yc})),n.d(t,"round",(function(){return Ot.ad})),n.d(t,"rsqrt",(function(){return Ot.bd})),n.d(t,"scalar",(function(){return Ot.cd})),n.d(t,"selu",(function(){return Ot.ed})),n.d(t,"separableConv2d",(function(){return Ot.fd})),n.d(t,"setdiff1dAsync",(function(){return Ot.gd})),n.d(t,"sigmoid",(function(){return Ot.hd})),n.d(t,"sign",(function(){return Ot.id})),n.d(t,"sin",(function(){return Ot.kd})),n.d(t,"sinh",(function(){return Ot.ld})),n.d(t,"slice",(function(){return Ot.md})),n.d(t,"slice1d",(function(){return Ot.nd})),n.d(t,"slice2d",(function(){return Ot.od})),n.d(t,"slice3d",(function(){return Ot.pd})),n.d(t,"slice4d",(function(){return Ot.qd})),n.d(t,"softmax",(function(){return Ot.rd})),n.d(t,"softplus",(function(){return Ot.sd})),n.d(t,"spaceToBatchND",(function(){return Ot.td})),n.d(t,"fft",(function(){return Ot.mb})),n.d(t,"ifft",(function(){return Ot.xb})),n.d(t,"irfft",(function(){return Ot.Bb})),n.d(t,"rfft",(function(){return Ot.Zc})),n.d(t,"split",(function(){return Ot.wd})),n.d(t,"sqrt",(function(){return Ot.xd})),n.d(t,"square",(function(){return Ot.yd})),n.d(t,"squaredDifference",(function(){return Ot.zd})),n.d(t,"squeeze",(function(){return Ot.Bd})),n.d(t,"stack",(function(){return Ot.Cd})),n.d(t,"step",(function(){return Ot.Dd})),n.d(t,"stridedSlice",(function(){return Ot.Ed})),n.d(t,"sub",(function(){return Ot.Fd})),n.d(t,"sum",(function(){return Ot.Hd})),n.d(t,"tan",(function(){return Ot.Id})),n.d(t,"tanh",(function(){return Ot.Jd})),n.d(t,"tensor",(function(){return Ot.Kd})),n.d(t,"tensor1d",(function(){return Ot.Ld})),n.d(t,"tensor2d",(function(){return Ot.Md})),n.d(t,"tensor3d",(function(){return Ot.Nd})),n.d(t,"tensor4d",(function(){return Ot.Od})),n.d(t,"tensor5d",(function(){return Ot.Pd})),n.d(t,"tensor6d",(function(){return Ot.Qd})),n.d(t,"tile",(function(){return Ot.Rd})),n.d(t,"topk",(function(){return Ot.Sd})),n.d(t,"truncatedNormal",(function(){return Ot.Ud})),n.d(t,"unsortedSegmentSum",(function(){return Ot.Vd})),n.d(t,"unstack",(function(){return Ot.Wd})),n.d(t,"variable",(function(){return Ot.Xd})),n.d(t,"where",(function(){return Ot.Yd})),n.d(t,"whereAsync",(function(){return Ot.Zd})),n.d(t,"zeros",(function(){return Ot.ae})),n.d(t,"zerosLike",(function(){return Ot.be})),n.d(t,"booleanMaskAsync",(function(){return Ot.y})),n.d(t,"equalStrict",(function(){return Ot.gb})),n.d(t,"greaterEqualStrict",(function(){return Ot.vb})),n.d(t,"greaterStrict",(function(){return Ot.wb})),n.d(t,"lessEqualStrict",(function(){return Ot.Ib})),n.d(t,"lessStrict",(function(){return Ot.Jb})),n.d(t,"notEqualStrict",(function(){return Ot.tc})),n.d(t,"addStrict",(function(){return Ot.g})),n.d(t,"divStrict",(function(){return Ot.ab})),n.d(t,"maximumStrict",(function(){return Ot.dc})),n.d(t,"minimumStrict",(function(){return Ot.hc})),n.d(t,"modStrict",(function(){return Ot.jc})),n.d(t,"mulStrict",(function(){return Ot.nc})),n.d(t,"powStrict",(function(){return Ot.Gc})),n.d(t,"squaredDifferenceStrict",(function(){return Ot.Ad})),n.d(t,"subStrict",(function(){return Ot.Gd})),n.d(t,"transpose",(function(){return Ot.Td})),n.d(t,"norm",(function(){return Ot.rc})),n.d(t,"movingAverage",(function(){return Ot.lc})),n.d(t,"scatterND",(function(){return Ot.dd})),n.d(t,"sparseToDense",(function(){return Ot.ud})),n.d(t,"gatherND",(function(){return Ot.sb})),n.d(t,"dropout",(function(){return Ot.cb})),n.d(t,"enclosingPowerOfTwo",(function(){return Ot.eb})),n.d(t,"cosineWindow",(function(){return Ot.S})),n.d(t,"inTopKAsync",(function(){return Ot.Ab})),n.d(t,"op",(function(){return Ot.xc})),n.d(t,"OP_SCOPE_SUFFIX",(function(){return Ot.a})),n.d(t,"image",(function(){return Ot.zb})),n.d(t,"linalg",(function(){return Ot.Kb})),n.d(t,"losses",(function(){return Ot.Wb})),n.d(t,"spectral",(function(){return Ot.vd})),n.d(t,"fused",(function(){return Ot.qb})),n.d(t,"signal",(function(){return Ot.jd})),n.d(t,"Reduction",(function(){return kt.a})),n.d(t,"train",(function(){return _t})),n.d(t,"enableProdMode",(function(){return $e.g})),n.d(t,"enableDebugMode",(function(){return $e.f})),n.d(t,"disableDeprecationWarnings",(function(){return $e.c})),n.d(t,"deprecationWarn",(function(){return $e.b})),n.d(t,"disposeVariables",(function(){return $e.e})),n.d(t,"engine",(function(){return $e.h})),n.d(t,"memory",(function(){return $e.m}
2)),n.d(t,"profile",(function(){return $e.n})),n.d(t,"tidy",(function(){return $e.t})),n.d(t,"dispose",(function(){return $e.d})),n.d(t,"keep",(function(){return $e.l})),n.d(t,"time",(function(){return $e.u})),n.d(t,"setBackend",(function(){return $e.r})),n.d(t,"ready",(function(){return $e.o})),n.d(t,"getBackend",(function(){return $e.k})),n.d(t,"removeBackend",(function(){return $e.q})),n.d(t,"findBackend",(function(){return $e.i})),n.d(t,"findBackendFactory",(function(){return $e.j})),n.d(t,"registerBackend",(function(){return $e.p})),n.d(t,"backend",(function(){return $e.a})),n.d(t,"setPlatform",(function(){return $e.s})),n.d(t,"getKernel",(function(){return Pe.b})),n.d(t,"getGradient",(function(){return Pe.a})),n.d(t,"getKernelsForBackend",(function(){return Pe.c})),n.d(t,"registerKernel",(function(){return Pe.e})),n.d(t,"registerGradient",(function(){return Pe.d})),n.d(t,"unregisterKernel",(function(){return Pe.g})),n.d(t,"unregisterGradient",(function(){return Pe.f})),n.d(t,"customGrad",(function(){return ot.a})),n.d(t,"grad",(function(){return ot.b})),n.d(t,"grads",(function(){return ot.c})),n.d(t,"valueAndGrad",(function(){return ot.d})),n.d(t,"valueAndGrads",(function(){return ot.e})),n.d(t,"variableGrads",(function(){return ot.f})),n.d(t,"Environment",(function(){return f.b})),n.d(t,"env",(function(){return f.c})),n.d(t,"ENV",(function(){return f.a})),n.d(t,"version_core",(function(){return Ze})),n.d(t,"nextFrame",(function(){return jt.a})),n.d(t,"browser",(function(){return i})),n.d(t,"io",(function(){return r})),n.d(t,"math",(function(){return a})),n.d(t,"serialization",(function(){return s})),n.d(t,"test_util",(function(){return Ke})),n.d(t,"util",(function(){return C})),n.d(t,"backend_util",(function(){return u})),n.d(t,"tensor_util",(function(){return Ye})),n.d(t,"slice_util",(function(){return Ge})),n.d(t,"gather_util",(function(){return o})),n.d(t,"scatter_util",(function(){return Ve})),n.d(t,"device_util",(function(){return hn})),n.d(t,"kernel_impls",(function(){return c})),n.d(t,"KernelBackend",(function(){return xn})),n.d(t,"DataStorage",(function(){return yn})),n.d(t,"Abs",(function(){return De.a})),n.d(t,"Acos",(function(){return De.b})),n.d(t,"Acosh",(function(){return De.c})),n.d(t,"Add",(function(){return De.d})),n.d(t,"AddN",(function(){return De.e})),n.d(t,"All",(function(){return De.f})),n.d(t,"Any",(function(){return De.g})),n.d(t,"ArgMax",(function(){return De.h})),n.d(t,"ArgMin",(function(){return De.i})),n.d(t,"Asin",(function(){return De.j})),n.d(t,"Asinh",(function(){return De.k})),n.d(t,"Atan",(function(){return De.l})),n.d(t,"Atanh",(function(){return De.n})),n.d(t,"Atan2",(function(){return De.m})),n.d(t,"AvgPool",(function(){return De.o})),n.d(t,"AvgPoolBackprop",(function(){return De.r})),n.d(t,"AvgPool3D",(function(){return De.p})),n.d(t,"AvgPool3DBackprop",(function(){return De.q})),n.d(t,"BatchMatMul",(function(){return De.s})),n.d(t,"BatchToSpaceND",(function(){return De.t})),n.d(t,"BroadcastTo",(function(){return De.u})),n.d(t,"Cast",(function(){return De.v})),n.d(t,"Ceil",(function(){return De.w})),n.d(t,"ClipByValue",(function(){return De.x})),n.d(t,"Complex",(function(){return De.y})),n.d(t,"Concat",(function(){return De.z})),n.d(t,"Conv2D",(function(){return De.A})),n.d(t,"Conv2DBackpropFilter",(function(){return De.B})),n.d(t,"Conv2DBackpropInput",(function(){return De.C})),n.d(t,"Conv3D",(function(){return De.D})),n.d(t,"Conv3DBackpropFilterV2",(function(){return De.E})),n.d(t,"Conv3DBackpropInputV2",(function(){return De.F})),n.d(t,"Cos",(function(){return De.G})),n.d(t,"Cosh",(function(){return De.H})),n.d(t,"Cumsum",(function(){return De.J})),n.d(t,"CropAndResize",(function(){return De.I})),n.d(t,"DepthToSpace",(function(){return De.K})),n.d(t,"DepthwiseConv2dNative",(function(){return De.L})),n.d(t,"DepthwiseConv2dNativeBackpropFilter",(function(){return De.M})),n.d(t,"DepthwiseConv2dNativeBackpropInput",(function(){return De.N})),n.d(t,"Diag",(function(){return De.O})),n.d(t,"Dilation2D",(function(){return De.P})),n.d(t,"Dilation2DBackpropInput",(function(){return De.R})),n.d(t,"Dilation2DBackpropFilter",(function(){return De.Q})),n.d(t,"Div",(function(){return De.S})),n.d(t,"Elu",(function(){return De.T})),n.d(t,"EluGrad",(function(){return De.U})),n.d(t,"Erf",(function(){return De.W})),n.d(t,"Equal",(function(){return De.V})),n.d(t,"Exp",(function(){return De.X})),n.d(t,"Expm1",(function(){return De.Y})),n.d(t,"FFT",(function(){return De.Z})),n.d(t,"Fill",(function(){return De.ab})),n.d(t,"FlipLeftRight",(function(){return De.bb})),n.d(t,"Floor",(function(){return De.cb})),n.d(t,"FloorDiv",(function(){return De.db})),n.d(t,"FusedBatchNorm",(function(){return De.fb})),n.d(t,"GatherV2",(function(){return De.jb})),n.d(t,"GatherNd",(function(){return De.ib})),n.d(t,"Greater",(function(){return De.kb})),n.d(t,"GreaterEqual",(function(){return De.lb})),n.d(t,"Identity",(function(){return De.nb})),n.d(t,"IFFT",(function(){return De.mb})),n.d(t,"Imag",(function(){return De.ob})),n.d(t,"IsFinite",(function(){return De.pb})),n.d(t,"IsInf",(function(){return De.qb})),n.d(t,"IsNan",(function(){return De.rb})),n.d(t,"Less",(function(){return De.ub})),n.d(t,"LessEqual",(function(){return De.vb})),n.d(t,"LinSpace",(function(){return De.wb})),n.d(t,"Log",(function(){return De.xb})),n.d(t,"Log1p",(function(){return De.yb})),n.d(t,"LogicalAnd",(function(){return De.Ab})),n.d(t,"LogicalNot",(function(){return De.Bb})),n.d(t,"LogicalOr",(function(){return De.Cb})),n.d(t,"LogSoftmax",(function(){return De.zb})),n.d(t,"LRN",(function(){return De.sb})),n.d(t,"LRNBackprop",(function(){return De.tb})),n.d(t,"Max",(function(){return De.Db})),n.d(t,"Maximum",(function(){return De.Jb})),n.d(t,"MaxPool",(function(){return De.Eb})),n.d(t,"MaxPoolBackprop",(function(){return De.Hb})),n.d(t,"MaxPool3D",(function(){return De.Fb})),n.d(t,"MaxPool3DBackprop",(function(){return De.Gb})),n.d(t,"MaxPoolWithArgmax",(function(){return De.Ib})),n.d(t,"Mean",(function(){return De.Kb})),n.d(t,"Min",(function(){return De.Lb})),n.d(t,"Minimum",(function(){return De.Mb})),n.d(t,"Mod",(function(){return De.Nb})),n.d(t,"Multiply",(function(){return De.Ob})),n.d(t,"Negate",(function(){return De.Pb})),n.d(t,"NotEqual",(function(){return De.Tb})),n.d(t,"NonMaxSuppressionV3",(function(){return De.Qb})),n.d(t,"NonMaxSuppressionV4",(function(){return De.Rb})),n.d(t,"NonMaxSuppressionV5",(function(){return De.Sb})),n.d(t,"OnesLike",(function(){return De.Vb})),n.d(t,"OneHot",(function(){return De.Ub})),n.d(t,"PadV2",(function(){return De.Wb})),n.d(t,"Pool",(function(){return De.Xb})),n.d(t,"Pow",(function(){return De.Yb})),n.d(t,"Prelu",(function(){return De.Zb})),n.d(t,"Prod",(function(){return De.ac})),n.d(t,"Range",(function(){return De.bc})),n.d(t,"Real",(function(){return De.cc})),n.d(t,"Reciprocal",(function(){return De.dc})),n.d(t,"Relu",(function(){return De.ec})),n.d(t,"Reshape",(function(){return De.gc})),n.d(t,"ResizeNearestNeighbor",(function(){return De.jc})),n.d(t,"ResizeNearestNeighborGrad",(function(){return De.kc})),n.d(t,"ResizeBilinear",(function(){return De.hc})),n.d(t,"ResizeBilinearGrad",(function(){return De.ic})),n.d(t,"Relu6",(function(){return De.fc})),n.d(t,"Reverse",(function(){return De.lc})),n.d(t,"Round",(function(){return De.nc})),n.d(t,"Rsqrt",(function(){return De.oc})),n.d(t,"ScatterNd",(function(){return De.pc})),n.d(t,"SelectV2",(function(){return De.qc})),n.d(t,"Selu",(function(){return De.rc})),n.d(t,"Slice",(function(){return De.wc})),n.d(t,"Sin",(function(){return De.uc})),n.d(t,"Sinh",(function(){return De.vc})),n.d(t,"Sign",(function(){return De.tc})),n.d(t,"Sigmoid",(function(){return De.sc})),n.d(t,"Softplus",(function(){return De.yc})),n.d(t,"Sqrt",(function(){return De.Cc})),n.d(t,"Sum",(function(){return De.Ic})),n.d(t,"SpaceToBatchND",(function(){return De.zc})),n.d(t,"SplitV",(function(){return De.Bc})),n.d(t,"Softmax",(function(){return De.xc})),n.d(t,"SquaredDifference",(function(){return De.Ec})),n.d(t,"Square",(function(){return De.Dc})),n.d(t,"Sub",(function(){return De.Hc})),n.d(t,"SparseToDense",(function(){return De.Ac})),n.d(t,"StridedSlice",(function(){return De.Gc})),n.d(t,"Tan",(function(){return De.Jc})),n.d(t,"Tanh",(function(){return De.Kc})),n.d(t,"Tile",(function(){return De.Lc})),n.d(t,"TopK",(function(){return De.Mc})),n.d(t,"Transpose",(function(){return De.Nc})),n.d(t,"Unpack",(function(){return De.Oc})),n.d(t,"UnsortedSegmentSum",(function(){return De.Pc})),n.d(t,"ZerosLike",(function(){return De.Qc})),n.d(t,"Step",(function(){return De.Fc})),n.d(t,"FromPixels",(function(){return De.eb})),n.d(t,"RotateWithOffset",(function(){return De.mc})),n.d(t,"_FusedMatMul",(function(){return De.Rc})),n.d(t,"FusedConv2D",(function(){return De.gb})),n.d(t,"FusedDepthwiseConv2D",(function(){return De.hb}));var r={};n.r(r),n.d(r,"copyModel",(function(){return K})),n.d(r,"listModels",(function(){return H})),n.d(r,"moveModel",(function(){return J})),n.d(r,"removeModel",(function(){return X})),n.d(r,"browserFiles",(function(){return le})),n.d(r,"browserHTTPRequest",(function(){return Se})),n.d(r,"concatenateArrayBuffers",(function(){return b.d})),n.d(r,"decodeWeights",(function(){return b.e})),n.d(r,"encodeWeights",(function(){return b.f})),n.d(r,"fromMemory",(function(){return Ee})),n.d(r,"getLoadHandlers",(function(){return k})),n.d(r,"getModelArtifactsInfoForJSON",(function(){return b.g})),n.d(r,"getSaveHandlers",(function(){return O})),n.d(r,"http",(function(){return ke})),n.d(r,"isHTTPScheme",(function(){return we})),n.d(r,"loadWeights",(function(){return ve})),n.d(r,"registerLoadRouter",(function(){return w})),n.d(r,"registerSaveRouter",(function(){return x})),n.d(r,"weightsLoaderFactory",(function(){return be})),n.d(r,"withSaveHandler",(function(){return Te}));var a={};n.r(a),n.d(a,"confusionMatrix",(function(){return Le}));var i={};n.r(i),n.d(i,"toPixels",(function(){return Fe})),n.d(i,"fromPixels",(function(){return Ue}));var o={};n.r(o),n.d(o,"prepareAndValidate",(function(){return We}));var s={};n.r(s),n.d(s,"Serializable",(function(){return He})),n.d(s,"SerializationMap",(function(){return qe})),n.d(s,"registerClass",(function(){return Xe}));var u={};n.r(u),n.d(u,"axesAreInnerMostDims",(function(){return Ct.b})),n.d(u,"combineLocations",(function(){return Ct.c})),n.d(u,"computeOutAndReduceShapes",(function(){return Ct.d})),n.d(u,"expandShapeToKeepDim",(function(){return Ct.e})),n.d(u,"assertAxesAreInnerMostDims",(function(){return Ct.a})),n.d(u,"getAxesPermutation",(function(){return Ct.f})),n.d(u,"getUndoAxesPermutation",(function(){return Ct.h})),n.d(u,"getInnerMostAxes",(function(){return Ct.g})),n.d(u,"getBroadcastDims",(function(){return Mt.b})),n.d(u,"getReductionAxes",(function(){return Mt.c})),n.d(u,"assertAndGetBroadcastShape",(function(){return Mt.a})),n.d(u,"assertParamsConsistent",(function(){return At.a}
2)),n.d(u,"computeOutShape",(function(){return At.b})),n.d(u,"computeDilation2DInfo",(function(){return Nt.d})),n.d(u,"computePool2DInfo",(function(){return Nt.e})),n.d(u,"computePool3DInfo",(function(){return Nt.f})),n.d(u,"computeConv2DInfo",(function(){return Nt.a})),n.d(u,"computeConv3DInfo",(function(){return Nt.b})),n.d(u,"computeDefaultPad",(function(){return Nt.c})),n.d(u,"tupleValuesAreOne",(function(){return Nt.i})),n.d(u,"eitherStridesOrDilationsAreOne",(function(){return Nt.h})),n.d(u,"convertConv2DDataFormat",(function(){return Nt.g})),n.d(u,"getFusedDyActivation",(function(){return Rt.c})),n.d(u,"getFusedBiasGradient",(function(){return Rt.b})),n.d(u,"applyActivation",(function(){return Rt.a})),n.d(u,"shouldFuse",(function(){return Rt.d})),n.d(u,"PARALLELIZE_THRESHOLD",(function(){return It.a})),n.d(u,"computeOptimalWindowSize",(function(){return It.b})),n.d(u,"slice_util",(function(){return Ge})),n.d(u,"upcastType",(function(){return wt.c})),n.d(u,"getImageCenter",(function(){return Lt})),n.d(u,"getReshaped",(function(){return Dt})),n.d(u,"getPermuted",(function(){return Pt})),n.d(u,"getReshapedPermuted",(function(){return zt})),n.d(u,"getSliceBeginCoords",(function(){return Ft})),n.d(u,"getSliceSize",(function(){return Bt})),n.d(u,"prepareAndValidate",(function(){return We})),n.d(u,"validateUpdateShape",(function(){return Ve.validateUpdateShape})),n.d(u,"validateInput",(function(){return Ve.validateInput})),n.d(u,"calculateShapes",(function(){return Ve.calculateShapes})),n.d(u,"SELU_SCALEALPHA",(function(){return Ut})),n.d(u,"SELU_SCALE",(function(){return Wt})),n.d(u,"ERF_P",(function(){return Vt})),n.d(u,"ERF_A1",(function(){return Gt})),n.d(u,"ERF_A2",(function(){return Ht})),n.d(u,"ERF_A3",(function(){return qt})),n.d(u,"ERF_A4",(function(){return Xt})),n.d(u,"ERF_A5",(function(){return Yt})),n.d(u,"warn",(function(){return Kt})),n.d(u,"log",(function(){return Zt})),n.d(u,"mergeRealAndImagArrays",(function(){return Jt})),n.d(u,"splitRealAndImagArrays",(function(){return Qt})),n.d(u,"complexWithEvenIndex",(function(){return $t})),n.d(u,"complexWithOddIndex",(function(){return en})),n.d(u,"getComplexWithIndex",(function(){return tn})),n.d(u,"assignToTypedArray",(function(){return nn})),n.d(u,"exponents",(function(){return rn})),n.d(u,"exponent",(function(){return an})),n.d(u,"prepareSplitSize",(function(){return on.a})),n.d(u,"segment_util",(function(){return sn})),n.d(u,"castTensor",(function(){return un})),n.d(u,"reshapeTensor",(function(){return cn})),n.d(u,"linspaceImpl",(function(){return ln}));var c={};n.r(c),n.d(c,"nonMaxSuppressionV3Impl",(function(){return dn.a})),n.d(c,"nonMaxSuppressionV4Impl",(function(){return dn.b})),n.d(c,"nonMaxSuppressionV5Impl",(function(){return dn.c})),n.d(c,"split",(function(){return pn})),n.d(c,"tile",(function(){return mn})),n.d(c,"topkImpl",(function(){return gn})),n.d(c,"whereImpl",(function(){return bn.a}));var l=n(10),h=(n(168),n(5)),d=n(11),f=n(39),p=n(18),m=n(3),v=n.n(m),g=n(13),b=n(60),y=function(){function e(){Object(h.a)(this,e),this.saveRouters=[],this.loadRouters=[]}return Object(d.a)(e,null,[{key:"getInstance",value:function(){return null==e.instance&&(e.instance=new e),e.instance}},{key:"registerSaveRouter",value:function(t){e.getInstance().saveRouters.push(t)}},{key:"registerLoadRouter",value:function(t){e.getInstance().loadRouters.push(t)}},{key:"getSaveHandlers",value:function(t){return e.getHandlers(t,"save")}},{key:"getLoadHandlers",value:function(t,n){return e.getHandlers(t,"load",n)}},{key:"getHandlers",value:function(t,n,r){var a=[];return("load"===n?e.getInstance().loadRouters:e.getInstance().saveRouters).forEach((function(e){var n=e(t,r);null!==n&&a.push(n)})),a}}]),e}(),x=function(e){return y.registerSaveRouter(e)},w=function(e){return y.registerLoadRouter(e)},O=function(e){return y.getSaveHandlers(e)},k=function(e,t){return y.getLoadHandlers(e,t)};function S(){if(!Object(f.c)().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");var e="undefined"===typeof window?self:window,t=e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB||e.shimIndexedDB;if(null==t)throw new Error("The current browser does not appear to supp
2ort IndexedDB.");return t}function _(e){var t=e.result;t.createObjectStore("models_store",{keyPath:"modelPath"}),t.createObjectStore("model_info_store",{keyPath:"modelPath"})}var j=function(){function e(t){if(Object(h.a)(this,e),this.indexedDB=S(),null==t||!t)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=t}return Object(d.a)(e,[{key:"save",value:function(){var e=Object(g.a)(v.a.mark((function e(t){return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.modelTopology instanceof ArrayBuffer)){e.next=2;break}throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");case 2:return e.abrupt("return",this.databaseAction(this.modelPath,t));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"load",value:function(){var e=Object(g.a)(v.a.mark((function e(){return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.databaseAction(this.modelPath));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"databaseAction",value:function(e,t){var n=this;return new Promise((function(e,r){var a=n.indexedDB.open("tensorflowjs",1);a.onupgradeneeded=function(){return _(a)},a.onsuccess=function(){var i=a.result;if(null==t){var o=i.transaction("models_store","readonly"),s=o.objectStore("models_store").get(n.modelPath);s.onsuccess=function(){if(null==s.result)return i.close(),r(new Error("Cannot find model with path '".concat(n.modelPath,"' ")+"in IndexedDB."));e(s.result.modelArtifacts)},s.onerror=function(e){return i.close(),r(s.error)},o.oncomplete=function(){return i.close()}}else{var u,c=Object(b.g)(t),l=i.transaction("model_info_store","readwrite"),h=l.objectStore("model_info_store"),d=h.put({modelPath:n.modelPath,modelArtifactsInfo:c});d.onsuccess=function(){var a=(u=i.transaction("models_store","readwrite")).objectStore("models_store").put({modelPath:n.modelPath,modelArtifacts:t,modelArtifactsInfo:c});a.onsuccess=function(){return e({modelArtifactsInfo:c})},a.onerror=function(e){var t=(h=l.objectStore("model_info_store")).delete(n.modelPath);t.onsuccess=function(){return i.close(),r(a.error)},t.onerror=function(e){return i.close(),r(a.error)}}},d.onerror=function(e){return i.close(),r(d.error)},l.oncomplete=function(){null==u?i.close():u.oncomplete=function(){return i.close()}}}},a.onerror=function(e){return r(a.error)}}))}}]),e}();j.URL_SCHEME="indexeddb://";var E=function(e){return Object(f.c)().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(j.URL_SCHEME)?(t=e.slice(j.URL_SCHEME.length),new j(t)):null;var t};y.registerSaveRouter(E),y.registerLoadRouter(E);var T=function(){function e(){Object(h.a)(this,e),this.indexedDB=S()}return Object(d.a)(e,[{key:"listModels",value:function(){var e=Object(g.a)(v.a.mark((function e(){var t=this;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=t.indexedDB.open("tensorflowjs",1);r.onupgradeneeded=function(){return _(r)},r.onsuccess=function(){var t=r.result,a=t.transaction("model_info_store","readonly"),i=a.objectStore("model_info_store").getAll();i.onsuccess=function(){var t,n={},r=Object(p.a)(i.result);try{for(r.s();!(t=r.n()).done;){var a=t.value;n[a.modelPath]=a.modelArtifactsInfo}}catch(o){r.e(o)}finally{r.f()}e(n)},i.onerror=function(e){return t.close(),n(i.error)},a.oncomplete=function(){return t.close()}},r.onerror=function(e){return n(r.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"removeModel",value:function(){var e=Object(g.a)(v.a.mark((function e(t){var n=this;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(r=t).startsWith(j.URL_SCHEME)?r.slice(j.URL_SCHEME.length):r,e.abrupt("return",new Promise((function(e,r){var a=n.indexedDB.open("tensorflowjs",1);a.onupgradeneeded=function(){return _(a)},a.onsuccess=function(){var n,i=a.result,o=i.transaction("model_info_store","readwrite"),s=o.objectStore("model_info_store"),u=s.get(t);u.onsuccess=function(){if(null==u.result)return i.close(),r(new Error("Cannot find model with path '".concat(t,"' ")+"in IndexedDB."));var a=s.delete(t),o=function(){var a=(n=i.transaction("models_store","readwrite")).objectStore("models_store").delete(t);a.onsuccess=function(){return e(u.result.modelArtifactsInfo)},a.onerror=function(e){return r(u.error)}};a.onsuccess=o,a.onerror=function(e){return o(),i.close(),r(u.error)}},u.onerror=function(e){return i.close(),r(u.error)},o.oncomplete=function(){null==n?i.close():n.oncomplete=function(){return i.close()}}},a.onerror=function(e){return r(a.error)}})));case 2:case"end":return e.stop()}var r}),e)})));return function(t){return e.apply(this,arguments)}}()}]),e}(),C=n(2),M="tensorflowjs_models",A="info",N="model_topology",R="weight_specs",I="weight_data",L="model_metadata";function D(e){return{info:[M,e,A].join("/"),topology:[M,e,N].join("/"),weightSpecs:[M,e,R].join("/"),weightData:[M,e,I].join("/"),modelMetadata:[M,e,L].join("/")}}function P(e){var t=e.split("/");if(t.length<3)throw new Error("Invalid key format: ".concat(e));return t.slice(1,t.length-1).join("/")}var z=function(){function e(t){if(Object(h.a)(this,e),!Object(f.c)().getBool("IS_BROW
2SER")||"undefined"===typeof window||"undefined"===typeof window.localStorage)throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,null==t||!t)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=t,this.keys=D(this.modelPath)}return Object(d.a)(e,[{key:"save",value:function(){var e=Object(g.a)(v.a.mark((function e(t){var n,r,a;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.modelTopology instanceof ArrayBuffer)){e.next=4;break}throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");case 4:return n=JSON.stringify(t.modelTopology),r=JSON.stringify(t.weightSpecs),a=Object(b.g)(t),e.prev=7,this.LS.setItem(this.keys.info,JSON.stringify(a)),this.LS.setItem(this.keys.topology,n),this.LS.setItem(this.keys.weightSpecs,r),this.LS.setItem(this.keys.weightData,Object(b.a)(t.weightData)),this.LS.setItem(this.keys.modelMetadata,JSON.stringify({format:t.format,generatedBy:t.generatedBy,convertedBy:t.convertedBy,userDefinedMetadata:t.userDefinedMetadata})),e.abrupt("return",{modelArtifactsInfo:a});case 16:throw e.prev=16,e.t0=e.catch(7),this.LS.removeItem(this.keys.info),this.LS.removeItem(this.keys.topology),this.LS.removeItem(this.keys.weightSpecs),this.LS.removeItem(this.keys.weightData),this.LS.removeItem(this.keys.modelMetadata),new Error("Failed to save model '".concat(this.modelPath,"' to local storage: ")+"size quota being exceeded is a possible cause of this failure: "+"modelTopologyBytes=".concat(a.modelTopologyBytes,", ")+"weightSpecsBytes=".concat(a.weightSpecsBytes,", ")+"weightDataBytes=".concat(a.weightDataBytes,"."));case 24:case"end":return e.stop()}}),e,this,[[7,16]])})));return function(t){return e.apply(this,arguments)}}()},{key:"load",value:function(){var e=Object(g.a)(v.a.mark((function e(){var t,n,r,a,i,o,s;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(t=JSON.parse(this.LS.getItem(this.keys.info)))){e.next=3;break}throw new Error("In local storage, there is no model with name '".concat(this.modelPath,"'"));case 3:if("JSON"===t.modelTopologyType){e.next=5;break}throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");case 5:if(n={},null!=(r=JSON.parse(this.LS.getItem(this.keys.topology)))){e.next=9;break}throw new Error("In local storage, the topology of model '".concat(this.modelPath,"' ")+"is missing.");case 9:if(n.modelTopology=r,null!=(a=JSON.parse(this.LS.getItem(this.keys.weightSpecs)))){e.next=13;break}throw new Error("In local storage, the weight specs of model '".concat(this.modelPath,"' ")+"are missing.");case 13:if(n.weightSpecs=a,null!=(i=this.LS.getItem(this.keys.modelMetadata))&&(o=JSON.parse(i),n.format=o.format,n.generatedBy=o.generatedBy,n.convertedBy=o.convertedBy,n.userDefinedMetadata=o.userDefinedMetadata),null!=(s=this.LS.getItem(this.keys.weightData))){e.next=19;break}throw new Error("In local storage, the binary weight values of model "+"'".concat(this.modelPath,"' are missing."));case 19:return n.weightData=Object(b.b)(s),e.abrupt("return",n);case 21:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}();z.URL_SCHEME="localstorage://";var F=function(e){return Object(f.c)().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(z.URL_SCHEME)?(t=e.slice(z.URL_SCHEME.length),new z(t)):null;var t};y.registerSaveRouter(F),y.registerLoadRouter(F);var B=function(){function e(){Object(h.a)(this,e),Object(C.assert)(Object(f.c)().getBool("IS_BROWSER"),(function(){return"Current environment is not a web browser"})),Object(C.assert)("undefined"===typeof window||"undefined"!==typeof window.localStorage,(function(){return"Current browser does not appear to support localStorage"})),this.LS=window.localStorage}return Object(d.a)(e,[{key:"listModels",value:function(){var e=Object(g.a)(v.a.mark((function e(){var t,n,r,a,i,o;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t={},n=M+"/",r="/"+A,a=0;a<this.LS.length;++a)(i=this.LS.key(a)).startsWith(n)&&i.endsWith(r)&&(o=P(i),t[o]=JSON.parse(this.LS.getItem(i)));return e.abrupt("return",t);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"removeModel",value:function(){var e=Object(g.a)(v.a.mark((function e(t){var n,r;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(a=t).startsWith(z.URL_SCHEME)?a.slice(z.URL_SCHEME.length):a,n=D(t),null!=this.LS.getItem(n.info)){e.next=4;break}throw new Error("Cannot find model at path '".concat(t,"'"));case 4:return r=JSON.parse(this.LS.getItem(n.info)),this.LS.removeItem(n.info),this.LS.removeItem(n.topology),this.LS.removeItem(n.weightSpecs),this.LS.removeItem(n.weightData),e.abrupt("return",r);case 10:case"end":return e.stop()}var a}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}(),U=function(){function e(){Object(h.a)(this,e),this.managers={}}return Object(d.a)(e,null,[{key:"getInstance",value:function(){return null==e.instance&&(e.instance=new e),e.instance}},{key:"registerManager",value:function(t,n){Object(C.assert)(null!=t,(function(){return"scheme must not be undefined or null."}
2)),t.endsWith("://")&&(t=t.slice(0,t.indexOf("://"))),Object(C.assert)(t.length>0,(function(){return"scheme must not be an empty string."}));var r=e.getInstance();Object(C.assert)(null==r.managers[t],(function(){return"A model store manager is already registered for scheme '".concat(t,"'.")})),r.managers[t]=n}},{key:"getManager",value:function(e){var t=this.getInstance().managers[e];if(null==t)throw new Error("Cannot find model manager for scheme '".concat(e,"'"));return t}},{key:"getSchemes",value:function(){return Object.keys(this.getInstance().managers)}}]),e}();function W(e){if(-1===e.indexOf("://"))throw new Error("The url string provided does not contain a scheme. Supported schemes are: "+"".concat(U.getSchemes().join(",")));return{scheme:e.split("://")[0],path:e.split("://")[1]}}function V(e,t){return G.apply(this,arguments)}function G(){return(G=Object(g.a)(v.a.mark((function e(t,n){var r,a,i,o,s,u,c,l,h,d,f=arguments;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=f.length>2&&void 0!==f[2]&&f[2],Object(C.assert)(t!==n,(function(){return"Old path and new path are the same: '".concat(t,"'")})),a=y.getLoadHandlers(t),Object(C.assert)(a.length>0,(function(){return"Copying failed because no load handler is found for source URL ".concat(t,".")})),Object(C.assert)(a.length<2,(function(){return"Copying failed because more than one (".concat(a.length,") ")+"load handlers for source URL ".concat(t,".")})),i=a[0],o=y.getSaveHandlers(n),Object(C.assert)(o.length>0,(function(){return"Copying failed because no save handler is found for destination "+"URL ".concat(n,".")})),Object(C.assert)(o.length<2,(function(){return"Copying failed because more than one (".concat(a.length,") ")+"save handlers for destination URL ".concat(n,".")})),s=o[0],u=W(t).scheme,c=W(t).path,l=u===W(t).scheme,e.next=15,i.load();case 15:if(h=e.sent,!r||!l){e.next=19;break}return e.next=19,U.getManager(u).removeModel(c);case 19:return e.next=21,s.save(h);case 21:if(d=e.sent,!r||l){e.next=25;break}return e.next=25,U.getManager(u).removeModel(c);case 25:return e.abrupt("return",d.modelArtifactsInfo);case 26:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function H(){return q.apply(this,arguments)}function q(){return(q=Object(g.a)(v.a.mark((function e(){var t,n,r,a,i,o,s;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=U.getSchemes(),n={},r=Object(p.a)(t),e.prev=3,r.s();case 5:if((a=r.n()).done){e.next=13;break}return i=a.value,e.next=9,U.getManager(i).listModels();case 9:for(s in o=e.sent)n[i+"://"+s]=o[s];case 11:e.next=5;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(3),r.e(e.t0);case 18:return e.prev=18,r.f(),e.finish(18);case 21:return e.abrupt("return",n);case 22:case"end":return e.stop()}}),e,null,[[3,15,18,21]])})))).apply(this,arguments)}function X(e){return Y.apply(this,arguments)}function Y(){return(Y=Object(g.a)(v.a.mark((function e(t){var n,r;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=W(t),r=U.getManager(n.scheme),e.abrupt("return",r.removeModel(n.path));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function K(e,t){return Z.apply(this,arguments)}function Z(){return(Z=Object(g.a)(v.a.mark((function e(t,n){return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return!1,e.abrupt("return",V(t,n,!1));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function J(e,t){return Q.apply(this,arguments)}function Q(){return(Q=Object(g.a)(v.a.mark((function e(t,n){return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return!0,e.abrupt("return",V(t,n,!0));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var $=function(){function e(){Object(h.a)(this,e)}return Object(d.a)(e,[{key:"fetch",value:function(e){function t(t,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t){return fetch(e,t)}))},{key:"now",value:function(){return performance.now()}},{key:"encode",value:function(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error("Browser's encoder only supports utf-8, but got ".concat(t));return null==this.textEncoder&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)}},{key:"decode",value:function(e,t){return new TextDecoder(t).decode(e)}}]),e}();
2if(Object(f.c)().get("IS_BROWSER")){Object(f.c)().setPlatform("browser",new $);try{U.registerManager(z.URL_SCHEME,new B)}catch(_o){}try{U.registerManager(j.URL_SCHEME,new T)}catch(_o){}}n(349);var ee=n(61),te=n(20),ne=n(89),re=n(185),ae=n(12);Object(l.b)();var ie={buffer:ee.a,cast:te.a,clone:ne.a,print:re.a};Object(ae.e)(ie);var oe=n(19);function se(e){return new Promise((function(e){return setTimeout(e)})).then(e)}var ue=function(){function e(t){if(Object(h.a)(this,e),!Object(f.c)().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");t.startsWith(e.URL_SCHEME)&&(t=t.slice(e.URL_SCHEME.length)),null!=t&&0!==t.length||(t="model"),this.modelTopologyFileName=t+".json",this.weightDataFileName=t+".weights.bin"}return Object(d.a)(e,[{key:"save",value:function(){var e=Object(g.a)(v.a.mark((function e(t){var n,r,a,i,o,s;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!==typeof document){e.next=2;break}throw new Error("Browser downloads are not supported in this environment since `document` is not present");case 2:if(n=window.URL.createObjectURL(new Blob([t.weightData],{type:"application/octet-stream"})),!(t.modelTopology instanceof ArrayBuffer)){e.next=7;break}throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");case 7:return r=[{paths:["./"+this.weightDataFileName],weights:t.weightSpecs}],a={modelTopology:t.modelTopology,format:t.format,generatedBy:t.generatedBy,convertedBy:t.convertedBy,weightsManifest:r},i=window.URL.createObjectURL(new Blob([JSON.stringify(a)],{type:"application/json"})),(o=null==this.jsonAnchor?document.createElement("a"):this.jsonAnchor).download=this.modelTopologyFileName,o.href=i,e.next=15,se((function(){return o.dispatchEvent(new MouseEvent("click"))}));case 15:if(null==t.weightData){e.next=21;break}return(s=null==this.weightDataAnchor?document.createElement("a"):this.weightDataAnchor).download=this.weightDataFileName,s.href=n,e.next=21,se((function(){return s.dispatchEvent(new MouseEvent("click"))}));case 21:return e.abrupt("return",{modelArtifactsInfo:Object(b.g)(t)});case 22:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();ue.URL_SCHEME="downloads://";var ce=function(){function e(t){if(Object(h.a)(this,e),null==t||t.length<1)throw new Error("When calling browserFiles, at least 1 file is required, "+"but received ".concat(t));this.files=t}return Object(d.a)(e,[{key:"load",value:function(){var e=Object(g.a)(v.a.mark((function e(){var t,n,r=this;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.files[0],n=this.files.slice(1),e.abrupt("return",new Promise((function(e,a){var i=new FileReader;i.onload=function(i){var o=JSON.parse(i.target.result),s=o.modelTopology;if(null!=s){0===n.length&&e({modelTopology:s});var u=o.weightsManifest;if(null!=u){var c;try{c=r.checkManifestAndWeightFiles(u,n)}catch(_o){return void a(_o)}var l=[],h=[],d=[];u.forEach((function(e){e.paths.forEach((function(e){h.push(e),d.push(null)})),l.push.apply(l,Object(oe.a)(e.weights))})),u.forEach((function(t){t.paths.forEach((function(t){var n=new FileReader;n.onload=function(n){var r=n.target.result,a=h.indexOf(t);d[a]=r,-1===d.indexOf(null)&&e({modelTopology:s,weightSpecs:l,weightData:Object(b.d)(d),format:o.format,generatedBy:o.generatedBy,convertedBy:o.convertedBy,userDefinedMetadata:o.userDefinedMetadata})},n.onerror=function(e){return a("Failed to weights data from file of path '".concat(t,"'."))},n.readAsArrayBuffer(c[t])}))}))}else a(new Error("weightManifest field is missing from file ".concat(t.name)))}else a(new Error("modelTopology field is missing from file ".concat(t.name)))},i.onerror=function(e){return a("Failed to read model topology and weights manifest JSON "+"from file '".concat(t.name,"'. BrowserFiles supports loading ")+"Keras-style tf.Model artifacts only.")},i.readAsText(t)})));case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"checkManifestAndWeightFiles",value:function(e,t){var n,r=[],a=t.map((function(e){return Object(b.c)(e.name)})),i={},o=Object(p.a)(e);try{for(o.s();!(n=o.n()).done;){n.value.paths.forEach((function(e){var n=Object(b.c)(e);if(-1!==r.indexOf(n))throw new Error("Duplicate file basename found in weights manifest: "+"'".concat(n,"'"));if(r.push(n),-1===a.indexOf(n))throw new Error("Weight file with basename '".concat(n,"' is not provided."));i[e]=t[a.indexOf(n)]}))}}catch(_o){o.e(_o)}finally{o.f()}if(r.length!==t.length)throw new Error("Mismatch in the number of files in weights manifest "+"(".concat(r.length,") and the number of weight files provided ")+"(".concat(t.length,")."));return i}}]),e}();function le(e){return new ce(e)}y.registerSaveRouter((function(e){return Object(f.c)().getBool("IS_BROW
2SER")&&!Array.isArray(e)&&e.startsWith(ue.URL_SCHEME)?function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"model";return new ue(e)}(e.slice(ue.URL_SCHEME.length)):null}));var he=n(8);function de(e,t,n,r){!function(e){Object(C.assert)(null!=e&&Array.isArray(e)&&e.length>0,(function(){return"promises must be a none empty array"}))}(e),function(e,t){Object(C.assert)(e>=0&&e<=1,(function(){return"Progress fraction must be in range [0, 1], but "+"got startFraction ".concat(e)})),Object(C.assert)(t>=0&&t<=1,(function(){return"Progress fraction must be in range [0, 1], but "+"got endFraction ".concat(t)})),Object(C.assert)(t>=e,(function(){return"startFraction must be no more than endFraction, but "+"got startFraction ".concat(e," and endFraction ")+"".concat(t)}))}(n=null==n?0:n,r=null==r?1:r);var a=0;return Promise.all(e.map((function(i){return i.then((function(i){var o=n+ ++a/e.length*(r-n);return t(o),i})),i})))}var fe=n(178);function pe(e,t){return me.apply(this,arguments)}function me(){return(me=Object(g.a)(v.a.mark((function e(t,n){var r,a,i,o,s,u,c,l,h;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==n&&(n={}),r=null==n.fetchFunc?Object(f.c)().platform.fetch:n.fetchFunc,a=t.map((function(e){return r(e,n.requestInit,{isBinary:!0})})),i=0,o=.5,null!=n.onProgress){e.next=11;break}return e.next=8,Promise.all(a);case 8:e.t0=e.sent,e.next=14;break;case 11:return e.next=13,de(a,n.onProgress,i,o);case 13:e.t0=e.sent;case 14:if(s=e.t0,u=s.map((function(e){return e.arrayBuffer()})),c=.5,l=1,null!=n.onProgress){e.next=24;break}return e.next=21,Promise.all(u);case 21:e.t1=e.sent,e.next=27;break;case 24:return e.next=26,de(u,n.onProgress,c,l);case 26:e.t1=e.sent;case 27:return h=e.t1,e.abrupt("return",h);case 29:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ve(e){return ge.apply(this,arguments)}function ge(){return(ge=Object(g.a)(v.a.mark((function e(t){var n,r,a,i,o=arguments;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:"",r=o.length>2?o[2]:void 0,a=o.length>3?o[3]:void 0,i=be((function(e){return pe(e,{requestInit:a})})),e.abrupt("return",i(t,n,r));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function be(e){return function(){var t=Object(g.a)(v.a.mark((function t(n){var r,a,i,o,s,u,c,l,h,d,f,p,m=arguments;return v.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=m.length>1&&void 0!==m[1]?m[1]:"",a=m.length>2?m[2]:void 0,i=n.map((function(){return!1})),o={},s=null!=a?a.map((function(){return!1})):[],u=[],n.forEach((function(e,t){var n=0;e.weights.forEach((function(e){var r="quantization"in e?e.quantization.dtype:e.dtype,c=fe.a[r]*C.sizeFromShape(e.shape),l=function(){i[t]=!0,null==o[t]&&(o[t]=[]),o[t].push({manifestEntry:e,groupOffset:n,sizeBytes:c})};null!=a?a.forEach((function(t,n){t===e.name&&(l(),s[n]=!0)})):l(),u.push(e.name),n+=c}))})),s.every((function(e){return e}))){t.next=10;break}throw c=a.filter((function(e,t){return!s[t]})),new Error("Could not find weights in manifest with names: "+"".concat(c.join(", "),". \n")+"Manifest JSON has weights with names: "+"".concat(u.join(", "),"."));case 10:return l=i.reduce((function(e,t,n){return t&&e.push(n),e}),[]),h=[],l.forEach((function(e){n[e].paths.forEach((function(e){var t=r+(r.endsWith("/")?"":"/")+e;h.push(t)}))})),t.next=15,e(h);case 15:return d=t.sent,f={},p=0,l.forEach((function(e){for(var t=n[e].paths.length,r=0,a=0;a<t;a++)r+=d[p+a].byteLength;for(var i=new ArrayBuffer(r),s=new Uint8Array(i),u=0,c=0;c<t;c++){var l=new Uint8Array(d[p+c]);s.set(l,u),u+=l.byteLength}o[e].forEach((function(e){var t=i.slice(e.groupOffset,e.groupOffset+e.sizeBytes),n=Object(b.e)(t,[e.manifestEntry]);for(var r in n)f[r]=n[r]})),p+=t})),t.abrupt("return",f);case 20:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}var ye=function(){function e(t,n){if(Object(h.a)(this,e),this.DEFAULT_METHOD="POST",null==n&&(n={}),this.weightPathPrefix=n.weightPathPrefix,this.onProgress=n.onProgress,this.weightUrlConverter=n.weightUrlConverter,null!=n.fetchFunc?(Object(C.assert)("function"===typeof n.fetchFunc,(function(){return"Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)"})),this.fetch=n.fetchFunc):this.fetch=Object(f.c)().platform.fetch,Object(C.assert)(null!=t&&t.length>0,(function(){return"URL path for http must not be null, undefined or empty."})),Array.isArray(t)&&Object(C.assert)(2===t.length,(function(){return"URL paths for http must have a length of 2, "+"(actual length is ".concat(t.length,").")})),this.path=t,null!=n.requestInit&&null!=n.requestInit.body)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=n.requestInit||{}}return Object(d.a)(e,[{key:"save",value:function(){var e=Object(g.a)(v.a.mark((function e(t){var n,r,a,i;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.modelTopology instanceof ArrayBuffer)){e.next=2;break}throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");case 2:return(n=Object.assign({method:this.DEFAULT_METHOD},this.requestInit)).body=new FormData,r=[{paths:["./model.weights.bin"],weights:t.
2weightSpecs}],a={modelTopology:t.modelTopology,format:t.format,generatedBy:t.generatedBy,convertedBy:t.convertedBy,userDefinedMetadata:t.userDefinedMetadata,weightsManifest:r},n.body.append("model.json",new Blob([JSON.stringify(a)],{type:"application/json"}),"model.json"),null!=t.weightData&&n.body.append("model.weights.bin",new Blob([t.weightData],{type:"application/octet-stream"}),"model.weights.bin"),e.next=10,this.fetch(this.path,n);case 10:if(!(i=e.sent).ok){e.next=15;break}return e.abrupt("return",{modelArtifactsInfo:Object(b.g)(t),responses:[i]});case 15:throw new Error("BrowserHTTPRequest.save() failed due to HTTP response status "+"".concat(i.status,"."));case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"load",value:function(){var e=Object(g.a)(v.a.mark((function e(){var t,n,r,a,i,o,s,u,c,l,h,d,f;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.fetch(this.path,this.requestInit);case 2:if((t=e.sent).ok){e.next=5;break}throw new Error("Request to ".concat(this.path," failed with status code ")+"".concat(t.status,". Please verify this URL points to ")+"the model JSON of the model to load.");case 5:return e.prev=5,e.next=8,t.json();case 8:n=e.sent,e.next=16;break;case 11:throw e.prev=11,e.t0=e.catch(5),r="Failed to parse model JSON of response from ".concat(this.path,"."),this.path.endsWith(".pb")?r+=" Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository.":r+=" Please make sure the server is serving valid JSON for this request.",new Error(r);case 16:if(a=n.modelTopology,i=n.weightsManifest,o=n.generatedBy,s=n.convertedBy,u=n.format,c=n.userDefinedMetadata,null!=a||null!=i){e.next=24;break}throw new Error("The JSON from HTTP path ".concat(this.path," contains
2neither model ")+"topology or manifest for weights.");case 24:if(null==i){e.next=31;break}return e.next=27,this.loadWeights(i);case 27:d=e.sent,f=Object(he.a)(d,2),l=f[0],h=f[1];case 31:return e.abrupt("return",{modelTopology:a,weightSpecs:l,weightData:h,userDefinedMetadata:c,generatedBy:o,convertedBy:s,format:u});case 32:case"end":return e.stop()}}),e,this,[[5,11]])})));return function(){return e.apply(this,arguments)}}()},{key:"loadWeights",value:function(){var e=Object(g.a)(v.a.mark((function e(t){var n,r,a,i,o,s,u,c,l,h,d,f,m,g,y,x,w,O,k;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Array.isArray(this.path)?this.path[1]:this.path,r=xe(n),a=Object(he.a)(r,2),i=a[0],o=a[1],s=this.weightPathPrefix||i,u=[],c=Object(p.a)(t);try{for(c.s();!(l=c.n()).done;)h=l.value,u.push.apply(u,Object(oe.a)(h.weights))}catch(_o){c.e(_o)}finally{c.f()}d=[],f=[],m=Object(p.a)(t);try{for(m.s();!(g=m.n()).done;){y=g.value,x=Object(p.a)(y.paths);try{for(x.s();!(w=x.n()).done;)O=w.value,null!=this.weightUrlConverter?f.push(this.weightUrlConverter(O)):d.push(s+O+o)}catch(_o){x.e(_o)}finally{x.f()}}}catch(_o){m.e(_o)}finally{m.f()}if(!this.weightUrlConverter){e.next=19;break}return e.t0=d.push,e.t1=d,e.t2=oe.a,e.next=16,Promise.all(f);case 16:e.t3=e.sent,e.t4=(0,e.t2)(e.t3),e.t0.apply.call(e.t0,e.t1,e.t4);case 19:return e.next=21,pe(d,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress});case 21:return k=e.sent,e.abrupt("return",[u,Object(b.d)(k)]);case 23:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();function xe(e){var t=e.lastIndexOf("/"),n=e.lastIndexOf("?");return[e.substring(0,t)+"/",n>t?e.substring(n):""]}function we(e){return null!=e.match(ye.URL_SCHEME_REGEX)}ye.URL_SCHEME_REGEX=/^https?:\/\//;var Oe=function(e,t){if("undefined"===typeof fetch&&(null==t||null==t.fetchFunc))return null;return(Array.isArray(e)?e.every((function(e){return we(e)})):we(e))?ke(e,t):null};function ke(e,t){return new ye(e,t)}function Se(e,t){return ke(e,t)}y.registerSaveRouter(Oe),y.registerLoadRouter(Oe);var _e=function(){function e(t){Object(h.a)(this,e),this.modelArtifacts=t}return Object(d.a)(e,[{key:"load",value:function(){var e=Object(g.a)(v.a.mark((function e(){return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.modelArtifacts);case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}(),je=function(){function e(t){Object(h.a)(this,e),this.saveHandler=t}return Object(d.a)(e,[{key:"save",value:function(){var e=Object(g.a)(v.a.mark((function e(t){return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.saveHandler(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();function Ee(e,t,n,r){if(1===arguments.length){var a=null!=e.modelTopology||null!=e.weightSpecs;return a?new _e(e):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new _e({modelTopology:e}))}return console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new _e({modelTopology:e,weightSpecs:t,weightData:n,trainingConfig:r})}function Te(e){return new je(e)}var Ce=n(4),Me=n(43),Ae=n(136),Ne=n(9),Re=n(45);var Ie,Le=Object(Ne.b)({confusionMatrix_:function(e,t,n){var r=Object(Ce.a)(e,"labels","confusionMatrix"),a=Object(Ce.a)(t,"predictions","confusionMatrix");C.assert(null==n||n>0&&Number.isInteger(n),(function(){return"If provided, numClasses must be a positive integer, "+"but got ".concat(n)})),C.assert(1===r.rank,(function(){return"Expected the rank of labels to be 1, but got ".concat(r.rank)})),C.assert(1===a.rank,(function(){return"Expected the rank of predictions to be 1, "+"but got ".concat(a.rank)})),C.assert(r.shape[0]===a.shape[0],(function(){return"Mismatch in the number of examples: "+"".concat(r.shape[0]," vs. ").concat(a.shape[0],". ")+"Labels and predictions should have the same number of elements."})),C.assert(n>0&&Number.isInteger(n),(function(){return"numClasses is required to be a positive integer, but got "+"".concat(n)}));var i=Object(Ae.a)(Object(te.a)(r,"int32"),n),o=Object(Ae.a)(Object(te.a)(a,"int32"),n),s=Object(Re.a)(i);return Object(te.a)(Object(Me.a)(s,o),"int32")}}),De=n(7),Pe=n(91),ze=n(215);function Fe(e,t){return Be.apply(this,arguments)}function Be(){return(Be=Object(g.a)(v.a.mark((function e(t,n){var r,a,i,o,s,u,c,l,h,d,f,p,m,g,b,y,x;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Object(Ce.a)(t,"img","toPixels"),t instanceof ae.a||(a=r,r=Object(te.a)(a,"int32"),a.dispose()),2===r.rank||3===r.rank){e.next=4;break}throw new Error("toPixels only supports rank 2 or 3 tensors, got rank ".concat(r.rank,"."));case 4:if(i=r.shape.slice(0,2),o=Object(he.a)(i,2),s=o[0],u=o[1],!((c=2===r.rank?1:r.shape[2])>4||2===c)){e.next=8;break}throw new Error("toPixels only supports depth of size "+"1, 3 or 4 but got ".concat(c));case 8:if("float32"===r.dtype||"int32"===r.dtype){e.next=10;break}throw new Error("Unsupported type for toPixels: ".concat(r.dtype,".")+" Please use float32 or int32 tensors.");case 10:return e.next=12,r.data();case 12:l=e.sent,h="float32"===r.dtype?255:1,d=new Uint8ClampedArray(u*s*4),f=0;case 16:if(!(f<s*u)){e.next=41;break}p=[0,0,0,255],m=0;case 19:if(!(m<c)){e.next=33;break}if(g=l[f*c+m],"float32"!==r.dtype){e.next=26;break}if(!(g<0||g>
21)){e.next=24;break}throw new Error("Tensor values for a float32 Tensor must be in the "+"range [0 - 1] but encountered ".concat(g,"."));case 24:e.next=29;break;case 26:if("int32"!==r.dtype){e.next=29;break}if(!(g<0||g>255)){e.next=29;break}throw new Error("Tensor values for a int32 Tensor must be in the "+"range [0 - 255] but encountered ".concat(g,"."));case 29:1===c?(p[0]=g*h,p[1]=g*h,p[2]=g*h):p[m]=g*h;case 30:m++,e.next=19;break;case 33:d[(b=4*f)+0]=Math.round(p[0]),d[b+1]=Math.round(p[1]),d[b+2]=Math.round(p[2]),d[b+3]=Math.round(p[3]);case 38:++f,e.next=16;break;case 41:return null!=n&&(n.width=u,n.height=s,y=n.getContext("2d"),x=new ImageData(d,u,s),y.putImageData(x,0,0)),r!==t&&r.dispose(),e.abrupt("return",d);case 44:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ue=Object(Ne.b)({fromPixels_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;if(t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(null==e)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");var n=!1,r=!1,a=!1,i=!1,o=!1;if(e.data instanceof Uint8Array)n=!0;else if("undefined"!==typeof ImageData&&e instanceof ImageData)r=!0;else if("undefined"!==typeof HTMLVideoElement&&e instanceof HTMLVideoElement)a=!0;else if("undefined"!==typeof HTMLImageElement&&e instanceof HTMLImageElement)i=!0;else{if(null==e.getContext)throw new Error("pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, "+"but was ".concat(e.constructor.name));o=!0}if(a){var s=2;if(a&&e.readyState<s)throw new Error("The video element has not loaded data yet. Please wait for `loadeddata` event on the <video> element.")}var u=Object(Pe.b)(De.eb,l.a.backendName);if(null!=u){var c={pixels:e},h={numChannels:t};return l.a.runKernel(De.eb,c,h)}var d,f,p=a?[e.videoWidth,e.videoHeight]:[e.width,e.height],m=Object(he.a)(p,2),v=m[0],g=m[1];if(o?d=e.getContext("2d").getImageData(0,0,v,g).data:r||n?d=e.data:(i||a)&&(null==Ie&&(Ie=document.createElement("canvas").getContext("2d")),Ie.canvas.width=v,Ie.canvas.height=g,Ie.drawImage(e,0,0,v,g),d=Ie.getImageData(0,0,v,g).data),4===t)f=new Int32Array(d);else{var b=v*g;f=new Int32Array(b*t);for(var y=0;y<b;y++)for(var x=0;x<t;++x)f[y*t+x]=d[4*y+x]}var w=[g,v,t];return Object(ze.a)(f,w,"int32")}});function We(e,t){if(e.rank<1)throw new Error("tf.gatherND() expects the input to be rank 1 or higher,"+" but the rank was ".concat(e.rank,"."));if(t.rank<1)throw new Error("tf.gatherND() expects the indices to be rank 1 or higher,"+" but the rank was ".concat(t.rank,"."));if("int32"!==t.dtype)throw new Error("tf.gatherND() expects the indices to be int32 type,"+" but the dtype was ".concat(t.dtype,"."));if(t.shape[t.rank-1]>e.rank)throw new Error("index innermost dimension length must be <= tensor rank; saw: "+"".concat(t.shape[t.rank-1]," vs. ").concat(e.rank));if(0===e.size)throw new Error("Requested more than 0 entries, but input is empty."+" Input shape: ".concat(e.shape,"."));for(var n=t.shape,r=n[n.length-1],a=1,i=0;i<n.length-1;++i)a*=n[i];var o=e.shape,s=n.slice();s.pop();for(var u=1,c=r;c<e.rank;++c)u*=o[c],s.push(o[c]);var l=[].concat(Object(oe.a)(Object(C.computeStrides)(e.shape).map((function(e){return e/u}))),[1]).slice(0,r);return[s,a,u,l]}var Ve=n(142),Ge=n(75),He=function(){function e(){Object(h.a)(this,e)}return Object(d.a)(e,[{key:"getClassName",value:function(){return this.constructor.className}}],[{key:"fromConfig",value:function(e,t){return new e(t)}}]),e}(),qe=function(){function e(){Object(h.a)(this,e),this.classNameMap={}}return Object(d.a)(e,null,[{key:"getMap",value:function(){return null==e.instance&&(e.instance=new e),e.instance}},{key:"register",value:function(t){e.getMap().classNameMap[t.className]=[t,t.fromConfig]}}]),e}();function Xe(e){Object(C.assert)(null!=e.className,(function(){return"Class being registered does not have the static className property defined."})),Object(C.assert)("string"===typeof e.className,(function(){return"className is required to be a string, but got type "+typeof e.className})),Object(C.assert)(e.className.length>0,(function(){return"Class being registered has an empty-string as its className, which is disallowed."})),qe.register(e)}var Ye=n(36),Ke=n(164),Ze="2.4.0",Je=n(15),Qe=n(16),$e=n(32),et=n(25),tt=n(28),nt=n(17),rt=n(58),at=n(40),it=n(34),ot=n(55),st=n(27),ut=function(e){Object(Je.a)(n,e);var t=Object(Qe.a)(n);function n(){return Object(h.a)(this,n),t.apply(this,arguments)}return Object(d.a)(n,[{key:"minimize",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,r=this.computeGradients(e,n),a=r.value,i=r.grads;if(null!=n){var o=n.map((function(e){return{name:e.name,tensor:i[e.name]}}));this.applyGradients(o)}else this.applyGradients(i);return Object($e.d)(i),t?a:(a.dispose(),null)}},{key:"incrementIterations",value:function(){this.iterations_=this.iterations+1}},{key:"computeGradients",value:function(e,t){return Object(ot.f)(e,t)}},{key:"dispose",value:function(){null!=this.iterations_&&Object($e.d)(this.iterations_)}},{key:"saveIterations",value:function(){var e=Object(g.a)(v.a.mark((function e(){return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return null==this.iterations_&&(this.iterations_=0),e.abrupt("return",{name:"iter",tensor:Object(st.a)(this.iterations_,"int32")});case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getWeights",value:function(){var e=Object(g.a)(v.a.mark((function e(){return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("getWeights() is not implemented for this optimizer yet.");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"setWeights",value:function(){var e=Object(g.a)(v.a.mark((function e(t){return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("setWeights() is not implemented for this optimizer class "+"".concat(this.getClassName()));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"extractIterations",value:function(){var e=Object(g.a)(v.a.mark((function e(t){return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t[0].tensor.data();case 2:return this.iterations_=e.sent[0],e.abrupt("return",t.slice(1));case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"iterations",get:function(){return null==this.iterations_&&(this.iterations_=0),this.iterations_}}]),n}(He);Object.defineProperty(ut,Symbol.hasInstance,{value:function(e){return null!=e.minimize&&null!=e.computeGradients&&null!=e.applyGradients}});var ct=function(e){Object(Je.a)(n,e);var t=Object(Qe.a)(n);function n(e,r){var a,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Object(h.a)(this,n),(a=t.call(this)).learningRate=e,a.rho=r,a.epsilon=i,a.accumulatedGrads=[],a.accumulatedUpdates=[],null==i&&(a.epsilon=l.a.backend.epsilon()),a}return Object(d.a)(n,[{key:"applyGradients",value:function(e){var t=this;(Array.isArray(e)?e.map((function(e){return e.name}
2)):Object.keys(e)).forEach((function(n,r){var a=l.a.registeredVariables[n];null==t.accumulatedGrads[r]&&(t.accumulatedGrads[r]={originalName:"".concat(n,"/accum_grad"),variable:Object($e.t)((function(){return Object(it.a)(a).variable(!1)}))}),null==t.accumulatedUpdates[r]&&(t.accumulatedUpdates[r]={originalName:"".concat(n,"/accum_var"),variable:Object($e.t)((function(){return Object(it.a)(a).variable(!1)}))});var i=Array.isArray(e)?e[r].tensor:e[n];if(null!=i){var o=t.accumulatedGrads[r].variable,s=t.accumulatedUpdates[r].variable;Object($e.t)((function(){var e=Object(et.a)(Object(nt.a)(o,t.rho),Object(nt.a)(Object(at.a)(i),1-t.rho)),n=Object(nt.a)(Object(tt.a)(Object(rt.a)(Object(et.a)(s,t.epsilon)),Object(rt.a)(Object(et.a)(o,t.epsilon))),i),r=Object(et.a)(Object(nt.a)(s,t.rho),Object(nt.a)(Object(at.a)(n),1-t.rho));o.assign(e),s.assign(r);var u=Object(et.a)(Object(nt.a)(n,-t.learningRate),a);a.assign(u)}))}})),this.incrementIterations()}},{key:"dispose",value:function(){null!=this.accumulatedUpdates&&(Object($e.d)(this.accumulatedGrads.map((function(e){return e.variable}))),Object($e.d)(this.accumulatedUpdates.map((function(e){return e.variable}))))}},{key:"getWeights",value:function(){var e=Object(g.a)(v.a.mark((function e(){var t;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[].concat(Object(oe.a)(this.accumulatedGrads),Object(oe.a)(this.accumulatedUpdates)),e.next=3,this.saveIterations();case 3:return e.t0=e.sent,e.abrupt("return",[e.t0].concat(t.map((function(e){return{name:e.originalName,tensor:e.variable}}))));case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setWeights",value:function(){var e=Object(g.a)(v.a.mark((function e(t){var n;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.extractIterations(t);case 2:t=e.sent,n=t.length/2,!1,this.accumulatedGrads=t.slice(0,n).map((function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}})),this.accumulatedUpdates=t.slice(n,2*n).map((function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}}));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getConfig",value:function(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}}],[{key:"fromConfig",value:function(e,t){return new e(t.learningRate,t.rho,t.epsilon)}}]),n}(ut);ct.className="Adadelta",Xe(ct);var lt=n(144),ht=function(e){Object(Je.a)(n,e);var t=Object(Qe.a)(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.1;return Object(h.a)(this,n),(r=t.call(this)).learningRate=e,r.initialAccumulatorValue=a,r.accumulatedGrads=[],r}return Object(d.a)(n,[{key:"applyGradients",value:function(e){var t=this;(Array.isArray(e)?e.map((function(e){return e.name})):Object.keys(e)).forEach((function(n,r){var a=l.a.registeredVariables[n];if(null==t.accumulatedGrads[r]){t.accumulatedGrads[r]={originalName:"".concat(n,"/accumulator"),variable:Object($e.t)((function(){return Object(lt.a)(a.shape,t.initialAccumulatorValue).variable(!1)}))}}var i=Array.isArray(e)?e[r].tensor:e[n];if(null!=i){var o=t.accumulatedGrads[r].variable;Object($e.t)((function(){var e=Object(et.a)(o,Object(at.a)(i));o.assign(e);var n=Object(et.a)(Object(nt.a)(Object(tt.a)(i,Object(rt.a)(Object(et.a)(e,l.a.backend.epsilon()))),-t.learningRate),a);a.assign(n)}))}})),this.incrementIterations()}},{key:"dispose",value:function(){null!=this.accumulatedGrads&&Object($e.d)(this.accumulatedGrads.map((function(e){return e.variable})))}},{key:"getWeights",value:function(){var e=Object(g.a)(v.a.mark((function e(){return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.saveIterations();case 2:return e.t0=e.sent,e.abrupt("return",[e.t0].concat(this.accumulatedGrads.map((function(e){return{name:e.originalName,tensor:e.variable}}))));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setWeights",value:function(){var e=Object(g.a)(v.a.mark((function e(t){return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.extractIterations(t);case 2:t=e.sent,!1,this.accumulatedGrads=t.map((function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}}));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getConfig",value:function(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}}],[{key:"fromConfig",value:function(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}}]),n}(ut);ht.className="Adagrad",Xe(ht);var dt=n(68),ft=n(26),pt=function(e){Object(Je.a)(n,e);var t=Object(Qe.a)(n);function n(e,r,a){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return Object(h.a)(this,n),(i=t.call(this)).learningRate=e,i.beta1=r,i.beta2=a,i.epsilon=o,i.accumulatedFirstMoment=[],i.accumulatedSecondMoment=[],Object($e.t)((function(){i.accBeta1=Object(st.a)(r).variable(),i.accBeta2=Object(st.a)(a).variable()})),null==o&&(i.epsilon=l.a.backend.epsilon()),i}return Object(d.a)(n,[{key:"applyGradients",value:function(e){var t=this,n=Array.isArray(e)?e.map((function(e){return e.name})):Object.keys(e);Object($e.t)((function(){var r=Object(ft.a)(1,t.accBeta1),a=Object(ft.a)(1,t.accBeta2);
2n.forEach((function(n,i){var o=l.a.registeredVariables[n];null==t.accumulatedFirstMoment[i]&&(t.accumulatedFirstMoment[i]={originalName:"".concat(n,"/m"),variable:Object($e.t)((function(){return Object(it.a)(o).variable(!1)}))}),null==t.accumulatedSecondMoment[i]&&(t.accumulatedSecondMoment[i]={originalName:"".concat(n,"/v"),variable:Object($e.t)((function(){return Object(it.a)(o).variable(!1)}))});var s=Array.isArray(e)?e[i].tensor:e[n];if(null!=s){var u=t.accumulatedFirstMoment[i].variable,c=t.accumulatedSecondMoment[i].variable,h=Object(et.a)(Object(nt.a)(u,t.beta1),Object(nt.a)(s,1-t.beta1)),d=Object(et.a)(Object(nt.a)(c,t.beta2),Object(nt.a)(Object(at.a)(s),1-t.beta2)),f=Object(tt.a)(h,r),p=Object(tt.a)(d,a);u.assign(h),c.assign(d);var m=Object(et.a)(Object(nt.a)(Object(tt.a)(f,Object(et.a)(Object(rt.a)(p),t.epsilon)),-t.learningRate),o);o.assign(m)}})),t.accBeta1.assign(Object(nt.a)(t.accBeta1,t.beta1)),t.accBeta2.assign(Object(nt.a)(t.accBeta2,t.beta2))})),this.incrementIterations()}},{key:"dispose",value:function(){this.accBeta1.dispose(),this.accBeta2.dispose(),null!=this.accumulatedFirstMoment&&Object($e.d)(this.accumulatedFirstMoment.map((function(e){return e.variable}))),null!=this.accumulatedSecondMoment&&Object($e.d)(this.accumulatedSecondMoment.map((function(e){return e.variable})))}},{key:"getWeights",value:function(){var e=Object(g.a)(v.a.mark((function e(){var t;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[].concat(Object(oe.a)(this.accumulatedFirstMoment),Object(oe.a)(this.accumulatedSecondMoment)),e.next=3,this.saveIterations();case 3:return e.t0=e.sent,e.abrupt("return",[e.t0].concat(t.map((function(e){return{name:e.originalName,tensor:e.variable}}))));case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setWeights",value:function(){var e=Object(g.a)(v.a.mark((function e(t){var n,r=this;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.extractIterations(t);case 2:t=e.sent,Object($e.t)((function(){r.accBeta1.assign(Object(dt.a)(r.beta1,r.iterations_+1)),r.accBeta2.assign(Object(dt.a)(r.beta2,r.iterations_+1))})),n=t.length/2,!1,this.accumulatedFirstMoment=t.slice(0,n).map((function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}})),this.accumulatedSecondMoment=t.slice(n,2*n).map((function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}}));case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getConfig",value:function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}}}],[{key:"fromConfig",value:function(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon)}}]),n}(ut);pt.className="Adam",Xe(pt);var mt=n(63),vt=n(87),gt=function(e){Object(Je.a)(n,e);var t=Object(Qe.a)(n);function n(e,r,a){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return Object(h.a)(this,n),(i=t.call(this)).learningRate=e,i.beta1=r,i.beta2=a,i.epsilon=o,i.decay=s,i.accumulatedFirstMoment=[],i.accumulatedWeightedInfNorm=[],Object($e.t)((function(){i.iteration=Object(st.a)(0).variable(),i.accBeta1=Object(st.a)(r).variable()})),null==o&&(i.epsilon=l.a.backend.epsilon()),i}return Object(d.a)(n,[{key:"applyGradients",value:function(e){var t=this,n=Array.isArray(e)?e.map((function(e){return e.name})):Object.keys(e);Object($e.t)((function(){var r=Object(ft.a)(1,t.accBeta1),a=Object(tt.a)(-t.learningRate,Object(et.a)(Object(nt.a)(t.iteration,t.decay),1));n.forEach((function(n,i){var o=l.a.registeredVariables[n];null==t.accumulatedFirstMoment[i]&&(t.accumulatedFirstMoment[i]={originalName:"".concat(n,"/m"),variable:Object(it.a)(o).variable(!1)}),null==t.accumulatedWeightedInfNorm[i]&&(t.accumulatedWeightedInfNorm[i]={originalName:"".concat(n,"/v"),variable:Object(it.a)(o).variable(!1)});var s=Array.isArray(e)?e[i].tensor:e[n];if(null!=s){var u=t.accumulatedFirstMoment[i].variable,c=t.accumulatedWeightedInfNorm[i].variable,h=Object(et.a)(Object(nt.a)(u,t.beta1),Object(nt.a)(s,1-t.beta1)),d=Object(nt.a)(c,t.beta2),f=Object(mt.a)(s),p=Object(vt.a)(d,f);u.assign(h),c.assign(p);var m=Object(et.a)(Object(nt.a)(Object(tt.a)(a,r),Object(tt.a)(h,Object(et.a)(p,t.epsilon))),o);o.assign(m)}})),t.iteration.assign(Object(et.a)(t.iteration,1)),t.accBeta1.assign(Object(nt.a)(t.accBeta1,t.beta1))})),this.incrementIterations()}},{key:"dispose",value:function(){this.accBeta1.dispose(),this.iteration.dispose(),null!=this.accumulatedFirstMoment&&Object($e.d)(this.accumulatedFirstMoment.map((function(e){return e.variable}
2))),null!=this.accumulatedWeightedInfNorm&&Object($e.d)(this.accumulatedWeightedInfNorm.map((function(e){return e.variable})))}},{key:"getWeights",value:function(){var e=Object(g.a)(v.a.mark((function e(){return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("getWeights() is not implemented for Adamax yet.");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"setWeights",value:function(){var e=Object(g.a)(v.a.mark((function e(t){return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("setWeights() is not implemented for Adamax yet.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"getConfig",value:function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}}}],[{key:"fromConfig",value:function(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon,t.decay)}}]),n}(ut);gt.className="Adamax",Xe(gt);var bt=function(e){Object(Je.a)(n,e);var t=Object(Qe.a)(n);function n(e){var r;return Object(h.a)(this,n),(r=t.call(this)).learningRate=e,r.setLearningRate(e),r}return Object(d.a)(n,[{key:"applyGradients",value:function(e){var t=this;(Array.isArray(e)?e.map((function(e){return e.name})):Object.keys(e)).forEach((function(n,r){var a=Array.isArray(e)?e[r].tensor:e[n];if(null!=a){var i=l.a.registeredVariables[n];Object($e.t)((function(){var e=Object(et.a)(Object(nt.a)(t.c,a),i);i.assign(e)}))}})),this.incrementIterations()}},{key:"setLearningRate",value:function(e){this.learningRate=e,null!=this.c&&this.c.dispose(),this.c=Object($e.l)(Object(st.a)(-e))}},{key:"dispose",value:function(){this.c.dispose()}},{key:"getWeights",value:function(){var e=Object(g.a)(v.a.mark((function e(){return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.saveIterations();case 2:return e.t0=e.sent,e.abrupt("return",[e.t0]);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setWeights",value:function(){var e=Object(g.a)(v.a.mark((function e(t){return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.extractIterations(t);case 2:if(0===(t=e.sent).length){e.next=5;break}throw new Error("SGD optimizer does not have settable weights.");case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getConfig",value:function(){return{learningRate:this.learningRate}}}],[{key:"fromConfig",value:function(e,t){return new e(t.learningRate)}}]),n}(ut);bt.className="SGD",Xe(bt);var yt=function(e){Object(Je.a)(n,e);var t=Object(Qe.a)(n);function n(e,r){var a,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Object(h.a)(this,n),(a=t.call(this,e)).learningRate=e,a.momentum=r,a.useNesterov=i,a.accumulations=[],a.m=Object(st.a)(a.momentum),a}return Object(d.a)(n,[{key:"applyGradients",value:function(e){var t=this;(Array.isArray(e)?e.map((function(e){return e.name})):Object.keys(e)).forEach((function(n,r){var a=l.a.registeredVariables[n];if(null==t.accumulations[r]){t.accumulations[r]={originalName:"".concat(n,"/momentum"),variable:Object($e.t)((function(){return Object(it.a)(a).variable(!1)}))}}var i=t.accumulations[r].variable,o=Array.isArray(e)?e[r].tensor:e[n];null!=o&&Object($e.t)((function(){var e,n=Object(et.a)(Object(nt.a)(t.m,i),o);e=t.useNesterov?Object(et.a)(Object(nt.a)(t.c,Object(et.a)(o,Object(nt.a)(n,t.m))),a):Object(et.a)(Object(nt.a)(t.c,n),a),i.assign(n),a.assign(e)}))})),this.incrementIterations()}},{key:"dispose",value:function(){this.m.dispose(),null!=this.accumulations&&Object($e.d)(this.accumulations.map((function(e){return e.variable})))}},{key:"setMomentum",value:function(e){this.momentum=e}},{key:"getWeights",value:function(){var e=Object(g.a)(v.a.mark((function e(){return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.saveIterations();case 2:return e.t0=e.sent,e.abrupt("return",[e.t0].concat(this.accumulations.map((function(e){return{name:e.originalName,tensor:e.variable}}))));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setWeights",value:function(){var e=Object(g.a)(v.a.mark((function e(t){return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.extractIterations(t);case 2:t=e.sent,!1,this.accumulations=t.map((function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}}));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getConfig",value:function(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov
2:this.useNesterov}}}],[{key:"fromConfig",value:function(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)}}]),n}(bt);yt.className="Momentum",Xe(yt);var xt=function(e){Object(Je.a)(n,e);var t=Object(Qe.a)(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.9,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Object(h.a)(this,n),(r=t.call(this)).learningRate=e,r.decay=a,r.momentum=i,r.epsilon=o,r.accumulatedMeanSquares=[],r.accumulatedMoments=[],r.accumulatedMeanGrads=[],r.centered=s,null==o&&(r.epsilon=l.a.backend.epsilon()),null==e)throw new Error("learningRate for RMSPropOptimizer must be defined.");return r}return Object(d.a)(n,[{key:"applyGradients",value:function(e){var t=this;(Array.isArray(e)?e.map((function(e){return e.name})):Object.keys(e)).forEach((function(n,r){var a=l.a.registeredVariables[n];null==t.accumulatedMeanSquares[r]&&(t.accumulatedMeanSquares[r]={originalName:"".concat(n,"/rms"),variable:Object($e.t)((function(){return Object(it.a)(a).variable(!1)}))}),null==t.accumulatedMoments[r]&&(t.accumulatedMoments[r]={originalName:"".concat(n,"/momentum"),variable:Object($e.t)((function(){return Object(it.a)(a).variable(!1)}))}),null==t.accumulatedMeanGrads[r]&&t.centered&&(t.accumulatedMeanGrads[r]={originalName:"".concat(n,"/mg"),variable:Object($e.t)((function(){return Object(it.a)(a).variable(!1)}))});var i=Array.isArray(e)?e[r].tensor:e[n];if(null!=i){var o=t.accumulatedMeanSquares[r].variable,s=t.accumulatedMoments[r].variable;Object($e.t)((function(){var e=Object(et.a)(Object(nt.a)(o,t.decay),Object(nt.a)(Object(at.a)(i),1-t.decay));if(t.centered){var n=t.accumulatedMeanGrads[r].variable,u=Object(et.a)(Object(nt.a)(n,t.decay),Object(nt.a)(i,1-t.decay)),c=Object(tt.a)(Object(nt.a)(i,t.learningRate),Object(rt.a)(Object(ft.a)(e,Object(et.a)(Object(at.a)(u),t.epsilon)))),l=Object(et.a)(Object(nt.a)(s,t.momentum),c);o.assign(e),n.assign(u),s.assign(l);var h=Object(ft.a)(a,l);a.assign(h)}else{var d=Object(et.a)(Object(nt.a)(o,t.decay),Object(nt.a)(Object(at.a)(i),1-t.decay)),f=Object(et.a)(Object(nt.a)(s,t.momentum),Object(tt.a)(Object(nt.a)(i,t.learningRate),Object(rt.a)(Object(et.a)(d,t.epsilon))));o.assign(d),s.assign(f);var p=Object(ft.a)(a,f);a.assign(p)}}))}})),this.incrementIterations()}},{key:"dispose",value:function(){null!=this.accumulatedMeanSquares&&Object($e.d)(this.accumulatedMeanSquares.map((function(e){return e.variable}))),null!=this.accumulatedMeanGrads&&this.centered&&Object($e.d)(this.accumulatedMeanGrads.map((function(e){return e.variable}))),null!=this.accumulatedMoments&&Object($e.d)(this.accumulatedMoments.map((function(e){return e.variable})))}},{key:"getWeights",value:function(){var e=Object(g.a)(v.a.mark((function e(){var t;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[].concat(Object(oe.a)(this.accumulatedMeanSquares),Object(oe.a)(this.accumulatedMoments)),this.centered&&t.push.apply(t,Object(oe.a)(this.accumulatedMeanGrads)),e.next=4,this.saveIterations();case 4:return e.t0=e.sent,e.abrupt("return",[e.t0].concat(t.map((function(e){return{name:e.originalName,tensor:e.variable}}))));case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setWeights",value:function(){var e=Object(g.a)(v.a.mark((function e(t){var n;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.extractIterations(t);case 2:t=e.sent,n=this.centered?t.length/3:t.length/2,!1,this.accumulatedMeanSquares=t.slice(0,n).map((function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}})),this.accumulatedMoments=t.slice(n,2*n).map((function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}})),this.centered&&(this.accumulatedMeanGrads=t.slice(2*n,3*n).map((function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}})));case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getConfig",value:function(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}}}],[{key:"fromConfig",value:function(e,t){return new e(t.learningRate,t.decay,t.momentum,t.epsilon,t.centered)}}]),n}(ut);xt.className="RMSProp",Xe(xt);var wt=n(117),Ot=n(30),kt=n(56),St=function(){function e(){Object(h.a)(this,e)}return Object(d.a)(e,null,[{key:"sgd",value:function(e){return new bt(e)}},{key:"momentum",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return new yt(e,t,n)}},{key:"rmsprop",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.9,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return new xt(e,t,n,r,a)}},{key:"adam",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.001,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.9,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.999,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return new pt(e,t,n,r)}},{key:"adadelta",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.001,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.95,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return new ct(e,t,n)}},{key:"adamax",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.002,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.9,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.999,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return new gt(e,t,n,r,a)}},{key:"adagrad",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.1;return new ht(e,t)}}]),e}(),_t={sgd:St.sgd,momentum:St.momentum,adadelta:St.adadelta,adagrad:St.adagrad,rmsprop:St.rmsprop,adamax:St.adamax,adam:St.adam},jt=n(285),Et=n(95),Tt=n(79),Ct=n(35),Mt=n(29),At=n(170),Nt=n(33),Rt=n(64),It=n(199);function Lt(e,t,n){return[n*("number"===typeof e?e:e[0]),t*("number"===typeof e?e:e[1])]}function Dt(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=[];if(r)(a=a.concat(t.slice(0))).push(e[0]/n),a=a.concat(e.slice(1));else{a=a.concat(e[0]);for(var i=t.length,o=0;o<i;++o)a=a.concat([e[o+1]/t[o],t[o]]);a=a.concat(e.slice(i+1))}return a}function Pt(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=[];if(n){r.push(t);for(var a=t+1;a<e;++a)a<=2*t?(r.push(a),r.push(a-(t+1))):r.push(a)}else{for(var i=[],o=[],s=1;s<e;++s)s>=2*t+1||s%2===1?o.push(s):i.push(s);r.push.apply(r,i),r.push(0),r.push.apply(r,o)}return r}function zt(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=[];r?a.push(e[0]/n):a.push(e[0]*n);for(var i=1;i<e.length;++i)i<=t.length?r?a.push(t[i-1]*e[i]):a.push(e[i]/t[i-1]):a.push(e[i]);return a}function Ft(e,t){for(var n=[0],r=0;r<t;++r)n.push(e[r][0]);return n}function Bt(e,t,n){for(var r=e.slice(0,1),a=0;a<n;++a)r.push(e[a+1]-t[a][0]-t[a][1]);return r}var Ut=1.7580993408473768,Wt=1.0507009873554805,Vt=.3275911,Gt=.254829592,Ht=-.284496736,qt=1.421413741,Xt=-1.453152027,Yt=1.061405429;function Kt(){var e;Object(f.c)().getBool("IS_TEST")||(e=console).warn.apply(e,arguments)}function Zt(){var e;
2Object(f.c)().getBool("IS_TEST")||(e=console).log.apply(e,arguments)}function Jt(e,t){if(e.length!==t.length)throw new Error("Cannot merge real and imag arrays of different lengths. real:"+"".concat(e.length,", imag: ").concat(t.length,"."));for(var n=new Float32Array(2*e.length),r=0;r<n.length;r+=2)n[r]=e[r/2],n[r+1]=t[r/2];return n}function Qt(e){for(var t=new Float32Array(e.length/2),n=new Float32Array(e.length/2),r=0;r<e.length;r+=2)t[r/2]=e[r],n[r/2]=e[r+1];return{real:t,imag:n}}function $t(e){for(var t=Math.ceil(e.length/4),n=new Float32Array(t),r=new Float32Array(t),a=0;a<e.length;a+=4)n[Math.floor(a/4)]=e[a],r[Math.floor(a/4)]=e[a+1];return{real:n,imag:r}}function en(e){for(var t=Math.floor(e.length/4),n=new Float32Array(t),r=new Float32Array(t),a=2;a<e.length;a+=4)n[Math.floor(a/4)]=e[a],r[Math.floor(a/4)]=e[a+1];return{real:n,imag:r}}function tn(e,t){return{real:e[2*t],imag:e[2*t+1]}}function nn(e,t,n,r){e[2*r]=t,e[2*r+1]=n}function rn(e,t){for(var n=new Float32Array(e/2),r=new Float32Array(e/2),a=0;a<Math.ceil(e/2);a++){var i=(t?2:-2)*Math.PI*(a/e);n[a]=Math.cos(i),r[a]=Math.sin(i)}return{real:n,imag:r}}function an(e,t,n){var r=(n?2:-2)*Math.PI*(e/t);return{real:Math.cos(r),imag:Math.sin(r)}}var on=n(214),sn=n(198);function un(e,t,n){if("complex64"===t){if("complex64"===e.dtype)return e.clone();var r=Object(Tt.a)(e.shape),a=Object(te.a)(e,"float32"),i=n.complex(a,r);return r.dispose(),a.dispose(),i}if(!Object(C.hasEncodingLoss)(e.dtype,t))return l.a.makeTensorFromDataId(e.dataId,e.shape,t);if("complex64"===e.dtype){var o=n.real(e),s=Object(te.a)(o,t);return o.dispose(),s}if("int32"===t)return n.int(e);if("bool"===t){var u=Object(st.a)(0,e.dtype),c=n.notEqual(e,u);return u.dispose(),c}throw new Error("Error in Cast: failed to cast ".concat(e.dtype," to ").concat(t))}function cn(e,t){return l.a.makeTensorFromDataId(e.dataId,t,e.dtype)}
2function ln(e,t,n){var r=(t-e)/(n-1),a=Object(C.makeZerosTypedArray)(n,"float32");a[0]=e;for(var i=1;i<a.length;i++)a[i]=a[i-1]+r;return Object(Et.a)(a,"float32")}var hn=n(184),dn=n(98),fn=n(41);function pn(e,t,n){var r=new Array(e.rank).fill(0),a=e.shape.slice();return t.map((function(t){var i=Object(oe.a)(a);i[n]=t;var o=Object(fn.a)(e,r,i);return r[n]+=t,o}))}function mn(e,t){for(var n=new Array(e.rank),r=0;r<n.length;r++)n[r]=e.shape[r]*t[r];for(var a=Object(ee.a)(n,e.dtype),i=0;i<a.values.length;++i){for(var o=a.indexToLoc(i),s=new Array(e.rank),u=0;u<s.length;u++)s[u]=o[u]%e.shape[u];var c=e.locToIndex(s);a.values[i]=e.values[c]}return a.toTensor()}var vn=n(84);function gn(e,t,n,r,a){for(var i=t[t.length-1],o=e.length/i,s=i,u=Object(C.getTypedArrayFromDType)(n,o*r),c=Object(C.getTypedArrayFromDType)("int32",o*r),l=0;l<o;l++){for(var h=l*s,d=e.subarray(h,h+s),f=[],p=0;p<d.length;p++)f.push({value:d[p],index:p});f.sort((function(e,t){return t.value-e.value}));for(var m=l*r,v=u.subarray(m,m+r),g=c.subarray(m,m+r),b=0;b<r;b++)v[b]=f[b].value,g[b]=f[b].index}var y=t.slice();return y[y.length-1]=r,[Object(vn.a)(u,y,n),Object(vn.a)(c,y,"int32")]}var bn=n(218),yn=function(){function e(t,n){Object(h.a)(this,e),this.backend=t,this.dataMover=n,this.data=new WeakMap,this.dataIdsCount=0}return Object(d.a)(e,[{key:"get",value:function(e){return this.data.has(e)||this.dataMover.moveData(this.backend,e),this.data.get(e)}},{key:"set",value:function(e,t){this.dataIdsCount++,this.data.set(e,t)}},{key:"has",value:function(e){return this.data.has(e)}},{key:"delete",value:function(e){return this.dataIdsCount--,this.data.delete(e)}},{key:"numDataIds",value:function(){return this.dataIdsCount}}]),e}(),xn=function(){function e(){Object(h.a)(this,e)}return Object(d.a)(e,[{key:"time",value:function(e){return wn("time")}},{key:"read",value:function(e){return wn("read")}},{key:"readSync",value:function(e){return wn("readSync")}},{key:"numDataIds",value:function(){return wn("numDataIds")}},{key:"disposeData",value:function(e){return wn("disposeData")}},{key:"write",value:function(e,t,n){return wn("write")}},{key:"move",value:function(e,t,n,r){return wn("move")}},{key:"memory",value:function(){return wn("memory")}},{key:"floatPrecision",value:function(){return wn("floatPrecision")}},{key:"epsilon",value:function(){return 32===this.floatPrecision()?1e-7:1e-4}},{key:"batchMatMul",value:function(e,t,n,r){return wn("batchMatMul")}},{key:"fusedBatchMatMul",value:function(e){e.a,e.b,e.transposeA,e.transposeB,e.bias,e.activation,e.preluActivationWeights;return wn("fusedBatchMatMul")}},{key:"slice",value:function(e,t,n){return wn("slice")}},{key:"stridedSlice",value:function(e,t,n,r){return wn("stridedSlice")}},{key:"unstack",value:function(e,t){return wn("unstack")}},{key:"reverse",value:function(e,t){return wn("reverse")}},{key:"concat",value:function(e,t){return wn("concat")}},{key:"neg",value:function(e){return wn("neg")}},{key:"add",value:function(e,t){return wn("add")}},{key:"addN",value:function(e){return wn("addN")}},{key:"subtract",value:function(e,t){return wn("subtract")}},{key:"multiply",value:function(e,t){return wn("multiply")}},{key:"realDivide",value:function(e,t){return wn("realDivide")}},{key:"floorDiv",value:function(e,t){return wn("floorDiv")}},{key:"sum",value:function(e,t){return wn("sum")}},{key:"prod",value:function(e,t){return wn("prod")}},{key:"unsortedSegmentSum",value:function(e,t,n){return wn("unsortedSegmentSum")}},{key:"argMin",value:function(e,t){return wn("argMin")}},{key:"argMax",value:function(e,t){return wn("argMax")}},{key:"equal",value:function(e,t){return wn("equal")}},{key:"notEqual",value:function(e,t){return wn("notEqual")}},{key:"less",value:function(e,t){return wn("less")}},{key:"lessEqual",value:function(e,t){return wn("lessEqual")}},{key:"greater",value:function(e,t){return wn("greater")}},{key:"greaterEqual",value:function(e,t){return wn("greaterEqual")}},{key:"logicalNot",value:function(e){return wn("logicalNot")}},{key:"logicalAnd",value:function(e,t){return wn("logicalAnd")}},{key:"logicalOr",value:function(e,t){return wn("logicalOr")}},{key:"where",value:function(e){return wn("where")}},{key:"select",value:function(e,t,n){return wn("select")}},{key:"topk",value:function(e,t,n){return wn("topk")}},{key:"min",value:function(e,t){return wn("min")}},{key:"minimum",value:function(e,t){return wn("minimum")}},{key:"mod",value:function(e,t){return wn("mod")}},{key:"max",value:function(e,t){return wn("max")}},{key:"maximum",value:function(e,t){return wn("maximum")}},{key:"all",value:function(e,t){return wn("all")}},{key:"any",value:function(e,t){return wn("any")}},{key:"squaredDifference",value:function(e,t){return wn("squaredDifference")}},{key:"ceil",value:function(e){return wn("ceil")}},{key:"floor",value:function(e){return wn("floor")}}
2,{key:"round",value:function(e){return wn("round")}},{key:"sign",value:function(e){return wn("sign")}},{key:"isNaN",value:function(e){return wn("isNaN")}},{key:"isInf",value:function(e){return wn("isInf")}},{key:"isFinite",value:function(e){return wn("isFinite")}},{key:"pow",value:function(e,t){return wn("pow")}},{key:"exp",value:function(e){return wn("exp")}},{key:"expm1",value:function(e){return wn("expm1")}},{key:"softmax",value:function(e,t){return wn("softmax")}},{key:"log",value:function(e){return wn("log")}},{key:"log1p",value:function(e){return wn("log1p")}},{key:"sqrt",value:function(e){return wn("sqrt")}},{key:"rsqrt",value:function(e){return wn("rsqrt")}},{key:"square",value:function(e){return wn("square")}},{key:"reciprocal",value:function(e){return wn("reciprocal")}},{key:"relu",value:function(e){return wn("relu")}},{key:"relu6",value:function(e){return wn("relu6")}},{key:"prelu",value:function(e,t){return wn("prelu")}},{key:"elu",value:function(e){return wn("elu")}},{key:"eluDer",value:function(e,t){return wn("eluDer")}},{key:"selu",value:function(e){return wn("selu")}},{key:"int",value:function(e){return wn("int")}},{key:"clip",value:function(e,t,n){return wn("clip")}},{key:"abs",value:function(e){return wn("abs")}},{key:"complexAbs",value:function(e){return wn("complexAbs")}},{key:"sigmoid",value:function(e){return wn("sigmoid")}},{key:"softplus",value:function(e){return wn("softplus")}},{key:"sin",value:function(e){return wn("sin")}},{key:"cos",value:function(e){return wn("cos")}},{key:"tan",value:function(e){return wn("tan")}},{key:"asin",value:function(e){return wn("asin")}},{key:"acos",value:function(e){return wn("acos")}},{key:"atan",value:function(e){return wn("atan")}},{key:"atan2",value:function(e,t){return wn("atan2")}},{key:"sinh",value:function(e){return wn("sinh")}},{key:"cosh",value:function(e){return wn("cosh")}},{key:"tanh",value:function(e){return wn("tanh")}},{key:"asinh",value:function(e){return wn("asinh")}},{key:"acosh",value:function(e){return wn("acosh")}},{key:"atanh",value:function(e){return wn("atanh")}},{key:"erf",value:function(e){return wn("erf")}},{key:"step",value:function(e,t){return wn("step")}},{key:"fusedConv2d",value:function(e){e.input,e.filter,e.convInfo,e.bias,e.activation,e.preluActivationWeights;return wn("fusedConv2d")}},{key:"conv2d",value:function(e,t,n){return wn("conv2d")}},{key:"conv2dDerInput",value:function(e,t,n){return wn("conv2dDerInput")}},{key:"conv2dDerFilter",value:function(e,t,n){return wn("conv2dDerFilter")}},{key:"fusedDepthwiseConv2D",value:function(e){e.input,e.filter,e.convInfo,e.bias,e.activation,e.preluActivationWeights;return wn("fusedDepthwiseConv2D")}},{key:"depthwiseConv2D",value:function(e,t,n){return wn("depthwiseConv2D")}},{key:"depthwiseConv2DDerInput",value:function(e,t,n){return wn("depthwiseConv2DDerInput")}},{key:"depthwiseConv2DDerFilter",value:function(e,t,n){return wn("depthwiseConv2DDerFilter")}},{key:"conv3d",value:function(e,t,n){return wn("conv3d")}},{key:"conv3dDerInput",value:function(e,t,n){return wn("conv3dDerInput")}},{key:"conv3dDerFilter",value:function(e,t,n){return wn("conv3dDerFilter")}},{key:"maxPool",value:function(e,t){return wn("maxPool")}},{key:"maxPoolBackprop",value:function(e,t,n,r){return wn("maxPoolBackprop")}},{key:"avgPool",value:function(e,t){return wn("avgPool")}},{key:"avgPoolBackprop",value:function(e,t,n){return wn("avgPoolBackprop")}},{key:"avgPool3d",value:function(e,t){return wn("avgPool3d")}},{key:"avgPool3dBackprop",value:function(e,t,n){return wn("avgPool3dBackprop")}},{key:"maxPool3d",value:function(e,t){return wn("maxPool3d")}},{key:"maxPool3dBackprop",value:function(e,t,n,r){return wn("maxPool3dBackprop")}},{key:"reshape",value:function(e,t){return wn("reshape")}},{key:"cast",value:function(e,t){return wn("cast")}},{key:"tile",value:function(e,t){return wn("tile")}},{key:"pad",value:function(e,t,n){return wn("pad")}},{key:"transpose",value:function(e,t){return wn("transpose")}},{key:"gather",value:function(e,t,n){return wn("gather")}},{key:"gatherND",value:function(e,t){return wn("gatherND")}},{key:"scatterND",value:function(e,t,n){return wn("scatterND")}},{key:"batchToSpaceND",value:function(e,t,n){return wn("batchToSpaceND")}},{key:"spaceToBatchND",value:function(e,t,n){return wn("spaceToBatchND")}
2},{key:"resizeBilinear",value:function(e,t,n,r){return wn("resizeBilinear")}},{key:"resizeBilinearBackprop",value:function(e,t,n){return wn("resizeBilinearBackprop")}},{key:"resizeNearestNeighbor",value:function(e,t,n,r){return wn("resizeNearestNeighbor")}},{key:"resizeNearestNeighborBackprop",value:function(e,t,n){return wn("resizeNearestNeighborBackprop")}},{key:"batchNorm",value:function(e,t,n,r,a,i){return wn("batchNorm")}},{key:"localResponseNormalization4D",value:function(e,t,n,r,a){return wn("localResponseNormalization4D")}},{key:"LRNGrad",value:function(e,t,n,r,a,i,o){return wn("LRNGrad")}},{key:"multinomial",value:function(e,t,n,r){return wn("multinomial")}},{key:"oneHot",value:function(e,t,n,r){return wn("oneHot")}},{key:"cumsum",value:function(e,t,n,r){return wn("cumsum")}},{key:"nonMaxSuppression",value:function(e,t,n,r,a){return wn("nonMaxSuppression")}},{key:"fft",value:function(e){return wn("fft")}},{key:"ifft",value:function(e){return wn("ifft")}},{key:"complex",value:function(e,t){return wn("complex")}},{key:"real",value:function(e){return wn("real")}},{key:"imag",value:function(e){return wn("imag")}},{key:"cropAndResize",value:function(e,t,n,r,a,i){return wn("cropAndResize")}},{key:"depthToSpace",value:function(e,t,n){return wn("depthToSpace")}},{key:"split",value:function(e,t,n){return wn("split")}},{key:"sparseToDense",value:function(e,t,n,r){return wn("sparseToDense")}},{key:"diag",value:function(e){return wn("diag")}},{key:"fill",value:function(e,t,n){return wn("fill")}},{key:"onesLike",value:function(e){return wn("onesLike")}},{key:"zerosLike",value:function(e){return wn("zerosLike")}},{key:"linspace",value:function(e,t,n){return wn("linspace")}},{key:"dispose",value:function(){return wn("dispose")}}]),e}();function wn(e){throw new Error("'".concat(e,"' not yet implemented or not found in the registry. ")+"Did you forget to import the kernel?")}var On=n(103),kn={kernelName:De.a,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(nt.a)(e,Object(On.a)(Object(te.a)(n,"float32"),-1))}}}},Sn=n(47),_n={kernelName:De.b,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){var t=Object(at.a)(Object(te.a)(n,"float32")),r=Object(rt.a)(Object(ft.a)(Object(st.a)(1),t));return Object(Sn.a)(Object(tt.a)(e,r))}}}},jn={kernelName:De.c,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){var t=Object(rt.a)(Object(ft.a)(Object(at.a)(Object(te.a)(n,"float32")),1));return Object(tt.a)(e,t)}}}},En=n(14),Tn=n(31),Cn={kernelName:De.d,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(he.a)(t,2),r=n[0],a=n[1],i=Mt.a(r.shape,a.shape);return{a:function(){var t=e,n=Mt.c(r.shape,i);return n.length>0&&(t=Object(Tn.a)(t,n)),Object(En.a)(t,r.shape)},b:function(){var t=e,n=Mt.c(a.shape,i);return n.length>0&&(t=Object(Tn.a)(t,n)),Object(En.a)(t,a.shape)}}}},Mn={kernelName:De.e,saveAllInputs:!0,gradFunc:function(e,t){var n={};return t.forEach((function(t,r){n[r]=function(){return e.clone()}})),n}},An={kernelName:De.h,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(it.a)(n)}}}},Nn={kernelName:De.i,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(it.a)(n)}}}},Rn={kernelName:De.j,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(tt.a)(e,Object(rt.a)(Object(ft.a)(Object(st.a)(1),Object(at.a)(Object(te.a)(n,"float32")))))}}}},In={kernelName:De.k,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){var t=Object(rt.a)(Object(et.a)(Object(st.a)(1),Object(at.a)(Object(te.a)(n,"float32"))));return Object(tt.a)(e,t)}}}},Ln={kernelName:De.m,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(he.a)(t,2),r=n[0],a=n[1],i=Object(Mt.a)(r.shape,a.shape);return{a:function(){var t=Object(et.a)(Object(at.a)(r),Object(at.a)(a)),n=Object(nt.a)(e,Object(tt.a)(a,t)),o=Object(Mt.c)(r.shape,i);return o.length>0&&(n=Object(Tn.a)(n,o)),Object(En.a)(n,r.shape)},b:function(){var t=Object(et.a)(Object(at.a)(r),Object(at.a)(a)
2),n=Object(Sn.a)(Object(nt.a)(e,Object(tt.a)(r,t))),o=Object(Mt.c)(a.shape,i);return o.length>0&&(n=Object(Tn.a)(n,o)),Object(En.a)(n,a.shape)}}}},Dn={kernelName:De.l,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(tt.a)(e,Object(et.a)(Object(at.a)(Object(te.a)(n,"float32")),1))}}}},Pn={kernelName:De.n,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(tt.a)(e,Object(ft.a)(Object(st.a)(1),Object(at.a)(Object(te.a)(n,"float32"))))}}}};var zn=Object(Ne.b)({avgPool3dBackprop_:function(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[1,1,1],i=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0,s=Object(Ce.a)(e,"dy","avgPool3dBackprop"),u=Object(Ce.a)(t,"input","avgPool3dBackprop"),c=s,h=u,d=!1;4===u.rank&&(d=!0,c=Object(En.a)(s,[1,s.shape[0],s.shape[1],s.shape[2],s.shape[3]]),h=Object(En.a)(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]])),C.assert(5===c.rank,(function(){return"Error in avgPool3dBackprop: dy must be rank 5 but got rank "+"".concat(c.rank,".")})),C.assert(5===h.rank,(function(){return"Error in avgPool3dBackprop: input must be rank 5 but got rank "+"".concat(h.rank,".")})),C.assert(Nt.h(r,a),(function(){return"Error in avgPool3dBackprop: Either strides or dilations "+"must be 1. Got strides ".concat(r," and dilations '").concat(a,"'")})),null!=o&&C.assert(C.isInt(i),(function(){return"Error in maxPool3dBackprop: pad must be an integer when "+"using, dimRoundingMode ".concat(o," but got pad ").concat(i,".")}));var f=function(e){var t=Nt.f(h.shape,n,r,a,i,o);return e.avgPool3dBackprop(c,h,t)},p={dy:c,input:h},m={filterSize:n,strides:r,dilations:a,pad:i,dimRoundingMode:o},v=l.a.runKernelFunc(f,p,null,De.q,m);return d?Object(En.a)(v,[v.shape[1],v.shape[2],v.shape[3],v.shape[4]]):v}}),Fn={kernelName:De.p,inputsToSave:["x"],gradFunc:function(e,t,n){var r=Object(he.a)(t,1)[0],a=n.filterSize,i=n.strides,o=n.dilations,s=n.pad,u=n.dimRoundingMode,c=null==o?[1,1,1]:o;return{x:function(){return zn(e,r,a,i,c,s,u)}}}};var Bn=Object(Ne.b)({avgPoolBackprop_:function(e,t,n,r,a){var i=Object(Ce.a)(e,"dy","avgPoolBackprop"),o=Object(Ce.a)(t,"input","avgPoolBackprop");C.assert(o.rank===i.rank,(function(){return"Rank of input (".concat(o.rank,") does not match rank of dy (").concat(i.rank,")")}));var s=o,u=i,c=!1;3===o.rank&&(c=!0,s=Object(En.a)(o,[1,o.shape[0],o.shape[1],o.shape[2]]),u=Object(En.a)(i,[1,i.shape[0],i.shape[1],i.shape[2]])),C.assert(4===u.rank,(function(){return"Error in avgPoolBackprop: dy must be rank 4 but got rank "+"".concat(u.rank,".")})),C.assert(4===s.rank,(function(){return"Error in avgPoolBackprop: input must be rank 4 but got rank "+"".concat(s.rank,".")}));var h={dy:u,input:s},d={filterSize:n,strides:r,pad:a},f=l.a.runKernelFunc((function(e){var t=Nt.e(s.shape,n,r,1,a);return e.avgPoolBackprop(u,s,t)}),h,null,De.r,d);return c?Object(En.a)(f,[f.shape[1],f.shape[2],f.shape[3]]):f}}),Un={kernelName:De.o,inputsToSave:["x"],gradFunc:function(e,t,n){var r=Object(he.a)(t,1)[0],a=n.filterSize,i=n.strides,o=n.pad;return{x:function(){return Bn(e,r,a,i,o)}}}},Wn={kernelName:De.s,inputsToSave:["a","b"],gradFunc:function(e,t,n){var r=Object(he.a)(t,2),a=r[0],i=r[1],o=n.transposeA,s=n.transposeB;return o||s?!o&&s?{a:function(){return Object(Me.a)(e,i,!1,!1)},b:function(){return Object(Me.a)(e,a,!0,!1)}}:o&&!s?{a:function(){return Object(Me.a)(i,e,!1,!0)},b:function(){return Object(Me.a)(a,e,!1,!1)}}:{a:function(){return Object(Me.a)(i,e,!0,!0)},b:function(){return Object(Me.a)(e,a,!0,!0)}}:{a:function(){return Object(Me.a)(e,i,!1,!0)},b:function(){return Object(Me.a)(a,e,!0,!1)}}}},Vn=n(126),Gn={kernelName:De.t,gradFunc:function(e,t,n){var r=n.blockShape,a=n.crops;return{x:function(){return Object(Vn.a)(e,r,a)}}}},Hn={kernelName:De.u,gradFunc:function(e,t,n){for(var r=n,a=r.inputShape,i=r.shape,o=Array.from(i),s=a.length-1;s>=0;s--)if(a[s]===i[s])o[s]=1;else if(1!==a[s])throw new Error("broadcastTo(): [".concat(a,"] cannot be broadcast to [").concat(i,"]."));for(var u=[],c=0;c<o.length;c++)o[c]>1&&u.push(c);return{x:function(){return Object(Tn.a)(e,u,!0)}}}},qn={kernelName:De.v,gradFunc:function(e){return{x:function(){return e.clone()}}}},Xn={kernelName:De.w,gradFunc:function(e){return{x:function(){return Object(it.a)(e)}}}},Yn=n(77),Kn=n(78),Zn=n(81),Jn=n(59),Qn={kernelName:De.x,inputsToSave:["x"],gradFunc:function(e,t,n){var r=Object(he.a)(t,1)[0],a=n.clipValueMin,i=n.clipValueMax;return{x:function(){return Object(Jn.a)(Object(Zn.a)(Object(Yn.a)(r,a),Ob
2ject(Kn.a)(r,i)),e,Object(it.a)(e))}}}},$n=n(96),er={kernelName:De.z,saveAllInputs:!0,gradFunc:function(e,t,n){var r=t.map((function(e){return e.shape})),a=n.axis,i=Object(C.parseAxisParam)(a,t[0].shape)[0],o=r.map((function(e){return e[i]}));return Object($n.a)(e,o,i).map((function(e){return function(){return e}}))}},tr=n(165),nr=n(163),rr={kernelName:De.A,inputsToSave:["x","filter"],gradFunc:function(e,t,n){var r=Object(he.a)(t,2),a=r[0],i=r[1],o=n.dilations,s=n.strides,u=n.pad,c=n.dataFormat;return C.assert(Nt.i(o),(function(){return"Error in gradient of conv2D: dilation rates greater than 1 "+"are not yet supported in gradients. Got dilations '".concat(o,"'")})),{x:function(){return Object(nr.a)(a.shape,e,i,s,u,c)},filter:function(){return Object(tr.a)(a,e,i.shape,s,u,c)}}}},ar=n(88),ir={kernelName:De.C,inputsToSave:["dy","filter"],gradFunc:function(e,t,n){var r=Object(he.a)(t,2),a=r[0],i=r[1],o=n.strides,s=n.pad,u=n.dataFormat,c=n.dimRoundingMode;return{dy:function(){return Object(ar.a)(e,i,o,s,u,1,c)},filter:function(){return Object(tr.a)(e,a,i.shape,o,s,u,c)}}}};var or=Object(Ne.b)({conv3DBackpropFilter_:function(e,t,n,r,a){var i=e;4===e.rank&&(i=Object(En.a)(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]));var o=t;4===o.rank&&(o=Object(En.a)(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]])),C.assert(5===i.rank,(function(){return"Error in conv3dDerFilter: input must be rank 5, but got shape "+"".concat(i.shape,".")})),C.assert(5===o.rank,(function(){return"Error in conv3dDerFilter: dy must be rank 5, but got shape "+"".concat(o.shape,".")})),C.assert(5===n.length,(function(){return"Error in conv3dDerFilter: filterShape must be length 5, but got "+"".concat(n,".")})),C.assert(i.shape[4]===n[3],(function(){return"Error in conv3dDerFilter: depth of input ".concat(i.shape[4],") must ")+"match input depth in filter (".concat(n[3],".")})),C.assert(o.shape[4]===n[4],(function(){return"Error in conv3dDerFilter: depth of dy (".concat(o.shape[4],") must ")+"match output depth for filter (".concat(n[4],").")}));var s={x:i,y:o},u={strides:r,pad:a};return l.a.runKernelFunc((function(e){var t=Nt.b(i.shape,n,r,1,a);return e.conv3dDerFilter(i,o,t)}),s,null,De.E,u)}}),sr=n(221),ur={kernelName:De.D,inputsToSave:["x","filter"],gradFunc:function(e,t,n){var r=n.dilations,a=n.strides,i=n.pad;C.assert(Object(Nt.i)(r),(function(){return"Error in gradient of conv3D: dilation rates greater than 1 are "+"not yet supported in gradients. Got dilations '".concat(r,"'")}));var o=Object(he.a)(t,2),s=o[0],u=o[1];return{x:function(){return Object(sr.a)(s.shape,e,u,a,i)},filter:function(){return or(s,e,u.shape,a,i)}}}},cr=n(211),lr={kernelName:De.G,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(nt.a)(Object(Sn.a)(Object(cr.a)(Object(te.a)(n,"float32"))),e)}}}},hr=n(212),dr={kernelName:De.H,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(nt.a)(Object(hr.a)(Object(te.a)(n,"float32")),e)}}}},fr=n(147),pr={kernelName:De.J,inputsToSave:["x"],gradFunc:function(e,t,n){var r=Object(he.a)(t,1)[0],a=n.axis,i=n.exclusive,o=n.reverse;return{x:function(){var t=Object(Ct.f)([a],r.rank),n=Object(fr.a)(e,a,i,!o);return null!=t&&(n=Object(Re.a)(n,t)),n}}}},mr=n(225),vr=n(224),gr={kernelName:De.L,inputsToSave:["x","filter"],gradFunc:function(e,t,n){var r=n.dilations,a=n.strides,i=n.pad,o=n.dimRoundingMode,s=null==r?[1,1]:r;C.assert(Nt.i(s),(function(){return"Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations "+"'".concat(s,"'")}));var u=Object(he.a)(t,2),c=u[0],l=u[1];C.assert(4===c.rank,(function(){return"Error in gradient of depthwiseConv2dNative: input must be "+"rank 4, but got rank ".concat(c.rank,".")})),C.assert(4===l.rank,(function(){return"Error in gradient of depthwiseConv2dNative: filter must be "+"rank 4, but got rank ".concat(l.rank,".")})),C.assert(c.shape[3]===l.shape[2],(function(){return"Error in gradient of depthwiseConv2d: number of input "+"channels (".concat(c.shape[3],") must match the inChannels dimension ")+"in filter ".concat(l.shape[2],".")})),C.assert(Nt.h(a,s),(function(){return"Error in gradient of depthwiseConv2d: Either strides or "+"dilations must be 1. Got strides ".concat(a," and dilations ")+"'".concat(s,"'.")})),null!=o&&C.assert(C.isInt(i),(function(){return"Error in depthwiseConv2d: pad must be an integer when using, "+"dimRoundingMode ".concat(o," but got pad ").concat(i,".")}));var h=Nt.a(c.shape,l.shape,a,s,i,o,!0);return{x:function(){return Object(vr.a)(c.shape,e,l,h)},filter:function(){return Object(mr.a)(c,e,l.shape,h)}}}}
2,br={kernelName:De.P,inputsToSave:["x","filter"],gradFunc:function(e,t,n){var r=Object(he.a)(t,2),a=r[0],i=r[1],o={x:a,filter:i,dy:e},s={x:a,filter:i,dy:e};return{x:function(){return l.a.runKernel(De.R,o,n)},filter:function(){return l.a.runKernel(De.Q,s,n)}}}},yr={kernelName:De.S,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(he.a)(t,2),r=n[0],a=n[1],i=Mt.a(r.shape,a.shape);return{a:function(){var t=Object(tt.a)(e,Object(te.a)(a,"float32")),n=Mt.c(r.shape,i);return n.length>0?Object(En.a)(Object(Tn.a)(t,n),r.shape):t},b:function(){var t=Object(nt.a)(e,Object(te.a)(r,"float32")),n=Mt.c(a.shape,i);n.length>0&&(t=Object(En.a)(Object(Tn.a)(t,n),a.shape));var o=Object(at.a)(a);return Object(Sn.a)(Object(tt.a)(t,Object(te.a)(o,"float32")))}}}},xr={kernelName:De.T,outputsToSave:[!0],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0],r=function(t){return t.eluDer(e,n)},a={dy:e,y:n};return{x:function(){return l.a.runKernelFunc(r,a,null,De.U)}}}},wr=n(62),Or={kernelName:De.W,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0],r=Object(nt.a)(Object(wr.a)(Object(Sn.a)(Object(at.a)(n))),2/Math.sqrt(Math.PI));return{x:function(){return Object(nt.a)(e,r)}}}},kr={kernelName:De.X,outputsToSave:[!0],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(nt.a)(e,n)}}}},Sr={kernelName:De.Y,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(nt.a)(e,Object(wr.a)(n))}}}},_r={kernelName:De.cb,gradFunc:function(e){return{x:function(){return Object(it.a)(e)}}}},jr={kernelName:De.db,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(he.a)(t,2),r=n[0],a=n[1],i=Object(Mt.a)(r.shape,a.shape);return{a:function(){var t=Object(tt.a)(e,Object(te.a)(a,"float32")),n=Object(Mt.c)(r.shape,i);return n.length>0?Object(En.a)(Object(Tn.a)(t,n),r.shape):t},b:function(){var t=Object(nt.a)(e,Object(te.a)(r,"float32")),n=Object(Mt.c)(a.shape,i);n.length>0&&(t=Object(En.a)(Object(Tn.a)(t,n),a.shape));var o=Object(at.a)(a);return Object(Sn.a)(Object(tt.a)(t,Object(te.a)(o,"float32")))}}}}
2,Er=n(208),Tr=n(106),Cr={kernelName:De.fb,inputsToSave:["x","mean","variance","scale"],gradFunc:function(e,t,n){var r=n.varianceEpsilon,a=Object(he.a)(t,4),i=a[0],o=a[1],s=a[2],u=a[3],c=null==u?Object(st.a)(1):u,l=Object(Mt.c)(o.shape,i.shape),h=[];if(1===o.rank){for(var d=0;d<i.shape.length-1;++d)h.push(i.shape[d]);h.push(1)}var f=Object(ft.a)(i,o),p=Object(nt.a)(e,c),m=Object(Er.a)(Object(et.a)(s,Object(st.a)(r))),v=Object(nt.a)(Object(nt.a)(Object(nt.a)(m,m),m),Object(st.a)(-.5));return{x:function(){return 1===o.rank?Object(En.a)(Object(nt.a)(Object(nt.a)(e,Object(Tr.a)(Object(En.a)(m,[1,1,1,o.shape[0]]),h)),c),i.shape):Object(En.a)(Object(nt.a)(Object(nt.a)(e,m),c),i.shape)},mean:function(){var e=Object(nt.a)(Object(nt.a)(m,Object(st.a)(-1)),p);return 1===o.rank&&(e=Object(Tn.a)(e,l)),Object(En.a)(e,o.shape)},variance:function(){var e=Object(nt.a)(Object(nt.a)(v,f),p);return 1===o.rank&&(e=Object(Tn.a)(e,l)),Object(En.a)(e,o.shape)},scale:function(){var t=Object(nt.a)(f,m),n=Object(nt.a)(e,t);return 1===o.rank&&(n=Object(Tn.a)(n,l)),Object(En.a)(n,o.shape)},offset:function(){var t=e;return 1===o.rank&&(t=Object(Tn.a)(t,l)),Object(En.a)(t,o.shape)}}}},Mr=n(158),Ar={kernelName:De.jb,inputsToSave:["x","indices"],gradFunc:function(e,t,n){var r=Object(he.a)(t,2),a=r[0],i=r[1],o=n.axis,s=Object(C.parseAxisParam)(o,a.shape)[0];return{x:function(){var t=a.shape,n=i.size,r=t.slice(0,s),u=r.length,c=t.slice(o,t.length).slice(1),l=c.length,h=Nr(0,u),d=Nr(u+1,u+1+l),f=Rr([r,[n],c]),p=Object(En.a)(e,f),m=Object(En.a)(i,[n]),v=Rr([[u],h,d]),g=Object(Re.a)(p,v),b=Object(Mr.a)(g,m,a.shape[s]),y=Object(Ct.h)(v);return b=Object(Re.a)(b,y)},indices:function(){return i}}}};function Nr(e,t){for(var n=[],r=e;r<t;++r)n.push(r);return n}function Rr(e){for(var t=[],n=0;n<e.length;++n)for(var r=0;r<e[n].length;++r)t.push(e[n][r]);return t}var Ir={kernelName:De.lb,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(he.a)(t,2),r=n[0],a=n[1];return{a:function(){return Object(it.a)(r)},b:function(){return Object(it.a)(a)}}}},Lr={kernelName:De.nb,gradFunc:function(e){return{x:function(){return Object(te.a)(e,"float32")}}}},Dr={kernelName:De.pb,gradFunc:function(e){return{x:function(){return Object(it.a)(e)}}}},Pr={kernelName:De.qb,gradFunc:function(e){return{x:function(){return Object(it.a)(e)}}}},zr={kernelName:De.rb,gradFunc:function(e){return{x:function(){return Object(it.a)(e)}}}},Fr={kernelName:De.yb,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(tt.a)(e,Object(et.a)(n,1))}}}},Br={kernelName:De.xb,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(tt.a)(e,Object(te.a)(n,"float32"))}}}}
2,Ur={kernelName:De.zb,inputsToSave:[],outputsToSave:[!0],gradFunc:function(e,t,n){var r=Object(he.a)(t,1)[0],a=n.axis;return{logits:function(){var t=Object(wr.a)(r);return Object(ft.a)(e,Object(nt.a)(Object(Tn.a)(e,a,!0),t))}}}};var Wr=Object(Ne.b)({localResponseNormalizationBackprop_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:.5,s=function(s){return s.LRNGrad(n,e,t,r,a,i,o)},u={x:e,y:t,dy:n},c={depthRadius:r,bias:a,alpha:i,beta:o};return l.a.runKernelFunc(s,u,null,De.tb,c)}}),Vr={kernelName:De.sb,inputsToSave:["x"],outputsToSave:[!0],gradFunc:function(e,t,n){var r=Object(he.a)(t,2),a=r[0],i=r[1],o=n.depthRadius,s=n.bias,u=n.alpha,c=n.beta;return{x:function(){return Wr(a,i,e,o,s,u,c)}}}},Gr=n(100);function Hr(e,t,n,r,a){return t.rank<n.rank&&(t=Object(En.a)(t,Ct.e(t.shape,r))),e.rank<n.rank&&(e=Object(En.a)(e,Ct.e(e.shape,r))),{x:function(){var r=Object(nt.a)(e,Object(te.a)(Object(Gr.a)(n,t),e.dtype));return null==a?r:Object(Re.a)(r,a)}}}var qr={kernelName:De.Db,inputsToSave:["x"],outputsToSave:[!0],gradFunc:function(e,t,n){var r=n.reductionIndices,a=Object(he.a)(t,2),i=a[0],o=a[1],s=C.parseAxisParam(r,i.shape),u=Ct.f(s,i.rank),c=Hr(e,o,i,s,u);return{x:function(){var e=c.x();return null!=u&&(e=Object(Re.a)(e)),e}}}},Xr=n(122),Yr={kernelName:De.Jb,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(he.a)(t,2),r=n[0],a=n[1];return{a:function(){return Object(nt.a)(e,Object(te.a)(Object(Yn.a)(r,a),"float32"))},b:function(){return Object(nt.a)(e,Object(te.a)(Object(Xr.a)(r,a),"float32"))}}}};var Kr=Object(Ne.b)({maxPool3dBackprop_:function(e,t,n,r,a){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[1,1,1],o=arguments.length>6?arguments[6]:void 0,s=arguments.length>7?arguments[7]:void 0,u=Object(Ce.a)(e,"dy","maxPool3dBackprop"),c=Object(Ce.a)(t,"input","maxPool3dBackprop"),h=Object(Ce.a)(n,"output","maxPool3dBackprop"),d=u,f=c,p=h,m=!1;4===c.rank&&(m=!0,d=Object(En.a)(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]]),f=Object(En.a)(c,[1,c.shape[0],c.shape[1],c.shape[2],c.shape[3]]),p=Object(En.a)(h,[1,h.shape[0],h.shape[1],h.shape[2],h.shape[3]])),C.assert(5===d.rank,(function(){return"Error in maxPool3dBackprop: dy must be rank 5 but got rank "+"".concat(d.rank,".")})),C.assert(5===f.rank,(function(){return"Error in maxPool3dBackprop: input must be rank 5 but got rank "+"".concat(f.rank,".")})),C.assert(5===p.rank,(function(){return"Error in maxPool3dBackprop: output must be rank 5 but got rank "+"".concat(p.rank,".")})),C.assert(Nt.h(a,i),(function(){return"Error in maxPool3dBackprop: Either strides or dilations "+"must be 1. Got strides ".concat(a," and dilations '").concat(i,"'")})),null!=s&&C.assert(C.isInt(o),(function(){return"Error in maxPool3dBackprop: pad must be an integer when "+"using, dimRoundingMode ".concat(s," but got pad ").concat(o,".")}));var v=function(e){var t=Nt.f(f.shape,r,a,i,o,s);return e.maxPool3dBackprop(d,f,p,t)},g={dy:d,input:f,output:p},b={filterSize:r,strides:a,dilations:i,pad:o,dimRoundingMode:s},y=l.a.runKernelFunc(v,g,null,De.Gb,b);return m?Object(En.a)(y,[y.shape[1],y.shape[2],y.shape[3],y.shape[4]]):y}}),Zr={kernelName:De.Fb,inputsToSave:["x"],outputsToSave:[!0],gradFunc:function(e,t,n){var r=Object(he.a)(t,2),a=r[0],i=r[1],o=n.filterSize,s=n.strides,u=n.dilations,c=n.pad,l=n.dimRoundingMode,h=null==u?[1,1,1]:u;return{x:function(){return Kr(e,a,i,o,s,h,c,l)}}}};var Jr=Object(Ne.b)({maxPoolBackprop_:function(e,t,n,r,a,i,o){var s=Object(Ce.a)(e,"dy","maxPoolBackprop"),u=Object(Ce.a)(t,"input","maxPoolBackprop"),c=Object(Ce.a)(n,"output","maxPoolBackprop");C.assert(u.rank===s.rank,(function(){return"Rank of input (".concat(u.rank,") does not match rank of dy ")+"(".concat(s.rank,")")})),C.assert(4===s.rank,(function(){return"Error in maxPoolBackprop: dy must be rank 4 but got rank "+"".concat(s.rank,".")})),C.assert(4===u.rank,(function(){return"Error in maxPoolBackprop: input must be rank 4 but got rank "+"".concat(u.rank,".")})),null!=o&&C.assert(C.isInt(i),(function(){return"Error in maxPoolBackprop: pad must be an integer when using, "+"dimRoundingMode ".concat(o," but got pad ").concat(i,".")}));var h={dy:s,input:u,output:c},d={filterSize:r,strides:a,pad:i,dimRoundingMode:o};return l.a.runKernelFunc((function(e){var t=Nt.e(u.shape,r,a,1,i,o);return e.maxPoolBackprop(s,u,c,t)}),h,null,De.Hb,d)}}),Qr={kernelName:De.Eb,inputsToSave:["x"],outputsToSave:[!0],gradFunc:function(e,t,n){var r=Object(he.a)(t,2),a=r[0],i=r[1],o=n.filterSize,s=n.strides,u=n.pad;return{x:function(){return Jr(e,a,i,o,s,u)}}}},$r={kernelName:De.Lb,inputsToSave:["x"],outputsToSave:[!0],gradFunc:function(e,t,n){var r=n.axis,a=Object(he.a)(t,2),i=a[0],o=a[1],s=C.parseAxisParam(r,i.shape),u=Ct.f(s,i.rank),c=Hr(e,o,i,s,u);return{x:function(){var e=c.x();return null!=u&&(e=Object(Re.a)(e)),e}}}},ea=n(71),ta={kernelName:De.Mb,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(he.a)(t,2),r=n[0],a=n[1];return{a:function(){return Object(nt.a)(e,Object(te.a)(Object(Kn.a)(r,a),"float32"))},b:function(){return Object(nt.a)(e,Object(te.a)(Object(ea.a)(r,a),"float32"))}}}},na=n(149),ra={kernelName:De.Nb,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(he.a)(t,2),r=n[0],a=n[1],i=Object(Mt.a)(r.shape,a.shape);return{a:function(){var t=Object(Mt.c)(r.shape,i);return t.length>0?Object(En.a)(Object(Tn.a)(e,t),r.shape):e},b:function(){var t=Object(nt.a)(e,Object(Sn.a)(Object(na.a)(Object(tt.a)(r,a)))),n=Object(Mt.c)(a.shape,i);return n.length>0?Object(En.a)(Object(Tn.a)(t,n),a.shape):t}}}}
2,aa={kernelName:De.Ob,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(he.a)(t,2),r=n[0],a=n[1],i=Object(Mt.a)(r.shape,a.shape);return{a:function(){var t=Object(nt.a)(e,Object(te.a)(a,"float32")),n=Object(Mt.c)(r.shape,i);return n.length>0?Object(En.a)(Object(Tn.a)(t,n),r.shape):t},b:function(){var t=Object(nt.a)(e,Object(te.a)(r,"float32")),n=Object(Mt.c)(a.shape,i);return n.length>0?Object(En.a)(Object(Tn.a)(t,n),a.shape):t}}}},ia={kernelName:De.Pb,gradFunc:function(e){return{x:function(){return Object(Sn.a)(e)}}}},oa={kernelName:De.Ub,inputsToSave:["indices"],gradFunc:function(e,t){var n=t[0];return{indices:function(){return Object(Tt.a)(n.shape,"float32")}}}},sa={kernelName:De.Vb,gradFunc:function(e){return{x:function(){return Object(it.a)(e)}}}},ua={kernelName:De.Wb,inputsToSave:["x"],gradFunc:function(e,t,n){var r=t[0],a=n.paddings.map((function(e){return e[0]}));return{x:function(){return Object(fn.a)(e,a,r.shape)}}}},ca=n(94),la={kernelName:De.Yb,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:function(e,t){var n=Object(he.a)(t,3),r=n[0],a=n[1],i=n[2],o=r,s=a,u=Mt.a(o.shape,s.shape);return{a:function(){var t=Object(te.a)(s,"float32"),n=Object(nt.a)(e,Object(nt.a)(t,Object(dt.a)(o,Object(ft.a)(t,Object(st.a)(1))))),r=Mt.c(o.shape,u);return r.length>0&&(n=Object(Tn.a)(n,r)),Object(En.a)(n,o.shape)},b:function(){var t=Object(ea.a)(o,0),n=Object(Jn.a)(t,Object(ca.a)(o),Object(it.a)(o)),r=Object(nt.a)(e,Object(nt.a)(i,n)),a=Mt.c(s.shape,u);return a.length>0&&(r=Object(Tn.a)(r,a)),Object(En.a)(r,s.shape)}}}},ha={kernelName:De.Zb,inputsToSave:["x","alpha"],gradFunc:function(e,t){var n=Object(he.a)(t,2),r=n[0],a=n[1],i=Object(ea.a)(r,0);return{x:function(){return Object(Jn.a)(i,e,Object(nt.a)(e,a))},alpha:function(){var t=Object(Jn.a)(i,Object(it.a)(e),Object(nt.a)(e,r)),n=Object(Mt.c)(a.shape,e.shape);return n.length>0&&(t=Object(Tn.a)(t,n)),Object(En.a)(t,a.shape)}}}},da={kernelName:De.dc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(tt.a)(e,Object(Sn.a)(Object(at.a)(n)))}}}},fa={kernelName:De.fc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0],r=Object(nt.a)(Object(Kn.a)(n,6),Object(On.a)(n));return{x:function(){return Object(nt.a)(e,Object(te.a)(r,"float32"))}}}},pa={kernelName:De.ec,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(nt.a)(e,Object(te.a)(Object(On.a)(n),"float32"))}}}},ma={kernelName:De.gc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(En.a)(e,n.shape)}}}},va={kernelName:De.hc,inputsToSave:["images"],gradFunc:function(e,t,n){var r=Object(he.a)(t,1)[0],a=function(t){var a=n.alignCorners;return t.resizeBilinearBackprop(e,r,a)},i={images:r};return{images:function(){return l.a.runKernelFunc(a,i,null,De.ic,n)}}}},ga={kernelName:De.jc,inputsToSave:["images"],gradFunc:function(e,t,n){var r=Object(he.a)(t,1)[0],a=function(t){var a=n.alignCorners;return t.resizeNearestNeighborBackprop(e,r,a)},i={images:r};return{images:function(){return l.a.runKernelFunc(a,i,null,De.kc,n)}}}},ba=n(69),ya={kernelName:De.lc,gradFunc:function(e,t,n){var r=n.dims,a=Object(C.parseAxisParam)(r,e.shape);return{x:function(){return Object(ba.a)(e,a)}}}},xa={kernelName:De.nc,gradFunc:function(e){return{x:function(){return Object(it.a)(e)}}}},wa={kernelName:De.oc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(Sn.a)(Object(tt.a)(e,Object(nt.a)(Object(dt.a)(n,1.5),2)))}}}},Oa=n(123),ka={kernelName:De.qc,inputsToSave:["condition"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{condition:function(){return Object(te.a)(Object(it.a)(n),"float32")},t:function(){return Object(nt.a)(e,Object(te.a)(n,e.dtype))},e:function(){return Object(nt.a)(e,Object(te.a)(Object(Oa.a)(n),e.dtype))}}}},Sa={kernelName:De.rc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){var t=Object(ea.a)(n,Object(st.a)(0)),r=Object(st.a)(Ut),a=Object(st.a)(Wt),i=Object(nt.a)(e,a),o=Object(nt.a)(Object(nt.a)(e,r),Object(wr.a)(Object(te.a)(n,"float32")));return Object(Jn.a)(t,i,o)}}}},_a={kernelName:De.sc,outputsToSave:[!0],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(nt.a)(e,Object(nt.a)(n,Object(ft.a)(Object(st.a)(1),n)))}}}},ja={kernelName:De.tc,gradFunc:function(e){return{x:function(){return Object(it.a)(e)}}}},Ea=n(146),Ta={kernelName:De.uc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(nt.a)(Object(Ea.a)(Object(te.a)(n,"float32")),e)}}}},Ca=n(193),Ma={kernelName:De.vc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(nt.a)(Object(Ca.a)(Object(te.a)(n,"float32")),e)}}}},Aa=n(80),Na={kernelName:De.wc,inputsToSave:["x"],gradFunc:function(e,t,n){for(var r=Object(he.a)(t,1)[0],a=n.begin,i=n.size,o=r.shape,s=Object(Ge.parseSliceParams)(r,a,i),u=Object(he.a)(s,2),c=u[0],l=u[1],h=[],d=0;d<e.rank;d++)h.push([c[d],o[d]-c[d]-l[d]]);return{x:function(){return Object(Aa.a)(e,h)}}}},Ra={kernelName:De.xc,outputsToSave:[!0],gradFunc:function(e,t,n){var r=Object(he.a)(t,1)[0],a=n.dim,i=Object(nt.a)(e,r);return{logits:function(){return Object(ft.a)(i,Object(nt.a)(Object(Tn.a)(i,[a],!0),r))}}}},Ia=n(105),La={kernelName:De.yc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(nt.a)(e,Object(Ia.a)(n))}}}},Da=n(119),Pa={kernelName:De.zc,gradFunc:function(e,t,n){var r=n.blockShape,a=n.paddings;return{x:function(){return Object(Da.a)(e,r,a)}}}},za=n(49),Fa={kernelName:De.Bc,gradFunc:function(e,t,n){var r=n.axis;return{x:function(){return Object(za.a)(e,r)}}}},Ba={kernelName:De.Cc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(tt.a)(e,Object(nt.a)(Object(rt.a)(Object(te.a)(n,"float32")),2))}}}},Ua={kernelName:De.Dc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(nt.a)(e,Object(nt.a)(Object(te.a)(n,"float32"),2))}}}},Wa={kernelName:De.Ec,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(he.a)(t,2),r=n[0],a=n[1],i=Object(st.a)(2);return{a:function(){return Object(nt.a)(e,Object(nt.a)(i,Object(ft.a)(r,a)))},b:function(){return Object(nt.a)(e,Object(nt.a)(i,Object(ft.a)(a,r)))}}}},Va={kernelName:De.Fc,gradFunc:function(e){return{x:function(){return Object(it.a)(e)}}}},Ga={kernelName:De.Hc,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(he.a)(t,2),r=n[0],a=n[1],i=Mt.a(r.shape,a.shape);return{a:function(){var t=e,n=Mt.c(r.shape,i);return n.length>0&&(t=Object(Tn.a)(t,n)),Object(En.a)(t,r.shape)},b:function(){var t=e,n=Mt.c(a.shape,i);return n.length>0&&(t=Object(Tn.a)(t,n)),Object(En.a)(Object(Sn.a)(t),a.shape)}}}},Ha=n(101),qa={kernelName:De.Ic,inputsToSave:["x"],gradFunc:function(e,t,n){var r=Object(he.a)(t,1)[0],a=r.shape.slice(),i=n.axis;Object(C.parseAxisParam)(i,r.shape).forEach((function(e){a[e]=1}));var o=Object(En.a)(e,a),s=Object(nt.a)(o,Object(Ha.a)(r.shape,"float32"));return{x:function(){return s}}}},Xa={kernelName:De.Jc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(tt.a)(e,Object(at.a)(Object(Ea.a)(n)))}}}},Ya={kernelName:De.Kc,outputsToSave:[!0],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return Object(nt.a)(Object(ft.a)(Object(st.a)(1),Object(at.a)(n)),e)}}}},Ka={kernelName:De.Lc,inputsToSave:["x"],gradFunc:function(e,t,n){var r=Object(he.a)(t,1)[0],a=n.reps;return{x:function(){var t=Object(it.a)(r);if(1===r.rank)for(var n=0;n<a[0];
2++n)t=Object(et.a)(t,Object(fn.a)(e,[n*r.shape[0]],[r.shape[0]]));else if(2===r.rank)for(var i=0;i<a[0];++i)for(var o=0;o<a[1];++o)t=Object(et.a)(t,Object(fn.a)(e,[i*r.shape[0],o*r.shape[1]],[r.shape[0],r.shape[1]]));else if(3===r.rank)for(var s=0;s<a[0];++s)for(var u=0;u<a[1];++u)for(var c=0;c<a[2];++c)t=Object(et.a)(t,Object(fn.a)(e,[s*r.shape[0],u*r.shape[1],c*r.shape[2]],[r.shape[0],r.shape[1],r.shape[2]]));else{if(4!==r.rank)throw new Error("Gradient for tile operation is not implemented for rank-"+"".concat(r.rank," tensors yet."));for(var l=0;l<a[0];++l)for(var h=0;h<a[1];++h)for(var d=0;d<a[2];++d)for(var f=0;f<a[3];++f)t=Object(et.a)(t,Object(fn.a)(e,[l*r.shape[0],h*r.shape[1],d*r.shape[2],f*r.shape[3]],[r.shape[0],r.shape[1],r.shape[2],r.shape[3]]))}return t}}}},Za={kernelName:De.Nc,gradFunc:function(e,t,n){var r=n.perm,a=Ct.h(r);return{x:function(){return Object(Re.a)(e,a)}}}},Ja=n(82),Qa={kernelName:De.Oc,gradFunc:function(e,t,n){var r=n.axis;return{value:function(){return Object(Ja.a)(e,r)}}}},$a=n(73),ei=n(120);for(var ti=0,ni=[kn,_n,jn,Cn,Mn,An,Nn,Rn,In,Ln,Dn,Pn,Fn,Un,Wn,Gn,Hn,qn,Xn,Qn,er,ir,rr,ur,lr,dr,pr,gr,br,yr,xr,Or,kr,Sr,jr,_r,Cr,Ar,Ir,Lr,Dr,Pr,zr,Fr,Br,Ur,Vr,qr,qr,Yr,Zr,Qr,$r,ta,ra,aa,ia,oa,sa,ua,ua,la,ha,da,fa,pa,ma,va,ga,ya,xa,wa,ka,Sa,_a,ja,Ta,Ma,Na,Ra,La,Pa,Pa,Fa,Fa,Ba,Wa,Ua,Va,Ga,qa,Xa,Ya,Ka,Za,Qa,{kernelName:De.Pc,inputsToSave:["segmentIds"],gradFunc:function(e,t){var n=Object(he.a)(t,1)[0];return{x:function(){return function(e,t){for(var n=Object(vt.a)(t,Object(it.a)(t)),r=Object(ei.a)(e,n),a=Object(Yn.a)(t,Object(st.a)(0,"int32")),i=r.rank-a.rank,o=0;o<i;++o)a=Object($a.a)(a,o+1);a=Object(Zn.a)(a,Object(Ha.a)(r.shape,"bool"));var s=Object(it.a)(r);return Object(Jn.a)(a,r,s)}(e,n)}}}},{kernelName:De.Qc,gradFunc:function(e){return{x:function(){return Object(it.a)(e)}}}}];ti<ni.length;ti++){var ri=ni[ti];Object(Pe.d)(ri)}ae.a.prototype.abs=function(){return this.throwIfDisposed(),Object(mt.a)(this)};var ai=n(250);ae.a.prototype.acos=function(){return this.throwIfDisposed(),Object(ai.a)(this)};var ii=n(251);ae.a.prototype.acosh=function(){return this.throwIfDisposed(),Object(ii.a)(this)};var oi=n(282);ae.a.prototype.addStrict=function(e){return this.throwIfDisposed(),Object(oi.a)(this,e)},ae.a.prototype.add=function(e){return this.throwIfDisposed(),Object(et.a)(this,e)};var si=n(186);ae.a.prototype.all=function(e,t){return this.throwIfDisposed(),Object(si.a)(this,e,t)};var ui=n(187);ae.a.prototype.any=function(e,t){return this.throwIfDisposed(),Object(ui.a)(this,e,t)};var ci=n(188);ae.a.prototype.argMax=function(e){return this.throwIfDisposed(),Object(ci.a)(this,e)};var li=n(189);ae.a.prototype.argMin=function(e){return this.throwIfDisposed(),Object(li.a)(this,e)},ae.a.prototype.asScalar=function(){return this.throwIfDisposed(),Object(C.assert)(1===this.size,(function(){return"The array must have only 1 element."})),Object(En.a)(this,[])},ae.a.prototype.asType=function(e){return this.throwIfDisposed(),Object(te.a)(this,e)},ae.a.prototype.as1D=function(){return this.throwIfDisposed(),Object(En.a)(this,[this.size])},ae.a.prototype.as2D=function(e,t){return this.throwIfDisposed(),Object(En.a)(this,[e,t])},ae.a.prototype.as3D=function(e,t,n){return this.throwIfDisposed(),Object(En.a)(this,[e,t,n])},ae.a.prototype.as4D=function(e,t,n,r){return this.throwIfDisposed(),Object(En.a)(this,[e,t,n,r])},ae.a.prototype.as5D=function(e,t,n,r,a){return this.throwIfDisposed(),Object(En.a)(this,[e,t,n,r,a])};var hi=n(253);ae.a.prototype.asin=function(){return this.throwIfDisposed(),Object(hi.a)(this)};var di=n(254);ae.a.prototype.asinh=function(){return this.throwIfDisposed(),Object(di.a)(this)};var fi=n(255);ae.a.prototype.atan=function(){return this.throwIfDisposed(),Object(fi.a)(this)};var pi=n(190);ae.a.prototype.atan2=function(e){return this.throwIfDisposed(),Object(pi.a)(this,e)};var mi=n(256);ae.a.prototype.atanh=function(){return this.throwIfDisposed(),Object(mi.a)(this)};var vi=n(145);ae.a.prototype.avgPool=function(e,t,n,r){return this.throwIfDisposed(),Object(vi.a)(this,e,t,n,r)},ae.a.prototype.batchToSpaceND=function(e,t){return this.throwIfDisposed(),Object(Da.a)(this,e,t)};var gi=n(104);ae.a.prototype.batchNorm=function(e,t,n,r,a){return this.throwIfDisposed(),Object(gi.a)(this,e,t,n,r,a)};var bi=n(134);ae.a.prototype.broadcastTo=function(e){return this.throwIfDisposed(),Object(bi.a)(this,e)},ae.a.prototype.cast=function(e){return this.throwIfDisposed(),Object(te.a)(this,e)};var yi=n(258);ae.a.prototype.ceil=function(){return this.throwIfDisposed(),Object(yi.a)(this)};var xi=n(259);ae.a.prototype.clipByValue=function(e,t){return this.throwIfDisposed(),Object(xi.a)(this,e,t)},ae.a.prototype.concat=function(e,t){return this.throwIfDisposed(),e instanceof ae.a&&(e=[e]),Ob
2ject(za.a)([this].concat(Object(oe.a)(e)),t)};var wi=n(191);ae.a.prototype.conv1d=function(e,t,n,r,a,i){return this.throwIfDisposed(),Object(wi.a)(this,e,t,n,r,a,i)};var Oi=n(192);ae.a.prototype.conv2dTranspose=function(e,t,n,r,a){return this.throwIfDisposed(),Object(Oi.a)(this,e,t,n,r,a)},ae.a.prototype.conv2d=function(e,t,n,r,a,i){return this.throwIfDisposed(),Object(ar.a)(this,e,t,n,r,a,i)},ae.a.prototype.cos=function(){return this.throwIfDisposed(),Object(Ea.a)(this)},ae.a.prototype.cosh=function(){return this.throwIfDisposed(),Object(Ca.a)(this)},ae.a.prototype.cumsum=function(e,t,n){return this.throwIfDisposed(),Object(fr.a)(this,e,t,n)};var ki=n(194);ae.a.prototype.depthToSpace=function(e,t){return this.throwIfDisposed(),Object(ki.a)(this,e,t)};var Si=n(99);ae.a.prototype.depthwiseConv2D=function(e,t,n,r,a,i){return Object($e.b)("depthwiseConv2D is deprecated, use depthwiseConv2d instead"),this.throwIfDisposed(),Object(Si.a)(this,e,t,n,r,a,i)},ae.a.prototype.depthwiseConv2d=function(e,t,n,r,a,i){return this.throwIfDisposed(),Object(Si.a)(this,e,t,n,r,a,i)};var _i=n(195);ae.a.prototype.dilation2d=function(e,t,n,r,a){return this.throwIfDisposed(),Object(_i.a)(this,e,t,n,r,a)};var ji=n(196);ae.a.prototype.divNoNan=function(e){return this.throwIfDisposed(),Object(ji.a)(this,e)},ae.a.prototype.divStrict=function(e){return this.throwIfDisposed(),Object(oi.b)(this,e)},ae.a.prototype.div=function(e){return this.throwIfDisposed(),Object(tt.a)(this,e)};var Ei=n(197);ae.a.prototype.dot=function(e){return this.throwIfDisposed(),Object(Ei.a)(this,e)};var Ti=n(148);ae.a.prototype.elu=function(){return this.throwIfDisposed(),Object(Ti.a)(this)};var Ci=n(281);ae.a.prototype.equalStrict=function(e){return this.throwIfDisposed(),Object(Ci.a)(this,e)},ae.a.prototype.equal=function(e){return this.throwIfDisposed(),Object(Gr.a)(this,e)};var Mi=n(261);ae.a.prototype.erf=function(){return this.throwIfDisposed(),Object(Mi.a)(this)},ae.a.prototype.exp=function(){return this.throwIfDisposed(),Object(wr.a)(this)},ae.a.prototype.expandDims=function(e){return this.throwIfDisposed(),Object($a.a)(this,e)};var Ai=n(262);ae.a.prototype.expm1=function(){return this.throwIfDisposed(),Object(Ai.a)(this)};var Ni=n(156);ae.a.prototype.fft=function(){return this.throwIfDisposed(),Object(Ni.a)(this)},ae.a.prototype.flatten=function(){return this.throwIfDisposed(),Object(En.a)(this,[this.size])},ae.a.prototype.floor=function(){return this.throwIfDisposed(),Object(na.a)(this)};var Ri=n(143);ae.a.prototype.floorDiv=function(e){return this.throwIfDisposed(),Object(Ri.a)(this,e)},ae.a.prototype.gather=function(e,t){return this.throwIfDisposed(),Object(ei.a)(this,e,t)},ae.a.prototype.greaterEqualStrict=function(e){return this.throwIfDisposed(),Object(Ci.b)(this,e)},ae.a.prototype.greaterEqual=function(e){return this.throwIfDisposed(),Object(Yn.a)(this,e)},ae.a.prototype.greaterStrict=function(e){return this.throwIfDisposed(),Object(Ci.c)(this,e)},ae.a.prototype.greater=function(e){return this.throwIfDisposed(),Object(ea.a)(this,e)};var Ii=n(137);ae.a.prototype.ifft=function(){return this.throwIfDisposed(),Object(Ii.a)(this)};var Li=n(213);ae.a.prototype.irfft=function(){return this.throwIfDisposed(),Object(Li.a)(this)};var Di=n(263);ae.a.prototype.isFinite=function(){return this.throwIfDisposed(),Object(Di.a)(this)};var Pi=n(264);ae.a.prototype.isInf=function(){return this.throwIfDisposed(),Object(Pi.a)(this)};var zi=n(265);ae.a.prototype.isNaN=function(){return this.throwIfDisposed(),Object(zi.a)(this)};var Fi=n(200);ae.a.prototype.leakyRelu=function(e){return this.throwIfDisposed(),Object(Fi.a)(this,e)},ae.a.prototype.lessEqualStrict=function(e){return this.throwIfDisposed(),Object(Ci.d)(this,e)},ae.a.prototype.lessEqual=function(e){return this.throwIfDisposed(),Object(Kn.a)(this,e)},ae.a.prototype.lessStrict=function(e){return this.throwIfDisposed(),Object(Ci.e)(this,e)},ae.a.prototype.less=function(e){return this.throwIfDisposed(),Object(Xr.a)(this,e)};var Bi=n(201);ae.a.prototype.localResponseNormalization=function(e,t,n,r){return this.throwIfDisposed(),Object(Bi.a)(this,e,t,n,r)};var Ui=n(267);ae.a.prototype.logSigmoid=function(){return this.throwIfDisposed(),Object(Ui.a)(this)};var Wi=n(268);ae.a.prototype.logSoftmax=function(e){return this.throwIfDisposed(),Object(Wi.a)(this,e)};var Vi=n(150);ae.a.prototype.logSumExp=function(e,t){return this.throwIfDisposed(),Object(Vi.a)(this,e,t)},ae.a.prototype.log=function(){return this.throwIfDisposed(),Object(ca.a)(this)};var Gi=n(202);ae.a.prototype.log1p=function(){return this.throwIfDisposed(),Object(Gi.a)(this)},ae.a.prototype.logicalAnd=function(e){return this.throwIfDisposed(),Object(Zn.a)(this,e)},ae.a.prototype.logicalNot=function(){return this.throwIfDisposed(),Object(Oa.a)(this)};var Hi=n(151);ae.a.prototype.logicalOr=function(e){return this.throwIfDisposed(),Object(Hi.a)(this,e)};var qi=n(204);ae.a.prototype.logicalXor=function(e){return this.throwIfDisposed(),Object(qi.a)(this,e)},ae.a.prototype.matMul=function(e,t,n){return this.throwIfDisposed(),Object(Me.a)(this,e,t,n)};var Xi=n(152);ae.a.prototype.maxPool=function(e,t,n,r){return this.throwIfDisposed(),Object(Xi.a)(this,e,t,n,r)};var Yi=n(90);ae.a.prototype.max=function(e,t){return this.throwIfDisposed(),Object(Yi.a)(this,e,t)},ae.a.prototype.maximumStrict=function(e){return this.throwIfDisposed(),Object(oi.c)(this,e)},ae.a.prototype.maximum=function(e){return this.throwIfDisposed(),Object(vt.a)(this,e)};var Ki=n(113);ae.a.prototype.mean=function(e,t){return this.throwIfDisposed(),Object(Ki.a)(this,e,t)};var Zi=n(135);ae.a.prototype.min=function(e,t){return this.throwIfDisposed(),Object(Zi.a)(this,e,t)},ae.a.prototype.minimumStrict=function(e){return this.throwIfDisposed(),Object(oi.d)(this,e)};var Ji=n(124);ae.a.prototype.minimum=function(e){return this.throwIfDisposed(),Object(Ji.a)(this,e)},ae.a.prototype.modStrict=function(e){return this.throwIfDisposed(),Object(oi.e)(this,e)};var Qi=n(153);ae.a.prototype.mod=function(e){return this.throwIfDisposed(),Object(Qi.a)(this,e)},ae.a.prototype.mulStrict=function(e){return this.throwIfDisposed(),Object(oi.f)(this,e)},ae.a.prototype.mul=function(e){return this.throwIfDisposed(),Object(nt.a)(this,e)},ae.a.prototype.neg=function(){return this.throwIfDisposed(),Object(Sn.a)(this)};var $i=n(159);ae.a.prototype.norm=function(e,t,n){return this.throwIfDisposed(),Object($i.a)(this,e,t,n)},ae.a.prototype.notEqualStrict=function(e){return this.throwIfDisposed(),Object(Ci.f)(this,e)};var eo=n(125);ae.a.prototype.notEqual=function(e){return this.throwIfDisposed(),Object(eo.a)(this,e)},ae.a.prototype.oneHot=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.throwIfDisposed(),Object(Ae.a)(this,e,t,n)};var to=n(272);ae.a.prototype.onesLike=function(){return this.throwIfDisposed(),Object(to.a)(this)},ae.a.prototype.pad=function(e,t){return this.throwIfDisposed(),Object(Aa.a)(this,e,t)};var no=n(205);ae.a.prototype.pool=function(e,t,n,r,a){return this.throwIfDisposed(),Object(no.a)(this,e,t,n,r,a)},ae.a.prototype.powStrict=function(e){return this.throwIfDisposed(),Object(oi.g)(this,e)},ae.a.prototype.pow=function(e){return this.throwIfDisposed(),Object(dt.a)(this,e)};var ro=n(154);ae.a.prototype.prelu=function(e){return this.throwIfDisposed(),Object(ro.a)(this,e)};var ao=n(206);ae.a.prototype.prod=function(e,t){return this.throwIfDisposed(),Object(ao.a)(this,e,t)};var io=n(273);ae.a.prototype.reciprocal=function(){return this.throwIfDisposed(),Object(io.a)(this)};var oo=n(102);ae.a.prototype.relu=function(){return this.throwIfDisposed(),Object(oo.a)(this)};var so=n(155);ae.a.prototype.relu6=function(){return this.throwIfDisposed(),Object(so.a)(this)},ae.a.prototype.reshapeAs=function(e){return this.throwIfDisposed(),Object(En.a)(this,e.shape)},ae.a.prototype.reshape=function(e){return this.throwIfDisposed(),Object(En.a)(this,e)};var uo=n(223);ae.a.prototype.resizeBilinear=function(e,t){return this.throwIfDisposed(),Object(uo.a)(this,e,t)};var co=n(222);ae.a.prototype.resizeNearestNeighbor=function(e,t){return this.throwIfDisposed(),Object(co.a)(this,e,t)},ae.a.prototype.reverse=function(e){return this.throwIfDisposed(),Object(ba.a)(this,e)};var lo=n(157);ae.a.prototype.rfft=function(){return this.throwIfDisposed(),Object(lo.a)(this)};var ho=n(274);ae.a.prototype.round=function(){return this.throwIfDisposed(),Object(ho.a)(this)},ae.a.prototype.rsqrt=function(){return this.throwIfDisposed(),Object(Er.a)(this)};var fo=n(209);ae.a.prototype.selu=function(){return this.throwIfDisposed(),Object(fo.a)(this)};var po=n(210);ae.a.prototype.separableConv2d=function(e,t,n,r,a,i){return this.throwIfDisposed(),Object(po.a)(this,e,t,n,r,a,i)},ae.a.prototype.sigmoid=function(){return this.throwIfDisposed(),Object(Ia.a)(this)};var mo=n(276);ae.a.prototype.sign=function(){return this.throwIfDisposed(),Object(mo.a)(this)},ae.a.prototype.sin=function(){return this.throwIfDisposed(),Object(cr.a)(this)},ae.a.prototype.sinh=function(){return this.throwIfDisposed(),Object(hr.a)(this)},ae.a.prototype.slice=function(e,t){return this.throwIfDisposed(),Object(fn.a)(this,e,t)};var vo=n(277);ae.a.prototype.softmax=function(e){return this.throwIfDisposed(),Object(vo.a)(this,e)};var go=n(203);ae.a.prototype.softplus=function(){return this.throwIfDisposed(),Object(go.a)(this)},ae.a.prototype.spaceToBatchND=function(e,t){return this.throwIfDisposed(),Object(Vn.a)(this,e,t)},ae.a.prototype.split=function(e,t){return this.throwIfDisposed(),Object($n.a)(this,e,t)},ae.a.prototype.sqrt=function(){return this.throwIfDisposed(),Object(rt.a)(this)},ae.a.prototype.square=function(){return this.throwIfDisposed(),Object(at.a)(this)};var bo=n(127);ae.a.prototype.squaredDifference=function(e){return this.throwIfDisposed(),Object(bo.a)(this,e)},ae.a.prototype.squaredDifferenceStrict=function(e){return this.throwIfDisposed(),Object(oi.h)(this,e)};var yo=n(128);ae.a.prototype.squeeze=function(e){return this.throwIfDisposed(),Object(yo.a)(this,e)},ae.a.prototype.stack=function(e,t){this.throwIfDisposed();var n=e instanceof ae.a?[this,e]:[this].concat(Object(oe.a)(e));return Object(Ja.a)(n,t)},ae.a.prototype.step=function(e){return this.throwIfDisposed(),Object(On.a)(this,e)};var xo=n(278);ae.a.prototype.stridedSlice=function(e,t,n,r,a,i,o,s){return this.throwIfDisposed(),Object(xo.a)(this,e,t,n,r,a,i,o,s)},ae.a.prototype.subStrict=function(e){return this.throwIfDisposed(),Object(oi.i)(this,e)},ae.a.prototype.sub=function(e){return this.throwIfDisposed(),Object(ft.a)(this,e)},ae.a.prototype.sum=function(e,t){return this.throwIfDisposed(),Object(Tn.a)(this,e,t)};var wo=n(279);ae.a.prototype.tan=function(){return this.throwIfDisposed(),Object(wo.a)(this)};var Oo=n(171);ae.a.prototype.tanh=function(){return this.throwIfDisposed(),Object(Oo.a)(this)},ae.a.prototype.tile=function(e){return this.throwIfDisposed(),Object(Tr.a)(this,e)},ae.a.prototype.toBool=function(){return this.throwIfDisposed(),Object(te.a)(this,"bool")},ae.a.prototype.toFloat=function(){return this.throwIfDisposed(),Object(te.a)(this,"float32")},ae.a.prototype.toInt=function(){return this.throwIfDisposed(),Object(te.a)(this,"int32")};var ko=n(216);ae.a.prototype.topk=function(e,t){return this.throwIfDisposed(),Object(ko.a)(this,e,t)},ae.a.prototype.transpose=function(e){return this.throwIfDisposed(),Object(Re.a)(this,e)},ae.a.prototype.unsortedSegmentSum=function(e,t){return this.throwIfDisposed(),Object(Mr.a)(this,e,t)};var So=n(129);ae.a.prototype.unstack=function(e){return this.throwIfDisposed(),Object(So.a)(this,e)},ae.a.prototype.where=function(e,t){return this.throwIfDisposed(),Object(Jn.a)(e,this,t)},ae.a.prototype.zerosLike=function(){return this.throwIfDisposed(),Object(it.a)(this)}},function(e,t,n){"use strict";e.exports=n(337)},function(e,t,n){"use strict";n.r(t),n.d(t,"shuffle",(function(){return a})),n.d(t,"clamp",(function(){return i})),n.d(t,"nearestLargerEven",(function(){return o}
2)),n.d(t,"sum",(function(){return s})),n.d(t,"randUniform",(function(){return u})),n.d(t,"distSquared",(function(){return c})),n.d(t,"assert",(function(){return l})),n.d(t,"assertShapesMatch",(function(){return h})),n.d(t,"assertNonNull",(function(){return d})),n.d(t,"flatten",(function(){return f})),n.d(t,"sizeFromShape",(function(){return p})),n.d(t,"isScalarShape",(function(){return m})),n.d(t,"arraysEqual",(function(){return v})),n.d(t,"isInt",(function(){return g})),n.d(t,"tanh",(function(){return b})),n.d(t,"sizeToSquarishShape",(function(){return y})),n.d(t,"createShuffledIndices",(function(){return x})),n.d(t,"rightPad",(function(){return w})),n.d(t,"repeatedTry",(function(){return O})),n.d(t,"inferFromImplicitShape",(function(){return k})),n.d(t,"parseAxisParam",(function(){return S})),n.d(t,"squeezeShape",(function(){return _})),n.d(t,"getTypedArrayFromDType",(function(){return j})),n.d(t,"getArrayFromDType",(function(){return E})),n.d(t,"checkConversionForErrors",(function(){return T})),n.d(t,"isValidDtype",(function(){return C})),n.d(t,"hasEncodingLoss",(function(){return M})),n.d(t,"isTypedArray",(function(){return A})),n.d(t,"bytesPerElement",(function(){return N})),n.d(t,"bytesFromStringArray",(function(){return R})),n.d(t,"isString",(function(){return I})),n.d(t,"isBoolean",(function(){return L})),n.d(t,"isNumber",(function(){return D})),n.d(t,"inferDtype",(function(){return P})),n.d(t,"isFunction",(function(){return z})),n.d(t,"nearestDivisor",(function(){return F})),n.d(t,"computeStrides",(function(){return B})),n.d(t,"toTypedArray",(function(){return U})),n.d(t,"toNestedArray",(function(){return W})),n.d(t,"makeOnesTypedArray",(function(){return V})),n.d(t,"makeZerosTypedArray",(function(){return G})),n.d(t,"makeZerosNestedTypedArray",(function(){return H})),n.d(t,"now",(function(){return q})),n.d(t,"assertNonNegativeIntegerDimensions",(function(){return X})),n.d(t,"fetch",(function(){return Y})),n.d(t,"encodeString",(function(){return K})),n.d(t,"decodeString",(function(){return Z})),n.d(t,"locToIndex",(function(){return J})),n.d(t,"indexToLoc",(function(){return Q}));var r=n(39);function a(e){for(var t=e.length,n=0,r=0;t>0;)r=Math.random()*t|0,n=e[--t],e[t]=e[r],e[r]=n}function i(e,t,n){return Math.max(e,Math.min(t,n))}function o(e){return e%2===0?e:e+1}function s(e){for(var t=0,n=0;n<e.length;n++)t+=e[n];return t}function u(e,t){var n=Math.random();return t*n+(1-n)*e}function c(e,t){for(var n=0,r=0;r<e.length;r++){var a=Number(e[r])-Number(t[r]);n+=a*a}return n}function l(e,t){if(!e)throw new Error("string"===typeof t?t:t())}function h(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";l(v(e,t),(function(){return n+" Shapes ".concat(e," and ").concat(t," must match")}))}function d(e){l(null!=e,(function(){return"The input to the tensor constructor must be a non-null value."}))}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==t&&(t=[]),Array.isArray(e)||A(e)&&!n)for(var r=0;r<e.length;++r)f(e[r],t,n);else t.push(e);return t}function p(e){if(0===e.length)return 1;for(var t=e[0],n=1;n<e.length;n++)t*=e[n];return t}function m(e){return 0===e.length}function v(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function g(e){return e%1===0}function b(e){if(null!=Math.tanh)return Math.tanh(e);if(e===1/0)return 1;if(e===-1/0)return-1;var t=Math.exp(2*e);return(t-1)/(t+1)}function y(e){var t=Math.ceil(Math.sqrt(e));return[t,Math.ceil(e/t)]}function x(e){for(var t=new Uint32Array(e),n=0;n<e;++n)t[n]=n;return a(t),t}function w(e,t){return t<=e.length?e:e+" ".repeat(t-e.length)}function O(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return 0},n=arguments.length>2?arguments[2]:void 0;return new Promise((function(r,a){var i=0;!function o(){if(e())r();else{i++;var s=t(i);null!=n&&i>=n?a():setTimeout(o,s)}}()}))}function k(e,t){for(var n=1,r=-1,a=0;a<e.length;++a)if(e[a]>=0)n*=e[a];else if(-1===e[a]){if(-1!==r)throw Error("Shapes can only have 1 implicit size. "+"Found -1 at dim ".concat(r," and dim ").concat(a));r=a}else if(e[a]<0)throw Error("Shapes can not be < 0. Found ".concat(e[a]," at dim ").concat(a));if(-1===r){if(t>0&&t!==n)throw Error("Size(".concat(t,") must match the product of shape ").concat(e));return e}if(0===n)throw Error("Cannot infer the missing size in [".concat(e,"] when ")+"there are 0 elements");if(t%n!==0)throw Error("The implicit shape can't be a fractional number. "+"Got ".concat(t," / ").concat(n));var i=e.slice();return i[r]=t/n,i}function S(e,t){var n=t.length;return l((e=null==e?t.map((function(e,t){return t})):[].concat(e)).every((function(e){return e>=-n&&e<n})),(function(){return"All values in axis param must be in range [-".concat(n,", ").concat(n,") but ")+"got axis ".concat(e)})),l(e.every((function(e){return g(e)})),(function(){return"All values in axis param must be integers but "+"got axis ".concat(e)})),e.map((function(e){return e<0?n+e:e}))}function _(e,t){for(var n=[],r=[],a=null!=t&&Array.isArray(t)&&0===t.length,i=null==t||a?null:S(t,e).sort(),o=0,s=0;s<e.length;++s){if(null!=i){if(i[o]===s&&1!==e[s])throw new Error("Can't squeeze axis ".concat(s," since its dim '").concat(e[s],"' is not 1"));(null==i[o]||i[o]>s)&&1===e[s]&&(n.push(e[s]),r.push(s)),i[o]<=s&&o++}1!==e[s]&&(n.push(e[s]),r.push(s))}return{newShape:n,keptDims:r}}function j(e,t){var n=null;if(null==e||"float32"===e)n=new Float32Array(t);else if("int32"===e)n=new Int32Array(t);else{if("bool"!==e)throw new Error("Unknown data type ".concat(e));n=new Uint8Array(t)}return n}function E(e,t){var n=null;if(null==e||"float32"===e)n=new Float32Array(t);else if("int32"===e)n=new Int32Array(t);else if("bool"===e)n=new Uint8Array(t);else{if("string"!==e)throw new Error("Unknown data type ".concat(e));n=new Array(t)}return n}function T(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(isNaN(r)||!isFinite(r))throw Error("A tensor of type ".concat(t," being uploaded contains ").concat(r,"."))}}function C(e){return"bool"===e||"complex64"===e||"float32"===e||"int32"===e||"string"===e}function M(e,t){return"complex64"!==t&&(("float32"!==t||"complex64"===e)&&(("int32"!==t||"float32"===e||"complex64"===e)&&("bool"!==t||"bool"!==e)))}function A(e){return e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array}function N(e){if("float32"===e||"int32"===e)return 4;if("complex64"===e)return 8;if("bool"===e)return 1;throw new Error("Unknown dtype ".concat(e))}function R(e){if(null==e)return 0;var t=0;return e.forEach((function(e){return t+=e.length})),t}function I(e){return"string"===typeof e||e instanceof String}function L(e){return"boolean"===typeof e}function D(e){return"number"===typeof e}function P(e){return Array.isArray(e)?P(e[0]):e instanceof Float32Array?"float32":e instanceof Int32Array||e instanceof Uint8Array?"int32":D(e)?"float32":I(e)?"string":L(e)?"bool":"float32"}function z(e){return!!(e&&e.constructor&&e.call&&e.apply)}function F(e,t){for(var n=t;n<e;++n)if(e%n===0)return n;return e}function B(e){var t=e.length;if(t<2)return[];var n=new Array(t-1);n[t-2]=e[t-1];for(var r=t-3;r>=0;--r)n[r]=n[r+1]*e[r+1];return n}function U(e,t){if("string"===t)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=f(e)),Object(r.c)().getBool("DEBUG")&&T(e,t),function(e,t){return e instanceof Float32Array&&"float32"===t||e instanceof Int32Array&&"int32"===t||e instanceof Uint8Array&&"bool"===t}(e,t))return e;if(null==t||"float32"===t||"complex64"===t)return new Float32Array(e);if("int32"===t)return new Int32Array(e);if("bool"===t){for(var n=new Uint8Array(e.length),a=0;a<n.length;++a)0!==Math.round(e[a])&&(n[a]=1);return n}throw new Error("Unknown data type ".concat(t))}function W(e,t){if(0===e.length)return t[0];var n=e.reduce((function(e,t){return e*t}));if(0===n)return[];if(n!==t.length)throw new Error("[".concat(e,"] does not match the input size ").concat(t.length,"."));return function e(t,n,r){var a=new Array;
2if(1===n.length)for(var i=n[0],o=0;o<i;o++)a[o]=r[t+o];else for(var s=n[0],u=n.slice(1),c=u.reduce((function(e,t){return e*t})),l=0;l<s;l++)a[l]=e(t+l*c,u,r);return a}(0,e,t)}function V(e,t){for(var n=G(e,t),r=0;r<n.length;r++)n[r]=1;return n}function G(e,t){if(null==t||"float32"===t||"complex64"===t)return new Float32Array(e);if("int32"===t)return new Int32Array(e);if("bool"===t)return new Uint8Array(e);throw new Error("Unknown data type ".concat(t))}function H(e,t){var n=e.reduce((function(e,t){return e*t}),1);if(null==t||"float32"===t)return W(e,new Float32Array(n));if("int32"===t)return W(e,new Int32Array(n));if("bool"===t)return W(e,new Uint8Array(n));throw new Error("Unknown data type ".concat(t))}function q(){return Object(r.c)().platform.now()}function X(e){e.forEach((function(t){l(Number.isInteger(t)&&t>=0,(function(){return"Tensor must have a shape comprised of positive integers but got "+"shape [".concat(e,"].")}))}))}function Y(e,t){return Object(r.c)().platform.fetch(e,t)}function K(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf-8";return t=t||"utf-8",Object(r.c)().platform.encode(e,t)}function Z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf-8";return t=t||"utf-8",Object(r.c)().platform.decode(e,t)}function J(e,t,n){if(0===t)return 0;if(1===t)return e[0];for(var r=e[e.length-1],a=0;a<e.length-1;++a)r+=n[a]*e[a];return r}function Q(e,t,n){if(0===t)return[];if(1===t)return[e];for(var r=new Array(t),a=0;a<r.length-1;++a)r[a]=Math.floor(e/n[a]),e-=r[a]*n[a];return r[r.length-1]=e,r}},function(e,t,n){e.exports=n(346)},function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return l}));var r=n(10),a=n(39),i=n(12),o=n(2);function s(e,t){var n=e;if(Object(o.isTypedArray)(e))return"string"===t?[]:[e.length];if(!Array.isArray(e))return[];for(var r=[];Array.isArray(n)||Object(o.isTypedArray)(n)&&"string"!==t;)r.push(n.length),n=n[0];return Array.isArray(e)&&Object(a.c)().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&function e(t,n,r){if(r=r||[],!Array.isArray(t)&&!Object(o.isTypedArray)(t))return void Object(o.assert)(0===n.length,(function(){return"Element arr[".concat(r.join("]["),"] is a primitive, ")+"but should be an array/TypedArray of ".concat(n[0]," elements")}));Object(o.assert)(n.length>0,(function(){return"Element arr[".concat(r.join("]["),"] should be a primitive, ")+"but is an array of ".concat(t.length," elements")})),Object(o.assert)(t.length===n[0],(function(){return"Element arr[".concat(r.join("]["),"] should have ").concat(n[0]," ")+"elements, but has ".concat(t.length," elements")}));for(var a=n.slice(1),i=0;i<t.length;++i)e(t[i],a,r.concat(i))}(e,r,[]),r}function u(e,t,n,r){if(null!=e&&("numeric"!==e&&e!==t||"numeric"===e&&"string"===t))throw new Error("Argument '".concat(n,"' passed to '").concat(r,"' must ")+"be ".concat(e," tensor, but got ").concat(t," tensor"))}function c(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"numeric";if(e instanceof i.a)return u(a,e.dtype,t,n),e;var c=Object(o.inferDtype)(e);if("string"!==c&&["bool","int32","float32"].indexOf(a)>=0&&(c=a),u(a,c,t,n),null==e||!Object(o.isTypedArray)(e)&&!Array.isArray(e)&&"number"!==typeof e&&"boolean"!==typeof e&&"string"!==typeof e){var l=null==e?"null":e.constructor.name;throw new Error("Argument '".concat(t,"' passed to '").concat(n,"' must be a ")+"Tensor or TensorLike, but got '".concat(l,"'"))}var h=s(e,c);Object(o.isTypedArray)(e)||Array.isArray(e)||(e=[e]);var d=!0,f="string"!==c?Object(o.toTypedArray)(e,c):Object(o.flatten)(e,[],d);return r.a.makeTensor(f,h,c)}function l(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"numeric";if(!Array.isArray(e))throw new Error("Argument ".concat(t," passed to ").concat(n," must be a ")+"`Tensor[]` or `TensorLike[]`");var a=e;return a.map((function(e,r){return c(e,"".concat(t,"[").concat(r,"]"),n)}),r)}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"d",(function(){return i})),n.d(t,"e",(function(){return o}
2)),n.d(t,"f",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"g",(function(){return l})),n.d(t,"c",(function(){return h})),n.d(t,"a",(function(){return d}));var r=n(8),a=n(0);function i(e,t,n,r){var i=t.inputParams[e];if(i&&void 0!==i.inputIndexStart){var s=i.inputIndexStart,u=0===i.inputIndexEnd?void 0:void 0===i.inputIndexEnd?s+1:i.inputIndexEnd;if("tensor"===i.type)return o(t.inputNames[i.inputIndexStart],n,r);if("tensors"===i.type)return t.inputNames.slice(s,u).map((function(e){return o(e,n,r)}));var c=o(t.inputNames.slice(s)[0],n,r),l=c.dataSync();return"number"===i.type?l[0]:a.util.toNestedArray(c.shape,l)}var h=t.attrParams[e];return h&&h.value}function o(e,t,n){var a=l(e),i=Object(r.a)(a,2),o=i[0],s=i[1],u=n.currentContextIds.find((function(e){return!!t[c(o,e)]}));return void 0!==u?t[c(o,u)][s]:void 0}function s(e,t,n){return t[c(e,n.currentContextId)]}function u(e,t){var n=l(e),a=Object(r.a)(n,2),i=a[0],o=a[1];return[c(i,t&&t.currentContextId),o]}function c(e,t){return t?"".concat(e,"-").concat(t):e}function l(e){var t=e.split(":");return 1===t.length?[e,0]:[t[0],Number(t[t.length-1])]}function h(e,t,n){var r=i("pad",e,t,n);if("explicit"===r){r=i("explicitPaddings",e,t,n);for(var a=[[0,0],[0,0],[0,0],[0,0]],o=0;o<4;o++)a[o][0]=r[2*o],a[o][1]=r[2*o+1];return a}return r}function d(e){return e.kept?e:Object(a.clone)(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"d",(function(){return o})),n.d(t,"e",(function(){return s})),n.d(t,"f",(function(){return u})),n.d(t,"g",(function(){return c})),n.d(t,"h",(function(){return l})),n.d(t,"i",(function(){return h})),n.d(t,"j",(function(){return d})),n.d(t,"k",(function(){return f})),n.d(t,"l",(function(){return p})),n.d(t,"n",(function(){return m})),n.d(t,"m",(function(){return v})),n.d(t,"o",(function(){return g})),n.d(t,"r",(function(){return b})),n.d(t,"p",(function(){return y})),n.d(t,"q",(function(){return x})),n.d(t,"s",(function(){return w})),n.d(t,"t",(function(){return O})),n.d(t,"u",(function(){return k})),n.d(t,"v",(function(){return S})),n.d(t,"w",(function(){return _})),n.d(t,"x",(function(){return j})),n.d(t,"y",(function(){return E})),n.d(t,"z",(function(){return T})),n.d(t,"A",(function(){return C})),n.d(t,"B",(function(){return M})),n.d(t,"C",(function(){return A})),n.d(t,"D",(function(){return N})),n.d(t,"E",(function(){return R})),n.d(t,"F",(function(){return I})),n.d(t,"G",(function(){return L})),n.d(t,"H",(function(){return D})),n.d(t,"J",(function(){return P})),n.d(t,"I",(function(){return z})),n.d(t,"K",(function(){return F})),n.d(t,"L",(function(){return B})),n.d(t,"M",(function(){return U})),n.d(t,"N",(function(){return W})),n.d(t,"O",(function(){return V})),n.d(t,"P",(function(){return G})),n.d(t,"R",(function(){return H})),n.d(t,"Q",(function(){return q})),n.d(t,"S",(function(){return X})),n.d(t,"T",(function(){return Y})),n.d(t,"U",(function(){return K})),n.d(t,"W",(function(){return Z})),n.d(t,"V",(function(){return J})),n.d(t,"X",(function(){return Q})),n.d(t,"Y",(function(){return $})),n.d(t,"Z",(function(){return ee})),n.d(t,"ab",(function(){return te})),n.d(t,"bb",(function(){return ne})),n.d(t,"cb",(function(){return re})),n.d(t,"db",(function(){return ae})),n.d(t,"fb",(function(){return ie})),n.d(t,"jb",(function(){return oe})),n.d(t,"ib",(function(){return se})),n.d(t,"kb",(function(){return ue})),n.d(t,"lb",(function(){return ce})),n.d(t,"nb",(function(){return le})),n.d(t,"mb",(function(){return he})),n.d(t,"ob",(function(){return de})),n.d(t,"pb",(function(){return fe})),n.d(t,"qb",(function(){return pe})),n.d(t,"rb",(function(){return me})),n.d(t,"ub",(function(){return ve})),n.d(t,"vb",(function(){return ge})),n.d(t,"wb",(function(){return be})),n.d(t,"xb",(function(){return ye})),n.d(t,"yb",(function(){return xe})),n.d(t,"Ab",(function(){return we})),n.d(t,"Bb",(function(){return Oe})),n.d(t,"Cb",(function(){return ke})),n.d(t,"zb",(function(){return Se})),n.d(t,"sb",(function(){return _e})),n.d(t,"tb",(function(){return je})),n.d(t,"Db",(function(){return Ee})),n.d(t,"Jb",(function(){return Te})),n.d(t,"Eb",(function(){return Ce})),n.d(t,"Hb",(function(){return Me})),n.d(t,"Fb",(function(){return Ae})),n.d(t,"Gb",(function(){return Ne})),n.d(t,"Ib",(function(){return Re})),n.d(t,"Kb",(function(){return Ie})),n.d(t,"Lb",(function(){return Le})),n.d(t,"Mb",(function(){return De})),n.d(t,"Nb",(function(){return Pe})),n.d(t,"Ob",(function(){return ze})),n.d(t,"Pb",(function(){return Fe})),n.d(t,"Tb",(function(){return Be})),n.d(t,"Qb",(function(){return Ue})),n.d(t,"Rb",(function(){return We})),n.d(t,"Sb",(function(){return Ve})),n.d(t,"Vb",(function(){return Ge})),n.d(t,"Ub",(function(){return He})),n.d(t,"Wb",(function(){return qe})),n.d(t,"Xb",(function(){return Xe})),n.d(t,"Yb",(function(){return Ye})),n.d(t,"Zb",(function(){return Ke})),n.d(t,"ac",(function(){return Ze})),n.d(t,"bc",(function(){return Je})),n.d(t,"cc",(function(){return Qe})),n.d(t,"dc",(function(){return $e})),n.d(t,"ec",(function(){return et})),n.d(t,"gc",(function(){return tt})),n.d(t,"jc",(function(){return nt})),n.d(t,"kc",(function(){return rt})),n.d(t,"hc",(function(){return at})),n.d(t,"ic",(function(){return it})),n.d(t,"fc",(function(){return ot})),n.d(t,"lc",(function(){return st})),n.d(t,"nc",(function(){return ut})),n.d(t,"oc",(function(){return ct})),n.d(t,"pc",(function(){return lt})),n.d(t,"qc",(function(){return ht})),n.d(t,"rc",(function(){return dt})),n.d(t,"wc",(function(){return ft})),n.d(t,"uc",(function(){return pt})),n.d(t,"vc",(function(){return mt})),n.d(t,"tc",(function(){return vt})),n.d(t,"sc",(function(){return gt})),n.d(t,"yc",(function(){return bt})),n.d(t,"Cc",(function(){return yt})),n.d(t,"Ic",(function(){return xt})),n.d(t,"zc",(function(){return wt})),n.d(t,"Bc",(function(){return Ot})),n.d(t,"xc",(function(){return kt})),n.d(t,"Ec",(function(){return St})),n.d(t,"Dc",(function(){return _t})),n.d(t,"Hc",(function(){return jt})),n.d(t,"Ac",(function(){return Et})),n.d(t,"Gc",(function(){return Tt})),n.d(t,"Jc",(function(){return Ct})),n.d(t,"Kc",(function(){return Mt})),n.d(t,"Lc",(function(){return At})),n.d(t,"Mc",(function(){return Nt})),n.d(t,"Nc",(function(){return Rt})),n.d(t,"Oc",(function(){return It})),n.d(t,"Pc",(function(){return Lt})),n.d(t,"Qc",(function(){return Dt})),n.d(t,"Fc",(function(){return Pt})),n.d(t,"eb",(function(){return zt})),n.d(t,"mc",(function(){return Ft})),n.d(t,"Rc",(function(){return Bt})),n.d(t,"gb",(function(){return Ut})),n.d(t,"hb",(function(){return Wt}));var r="Abs",a="Acos",i="Acosh",o="Add",s="AddN",u="All",c="Any",l="ArgMax",h="ArgMin",d="Asin",f="Asinh",p="Atan",m="Atanh",v="Atan2",g="AvgPool",b="AvgPoolBackprop",y="AvgPool3D",x="AvgPool3DBackprop",w="BatchMatMul",O="BatchToSpaceND",k="BroadcastTo",S="Cast",_="Ceil",j="ClipByValue",E="Complex",T="Concat",C="Conv2D",M="Conv2DBackpropFilter",A="Conv2DBackpropInput",N="Conv3D",R="Conv3DBackpropFilterV2",I="Conv3DBackpropInputV2",L="Cos",D="Cosh",P="Cumsum",z="CropAndResize",F="DepthToSpace",B="DepthwiseConv2dNative",U="DepthwiseConv2dNativeBackpropFilter",W="DepthwiseConv2dNativeBackpropInput",V="Diag",G="Dilation2D",H="Dilation2DBackpropInput",q="Dilation2DBackpropFilter",X="Div",Y="Elu",K="EluGrad",Z="Erf",J="Equal",Q="Exp",$="Expm1",ee="FFT",te="Fill",ne="FlipLeftRight",re="Floor",ae="FloorDiv",ie="FusedBatchNorm",oe="GatherV2",se="GatherNd",ue="Greater",ce="GreaterEqual",le="Identity",he="IFFT",de="Imag",fe="IsFinite",pe="IsInf",me="IsNan",ve="Less",ge="LessEqual",be="LinSpace",ye="Log",xe
2="Log1p",we="LogicalAnd",Oe="LogicalNot",ke="LogicalOr",Se="LogSoftmax",_e="LRN",je="LRNBackprop",Ee="Max",Te="Maximum",Ce="MaxPool",Me="MaxPoolBackprop",Ae="MaxPool3D",Ne="MaxPool3DBackprop",Re="MaxPoolWithArgmax",Ie="Mean",Le="Min",De="Minimum",Pe="Mod",ze="Multiply",Fe="Negate",Be="NotEqual",Ue="NonMaxSuppressionV3",We="NonMaxSuppressionV4",Ve="NonMaxSuppressionV5",Ge="OnesLike",He="OneHot",qe="PadV2",Xe="Pool",Ye="Pow",Ke="Prelu",Ze="Prod",Je="Range",Qe="Real",$e="Reciprocal",et="Relu",tt="Reshape",nt="ResizeNearestNeighbor",rt="ResizeNearestNeighborGrad",at="ResizeBilinear",it="ResizeBilinearGrad",ot="Relu6",st="Reverse",ut="Round",ct="Rsqrt",lt="ScatterNd",ht="SelectV2",dt="Selu",ft="Slice",pt="Sin",mt="Sinh",vt="Sign",gt="Sigmoid",bt="Softplus",yt="Sqrt",xt="Sum",wt="SpaceToBatchND",Ot="SplitV",kt="Softmax",St="SquaredDifference",_t="Square",jt="Sub",Et="SparseToDense",Tt="StridedSlice",Ct="Tan",Mt="Tanh",At="Tile",Nt="TopK",Rt="Transpose",It="Unpack",Lt="UnsortedSegmentSum",Dt="ZerosLike",Pt="Step",zt="FromPixels",Ft="RotateWithOffset",Bt="_FusedMatMul",Ut="FusedConv2D",Wt="FusedDepthwiseConv2D"},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(161);function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(u){a=!0,i=u}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}}(e,t)||Object(r.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return i}));var r=n(10),a="__op";function i(e){var t=Object.keys(e);if(1!==t.length)throw new Error("Please provide an object with a single key (operation name) mapping to a function. Got an object with "+"".concat(t.length," keys."));var n=t[0],i=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n+=a;var o=function(){r.a.startScope(n);try{var e=i.apply(void 0,arguments);return e instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),r.a.endScope(e),e}catch(t){throw r.a.endScope(null),t}};return Object.defineProperty(o,"name",{value:n,configurable:!0}),o}},function(e,t,n){"use strict";n.d(t,"b",(function(){return S})),n.d(t,"a",(function(){return _}));var r=n(18),a=n(19),i=n(3),o=n.n(i),s=n(13),u=n(5),c=n(11),l=n(39),h=n(177),d=n(7),f=n(91),p=n(2),m=function(){function e(t,n){Object(u.a)(this,e),this.backendTimer=t,this.logger=n,null==n&&(this.logger=new v)}return Object(c.a)(e,[{key:"profileKernel",value:function(e,t,n){for(var r,a=this.backendTimer.time((function(){r=n()})),i=function(t){var n=r[t];n.data().then((function(t){!function(e,t,n){if("float32"!==t)return!1;for(var r=0;r<e.length;r++){var a=e[r];if(isNaN(a)||!isFinite(a))return console.warn("Found ".concat(a," in the result of '").concat(n,"'")),!0}}(t,n.dtype,e)}))},o=0;o<r.length;o++)i(o);return{kernelName:e,outputs:r,inputs:t,timeMs:a.then((function(e){return e.kernelMs})),extraInfo:a.then((function(e){return null!=e.getExtraProfileInfo?e.getExtraProfileInfo():""}))}}},{key:"logKernelProfile",value:function(e){var t=this,n=e.kernelName,r=e.outputs,a=e.timeMs,i=e.inputs,o=e.extraInfo;r.forEach((function(e){Promise.all([e.data(),a,o]).then((function(r){t.logger.logKernelProfile(n,e,r[0],r[1],i,r[2])}))}))}}]),e}();var v=function(){function e(){Object(u.a)(this,e)}return Object(c.a)(e,[{key:"logKernelProfile",value:function(e,t,n,r,a,i){var o="number"===typeof r?p.rightPad("".concat(r,"ms"),9):r.error,s=p.rightPad(e,25),u=t.rank,c=t.size,l=p.rightPad(t.shape.toString(),14),h="";for(var d in a){var f=a[d];if(null!=f){var m=f.shape||t.shape,v=m.length;h+="".concat(d,": ").concat(v,"D ").concat(v>0?m:""," ")}}console.log("%c".concat(s,"\t%c").concat(o,"\t%c").concat(u,"D ").concat(l,"\t%c").concat(c,"\t%c").concat(h,"\t%c").concat(i),"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}}]),e}();function g(e,t,n){for(var r={},a={},i=0;i<t.length;i++)r[t[i].id]=!0;for(var o=0;o<e.length;o++){var s=e[o],u=s.inputs;for(var c in u){for(var l=u[c],h=!1,d=0;d<t.length;
2d++)if(r[l.id]){s.outputs.forEach((function(e){return r[e.id]=!0})),h=!0,a[s.id]=!0;break}if(h)break}}var f={};f[n.id]=!0;for(var p={},m=e.length-1;m>=0;m--)for(var v=e[m],g=v.inputs,b=0;b<v.outputs.length;b++)if(f[v.outputs[b].id]){for(var y in g)f[g[y].id]=!0,p[v.id]=!0;break}for(var x=[],w=0;w<e.length;w++){var O=e[w];if(a[O.id]&&p[O.id]){var k={};for(var S in O.inputs){var _=O.inputs[S];r[_.id]&&(k[S]=_)}var j=Object.assign({},O);j.inputs=k,j.outputs=O.outputs,x.push(j)}}return x}function b(e,t,n,r){for(var a=function(a){var i=t[a],o=[];if(i.outputs.forEach((function(t){var n=e[t.id];null!=n?o.push(n):o.push(null)})),null==i.gradient)throw new Error("Cannot compute gradient: gradient function not found "+"for ".concat(i.kernelName,"."));var s=i.gradient(o),u=function(t){if(!(t in s))throw new Error("Cannot backprop through input ".concat(t,". ")+"Available gradients found: ".concat(Object.keys(s),"."));var a=n((function(){return s[t]()}));if("float32"!==a.dtype)throw new Error("Error in gradient for op ".concat(i.kernelName,". The gradient of input ")+"".concat(t," must have 'float32' dtype, but has '").concat(a.dtype,"'"));var o=i.inputs[t];if(!p.arraysEqual(a.shape,o.shape))throw new Error("Error in gradient for op ".concat(i.kernelName,". The gradient of input ")+"'".concat(t,"' has shape '").concat(a.shape,"', which does not match ")+"the shape of the input '".concat(o.shape,"'"));if(null==e[o.id])e[o.id]=a;else{var u=e[o.id];e[o.id]=r(u,a),u.dispose()}};for(var c in i.inputs)u(c)},i=t.length-1;i>=0;i--)a(i)}var y=n(12),x=n(36),w=function(){function e(){Object(u.a)(this,e),this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null}}return Object(c.a)(e,[{key:"dispose",value:function(){for(var e in this.registeredVariables)this.registeredVariables[e].dispose()}}]),e}(),O=function(){function e(t){Object(u.a)(this,e),this.ENV=t,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new w}return Object(c.a)(e,[{key:"ready",value:function(){var e=Object(s.a)(o.a.mark((function e(){var t,n,r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==this.pendingBackendInit){e.next=2;break}return e.abrupt("return",this.pendingBackendInit.then((function(){})));case 2:if(null==this.backendInstance){e.next=4;break}return e.abrupt("return");case 4:t=this.getSortedBackends(),n=0;case 6:if(!(n<t.length)){e.next=18;break}return r=t[n],e.next=10,this.initializeBackend(r).success;case 10:if(!e.sent){e.next=15;break}return e.next=14,this.setBackend(r);case 14:return e.abrupt("return");case 15:n++,e.next=6;break;case 18:throw new Error("Could not initialize any backends, all backend initializations failed.");case 19:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"backendNames",value:function(){return Object.keys(this.registryFactory)}},{key:"findBackend",value:function(e){if(!(e in this.registry)){if(!(e in this.registryFactory))return null;if(this.initializeBackend(e).asyncInit)return null}return this.registry[e]}},{key:"findBackendFactory",value:function(e){return e in this.registryFactory?this.registryFactory[e].factory:null}},{key:"registerBackend",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return e in this.registryFactory?(console.warn("".concat(e," backend was already registered. ")+"Reusing existing backend factory."),!1):(this.registryFactory[e]={factory:t,priority:n},!0)}},{key:"setBackend",value:function(){var e=Object(s.a)(o.a.mark((function e(t){var n,r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=this.registryFactory[t]){e.next=2;break}throw new Error("Backend name '".concat(t,"' not found in registry"));case 2:if(this.backendName=t,null!=this.registry[t]){e.next=16;break}if(this.backendInstance=null,n=this.initializeBackend(t),r=n.success,!n.asyncInit){e.next=12;break}return e.next=9,r;case 9:e.t0=e.sent,e.next=13;break;case 12:e.t0=r;case 13:if(e.t0){e.next=16;break}return e.abrupt("return",!1);case 16:return this.backendInstance=this.registry[t],this.setupRegisteredKernels(),this.profiler=new m(this.backendInstance),e.abrupt("return",!0);case 20:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setupRegisteredKernels",value:function(){var e=this;Object(f.c)(this.backendName).forEach((function(t){null!=t.setupFunc&&t.setupFunc(e.backendInstance)}))}},{key:"disposeRegisteredKernels",value:function(e){var t=this;Object(f.c)(e).forEach((function(n){null!=n.disposeFunc&&n.disposeFunc(t.registry[e])}))}},{key:"initializeBackend",value:function(e){var t=this,n=this.registryFactory[e];if(null==n)throw new Error("Cannot initialize backend ".concat(e,", no registration found."));try{var r=n.factory();if(Promise.resolve(r)===r){var a=++this.pendingBackendInitId,i=r.then((function(n){return!(a<t.pendingBackendInitId)&&(t.registry[e]=n,t.pendingBackendInit=null,!0)})).catch((function(n){return a<t.pendingBackendInitId||(t.pendingBackendInit=null,console.warn("Initialization of backend ".concat(e," failed")),console.warn(n.stack||n.message)),!1}));return this.pendingBackendInit=i,{success:i,asyncInit:!0}}return this.registry[e]=r,{success:!0,asyncInit:!1}}catch(o){return console.warn("Initialization of backend ".concat(e," failed")),console.warn(o.stack||o.message),{success:!1,asyncInit:!1}}}},{key:"removeBackend",value:function(e){if(!(e in this.registryFactory))throw new Error("".concat(e," backend not found in registry"));this.backendName===e&&null!=this.pendingBackendInit&&this.pendingBackendInitId++,e in this.registry&&(this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e]),delete this.registryFactory[e],this.backendName===e&&(this.pendingBackendInit=null,this.backendName=null,this.backendInstance=null)}},{key:"getSortedBackends",value:function(){var e=this;if(0===Object.keys(this.registryFactory).length)throw new Error("No backend found in registry.");return Object.keys(this.registryFactory).sort((function(t,n){return e.registryFactory[n].priority-e.registryFactory[t].priority}))}},{key:"initializeBackendsAndReturnBest",value:function(){for(var e=this.getSortedBackends(),t=0;t<e.length;t++){var n=e[t],r=this.initializeBackend(n),a=r.success,i=r.asyncInit;if(i||a)return{name:n,asyncInit:i}}throw new Error("Could not initialize any backends, all backend initializations failed.")}},{key:"moveData",value:function(e,t){var n=this.state.tensorInfo.get(t),r=n.backend,a=this.readSync(t);r.disposeData(t),n.backend=e,e.move(t,a,n.shape,n.dtype),this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack[this.state.numDataMovesStack.length-1]++}},{key:"tidy",value:function(e,t){var n,r=this,a=null;if(null==t){if("function"!==typeof e)throw new Error("Please provide a function to tidy()");t=e}else{if("string"!==typeof e&&!(e instanceof String))throw new Error("When calling with two arguments, the first argument to tidy() must be a string");if("function"!==typeof t)throw new Error("When calling with two arguments, the 2nd argument to tidy() must be a function");a=e}return this.scopedRun((function(){return r.startScope(a)}),(function(){return r.endScope(n)}),(function(){return(n=t())instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),n}))}},{key:"scopedRun",value:function(e,t,n){e();try{var r=n();return t(),r}catch(a){throw t(),a}}},{key:"nextTensorId",value:function(){return e.nextTensorId++}},{key:"nextVariableId",value:function(){return e.nextVariableId++}},{key:"clone",value:function(e){var t=this.makeTensorFromDataId(e.dataId,e.shape,e.dtype),n={x:e};return this.addTapeNode(this.state.activeScope.name,n,[t],(function(e){return{x:function(){var t={x:e},n={dtype:"float32"};return _.runKernelFunc((function(t){return t.cast(e,"float32")}),t,null,d.v,n)}}}),[],{}),t}},{key:"runKernel",value:function(e,t,n,r,a){return this.runKernelFunc(null,t,null,e,n,r,a)}},{key:"shouldCheckForMemLeaks",value:function(){return this.ENV.getBool("IS_TEST")}},{key:"checkKernelForMemLeak",value:function(e,t,n){var r=this.backend.numDataIds(),a=0;
2n.forEach((function(e){a+="complex64"===e.dtype?3:1}));var i=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],o=r-t-a-i;if(o>0)throw new Error("Backend '".concat(this.backendName,"' has an internal memory leak ")+"(".concat(o," data ids) after running '").concat(e,"'"))}},{key:"runKernelFunc",value:function(e,t,n,r,a,i,o){var s,u=this,c=[],l=this.isTapeOn();null==r&&(r=null!=this.state.activeScope?this.state.activeScope.name:"");var h,d=this.state.numBytes,p=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);var m,v,g=Object(f.b)(r,this.backendName);if(null!=g)h=function(){var e=u.backend.numDataIds();m=g.kernelFunc({inputs:t,attrs:a,backend:u.backend});var n=Array.isArray(m)?m:[m];u.shouldCheckForMemLeaks()&&u.checkKernelForMemLeak(r,e,n);var s=n.map((function(e){var t=e.dataId,n=e.shape,r=e.dtype;return u.makeTensorFromDataId(t,n,r)}));if(l){var h=u.getTensorsForGradient(r,t,s);if(null==h){null==o&&(o=[]);var d=s.filter((function(e,t){return o[t]}));h=(i||[]).slice().concat(d)}c=u.saveTensorsForBackwardMode(h)}return s};else{var b=function(e){l&&(c=e.map((function(e){return u.keep(u.clone(e))})))};h=function(){var t=u.backend.numDataIds();m=u.tidy((function(){return e(u.backend,b)}));var n=Array.isArray(m)?m:[m];return u.shouldCheckForMemLeaks()&&u.checkKernelForMemLeak(r,t,n),n}}return this.scopedRun((function(){return u.state.kernelDepth++}),(function(){return u.state.kernelDepth--}),(function(){u.ENV.getBool("DEBUG")||u.state.profiling?(v=u.profiler.profileKernel(r,t,(function(){return h()})),u.ENV.getBool("DEBUG")&&u.profiler.logKernelProfile(v),s=v.outputs):s=h()})),l&&this.addTapeNode(r,t,s,n,c,a),this.state.profiling&&this.state.activeProfile.kernels.push({name:r,bytesAdded:this.state.numBytes-d,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-p,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(t).map((function(e){return null!=t[e]?t[e].shape:null})),outputShapes:s.map((function(e){return e.shape})),kernelTimeMs:v.timeMs,extraInfo:v.extraInfo}),Array.isArray(m)?s:s[0]}},{key:"saveTensorsForBackwardMode",value:function(e){var t=this;return e.map((function(e){return t.keep(t.clone(e))}))}},{key:"getTensorsForGradient",value:function(e,t,n){var r=Object(f.a)(e);if(null!=r){var a,i=r.inputsToSave||[],o=r.outputsToSave||[];r.saveAllInputs?(p.assert(Array.isArray(t),(function(){return"saveAllInputs is true, expected inputs to be an array."})),a=Object.keys(t).map((function(e){return t[e]}))):a=i.map((function(e){return t[e]}));var s=n.filter((function(e,t){return o[t]}));return a.concat(s)}return null}},{key:"makeTensor",value:function(e,t,n,r){if(null==e)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",r=r||this.backend;var a=e;"string"===n&&p.isString(e[0])&&(a=e.map((function(e){return p.encodeString(e)})));var i=r.write(a,t,n),o=new y.a(t,n,i,this.nextTensorId());if(this.incRef(o,r),"string"===n){var s=this.state.tensorInfo.get(i),u=Object(p.bytesFromStringArray)(a);this.state.numBytes+=u-s.bytes,s.bytes=u}return o}},{key:"makeTensorFromDataId",value:function(e,t,n,r){n=n||"float32";var a=new y.a(t,n,e,this.nextTensorId());return this.incRef(a,r),a}},{key:"makeVariable",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;n=n||this.nextVariableId().toString(),null!=r&&r!==e.dtype&&(e=e.cast(r));var a=new y.c(e,t,n,this.nextTensorId());if(null!=this.state.registeredVariables[a.name])throw new Error("Variable with name ".concat(a.name," was already registered"));return this.state.registeredVariables[a.name]=a,this.incRef(a,this.backend),a}},{key:"incRef",value:function(e,t){var n=this.state.tensorInfo.has(e.dataId)?this.state.tensorInfo.get(e.dataId).refCount:0;if(this.state.numTensors++,"string"===e.dtype&&this.state.numStringTensors++,0===n){this.state.numDataBuffers++;var r=0;"complex64"!==e.dtype&&"string"!==e.dtype&&(r=e.size*p.bytesPerElement(e.dtype)),this.state.tensorInfo.set(e.dataId,{backend:t||this.backend,dtype:e.dtype,shape:e.shape,bytes:r,refCount:0}),this.state.numBytes+=r}this.state.tensorInfo.get(e.dataId).refCount++,e instanceof y.c||this.track(e)}},{key:"disposeTensor",value:function(e){if(this.state.tensorInfo.has(e.dataId)){this.state.numTensors--,"string"===e.dtype&&this.state.numStringTensors--;var t=this.state.tensorInfo.get(e.dataId);t.refCount<=1?("complex64"!==e.dtype&&(this.state.numBytes-=t.bytes),this.state.numDataBuffers--,t.backend.disposeData(e.dataId),this.state.tensorInfo.delete(e.dataId)):this.state.tensorInfo.get(e.dataId).refCount--}}},{key:"disposeVariables",value:function(){for(var e in this.state.registeredVariables){var t=this.state.registeredVariables[e];this.disposeVariable(t)}
2}},{key:"disposeVariable",value:function(e){this.disposeTensor(e),null!=this.state.registeredVariables[e.name]&&delete this.state.registeredVariables[e.name]}},{key:"memory",value:function(){var e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,null==e.reasons&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e}},{key:"profile",value:function(){var e=Object(s.a)(o.a.mark((function e(t){var n,i,s,u,c;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.state.profiling=!0,n=this.state.numBytes,i=this.state.numTensors,this.state.activeProfile.kernels=[],e.next=6,t();case 6:this.state.activeProfile.result=e.sent,this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max.apply(Math,Object(a.a)(this.state.activeProfile.kernels.map((function(e){return e.totalBytesSnapshot})))),this.state.activeProfile.newBytes=this.state.numBytes-n,this.state.activeProfile.newTensors=this.state.numTensors-i,s=Object(r.a)(this.state.activeProfile.kernels),e.prev=12,s.s();case 14:if((u=s.n()).done){e.next=24;break}return c=u.value,e.next=18,c.kernelTimeMs;case 18:return c.kernelTimeMs=e.sent,e.next=21,c.extraInfo;case 21:c.extraInfo=e.sent;case 22:e.next=14;break;case 24:e.next=29;break;case 26:e.prev=26,e.t0=e.catch(12),s.e(e.t0);case 29:return e.prev=29,s.f(),e.finish(29);case 32:return e.abrupt("return",this.state.activeProfile);case 33:case"end":return e.stop()}}),e,this,[[12,26,29,32]])})));return function(t){return e.apply(this,arguments)}}()},{key:"isTapeOn",value:function(){return this.state.gradientDepth>
20&&0===this.state.kernelDepth}},{key:"addTapeNode",value:function(e,t,n,r,a,i){var o=this,s={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:n,saved:a},u=Object(f.a)(e);null!=u&&(r=u.gradFunc),null!=r&&(s.gradient=function(e){return e=e.map((function(e,t){if(null==e){var r=n[t],a=p.makeZerosTypedArray(r.size,r.dtype);return o.makeTensor(a,r.shape,r.dtype)}return e})),r(e.length>1?e:e[0],a,i)}),this.state.activeTape.push(s)}},{key:"keep",value:function(e){return e.kept=!0,e}},{key:"startTape",value:function(){0===this.state.gradientDepth&&(this.state.activeTape=[]),this.state.gradientDepth++}},{key:"endTape",value:function(){this.state.gradientDepth--}},{key:"startScope",value:function(e){var t={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(t.name=e),this.state.scopeStack.push(t),this.state.activeScope=t}},{key:"endScope",value:function(e){for(var t=this,n=Object(x.getTensorsInContainer)(e),r=new Set(n.map((function(e){return e.id}))),a=0;a<this.state.activeScope.track.length;a++){var i=this.state.activeScope.track[a];i.kept||r.has(i.id)||i.dispose()}var o=this.state.scopeStack.pop();this.state.activeScope=0===this.state.scopeStack.length?null:this.state.scopeStack[this.state.scopeStack.length-1],n.forEach((function(e){e.kept||e.scopeId!==o.id||t.track(e)}))}},{key:"gradients",value:function(e,t,n){var a=this,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(p.assert(t.length>0,(function(){return"gradients() received an empty list of xs."})),null!=n&&"float32"!==n.dtype)throw new Error("dy must have 'float32' dtype, but has '".concat(n.dtype,"'"));var o=this.scopedRun((function(){return a.startTape()}),(function(){return a.endTape()}),(function(){return a.tidy("forward",e)}));p.assert(o instanceof y.a,(function(){return"The result y returned by f() must be a tensor."}));var s=g(this.state.activeTape,t,o);if(!i&&0===s.length&&t.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",(function(){var e={};e[o.id]=null==n?k(o.shape):n,b(e,s,(function(e){return a.tidy(e)}),j);var i=t.map((function(t){return e[t.id]}));return 0===a.state.gradientDepth&&(a.state.activeTape.forEach((function(e){var t,n=Object(r.a)(e.saved);try{for(n.s();!(t=n.n()).done;){t.value.dispose()}}catch(a){n.e(a)}finally{n.f()}})),a.state.activeTape=null),{value:o,grads:i}}))}},{key:"customGrad",value:function(e){var t=this;return p.assert(p.isFunction(e),(function(){return"The f passed in customGrad(f) must be a function."})),function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];var i;p.assert(r.every((function(e){return e instanceof y.a})),(function(){return"The args passed in customGrad(f)(x1, x2,...) must all be tensors"}));var o={};return r.forEach((function(e,t){o[t]=e})),t.runKernelFunc((function(t,n){return i=e.apply(void 0,[].concat(r,[n])),p.assert(i.value instanceof y.a,(function(){return"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"})),p.assert(p.isFunction(i.gradFunc),(function(){return"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."})),i.value}),o,(function(e,t){var n=i.gradFunc(e,t),a=Array.isArray(n)?n:[n];p.assert(a.length===r.length,(function(){return"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...)."})),p.assert(a.every((function(e){return e instanceof y.a})),(function(){return"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors."}));var o={};return a.forEach((function(e,t){o[t]=function(){return e}})),o}))}}},{key:"readSync",value:function(e){return this.state.tensorInfo.get(e).backend.readSync(e)}},{key:"read",value:function(e){return this.state.tensorInfo.get(e).backend.read(e)}},{key:"time",value:function(){var e=Object(s.a)(o.a.mark((function e(t){var n,r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Object(p.now)(),e.next=3,this.backend.time(t);case 3:return(r=e.sent).wallMs=Object(p.now)()-n,e.abrupt("return",r);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"track",value:function(e){return null!=this.state.activeScope&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e}},{key:"reset",value:function(){for(var e in this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new w,this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}},{key:"backend",get:function(){if(null!=this.pendingBackendInit)throw new Error("Backend '".concat(this.backendName,"' has not yet been initialized. Make ")+"sure to await tf.ready() or await tf.setBackend() before calling other methods");if(null==this.backendInstance){var e=this.initializeBackendsAndReturnBest(),t=e.name;if(e.asyncInit)throw new Error("The highest priority backend '".concat(t,"' has not yet been ")+"initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods");this.setBackend(t)}return this.backendInstance}},{key:"registeredVariables",get:function(){return this.state.registeredVariables}}]),e}();function k(e){var t=Object(p.makeOnesTypedArray)(Object(p.sizeFromShape)(e),"float32");return _.makeTensor(t,e,"float32")}function S(){var e=Object(h.b)();if(null==e._tfengine){var t=new l.b(e);e._tfengine=new O(t)}return Object(l.d)(e._tfengine.ENV),Object(y.f)((function(){return e._tfengine})),e._tfengine}O.nextTensorId=0,O.nextVariableId=0;var _=S();function j(e,t){var n={a:e,b:t};return _.runKernelFunc((function(n,r){var a=n.add(e,t);return r([e,t]),a}),n,null,d.d)}},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}n.d(t,"a",(function(){return a}))},function(e,t,n){"use strict";n.d(t,"b",(function(){return v})),n.d(t,"f",(function(){return y}
2)),n.d(t,"e",(function(){return x})),n.d(t,"d",(function(){return w})),n.d(t,"a",(function(){return O})),n.d(t,"c",(function(){return k}));var r=n(15),a=n(16),i=n(3),o=n.n(i),s=n(13),u=n(5),c=n(11),l=n(19),h=n(2);function d(e,t,n,r){var a=Object(h.computeStrides)(t),i=function(e,t,n,r){var a=Object(h.sizeFromShape)(t),i=r[r.length-1],o=new Array(i).fill(0),s=t.length,u="complex64"===n?m(e):e;if(s>1)for(var c=0;c<a/i;c++)for(var l=c*i,d=0;d<i;d++)o[d]=Math.max(o[d],f(u[l+d],0,n).length);return o}(e,t,n,a),o=t.length,s=function e(t,n,r,a,i){var o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],s="complex64"===r?2:1,u=n[0],c=n.length;if(0===c){if("complex64"===r){var h=m(t);return[f(h[0],0,r)]}return"bool"===r?[p(t[0])]:[t[0].toString()]}if(1===c){if(u>20){var d=3*s,v=Array.from(t.slice(0,d)),g=Array.from(t.slice((u-3)*s,u*s));return"complex64"===r&&(v=m(v),g=m(g)),["["+v.map((function(e,t){return f(e,i[t],r)})).join(", ")+", ..., "+g.map((function(e,t){return f(e,i[u-3+t],r)})).join(", ")+"]"]}var b="complex64"===r?m(t):Array.from(t);return["["+b.map((function(e,t){return f(e,i[t],r)})).join(", ")+"]"]}var y=n.slice(1),x=a.slice(1),w=a[0]*s,O=[];if(u>20){for(var k=0;k<3;k++){var S=k*w,_=S+w;O.push.apply(O,Object(l.a)(e(t.slice(S,_),y,r,x,i,!1)))}O.push("...");for(var j=u-3;j<u;j++){var E=j*w,T=E+w;O.push.apply(O,Object(l.a)(e(t.slice(E,T),y,r,x,i,j===u-1)))}}else for(var C=0;C<u;C++){var M=C*w,A=M+w;O.push.apply(O,Object(l.a)(e(t.slice(M,A),y,r,x,i,C===u-1)))}var N=2===c?",":"";O[0]="["+O[0]+N;for(var R=1;R<O.length-1;R++)O[R]=" "+O[R]+N;for(var I=",\n",L=2;L<c;L++)I+="\n";return O[O.length-1]=" "+O[O.length-1]+"]"+(o?"":I),O}(e,t,n,a,i),u=["Tensor"];return r&&(u.push(" dtype: ".concat(n)),u.push(" rank: ".concat(o)),u.push(" shape: [".concat(t,"]")),u.push(" values:")),u.push(s.map((function(e){return" "+e})).join("\n")),u.join("\n")}function f(e,t,n){var r;return r=Array.isArray(e)?"".concat(parseFloat(e[0].toFixed(7))," + ")+"".concat(parseFloat(e[1].toFixed(7)),"j"):Object(h.isString)(e)?"'".concat(e,"'"):"bool"===n?p(e):parseFloat(e.toFixed(7)).toString(),Object(h.rightPad)(r,t)}function p(e){return 0===e?"false":"true"}function m(e){for(var t=[],n=0;n<e.length;n+=2)t.push([e[n],e[n+1]]);return t}var v=function(){function e(t,n,r){var a=this;if(Object(u.a)(this,e),this.dtype=n,this.shape=t.slice(),this.size=h.sizeFromShape(t),null!=r){var i=r.length;h.assert(i===this.size,(function(){return"Length of values '".concat(i,"' does not match the size ")+"inferred by the shape '".concat(a.size,"'.")}))}if("complex64"===n)throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=r||h.getArrayFromDType(n,this.size),this.strides=Object(h.computeStrides)(t)}return Object(c.a)(e,[{key:"set",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];0===r.length&&(r=[0]),h.assert(r.length===this.rank,(function(){return"The number of provided coordinates (".concat(r.length,") must ")+"match the rank (".concat(t.rank,")")}));var i=this.locToIndex(r);this.values[i]=e}},{key:"get",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];0===t.length&&(t=[0]);for(var r=0,a=0,i=t;a<i.length;a++){var o=i[a];if(o<0||o>=this.shape[r]){var s="Requested out of range element at ".concat(t,". ")+" Buffer shape=".concat(this.shape);throw new Error(s)}r++}for(var u=t[t.length-1],c=0;c<t.length-1;++c)u+=this.strides[c]*t[c];return this.values[u]}},{key:"locToIndex",value:function(e){if(0===this.rank)return 0;if(1===this.rank)return e[0];for(var t=e[e.length-1],n=0;n<e.length-1;++n)t+=this.strides[n]*e[n];return t}},{key:"indexToLoc",value:function(e){if(0===this.rank)return[];if(1===this.rank)return[e];for(var t=new Array(this.shape.length),n=0;n<t.length-1;++n)t[n]=Math.floor(e/this.strides[n]),e-=t[n]*this.strides[n];return t[t.length-1]=e,t}},{key:"toTensor",value:function(){return g().makeTensor(this.values,this.shape,this.dtype)}},{key:"rank",get:function(){return this.shape.length}}]),e}(),g=null,b=null;function y(e){g=e}function x(e){b=e}function w(e){e}var O=function(){function e(t,n,r,a){Object(u.a)(this,e),this.kept=!1,this.isDisposedInternal=!1,this.shape=t.slice(),this.dtype=n||"float32",this.size=h.sizeFromShape(t),this.strides=Object(h.computeStrides)(t),this.dataId=r,this.id=a,this.rankType=this.rank<5?this.rank.toString():"higher"}return Object(c.a)(e,[{key:"buffer",value:function(){var e=Object(s.a)(o.a.mark((function e(){var t;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.data();case 2:return t=e.sent,e.abrupt("return",b.buffer(this.shape,this.dtype,t));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"bufferSync",value:function(){return b.buffer(this.shape,this.dtype,this.dataSync())}},{key:"array",value:function(){var e=Object(s.a)(o.a.mark((function e(){var t;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.data();case 2:return t=e.sent,e.abrupt("return",Object(h.toNestedArray)(this.shape,t));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"arraySync",value:function(){return Object(h.toNestedArray)(this.shape,this.dataSync())}},{key:"data",value:function(){var e=Object(s.a)(o.a.mark((function e(){var t,n;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.throwIfDisposed(),t=g().read(this.dataId),"string"!==this.dtype){e.next=13;break}return e.next=5,t;case 5:return n=e.sent,e.prev=6,e.abrupt("return",n.map((function(e){return h.decodeString(e)})));case 10:throw e.prev=10,e.t0=e.catch(6),new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().");case 13:return e.abrupt("return",t);case 14:case"end":return e.stop()}}),e,this,[[6,10]])})));return function(){return e.apply(this,arguments)}}()},{key:"dataSync",value:function(){this.throwIfDisposed();var e=g().readSync(this.dataId);if("string"===this.dtype)try{return e.map((function(e){return h.decodeString(e)}))}catch(t){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e}},{key:"bytes",value:function(){var e=Object(s.a)(o.a.mark((function e(){var t;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.throwIfDisposed(),e.next=3,g().read(this.dataId);case 3:if(t=e.sent,"string"!==this.dtype){e.next=8;break}return e.abrupt("return",t);case 8:return e.abrupt("return",new Uint8Array(t.buffer));case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"dispose",value:function(){this.isDisposed||(g().disposeTensor(this),this.isDisposedInternal=!0)}},{key:"throwIfDisposed",value:function(){if(this.isDisposed)throw new Error("Tensor is disposed.")}},{key:"print",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return b.print(this,e)}},{key:"clone",value:function(){return this.throwIfDisposed(),b.clone(this)}},{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.dataSync();return d(t,this.shape,this.dtype,e)}},{key:"cast",value:function(e){return this.throwIfDisposed(),b.cast(this,e)}},{key:"variable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return this.throwIfDisposed(),g().makeVariable(this,e,t,n)}},{key:"rank",get:function(){return this.shape.length}},{key:"isDisposed",get:function(){return this.isDisposedInternal}}]),e}();Object.defineProperty(O,Symbol.hasInstance,{value:function(e){return!!e&&null!=e.data&&null!=e.dataSync&&null!=e.throwIfDisposed}});var k=function(e){Object(r.a)(n,e);var t=Object(a.a)(n);function n(e,r,a,i){var o;return Object(u.a)(this,n),(o=t.call(this,e.shape,e.dtype,e.dataId,i)).trainable=r,o.name=a,o}return Object(c.a)(n,[{key:"assign",value:function(e){if(e.dtype!==this.dtype)throw new Error("dtype of the new value (".concat(e.dtype,") and ")+"previous value (".concat(this.dtype,") must match"));if(!h.arraysEqual(e.shape,this.shape))throw new Error("shape of the new value (".concat(e.shape,") and ")+"previous value (".concat(this.shape,") must match"));g().disposeTensor(this),this.dataId=e.dataId,g().incRef(this,null)}},{key:"dispose",value:function(){g().disposeVariable(this),this.isDisposedInternal=!0}}]),n}(O);Object.defineProperty(k,Symbol.hasInstance,{value:function(e){return e instanceof O&&null!=e.assign&&e.assign instanceof Function}})},function(e,t,n){"use strict";function r(e,t,n,r,a,i,o){try{var s=e[i](o),u=s.value}catch(c){return void n(c)}s.done?t(u):Promise.resolve(u).then(r,a)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(a,i){var o=e.apply(t,n);function s(e){r(o,a,i,s,u,"next",e)}function u(e){r(o,a,i,s,u,"throw",e)}s(void 0)}))}}n.d(t,"a",(function(){return a}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(9);var u=Object(s.b)({reshape_:function(e,t){var n=Object(i.a)(e,"x","reshape",null);t=o.inferFromImplicitShape(t,n.size),o.assert(n.size===o.sizeFromShape(t),(function(){return"new shape and old shape must have the same number of elements."}));var s={x:n},u={shape:t};return r.a.runKernelFunc((function(e,r){return r([n]),e.reshape(n,t)}),s,null,a.gc,u)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(162);function a(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}
2),t&&Object(r.a)(e,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(22),a=n(220),i=n(234);function o(e){return function(){var t,n=Object(r.a)(e);if(Object(a.a)()){var o=Object(r.a)(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return Object(i.a)(this,t)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(8),a=n(10),i=n(7),o=n(36),s=n(4),u=n(9);var c=Object(u.b)({mul_:function(e,t){var n=Object(s.a)(e,"a","mul"),u=Object(s.a)(t,"b","mul"),c=Object(o.makeTypesMatch)(n,u),l=Object(r.a)(c,2);n=l[0],u=l[1];var h={a:n,b:u};return a.a.runKernelFunc((function(e,t){var r=e.multiply(n,u);return t([n,u]),r}),h,null,i.Ob)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(161);function a(e){if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=Object(r.a)(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i,o=!0,s=!1;return{s:function(){a=e[Symbol.iterator]()},n:function(){var e=a.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==a.return||a.return()}finally{if(s)throw i}}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(176);var a=n(161);function i(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Object(a.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(9);var u=Object(s.b)({cast_:function(e,t){var n=Object(i.a)(e,"x","cast");if(!o.isValidDtype(t))throw new Error("Failed to cast to unknown dtype ".concat(t));if("string"===t&&"string"!==n.dtype||"string"!==t&&"string"===n.dtype)throw new Error("Only strings can be casted to strings");var s={x:n},u={dtype:t};return r.a.runKernelFunc((function(e){return e.cast(n,t)}),s,null,a.v,u)}})},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(22);function a(e,t,n){return(a="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var a=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(r.a)(e)););return e}(e,t);if(a){var i=Object.getOwnPropertyDescriptor(a,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return Zu})),n.d(t,"b",(function(){return fe})),n.d(t,"c",(function(){return Qe})),n.d(t,"d",(function(){return gt})),n.d(t,"e",(function(){return Ve})),n.d(t,"f",(function(){return _s})),n.d(t,"g",(function(){return rs})),n.d(t,"h",(function(){return c})),n.d(t,"i",(function(){return os})),n.d(t,"j",(function(){return ot})),n.d(t,"k",(function(){return hu})),n.d(t,"l",(function(){return ia})),n.d(t,"m",(function(){return Za})),n.d(t,"n",(function(){return Ga})),n.d(t,"o",(function(){return Es})),n.d(t,"p",(function(){return v})),n.d(t,"q",(function(){return I})),n.d(t,"r",(function(){return Lt})),n.d(t,"s",(function(){return Ze})),n.d(t,"t",(function(){return Vs})),n.d(t,"u",(function(){return Is})),n.d(t,"v",(function(){return sn})),n.d(t,"w",(function(){return $})),n.d(t,"x",(function(){return Yt})),n.d(t,"y",(function(){return yo})),n.d(t,"z",(function(){return uu})),n.d(t,"A",(function(){return no})),n.d(t,"B",(function(){return co})),n.d(t,"C",(function(){return ds})),n.d(t,"D",(function(){return Gu})),n.d(t,"E",(function(){return m})),n.d(t,"F",(function(){return j})),n.d(t,"G",(function(){return ca}));var r,a=n(42),i=n(57),o=n(5),s=n(15),u=n(16);void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(e){return"number"===typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:e>0?1:+e}),"name"in Function.prototype===!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(void 0!==r&&null!==r)for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t});var c=2;function l(){}Object.assign(l.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=t.slice(0),r=0,a=n.length;r<a;r++)n[r].call(this,e)}}}});for(var h=[],d=0;d<256;d++)h[d]=(d<16?"0":"")+d.toString(16);var f,p={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;
vendor: 4,314 bytes, line 2
2return(h[255&e]+h[e>>8&255]+h[e>>16&255]+h[e>>24&255]+"-"+h[255&t]+h[t>>8&255]+"-"+h[t>>16&15|64]+h[t>>24&255]+"-"+h[63&n|128]+h[n>>8&255]+"-"+h[n>>16&255]+h[n>>24&255]+h[255&r]+h[r>>8&255]+h[r>>16&255]+h[r>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,a){return r+(e-t)*(a-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*p.DEG2RAD},radToDeg:function(e){return e*p.RAD2DEG},isPowerOfTwo:function(e){return 0===(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,a){var i=Math.cos,o=Math.sin,s=i(n/2),u=o(n/2),c=i((t+r)/2),l=o((t+r)/2),h=i((t-r)/2),d=o((t-r)/2),f=i((r-t)/2),p=o((r-t)/2);switch(a){case"XYX":e.set(s*l,u*h,u*d,s*c);break;case"YZY":e.set(u*d,s*l,u*h,s*c);break;case"ZXZ":e.set(u*h,u*d,s*l,s*c);break;case"XZX":e.set(s*l,u*p,u*f,s*c);break;case"YXY":e.set(u*f,s*l,u*p,s*c);break;case"ZYZ":e.set(u*p,u*f,s*l,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+a)}}};function m(e,t){this.x=e||0,this.y=t||0}function v(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(m.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(m.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}
vendor: 6,975 bytes, line 2
2,round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},cross:function(e){return this.x*e.y-this.y*e.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=Math.atan2(-this.y,-this.x)+Math.PI;return e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var n=Math.cos(t),r=Math.sin(t),a=this.x-e.x,i=this.y-e.y;return this.x=a*n-i*r+e.x,this.y=a*r+i*n+e.y,this},random:function(){return this.x=Math.random(),this.y=Math.random(),this}}),Object.assign(v.prototype,{isMatrix3:!0,set:function(e,t,n,r,a,i,o,s,u){var c=this.elements;return c[0]=e,c[1]=r,c[2]=o,c[3]=t,c[4]=a,c[5]=s,c[6]=n,c[7]=i,c[8]=u,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this},extractBasis:function(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,a=this.elements,i=n[0],o=n[3],s=n[6],u=n[1],c=n[4],l=n[7],h=n[2],d=n[5],f=n[8],p=r[0],m=r[3],v=r[6],g=r[1],b=r[4],y=r[7],x=r[2],w=r[5],O=r[8];return a[0]=i*p+o*g+s*x,a[3]=i*m+o*b+s*w,a[6]=i*v+o*y+s*O,a[1]=u*p+c*g+l*x,a[4]=u*m+c*b+l*w,a[7]=u*v+c*y+l*O,a[2]=h*p+d*g+f*x,a[5]=h*m+d*b+f*w,a[8]=h*v+d*y+f*O,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],a=e[3],i=e[4],o=e[5],s=e[6],u=e[7],c=e[8];return t*i*c-t*o*u-n*a*c+n*o*s+r*a*u-r*i*s},getInverse:function(e,t){void 0!==t&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var n=e.elements,r=this.elements,a=n[0],i=n[1],o=n[2],s=n[3],u=n[4],c=n[5],l=n[6],h=n[7],d=n[8],f=d*u-c*h,p=c*l-d*s,m=h*s-u*l,v=a*f+i*p+o*m;if(0===v)return this.set(0,0,0,0,0,0,0,0,0);var g=1/v;return r[0]=f*g,r[1]=(o*h-d*i)*g,r[2]=(c*i-o*u)*g,r[3]=p*g,r[4]=(d*a-o*l)*g,r[5]=(o*s-c*a)*g,r[6]=m*g,r[7]=(i*l-h*a)*g,r[8]=(u*a-i*s)*g,this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},setUvTransform:function(e,t,n,r,a,i,o){var s=Math.cos(a),u=Math.sin(a);this.set(n*s,n*u,-n*(s*i+u*o)+i+e,-r*u,r*s,-r*(-u*i+s*o)+o+t,0,0,1)},scale:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this},rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,a=r[0],i=r[3],o=r[6],s=r[1],u=r[4],c=r[7];return r[0]=t*a+n*s,r[3]=t*i+n*u,r[6]=t*o+n*c,r[1]=-n*a+t*s,r[4]=-n*i+t*u,r[7]=-n*o+t*c,this},translate:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}});var g={getDataURL:function(e){var t;if("undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)t=e;else{void 0===f&&(f=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),f.width=e.width,f.height=e.height;var n=f.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=f}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}},b=0;function y(e,t,n,r,a,i,o,s,u,c){Object.defineProperty(this,"id",{value:b++}),this.uuid=p.generateUUID(),this.name="",this.image=void 0!==e?e:y.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:y.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:1001,this.wrapT=void 0!==r?r:1001,this.magFilter=void 0!==a?a:1006,this.minFilter=void 0!==i?i:1008,this.anisotropy=void 0!==u?u:1,this.format=void 0!==o?o:1023,this.internalFormat=null,this.type=void 0!==s?s:1009,this.offset=new m(0,0),this.repeat=new m(1,1),this.center=new m(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new v,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==c?c:3e3,this.version=0,this.onUpdate=null}function x(e,t,n,r){this.x=e||0,this.y=t||0,this.z=n||0,this.w=void 0!==r?r:1}function w(e,t,n){this.width=e,this.height=t,this.scissor=new x(0,0,e,t),this.scissorTest=!1,this.viewport=new x(0,0,e,t),n=n||{},this.texture=new y(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:1006,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}
vendor: 4,444 bytes, line 2
2function O(e,t,n){w.call(this,e,t,n),this.samples=4}function k(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._w=void 0!==r?r:1}y.DEFAULT_IMAGE=void 0,y.DEFAULT_MAPPING=300,y.prototype=Object.assign(Object.create(l.prototype),{constructor:y,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"===typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=p.generateUUID()),!t&&void 0===e.images[r.uuid]){var a;if(Array.isArray(r)){a=[];for(var i=0,o=r.length;i<o;i++)a.push(g.getDataURL(r[i]))}else a=g.getDataURL(r);e.images[r.uuid]={uuid:r.uuid,url:a}}n.image=r.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(y.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.defineProperties(x.prototype,{width:{get:function(){return this.z},set:function(e){this.z=e}},height:{get:function(){return this.w},set:function(e){this.w=e}}}),Object.assign(x.prototype,{isVector4:!0,set:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.
2y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,a=this.w,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r+i[12]*a,this.y=i[1]*t+i[5]*n+i[9]*r+i[13]*a,this.z=i[2]*t+i[6]*n+i[10]*r+i[14]*a,this.w=i[3]*t+i[7]*n+i[11]*r+i[15]*a,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,n,r,a,i=e.elements,o=i[0],s=i[4],u=i[8],c=i[1],l=i[5],h=i[9],d=i[2],f=i[6],p=i[10];if(Math.abs(s-c)<.01&&Math.abs(u-d)<.01&&Math.abs(h-f)<.01){if(Math.abs(s+c)<.1&&Math.abs(u+d)<.1&&Math.abs(h+f)<.1&&Math.abs(o+l+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var m=(o+1)/2,v=(l+1)/2,g=(p+1)/2,b=(s+c)/4,y=(u+d)/4,x=(h+f)/4;return m>v&&m>g?m<.01?(n=0,r=.707106781,a=.707106781):(r=b/(n=Math.sqrt(m)),a=y/n):v>g?v<.01?(n=.707106781,r=0,a=.707106781):(n=b/(r=Math.sqrt(v)),a=x/r):g<.01?(n=.707106781,r=.707106781,a=0):(n=y/(a=Math.sqrt(g)),r=x/a),this.set(n,r,a,t),this}var w=Math.sqrt((f-h)*(f-h)+(u-d)*(u-d)+(c-s)*(c-s));return Math.abs(w)<.001&&(w=1),this.x=(f-h)/w,this.y=(u-d)/w,this.z=(c-s)/w,this.w=Math.acos((o+l+p-1)/2),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}),w.prototype=Object.assign(Object.create(l.prototype),{constructor:w,isWebG
2LRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),O.prototype=Object.assign(Object.create(w.prototype),{constructor:O,isWebGLMultisampleRenderTarget:!0,copy:function(e){return w.prototype.copy.call(this,e),this.samples=e.samples,this}}),Object.assign(k,{slerp:function(e,t,n,r){return n.copy(e).slerp(t,r)},slerpFlat:function(e,t,n,r,a,i,o){var s=n[r+0],u=n[r+1],c=n[r+2],l=n[r+3],h=a[i+0],d=a[i+1],f=a[i+2],p=a[i+3];if(l!==p||s!==h||u!==d||c!==f){var m=1-o,v=s*h+u*d+c*f+l*p,g=v>=0?1:-1,b=1-v*v;if(b>Number.EPSILON){var y=Math.sqrt(b),x=Math.atan2(y,v*g);m=Math.sin(m*x)/y,o=Math.sin(o*x)/y}var w=o*g;if(s=s*m+h*w,u=u*m+d*w,c=c*m+f*w,l=l*m+p*w,m===1-o){var O=1/Math.sqrt(s*s+u*u+c*c+l*l);s*=O,u*=O,c*=O,l*=O}}e[t]=s,e[t+1]=u,e[t+2]=c,e[t+3]=l},multiplyQuaternionsFlat:function(e,t,n,r,a,i){var o=n[r],s=n[r+1],u=n[r+2],c=n[r+3],l=a[i],h=a[i+1],d=a[i+2],f=a[i+3];return e[t]=o*f+c*l+s*d-u*h,e[t+1]=s*f+c*h+u*l-o*d,e[t+2]=u*f+c*d+o*h-s*l,e[t+3]=c*f-o*l-s*h-u*d,e}}),Object.defineProperties(k.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}}),Object.assign(k.prototype,{isQuaternion:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,r=e._y,a=e._z,i=e.order,o=Math.cos,s=Math.sin,u=o(n/2),c=o(r/2),l=o(a/2),h=s(n/2),d=s(r/2),f=s(a/2);switch(i){case"XYZ":this._x=h*c*l+u*d*f,this._y=u*d*l-h*c*f,this._z=u*c*f+h*d*l,this._w=u*c*l-h*d*f;break;case"YXZ":this._x=h*c*l+u*d*f,this._y=u*d*l-h*c*f,this._z=u*c*f-h*d*l,this._w=u*c*l+h*d*f;break;case"ZXY":this._x=h*c*l-u*d*f,this._y=u*d*l+h*c*f,this._z=u*c*f+h*d*l,this._w=u*c*l-h*d*f;break;case"ZYX":this._x=h*c*l-u*d*f,this._y=u*d*l+h*c*f,this._z=u*c*f-h*d*l,this._w=u*c*l+h*d*f;break;case"YZX":this._x=h*c*l+u*d*f,this._y=u*d*l+h*c*f,this._z=u*c*f-h*d*l,this._w=u*c*l-h*d*f;break;case"XZY":this._x=h*c*l-u*d*f,this._y=u*d*l-h*c*f,this._z=u*c*f+h*d*l,this._w=u*c*l+h*d*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+i)}return!1!==t&&this._onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,r=n[0],a=n[4],i=n[8],o=n[1],s=n[5],u=n[9],c=n[2],l=n[6],h=n[10],d=r+s+h;return d>0?(t=.5/Math.sqrt(d+1),this._w=.25/t,this._x=(l-u)*t,this._y=(i-c)*t,this._z=(o-a)*t):r>s&&r>h?(t=2*Math.sqrt(1+r-s-h),this._w=(l-u)/t,this._x=.25*t,this._y=(a+o)/t,this._z=(i+c)/t):s>h?(t=2*Math.sqrt(1+s-r-h),this._w=(i-c)/t,this._x=(a+o)/t,this._y=.25*t,this._z=(u+l)/t):(t=2*Math.sqrt(1+h-r-s),this._w=(o-a)/t,this._x=(i+c)/t,this._y=(u+l)/t,this._z=.25*t),this._onChangeCallback(),this},setFromUnitVectors:function(e,t){var n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(p.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var n=this.angleTo(e);if(0===n)return this;var r=Math.min(1,t/n);return this.slerp(e,r),this},inverse:function(){return this.conjugate()}
vendor: 10,143 bytes, line 2
2,conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,r=e._y,a=e._z,i=e._w,o=t._x,s=t._y,u=t._z,c=t._w;return this._x=n*c+i*o+r*u-a*s,this._y=r*c+i*s+a*o-n*u,this._z=a*c+i*u+n*s-r*o,this._w=i*c-n*o-r*s-a*u,this._onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,a=this._z,i=this._w,o=i*e._w+n*e._x+r*e._y+a*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=i,this._x=n,this._y=r,this._z=a,this;var s=1-o*o;if(s<=Number.EPSILON){var u=1-t;return this._w=u*i+t*this._w,this._x=u*n+t*this._x,this._y=u*r+t*this._y,this._z=u*a+t*this._z,this.normalize(),this._onChangeCallback(),this}var c=Math.sqrt(s),l=Math.atan2(c,o),h=Math.sin((1-t)*l)/c,d=Math.sin(t*l)/c;return this._w=i*h+this._w*d,this._x=n*h+this._x*d,this._y=r*h+this._y*d,this._z=a*h+this._z*d,this._onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},fromBufferAttribute:function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}});var S=new j,_=new k;function j(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}Object.assign(j.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(_.setFromEuler(e))},applyAxisAngle:function(e,t){return this.applyQuaternion(_.setFromAxisAngle(e,t))},applyMatrix3:function(e){var t=this.x,n=this.y,r=this.z,a=e.elements;return this.x=a[0]*t+a[3]*n+a[6]*r,this.y=a[1]*t+a[4]*n+a[7]*r,this.z=a[2]*t+a[5]*n+a[8]*r,this},applyNormalMatrix:function(e){return this.applyMatrix3(e).normalize()},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,a=e.elements,i=1/(a[3]*t+a[7]*n+a[11]*r+a[15]);return this.x=(a[0]*t+a[4]*n+a[8]*r+a[12])*i,this.y=(a[1]*t+a[5]*n+a[9]*r+a[13])*i,this.z=(a[2]*t+a[6]*n+a[10]*r+a[14])*i,this},applyQuaternion:function(e){var t=this.x,n=this.y,r=this.z,a=e.x,i=e.y,o=e.z,s=e.w,u=s*t+i*r-o*n,c=s*n+o*t-a*r,l=s*r+a*n-i*t,h=-a*t-i*n-o*r;return this.x=u*s+h*-a+c*-o-l*-i,this.y=c*s+h*-i+l*-a-u*-o,this.z=l*s+h*-o+u*-i-c*-a,this},project:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},unproject:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},transformDirection:function(e){var t=this.x,n=this.y,r=this.z,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r,this.y=a[1]*t+a[5]*n+a[9]*r,this.z=a[2]*t+a[6]*n+a[10]*r,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this},cross:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var n=e.x,r=e.y,a=e.z,i=t.x,o=t.y,s=t.z;return this.x=r*s-a*o,this.y=a*i-n*s,this.z=n*o-r*i,this},projectOnVector:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)},projectOnPlane:function(e){return S.copy(this).projectOnVector(e),this.sub(S)},reflect:function(e){return this.sub(S.copy(e).multiplyScalar(2*this.dot(e)))},angleTo:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var n=this.dot(e)/t;return Math.acos(p.clamp(n,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},setFromSphericalCoords:function(e,t,n){var r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this},setFromCylindrical:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},setFromCylindricalCoords:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},setFromMatrix3Column:function(e,t){return this.fromArray(e.elements,3*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}});
vendor: 5,470 bytes, line 2
2var E=new j,T=new I,C=new j(0,0,0),M=new j(1,1,1),A=new j,N=new j,R=new j;function I(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}Object.assign(I.prototype,{isMatrix4:!0,set:function(e,t,n,r,a,i,o,s,u,c,l,h,d,f,p,m){var v=this.elements;return v[0]=e,v[4]=t,v[8]=n,v[12]=r,v[1]=a,v[5]=i,v[9]=o,v[13]=s,v[2]=u,v[6]=c,v[10]=l,v[14]=h,v[3]=d,v[7]=f,v[11]=p,v[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new I).fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this},copyPosition:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this},extractRotation:function(e){var t=this.elements,n=e.elements,r=1/E.setFromMatrixColumn(e,0).length(),a=1/E.setFromMatrixColumn(e,1).length(),i=1/E.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*a,t[5]=n[5]*a,t[6]=n[6]*a,t[7]=0,t[8]=n[8]*i,t[9]=n[9]*i,t[10]=n[10]*i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,r=e.y,a=e.z,i=Math.cos(n),o=Math.sin(n),s=Math.cos(r),u=Math.sin(r),c=Math.cos(a),l=Math.sin(a);if("XYZ"===e.order){var h=i*c,d=i*l,f=o*c,p=o*l;t[0]=s*c,t[4]=-s*l,t[8]=u,t[1]=d+f*u,t[5]=h-p*u,t[9]=-o*s,t[2]=p-h*u,t[6]=f+d*u,t[10]=i*s}else if("YXZ"===e.order){var m=s*c,v=s*l,g=u*c,b=u*l;t[0]=m+b*o,t[4]=g*o-v,t[8]=i*u,t[1]=i*l,t[5]=i*c,t[9]=-o,t[2]=v*o-g,t[6]=b+m*o,t[10]=i*s}else if("ZXY"===e.order){m=s*c,v=s*l,g=u*c,b=u*l;t[0]=m-b*o,t[4]=-i*l,t[8]=g+v*o,t[1]=v+g*o,t[5]=i*c,t[9]=b-m*o,t[2]=-i*u,t[6]=o,t[10]=i*s}else if("ZYX"===e.order){h=i*c,d=i*l,f=o*c,p=o*l;t[0]=s*c,t[4]=f*u-d,t[8]=h*u+p,t[1]=s*l,t[5]=p*u+h,t[9]=d*u-f,t[2]=-u,t[6]=o*s,t[10]=i*s}else if("YZX"===e.order){var y=i*s,x=i*u,w=o*s,O=o*u;t[0]=s*c,t[4]=O-y*l,t[8]=w*l+x,t[1]=l,t[5]=i*c,t[9]=-o*c,t[2]=-u*c,t[6]=x*l+w,t[10]=y-O*l}else if("XZY"===e.order){y=i*s,x=i*u,w=o*s,O=o*u;t[0]=s*c,t[4]=-l,t[8]=u*c,t[1]=y*l+O,t[5]=i*c,t[9]=x*l-w,t[2]=w*l-x,t[6]=o*c,t[10]=O*l+y}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(e){return this.compose(C,e,M)},lookAt:function(e,t,n){var r=this.elements;return R.subVectors(e,t),0===R.lengthSq()&&(R.z=1),R.normalize(),A.crossVectors(n,R),0===A.lengthSq()&&(1===Math.abs(n.z)?R.x+=1e-4:R.z+=1e-4,R.normalize(),A.crossVectors(n,R)),A.normalize(),N.crossVectors(R,A),r[0]=A.x,r[4]=N.x,r[8]=R.x,r[1]=A.y,r[5]=N.y,r[9]=R.y,r[2]=A.z,r[6]=N.z,r[10]=R.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,a=this.elements,i=n[0],o=n[4],s=n[8],u=n[12],c=n[1],l=n[5],h=n[9],d=n[13],f=n[2],p=n[6],m=n[10],v=n[14],g=n[3],b=n[7],y=n[11],x=n[15],w=r[0],O=r[4],k=r[8],S=r[12],_=r[1],j=r[5],E=r[9],T=r[13],C=r[2],M=r[6],A=r[10],N=r[14],R=r[3],I=r[7],L=r[11],D=r[15];return a[0]=i*w+o*_+s*C+u*R,a[4]=i*O+o*j+s*M+u*I,a[8]=i*k+o*E+s*A+u*L,a[12]=i*S+o*T+s*N+u*D,a[1]=c*w+l*_+h*C+d*R,a[5]=c*O+l*j+h*M+d*I,a[9]=c*k+l*E+h*A+d*L,a[13]=c*S+l*T+h*N+d*D,a[2]=f*w+p*_+m*C+v*R,a[6]=f*O+p*j+m*M+v*I,a[10]=f*k+p*E+m*A+v*L,a[14]=f*S+p*T+m*N+v*D,a[3]=g*w+b*_+y*C+x*R,a[7]=g*O+b*j+y*M+x*I,a[11]=g*k+b*E+y*A+x*L,a[15]=g*S+b*T+y*N+x*D,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},determinant:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],a=e[12],i=e[1],o=e[5],s=e[9],u=e[13],c=e[2],l=e[6],h=e[10],d=e[14];return e[3]*(+a*s*l-r*u*l-a*o*h+n*u*h+r*o*d-n*s*d)+e[7]*(+t*s*d-t*u*h+a*i*h-r*i*d+r*u*c-a*s*c)+e[11]*(+t*u*l-t*o*d-a*i*l+n*i*d+a*o*c-n*u*c)+e[15]*(-r*o*c-t*s*l+t*o*h+r*i*l-n*i*h+n*s*c)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(e,t,n){var r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this},getInverse:function(e,t){void 0!==t&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var n=this.elements,r=e.elements,a=r[0],i=r[1],o=r[2],s=r[3],u=r[4],c=r[5],l=r[6],h=r[7],d=r[8],f=r[9],p=r[10],m=r[11],v=r[12],g=r[13],b=r[14],y=r[15],x=f*b*h-g*p*h+g*l*m-c*b*m-f*l*y+c*p*y,w=v*p*h-d*b*h-v*l*m+u*b*m+d*l*y-u*p*y,O=d*g*h-v*f*h+v*c*m-u*g*m-d*c*y+u*f*y,k=v*f*l-d*g*l-v*c*p+u*g*p+d*c*b-u*f*b,S=a*x+i*w+o*O+s*k;if(0===S)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var _=1/S;
vendor: 4,765 bytes, line 2
2return n[0]=x*_,n[1]=(g*p*s-f*b*s-g*o*m+i*b*m+f*o*y-i*p*y)*_,n[2]=(c*b*s-g*l*s+g*o*h-i*b*h-c*o*y+i*l*y)*_,n[3]=(f*l*s-c*p*s-f*o*h+i*p*h+c*o*m-i*l*m)*_,n[4]=w*_,n[5]=(d*b*s-v*p*s+v*o*m-a*b*m-d*o*y+a*p*y)*_,n[6]=(v*l*s-u*b*s-v*o*h+a*b*h+u*o*y-a*l*y)*_,n[7]=(u*p*s-d*l*s+d*o*h-a*p*h-u*o*m+a*l*m)*_,n[8]=O*_,n[9]=(v*f*s-d*g*s-v*i*m+a*g*m+d*i*y-a*f*y)*_,n[10]=(u*g*s-v*c*s+v*i*h-a*g*h-u*i*y+a*c*y)*_,n[11]=(d*c*s-u*f*s-d*i*h+a*f*h+u*i*m-a*c*m)*_,n[12]=k*_,n[13]=(d*g*o-v*f*o+v*i*p-a*g*p-d*i*b+a*f*b)*_,n[14]=(v*c*o-u*g*o-v*i*l+a*g*l+u*i*b-a*c*b)*_,n[15]=(u*f*o-d*c*o+d*i*l-a*f*l-u*i*p+a*c*p)*_,this},scale:function(e){var t=this.elements,n=e.x,r=e.y,a=e.z;return t[0]*=n,t[4]*=r,t[8]*=a,t[1]*=n,t[5]*=r,t[9]*=a,t[2]*=n,t[6]*=r,t[10]*=a,t[3]*=n,t[7]*=r,t[11]*=a,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))},makeTranslation:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var n=Math.cos(t),r=Math.sin(t),a=1-n,i=e.x,o=e.y,s=e.z,u=a*i,c=a*o;return this.set(u*i+n,u*o-r*s,u*s+r*o,0,u*o+r*s,c*o+n,c*s-r*i,0,u*s-r*o,c*s+r*i,a*s*s+n,0,0,0,0,1),this},makeScale:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,n){var r=this.elements,a=t._x,i=t._y,o=t._z,s=t._w,u=a+a,c=i+i,l=o+o,h=a*u,d=a*c,f=a*l,p=i*c,m=i*l,v=o*l,g=s*u,b=s*c,y=s*l,x=n.x,w=n.y,O=n.z;return r[0]=(1-(p+v))*x,r[1]=(d+y)*x,r[2]=(f-b)*x,r[3]=0,r[4]=(d-y)*w,r[5]=(1-(h+v))*w,r[6]=(m+g)*w,r[7]=0,r[8]=(f+b)*O,r[9]=(m-g)*O,r[10]=(1-(h+p))*O,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this},decompose:function(e,t,n){var r=this.elements,a=E.set(r[0],r[1],r[2]).length(),i=E.set(r[4],r[5],r[6]).length(),o=E.set(r[8],r[9],r[10]).length();this.determinant()<0&&(a=-a),e.x=r[12],e.y=r[13],e.z=r[14],T.copy(this);var s=1/a,u=1/i,c=1/o;return T.elements[0]*=s,T.elements[1]*=s,T.elements[2]*=s,T.elements[4]*=u,T.elements[5]*=u,T.elements[6]*=u,T.elements[8]*=c,T.elements[9]*=c,T.elements[10]*=c,t.setFromRotationMatrix(T),n.x=a,n.y=i,n.z=o,this},makePerspective:function(e,t,n,r,a,i){void 0===i&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*a/(t-e),u=2*a/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),h=-(i+a)/(i-a),d=-2*i*a/(i-a);return o[0]=s,o[4]=0,o[8]=c,o[12]=0,o[1]=0,o[5]=u,o[9]=l,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(e,t,n,r,a,i){var o=this.elements,s=1/(t-e),u=1/(n-r),c=1/(i-a),l=(t+e)*s,h=(n+r)*u,d=(i+a)*c;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-l,o[1]=0,o[5]=2*u,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2*c,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}});var L=new I,D=new k;function P(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._order=r||P.DefaultOrder}function z(){this.mask=1}P.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],P.DefaultOrder="XYZ",Object.defineProperties(P.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}}),Object.assign(P.prototype,{isEuler:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var r=p.clamp,a=e.elements,i=a[0],o=a[4],s=a[8],u=a[
21],c=a[5],l=a[9],h=a[2],d=a[6],f=a[10];switch(t=t||this._order){case"XYZ":this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,f),this._z=Math.atan2(-o,i)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-r(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(s,f),this._z=Math.atan2(u,c)):(this._y=Math.atan2(-h,i),this._z=0);break;case"ZXY":this._x=Math.asin(r(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(u,i));break;case"ZYX":this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(u,i)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(r(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-h,i)):(this._x=0,this._y=Math.atan2(s,f));break;case"XZY":this._z=Math.asin(-r(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(s,i)):(this._x=Math.atan2(-l,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!1!==n&&this._onChangeCallback(),this},setFromQuaternion:function(e,t,n){return L.makeRotationFromQuaternion(e),this.setFromRotationMatrix(L,t,n)},setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(e){return D.setFromEuler(this),this.setFromQuaternion(D,e)},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new j(this._x,this._y,this._z)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}}),Object.assign(z.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask|=1<<e|0},enableAll:function(){this.mask=-1},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},disableAll:function(){this.mask=0},test:function(e){return 0!==(this.mask&e.mask)}});var F=0,B=new j,U=new k,W=new I,V=new j,G=new j,H=new j,q=new k,X=new j(1,0,0),Y=new j(0,1,0),K=new j(0,0,1),Z={type:"added"},J={type:"removed"};function Q(){Object.defineProperty(this,"id",{value:F++}),this.uuid=p.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Q.DefaultUp.clone();var e=new j,t=new P,n=new k,r=new j(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new I},normalMatrix:{value:new v}}),this.matrix=new I,this.matrixWorld=new I,this.matrixAutoUpdate=Q.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new z,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function $(){Q.call(this),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Q.DefaultUp=new j(0,1,0),Q.DefaultMatrixAutoUpdate=!0,Q.prototype=Object.assign(Object.create(l.prototype),{constructor:Q,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)}
vendor: 4,302 bytes, line 2
2,setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(e,t){return U.setFromAxisAngle(e,t),this.quaternion.multiply(U),this},rotateOnWorldAxis:function(e,t){return U.setFromAxisAngle(e,t),this.quaternion.premultiply(U),this},rotateX:function(e){return this.rotateOnAxis(X,e)},rotateY:function(e){return this.rotateOnAxis(Y,e)},rotateZ:function(e){return this.rotateOnAxis(K,e)},translateOnAxis:function(e,t){return B.copy(e).applyQuaternion(this.quaternion),this.position.add(B.multiplyScalar(t)),this},translateX:function(e){return this.translateOnAxis(X,e)},translateY:function(e){return this.translateOnAxis(Y,e)},translateZ:function(e){return this.translateOnAxis(K,e)},localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(e){return e.applyMatrix4(W.getInverse(this.matrixWorld))},lookAt:function(e,t,n){e.isVector3?V.copy(e):V.set(e,t,n);var r=this.parent;this.updateWorldMatrix(!0,!1),G.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?W.lookAt(G,V,this.up):W.lookAt(V,G,this.up),this.quaternion.setFromRotationMatrix(W),r&&(W.extractRotation(r.matrixWorld),U.setFromRotationMatrix(W),this.quaternion.premultiply(U.inverse()))},add:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(Z)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var n=this.children.indexOf(e);return-1!==n&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(J)),this},attach:function(e){return this.updateWorldMatrix(!0,!1),W.getInverse(this.matrixWorld),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),W.multiply(e.parent.matrixWorld)),e.applyMatrix4(W),e.updateWorldMatrix(!1,!1),this.add(e),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var n=0,r=this.children.length;n<r;n++){var a=this.children[n].getObjectByProperty(e,t);if(void 0!==a)return a}},getWorldPosition:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),e=new j),this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new k),this.updateMatrixWorld(!0),this.matrixWorld.decompose(G,e,H),e},getWorldScale:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),e=new j),this.updateMatrixWorld(!0),this.matrixWorld.decompose(G,q,e),e},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),e=new j),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()},raycast:function(){},traverse:function(e){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)},updateWorldMatrix:function(e,t){var n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix
vendor: 4,239 bytes, line 2
2):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t)for(var r=this.children,a=0,i=r.length;a<i;a++)r[a].updateWorldMatrix(!1,!0)},toJSON:function(e){var t=void 0===e||"string"===typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};function a(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){r.geometry=a(e.geometries,this.geometry);var i=this.geometry.parameters;if(void 0!==i&&void 0!==i.shapes){var o=i.shapes;if(Array.isArray(o))for(var s=0,u=o.length;s<u;s++){var c=o[s];a(e.shapes,c)}else a(e.shapes,o)}}if(void 0!==this.material)if(Array.isArray(this.material)){var l=[];for(s=0,u=this.material.length;s<u;s++)l.push(a(e.materials,this.material[s]));r.material=l}else r.material=a(e.materials,this.material);if(this.children.length>0){r.children=[];for(s=0;s<this.children.length;s++)r.children.push(this.children[s].toJSON(e).object)}if(t){var h=m(e.geometries),d=m(e.materials),f=m(e.textures),p=m(e.images);o=m(e.shapes);h.length>0&&(n.geometries=h),d.length>0&&(n.materials=d),f.length>0&&(n.textures=f),p.length>0&&(n.images=p),o.length>0&&(n.shapes=o)}return n.object=r,n;function m(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var n=0;n<e.children.length;n++){var r=e.children[n];this.add(r.clone())}return this}}),$.prototype=Object.assign(Object.create(Q.prototype),{constructor:$,isScene:!0,copy:function(e,t){return Q.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var t=Q.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.environment&&(t.object.environment=this.environment.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t},dispose:function(){this.dispatchEvent({type:"dispose"})}});var ee=[new j,new j,new j,new j,new j,new j,new j,new j],te=new j,ne=new fe,re=new j,ae=new j,ie=new j,oe=new j,se=new j,ue=new j,ce=new j,le=new j,he=new j,de=new j;function fe(e,t){this.min=void 0!==e?e:new j(1/0,1/0,1/0),this.max=void 0!==t?t:new j(-1/0,-1/0,-1/0)}function pe(e,t,n,r,a){var i,o;for(i=0,o=e.length-3;i<=o;i+=3){de.fromArray(e,i);var s=a.x*Math.abs(de.x)+a.y*Math.abs(de.y)+a.z*Math.abs(de.z),u=t.dot(de),c=n.dot(de),l=r.dot(de);if(Math.max(-Math.max(u,c,l),Math.min(u,c,l))>s)return!1}return!0}Object.assign(fe.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,n=1/0,r=1/0,a=-1/0,i=-1/0,o=-1/0,s=0,u=e.length;s<u;s+=3){var c=e[s],l=e[s+1],h=e[s+2];c<t&&(t=c),l<n&&(n=l),h<r&&(r=h),c>a&&(a=c),l>i&&(i=l),h>
2o&&(o=h)}return this.min.set(t,n,r),this.max.set(a,i,o),this},setFromBufferAttribute:function(e){for(var t=1/0,n=1/0,r=1/0,a=-1/0,i=-1/0,o=-1/0,s=0,u=e.count;s<u;s++){var c=e.getX(s),l=e.getY(s),h=e.getZ(s);c<t&&(t=c),l<n&&(n=l),h<r&&(r=h),c>a&&(a=c),l>i&&(i=l),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(a,i,o),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){var n=te.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box3: .getCenter() target is now required"),e=new j),this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box3: .getSize() target is now required"),e=new j),this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(e){e.updateWorldMatrix(!1,!1);var t=e.geometry;void 0!==t&&(null===t.boundingBox&&t.computeBoundingBox(),ne.copy(t.boundingBox),ne.applyMatrix4(e.matrixWorld),this.union(ne));for(var n=e.children,r=0,a=n.length;r<a;r++)this.expandByObject(n[r]);return this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new j),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},intersectsSphere:function(e){return this.clampPoint(e.center,te),te.distanceToSquared(e.center)<=e.radius*e.radius},intersectsPlane:function(e){var t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant},intersectsTriangle:function(e){if(this.isEmpty())return!1;this.getCenter(ce),le.subVectors(this.max,ce),re.subVectors(e.a,ce),ae.subVectors(e.b,ce),ie.subVectors(e.c,ce),oe.subVectors(ae,re),se.subVectors(ie,ae),ue.subVectors(re,ie);var t=[0,-oe.z,oe.y,0,-se.z,se.y,0,-ue.z,ue.y,oe.z,0,-oe.x,se.z,0,-se.x,ue.z,0,-ue.x,-oe.y,oe.x,0,-se.y,se.x,0,-ue.y,ue.x,0];return!!pe(t,re,ae,ie,le)&&(!!pe(t=[1,0,0,0,1,0,0,0,1],re,ae,ie,le)&&(he.crossVectors(oe,se),pe(t=[he.x,he.y,he.z],re,ae,ie,le)))},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new j),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return te.copy(e).clamp(this.min,this.max).sub(e).length()},getBoundingSphere:function(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(te).length(),e},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(e){return this.isEmpty()||(ee[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ee[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ee[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ee[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ee[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ee[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ee[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ee[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ee)),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var me=new fe;function ve(e,t){this.center=void 0!==e?e:new j,this.radius=void 0!==t?t:-1}Object.assign(ve.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(e,t){var n=this.center;void 0!==t?n.copy(t):me.setFromPoints(e).getCenter(n);for(var r=0,a=0,i=e.length;a<i;a++)r=Math.max(r,n.distanceToSquared(e[a]));return this.radius=Math.sqrt(r),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},isEmpty:function(){return this.radius<0},makeEmpty:function(){return this.center.set(0,0,0),this.radius=-1,this},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var n=this.center.distanceToSquared(e);return void 0===t&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),t=new j),t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t},getBoundingBox:function(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new fe),this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}
vendor: 20,728 bytes, line 2
2,applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}});var ge=new j,be=new j,ye=new j,xe=new j,we=new j,Oe=new j,ke=new j;function Se(e,t){this.origin=void 0!==e?e:new j,this.direction=void 0!==t?t:new j(0,0,-1)}Object.assign(Se.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new j),t.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(e){return this.origin.copy(this.at(e,ge)),this},closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new j),t.subVectors(e,this.origin);var n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(e){var t=ge.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ge.copy(this.direction).multiplyScalar(t).add(this.origin),ge.distanceToSquared(e))},distanceSqToSegment:function(e,t,n,r){be.copy(e).add(t).multiplyScalar(.5),ye.copy(t).sub(e).normalize(),xe.copy(this.origin).sub(be);var a,i,o,s,u=.5*e.distanceTo(t),c=-this.direction.dot(ye),l=xe.dot(this.direction),h=-xe.dot(ye),d=xe.lengthSq(),f=Math.abs(1-c*c);if(f>0)if(i=c*l-h,s=u*f,(a=c*h-l)>=0)if(i>=-s)if(i<=s){var p=1/f;o=(a*=p)*(a+c*(i*=p)+2*l)+i*(c*a+i+2*h)+d}else i=u,o=-(a=Math.max(0,-(c*i+l)))*a+i*(i+2*h)+d;else i=-u,o=-(a=Math.max(0,-(c*i+l)))*a+i*(i+2*h)+d;else i<=-s?o=-(a=Math.max(0,-(-c*u+l)))*a+(i=a>0?-u:Math.min(Math.max(-u,-h),u))*(i+2*h)+d:i<=s?(a=0,o=(i=Math.min(Math.max(-u,-h),u))*(i+2*h)+d):o=-(a=Math.max(0,-(c*u+l)))*a+(i=a>0?u:Math.min(Math.max(-u,-h),u))*(i+2*h)+d;else i=c>0?-u:u,o=-(a=Math.max(0,-(c*i+l)))*a+i*(i+2*h)+d;return n&&n.copy(this.direction).multiplyScalar(a).add(this.origin),r&&r.copy(ye).multiplyScalar(i).add(be),o},intersectSphere:function(e,t){ge.subVectors(e.center,this.origin);var n=ge.dot(this.direction),r=ge.dot(ge)-n*n,a=e.radius*e.radius;if(r>a)return null;var i=Math.sqrt(a-r),o=n-i,s=n+i;return o<0&&s<0?null:o<0?this.at(s,t):this.at(o,t)},intersectsSphere:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null},intersectPlane:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0},intersectBox:function(e,t){var n,r,a,i,o,s,u=1/this.direction.x,c=1/this.direction.y,l=1/this.direction.z,h=this.origin;return u>=0?(n=(e.min.x-h.x)*u,r=(e.max.x-h.x)*u):(n=(e.max.x-h.x)*u,r=(e.min.x-h.x)*u),c>=0?(a=(e.min.y-h.y)*c,i=(e.max.y-h.y)*c):(a=(e.max.y-h.y)*c,i=(e.min.y-h.y)*c),n>i||a>r?null:((a>n||n!==n)&&(n=a),(i<r||r!==r)&&(r=i),l>=0?(o=(e.min.z-h.z)*l,s=(e.max.z-h.z)*l):(o=(e.max.z-h.z)*l,s=(e.min.z-h.z)*l),n>s||o>r?null:((o>n||n!==n)&&(n=o),(s<r||r!==r)&&(r=s),r<0?null:this.at(n>=0?n:r,t)))},intersectsBox:function(e){return null!==this.intersectBox(e,ge)},intersectTriangle:function(e,t,n,r,a){we.subVectors(t,e),Oe.subVectors(n,e),ke.crossVectors(we,Oe);var i,o=this.direction.dot(ke);if(o>0){if(r)return null;i=1}else{if(!(o<0))return null;i=-1,o=-o}xe.subVectors(this.origin,e);var s=i*this.direction.dot(Oe.crossVectors(xe,Oe));if(s<0)return null;var u=i*this.direction.dot(we.cross(xe));if(u<0)return null;if(s+u>o)return null;var c=-i*xe.dot(ke);return c<0?null:this.at(c/o,a)},applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}});var _e=new j,je=new j,Ee=new v;function Te(e,t){this.normal=void 0!==e?e:new j(1,0,0),this.constant=void 0!==t?t:0}Object.assign(Te.prototype,{isPlane:!0,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(e,t,n){var r=_e.subVectors(n,t).cross(je.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return void 0===t&&(console.warn("THREE.Plane: .projectPoint() target is now required"),t=new j),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(e,t){void 0===t&&(console.warn("THREE.Plane: .intersectLine() target is now required"),t=new j);var n=e.delta(_e),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):void 0;var a=-(e.start.dot(this.normal)+this.constant)/r;return a<0||a>1?void 0:t.copy(n).multiplyScalar(a).add(e.start)},intersectsLine:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new j),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(e,t){var n=t||Ee.getNormalMatrix(e),r=this.coplanarPoint(_e).applyMatrix4(e),a=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(a),this},translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}});var Ce=new j,Me=new j,Ae=new j,Ne=new j,Re=new j,Ie=new j,Le=new j,De=new j,Pe=new j,ze=new j;function Fe(e,t,n){this.a=void 0!==e?e:new j,this.b=void 0!==t?t:new j,this.c=void 0!==n?n:new j}Object.assign(Fe,{getNormal:function(e,t,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new j),r.subVectors(n,t),Ce.subVectors(e,t),r.cross(Ce);var a=r.lengthSq();return a>0?r.multiplyScalar(1/Math.sqrt(a)):r.set(0,0,0)},getBarycoord:function(e,t,n,r,a){Ce.subVectors(r,t),Me.subVectors(n,t),Ae.subVectors(e,t);var i=Ce.dot(Ce),o=Ce.dot(Me),s=Ce.dot(Ae),u=Me.dot(Me),c=Me.dot(Ae),l=i*u-o*o;if(void 0===a&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),a=new j),0===l)return a.set(-2,-1,-1);var h=1/l,d=(u*s-o*c)*h,f=(i*c-o*s)*h;return a.set(1-d-f,f,d)},containsPoint:function(e,t,n,r){return Fe.getBarycoord(e,t,n,r,Ne),Ne.x>=0&&Ne.y>=0&&Ne.x+Ne.y<=1},getUV:function(e,t,n,r,a,i,o,s){return this.getBarycoord(e,t,n,r,Ne),s.set(0,0),s.addScaledVector(a,Ne.x),s.addScaledVector(i,Ne.y),s.addScaledVector(o,Ne.z),s},isFrontFacing:function(e,t,n,r){return Ce.subVectors(n,t),Me.subVectors(e,t),Ce.cross(Me).dot(r)<0}}),Object.assign(Fe.prototype,{set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},getArea:function(){return Ce.subVectors(this.c,this.b),Me.subVectors(this.a,this.b),.5*Ce.cross(Me).length()},getMidpoint:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new j),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return Fe.getNormal(this.a,this.b,this.c,e)},getPlane:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new Te),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return Fe.getBarycoord(e,this.a,this.b,this.c,t)},getUV:function(e,t,n,r,a){return Fe.getUV(e,this.a,this.b,this.c,t,n,r,a)},containsPoint:function(e){return Fe.containsPoint(e,this.a,this.b,this.c)},isFrontFacing:function(e){return Fe.isFrontFacing(this.a,this.b,this.c,e)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new j);var n,r,a=this.a,i=this.b,o=this.c;Re.subVectors(i,a),Ie.subVectors(o,a),De.subVectors(e,a);var s=Re.dot(De),u=Ie.dot(De);if(s<=0&&u<=0)return t.copy(a);Pe.subVectors(e,i);var c=Re.dot(Pe),l=Ie.dot(Pe);if(c>=0&&l<=c)return t.copy(i);var h=s*l-c*u;if(h<=0&&s>=0&&c<=0)return n=s/(s-c),t.copy(a).addScaledVector(Re,n);ze.subVectors(e,o);var d=Re.dot(ze),f=Ie.dot(ze);if(f>=0&&d<=f)return t.copy(o);var p=d*u-s*f;if(p<=0&&u>=0&&f<=0)return r=u/(u-f),t.copy(a).addScaledVector(Ie,r);var m=c*f-d*l;if(m<=0&&l-c>=0&&d-f>=0)return Le.subVectors(o,i),r=(l-c)/(l-c+(d-f)),t.copy(i).addScaledVector(Le,r);var v=1/(m+p+h);return n=p*v,r=h*v,t.copy(a).addScaledVector(Re,n).addScaledVector(Ie,r)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}});var Be={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ue={h:0,s:0,l:0},We={h:0,s:0,l:0};function Ve(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}function Ge(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function He(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function qe(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}function Xe(e,t,n,r,a,i){this.a=e,this.b=t,this.c=n,this.normal=r&&r.isVector3?r:new j,this.vertexNormals=Array.isArray(r)?r:[],this.color=a&&a.isColor?a:new Ve,this.vertexColors=Array.isArray(a)?a:[],this.materialIndex=void 0!==i?i:0}Object.assign(Ve.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"===typeof e?this.setHex(e):"string"===typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(e,t,n){if(e=p.euclideanModulo(e,1),t=p.clamp(t,0,1),n=p.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+t):n+t-n*t,a=2*n-r;this.r=Ge(a,r,e+1/3),this.g=Ge(a,r,e),this.b=Ge(a,r,e-1/3)}return this},setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var r,a=n[1],i=n[2];switch(a){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(i))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(i))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(i)){var o=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,u=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(o,s,u)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var c=n[1],l=c.length;if(3===l)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===l)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this},setColorName:function(e){var t=Be[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this},convertGammaToLinear:function(e){return this.copyGammaToLinear(this,e),this},convertLinearToGamma:function(e){return this.copyLinearToGamma(this,e),this},copySRGBToLinear:function(e){return this.r=He(e.r),this.g=He(e.g),this.b=He(e.b),this},copyLinearToSRGB:function(e){return this.r=qe(e.r),this.g=qe(e.g),this.b=qe(e.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,n,r=this.r,a=this.g,i=this.b,o=Math.max(r,a,i),s=Math.min(r,a,i),u=(s+o)/2;if(s===o)t=0,n=0;else{var c=o-s;switch(n=u<=.5?c/(o+s):c/(2-o-s),o){case r:t=(a-i)/c+(a<i?6:0);break;case a:t=(i-r)/c+2;break;case i:t=(r-a)/c+4}t/=6}return e.h=t,e.s=n,e.l=u,e},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,n){return this.getHSL(Ue),Ue.h+=e,Ue.s+=t,Ue.l+=n,this.setHSL(Ue.h,Ue.s,Ue.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},lerpHSL:function(e,t){this.getHSL(Ue),e.getHSL(We);var n=p.lerp(Ue.h,We.h,t),r=p.lerp(Ue.s,We.s,t),a=p.lerp(Ue.l,We.l,t);return this.setHSL(n,r,a),this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}}),Ve.NAMES=Be,Object.assign(Xe.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,n=e.vertexNormals.length;t<n;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(t=0,n=e.vertexColors.length;t<n;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}});var Ye=0;function Ke(){Object.defineProperty(this,"id",{value:Ye++}),this.uuid=p.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function Ze(e){Ke.call(this),this.type="MeshBasicMaterial",this.color=new Ve(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.setValues(e)}Ke.prototype=Object.assign(Object.create(l.prototype),{constructor:Ke,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n)if("shading"!==t){var r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){var t=void 0===e||"string"===typeof e;t&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}
vendor: 4,476 bytes, line 2
2if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),0!==this.side&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&
vendor: 9,978 bytes, line 2
2(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){var a=r(e.textures),i=r(e.images);a.length>0&&(n.textures=a),i.length>0&&(n.images=i)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,n=null;if(null!==t){var r=t.length;n=new Array(r);for(var a=0;a!==r;++a)n[a]=t[a].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Ke.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Ze.prototype=Object.create(Ke.prototype),Ze.prototype.constructor=Ze,Ze.prototype.isMeshBasicMaterial=!0,Ze.prototype.copy=function(e){return Ke.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};var Je=new j;function Qe(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function $e(e,t,n){Qe.call(this,new Int8Array(e),t,n)}function et(e,t,n){Qe.call(this,new Uint8Array(e),t,n)}function tt(e,t,n){Qe.call(this,new Uint8ClampedArray(e),t,n)}function nt(e,t,n){Qe.call(this,new Int16Array(e),t,n)}function rt(e,t,n){Qe.call(this,new Uint16Array(e),t,n)}function at(e,t,n){Qe.call(this,new Int32Array(e),t,n)}function it(e,t,n){Qe.call(this,new Uint32Array(e),t,n)}function ot(e,t,n){Qe.call(this,new Float32Array(e),t,n)}function st(e,t,n){Qe.call(this,new Float64Array(e),t,n)}function ut(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function ct(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,r=e.length;n<r;++n)e[n]>t&&(t=e[n]);return t}Object.defineProperty(Qe.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Qe.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var r=0,a=this.itemSize;r<a;r++)this.array[e+r]=t.array[n+r];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,r=0,a=e.length;r<a;r++){var i=e[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),i=new Ve),t[n++]=i.r,t[n++]=i.g,t[n++]=i.b}return this},copyVector2sArray:function(e){for(var t=this.array,n=0,r=0,a=e.length;r<a;r++){var i=e[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),i=new m),t[n++]=i.x,t[n++]=i.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,r=0,a=e.length;r<a;r++){var i=e[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),i=new j),t[n++]=i.x,t[n++]=i.y,t[n++]=i.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,r=0,a=e.length;r<a;r++){var i=e[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),i=new x),t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n++]=i.w}return this},applyMatrix3:function(e){for(var t=0,n=this.count;t<n;t++)Je.x=this.getX(t),Je.y=this.getY(t),Je.z=this.getZ(t),Je.applyMatrix3(e),this.setXYZ(t,Je.x,Je.y,Je.z);return this},applyMatrix4:function(e){for(var t=0,n=this.count;t<n;t++)Je.x=this.getX(t),Je.y=this.getY(t),Je.z=this.getZ(t),Je.applyMatrix4(e),this.setXYZ(t,Je.x,Je.y,Je.z);return this},applyNormalMatrix:function(e){for(var t=0,n=this.count;t<n;t++)Je.x=this.getX(t),Je.y=this.getY(t),Je.z=this.getZ(t),Je.applyNormalMatrix(e),this.setXYZ(t,Je.x,Je.y,Je.z);return this},transformDirection:function(e){for(var t=0,n=this.count;t<n;t++)Je.x=this.getX(t),Je.y=this.getY(t),Je.z=this.getZ(t),Je.transformDirection(e),this.setXYZ(t,Je.x,Je.y,Je.z);return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this},setXYZW:function(e,t,n,r,a){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=a,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),$e.prototype=Object.create(Qe.prototype),$e.prototype.constructor=$e,et.prototype=Object.create(Qe.prototype),et.prototype.constructor=et,tt.prototype=Object.create(Qe.prototype),tt.prototype.constructor=tt,nt.prototype=Object.create(Qe.prototype),nt.prototype.constructor=nt,rt.prototype=Object.create(Qe.prototype),rt.prototype.constructor=rt,at.prototype=Object.create(Qe.prototype),at.prototype.constructor=at,it.prototype=Object.create(Qe.prototype),it.prototype.constructor=it,ot.prototype=Object.create(Qe.prototype),ot.prototype.constructor=ot,st.prototype=Object.create(Qe.prototype),st.prototype.constructor=st,Object.assign(ut.prototype,{computeGroups:function(e){for(var t,n=[],r=void 0,a=e.faces,i=0;i<a.length;i++){var o=a[i];o.materialIndex!==r&&(r=o.materialIndex,void 0!==t&&(t.count=3*i-t.start,n.push(t)),t={start:3*i,materialIndex:r})}void 0!==t&&(t.count=3*i-t.start,n.push(t)),this.groups=n},fromGeometry:function(e){var t,n=e.faces,r=e.vertices,a=e.faceVertexUvs,i=a[0]&&a[0].length>0,o=a[1]&&a[1].length>0,s=e.morphTargets,u=s.length;if(u>0){t=[];for(var c=0;c<u;c++)t[c]={name:s[c].name,data:[]};this.morphTargets.position=t}var l,h=e.morphNormals,d=h.length;if(d>0){l=[];for(c=0;c<d;c++)l[c]={name:h[c].name,data:[]};this.morphTargets.normal=l}var f=e.skinIndices,p=e.skinWeights,v=f.length===r.length,g=p.length===r.length;r.length>0&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(c=0;c<n.length;c++){var b=n[c];this.vertices.push(r[b.a],r[b.b],r[b.c]);var y=b.vertexNormals;if(3===y.length)this.normals.push(y[0],y[1],y[2]);else{var x=b.normal;this.normals.push(x,x,x)}var w,O=b.vertexColors;if(3===O.length)this.colors.push(O[0],O[1],O[2]);else{var k=b.color;this.colors.push(k,k,k)}if(!0===i)void 0!==(w=a[0][c])?this.uvs.push(w[0],w[1],w[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",c),this.uvs.push(new m,new m,new m));if(!0===o)void 0!==(w=a[1][c])?this.uvs2.push(w[0],w[1],w[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",c),this.uvs2.push(new m,new m,new m));for(var S=0;S<u;S++){var _=s[S].vertices;t[S].data.push(_[b.a],_[b.b],_[b.c])}for(S=0;S<d;S++){var j=h[S].vertexNormals[c];l[S].data.push(j.a,j.b,j.c)}v&&this.skinIndices.push(f[b.a],f[b.b],f[b.c]),g&&this.skinWeights.push(p[b.a],p[b.b],p[b.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&
vendor: 4,844 bytes, line 2
2(this.boundingBox=e.boundingBox.clone()),this}});var lt=1,ht=new I,dt=new Q,ft=new j,pt=new fe,mt=new fe,vt=new j;function gt(){Object.defineProperty(this,"id",{value:lt+=2}),this.uuid=p.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}gt.prototype=Object.assign(Object.create(l.prototype),{constructor:gt,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(ct(e)>65535?it:rt)(e,1):this.index=e},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,n){this.groups.push({start:e,count:t,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new v).getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}var a=this.attributes.tangent;return void 0!==a&&(a.transformDirection(e),a.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return ht.makeRotationX(e),this.applyMatrix4(ht),this},rotateY:function(e){return ht.makeRotationY(e),this.applyMatrix4(ht),this},rotateZ:function(e){return ht.makeRotationZ(e),this.applyMatrix4(ht),this},translate:function(e,t,n){return ht.makeTranslation(e,t,n),this.applyMatrix4(ht),this},scale:function(e,t,n){return ht.makeScale(e,t,n),this.applyMatrix4(ht),this},lookAt:function(e){return dt.lookAt(e),dt.updateMatrix(),this.applyMatrix4(dt.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(ft).negate(),this.translate(ft.x,ft.y,ft.z),this},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new ot(3*t.vertices.length,3),r=new ot(3*t.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(t.vertices)),this.setAttribute("color",r.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var a=new ot(t.lineDistances.length,1);this.setAttribute("lineDistance",a.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,r=e.length;n<r;n++){var a=e[n];t.push(a.x,a.y,a.z||0)}return this.setAttribute("position",new ot(t,3)),this},updateFromObject:function(e){var t,n=e.geometry;if(e.isMesh){var r=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(r=void 0,n.elementsNeedUpdate=!1),void 0===r)return this.fromGeometry(n);r.verticesNeedUpdate=n.verticesNeedUpdate,r.normalsNeedUpdate=n.normalsNeedUpdate,r.colorsNeedUpdate=n.colorsNeedUpdate,r.uvsNeedUpdate=n.uvsNeedUpdate,r.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=r}return!0===n.verticesNeedUpdate&&(void 0!==(t=this.attributes.position)&&(t.copyVector3sArray(n.vertices),t.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(t=this.attributes.normal)&&(t.copyVector3sArray(n.normals),t.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(t=this.attributes.color)&&(t.copyColorsArray(n.colors),t.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(t=this.attributes.uv)&&(t.copyVector2sArray(n.uvs),t.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(t=this.attributes.lineDistance)&&(t.copyArray(n.lineDistances),t.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(e.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new ut).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.setAttribute("position",new Qe(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var n=new Float32Array(3*e.normals.length);this.setAttribute("normal",new Qe(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var r=new Float32Array(3*e.colors.length);this.setAttribute("color",new Qe(r,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var a=new Float32Array(2*e.uvs.length);this.setAttribute("uv",new Qe(a,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var i=new Float32Array(2*e.uvs2.length);
2this.setAttribute("uv2",new Qe(i,2).copyVector2sArray(e.uvs2))}for(var o in this.groups=e.groups,e.morphTargets){for(var s=[],u=e.morphTargets[o],c=0,l=u.length;c<l;c++){var h=u[c],d=new ot(3*h.data.length,3);d.name=h.name,s.push(d.copyVector3sArray(h.data))}this.morphAttributes[o]=s}if(e.skinIndices.length>0){var f=new ot(4*e.skinIndices.length,4);this.setAttribute("skinIndex",f.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var p=new ot(4*e.skinWeights.length,4);this.setAttribute("skinWeight",p.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new fe);var e=this.attributes.position,t=this.morphAttributes.position;if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(var n=0,r=t.length;n<r;n++){var a=t[n];pt.setFromBufferAttribute(a),this.morphTargetsRelative?(vt.addVectors(this.boundingBox.min,pt.min),this.boundingBox.expandByPoint(vt),vt.addVectors(this.boundingBox.max,pt.max),this.boundingBox.expandByPoint(vt)):(this.boundingBox.expandByPoint(pt.min),this.boundingBox.expandByPoint(pt.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new ve);var e=this.attributes.position,t=this.morphAttributes.position;if(e){var n=this.boundingSphere.center;if(pt.setFromBufferAttribute(e),t)for(var r=0,a=t.length;r<a;r++){var i=t[r];mt.setFromBufferAttribute(i),this.morphTargetsRelative?(vt.addVectors(pt.min,mt.min),pt.expandByPoint(vt),vt.addVectors(pt.max,mt.max),pt.expandByPoint(vt)):(pt.expandByPoint(mt.min),pt.expandByPoint(mt.max))}pt.getCenter(n);var o=0;for(r=0,a=e.count;r<a;r++)vt.fromBufferAttribute(e,r),o=Math.max(o,n.distanceToSquared(vt));if(t)for(r=0,a=t.length;r<a;r++){i=t[r];for(var s=this.morphTargetsRelative,u=0,c=i.count;u<c;u++)vt.fromBufferAttribute(i,u),s&&(ft.fromBufferAttribute(e,u),vt.add(ft)),o=Math.max(o,n.distanceToSquared(vt))}this.boundingSphere.radius=Math.sqrt(o),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.attributes;if(t.position){var n=t.position.array;if(void 0===t.normal)this.setAttribute("normal",new Qe(new Float32Array(n.length),3));else for(var r=t.normal.array,a=0,i=r.length;a<i;a++)r[a]=0;var o,s,u,c=t.normal.array,l=new j,h=new j,d=new j,f=new j,p=new j;if(e){var m=e.array;for(a=0,i=e.count;a<i;a+=3)o=3*m[a+0],s=3*m[a+1],u=3*m[a+2],l.fromArray(n,o),h.fromArray(n,s),d.fromArray(n,u),f.subVectors(d,h),p.subVectors(l,h),f.cross(p),c[o]+=f.x,c[o+1]+=f.y,c[o+2]+=f.z,c[s]+=f.x,c[s+1]+=f.y,c[s+2]+=f.z,c[u]+=f.x,c[u+1]+=f.y,c[u+2]+=f.z}else for(a=0,i=n.length;a<i;a+=9)l.fromArray(n,a),h.fromArray(n,a+3),d.fromArray(n,a+6),f.subVectors(d,h),p.subVectors(l,h),f.cross(p),c[a]=f.x,c[a+1]=f.y,c[a+2]=f.z,c[a+3]=f.x,c[a+4]=f.y,c[a+5]=f.z,c[a+6]=f.x,c[a+7]=f.y,c[a+8]=f.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if(e&&e.isBufferGeometry){void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var r in n)if(void 0!==e.attributes[r])for(var a=n[r].array,i=e.attributes[r],o=i.array,s=i.itemSize*t,u=Math.min(o.length,a.length-s),c=0,l=s;c<u;c++,l++)a[l]=o[c];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:function(){for(var e=this.attributes.normal,t=0,n=e.count;t<n;t++)vt.x=e.getX(t),vt.y=e.getY(t),vt.z=e.getZ(t),vt.normalize(),e.setXYZ(t,vt.x,vt.y,vt.z)},toNonIndexed:function(){function e(e,t){for(var n=e.array,r=e.itemSize,a=e.normalized,i=new n.constructor(t.length*r),o=0,s=0,u=0,c=t.length;u<c;u++){o=t[u]*r;for(var l=0;l<r;l++)i[s++]=n[o++]}return new Qe(i,r,a)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new gt,n=this.index.array,r=this.attributes;for(var a in r){var i=e(r[a],n);t.setAttribute(a,i)}var o=this.morphAttributes;for(a in o){for(var s=[],u=o[a],c=0,l=u.length;c<l;c++){i=e(u[c],n);s.push(i)}t.morphAttributes[a]=s}t.morphTargetsRelative=this.morphTargetsRelative;for(var h=this.groups,d=(c=0,h.length);c<d;c++){var f=h[c];t.addGroup(f.start,f.count,f.materialIndex)}return t},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};
vendor: 4,491 bytes, line 2
2if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;null!==r&&(e.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var a=this.attributes;for(var n in a){var i=(d=a[n]).toJSON();""!==d.name&&(i.name=d.name),e.data.attributes[n]=i}var o={},s=!1;for(var n in this.morphAttributes){for(var u=this.morphAttributes[n],c=[],l=0,h=u.length;l<h;l++){var d;i=(d=u[l]).toJSON();""!==d.name&&(i.name=d.name),c.push(i)}c.length>0&&(o[n]=c,s=!0)}s&&(e.data.morphAttributes=o,e.data.morphTargetsRelative=this.morphTargetsRelative);var f=this.groups;f.length>0&&(e.data.groups=JSON.parse(JSON.stringify(f)));var p=this.boundingSphere;return null!==p&&(e.data.boundingSphere={center:p.center.toArray(),radius:p.radius}),e},clone:function(){return(new gt).copy(this)},copy:function(e){var t,n,r;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var a=e.index;null!==a&&this.setIndex(a.clone());var i=e.attributes;for(t in i){var o=i[t];this.setAttribute(t,o.clone())}var s=e.morphAttributes;for(t in s){var u=[],c=s[t];for(n=0,r=c.length;n<r;n++)u.push(c[n].clone());this.morphAttributes[t]=u}this.morphTargetsRelative=e.morphTargetsRelative;var l=e.groups;for(n=0,r=l.length;n<r;n++){var h=l[n];this.addGroup(h.start,h.count,h.materialIndex)}var d=e.boundingBox;null!==d&&(this.boundingBox=d.clone());var f=e.boundingSphere;return null!==f&&(this.boundingSphere=f.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var bt=new I,yt=new Se,xt=new ve,wt=new j,Ot=new j,kt=new j,St=new j,_t=new j,jt=new j,Et=new j,Tt=new j,Ct=new j,Mt=new m,At=new m,Nt=new m,Rt=new j,It=new j;function Lt(e,t){Q.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new gt,this.material=void 0!==t?t:new Ze,this.updateMorphTargets()}function Dt(e,t,n,r,a,i,o,s){if(null===(1===t.side?r.intersectTriangle(o,i,a,!0,s):r.intersectTriangle(a,i,o,t.side!==c,s)))return null;It.copy(s),It.applyMatrix4(e.matrixWorld);var u=n.ray.origin.distanceTo(It);return u<n.near||u>n.far?null:{distance:u,point:It.clone(),object:e}}function Pt(e,t,n,r,a,i,o,s,u,c,l,h){wt.fromBufferAttribute(a,c),Ot.fromBufferAttribute(a,l),kt.fromBufferAttribute(a,h);var d=e.morphTargetInfluences;if(t.morphTargets&&i&&d){Et.set(0,0,0),Tt.set(0,0,0),Ct.set(0,0,0);for(var f=0,p=i.length;f<p;f++){var v=d[f],g=i[f];0!==v&&(St.fromBufferAttribute(g,c),_t.fromBufferAttribute(g,l),jt.fromBufferAttribute(g,h),o?(Et.addScaledVector(St,v),Tt.addScaledVector(_t,v),Ct.addScaledVector(jt,v)):(Et.addScaledVector(St.sub(wt),v),Tt.addScaledVector(_t.sub(Ot),v),Ct.addScaledVector(jt.sub(kt),v)))}wt.add(Et),Ot.add(Tt),kt.add(Ct)}e.isSkinnedMesh&&(e.boneTransform(c,wt),e.boneTransform(l,Ot),e.boneTransform(h,kt));var b=Dt(e,t,n,r,wt,Ot,kt,Rt);if(b){s&&(Mt.fromBufferAttribute(s,c),At.fromBufferAttribute(s,l),Nt.fromBufferAttribute(s,h),b.uv=Fe.getUV(Rt,wt,Ot,kt,Mt,At,Nt,new m)),u&&(Mt.fromBufferAttribute(u,c),At.fromBufferAttribute(u,l),Nt.fromBufferAttribute(u,h),b.uv2=Fe.getUV(Rt,wt,Ot,kt,Mt,At,Nt,new m));var y=new Xe(c,l,h);Fe.getNormal(wt,Ot,kt,y.normal),b.face=y}return b}Lt.prototype=Object.assign(Object.create(Q.prototype),{constructor:Lt,isMesh:!0,copy:function(e){return Q.prototype.copy.call(this,e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e,t,n,r=this.geometry;if(r.isBufferGeometry){var a=r.morphAttributes,i=Object.keys(a);if(i.length>0){var o=a[i[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=r.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){var n,r=this.geometry,a=this.material,i=this.matrixWorld;if(void 0!==a&&(null===r.boundingSphere&&r.computeBoundingSphere(),xt.copy(r.boun
vendor: 7,877 bytes, line 2
2dingSphere),xt.applyMatrix4(i),!1!==e.ray.intersectsSphere(xt)&&(bt.getInverse(i),yt.copy(e.ray).applyMatrix4(bt),null===r.boundingBox||!1!==yt.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var o,s,u,c,l,h,d,f,p,v=r.index,g=r.attributes.position,b=r.morphAttributes.position,y=r.morphTargetsRelative,x=r.attributes.uv,w=r.attributes.uv2,O=r.groups,k=r.drawRange;if(null!==v)if(Array.isArray(a))for(c=0,h=O.length;c<h;c++)for(p=a[(f=O[c]).materialIndex],l=Math.max(f.start,k.start),d=Math.min(f.start+f.count,k.start+k.count);l<d;l+=3)o=v.getX(l),s=v.getX(l+1),u=v.getX(l+2),(n=Pt(this,p,e,yt,g,b,y,x,w,o,s,u))&&(n.faceIndex=Math.floor(l/3),n.face.materialIndex=f.materialIndex,t.push(n));else for(c=Math.max(0,k.start),h=Math.min(v.count,k.start+k.count);c<h;c+=3)o=v.getX(c),s=v.getX(c+1),u=v.getX(c+2),(n=Pt(this,a,e,yt,g,b,y,x,w,o,s,u))&&(n.faceIndex=Math.floor(c/3),t.push(n));else if(void 0!==g)if(Array.isArray(a))for(c=0,h=O.length;c<h;c++)for(p=a[(f=O[c]).materialIndex],l=Math.max(f.start,k.start),d=Math.min(f.start+f.count,k.start+k.count);l<d;l+=3)(n=Pt(this,p,e,yt,g,b,y,x,w,o=l,s=l+1,u=l+2))&&(n.faceIndex=Math.floor(l/3),n.face.materialIndex=f.materialIndex,t.push(n));else for(c=Math.max(0,k.start),h=Math.min(g.count,k.start+k.count);c<h;c+=3)(n=Pt(this,a,e,yt,g,b,y,x,w,o=c,s=c+1,u=c+2))&&(n.faceIndex=Math.floor(c/3),t.push(n))}else if(r.isGeometry){var S,_,j,E,T=Array.isArray(a),C=r.vertices,M=r.faces,A=r.faceVertexUvs[0];A.length>0&&(E=A);for(var N=0,R=M.length;N<R;N++){var I=M[N],L=T?a[I.materialIndex]:a;if(void 0!==L&&(S=C[I.a],_=C[I.b],j=C[I.c],n=Dt(this,L,e,yt,S,_,j,Rt))){if(E&&E[N]){var D=E[N];Mt.copy(D[0]),At.copy(D[1]),Nt.copy(D[2]),n.uv=Fe.getUV(Rt,S,_,j,Mt,At,Nt,new m)}n.face=I,n.faceIndex=N,t.push(n)}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var zt=0,Ft=new I,Bt=new Q,Ut=new j;function Wt(){Object.defineProperty(this,"id",{value:zt+=2}),this.uuid=p.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}Wt.prototype=Object.assign(Object.create(l.prototype),{constructor:Wt,isGeometry:!0,applyMatrix4:function(e){for(var t=(new v).getNormalMatrix(e),n=0,r=this.vertices.length;n<r;n++){this.vertices[n].applyMatrix4(e)}for(n=0,r=this.faces.length;n<r;n++){var a=this.faces[n];a.normal.applyMatrix3(t).normalize();for(var i=0,o=a.vertexNormals.length;i<o;i++)a.vertexNormals[i].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(e){return Ft.makeRotationX(e),this.applyMatrix4(Ft),this},rotateY:function(e){return Ft.makeRotationY(e),this.applyMatrix4(Ft),this},rotateZ:function(e){return Ft.makeRotationZ(e),this.applyMatrix4(Ft),this},translate:function(e,t,n){return Ft.makeTranslation(e,t,n),this.applyMatrix4(Ft),this},scale:function(e,t,n){return Ft.makeScale(e,t,n),this.applyMatrix4(Ft),this},lookAt:function(e){return Bt.lookAt(e),Bt.updateMatrix(),this.applyMatrix4(Bt.matrix),this},fromBufferGeometry:function(e){var t=this,n=null!==e.index?e.index.array:void 0,r=e.attributes;if(void 0===r.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var a=r.position.array,i=void 0!==r.normal?r.normal.array:void 0,o=void 0!==r.color?r.color.array:void 0,s=void 0!==r.uv?r.uv.array:void 0,u=void 0!==r.uv2?r.uv2.array:void 0;void 0!==u&&(this.faceVertexUvs[1]=[]);for(var c=0;c<a.length;c+=3)t.vertices.push((new j).fromArray(a,c)),void 0!==o&&t.colors.push((new Ve).fromArray(o,c));function l(e,n,r,a){var c=void 0===o?[]:[t.colors[e].clone(),t.colors[n].clone(),t.colors[r].clone()],l=new Xe(e,n,r,void 0===i?[]:[(new j).fromArray(i,3*e),(new j).fromArray(i,3*n),(new j).fromArray(i,3*r)],c,a);t.faces.push(l),void 0!==s&&t.faceVertexUvs[0].push([(new m).fromArray(s,2*e),(new m).fromArray(s,2*n),(new m).fromArray(s,2*r)]),void 0!==u&&t.faceVertexUvs[1].push([(new m).fromArray(u,2*e),(new m).fromArray(u,2*n),(new m).fromArray(u,2*r)])}var h=e.groups;if(h.length>0)for(c=0;c<h.length;c++)for(var d=h[c],f=d.start,p=f,v=f+d.count;p<v;p+=3)void 0!==n?l(n[p],n[p+1],n[p+2],d.materialIndex):l(p,p+1,p+2,d.materialIndex);else if(void 0!==n)for(c=0;c<n.length;c+=3)l(n[c],n[c+1],n[c+2]);else for(c=0;c<a.length/3;c+=3)l(c,c+1,c+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ut).negate(),this.translate(Ut.x,Ut.y,Ut.z),this},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=0===t?1:1/t,r=new I;return r.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix4(r),this},computeFaceNormals:function(){for(var e=new j,t=new j,n=0,r=this.faces.length;n<r;n++){var a=this.faces[n],i=this.vertices[a.a],o=this.vertices[a.b],s=this.vertices[a.c];e.subVectors(s,o),t.subVectors(i,o),e.cross(t),e.normalize(),a.normal.copy(e)}},computeVertexNormals:function(e){var t,n,r,a,i,o;for(void 0===e&&(e=!0),o=new Array(this.vertices.length),t=0,n=this.vertices.length;t<n;t++)o[t]=new j;if(e){var s,u,c,l=new j,h=new j;for(r=0,a=this.faces.length;r<a;r++)i=this.faces[r],s=this.vertices[i.a],u=this.vertices[i.b],c=this.vertices[i.c],l.subVectors(c,u),h.subVectors(s,u),l.cross(h),o[i.a].add(l),o[i.b].add(l),o[i.c].add(l)}else for(this.computeFaceNormals(),r=0,a=this.faces.length;r<a;r++)o[(i=this.faces[r]).a].add(i.normal),o[i.b].add(i.normal),o[i.c].add(i.normal);for(t=0,n=this.vertices.length;t<n;t++)o[t].normalize();for(r=0,a=this.faces.length;r<a;r++){var d=(i=this.faces[r]).vertexNormals;3===d.length?(d[0].copy(o[i.a]),d[1].copy(o[i.b]),d[2].copy(o[i.c])):(d[0]=o[i.a].clone(),d[1]=o[i.b].clone(),d[2]=o[i.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,n;for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++){var r=(n=this.faces[e]).vertexNormals;3===r.length?(r[0].copy(n.normal),r[1].copy(n.normal),r[2].copy(n.normal)):(r[0]=n.normal.clone(),r[1]=n.normal.clone(),r[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,n,r,a;for(n=0,r=this.faces.length;n<r;n++)for((a=this.faces[n]).__originalFaceNormal?a.__originalFaceNormal.copy(a.normal):a.__originalFaceNormal=a.normal.clone(),a.__originalVertexNormals||(a.__originalVertexNormals=[]),e=0,t=a.vertexNormals.length;e<t;e++)a.__originalVertexNormals[e]?a.__originalVertexNormals[e].copy(a.vertexNormals[e]):a.__originalVertexNormals[e]=a.vertexNormals[e].clone();var i=new Wt;for(i.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var o=this.morphNormals[e].faceNormals,s=this.morphNormals[e].vertexNormals;for(n=0,r=this.faces.length;n<r;n++)u=new j,c={a:new j,b:new j,c:new j},o.push(u),s.push(c)}var u,c,l=this.morphNormals[e];for(i.vertices=this.morphTargets[e].vertices,i.computeFaceNormals(),i.computeVertexNormals(),n=0,r=this.faces.length;n<r;n++)a=this.faces[n],u=l.faceNormals[n],c=l.vertexNormals[n],u.copy(a.normal),c.a.copy(a.vertexNormals[0]),c.b.copy(a.vertexNormals[1]),c.c.copy(a.vertexNormals[2])}for(n=0,r=this.faces.length;n<r;
vendor: 12,571 bytes, line 2
2n++)(a=this.faces[n]).normal=a.__originalFaceNormal,a.vertexNormals=a.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new fe),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new ve),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(e&&e.isGeometry){var r,a=this.vertices.length,i=this.vertices,o=e.vertices,s=this.faces,u=e.faces,c=this.colors,l=e.colors;void 0===n&&(n=0),void 0!==t&&(r=(new v).getNormalMatrix(t));for(var h=0,d=o.length;h<d;h++){var f=o[h].clone();void 0!==t&&f.applyMatrix4(t),i.push(f)}for(h=0,d=l.length;h<d;h++)c.push(l[h].clone());for(h=0,d=u.length;h<d;h++){var p,m,g,b=u[h],y=b.vertexNormals,x=b.vertexColors;(p=new Xe(b.a+a,b.b+a,b.c+a)).normal.copy(b.normal),void 0!==r&&p.normal.applyMatrix3(r).normalize();for(var w=0,O=y.length;w<O;w++)m=y[w].clone(),void 0!==r&&m.applyMatrix3(r).normalize(),p.vertexNormals.push(m);p.color.copy(b.color);for(w=0,O=x.length;w<O;w++)g=x[w],p.vertexColors.push(g.clone());p.materialIndex=b.materialIndex+n,s.push(p)}for(h=0,d=e.faceVertexUvs.length;h<d;h++){var k=e.faceVertexUvs[h];void 0===this.faceVertexUvs[h]&&(this.faceVertexUvs[h]=[]);for(w=0,O=k.length;w<O;w++){for(var S=k[w],_=[],j=0,E=S.length;j<E;j++)_.push(S[j].clone());this.faceVertexUvs[h].push(_)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e)},mergeMesh:function(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)},mergeVertices:function(){var e,t,n,r,a,i,o,s,u={},c=[],l=[],h=Math.pow(10,4);for(n=0,r=this.vertices.length;n<r;n++)e=this.vertices[n],void 0===u[t=Math.round(e.x*h)+"_"+Math.round(e.y*h)+"_"+Math.round(e.z*h)]?(u[t]=n,c.push(this.vertices[n]),l[n]=c.length-1):l[n]=l[u[t]];var d=[];for(n=0,r=this.faces.length;n<r;n++){(a=this.faces[n]).a=l[a.a],a.b=l[a.b],a.c=l[a.c],i=[a.a,a.b,a.c];for(var f=0;f<3;f++)if(i[f]===i[(f+1)%3]){d.push(n);break}}for(n=d.length-1;n>=0;n--){var p=d[n];for(this.faces.splice(p,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(p,1)}var m=this.vertices.length-c.length;return this.vertices=c,m},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var r=e[t];this.vertices.push(new j(r.x,r.y,r.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;e.sort((function(e,t){return e.materialIndex-t.materialIndex}));var r,a,i=this.faceVertexUvs[0],o=this.faceVertexUvs[1];i&&i.length===t&&(r=[]),o&&o.length===t&&(a=[]);for(n=0;n<t;n++){var s=e[n]._id;r&&r.push(i[s]),a&&a.push(o[s])}r&&(this.faceVertexUvs[0]=r),a&&(this.faceVertexUvs[1]=a)},toJSON:function(){var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}for(var r=[],a=0;a<this.vertices.length;a++){var i=this.vertices[a];r.push(i.x,i.y,i.z)}var o=[],s=[],u={},c=[],l={},h=[],d={};for(a=0;a<this.faces.length;a++){var f=this.faces[a],p=void 0!==this.faceVertexUvs[0][a],m=f.normal.length()>0,v=f.vertexNormals.length>0,g=1!==f.color.r||1!==f.color.g||1!==f.color.b,b=f.vertexColors.length>0,y=0;if(y=k(y,0,0),y=k(y,1,!0),y=k(y,2,!1),y=k(y,3,p),y=k(y,4,m),y=k(y,5,v),y=k(y,6,g),y=k(y,7,b),o.push(y),o.push(f.a,f.b,f.c),o.push(f.materialIndex),p){var x=this.faceVertexUvs[0][a];o.push(j(x[0]),j(x[1]),j(x[2]))}if(m&&o.push(S(f.normal)),v){var w=f.vertexNormals;o.push(S(w[0]),S(w[1]),S(w[2]))}if(g&&o.push(_(f.color)),b){var O=f.vertexColors;o.push(_(O[0]),_(O[1]),_(O[2]))}}function k(e,t,n){return n?e|1<<t:e&~(1<<t)}function S(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==u[t]||(u[t]=s.length/3,s.push(e.x,e.y,e.z)),u[t]}function _(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==l[t]||(l[t]=c.length,c.push(e.getHex())),l[t]}function j(e){var t=e.x.toString()+e.y.toString();return void 0!==d[t]||(d[t]=h.length/2,h.push(e.x,e.y)),d[t]}return e.data={},e.data.vertices=r,e.data.normals=s,c.length>0&&(e.data.colors=c),h.length>0&&(e.data.uvs=[h]),e.data.faces=o,e},clone:function(){return(new Wt).copy(this)},copy:function(e){var t,n,r,a,i,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var s=e.vertices;for(t=0,n=s.length;t<n;t++)this.vertices.push(s[t].clone());var u=e.colors;for(t=0,n=u.length;t<n;t++)this.colors.push(u[t].clone());var c=e.faces;for(t=0,n=c.length;t<n;t++)this.faces.push(c[t].clone());for(t=0,n=e.faceVertexUvs.length;t<n;t++){var l=e.faceVertexUvs[t];for(void 0===this.faceVertexUvs[t]&&(this.faceVertexUvs[t]=[]),r=0,a=l.length;r<a;r++){var h=l[r],d=[];for(i=0,o=h.length;i<o;i++){var f=h[i];d.push(f.clone())}this.faceVertexUvs[t].push(d)}}var p=e.morphTargets;for(t=0,n=p.length;t<n;t++){var m={};if(m.name=p[t].name,void 0!==p[t].vertices)for(m.vertices=[],r=0,a=p[t].vertices.length;r<a;r++)m.vertices.push(p[t].vertices[r].clone());if(void 0!==p[t].normals)for(m.normals=[],r=0,a=p[t].normals.length;r<a;r++)m.normals.push(p[t].normals[r].clone());this.morphTargets.push(m)}var v=e.morphNormals;for(t=0,n=v.length;t<n;t++){var g={};if(void 0!==v[t].vertexNormals)for(g.vertexNormals=[],r=0,a=v[t].vertexNormals.length;r<a;r++){var b=v[t].vertexNormals[r],y={};y.a=b.a.clone(),y.b=b.b.clone(),y.c=b.c.clone(),g.vertexNormals.push(y)}if(void 0!==v[t].faceNormals)for(g.faceNormals=[],r=0,a=v[t].faceNormals.length;r<a;r++)g.faceNormals.push(v[t].faceNormals[r].clone());this.morphNormals.push(g)}var x=e.skinWeights;for(t=0,n=x.length;t<n;t++)this.skinWeights.push(x[t].clone());var w=e.skinIndices;for(t=0,n=w.length;t<n;t++)this.skinIndices.push(w[t].clone());var O=e.lineDistances;for(t=0,n=O.length;t<n;t++)this.lineDistances.push(O[t]);var k=e.boundingBox;null!==k&&(this.boundingBox=k.clone());var S=e.boundingSphere;return null!==S&&(this.boundingSphere=S.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Vt=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e,r,a,i,s,u){var c;return Object(o.a)(this,n),(c=t.call(this)).type="BoxGeometry",c.parameters={width:e,height:r,depth:a,widthSegments:i,heightSegments:s,depthSegments:u},c.fromBufferGeometry(new Gt(e,r,a,i,s,u)),c.mergeVertices(),c}return n}(Wt),Gt=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e,r,a,s,u,c){var l;Object(o.a)(this,n),(l=t.call(this)).type="BoxBufferGeometry",l.parameters={width:e,height:r,depth:a,widthSegments:s,heightSegments:u,depthSegments:c};var h=Object(i.a)(l);e=e||1,r=r||1,a=a||1,s=Math.floor(s)||1,u=Math.floor(u)||1,c=Math.floor(c)||1;var d=[],f=[],p=[],m=[],v=0,g=0;function b(e,t,n,r,a,i,o,s,u,c,l){for(var b=i/u,y=o/c,x=i/2,w=o/2,O=s/2,k=u+1,S=c+1,_=0,E=0,T=new j,C=0;C<S;C++)for(var M=C*y-w,A=0;A<k;A++){var N=A*b-x;T[e]=N*r,T[t]=M*a,T[n]=O,f.push(T.x,T.y,T.z),T[e]=0,T[t]=0,T[n]=s>0?1:-1,p.push(T.x,T.y,T.z),m.push(A/u),m.push(1-C/c),_+=1}for(var R=0;R<c;R++)for(var I=0;I<u;I++){var L=v+I+k*R,D=v+I+k*(R+1),P=v+(I+1)+k*(R+1),z=v+(I+1)+k*R;d.push(L,D,z),d.push(D,P,z),E+=6}h.addGroup(g,E,l),g+=E,v+=_}return b("z","y","x",-1,-1,a,r,e,c,u,0),b("z","y","x",1,-1,a,r,-e,c,u,1),b("x","z","y",1,1,e,a,r,s,c,2),b("x","z","y",1,-1,e,a,-r,s,c,3),b("x","y","z",1,-1,e,r,a,s,u,4),b("x","y","z",-1,-1,e,r,-a,s,u,5),l.setIndex(d),l.setAttribute("position",new ot(f,3)),l.setAttribute("normal",new ot(p,3)),l.setAttribute("uv",new ot(m,2)),l}return n}(gt);function Ht(e){var t={};for(var n in e)for(var r in t[n]={},e[n]){var a=e[n][r];a&&(a.isColor||a.isMatrix3||a.isMatrix4||a.isVector2||a.isVector3||a.isVector4||a.isTexture)?t[n][r]=a.clone():Array.isArray(a)?t[n][r]=a.slice():t[n][r]=a}return t}function qt(e){for(var t={},n=0;n<e.length;n++){var r=Ht(e[n]);for(var a in r)t[a]=r[a]}return t}var Xt={clone:Ht,merge:qt};function Yt(e){Ke.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function Kt(){Q.call(this),this.type="Camera",this.matrixWorldInverse=new I,this.projectionMatrix=new I,this.projectionMatrixInverse=new I}function Zt(e,t,n,r){Kt.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}Yt.prototype=Object.create(Ke.prototype),Yt.prototype.constructor=Yt,Yt.prototype.isShaderMaterial=!0,Yt.prototype.copy=function(e){return Ke.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Ht(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=Object.assign({},e.extensions),this},Yt.prototype.toJSON=function(e){var t=Ke.prototype.toJSON.call(this,e);for(var n in t.uniforms={},this.uniforms){var r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:"t",value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:"m4",value:r.toArray()}:t.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var a={};for(var i in this.extensions)!0===this.extensions[i]&&(a[i]=!0);return Object.keys(a).length>0&&(t.extensions=a),t},Kt.prototype=Object.assign(Object.create(Q.prototype),{constructor:Kt,isCamera:!0,copy:function(e,t){return Q.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new j),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){Q.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(e,t){Q.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Zt.prototype=Object.assign(Object.create(Kt.prototype),{constructor:Zt,isPerspectiveCamera:!0,copy:function(e,t){return Kt.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*p.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*p.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e}
2,getEffectiveFOV:function(){return 2*p.RAD2DEG*Math.atan(Math.tan(.5*p.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,r,a,i){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=a,this.view.height=i,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*p.DEG2RAD*this.fov)/this.zoom,n=2*t,r=this.aspect*n,a=-.5*r,i=this.view;if(null!==this.view&&this.view.enabled){var o=i.fullWidth,s=i.fullHeight;a+=i.offsetX*r/o,t-=i.offsetY*n/s,r*=i.width/o,n*=i.height/s}var u=this.filmOffset;0!==u&&(a+=e*u/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+r,t,t-n,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=Q.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}});function Jt(e,t,n){if(Q.call(this),this.type="CubeCamera",!0===n.isWebGLCubeRenderTarget){this.renderTarget=n;var r=new Zt(90,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new j(1,0,0)),this.add(r);var a=new Zt(90,1,e,t);a.layers=this.layers,a.up.set(0,-1,0),a.lookAt(new j(-1,0,0)),this.add(a);var i=new Zt(90,1,e,t);i.layers=this.layers,i.up.set(0,0,1),i.lookAt(new j(0,1,0)),this.add(i);var o=new Zt(90,1,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new j(0,-1,0)),this.add(o);var s=new Zt(90,1,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new j(0,0,1)),this.add(s);var u=new Zt(90,1,e,t);u.layers=this.layers,u.up.set(0,-1,0),u.lookAt(new j(0,0,-1)),this.add(u),this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var c=e.xr.enabled,l=e.getRenderTarget();e.xr.enabled=!1;var h=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,r),e.setRenderTarget(n,1),e.render(t,a),e.setRenderTarget(n,2),e.render(t,i),e.setRenderTarget(n,3),e.render(t,o),e.setRenderTarget(n,4),e.render(t,s),n.texture.generateMipmaps=h,e.setRenderTarget(n,5),e.render(t,u),e.setRenderTarget(l),e.xr.enabled=c},this.clear=function(e,t,r,a){for(var i=e.getRenderTarget(),o=0;o<6;o++)e.setRenderTarget(n,o),e.clear(t,r,a);e.setRenderTarget(i)}}else console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.")}function Qt(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),w.call(this,e,e,t)}function $t(e,t,n,r,a,i,o,s,u,c,l,h){y.call(this,null,i,o,s,u,c,r,a,l,h),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==u?u:1003,this.minFilter=void 0!==c?c:1003,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}Jt.prototype=Object.create(Q.prototype),Jt.prototype.constructor=Jt,Qt.prototype=Object.create(w.prototype),Qt.prototype.constructor=Qt,Qt.prototype.isWebGLCubeRenderTarget=!0,Qt.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=t.format,this.texture.encoding=t.encoding;var n=new $,r={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include <begin_vertex>","\t#include <project_vertex>","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#include <common>","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV = equirectUv( direction );","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},a=new Yt({type:"CubemapFromEquirect",uniforms:Ht(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:1,blending:0});a.uniforms.tEquirect.value=t;var i=new Lt(new Gt(5,5,5),a);return n.add(i),new Jt(1,10,this).update(e,n),i.geometry.dispose(),i.material.dispose(),this},$t.prototype=Object.create(y.prototype),$t.prototype.constructor=$t,$t.prototype.isDataTexture=!0;var en=new ve,tn=new j;function nn(e,t,n,r,a,i){this.planes=[void 0!==e?e:new Te,void 0!==t?t:new Te,void 0!==n?n:new Te,void 0!==r?r:new Te,void 0!==a?a:new Te,void 0!==i?i:new Te]}Object.assign(nn.prototype,{set:function(e,t,n,r,a,i){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(a),o[5].copy(i),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,n=0;n<6;
vendor: 6,495 bytes, line 2
2n++)t[n].copy(e.planes[n]);return this},setFromProjectionMatrix:function(e){var t=this.planes,n=e.elements,r=n[0],a=n[1],i=n[2],o=n[3],s=n[4],u=n[5],c=n[6],l=n[7],h=n[8],d=n[9],f=n[10],p=n[11],m=n[12],v=n[13],g=n[14],b=n[15];return t[0].setComponents(o-r,l-s,p-h,b-m).normalize(),t[1].setComponents(o+r,l+s,p+h,b+m).normalize(),t[2].setComponents(o+a,l+u,p+d,b+v).normalize(),t[3].setComponents(o-a,l-u,p-d,b-v).normalize(),t[4].setComponents(o-i,l-c,p-f,b-g).normalize(),t[5].setComponents(o+i,l+c,p+f,b+g).normalize(),this},intersectsObject:function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),en.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(en)},intersectsSprite:function(e){return en.center.set(0,0,0),en.radius=.7071067811865476,en.applyMatrix4(e.matrixWorld),this.intersectsSphere(en)},intersectsSphere:function(e){for(var t=this.planes,n=e.center,r=-e.radius,a=0;a<6;a++){if(t[a].distanceToPoint(n)<r)return!1}return!0},intersectsBox:function(e){for(var t=this.planes,n=0;n<6;n++){var r=t[n];if(tn.x=r.normal.x>0?e.max.x:e.min.x,tn.y=r.normal.y>0?e.max.y:e.min.y,tn.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(tn)<0)return!1}return!0},containsPoint:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}});var rn={common:{diffuse:{value:new Ve(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new v},uv2Transform:{value:new v},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new m(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ve(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new Ve(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new v}},sprite:{diffuse:{value:new Ve(15658734)},opacity:{value:1},center:{value:new m(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new v}}};function an(){var e=null,t=!1,n=null;function r(a,i){!1!==t&&(n(a,i),e.requestAnimationFrame(r))}return{start:function(){!0!==t&&null!==n&&(e.requestAnimationFrame(r),t=!0)},stop:function(){t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function on(e,t){var n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,a){t.isInterleavedBufferAttribute&&(t=t.data);var i=r.get(t);void 0===i?r.set(t,function(t,n){var r=t.array,a=t.usage,i=e.createBuffer();e.bindBuffer(n,i),e.bufferData(n,r,a),t.onUploadCallback();var o=5126;return r instanceof Float32Array?o=5126:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?o=5123:r instanceof Int16Array?o=5122:r instanceof Uint32Array?o=5125:r instanceof Int32Array?o=5124:r instanceof Int8Array?o=5120:r instanceof Uint8Array&&(o=5121),{buffer:i,type:o,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version}}(t,a)):i.version<t.version&&(!function(t,r,a){var i=r.array,o=r.updateRange;e.bindBuffer(a,t),-1===o.count?e.bufferSubData(a,0,i):(n?e.bufferSubData(a,o.offset*i.BYTES_PER_ELEMENT,i,o.offset,o.count):e.bufferSubData(a,o.offset*i.BYTES_PER_ELEMENT,i.subarray(o.offset,o.offset+o.count)),o.count=-1)}(i.buffer,t,a),i.version=t.version)}}}function sn(e,t,n,r){Wt.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new un(e,t,n,r)),this.mergeVertices()}function un(e,t,n,r){gt.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};var a,i,o=(e=e||1)/2,s=(t=t||1)/2,u=Math.floor(n)||1,c=Math.floor(r)||1,l=u+1,h=c+1,d=e/u,f=t/c,p=[],m=[],v=[],g=[];for(i=0;i<h;i++){var b=i*f-s;for(a=0;a<l;a++){var y=a*d-o;m.push(y,-b,0),v.push(0,0,1),g.push(a/u),g.push(1-i/c)}}for(i=0;i<c;i++)for(a=0;a<u;a++){var x=a+l*i,w=a+l*(i+1),O=a+1+l*(i+1),k=a+1+l*i;p.push(x,w,k),p.push(w,O,k)}this.setIndex(p),this.setAttribute("position",new ot(m,3)),this.setAttribute("normal",new ot(v,3)),this.setAttribute("uv",new ot(g,2))}sn.prototype=Object.create(Wt.prototype),sn.prototype.constructor=sn,un.prototype=Object.create(gt.prototype),un.prototype.constructor=un;var cn={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot
2( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );
2\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}
2\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\nfloat getFace(vec3 direction) {\n vec3 absDirection = abs(direction);\n float face = -1.0;\n if (absDirection.x > absDirection.z) {\n if (absDirection.x > absDirection.y)\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if (absDirection.z > absDirection.y)\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n}\nvec2 getUV(vec3 direction, float face) {\n vec2 uv;\n if (face == 0.0) {\n uv = vec2(direction.z, direction.y) / abs(direction.x); } else if (face == 1.0) {\n uv = vec2(-direction.x, -direction.z) / abs(direction.y); } else if (face == 2.0) {\n uv = vec2(-direction.x, direction.y) / abs(direction.z); } else if (face == 3.0) {\n uv = vec2(-direction.z, direction.y) / abs(direction.x); } else if (face == 4.0) {\n uv = vec2(-direction.x, direction.z) / abs(direction.y); } else {\n uv = vec2(direction.x, direction.y) / abs(direction.z); }\n return 0.5 * (uv + 1.0);\n}\nvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n float face = getFace(direction);\n float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n mipInt = max(mipInt, cubeUV_minMipLevel);\n float faceSize = exp2(mipInt);\n float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n vec2 f = fract(uv);\n uv += 0.5 - f;\n if (face > 2.0) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if(mipInt < cubeUV_maxMipLevel){\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n uv *= texelSize;\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n return mix(tm, bm, f.y);\n}\n#define r0 1.0\n#define v0 0.339\n#define m0 -2.0\n#define r1 0.8\n#define v1 0.276\n#define m1 -1.0\n#define r4 0.4\n#define v4 0.046\n#define m4 2.0\n#define r5 0.305\n#define v5 0.016\n#define m5 3.0\n#define r6 0.21\n#define v6 0.0038\n#define m6 4.0\nfloat roughnessToMip(float roughness) {\
2n float mip = 0.0;\n if (roughness >= r1) {\n mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n } else if (roughness >= r4) {\n mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n } else if (roughness >= r5) {\n mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n } else if (roughness >= r6) {\n mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n } else {\n mip = -2.0 * log2(1.16 * roughness); }\n return mip;\n}\nvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {\n float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}
2\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec2 sampleUV = equirectUv( reflectVec );\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV = equirectUv( reflectVec );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) { \n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t}
2 else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}
2\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot
2( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;
2\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot
2( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );
2\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
2\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );
2\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;
2\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
2\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;
2\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",shadow_vert:"#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"},ln={basic:{uniforms:qt([rn.common,rn.specularmap,rn.envmap,rn.aomap,rn.lightmap,rn.fog]),vertexShader:cn.meshbasic_vert,fragmentShader:cn.meshbasic_frag},lambert:{uniforms:qt([rn.common,rn.specularmap,rn.envmap,rn.aomap,rn.lightmap,rn.emissivemap,rn.fog,rn.lights,{emissive:{value:new Ve(0)}}]),vertexShader:cn.meshlambert_vert,fragmentShader:cn.meshlambert_frag},phong:{uniforms:qt([rn.common,rn.specularmap,rn.envmap,rn.aomap,rn.lightmap,rn.emissivemap,rn.bumpmap,rn.normalmap,rn.displacementmap,rn.fog,rn.lights,{emissive:{value:new Ve(0)},specular:{value:new Ve(1118481)},shininess:{value:30}}]),vertexShader:cn.meshphong_vert,fragmentShader:cn.meshphong_frag},standard:{uniforms:qt([rn.common,rn.envmap,rn.aomap,rn.lightmap,rn.emissivemap,rn.bumpmap,rn.normalmap,rn.displacementmap,rn.roughnessmap,rn.metalnessmap,rn.fog,rn.lights,{emissive:{value:new Ve(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:cn.meshphysical_vert,fragmentShader:cn.meshphysical_frag},toon:{uniforms:qt([rn.common,rn.specularmap,rn.aomap,rn.lightmap,rn.emissivemap,rn.bumpmap,rn.normalmap,rn.displacementmap,rn.gradientmap,rn.fog,rn.lights,{emissive:{value:new Ve(0)},specular:{value:new Ve(1118481)},shininess:{value:30}}]),vertexShader:cn.meshtoon_vert,fragmentShader:cn.meshtoon_frag},matcap:{uniforms:qt([rn.common,rn.bumpmap,rn.normalmap,rn.displacementmap,rn.fog,{matc
vendor: 7,332 bytes, line 2
2ap:{value:null}}]),vertexShader:cn.meshmatcap_vert,fragmentShader:cn.meshmatcap_frag},points:{uniforms:qt([rn.points,rn.fog]),vertexShader:cn.points_vert,fragmentShader:cn.points_frag},dashed:{uniforms:qt([rn.common,rn.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:cn.linedashed_vert,fragmentShader:cn.linedashed_frag},depth:{uniforms:qt([rn.common,rn.displacementmap]),vertexShader:cn.depth_vert,fragmentShader:cn.depth_frag},normal:{uniforms:qt([rn.common,rn.bumpmap,rn.normalmap,rn.displacementmap,{opacity:{value:1}}]),vertexShader:cn.normal_vert,fragmentShader:cn.normal_frag},sprite:{uniforms:qt([rn.sprite,rn.fog]),vertexShader:cn.sprite_vert,fragmentShader:cn.sprite_frag},background:{uniforms:{uvTransform:{value:new v},t2D:{value:null}},vertexShader:cn.background_vert,fragmentShader:cn.background_frag},cube:{uniforms:qt([rn.envmap,{opacity:{value:1}}]),vertexShader:cn.cube_vert,fragmentShader:cn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:cn.equirect_vert,fragmentShader:cn.equirect_frag},distanceRGBA:{uniforms:qt([rn.common,rn.displacementmap,{referencePosition:{value:new j},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:cn.distanceRGBA_vert,fragmentShader:cn.distanceRGBA_frag},shadow:{uniforms:qt([rn.lights,rn.fog,{color:{value:new Ve(0)},opacity:{value:1}}]),vertexShader:cn.shadow_vert,fragmentShader:cn.shadow_frag}};function hn(e,t,n,r){var a,i,o=new Ve(0),s=0,u=null,c=0,l=null;function h(e,n){t.buffers.color.setClear(e.r,e.g,e.b,n,r)}return{getClearColor:function(){return o},setClearColor:function(e,t){o.set(e),h(o,s=void 0!==t?t:1)},getClearAlpha:function(){return s},setClearAlpha:function(e){h(o,s=e)},render:function(t,r,d,f){var p=r.background,m=e.xr,v=m.getSession&&m.getSession();if(v&&"additive"===v.environmentBlendMode&&(p=null),null===p?h(o,s):p&&p.isColor&&(h(p,1),f=!0),(e.autoClear||f)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),p&&(p.isCubeTexture||p.isWebGLCubeRenderTarget||306===p.mapping)){void 0===i&&((i=new Lt(new Gt(1,1,1),new Yt({type:"BackgroundCubeMaterial",uniforms:Ht(ln.cube.uniforms),vertexShader:ln.cube.vertexShader,fragmentShader:ln.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),i.geometry.deleteAttribute("uv"),i.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(i.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(i));var g=p.isWebGLCubeRenderTarget?p.texture:p;i.material.uniforms.envMap.value=g,i.material.uniforms.flipEnvMap.value=g.isCubeTexture?-1:1,u===p&&c===g.version&&l===e.toneMapping||(i.material.needsUpdate=!0,u=p,c=g.version,l=e.toneMapping),t.unshift(i,i.geometry,i.material,0,0,null)}else p&&p.isTexture&&(void 0===a&&((a=new Lt(new un(2,2),new Yt({type:"BackgroundMaterial",uniforms:Ht(ln.background.uniforms),vertexShader:ln.background.vertexShader,fragmentShader:ln.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=p,!0===p.matrixAutoUpdate&&p.updateMatrix(),a.material.uniforms.uvTransform.value.copy(p.matrix),u===p&&c===p.version&&l===e.toneMapping||(a.material.needsUpdate=!0,u=p,c=p.version,l=e.toneMapping),t.unshift(a,a.geometry,a.material,0,0,null))}}}function dn(e,t,n,r){var a,i=r.isWebGL2;this.setMode=function(e){a=e},this.render=function(t,r){e.drawArrays(a,t,r),n.update(r,a)},this.renderInstances=function(r,o,s,u){if(0!==u){var c,l;if(i)c=e,l="drawArraysInstanced";else if(l="drawArraysInstancedANGLE",null===(c=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[l](a,o,s,u),n.update(s,a,u)}}}function fn(e,t,n){var r;function a(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var i="undefined"!==typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!==typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,o=void 0!==n.precision?n.precision:"highp",s=a(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var u=!0===n.logarithmicDepthBuffer,c=e.getParameter(34930),l=e.getParameter(35660),h=e.getParameter(3379),d=e.getParameter(34076),f=e.getParameter(34921),p=e.getParameter(36347),m=e.getParameter(36348),v=e.getParameter(36349),g=l>0,b=i||!!t.get("OES_texture_float");return{isWebGL2:i,getMaxAnisotropy:function(){if(void 0!==r)return r;var n=t.get("EXT_texture_filter_anisotropic");return r=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:a,precision:o,logarithmicDepthBuffer:u,maxTextures:c,maxVertexTextures:l,maxTextureSize:h,maxCubemapSize:d,maxAttributes:f,maxVertexUniforms:p,maxVaryings:m,maxFragmentUniforms:v,vertexTextures:g,floatFragmentTextures:b,floatVertexTextures:g&&b,maxSamples:i?e.getParameter(36183):0}}function pn(){var e=this,t=null,n=0,r=!1,a=!1,i=new Te,o=new v,s={value:null,needsUpdate:!1};function u(){s.value!==t&&(s.value=t,s.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function c(t,n,r,a){var u=null!==t?t.length:0,c=null;if(0!==u){if(c=s.value,!0!==a||null===c){var l=r+4*u,h=n.matrixWorldInverse;o.getNormalMatrix(h),(null===c||c.length<l)&&(c=new Float32Array(l));for(var d=0,f=r;d!==u;++d,f+=4)i.copy(t[d]).applyMatrix4(h,o),i.normal.toArray(c,f),c[f+3]=i.constant}s.value=c,s.needsUpdate=!0}return e.numPlanes=u,e.numIntersection=0,c}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(e,a,i){var o=0!==e.length||a||0!==n||r;return r=a,t=c(e,i,0),n=e.length,o},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1,u()},this.setState=function(e,i,o,l,h,d){if(!r||null===e||0===e.length||a&&!o)a?c(null):u();else{var f=a?0:n,p=4*f,m=h.clippingState||null;s.value=m,m=c(e,l,p,d);for(var v=0;v!==p;++v)m[v]=t[v];h.clippingState=m,this.numIntersection=i?this.numPlanes:0,this.numPlanes+=f}}}function mn(e){var t={};return{get:function(n){if(void 0!==t[n])return t[n];var r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return null===r&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),t[n]=r,r}}}
2function vn(e,t,n){var r=new WeakMap,a=new WeakMap;function i(e){var o=e.target,s=r.get(o);for(var u in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[u]);o.removeEventListener("dispose",i),r.delete(o);var c=a.get(s);c&&(t.remove(c),a.delete(s)),n.memory.geometries--}function o(e){var n=[],r=e.index,i=e.attributes.position,o=0;if(null!==r){var s=r.array;o=r.version;for(var u=0,c=s.length;u<c;u+=3){var l=s[u+0],h=s[u+1],d=s[u+2];n.push(l,h,h,d,d,l)}}else{s=i.array;o=i.version;for(u=0,c=s.length/3-1;u<c;u+=3){l=u+0,h=u+1,d=u+2;n.push(l,h,h,d,d,l)}}var f=new(ct(n)>65535?it:rt)(n,1);f.version=o,t.update(f,34963);var p=a.get(e);p&&t.remove(p),a.set(e,f)}return{get:function(e,t){var a=r.get(t);return a||(t.addEventListener("dispose",i),t.isBufferGeometry?a=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new gt).setFromObject(e)),a=t._bufferGeometry),r.set(t,a),n.memory.geometries++,a)},update:function(e){var n=e.index,r=e.attributes;for(var a in null!==n&&t.update(n,34963),r)t.update(r[a],34962);var i=e.morphAttributes;for(var a in i)for(var o=i[a],s=0,u=o.length;s<u;s++)t.update(o[s],34962)},getWireframeAttribute:function(e){var t=a.get(e);if(t){var n=e.index;null!==n&&t.version<n.version&&o(e)}else o(e);return a.get(e)}}}function gn(e,t,n,r){var a,i,o,s=r.isWebGL2;this.setMode=function(e){a=e},this.setIndex=function(e){i=e.type,o=e.bytesPerElement},this.render=function(t,r){e.drawElements(a,r,i,t*o),n.update(r,a)},this.renderInstances=function(r,u,c,l){if(0!==l){var h,d;if(s)h=e,d="drawElementsInstanced";else if(d="drawElementsInstancedANGLE",null===(h=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[d](a,c,i,u*o,l),n.update(c,a,l)}}}function bn(e){var t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(e,n,r){switch(r=r||1,t.calls++,n){case 4:t.triangles+=r*(e/3);break;case 1:t.lines+=r*(e/2);break;case 3:t.lines+=r*(e-1);break;case 2:t.lines+=r*e;break;case 0:t.points+=r*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function yn(e,t){return Math.abs(t[1])-Math.abs(e[1])}function xn(e){var t={},n=new Float32Array(8);return{update:function(r,a,i,o){var s=r.morphTargetInfluences,u=void 0===s?0:s.length,c=t[a.id];if(void 0===c){c=[];for(var l=0;l<u;l++)c[l]=[l,0];t[a.id]=c}var h=i.morphTargets&&a.morphAttributes.position,d=i.morphNormals&&a.morphAttributes.normal;for(l=0;l<u;l++){0!==(p=c[l])[1]&&(h&&a.deleteAttribute("morphTarget"+l),d&&a.deleteAttribute("morphNormal"+l))}for(l=0;l<u;l++){(p=c[l])[0]=l,p[1]=s[l]}c.sort(yn);var f=0;for(l=0;l<8;l++){var p;if(p=c[l]){var m=p[0],v=p[1];if(v){h&&a.setAttribute("morphTarget"+l,h[m]),d&&a.setAttribute("morphNormal"+l,d[m]),n[l]=v,f+=v;continue}}n[l]=0}var g=a.morphTargetsRelative?1:1-f;o.getUniforms().setValue(e,"morphTargetBaseInfluence",g),o.getUniforms().setValue(e,"morphTargetInfluences",n)}}}function wn(e,t,n,r){var a=new WeakMap;return{update:function(e){var i=r.render.frame,o=e.geometry,s=t.get(e,o);return a.get(s)!==i&&(o.isGeometry&&s.updateFromObject(e),t.update(s),a.set(s,i)),e.isInstancedMesh&&n.update(e.instanceMatrix,34962),s},dispose:function(){a=new WeakMap}}}function On(e,t,n,r,a,i,o,s,u,c){e=void 0!==e?e:[],t=void 0!==t?t:301,o=void 0!==o?o:1022,y.call(this,e,t,n,r,a,i,o,s,u,c),this.flipY=!1}function kn(e,t,n,r){y.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:r||1},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function Sn(e,t,n,r){y.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:r||1},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}ln.physical={uniforms:qt([ln.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new m(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new Ve(0)},transparency:{value:0}}]),vertexShader:cn.meshphysical_vert,fragmentShader:cn.meshphysical_frag},On.prototype=Object.create(y.prototype),On.prototype.constructor=On,On.prototype.isCubeTexture=!0,Object.defineProperty(On.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}}),kn.prototype=Object.create(y.prototype),kn.prototype.constructor=kn,kn.prototype.isDataTexture2DArray=!0,Sn.prototype=Object.create(y.prototype),Sn.prototype.constructor=Sn,Sn.prototype.isDataTexture3D=!0;var _n=new y,jn=new kn,En=new Sn,Tn=new On,Cn=[],Mn=[],An=new Float32Array(16),Nn=new Float32Array(9),Rn=new Float32Array(4);function In(e,t,n){var r=e[0];if(r<=0||r>0)return e;var a=t*n,i=Cn[a];if(void 0===i&&(i=new Float32Array(a),Cn[a]=i),0!==t){r.toArray(i,0);for(var o=1,s=0;o!==t;++o)s+=n,e[o].toArray(i,s)}return i}function Ln(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function Dn(e,t){for(var n=0,r=t.length;n<r;n++)e[n]=t[n]}function Pn(e,t){var n=Mn[t];void 0===n&&(n=new Int32Array(t),Mn[t]=n);for(var r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function zn(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function Fn(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(Ln(n,t))return;e.uniform2fv(this.addr,t),Dn(n,t)}}function Bn(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(Ln(n,t))return;e.uniform3fv(this.addr,t),Dn(n,t)}}function Un(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(Ln(n,t))return;e.uniform4fv(this.addr,t),Dn(n,t)}}function Wn(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(Ln(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Dn(n,t)}else{if(Ln(n,r))return;Rn.set(r),e.uniformMatrix2fv(this.addr,!1,Rn),Dn(n,r)}}function Vn(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(Ln(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Dn(n,t)}else{if(Ln(n,r))return;Nn.set(r),e.uniformMatrix3fv(this.addr,!1,Nn),Dn(n,r)}}function Gn(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(Ln(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Dn(n,t)}else{if(Ln(n,r))return;An.set(r),e.uniformMatrix4fv(this.addr,!1,An),Dn(n,r)}}function Hn(e,t,n){var r=this.cache,a=n.allocateTextureUnit();r[0]!==a&&(e.uniform1i(this.addr,a),r[0]=a),n.safeSetTexture2D(t||_n,a)}
vendor: 5,467 bytes, line 2
2function qn(e,t,n){var r=this.cache,a=n.allocateTextureUnit();r[0]!==a&&(e.uniform1i(this.addr,a),r[0]=a),n.setTexture2DArray(t||jn,a)}function Xn(e,t,n){var r=this.cache,a=n.allocateTextureUnit();r[0]!==a&&(e.uniform1i(this.addr,a),r[0]=a),n.setTexture3D(t||En,a)}function Yn(e,t,n){var r=this.cache,a=n.allocateTextureUnit();r[0]!==a&&(e.uniform1i(this.addr,a),r[0]=a),n.safeSetTextureCube(t||Tn,a)}function Kn(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function Zn(e,t){var n=this.cache;Ln(n,t)||(e.uniform2iv(this.addr,t),Dn(n,t))}function Jn(e,t){var n=this.cache;Ln(n,t)||(e.uniform3iv(this.addr,t),Dn(n,t))}function Qn(e,t){var n=this.cache;Ln(n,t)||(e.uniform4iv(this.addr,t),Dn(n,t))}function $n(e,t){var n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function er(e,t){e.uniform1fv(this.addr,t)}function tr(e,t){e.uniform1iv(this.addr,t)}function nr(e,t){e.uniform2iv(this.addr,t)}function rr(e,t){e.uniform3iv(this.addr,t)}function ar(e,t){e.uniform4iv(this.addr,t)}function ir(e,t){var n=In(t,this.size,2);e.uniform2fv(this.addr,n)}function or(e,t){var n=In(t,this.size,3);e.uniform3fv(this.addr,n)}function sr(e,t){var n=In(t,this.size,4);e.uniform4fv(this.addr,n)}function ur(e,t){var n=In(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function cr(e,t){var n=In(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function lr(e,t){var n=In(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function hr(e,t,n){var r=t.length,a=Pn(n,r);e.uniform1iv(this.addr,a);for(var i=0;i!==r;++i)n.safeSetTexture2D(t[i]||_n,a[i])}function dr(e,t,n){var r=t.length,a=Pn(n,r);e.uniform1iv(this.addr,a);for(var i=0;i!==r;++i)n.safeSetTextureCube(t[i]||Tn,a[i])}function fr(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=function(e){switch(e){case 5126:return zn;case 35664:return Fn;case 35665:return Bn;case 35666:return Un;case 35674:return Wn;case 35675:return Vn;case 35676:return Gn;case 5124:case 35670:return Kn;case 35667:case 35671:return Zn;case 35668:case 35672:return Jn;case 35669:case 35673:return Qn;case 5125:return $n;case 35678:case 36198:case 36298:case 36306:case 35682:return Hn;case 35679:case 36299:case 36307:return Xn;case 35680:case 36300:case 36308:case 36293:return Yn;case 36289:case 36303:case 36311:case 36292:return qn}}(t.type)}function pr(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return er;case 35664:return ir;case 35665:return or;case 35666:return sr;case 35674:return ur;case 35675:return cr;case 35676:return lr;case 5124:case 35670:return tr;case 35667:case 35671:return nr;case 35668:case 35672:return rr;case 35669:case 35673:return ar;case 35678:case 36198:case 36298:case 36306:case 35682:return hr;case 35680:case 36300:case 36308:case 36293:return dr}}(t.type)}function mr(e){this.id=e,this.seq=[],this.map={}}pr.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),Dn(t,e)},mr.prototype.setValue=function(e,t,n){for(var r=this.seq,a=0,i=r.length;a!==i;++a){var o=r[a];o.setValue(e,t[o.id],n)}};var vr=/([\w\d_]+)(\])?(\[|\.)?/g;function gr(e,t){e.seq.push(t),e.map[t.id]=t}function br(e,t,n){var r=e.name,a=r.length;for(vr.lastIndex=0;;){var i=vr.exec(r),o=vr.lastIndex,s=i[1],u="]"===i[2],c=i[3];if(u&&(s|=0),void 0===c||"["===c&&o+2===a){gr(n,void 0===c?new fr(s,e,t):new pr(s,e,t));break}var l=n.map[s];void 0===l&&gr(n,l=new mr(s)),n=l}}function yr(e,t){this.seq=[],this.map={};for(var n=e.getProgramParameter(t,35718),r=0;r<n;++r){var a=e.getActiveUniform(t,r);br(a,e.getUniformLocation(t,a.name),this)}}function xr(e,t,n){var r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}yr.prototype.setValue=function(e,t,n,r){var a=this.map[t];void 0!==a&&a.setValue(e,n,r)},yr.prototype.setOptional=function(e,t,n){var r=t[n];void 0!==r&&this.setValue(e,n,r)},yr.upload=function(e,t,n,r){for(var a=0,i=t.length;a!==i;++a){var o=t[a],s=n[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,r)}},yr.seqWithValue=function(e,t){for(var n=[],r=0,a=e.length;r!==a;++r){var i=e[r];i.id in t&&n.push(i)}return n};var wr=0;function Or(e){switch(e){case 3e3:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case 3003:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+e)}}function kr(e,t,n){var r=e.getShaderParameter(t,35713),a=e.getShaderInfoLog(t).trim();return r&&""===a?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+a+function(e){for(var t=e.split("\n"),n=0;n<t.length;n++)t[n]=n+1+": "+t[n];return t.join("\n")}(e.getShaderSource(t))}function Sr(e,t){var n=Or(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function _r(e,t){var n=Or(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function jr(e,t){var n;switch(t){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="Uncharted2";break;case 4:n="OptimizedCineon";break;case 5:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Er(e){return""!==e}function Tr(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_L
2IGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function Cr(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var Mr=/^[ \t]*#include +<([\w\d./]+)>/gm;function Ar(e){return e.replace(Mr,Nr)}function Nr(e,t){var n=cn[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Ar(n)}var Rr=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Ir=/#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g;function Lr(e){return e.replace(Ir,Pr).replace(Rr,Dr)}function Dr(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Pr(e,t,n,r)}function Pr(e,t,n,r){for(var a="",i=parseInt(t);i<parseInt(n);i++)a+=r.replace(/\[ i \]/g,"[ "+i+" ]").replace(/UNROLLED_LOOP_INDEX/g,i);return a}function zr(e){var t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function Fr(e,t,n){var r,a,i=e.getContext(),o=n.defines,s=n.vertexShader,u=n.fragmentShader,c=function(e){var t="SHADOWMAP_TYPE_BASIC";return 1===e.shadowMapType?t="SHADOWMAP_TYPE_PCF":2===e.shadowMapType?t="SHADOWMAP_TYPE_PCF_SOFT":3===e.shadowMapType&&(t="SHADOWMAP_TYPE_VSM"),t}(n),l=function(e){var t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case 301:case 302:t="ENVMAP_TYPE_CUBE";break;case 306:case 307:t="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:t="ENVMAP_TYPE_EQUIREC";break;case 305:t="ENVMAP_TYPE_SPHERE"}return t}(n),h=function(e){var t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case 302:case 304:t="ENVMAP_MODE_REFRACTION"}return t}(n),d=function(e){var t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case 0:t="ENVMAP_BLENDING_MULTIPLY";break;case 1:t="ENVMAP_BLENDING_MIX";break;case 2:t="ENVMAP_BLENDING_ADD"}return t}(n),f=e.gammaFactor>0?e.gammaFactor:1,p=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Er).join("\n")}(n),m=function(e){var t=[];for(var n in e){var r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(o),v=i.createProgram();if(n.isRawShaderMaterial?((r=[m].filter(Er).join("\n")).length>0&&(r+="\n"),(a=[p,m].filter(Er).join("\n")).length>0&&(a+="\n")):(r=[zr(n),"#define SHADER_NAME "+n.shaderName,m,n.instancing?"#define USE_INSTANCING":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+f,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alph
vendor: 5,731 bytes, line 2
2aMap?"#define USE_ALPHAMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Er).join("\n"),a=[p,zr(n),"#define SHADER_NAME "+n.shaderName,m,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+f,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+l:"",n.envMap?"#define "+h:"",n.envMap?"#define "+d:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?cn.tonemapping_pars_fragment:"",0!==n.toneMapping?jr("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.outputEncoding||n.mapEncoding||n.matcapEncoding||n.envMapEncoding||n.emissiveMapEncoding||n.lightMapEncoding?cn.encodings_pars_fragment:"",n.mapEncoding?Sr("mapTexelToLinear",n.mapEncoding):"",n.matcapEncoding?Sr("matcapTexelToLinear",n.matcapEncoding):"",n.envMapEncoding?Sr("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMapEncoding?Sr("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMapEncoding?Sr("lightMapTexelToLinear",n.lightMapEncoding):"",n.outputEncoding?_r("linearToOutputTexel",n.outputEncoding):"",n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Er).join("\n")),s=Cr(s=Tr(s=Ar(s),n),n),u=Cr(u=Tr(u=Ar(u),n),n),s=Lr(s),u=Lr(u),n.isWebGL2&&!n.isRawShaderMaterial){var g=!1,b=/^\s*#version\s+300\s+es\s*\n/;n.isShaderMaterial&&null!==s.match(b)&&null!==u.match(b)&&(g=!0,s=s.replace(b,""),u=u.replace(b,"")),r=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+r,a=["#version 300 es\n","#define varying in",g?"":"out highp vec4 pc_fragColor;",g?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+a}var y,x,w=a+u,O=xr(i,35633,r+s),k=xr(i,35632,w);if(i.attachShader(v,O),i.attachShader(v,k),void 0!==n.index0AttributeName?i.bindAttribLocation(v,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(v,0,"position"),i.linkProgram(v),e.debug.checkSha
2derErrors){var S=i.getProgramInfoLog(v).trim(),_=i.getShaderInfoLog(O).trim(),j=i.getShaderInfoLog(k).trim(),E=!0,T=!0;if(!1===i.getProgramParameter(v,35714)){E=!1;var C=kr(i,O,"vertex"),M=kr(i,k,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(v,35715),"gl.getProgramInfoLog",S,C,M)}else""!==S?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",S):""!==_&&""!==j||(T=!1);T&&(this.diagnostics={runnable:E,programLog:S,vertexShader:{log:_,prefix:r},fragmentShader:{log:j,prefix:a}})}return i.deleteShader(O),i.deleteShader(k),this.getUniforms=function(){return void 0===y&&(y=new yr(i,v)),y},this.getAttributes=function(){return void 0===x&&(x=function(e,t){for(var n={},r=e.getProgramParameter(t,35721),a=0;a<r;a++){var i=e.getActiveAttrib(t,a).name;n[i]=e.getAttribLocation(t,i)}return n}(i,v)),x},this.destroy=function(){i.deleteProgram(v),this.program=void 0},this.name=n.shaderName,this.id=wr++,this.cacheKey=t,this.usedTimes=1,this.program=v,this.vertexShader=O,this.fragmentShader=k,this}function Br(e,t,n){var r=[],a=n.isWebGL2,i=n.logarithmicDepthBuffer,o=n.floatVertexTextures,s=n.precision,u=n.maxVertexUniforms,l=n.vertexTextures,h={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},d=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen"];function f(e){var t;return e?e.isTexture?t=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),t=e.texture.encoding):t=3e3,t}this.getParameters=function(r,d,p,m,v,g,b){var y=m.fog,x=r.isMeshStandardMaterial?m.environment:null,w=r.envMap||x,O=h[r.type],k=b.isSkinnedMesh?function(e){var t=e.skeleton.bones;if(o)return 1024;var n=u,r=Math.floor((n-20)/4),a=Math.min(r,t.length);return a<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+a+"."),0):a}(b):0;null!==r.precision&&(s=n.getMaxPrecision(r.precision))!==r.precision&&console.warn("THREE.WebGLProgram.getParameters:",r.precision,"not supported, using",s,"instead.");var S=function(e,t){var n;if(t){var r=ln[t];n={name:e.type,uniforms:Xt.clone(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader}}else n={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};return n}(r,O);r.onBeforeCompile(S,e);var _=e.getRenderTarget();return{isWebGL2:a,shaderID:O,shaderName:S.name,uniforms:S.uniforms,vertexShader:S.vertexShader,fragmentShader:S.fragmentShader,defines:r.defines,isRawShaderMaterial:r.isRawShaderMaterial,isShaderMaterial:r.isShaderMaterial,precision:s,instancing:!0===b.isInstancedMesh,supportsVertexTextures:l,outputEncoding:null!==_?f(_.texture):e.outputEncoding,map:!!r.map,mapEncoding:f(r.map),matcap:!!r.matcap,matc
2apEncoding:f(r.matcap),envMap:!!w,envMapMode:w&&w.mapping,envMapEncoding:f(w),envMapCubeUV:!!w&&(306===w.mapping||307===w.mapping),lightMap:!!r.lightMap,lightMapEncoding:f(r.lightMap),aoMap:!!r.aoMap,emissiveMap:!!r.emissiveMap,emissiveMapEncoding:f(r.emissiveMap),bumpMap:!!r.bumpMap,normalMap:!!r.normalMap,objectSpaceNormalMap:1===r.normalMapType,tangentSpaceNormalMap:0===r.normalMapType,clearcoatMap:!!r.clearcoatMap,clearcoatRoughnessMap:!!r.clearcoatRoughnessMap,clearcoatNormalMap:!!r.clearcoatNormalMap,displacementMap:!!r.displacementMap,roughnessMap:!!r.roughnessMap,metalnessMap:!!r.metalnessMap,specularMap:!!r.specularMap,alphaMap:!!r.alphaMap,gradientMap:!!r.gradientMap,sheen:!!r.sheen,combine:r.combine,vertexTangents:r.normalMap&&r.vertexTangents,vertexColors:r.vertexColors,vertexUvs:!!r.map||!!r.bumpMap||!!r.normalMap||!!r.specularMap||!!r.alphaMap||!!r.emissiveMap||!!r.roughnessMap||!!r.metalnessMap||!!r.clearcoatMap||!!r.clearcoatRoughnessMap||!!r.clearcoatNormalMap||!!r.displacementMap,uvsVertexOnly:!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatNormalMap)&&!!r.displacementMap,fog:!!y,useFog:r.fog,fogExp2:y&&y.isFogExp2,flatShading:r.flatShading,sizeAttenuation:r.sizeAttenuation,logarithmicDepthBuffer:i,skinning:r.skinning&&k>0,maxBones:k,useVertexTexture:o,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:d.directional.length,numPointLights:d.point.length,numSpotLights:d.spot.length,numRectAreaLights:d.rectArea.length,numHemiLights:d.hemi.length,numDirLightShadows:d.directionalShadowMap.length,numPointLightShadows:d.pointShadowMap.length,numSpotLightShadows:d.spotShadowMap.length,numClippingPlanes:v,numClipIntersection:g,dithering:r.dithering,shadowMapEnabled:e.shadowMap.enabled&&p.length>0,shadowMapType:e.shadowMap.type,toneMapping:r.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,alphaTest:r.alphaTest,doubleSided:r.side===c,flipSided:1===r.side,depthPacking:void 0!==r.depthPacking&&r.depthPacking,index0AttributeName:r.index0AttributeName,extensionDerivatives:r.extensions&&r.extensions.derivatives,extensionFragDepth:r.extensions&&r.extensions.fragDepth,extensionDrawBuffers:r.extensions&&r.extensions.drawBuffers,extensionShaderTextureLOD:r.extensions&&r.extensions.shaderTextureLOD,rendererExtensionFragDepth:a||null!==t.get("EXT_frag_depth"),rendererExtensionDrawBuffers:a||null!==t.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:a||null!==t.get("EXT_shader_texture_lod"),onBeforeCompile:r.onBeforeCompile}},this.getProgramCacheKey=function(t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var r in t.defines)n.push(r),n.push(t.defines[r]);if(void 0===t.isRawShaderMaterial){for(var a=0;a<d.length;a++)n.push(t[d[a]]);n.push(e.outputEncoding),n.push(e.gammaFactor)}return n.push(t.onBeforeCompile.toString()),n.join()},this.acquireProgram=function(t,n){for(var a,i=0,o=r.length;i<o;i++){var s=r[i];if(s.cacheKey===n){++(a=s).usedTimes;break}}return void 0===a&&(a=new Fr(e,n,t),r.push(a)),a},this.releaseProgram=function(e){if(0===--e.usedTimes){var t=r.indexOf(e);r[t]=r[r.length-1],r.pop(),e.destroy()}},this.programs=r}function Ur(){var e=new WeakMap;return{get:function(t){var n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,r){e.get(t)[n]=r},dispose:function(){e=new WeakMap}}}function Wr(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function Vr(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Gr(){var e=[],t=0,n=[],r=[],a={id:-1};function i(n,r,i,o,s,u){var c=e[t];return void 0===c?(c={id:n.id,object:n,geometry:r,material:i,program:i.program||a,groupOrder:o,renderOrder:n.renderOrder,z:s,group:u},e[t]=c):(c.id=n.id,c.object=n,c.geometry=r,c.material=i,c.program=i.program||a,c.groupOrder=o,c.renderOrder=n.renderOrder,c.z=s,c.group=u),t++,c}return{opaque:n,transparent:r,init:function(){t=0,n.length=0,r.length=0},push:function(e,t,a,o,s,u){var c=i(e,t,a,o,s,u);
2(!0===a.transparent?r:n).push(c)},unshift:function(e,t,a,o,s,u){var c=i(e,t,a,o,s,u);(!0===a.transparent?r:n).unshift(c)},finish:function(){for(var n=t,r=e.length;n<r;n++){var a=e[n];if(null===a.id)break;a.id=null,a.object=null,a.geometry=null,a.material=null,a.program=null,a.group=null}},sort:function(e,t){n.length>1&&n.sort(e||Wr),r.length>1&&r.sort(t||Vr)}}}function Hr(){var e=new WeakMap;function t(n){var r=n.target;r.removeEventListener("dispose",t),e.delete(r)}return{get:function(n,r){var a,i=e.get(n);return void 0===i?(a=new Gr,e.set(n,new WeakMap),e.get(n).set(r,a),n.addEventListener("dispose",t)):void 0===(a=i.get(r))&&(a=new Gr,i.set(r,a)),a},dispose:function(){e=new WeakMap}}}function qr(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new j,color:new Ve};break;case"SpotLight":n={position:new j,direction:new j,color:new Ve,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new j,color:new Ve,distance:0,decay:0};break;case"HemisphereLight":n={direction:new j,skyColor:new Ve,groundColor:new Ve};break;case"RectAreaLight":n={color:new Ve,position:new j,halfWidth:new j,halfHeight:new j}}return e[t.id]=n,n}}}var Xr=0;function Yr(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Kr(){for(var e=new qr,t=function(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowRadius:1,shadowMapSize:new m};break;case"PointLight":n={shadowBias:0,shadowRadius:1,shadowMapSize:new m,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},r=0;r<9;r++)n.probe.push(new j);var a=new j,i=new I,o=new I;return{setup:function(r,s,u){for(var c=0,l=0,h=0,d=0;d<9;d++)n.probe[d].set(0,0,0);var f=0,p=0,m=0,v=0,g=0,b=0,y=0,x=0,w=u.matrixWorldInverse;r.sort(Yr),d=0;for(var O=r.length;d<O;d++){var k=r[d],S=k.color,_=k.intensity,j=k.distance,E=k.shadow&&k.shadow.map?k.shadow.map.texture:null;if(k.isAmbientLight)c+=S.r*_,l+=S.g*_,h+=S.b*_;else if(k.isLightProbe)for(var T=0;T<9;T++)n.probe[T].addScaledVector(k.sh.coefficients[T],_);else if(k.isDirectionalLight){if((A=e.get(k)).color.copy(k.color).multiplyScalar(k.intensity),A.direction.setFromMatrixPosition(k.matrixWorld),a.setFromMatrixPosition(k.target.matrixWorld),A.direction.sub(a),A.direction.transformDirection(w),k.castShadow){var C=k.shadow;(M=t.get(k)).shadowBias=C.bias,M.shadowRadius=C.radius,M.shadowMapSize=C.mapSize,n.directionalShadow[f]=M,n.directionalShadowMap[f]=E,n.directionalShadowMatrix[f]=k.shadow.matrix,b++}n.directional[f]=A,f++}else if(k.isSpotLight){if((A=e.get(k)).position.setFromMatrixPosition(k.matrixWorld),A.position.applyMatrix4(w),A.color.copy(S).multiplyScalar(_),A.distance=j,A.direction.setFromMatrixPosition(k.matrixWorld),a.setFromMatrixPosition(k.target.matrixWorld),A.direction.sub(a),A.direction.transformDirection(w),A.coneCos=Math.cos(k.angle),A.penumbraCos=Math.cos(k.angle*(1-k.penumbra)),A.decay=k.decay,k.castShadow){C=k.shadow;(M=t.get(k)).shadowBias=C.bias,M.shadowRadius=C.radius,M.shadowMapSize=C.mapSize,n.spotShadow[m]=M,n.spotShadowMap[m]=E,n.spotShadowMatrix[m]=k.shadow.matrix,x++}n.spot[m]=A,m++}else if(k.isRectAreaLight){(A=e.get(k)).color.copy(S).multiplyScalar(_),A.position.setFromMatrixPosition(k.matrixWorld),A.position.applyMatrix4(w),o.identity(),i.copy(k.matrixWorld),i.premultiply(w),o.extractRotation(i),A.halfWidth.set(.5*k.width,0,0),A.halfHeight.set(0,.5*k.height,0),A.halfWidth.applyMatrix4(o),A.halfHeight.applyMatrix4(o),n.rectArea[v]=A,v++}else if(k.isPointLight){if((A=e.get(k)).position.setFromMatrixPosition(k.matrixWorld),A.position.applyMatrix4(w),A.color.copy(k.color).multiplyScalar(k.intensity),A.distance=k.distance,A.decay=k.decay,k.castShadow){var M;C=k.shadow;(M=t.get(k)).shadowBias=C.bias,M.shadowRadius=C.radius,M.shadowMapSize=C.mapSize,M.shadowCameraNear=C.camera.near,M.shadowCameraFar=C.camera.far,n.pointShadow[p]=M,n.pointShadowMap[p]=E,n.pointShadowMatrix[p]=k.shadow.matrix,y++}n.point[p]=A,p++}else if(k.isHemisphereLight){var A;(A=e.get(k)).direction.setFromMatrixPosition(k.matrixWorld),A.direction.transformDirection(w),A.direction.normalize(),A.skyColor.copy(k.color).multiplyScalar(_),A.groundColor.copy(k.groundColor).multiplyScalar(_),n.hemi[g]=A,g++}}n.ambient[0]=c,n.ambient[1]=l,n.ambient[2]=h;var N=n.hash;N.directionalLength===f&&N.pointLength===p&&N.spotLength===m&&N.rectAreaLength===v&&N.hemiLength===g&&N.numDirectionalShadows===b&&N.numPointShadows===y&&N.numSpotShadows===x||(n.directional.length=f,n.spot.length=m,n.rectArea.length=v,n.point.length=p,n.hemi.length=g,n.directionalShadow.length=b,n.directionalShadowMap.length=b,n.pointShadow.length=y,n.pointShadowMap.length=y,n.spotShadow.length=x,n.spotShadowMap.length=x,n.directionalShadowMatrix.length=b,n.pointShadowMatrix.length=y,n.spotShadowMatrix.length=x,N.directionalLength=f,N.pointLength=p,N.spotLength=m,N.rectAreaLength=v,N.hemiLength=g,N.numDirectionalShadows=b,N.numPointShadows=y,N.numSpotShadows=x,n.version=Xr++)},state:n}}function Zr(){var e=new Kr,t=[],n=[];return{init:function(){t.length=0,n.length=0},state:{lightsArray:t,shadowsArray:n,lights:e},setupLights:function(r){e.setup(t,n,r)},pushLight:function(e){t.push(e)},pushShadow:function(e){n.push(e)}}}function Jr(){var e=new WeakMap;function t(n){var r=n.target;r.removeEventListener("dispose",t),e.delete(r)}return{get:function(n,r){var a;return!1===e.has(n)?(a=new Zr,e.set(n,new WeakMap),e.get(n).set(r,a),n.addEventListener("dispose",t)):!1===e.get(n).has(r)?(a=new Zr,e.get(n).set(r,a)):a=e.get(n).get(r),a},dispose:function(){e=new WeakMap}}}function Qr(e){Ke.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}function $r(e){Ke.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new j,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}Qr.prototype=Object.create(Ke.prototype),Qr.prototype.constructor=Qr,Qr.prototype.isMeshDepthMaterial=!0,Qr.prototype.copy=function(e){return Ke.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},$r.prototype=Object.create(Ke.prototype),$r.prototype.constructor=$r,$r.prototype.isMeshDistanceMaterial=!0,$r.prototype.copy=function(e){return Ke.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this};
2function ea(e,t,n){var r=new nn,a=new m,i=new m,o=new x,s=[],u=[],l={},h={0:1,1:0,2:c},d=new Yt({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new m},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),f=d.clone();f.defines.HORIZONAL_PASS=1;var p=new gt;p.setAttribute("position",new Qe(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var v=new Lt(p,d),g=this;function b(n,r){var a=t.update(v);d.uniforms.shadow_pass.value=n.map.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,a,d,v,null),f.uniforms.shadow_pass.value=n.mapPass.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,a,f,v,null)}function y(e,t,n){var r=e<<0|t<<1|n<<2,a=s[r];return void 0===a&&(a=new Qr({depthPacking:3201,morphTargets:e,skinning:t}),s[r]=a),a}function O(e,t,n){var r=e<<0|t<<1|n<<2,a=u[r];return void 0===a&&(a=new $r({morphTargets:e,skinning:t}),u[r]=a),a}function k(t,n,r,a,i,o,s){var u=null,c=y,d=t.customDepthMaterial;if(!0===a.isPointLight&&(c=O,d=t.customDistanceMaterial),void 0===d){var f=!1;!0===r.morphTargets&&(f=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);var p=!1;!0===t.isSkinnedMesh&&(!0===r.skinning?p=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),u=c(f,p,!0===t.isInstancedMesh)}else u=d;if(e.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){var m=u.uuid,v=r.uuid,g=l[m];void 0===g&&(g={},l[m]=g);var b=g[v];void 0===b&&(b=u.clone(),g[v]=b),u=b}return u.visible=r.visible,u.wireframe=r.wireframe,u.side=3===s?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:h[r.side],u.clipShadows=r.clipShadows,u.clippingPlanes=r.clippingPlanes,u.clipIntersection=r.clipIntersection,u.wireframeLinewidth=r.wireframeLinewidth,u.linewidth=r.linewidth,!0===a.isPointLight&&!0===u.isMeshDistanceMaterial&&(u.referencePosition.setFromMatrixPosition(a.matrixWorld),u.nearDistance=i,u.farDistance=o),u}function S(n,a,i,o,s){if(!1!==n.visible){if(n.layers.test(a.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===s)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,n.matrixWorld);var u=t.update(n),c=n.material;if(Array.isArray(c))for(var l=u.groups,h=0,d=l.length;h<d;h++){var f=l[h],p=c[f.materialIndex];if(p&&p.visible){var m=k(n,u,p,o,i.near,i.far,s);e.renderBufferDirect(i,null,u,m,n,f)}}else if(c.visible){m=k(n,u,c,o,i.near,i.far,s);e.renderBufferDirect(i,null,u,m,n,null)}}for(var v=n.children,g=0,b=v.length;g<b;g++)S(v[g],a,i,o,s)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(t,s,u){if(!1!==g.enabled&&(!1!==g.autoUpdate||!1!==g.needsUpdate)&&0!==t.length){var c=e.getRenderTarget(),l=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),d=e.state;d.setBlending(0),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(var f=0,p=t.length;f<p;f++){var m=t[f],v=m.shadow;if(void 0!==v){a.copy(v.mapSize);var y=v.getFrameExtents();if(a.multiply(y),i.copy(v.mapSize),(a.x>n||a.y>n)&&(a.x>n&&(i.x=Math.floor(n/y.x),a.x=i.x*y.x,v.mapSize.x=i.x),a.y>n&&(i.y=Math.floor(n/y.y),a.y=i.y*y.y,v.mapSize.y=i.y)),null===v.map&&!v.isPointLightShadow&&3===this.type){var x={minFilter:1006,magFilter:1006,format:1023};v.map=new w(a.x,a.y,x),v.map.texture.name=m.name+".shadowMap",v.mapPass=new w(a.x,a.y,x),v.camera.updateProjectionMatrix()}if(null===v.map){x={minFilter:1003,magFilter:1003,format:1023};v.map=new w(a.x,a.y,x),v.map.texture.name=m.name+".shadowMap",v.camera.updateProjectionMatrix()}
2e.setRenderTarget(v.map),e.clear();for(var O=v.getViewportCount(),k=0;k<O;k++){var _=v.getViewport(k);o.set(i.x*_.x,i.y*_.y,i.x*_.z,i.y*_.w),d.viewport(o),v.updateMatrices(m,k),r=v.getFrustum(),S(s,u,v.camera,m,this.type)}v.isPointLightShadow||3!==this.type||b(v,u)}else console.warn("THREE.WebGLShadowMap:",m,"has no shadow.")}g.needsUpdate=!1,e.setRenderTarget(c,l,h)}}}function ta(e,t,n){var r,i,o=n.isWebGL2;var s=new function(){var t=!1,n=new x,r=null,a=new x(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,i,o,s){!0===s&&(t*=o,r*=o,i*=o),n.set(t,r,i,o),!1===a.equals(n)&&(e.clearColor(t,r,i,o),a.copy(n))},reset:function(){t=!1,r=null,a.set(-1,0,0,0)}}},u=new function(){var t=!1,n=null,r=null,a=null;return{setTest:function(e){e?V(2929):G(2929)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){if(t)switch(t){case 0:e.depthFunc(512);break;case 1:e.depthFunc(519);break;case 2:e.depthFunc(513);break;case 3:e.depthFunc(515);break;case 4:e.depthFunc(514);break;case 5:e.depthFunc(518);break;case 6:e.depthFunc(516);break;case 7:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);r=t}},setLocked:function(e){t=e},setClear:function(t){a!==t&&(e.clearDepth(t),a=t)},reset:function(){t=!1,n=null,r=null,a=null}}},l=new function(){var t=!1,n=null,r=null,a=null,i=null,o=null,s=null,u=null,c=null;return{setTest:function(e){t||(e?V(2960):G(2960))},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,o){r===t&&a===n&&i===o||(e.stencilFunc(t,n,o),r=t,a=n,i=o)},setOp:function(t,n,r){o===t&&s===n&&u===r||(e.stencilOp(t,n,r),o=t,s=n,u=r)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,n=null,r=null,a=null,i=null,o=null,s=null,u=null,c=null}}},h=e.getParameter(34921),d=new Uint8Array(h),f=new Uint8Array(h),p=new Uint8Array(h),m={},v=null,g=null,b=null,y=null,w=null,O=null,k=null,S=null,_=null,j=!1,E=null,T=null,C=null,M=null,A=null,N=e.getParameter(35661),R=!1,I=0,L=e.getParameter(7938);-1!==L.indexOf("WebGL")?(I=parseFloat(/^WebGL\ ([0-9])/.exec(L)[1]),R=I>=1):-1!==L.indexOf("OpenGL ES")&&(I=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(L)[1]),R=I>=2);var D=null,P={},z=new x,F=new x;function B(t,n,r){var a=new Uint8Array(4),i=e.createTexture();e.bindTexture(t,i),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(var o=0;o<r;o++)e.texImage2D(n+o,0,6408,1,1,0,6408,5121,a);return i}var U={};function W(n,r){(d[n]=1,0===f[n]&&(e.enableVertexAttribArray(n),f[n]=1),p[n]!==r)&&((o?e:t.get("ANGLE_instanced_arrays"))[o?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,r),p[n]=r)}function V(t){!0!==m[t]&&(e.enable(t),m[t]=!0)}function G(t){!1!==m[t]&&(e.disable(t),m[t]=!1)}U[3553]=B(3553,3553,1),U[34067]=B(34067,34069,6),s.setClear(0,0,0,1),u.setClear(1),l.setClear(0),V(2929),u.setFunc(3),K(!1),Z(1),V(2884),Y(0);var H=(r={},Object(a.a)(r,100,32774),Object(a.a)(r,101,32778),Object(a.a)(r,102,32779),r);if(o)H[103]=32775,H[104]=32776;else{var q=t.get("EXT_blend_minmax");null!==q&&(H[103]=q.MIN_EXT,H[104]=q.MAX_EXT)}var X=(i={},Object(a.a)(i,200,0),Object(a.a)(i,201,1),Object(a.a)(i,202,768),Object(a.a)(i,204,770),Object(a.a)(i,210,776),Object(a.a)(i,208,774),Object(a.a)(i,206,772),Object(a.a)(i,203,769),Object(a.a)(i,205,771),Object(a.a)(i,209,775),Object(a.a)(i,207,773),i);function Y(t,n,r,a,i,o,s,u){if(0!==t){if(g||(V(3042),g=!0),5===t)i=i||n,o=o||r,s=s||a,n===y&&i===k||(e.blendEquationSeparate(H[n],H[i]),y=n,k=i),r===w&&a===O&&o===S&&s===_||(e.blendFuncSeparate(X[r],X[a],X[o],X[s]),w=r,O=a,S=o,_=s),b=t,j=null;else if(t!==b||u!==j){if(100===y&&100===k||(e.blendEquation(32774),y=100,k=100),u)switch(t){case 1:e.blendFuncSeparate(1,771,1,771);break;case 2:e.blendFunc(1,1);break;case 3:e.blendFuncSeparate(0,0,769,771);break;case 4:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case 1:e.blendFuncSeparate(770,771,1,771);break;case 2:e.blendFunc(770,1);break;case 3:e.blendFunc(0,769);break;case 4:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}w=null,O=null,S=null,_=null,b=t,j=u}}else g&&(G(3042),g=!1)}function K(t){E!==t&&(t?e.frontFace(2304):e.frontFace(2305),E=t)}function Z(t){0!==t?(V(2884),t!==T&&(1===t?e.cullFace(1029):2===t?e.cullFace(1028):e.cullFace(1032))):G(2884),T=t}
2function J(t,n,r){t?(V(32823),M===n&&A===r||(e.polygonOffset(n,r),M=n,A=r)):G(32823)}function Q(t){void 0===t&&(t=33984+N-1),D!==t&&(e.activeTexture(t),D=t)}return{buffers:{color:s,depth:u,stencil:l},initAttributes:function(){for(var e=0,t=d.length;e<t;e++)d[e]=0},enableAttribute:function(e){W(e,0)},enableAttributeAndDivisor:W,disableUnusedAttributes:function(){for(var t=0,n=f.length;t!==n;++t)f[t]!==d[t]&&(e.disableVertexAttribArray(t),f[t]=0)},vertexAttribPointer:function(t,n,r,a,i,s){!0!==o||5124!==r&&5125!==r?e.vertexAttribPointer(t,n,r,a,i,s):e.vertexAttribIPointer(t,n,r,a,i,s)},enable:V,disable:G,useProgram:function(t){return v!==t&&(e.useProgram(t),v=t,!0)},setBlending:Y,setMaterial:function(e,t){e.side===c?G(2884):V(2884);var n=1===e.side;t&&(n=!n),K(n),1===e.blending&&!1===e.transparent?Y(0):Y(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),u.setFunc(e.depthFunc),u.setTest(e.depthTest),u.setMask(e.depthWrite),s.setMask(e.colorWrite);var r=e.stencilWrite;l.setTest(r),r&&(l.setMask(e.stencilWriteMask),l.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),l.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),J(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)},setFlipSided:K,setCullFace:Z,setLineWidth:function(t){t!==C&&(R&&e.lineWidth(t),C=t)},setPolygonOffset:J,setScissorTest:function(e){e?V(3089):G(3089)},activeTexture:Q,bindTexture:function(t,n){null===D&&Q();var r=P[D];void 0===r&&(r={type:void 0,texture:void 0},P[D]=r),r.type===t&&r.texture===n||(e.bindTexture(t,n||U[t]),r.type=t,r.texture=n)},unbindTexture:function(){var t=P[D];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(t){!1===z.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),z.copy(t))},viewport:function(t){!1===F.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),F.copy(t))},reset:function(){for(var t=0;t<f.length;t++)1===f[t]&&(e.disableVertexAttribArray(t),f[t]=0);m={},D=null,P={},v=null,b=null,E=null,T=null,s.reset(),u.reset(),l.reset()}}}function na(e,t,n,r,i,o,s){var u,c,l,h=i.isWebGL2,d=i.maxTextures,f=i.maxCubemapSize,m=i.maxTextureSize,v=i.maxSamples,g=new WeakMap,b=!1;try{b="undefined"!==typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(V){}function y(e,t){return b?new OffscreenCanvas(e,t):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function x(e,t,n,r){var a=1;if((e.width>r||e.height>r)&&(a=r/Math.max(e.width,e.height)),a<1||!0===t){if("undefined"!==typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&e instanceof ImageBitmap){var i=t?p.floorPowerOfTwo:Math.floor,o=i(a*e.width),s=i(a*e.height);void 0===l&&(l=y(o,s));var u=n?y(o,s):l;return u.width=o,u.height=s,u.getContext("2d").drawImage(e,0,0,o,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+o+"x"+s+")."),u}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function w(e){return p.isPowerOfTwo(e.width)&&p.isPowerOfTwo(e.height)}function O(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function k(t,n,a,i){e.generateMipmap(t),r.get(n).__maxMipLevel=Math.log(Math.max(a,i))*Math.LOG2E}function S(n,r,a){if(!1===h)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var i=r;return 6403===r&&(5126===a&&(i=33326),5131===a&&(i=33325),5121===a&&(i=33321)),6407===r&&(5126===a&&(i=34837),5131===a&&(i=34843),5121===a&&(i=32849)),6408===r&&(5126===a&&(i=34836),5131===a&&(i=34842),5121===a&&(i=32856)),33325!==i&&33326!==i&&34842!==i&&34836!==i||t.get("EXT_color_buffer_float"),i}function _(e){return 1003===e||1004===e||1005===e?9728:9729}function j(t){var n=t.target;n.removeEventListener("dispose",j),function(t){var n=r.get(t);if(void 0===n.__webglInit)return;e.deleteTexture(n.__webglTexture),r.remove(t)}(n),n.isVideoTexture&&g.delete(n),s.memory.textures--}function E(t){var n=t.target;n.removeEventListener("dispose",E),function(t){var n=r.get(t),a=r.get(t.texture);if(!t)return;void 0!==a.__webglTexture&&e.deleteTexture(a.__webglTexture);t.depthTexture&&t.depthTexture.dispose();
2if(t.isWebGLCubeRenderTarget)for(var i=0;i<6;i++)e.deleteFramebuffer(n.__webglFramebuffer[i]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[i]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&e.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer);r.remove(t.texture),r.remove(t)}(n),s.memory.textures--}var T=0;function C(e,t){var a=r.get(e);if(e.isVideoTexture&&function(e){var t=s.render.frame;g.get(e)!==t&&(g.set(e,t),e.update())}(e),e.version>0&&a.__version!==e.version){var i=e.image;if(void 0===i)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==i.complete)return void D(a,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,a.__webglTexture)}function M(t,a){if(6===t.image.length){var i=r.get(t);if(t.version>0&&i.__version!==t.version){L(i,t),n.activeTexture(33984+a),n.bindTexture(34067,i.__webglTexture),e.pixelStorei(37440,t.flipY);for(var s=t&&(t.isCompressedTexture||t.image[0].isCompressedTexture),u=t.image[0]&&t.image[0].isDataTexture,c=[],l=0;l<6;l++)c[l]=s||u?u?t.image[l].image:t.image[l]:x(t.image[l],!1,!0,f);var d,p=c[0],m=w(p)||h,v=o.convert(t.format),g=o.convert(t.type),b=S(t.internalFormat,v,g);if(I(34067,t,m),s){for(l=0;l<6;l++){d=c[l].mipmaps;for(var y=0;y<d.length;y++){var _=d[y];1023!==t.format&&1022!==t.format?null!==v?n.compressedTexImage2D(34069+l,y,b,_.width,_.height,0,_.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+l,y,b,_.width,_.height,0,v,g,_.data)}}i.__maxMipLevel=d.length-1}else{d=t.mipmaps;for(l=0;l<6;l++)if(u){n.texImage2D(34069+l,0,b,c[l].width,c[l].height,0,v,g,c[l].data);for(y=0;y<d.length;y++){var j=(_=d[y]).image[l].image;n.texImage2D(34069+l,y+1,b,j.width,j.height,0,v,g,j.data)}}else{n.texImage2D(34069+l,0,b,v,g,c[l]);for(y=0;y<d.length;y++){_=d[y];n.texImage2D(34069+l,y+1,b,v,g,_.image[l])}}i.__maxMipLevel=d.length}O(t,m)&&k(34067,t,p.width,p.height),i.__version=t.version,t.onUpdate&&t.onUpdate(t)}else n.activeTexture(33984+a),n.bindTexture(34067,i.__webglTexture)}}function A(e,t){n.activeTexture(33984+t),n.bindTexture(34067,r.get(e).__webglTexture)}var N=(u={},Object(a.a)(u,1e3,10497),Object(a.a)(u,1001,33071),Object(a.a)(u,1002,33648),u),R=(c={},Object(a.a)(c,1003,9728),Object(a.a)(c,1004,9984),Object(a.a)(c,1005,9986),Object(a.a)(c,1006,9729),Object(a.a)(c,1007,9985),Object(a.a)(c,1008,9987),c);function I(n,a,o){o?(e.texParameteri(n,10242,N[a.wrapS]),e.texParameteri(n,10243,N[a.wrapT]),32879!==n&&35866!==n||e.texParameteri(n,32882,N[a.wrapR]),e.texParameteri(n,10240,R[a.magFilter]),e.texParameteri(n,10241,R[a.minFilter])):(e.texParameteri(n,10242,33071),e.texParameteri(n,10243,33071),32879!==n&&35866!==n||e.texParameteri(n,32882,33071),1001===a.wrapS&&1001===a.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,10240,_(a.magFilter)),e.texParameteri(n,10241,_(a.minFilter)),1003!==a.minFilter&&1006!==a.minFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var s=t.get("EXT_texture_filter_anisotropic");if(s){if(1015===a.type&&null===t.get("OES_texture_float_linear"))return;if(1016===a.type&&null===(h||t.get("OES_texture_half_float_linear")))return;(a.anisotropy>1||r.get(a).__currentAnisotropy)&&(e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}function L(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",j),t.__webglTexture=e.createTexture(),s.memory.textures++)}function D(t,r,a){var i=3553;r.isDataTexture2DArray&&(i=35866),r.isDataTexture3D&&(i=32879),L(t,r),n.activeTexture(33984+a),n.bindTexture(i,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment);var s=function(e){return!h&&(1001!==e.wrapS||1001!==e.wrapT||1003!==e.minFilter&&1006!==e.minFilter)}(r)&&!1===w(r.image),u=x(r.image,s,!1,m),c=w(u)||h,l=o.convert(r.format),d=o.convert(r.type),f=S(r.internalFormat,l,d);I(i,r,c);var p,v=r.mipmaps;if(r.isDepthTexture)f=6402,h?f=1015===r.type?36012:1014===r.type?33190:1020===r.type?35056:33189:1015===r.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===r.format&&6402===f&&1012!==r.type&&1014!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=1012,d=o.convert(r.type)),1027===r.format&&6402===f&&(f=34041,1020!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=1020,d=o.convert(r.type))),n.texImage2D(3553,0,f,u.width,u.height,0,l,d,null);else if(r.isDataTexture)if(v.length>0&&c){for(var g=0,b=v.length;g<b;g++)p=v[g],n.texImage2D(3553,g,f,p.width,p.height,0,l,d,p.data);r.generateMipmaps=!1,t.__maxMipLevel=v.length-1}else n.texImage2D(3553,0,f,u.width,u.height,0,l,d,u.data),t.__maxMipLevel=0;else if(r.isCompressedTexture){for(g=0,b=v.length;g<b;g++)p=v[g],1023!==r.format&&1022!==r.format?null!==l?n.compressedTexImage2D(3553,g,f,p.width,p.height,0,p.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,g,f,p.width,p.height,0,l,d,p.data);t.__maxMipLevel=v.length-1}else if(r.isDataTexture2DArray)n.texImage3D(35866,0,f,u.width,u.height,u.depth,0,l,d,u.data),t.__maxMipLevel=0;else if(r.isDataTexture3D)n.texImage3D(32879,0,f,u.width,u.height,u.depth,0,l,d,u.data),t.__maxMipLevel=0;else if(v.length>0&&c){for(g=0,b=v.length;g<b;g++)p=v[g],n.texImage2D(3553,g,f,l,d,p);r.generateMipmaps=!1,t.__maxMipLevel=v.length-1}else n.texImage2D(3553,0,f,l,d,u),t.__maxMipLevel=0;O(r,c)&&k(i,r,u.width,u.height),t.__version=r.version,r.onUpdate&&r.onUpdate(r)}function P(t,a,i,s){var u=o.convert(a.texture.format),c=o.convert(a.texture.type),l=S(a.texture.internalFormat,u,c);n.texImage2D(s,0,l,a.width,a.height,0,u,c,null),e.bindFramebuffer(36160,t),e.framebufferTexture2D(36160,i,s,r.get(a.texture).__webglTexture,0),e.bindFramebuffer(36160,null)}function z(t,n,r){if(e.bindRenderbuffer(36161,t),n.depthBuffer&&!n.stencilBuffer){var a=33189;if(r){var i=n.depthTexture;i&&i.isDepthTexture&&(1015===i.type?a=36012:1014===i.type&&(a=33190));var s=B(n);e.renderbufferStorageMultisample(36161,s,a,n.width,n.height)}else e.renderbufferStorage(36161,a,n.width,n.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(n.depthBuffer&&n.stencilBuffer){if(r){s=B(n);e.renderbufferStorageMultisample(36161,s,35056,n.width,n.height)}else e.renderbufferStorage(36161,34041,n.width,n.height);e.framebufferRenderbuffer(36160,33306,36161,t)}else{var u=o.convert(n.texture.format),c=o.convert(n.texture.type);a=S(n.texture.internalFormat,u,c);if(r){s=B(n);e.renderbufferStorageMultisample(36161,s,a,n.width,n.height)}else e.renderbufferStorage(36161,a,n.width,n.height)}e.bindRenderbuffer(36161,null)}
2function F(t){var n=r.get(t),a=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture){if(a)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,n){if(n&&n.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,t),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),C(n.depthTexture,0);var a=r.get(n.depthTexture).__webglTexture;if(1026===n.depthTexture.format)e.framebufferTexture2D(36160,36096,3553,a,0);else{if(1027!==n.depthTexture.format)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(36160,33306,3553,a,0)}}(n.__webglFramebuffer,t)}else if(a){n.__webglDepthbuffer=[];for(var i=0;i<6;i++)e.bindFramebuffer(36160,n.__webglFramebuffer[i]),n.__webglDepthbuffer[i]=e.createRenderbuffer(),z(n.__webglDepthbuffer[i],t,!1)}else e.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),z(n.__webglDepthbuffer,t,!1);e.bindFramebuffer(36160,null)}function B(e){return h&&e.isWebGLMultisampleRenderTarget?Math.min(v,e.samples):0}var U=!1,W=!1;this.allocateTextureUnit=function(){var e=T;return e>=d&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+d),T+=1,e},this.resetTextureUnits=function(){T=0},this.setTexture2D=C,this.setTexture2DArray=function(e,t){var a=r.get(e);e.version>0&&a.__version!==e.version?D(a,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,a.__webglTexture))},this.setTexture3D=function(e,t){var a=r.get(e);e.version>0&&a.__version!==e.version?D(a,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,a.__webglTexture))},this.setTextureCube=M,this.setTextureCubeDynamic=A,this.setupRenderTarget=function(t){var a=r.get(t),i=r.get(t.texture);t.addEventListener("dispose",E),i.__webglTexture=e.createTexture(),s.memory.textures++;var u=!0===t.isWebGLCubeRenderTarget,c=!0===t.isWebGLMultisampleRenderTarget,l=w(t)||h;if(!h||1022!==t.texture.format||1015!==t.texture.type&&1016!==t.texture.type||(t.texture.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),u){a.__webglFramebuffer=[];for(var d=0;d<6;d++)a.__webglFramebuffer[d]=e.createFramebuffer()}else if(a.__webglFramebuffer=e.createFramebuffer(),c)if(h){a.__webglMultisampledFramebuffer=e.createFramebuffer(),a.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,a.__webglColorRenderbuffer);var f=o.convert(t.texture.format),p=o.convert(t.texture.type),m=S(t.texture.internalFormat,f,p),v=B(t);e.renderbufferStorageMultisample(36161,v,m,t.width,t.height),e.bindFramebuffer(36160,a.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,a.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(a.__webglDepthRenderbuffer=e.createRenderbuffer(),z(a.__webglDepthRenderbuffer,t,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(u){n.bindTexture(34067,i.__webglTexture),I(34067,t.texture,l);for(d=0;d<6;d++)P(a.__webglFramebuffer[d],t,36064,34069+d);O(t.texture,l)&&k(34067,t.texture,t.width,t.height),n.bindTexture(34067,null)}else n.bindTexture(3553,i.__webglTexture),I(3553,t.texture,l),P(a.__webglFramebuffer,t,36064,3553),O(t.texture,l)&&k(3553,t.texture,t.width,t.height),n.bindTexture(3553,null);t.depthBuffer&&F(t)},this.updateRenderTargetMipmap=function(e){var t=e.texture;if(O(t,w(e)||h)){var a=e.isWebGLCubeRenderTarget?34067:3553,i=r.get(t).__webglTexture;n.bindTexture(a,i),k(a,t,e.width,e.height),n.bindTexture(a,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(h){var n=r.get(t);e.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,n.__webglFramebuffer);var a=t.width,i=t.height,o=16384;t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024),e.blitFramebuffer(0,0,a,i,0,0,a,i,o,9728),e.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===U&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),U=!0),e=e.texture),C(e,t)}
2,this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===W&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),W=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?M(e,t):A(e,t)}}function ra(e,t,n){var r=n.isWebGL2;return{convert:function(e){var n;if(1009===e)return 5121;if(1017===e)return 32819;if(1018===e)return 32820;if(1019===e)return 33635;if(1010===e)return 5120;if(1011===e)return 5122;if(1012===e)return 5123;if(1013===e)return 5124;if(1014===e)return 5125;if(1015===e)return 5126;if(1016===e)return r?5131:null!==(n=t.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(1021===e)return 6406;if(1022===e)return 6407;if(1023===e)return 6408;if(1024===e)return 6409;if(1025===e)return 6410;if(1026===e)return 6402;if(1027===e)return 34041;if(1028===e)return 6403;if(1029===e)return 36244;if(1030===e)return 33319;if(1031===e)return 33320;if(1032===e)return 36248;if(1033===e)return 36249;if(33776===e||33777===e||33778===e||33779===e){if(null===(n=t.get("WEBGL_compressed_texture_s3tc")))return null;if(33776===e)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===e)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===e)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===e)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===e||35841===e||35842===e||35843===e){if(null===(n=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(35840===e)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===e)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===e)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===e)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===e)return null!==(n=t.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===e||37496===e)&&null!==(n=t.get("WEBGL_compressed_texture_etc"))){if(37492===e)return n.COMPRESSED_RGB8_ETC2;if(37496===e)return n.COMPRESSED_RGBA8_ETC2_EAC}return 37808===e||37809===e||37810===e||37811===e||37812===e||37813===e||37814===e||37815===e||37816===e||37817===e||37818===e||37819===e||37820===e||37821===e||37840===e||37841===e||37842===e||37843===e||37844===e||37845===e||37846===e||37847===e||37848===e||37849===e||37850===e||37851===e||37852===e||37853===e?null!==(n=t.get("WEBGL_compressed_texture_astc"))?e:null:36492===e?null!==(n=t.get("EXT_texture_compression_bptc"))?e:null:1020===e?r?34042:null!==(n=t.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function aa(e){Zt.call(this),this.cameras=e||[]}function ia(){Q.call(this),this.type="Group"}function oa(){this._targetRay=null,this._grip=null}function sa(e,t){var n=this,r=null,a=1,i=null,o="local-floor",s=null,u=[],c=new Map,l=new Zt;l.layers.enable(1),l.viewport=new x;var h=new Zt;h.layers.enable(2),h.viewport=new x;var d=[l,h],f=new aa;f.layers.enable(1),f.layers.enable(2);var p=null,m=null;function v(e){var t=c.get(e.inputSource);t&&t.dispatchEvent({type:e.type})}function g(){c.forEach((function(e,t){e.disconnect(t)})),c.clear(),e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),_.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function b(e){i=e,_.setContext(r),_.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}function y(e){for(var t=r.inputSources,n=0;n<u.length;n++)c.set(t[n],u[n]);for(n=0;n<e.removed.length;n++){var a=e.removed[n];(i=c.get(a))&&(i.dispatchEvent({type:"disconnected",data:a}),c.delete(a))}for(n=0;n<e.added.length;n++){var i;a=e.added[n];(i=c.get(a))&&i.dispatchEvent({type:"connected",data:a})}}this.enabled=!1,this.isPresenting=!1,this.getController=function(e){var t=u[e];return void 0===t&&(t=new oa,u[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){var t=u[e];return void 0===t&&(t=new oa,u[e]=t),t.getGripSpace()},this.setFramebufferScaleFactor=function(e){a=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){o=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return i}
2,this.getSession=function(){return r},this.setSession=function(e){if(null!==(r=e)){r.addEventListener("select",v),r.addEventListener("selectstart",v),r.addEventListener("selectend",v),r.addEventListener("squeeze",v),r.addEventListener("squeezestart",v),r.addEventListener("squeezeend",v),r.addEventListener("end",g);var n=t.getContextAttributes();!0!==n.xrCompatible&&t.makeXRCompatible();var i={antialias:n.antialias,alpha:n.alpha,depth:n.depth,stencil:n.stencil,framebufferScaleFactor:a},s=new XRWebGLLayer(r,t,i);r.updateRenderState({baseLayer:s}),r.requestReferenceSpace(o).then(b),r.addEventListener("inputsourceschange",y)}};var w=new j,O=new j;function k(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.getInverse(e.matrixWorld)}this.getCamera=function(e){f.near=h.near=l.near=e.near,f.far=h.far=l.far=e.far,p===f.near&&m===f.far||(r.updateRenderState({depthNear:f.near,depthFar:f.far}),p=f.near,m=f.far);var t=e.parent,n=f.cameras;k(f,t);for(var a=0;a<n.length;a++)k(n[a],t);e.matrixWorld.copy(f.matrixWorld);for(var i=e.children,o=(a=0,i.length);a<o;a++)i[a].updateMatrixWorld(!0);return 2===n.length?function(e,t,n){w.setFromMatrixPosition(t.matrixWorld),O.setFromMatrixPosition(n.matrixWorld);var r=w.distanceTo(O),a=t.projectionMatrix.elements,i=n.projectionMatrix.elements,o=a[14]/(a[10]-1),s=a[14]/(a[10]+1),u=(a[9]+1)/a[5],c=(a[9]-1)/a[5],l=(a[8]-1)/a[0],h=(i[8]+1)/i[0],d=o*l,f=o*h,p=r/(-l+h),m=p*-l;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(p),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.getInverse(e.matrixWorld);var v=o+p,g=s+p,b=d-m,y=f+(r-m),x=u*s/g*v,k=c*s/g*v;e.projectionMatrix.makePerspective(b,y,x,k,v,g)}(f,l,h):f.projectionMatrix.copy(l.projectionMatrix),f};var S=null;var _=new an;_.setAnimationLoop((function(t,n){if(null!==(s=n.getViewerPose(i))){var a=s.views,o=r.renderState.baseLayer;e.setFramebuffer(o.framebuffer);var c=!1;a.length!==f.cameras.length&&(f.cameras.length=0,c=!0);for(var l=0;l<a.length;l++){var h=a[l],p=o.getViewport(h),m=d[l];m.matrix.fromArray(h.transform.matrix),m.projectionMatrix.fromArray(h.projectionMatrix),m.viewport.set(p.x,p.y,p.width,p.height),0===l&&f.matrix.copy(m.matrix),!0===c&&f.cameras.push(m)}}var v=r.inputSources;for(l=0;l<u.length;l++){var g=u[l],b=v[l];g.update(b,n,i)}S&&S(t,n)})),this.setAnimationLoop=function(e){S=e},this.dispose=function(){}}function ua(e){function t(t,n,r){t.opacity.value=n.opacity,n.color&&t.diffuse.value.copy(n.color),n.emissive&&t.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(t.map.value=n.map),n.alphaMap&&(t.alphaMap.value=n.alphaMap),n.specularMap&&(t.specularMap.value=n.specularMap);var a,i,o=n.envMap||r;o&&(t.envMap.value=o,t.flipEnvMap.value=o.isCubeTexture?-1:1,t.reflectivity.value=n.reflectivity,t.refractionRatio.value=n.refractionRatio,t.maxMipLevel.value=e.get(o).__maxMipLevel),n.lightMap&&(t.lightMap.value=n.lightMap,t.lightMapIntensity.value=n.lightMapIntensity),n.aoMap&&(t.aoMap.value=n.aoMap,t.aoMapIntensity.value=n.aoMapIntensity),n.map?a=n.map:n.specularMap?a=n.specularMap:n.displacementMap?a=n.displacementMap:n.normalMap?a=n.normalMap:n.bumpMap?a=n.bumpMap:n.roughnessMap?a=n.roughnessMap:n.metalnessMap?a=n.metalnessMap:n.alphaMap?a=n.alphaMap:n.emissiveMap&&(a=n.emissiveMap),void 0!==a&&(a.isWebGLRenderTarget&&(a=a.texture),!0===a.matrixAutoUpdate&&a.updateMatrix(),t.uvTransform.value.copy(a.matrix)),n.aoMap?i=n.aoMap:n.lightMap&&(i=n.lightMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uv2Transform.value.copy(i.matrix))}function n(e,t,n){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate()),t.dis
2placementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),(t.envMap||n)&&(e.envMapIntensity.value=t.envMapIntensity)}return{refreshFogUniforms:function(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)},refreshMaterialUniforms:function(e,r,a,i,o){r.isMeshBasicMaterial?t(e,r):r.isMeshLambertMaterial?(t(e,r),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(e,r)):r.isMeshToonMaterial?(t(e,r),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.gradientMap&&(e.gradientMap.value=t.gradientMap);t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshPhongMaterial?(t(e,r),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshStandardMaterial?(t(e,r,a),r.isMeshPhysicalMaterial?function(e,t,r){n(e,t,r),e.reflectivity.value=t.reflectivity,e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.sheen&&e.sheen.value.copy(t.sheen);t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap);t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap);t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,1===t.side&&e.clearcoatNormalScale.value.negate());e.transparency.value=t.transparency}(e,r,a):n(e,r,a)):r.isMeshMatcapMaterial?(t(e,r),function(e,t){t.matcap&&(e.matcap.value=t.matcap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshDepthMaterial?(t(e,r),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshDistanceMaterial?(t(e,r),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias);e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(e,r)):r.isMeshNormalMaterial?(t(e,r),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(e,r),r.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,r)):r.isPointsMaterial?function(e,t,n,r){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=.5*r,t.map&&(e.map.value=t.map);t.alphaMap&&(e.alphaMap.value=t.alphaMap);var a;t.map?a=t.map:t.alphaMap&&(a=t.alphaMap);void 0!==a&&(!0===a.matrixAutoUpdate&&a.updateMatrix(),e.uvTransform.value.copy(a.matrix))}(e,r,i,o):r.isSpriteMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map);t.alphaMap&&(e.alphaMap.value=t.alphaMap);var n;t.map?n=t.map:t.alphaMap&&(n=t.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix
vendor: 6,333 bytes, line 2
2))}(e,r):r.isShadowMaterial?(e.color.value.copy(r.color),e.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function ca(e){var t=void 0!==(e=e||{}).canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==e.context?e.context:null,r=void 0!==e.alpha&&e.alpha,a=void 0===e.depth||e.depth,i=void 0===e.stencil||e.stencil,o=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,u=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,c=void 0!==e.powerPreference?e.powerPreference:"default",l=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat,h=null,d=null;this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=3e3,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var f,v,g,b,y,w,O,k,S,_,E,T,C,M,A,N,R,L,D,P=this,z=!1,F=null,B=0,U=0,W=null,V=null,G=-1,H={geometry:null,program:null,wireframe:!1},q=null,X=null,Y=new x,K=new x,Z=null,J=t.width,Q=t.height,ee=1,te=null,ne=null,re=new x(0,0,J,Q),ae=new x(0,0,J,Q),ie=!1,oe=new nn,se=new pn,ue=!1,ce=!1,le=new I,he=new j;function de(){return null===W?ee:1}try{var fe={alpha:r,depth:a,stencil:i,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:u,powerPreference:c,failIfMajorPerformanceCaveat:l};if(t.addEventListener("webglcontextlost",ge,!1),t.addEventListener("webglcontextrestored",be,!1),null===(f=n||t.getContext("webgl",fe)||t.getContext("experimental-webgl",fe)))throw null!==t.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===f.getShaderPrecisionFormat&&(f.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Ce){throw console.error("THREE.WebGLRenderer: "+Ce.message),Ce}function pe(){v=new mn(f),!1===(g=new fn(f,v,e)).isWebGL2&&(v.get("WEBGL_depth_texture"),v.get("OES_texture_float"),v.get("OES_texture_half_float"),v.get("OES_texture_half_float_linear"),v.get("OES_standard_derivatives"),v.get("OES_element_index_uint"),v.get("ANGLE_instanced_arrays")),v.get("OES_texture_float_linear"),D=new ra(f,v,g),(b=new ta(f,v,g)).scissor(K.copy(ae).multiplyScalar(ee).floor()),b.viewport(Y.copy(re).multiplyScalar(ee).floor()),y=new bn(f),w=new Ur,O=new na(f,v,b,w,g,D,y),k=new on(f,g),S=new vn(f,k,y),_=new wn(f,S,k,y),N=new xn(f),E=new Br(P,v,g),T=new ua(w),C=new Hr,M=new Jr,A=new hn(P,b,_,s),R=new dn(f,v,y,g),L=new gn(f,v,y,g),y.programs=E.programs,P.capabilities=g,P.extensions=v,P.properties=w,P.renderLists=C,P.state=b,P.info=y}pe();var me=new sa(P,f);this.xr=me;var ve=new ea(P,_,g.maxTextureSize);function ge(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),z=!0}function be(){console.log("THREE.WebGLRenderer: Context Restored."),z=!1,pe()}function ye(e){var t=e.target;t.removeEventListener("dispose",ye),function(e){xe(e),w.remove(e)}(t)}function xe(e){var t=w.get(e).program;e.program=void 0,void 0!==t&&E.releaseProgram(t)}this.shadowMap=ve,this.getContext=function(){return f},this.getContextAttributes=function(){return f.getContextAttributes()},this.forceContextLoss=function(){var e=v.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=v.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return ee},this.setPixelRatio=function(e){void 0!==e&&(ee=e,this.setSize(J,Q,!1))},this.getSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),e=new m),e.set(J,Q)},this.setSize=function(e,n,r){me.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(J=e,Q=n,t.width=Math.floor(e*ee),t.height=Math.floor(n*ee),!1!==r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),e=new m),e.set(J*ee,Q*ee).floor()},this.setDrawingBufferSize=function(e,n,r){J=e,Q=n,ee=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),e=new x),e.copy(Y)},this.getViewport=function(e){return e.copy(re)},this.setViewport=function(e,t,n,r){e.isVector4?re.set(e.x,e.y,e.z,e.w):re.set(e,t,n,r),b.viewport(Y.copy(re).multiplyScalar(ee).floor())},this.getScissor=function(e){return e.copy(ae)},this.setScissor=function(e,t,n,r){e.isVector4?ae.set(e.x,e.y,e.z,e.w):ae.set(e,t,n,r),b.scissor(K.copy(ae).multiplyScalar(ee).floor())},this.getScissorTest=function(){return ie},this.setScissorTest=function(e){b.setScissorTest(ie=e)},this.setOpaqueSort=function(e){te=e},this.setTransparentSort=function(e){ne=e},this.getClearColor=function(){return A.getClearColor()},this.setClearColor=function(){A.setClearColor.apply(A,arguments)},this.getClearAlpha=function(){return A.getClearAlpha()},this.setClearAlpha=function(){A.setClearAlpha.apply(A,arguments)},this.clear=function(e,t,n){var r=0;(void 0===e||e)&&(r|=16384),(void 0===t||t)&&(r|=256),(void 0===n||n)&&(r|=1024),f.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",ge,!1),t.removeEventListener("webglcontextrestored",be,!1),C.dispose(),M.dispose(),w.dispose(),_.dispose(),me.dispose(),ke.stop()},this.renderBufferImmediate=function(e,t){b.initAttributes();var n=w.get(e);e.hasPositions&&!n.position&&(n.position=f.createBuffer()),e.hasNormals&&!n.normal&&(n.normal=f.createBuffer()),e.hasUvs&&!n.uv&&(n.uv=f.createBuffer()),e.hasColors&&!n.color&&(n.color=f.createBuffer());var r=t.getAttributes();e.hasPositions&&(f.bindBuffer(34962,n.position),f.bufferData(34962,e.positionArray,35048),b.enableAttribute(r.position),f.vertexAttribPointer(r.position,3,5126,!1,0,0)),e.hasNormals&&
2(f.bindBuffer(34962,n.normal),f.bufferData(34962,e.normalArray,35048),b.enableAttribute(r.normal),f.vertexAttribPointer(r.normal,3,5126,!1,0,0)),e.hasUvs&&(f.bindBuffer(34962,n.uv),f.bufferData(34962,e.uvArray,35048),b.enableAttribute(r.uv),f.vertexAttribPointer(r.uv,2,5126,!1,0,0)),e.hasColors&&(f.bindBuffer(34962,n.color),f.bufferData(34962,e.colorArray,35048),b.enableAttribute(r.color),f.vertexAttribPointer(r.color,3,5126,!1,0,0)),b.disableUnusedAttributes(),f.drawArrays(4,0,e.count),e.count=0};var we=new $;this.renderBufferDirect=function(e,t,n,r,a,i){null===t&&(t=we);var o=a.isMesh&&a.matrixWorld.determinant()<0,s=Te(e,t,r,a);b.setMaterial(r,o);var u=!1;H.geometry===n.id&&H.program===s.id&&H.wireframe===(!0===r.wireframe)||(H.geometry=n.id,H.program=s.id,H.wireframe=!0===r.wireframe,u=!0),(r.morphTargets||r.morphNormals)&&(N.update(a,n,r,s),u=!0),!0===a.isInstancedMesh&&(u=!0);var c=n.index,l=n.attributes.position;if(null===c){if(void 0===l||0===l.count)return}else if(0===c.count)return;var h,d=1;!0===r.wireframe&&(c=S.getWireframeAttribute(n),d=2);var p=R;null!==c&&(h=k.get(c),(p=L).setIndex(h)),u&&(!function(e,t,n,r){if(!1===g.isWebGL2&&(e.isInstancedMesh||t.isInstancedBufferGeometry)&&null===v.get("ANGLE_instanced_arrays"))return;b.initAttributes();var a=t.attributes,i=r.getAttributes(),o=n.defaultAttributeValues;for(var s in i){var u=i[s];if(u>=0){var c=a[s];if(void 0!==c){var l=c.normalized,h=c.itemSize;if(void 0===(O=k.get(c)))continue;var d=O.buffer,p=O.type,m=O.bytesPerElement;if(c.isInterleavedBufferAttribute){var y=c.data,x=y.stride,w=c.offset;y&&y.isInstancedInterleavedBuffer?(b.enableAttributeAndDivisor(u,y.meshPerAttribute),void 0===t._maxInstanceCount&&(t._maxInstanceCount=y.meshPerAttribute*y.count)):b.enableAttribute(u),f.bindBuffer(34962,d),b.vertexAttribPointer(u,h,p,l,x*m,w*m)}else c.isInstancedBufferAttribute?(b.enableAttributeAndDivisor(u,c.meshPerAttribute),void 0===t._maxInstanceCount&&(t._maxInstanceCount=c.meshPerAttribute*c.count)):b.enableAttribute(u),f.bindBuffer(34962,d),b.vertexAttribPointer(u,h,p,l,0,0)}else if("instanceMatrix"===s){var O;if(void 0===(O=k.get(e.instanceMatrix)))continue;d=O.buffer,p=O.type;b.enableAttributeAndDivisor(u+0,1),b.enableAttributeAndDivisor(u+1,1),b.enableAttributeAndDivisor(u+2,1),b.enableAttributeAndDivisor(u+3,1),f.bindBuffer(34962,d),f.vertexAttribPointer(u+0,4,p,!1,64,0),f.vertexAttribPointer(u+1,4,p,!1,64,16),f.vertexAttribPointer(u+2,4,p,!1,64,32),f.vertexAttribPointer(u+3,4,p,!1,64,48)}else if(void 0!==o){var S=o[s];if(void 0!==S)switch(S.length){case 2:f.vertexAttrib2fv(u,S);break;case 3:f.vertexAttrib3fv(u,S);break;case 4:f.vertexAttrib4fv(u,S);break;default:f.vertexAttrib1fv(u,S)}}}}b.disableUnusedAttributes()}(a,n,r,s),null!==c&&f.bindBuffer(34963,h.buffer));var m=null!==c?c.count:l.count,y=n.drawRange.start*d,x=n.drawRange.count*d,w=null!==i?i.start*d:0,O=null!==i?i.count*d:1/0,_=Math.max(y,w),j=Math.min(m,y+x,w+O)-1,E=Math.max(0,j-_+1);if(0!==E){if(a.isMesh)!0===r.wireframe?(b.setLineWidth(r.wireframeLinewidth*de()),p.setMode(1)):p.setMode(4);else if(a.isLine){var T=r.linewidth;void 0===T&&(T=1),b.setLineWidth(T*de()),a.isLineSegments?p.setMode(1):a.isLineLoop?p.setMode(2):p.setMode(3)}else a.isPoints?p.setMode(0):a.isSprite&&p.setMode(4);if(a.isInstancedMesh)p.renderInstances(n,_,E,a.count);else if(n.isInstancedBufferGeometry){var C=Math.min(n.instanceCount,n._maxInstanceCount);p.renderInstances(n,_,E,C)}else p.render(_,E)}},this.compile=function(e,t){(d=M.get(e,t)).init(),e.traverse((function(e){e.isLight&&(d.pushLight(e),e.castShadow&&d.pushShadow(e))})),d.setupLights(t);var n={};e.traverse((function(t){var r=t.material;if(r)if(Array.isArray(r))for(var a=0;a<r.length;a++){var i=r[a];i.uuid in n===!1&&(Ee(i,e,t),n[i.uuid]=!0)}else r.uuid in n===!1&&(Ee(r,e,t),n[r.uuid]=!0)}))};var Oe=null;var ke=new an;function Se(e,t,n,r){if(!1!==e.visible){if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)d.pushLight(e),e.castShadow&&d.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||oe.intersectsSprite(e)){r&&he.setFromMatrixPosition(e.matrixWorld).applyMatrix4(le);var a=_.update(e);(i=e.material).visible&&h.push(e,a,i,n,he.z,null)}}else if(e.isImmediateRenderObject)r&&he.setFromMatrixPosition(e.matrixWorld).applyMatrix4(le),h.push(e,null,e.material,n,he.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==y.render.frame&&(e.skeleton.update(),e.skeleton.frame=y.render.frame),!e.frustumCulled||oe.intersectsObject(e))){r&&he.setFromMatrixPosition(e.matrixWorld).applyMatrix4(le);a=_.update(e);var i=e.material;if(Array.isArray(i))for(var o=a.groups,s=0,u=o.length;s<u;s++){var c=o[s],l=i[c.materialIndex];l&&l.visible&&h.push(e,a,l,n,he.z,c)}else i.visible&&h.push(e,a,i,n,he.z,null)}var f=e.children;for(s=0,u=f.length;s<u;s++)Se(f[s],t,n,r)}}function _e(e,t,n,r){for(var a=0,i=e.length;a<i;a++){var o=e[a],s=o.object,u=o.geometry,c=void 0===r?o.material:r,l=o.group;if(n.isArrayCamera){X=n;for(var h=n.cameras,f=0,p=h.length;f<p;f++){var m=h[f];
2s.layers.test(m.layers)&&(b.viewport(Y.copy(m.viewport)),d.setupLights(m),je(s,t,m,u,c,l))}}else X=null,je(s,t,n,u,c,l)}}function je(e,t,n,r,a,i){if(e.onBeforeRender(P,t,n,r,a,i),d=M.get(t,X||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){var o=Te(n,t,a,e);b.setMaterial(a),H.geometry=null,H.program=null,H.wireframe=!1,function(e,t){e.render((function(e){P.renderBufferImmediate(e,t)}))}(e,o)}else P.renderBufferDirect(n,t,r,a,e,i);e.onAfterRender(P,t,n,r,a,i),d=M.get(t,X||n)}function Ee(e,t,n){var r=w.get(e),a=d.state.lights,i=d.state.shadowsArray,o=a.state.version,s=E.getParameters(e,a.state,i,t,se.numPlanes,se.numIntersection,n),u=E.getProgramCacheKey(s),c=r.program,l=!0;if(void 0===c)e.addEventListener("dispose",ye);else if(c.cacheKey!==u)xe(e);else if(r.lightsStateVersion!==o)r.lightsStateVersion=o,l=!1;else{if(void 0!==s.shaderID)return;l=!1}l&&(c=E.acquireProgram(s,u),r.program=c,r.uniforms=s.uniforms,r.outputEncoding=s.outputEncoding,e.program=c);var h=c.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var f=0;f<P.maxMorphTargets;f++)h["morphTarget"+f]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;for(f=0;f<P.maxMorphNormals;f++)h["morphNormal"+f]>=0&&e.numSupportedMorphNormals++}var p=r.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(r.numClippingPlanes=se.numPlanes,r.numIntersection=se.numIntersection,p.clippingPlanes=se.uniform),r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),r.lightsStateVersion=o,r.needsLights&&(p.ambientLightColor.value=a.state.ambient,p.lightProbe.value=a.state.probe,p.directionalLights.value=a.state.directional,p.directionalLightShadows.value=a.state.directionalShadow,p.spotLights.value=a.state.spot,p.spotLightShadows.value=a.state.spotShadow,p.rectAreaLights.value=a.state.rectArea,p.pointLights.value=a.state.point,p.pointLightShadows.value=a.state.pointShadow,p.hemisphereLights.value=a.state.hemi,p.directionalShadowMap.value=a.state.directionalShadowMap,p.directionalShadowMatrix.value=a.state.directionalShadowMatrix,p.spotShadowMap.value=a.state.spotShadowMap,p.spotShadowMatrix.value=a.state.spotShadowMatrix,p.pointShadowMap.value=a.state.pointShadowMap,p.pointShadowMatrix.value=a.state.pointShadowMatrix);var m=r.program.getUniforms(),v=yr.seqWithValue(m.seq,p);r.uniformsList=v}function Te(e,t,n,r){O.resetTextureUnits();var a=t.fog,i=n.isMeshStandardMaterial?t.environment:null,o=null===W?P.outputEncoding:W.texture.encoding,s=w.get(n),u=d.state.lights;if(ue&&(ce||e!==q)){var c=e===q&&n.id===G;se.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,e,s,c)}n.version===s.__version?void 0===s.program||n.fog&&s.fog!==a||s.environment!==i||s.needsLights&&s.lightsStateVersion!==u.state.version?Ee(n,t,r):void 0===s.numClippingPlanes||s.numClippingPlanes===se.numPlanes&&s.numIntersection===se.numIntersection?s.outputEncoding!==o&&Ee(n,t,r):Ee(n,t,r):(Ee(n,t,r),s.__version=n.version);var l,h,m=!1,v=!1,y=!1,x=s.program,k=x.getUniforms(),S=s.uniforms;if(b.useProgram(x.program)&&(m=!0,v=!0,y=!0),n.id!==G&&(G=n.id,v=!0),m||q!==e){if(k.setValue(f,"projectionMatrix",e.projectionMatrix),g.logarithmicDepthBuffer&&k.setValue(f,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),q!==e&&(q=e,v=!0,y=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){var _=k.map.cameraPosition;void 0!==_&&_.setValue(f,he.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&k.setValue(f,"isOrthographic",!0===e.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&k.setValue(f,"viewMatrix",e.matrixWorldInverse)}if(n.skinning){k.setOptional(f,r,"bindMatrix"),k.setOptional(f,r,"bindMatrixInverse");var j=r.skeleton;if(j){var E=j.bones;if(g.floatVertexTextures){if(void 0===j.boneTexture){var C=Math.sqrt(4*E.length);C=p.ceilPowerOfTwo(C),C=Math.max(C,4);var M=new Float32Array(C*C*4);M.set(j.boneMatrices);var A=new $t(M,C,C,1023,1015);j.boneMatrices=M,j.boneTexture=A,j.boneTextureSize=C}k.setValue(f,"boneTexture",j.boneTexture,O),k.setValue(f,"boneTextureSize",j.boneTextureSize)}else k.setOptional(f,j,"boneMatrices")}}return(v||s.receiveShadow!==r.receiveShadow)&&(s.receiveShadow=r.receiveShadow,k.setValue(f,"receiveShadow",r.receiveShadow)),v&&(k.setValue(f,"toneMappingExposure",P.toneMappingExposure),k.setValue(f,"toneMappingWhitePoint",P.toneMappingWhitePoint),s.needsLights&&(h=y,(l=S).ambientLightColor.needsUpdate=h,l.lightProbe.needsUpdate=h,l.directionalLights.needsUpdate=h,l.directionalLightShadows.needsUpdate=h,l.pointLights.needsUpdate=h,l.pointLightShadows.needsUpdate=h,l.spotLights.needsUpdate=h,l.spotLightShadows.needsUpdate=h,l.rectAreaLights.needsUpdate=h,l.hemisphereLights.needsUpdate=h),a&&n.fog&&T.refreshFogUniforms(S,a),T.refreshMaterialUniforms(S,n,i,ee,Q),void 0!==S.ltc_1&&(S.ltc_1.value=rn.LTC_1),void 0!==S.ltc_2&&(S.ltc_2.value=rn.LTC_2),yr.upload(f,s.uniformsList,S,O)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(yr.upload(f,s.uniformsList,S,O),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&k.setValue(f,"center",r.center),k.setValue(f,"modelViewMatrix",r.modelViewMatrix),k.setValue(f,"normalMatrix",r.normalMatrix),k.setValue(f,"modelMatrix",r.matrixWorld),x}ke.setAnimationLoop((function(e){me.isPresenting||Oe&&Oe(e)})),"undefined"!==typeof window&&ke.setContext(window),this.setAnimationLoop=function(e){Oe=e,me.setAnimationLoop(e),ke.start()},this.render=function(e,t){var n,r;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),r=arguments[3]),t&&t.isCamera){if(!z){H.geometry=null,H.program=null,H.wireframe=!1,G=-1,q=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),me.enabled&&me.isPresenting&&(t=me.getCamera(t)),e.onBeforeRender(P,e,t,n||W),(d=M.get(e,t)).init(),le.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),oe.setFromProjectionMatrix(le),ce=this.localClippingEnabled,ue=se.init(this.clippingPlanes,ce,t),(h=C.get(e,t)).init(),Se(e,t,0,P.sortObjects),h.finish(),!0===P.sortObjects&&h.sort(te,ne),ue&&se.beginShadows();var a=d.state.shadowsArray;ve.render(a,e,t),d.setupLights(t),ue&&se.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),A.render(h,e,t,r);var i=h.opaque,o=h.transparent;if(e.overrideMaterial){var s=e.overrideMaterial;i.length&&_e(i,e,t,s),o.length&&_e(o,e,t,s)}else i.length&&_e(i,e,t),o.length&&_e(o,e,t);e.onAfterRender(P,e,t),null!==W&&(O.updateRenderTargetMipmap(W),O.updateMultisampleRenderTarget(W)),b.buffers.depth.setTest(!0),b.buffers.depth.setMask(!0),b.buffers.color.setMask(!0),b.setPolygonOffset(!1),h=null,d=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(e){F!==e&&null===W&&f.bindFramebuffer(36160,e),F=e},this.getActiveCubeFace=function(){return B},this.getActiveMipmapLevel=function(){return U},this.getRenderTarget=function(){return W},this.setRenderTarget=function(e,t,n){W=e,B=t,U=n,e&&void 0===w.get(e).__webglFramebuffer&&O.setupRenderTarget(e);var r=F,a=!1;if(e){var i=w.get(e).__webglFramebuffer;
2e.isWebGLCubeRenderTarget?(r=i[t||0],a=!0):r=e.isWebGLMultisampleRenderTarget?w.get(e).__webglMultisampledFramebuffer:i,Y.copy(e.viewport),K.copy(e.scissor),Z=e.scissorTest}else Y.copy(re).multiplyScalar(ee).floor(),K.copy(ae).multiplyScalar(ee).floor(),Z=ie;if(V!==r&&(f.bindFramebuffer(36160,r),V=r),b.viewport(Y),b.scissor(K),b.setScissorTest(Z),a){var o=w.get(e.texture);f.framebufferTexture2D(36160,36064,34069+(t||0),o.__webglTexture,n||0)}},this.readRenderTargetPixels=function(e,t,n,r,a,i,o){if(e&&e.isWebGLRenderTarget){var s=w.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){var u=!1;s!==V&&(f.bindFramebuffer(36160,s),u=!0);try{var c=e.texture,l=c.format,h=c.type;if(1023!==l&&D.convert(l)!==f.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(1009!==h&&D.convert(h)!==f.getParameter(35738)&&(1015!==h||!(g.isWebGL2||v.get("OES_texture_float")||v.get("WEBGL_color_buffer_float")))&&(1016!==h||!(g.isWebGL2?v.get("EXT_color_buffer_float"):v.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===f.checkFramebufferStatus(36160)?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-a&&f.readPixels(t,n,r,a,D.convert(l),D.convert(h),i):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{u&&f.bindFramebuffer(36160,V)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,n){void 0===n&&(n=0);var r=Math.pow(2,-n),a=Math.floor(t.image.width*r),i=Math.floor(t.image.height*r),o=D.convert(t.format);O.setTexture2D(t,0),f.copyTexImage2D(3553,n,o,e.x,e.y,a,i,0),b.unbindTexture()},this.copyTextureToTexture=function(e,t,n,r){void 0===r&&(r=0);var a=t.image.width,i=t.image.height,o=D.convert(n.format),s=D.convert(n.type);O.setTexture2D(n,0),t.isDataTexture?f.texSubImage2D(3553,r,e.x,e.y,a,i,o,s,t.image.data):t.isCompressedTexture?f.compressedTexSubImage2D(3553,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):f.texSubImage2D(3553,r,e.x,e.y,o,s,t.image),0===r&&n.generateMipmaps&&f.generateMipmap(3553),b.unbindTexture()},this.initTexture=function(e){O.setTexture2D(e,0),b.unbindTexture()},"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function la(e,t){this.name="",this.color=new Ve(e),this.density=void 0!==t?t:25e-5}function ha(e,t,n){this.name="",this.color=new Ve(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}function da(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}aa.prototype=Object.assign(Object.create(Zt.prototype),{constructor:aa,isArrayCamera:!0}),ia.prototype=Object.assign(Object.create(Q.prototype),{constructor:ia,isGroup:!0}),Object.assign(oa.prototype,{constructor:oa,getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new ia,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new ia,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),this},disconnect:function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),this},update:function(e,t,n){var r=null,a=null,i=this._targetRay,o=this._grip;return e&&(null!==i&&null!==(r=t.getPose(e.targetRaySpace,n))&&(i.matrix.fromArray(r.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale)),null!==o&&e.gripSpace&&null!==(a=t.getPose(e.gripSpace,n))&&(o.matrix.fromArray(a.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale))),null!==i&&(i.visible=null!==r),null!==o&&(o.visible=null!==a),this}}),Object.assign(sa.prototype,l.prototype),Object.assign(la.prototype,{isFogExp2:!0,clone:function(){return new la(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(ha.prototype,{isFog:!0,clone:function(){return new ha(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(da.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(da.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(var r=0,a=this.stride;r<a;r++)this.array[e+r]=t.array[n+r];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(e){return this.onUploadCallback=e,this}});var fa,pa=new j;function ma(e,t,n,r){this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===r}function va(e){Ke.call(this),this.type="SpriteMaterial",this.color=new Ve(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}Object.defineProperties(ma.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(ma.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(e){for(var t=0,n=this.data.count;t<n;t++)pa.x=this.getX(t),pa.y=this.getY(t),pa.z=this.getZ(t),pa.applyMatrix4(e),this.setXYZ(t,pa.x,pa.y,pa.z);return this},setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this},setXYZW:function(e,t,n,r,a){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=a,this},clone:function(){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");for(var e=[],t=0;t<this.count;t++)for(var n=t*this.data.stride+this.offset,r=0;r<this.itemSize;r++)e.push(this.data.array[n+r]);return new Qe(new this.array.constructor(e),this.itemSize,this.normalized)},toJSON:function(){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");for(var e=[],t=0;t<this.count;t++)for(var n=t*this.data.stride+this.offset,r=0;r<this.itemSize;r++)e.push(this.data.array[n+r]);return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}}),va.prototype=Object.create(Ke.prototype),va.prototype.constructor=va,va.prototype.isSpriteMaterial=!0,va.prototype.copy=function(e){return Ke.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this};var ga=new j,ba=new j,ya=new j,xa=new m,wa=new m,Oa=new I,ka=new j,Sa=new j,_a=new j,ja=new m,Ea=new m,Ta=new m;function Ca(e){if(Q.call(this),this.type="Sprite",void 0===fa){fa=new gt;var t=new da(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);fa.setIndex([0,1,2,0,2,3]),fa.setAttribute("position",new ma(t,3,0,!1)),fa.setAttribute("uv",new ma(t,2,3,!1))}this.geometry=fa,this.material=void 0!==e?e:new va,this.center=new m(.5,.5)}function Ma(e,t,n,r,a,i){xa.subVectors(e,n).addScalar(.5).multiply(r),void 0!==a?(wa.x=i*xa.x-a*xa.y,wa.y=a*xa.x+i*xa.y):wa.copy(xa),e.copy(t),e.x+=wa.x,e.y+=wa.y,e.applyMatrix4(Oa)}Ca.prototype=Object.assign(Object.create(Q.prototype),{constructor:Ca,isSprite:!0,raycast:function(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),ba.setFromMatrixScale(this.matrixWorld),Oa.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),ya.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&ba.multiplyScalar(-ya.z);var n,r,a=this.material.rotation;0!==a&&(r=Math.cos(a),n=Math.sin(a));var i=this.center;Ma(ka.set(-.5,-.5,0),ya,i,ba,n,r),Ma(Sa.set(.5,-.5,0),ya,i,ba,n,r),Ma(_a.set(.5,.5,0),ya,i,ba,n,r),ja.set(0,0),Ea.set(1,0),Ta.set(1,1);var o=e.ray.intersectTriangle(ka,Sa,_a,!1,ga);if(null!==o||(Ma(Sa.set(-.5,.5,0),ya,i,ba,n,r),Ea.set(0,1),null!==(o=e.ray.intersectTriangle(ka,_a,Sa,!1,ga)))){var s=e.ray.origin.distanceTo(ga);s<e.near||s>e.far||t.push({distance:s,point:ga.clone(),uv:Fe.getUV(ga,ka,Sa,_a,ja,Ea,Ta,new m),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return Q.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this}});var Aa=new j,Na=new j;function Ra(){Q.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function Ia(e,t){e&&e.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Lt.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new I,this.bindMatrixInverse=new I}Ra.prototype=Object.assign(Object.create(Q.prototype),{constructor:Ra,isLOD:!0,copy:function(e){Q.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,r=t.length;n<r;n++){var a=t[n];this.addLevel(a.object.clone(),a.distance)}return this.autoUpdate=e.autoUpdate,this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var n=this.levels,r=0;r<n.length&&!(t<n[r].distance);r++);return n.splice(r,0,{distance:t,object:e}),this.add(e),this},getCurrentLevel:function(){return this._currentLevel},getObjectForDistance:function(e){var t=this.levels;if(t.length>0){for(var n=1,r=t.length;n<r&&!(e<t[n].distance);n++);return t[n-1].object}return null},raycast:function(e,t){if(this.levels.length>0){Aa.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(Aa);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){var t=this.levels;if(t.length>1){Aa.setFromMatrixPosition(e.matrixWorld),Na.setFromMatrixPosition(this.matrixWorld);var n=Aa.distanceTo(Na)/e.zoom;t[0].object.visible=!0;for(var r=1,a=t.length;r<a&&n>=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;r<a;r++)t[r].object.visible=!1}},toJSON:function(e){var t=Q.prototype.toJSON.call(this,e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];for(var n=this.levels,r=0,a=n.length;r<a;r++){var i=n[r];t.object.levels.push({object:i.object.uuid,distance:i.distance})}return t}}),Ia.prototype=Object.assign(Object.create(Lt.prototype),{constructor:Ia,isSkinnedMesh:!0,bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var e=new x,t=this.geometry.attributes.skinWeight,n=0,r=t.count;n<r;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);var a=1/e.manhattanLength();a!==1/0?e.multiplyScalar(a):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}},updateMatrixWorld:function(e){Lt.prototype.updateMatrixWorld.call(this,e),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)},boneTransform:function(){var e=new j,t=new x,n=new x,r=new j,a=new I;return function(i,o){var s=this.skeleton,u=this.geometry;t.fromBufferAttribute(u.attributes.skinIndex,i),n.fromBufferAttribute(u.attributes.skinWeight,i),e.fromBufferAttribute(u.attributes.position,i).applyMatrix4(this.bindMatrix),o.set(0,0,0);for(var c=0;c<4;c++){var l=n.getComponent(c);if(0!==l){var h=t.getComponent(c);a.multiplyMatrices(s.bones[h].matrixWorld,s.boneInverses[h]),o.addScaledVector(r.copy(e).applyMatrix4(a),l)}}return o.applyMatrix4(this.bindMatrixInverse)}}()});var La=new I,Da=new I;function Pa(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new I)}}function za(){Q.call(this),this.type="Bone"}Object.assign(Pa.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new I;this.bones[e]&&n.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(n)}},pose:function(){var e,t,n;for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},update:function(){for(var e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,a=0,i=e.length;a<i;a++){var o=e[a]?e[a].matrixWorld:Da;
2La.multiplyMatrices(o,t[a]),La.toArray(n,16*a)}void 0!==r&&(r.needsUpdate=!0)},clone:function(){return new Pa(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var r=this.bones[t];if(r.name===e)return r}},dispose:function(){this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=void 0)}}),za.prototype=Object.assign(Object.create(Q.prototype),{constructor:za,isBone:!0});var Fa=new I,Ba=new I,Ua=[],Wa=new Lt;function Va(e,t,n){Lt.call(this,e,t),this.instanceMatrix=new Qe(new Float32Array(16*n),16),this.count=n,this.frustumCulled=!1}function Ga(e){Ke.call(this),this.type="LineBasicMaterial",this.color=new Ve(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(e)}Va.prototype=Object.assign(Object.create(Lt.prototype),{constructor:Va,isInstancedMesh:!0,getMatrixAt:function(e,t){t.fromArray(this.instanceMatrix.array,16*e)},raycast:function(e,t){var n=this.matrixWorld,r=this.count;if(Wa.geometry=this.geometry,Wa.material=this.material,void 0!==Wa.material)for(var a=0;a<r;a++){this.getMatrixAt(a,Fa),Ba.multiplyMatrices(n,Fa),Wa.matrixWorld=Ba,Wa.raycast(e,Ua);for(var i=0,o=Ua.length;i<o;i++){var s=Ua[i];s.instanceId=a,s.object=this,t.push(s)}Ua.length=0}},setMatrixAt:function(e,t){t.toArray(this.instanceMatrix.array,16*e)},updateMorphTargets:function(){}}),Ga.prototype=Object.create(Ke.prototype),Ga.prototype.constructor=Ga,Ga.prototype.isLineBasicMaterial=!0,Ga.prototype.copy=function(e){return Ke.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.morphTargets=e.morphTargets,this};var Ha=new j,qa=new j,Xa=new I,Ya=new Se,Ka=new ve;function Za(e,t,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),Q.call(this),this.type="Line",this.geometry=void 0!==e?e:new gt,this.material=void 0!==t?t:new Ga,this.updateMorphTargets()}Za.prototype=Object.assign(Object.create(Q.prototype),{constructor:Za,isLine:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],r=1,a=t.count;r<a;r++)Ha.fromBufferAttribute(t,r-1),qa.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=Ha.distanceTo(qa);e.setAttribute("lineDistance",new ot(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var i=e.vertices;(n=e.lineDistances)[0]=0;for(r=1,a=i.length;r<a;r++)n[r]=n[r-1],n[r]+=i[r-1].distanceTo(i[r])}return this},raycast:function(e,t){var n=this.geometry,r=this.matrixWorld,a=e.params.Line.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),Ka.copy(n.boundingSphere),Ka.applyMatrix4(r),Ka.radius+=a,!1!==e.ray.intersectsSphere(Ka)){Xa.getInverse(r),Ya.copy(e.ray).applyMatrix4(Xa);var i=a/((this.scale.x+this.scale.y+this.scale.z)/3),o=i*i,s=new j,u=new j,c=new j,l=new j,h=this&&this.isLineSegments?2:1;if(n.isBufferGeometry){var d=n.index,f=n.attributes.position.array;if(null!==d)for(var p=d.array,m=0,v=p.length-1;m<v;m+=h){var g=p[m],b=p[m+1];if(s.fromArray(f,3*g),u.fromArray(f,3*b),!(Ya.distanceSqToSegment(s,u,l,c)>o))l.applyMatrix4(this.matrixWorld),(w=e.ray.origin.distanceTo(l))<e.near||w>e.far||t.push({distance:w,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}else for(m=0,v=f.length/3-1;m<v;m+=h){if(s.fromArray(f,3*m),u.fromArray(f,3*m+3),!(Ya.distanceSqToSegment(s,u,l,c)>o))l.applyMatrix4(this.matrixWorld),(w=e.ray.origin.distanceTo(l))<e.near||w>e.far||t.push({distance:w,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}else if(n.isGeometry){var y=n.vertices,x=y.length;for(m=0;m<x-1;m+=h){var w;if(!(Ya.distanceSqToSegment(y[m],y[m+1],l,c)>o))l.applyMatrix4(this.matrixWorld),(w=e.ray.origin.distanceTo(l))<e.near||w>e.far||t.push({distance:w,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}}},updateMorphTargets:function(){var e,t,n,r=this.geometry;if(r.isBufferGeometry){var a=r.morphAttributes,i=Object.keys(a);if(i.length>0){var o=a[i[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=r.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Ja=new j,Qa=new j;function $a(e,t){Za.call(this,e,t),this.type="LineSegments"}function ei(e,t){Za.call(this,e,t),this.type="LineLoop"}function ti(e){Ke.call(this),this.type="PointsMaterial",this.color=new Ve(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}$a.prototype=Object.assign(Object.create(Za.prototype),{constructor:$a,isLineSegments:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[],r=0,a=t.count;r<a;r+=2)Ja.fromBufferAttribute(t,r),Qa.fromBufferAttribute(t,r+1),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+Ja.distanceTo(Qa);e.setAttribute("lineDistance",new ot(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var i=e.vertices;for(n=e.lineDistances,r=0,a=i.length;r<a;r+=2)Ja.copy(i[r]),Qa.copy(i[r+1]),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+Ja.distanceTo(Qa)}return this}}),ei.prototype=Object.assign(Object.create(Za.prototype),{constructor:ei,isLine
vendor: 5,642 bytes, line 2
2Loop:!0}),ti.prototype=Object.create(Ke.prototype),ti.prototype.constructor=ti,ti.prototype.isPointsMaterial=!0,ti.prototype.copy=function(e){return Ke.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this};var ni=new I,ri=new Se,ai=new ve,ii=new j;function oi(e,t){Q.call(this),this.type="Points",this.geometry=void 0!==e?e:new gt,this.material=void 0!==t?t:new ti,this.updateMorphTargets()}function si(e,t,n,r,a,i,o){var s=ri.distanceSqToPoint(e);if(s<n){var u=new j;ri.closestPointToPoint(e,u),u.applyMatrix4(r);var c=a.ray.origin.distanceTo(u);if(c<a.near||c>a.far)return;i.push({distance:c,distanceToRay:Math.sqrt(s),point:u,index:t,face:null,object:o})}}function ui(e,t,n,r,a,i,o,s,u){y.call(this,e,t,n,r,a,i,o,s,u),this.format=void 0!==o?o:1022,this.minFilter=void 0!==i?i:1006,this.magFilter=void 0!==a?a:1006,this.generateMipmaps=!1}function ci(e,t,n,r,a,i,o,s,u,c,l,h){y.call(this,null,i,o,s,u,c,r,a,l,h),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function li(e,t,n,r,a,i,o,s,u){y.call(this,e,t,n,r,a,i,o,s,u),this.needsUpdate=!0}function hi(e,t,n,r,a,i,o,s,u,c){if(1026!==(c=void 0!==c?c:1026)&&1027!==c)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&1026===c&&(n=1012),void 0===n&&1027===c&&(n=1020),y.call(this,null,r,a,i,o,s,c,n,u),this.image={width:e,height:t},this.magFilter=void 0!==o?o:1003,this.minFilter=void 0!==s?s:1003,this.flipY=!1,this.generateMipmaps=!1}function di(e){gt.call(this),this.type="WireframeGeometry";var t,n,r,a,i,o,s,u,c,l,h=[],d=[0,0],f={},p=["a","b","c"];if(e&&e.isGeometry){var m=e.faces;for(t=0,r=m.length;t<r;t++){var v=m[t];for(n=0;n<3;n++)s=v[p[n]],u=v[p[(n+1)%3]],d[0]=Math.min(s,u),d[1]=Math.max(s,u),void 0===f[c=d[0]+","+d[1]]&&(f[c]={index1:d[0],index2:d[1]})}for(c in f)o=f[c],l=e.vertices[o.index1],h.push(l.x,l.y,l.z),l=e.vertices[o.index2],h.push(l.x,l.y,l.z)}else if(e&&e.isBufferGeometry){var g,b,y,x,w,O,k;if(l=new j,null!==e.index){for(g=e.attributes.position,b=e.index,0===(y=e.groups).length&&(y=[{start:0,count:b.count,materialIndex:0}]),a=0,i=y.length;a<i;++a)for(t=w=(x=y[a]).start,r=w+x.count;t<r;t+=3)for(n=0;n<3;n++)s=b.getX(t+n),u=b.getX(t+(n+1)%3),d[0]=Math.min(s,u),d[1]=Math.max(s,u),void 0===f[c=d[0]+","+d[1]]&&(f[c]={index1:d[0],index2:d[1]});for(c in f)o=f[c],l.fromBufferAttribute(g,o.index1),h.push(l.x,l.y,l.z),l.fromBufferAttribute(g,o.index2),h.push(l.x,l.y,l.z)}else for(t=0,r=(g=e.attributes.position).count/3;t<r;t++)for(n=0;n<3;n++)O=3*t+n,l.fromBufferAttribute(g,O),h.push(l.x,l.y,l.z),k=3*t+(n+1)%3,l.fromBufferAttribute(g,k),h.push(l.x,l.y,l.z)}this.setAttribute("position",new ot(h,3))}function fi(e,t,n){Wt.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new pi(e,t,n)),this.mergeVertices()}function pi(e,t,n){gt.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var r,a,i=[],o=[],s=[],u=[],c=1e-5,l=new j,h=new j,d=new j,f=new j,p=new j;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var m=t+1;for(r=0;r<=n;r++){var v=r/n;for(a=0;a<=t;a++){var g=a/t;e(g,v,h),o.push(h.x,h.y,h.z),g-c>=0?(e(g-c,v,d),f.subVectors(h,d)):(e(g+c,v,d),f.subVectors(d,h)),v-c>=0?(e(g,v-c,d),p.subVectors(h,d)):(e(g,v+c,d),p.subVectors(d,h)),l.crossVectors(f,p).normalize(),s.push(l.x,l.y,l.z),u.push(g,v)}}for(r=0;r<n;r++)for(a=0;a<t;a++){var b=r*m+a,y=r*m+a+1,x=(r+1)*m+a+1,w=(r+1)*m+a;i.push(b,y,w),i.push(y,x,w)}this.setIndex(i),this.setAttribute("position",new ot(o,3)),this.setAttribute("normal",new ot(s,3)),this.setAttribute("uv",new ot(u,2))}function mi(e,t,n,r){Wt.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},this.fromBufferGeometry(new vi(e,t,n,r)),this.mergeVertices()}function vi(e,t,n,r){gt.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},n=n||1;var a=[],i=[];function o(e,t,n,r){var a,i,o=Math.pow(2,r),u=[];for(a=0;a<=o;a++){u[a]=[];var c=e.clone().lerp(n,a/o),l=t.clone().lerp(n,a/o),h=o-a;for(i=0;i<=h;i++)u[a][i]=0===i&&a===o?c:c.clone().lerp(l,i/h)}for(a=0;a<o;a++)for(i=0;i<2*(o-a)-1;i++){var d=Math.floor(i/2);i%2===0?(s(u[a][d+1]),s(u[a+1][d]),s(u[a][d])):(s(u[a][d+1]),s(u[a+1][d+1]),s(u[a+1][d]))}}function s(e){a.push(e.x,e.y,e.z)}function u(t,n){var r=3*t;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function c(e,t,n,r){r<0&&1===e.x&&(i[t]=e.x-1),0===n.x&&0===n.z&&(i[t]=r/2/Math.PI+.5)}function l(e){return Math.atan2(e.z,-e.x)}!function(e){for(var n=new j,r=new j,a=new j,i=0;i<t.length;i+=3)u(t[i+0],n),u(t[i+1],r),u(t[i+2],a),o(n,r,a,e)}(r=r||0),function(e){for(var t=new j,n=0;n<a.length;n+=3)t.x=a[n+0],t.y=a[n+1],t.z=a[n+2],t.normalize().multiplyScalar(e),a[n+0]=t.x,a[n+1]=t.y,a[n+2]=t.z}(n),function(){for(var e=new j,t=0;t<a.length;t+=3){e.x=a[t+0],e.y=a[t+1],e.z=a[t+2];var n=l(e)/2/Math.PI+.5,r=(o=e,Math.atan2(-o.y,Math.sqrt(o.x*o.x+o.z*o.z))/Math.PI+.5);i.push(n,1-r)}var o;(function(){for(var e=new j,t=new j,n=new j,r=new j,o=new m,s=new m,u=new m,h=0,d=0;h<a.length;h+=9,d+=6){e.set(a[h+0],a[h+1],a[h+2]),t.set(a[h+3],a[h+4],a[h+5]),n.set(a[h+6],a[h+7],a[h+8]),o.set(i[d+0],i[d+1]),s.set(i[d+2],i[d+3]),u.set(i[d+4],i[d+5]),r.copy(e).add(t).add(n).divideScalar(3);var f=l(r);c(o,d+0,e,f),c(s,d+2,t,f),c(u,d+4,n,f)}})(),function(){for(var e=0;e<i.length;e+=6){var t=i[e+0],n=i[e+2],r=i[e+4],a=Math.max(t,n,r),o=Math.min(t,n,r);a>
vendor: 2,040 bytes, line 2
2.9&&o<.1&&(t<.2&&(i[e+0]+=1),n<.2&&(i[e+2]+=1),r<.2&&(i[e+4]+=1))}}()}(),this.setAttribute("position",new ot(a,3)),this.setAttribute("normal",new ot(a.slice(),3)),this.setAttribute("uv",new ot(i,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function gi(e,t){Wt.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new bi(e,t)),this.mergeVertices()}function bi(e,t){vi.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function yi(e,t){Wt.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new xi(e,t)),this.mergeVertices()}function xi(e,t){vi.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function wi(e,t){Wt.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Oi(e,t)),this.mergeVertices()}function Oi(e,t){var n=(1+Math.sqrt(5))/2,r=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];vi.call(this,r,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function ki(e,t){Wt.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Si(e,t)),this.mergeVertices()}function Si(e,t){var n=(1+Math.sqrt(5))/2,r=1/n,a=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r];vi.call(this,a,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,
vendor: 1,148 bytes, line 2
219,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function _i(e,t,n,r,a,i){Wt.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:a},void 0!==i&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new ji(e,t,n,r,a);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function ji(e,t,n,r,a){gt.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:a},t=t||64,n=n||1,r=r||8,a=a||!1;var i=e.computeFrenetFrames(t,a);this.tangents=i.tangents,this.normals=i.normals,this.binormals=i.binormals;var o,s,u=new j,c=new j,l=new m,h=new j,d=[],f=[],p=[],v=[];function g(a){h=e.getPointAt(a/t,h);var o=i.normals[a],l=i.binormals[a];for(s=0;s<=r;s++){var p=s/r*Math.PI*2,m=Math.sin(p),v=-Math.cos(p);c.x=v*o.x+m*l.x,c.y=v*o.y+m*l.y,c.z=v*o.z+m*l.z,c.normalize(),f.push(c.x,c.y,c.z),u.x=h.x+n*c.x,u.y=h.y+n*c.y,u.z=h.z+n*c.z,d.push(u.x,u.y,u.z)}}!function(){for(o=0;o<t;o++)g(o);
vendor: 8,203 bytes, line 2
2g(!1===a?t:0),function(){for(o=0;o<=t;o++)for(s=0;s<=r;s++)l.x=o/t,l.y=s/r,p.push(l.x,l.y)}(),function(){for(s=1;s<=t;s++)for(o=1;o<=r;o++){var e=(r+1)*(s-1)+(o-1),n=(r+1)*s+(o-1),a=(r+1)*s+o,i=(r+1)*(s-1)+o;v.push(e,n,i),v.push(n,a,i)}}()}(),this.setIndex(v),this.setAttribute("position",new ot(d,3)),this.setAttribute("normal",new ot(f,3)),this.setAttribute("uv",new ot(p,2))}function Ei(e,t,n,r,a,i,o){Wt.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:a,q:i},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Ti(e,t,n,r,a,i)),this.mergeVertices()}function Ti(e,t,n,r,a,i){gt.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:a,q:i},e=e||1,t=t||.4,n=Math.floor(n)||64,r=Math.floor(r)||8,a=a||2,i=i||3;var o,s,u=[],c=[],l=[],h=[],d=new j,f=new j,p=new j,m=new j,v=new j,g=new j,b=new j;for(o=0;o<=n;++o){var y=o/n*a*Math.PI*2;for(T(y,a,i,e,p),T(y+.01,a,i,e,m),g.subVectors(m,p),b.addVectors(m,p),v.crossVectors(g,b),b.crossVectors(v,g),v.normalize(),b.normalize(),s=0;s<=r;++s){var x=s/r*Math.PI*2,w=-t*Math.cos(x),O=t*Math.sin(x);d.x=p.x+(w*b.x+O*v.x),d.y=p.y+(w*b.y+O*v.y),d.z=p.z+(w*b.z+O*v.z),c.push(d.x,d.y,d.z),f.subVectors(d,p).normalize(),l.push(f.x,f.y,f.z),h.push(o/n),h.push(s/r)}}for(s=1;s<=n;s++)for(o=1;o<=r;o++){var k=(r+1)*(s-1)+(o-1),S=(r+1)*s+(o-1),_=(r+1)*s+o,E=(r+1)*(s-1)+o;u.push(k,S,E),u.push(S,_,E)}function T(e,t,n,r,a){var i=Math.cos(e),o=Math.sin(e),s=n/t*e,u=Math.cos(s);a.x=r*(2+u)*.5*i,a.y=r*(2+u)*o*.5,a.z=r*Math.sin(s)*.5}this.setIndex(u),this.setAttribute("position",new ot(c,3)),this.setAttribute("normal",new ot(l,3)),this.setAttribute("uv",new ot(h,2))}function Ci(e,t,n,r,a){Wt.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:a},this.fromBufferGeometry(new Mi(e,t,n,r,a)),this.mergeVertices()}function Mi(e,t,n,r,a){gt.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:a},e=e||1,t=t||.4,n=Math.floor(n)||8,r=Math.floor(r)||6,a=a||2*Math.PI;var i,o,s=[],u=[],c=[],l=[],h=new j,d=new j,f=new j;for(i=0;i<=n;i++)for(o=0;o<=r;o++){var p=o/r*a,m=i/n*Math.PI*2;d.x=(e+t*Math.cos(m))*Math.cos(p),d.y=(e+t*Math.cos(m))*Math.sin(p),d.z=t*Math.sin(m),u.push(d.x,d.y,d.z),h.x=e*Math.cos(p),h.y=e*Math.sin(p),f.subVectors(d,h).normalize(),c.push(f.x,f.y,f.z),l.push(o/r),l.push(i/n)}for(i=1;i<=n;i++)for(o=1;o<=r;o++){var v=(r+1)*i+o-1,g=(r+1)*(i-1)+o-1,b=(r+1)*(i-1)+o,y=(r+1)*i+o;s.push(v,g,y),s.push(g,b,y)}this.setIndex(s),this.setAttribute("position",new ot(u,3)),this.setAttribute("normal",new ot(c,3)),this.setAttribute("uv",new ot(l,2))}oi.prototype=Object.assign(Object.create(Q.prototype),{constructor:oi,isPoints:!0,raycast:function(e,t){var n=this.geometry,r=this.matrixWorld,a=e.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),ai.copy(n.boundingSphere),ai.applyMatrix4(r),ai.radius+=a,!1!==e.ray.intersectsSphere(ai)){ni.getInverse(r),ri.copy(e.ray).applyMatrix4(ni);var i=a/((this.scale.x+this.scale.y+this.scale.z)/3),o=i*i;if(n.isBufferGeometry){var s=n.index,u=n.attributes.position.array;if(null!==s)for(var c=s.array,l=0,h=c.length;l<h;l++){var d=c[l];ii.fromArray(u,3*d),si(ii,d,o,r,e,t,this)}else{l=0;for(var f=u.length/3;l<f;l++)ii.fromArray(u,3*l),si(ii,l,o,r,e,t,this)}}else{var p=n.vertices;for(l=0,f=p.length;l<f;l++)si(p[l],l,o,r,e,t,this)}}},updateMorphTargets:function(){var e,t,n,r=this.geometry;if(r.isBufferGeometry){var a=r.morphAttributes,i=Object.keys(a);if(i.length>0){var o=a[i[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=r.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),ui.prototype=Object.assign(Object.create(y.prototype),{constructor:ui,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),ci.prototype=Object.create(y.prototype),ci.prototype.constructor=ci,ci.prototype.isCompressedTexture=!0,li.prototype=Object.create(y.prototype),li.prototype.constructor=li,li.prototype.isCanvasTexture=!0,hi.prototype=Object.create(y.prototype),hi.prototype.constructor=hi,hi.prototype.isDepthTexture=!0,di.prototype=Object.create(gt.prototype),di.prototype.constructor=di,fi.prototype=Object.create(Wt.prototype),fi.prototype.constructor=fi,pi.prototype=Object.create(gt.prototype),pi.prototype.constructor=pi,mi.prototype=Object.create(Wt.prototype),mi.prototype.constructor=mi,vi.prototype=Object.create(gt.prototype),vi.prototype.constructor=vi,gi.prototype=Object.create(Wt.prototype),gi.prototype.constructor=gi,bi.prototype=Object.create(vi.prototype),bi.prototype.constructor=bi,yi.prototype=Object.create(Wt.prototype),yi.prototype.constructor=yi,xi.prototype=Object.create(vi.prototype),xi.prototype.constructor=xi,wi.prototype=Object.create(Wt.prototype),wi.prototype.constructor=wi,Oi.prototype=Object.create(vi.prototype),Oi.prototype.constructor=Oi,ki.prototype=Object.create(Wt.prototype),ki.prototype.constructor=ki,Si.prototype=Object.create(vi.prototype),Si.prototype.constructor=Si,_i.prototype=Object.create(Wt.prototype),_i.prototype.constructor=_i,ji.prototype=Object.create(gt.prototype),ji.prototype.constructor=ji,ji.prototype.toJSON=function(){var e=gt.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e},Ei.prototype=Object.create(Wt.prototype),Ei.prototype.constructor=Ei,Ti.prototype=Object.create(gt.prototype),Ti.prototype.constructor=Ti,Ci.prototype=Object.create(Wt.prototype),Ci.prototype.constructor=Ci,Mi.prototype=Object.create(gt.prototype),Mi.prototype.constructor=Mi;var Ai=function(e,t,n){n=n||2;var r,a,i,o,s,u,c,l=t&&t.length,h=l?t[0]*n:e.length,d=Ni(e,0,h,n,!0),f=[];if(!d||d.next===d.prev)return f;if(l&&(d=function(e,t,n,r){var a,i,o,s,u,c=[];for(a=0,i=t.length;a<i;a++)o=t[a]*r,s=a<i-1?t[a+1]*r:e.length,(u=Ni(e,o,s,r,!1))===u.next&&(u.steiner=!0),c.push(Vi(u));for(c.sort(Fi),a=0;a<c.length;a++)Bi(c[a],n),n=Ri(n,n.next);return n}(e,t,d,n)),e.length>80*n){r=i=e[0],a=o=e[1];for(var p=n;p<h;p+=n)(s=e[p])<r&&(r=s),(u=e[p+1])<a&&(a=u),s>i&&(i=s),u>o&&(o=u);c=0!==(c=Math.max(i-r,o-a))?1/c:0}return Ii(d,f,n,r,a,c),f};function Ni(e,t,n,r,a){var i,o;if(a===function(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}(e,t,n,r)>0)for(i=t;i<n;i+=r)o=$i(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=$i(i,e[i],e[i+1],o);return o&&Xi(o,o.next)&&(eo(o),o=o.next),o}function Ri(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!Xi(r,r.next)&&0!==qi(r.prev,r,r.next))r=r.next;else{if(eo(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function Ii(e,t,n,r,a,i,o){if(e){!o&&i&&function(e,t,n,r){var a=e;do{null===a.z&&(a.z=Wi(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next}while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,function(e){var t,n,r,a,i,o,s,u,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,s=0,t=0;t<c&&(s++,r=r.nextZ);t++);for(u=c;s>0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(a=n,n=n.nextZ,s--):(a=r,r=r.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1)}(a)}(e,r,a,i);for(var s,u,c=e;e.prev!==e.next;)if(s=e.prev,u=e.next,i?Di(e,r,a,i):Li(e))t.push(s.i/n),t.push(e.i/n),t.push(u.i/n),eo(e),e=u.next,c=u.next;else if((e=u)===c){o?1===o?Ii(e=Pi(Ri(e),t,n),t,n,r,a,i,2):2===o&&zi(e,t,n,r,a,i):Ii(Ri(e),t,n,r,a,i,1);break}}}function Li(e){var t=e.prev,n=e,r=e.next;if(qi(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(Gi(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&qi(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function Di(e,t,n,r){var a=e.prev,i=e,o=e.next;if(qi(a,i,o)>=0)return!1;for(var s=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,u=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>
vendor: 1,216 bytes, line 2
2o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,h=Wi(s,u,t,n,r),d=Wi(c,l,t,n,r),f=e.prevZ,p=e.nextZ;f&&f.z>=h&&p&&p.z<=d;){if(f!==e.prev&&f!==e.next&&Gi(a.x,a.y,i.x,i.y,o.x,o.y,f.x,f.y)&&qi(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,p!==e.prev&&p!==e.next&&Gi(a.x,a.y,i.x,i.y,o.x,o.y,p.x,p.y)&&qi(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==e.prev&&f!==e.next&&Gi(a.x,a.y,i.x,i.y,o.x,o.y,f.x,f.y)&&qi(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&Gi(a.x,a.y,i.x,i.y,o.x,o.y,p.x,p.y)&&qi(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function Pi(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!Xi(a,i)&&Yi(a,r,r.next,i)&&Ji(a,i)&&Ji(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),eo(r),eo(r.next),r=e=i),r=r.next}while(r!==e);return Ri(r)}function zi(e,t,n,r,a,i){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Hi(o,s)){var u=Qi(o,s);return o=Ri(o,o.next),u=Ri(u,u.next),Ii(o,t,n,r,a,i),void Ii(u,t,n,r,a,i)}s=s.next}o=o.next}while(o!==e)}function Fi(e,t){return e.x-t.x}function Bi(e,t){if(t=function(e,t){var n,r=t,a=e.x,i=e.y,o=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var s=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y
2);if(s<=a&&s>o){if(o=s,s===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n;var u,c=n,l=n.x,h=n.y,d=1/0;r=n;do{a>=r.x&&r.x>=l&&a!==r.x&&Gi(i<h?a:o,i,l,h,i<h?o:a,i,r.x,r.y)&&(u=Math.abs(i-r.y)/(a-r.x),Ji(r,e)&&(u<d||u===d&&(r.x>n.x||r.x===n.x&&Ui(n,r)))&&(n=r,d=u)),r=r.next}while(r!==c);return n}(e,t)){var n=Qi(t,e);Ri(t,t.next),Ri(n,n.next)}}function Ui(e,t){return qi(e.prev,e,t.prev)<0&&qi(t.next,e,e.next)<0}function Wi(e,t,n,r,a){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*a)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*a)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Vi(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function Gi(e,t,n,r,a,i,o,s){return(a-o)*(t-s)-(e-o)*(i-s)>=0&&(e-o)*(r-s)-(n-o)*(t-s)>=0&&(n-o)*(i-s)-(a-o)*(r-s)>=0}function Hi(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Yi(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(Ji(e,t)&&Ji(t,e)&&function(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do{n.y>i!==n.next.y>i&&n.next.y!==n.y&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(qi(e.prev,e,t.prev)||qi(e,t.prev,t))||Xi(e,t)&&qi(e.prev,e,e.next)>0&&qi(t.prev,t,t.next)>0)}function qi(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Xi(e,t){return e.x===t.x&&e.y===t.y}function Yi(e,t,n,r){var a=Zi(qi(e,t,n)),i=Zi(qi(e,t,r)),o=Zi(qi(n,r,e)),s=Zi(qi(n,r,t));return a!==i&&o!==s||(!(0!==a||!Ki(e,n,t))||(!(0!==i||!Ki(e,r,t))||(!(0!==o||!Ki(n,e,r))||!(0!==s||!Ki(n,t,r)))))}function Ki(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Zi(e){return e>0?1:e<0?-1:0}function Ji(e,t){return qi(e.prev,e,e.next)<0?qi(e,t,e.next)>=0&&qi(e,e.prev,t)>=0:qi(e,t,e.prev)<0||qi(e,e.next,t)<0}function Qi(e,t){var n=new to(e.i,e.x,e.y),r=new to(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function $i(e,t,n,r){var a=new to(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function eo(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function to(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var no={area:function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++)n+=e[r].x*e[a].y-e[a].x*e[r].y;return.5*n},isClockWise:function(e){return no.area(e)<0},triangulateShape:function(e,t){var n=[],r=[],a=[];ro(e),ao(n,e);var i=e.length;t.forEach(ro);for(var o=0;o<t.length;o++)r.push(i),i+=t[o].length,ao(n,t[o]);var s=Ai(n,r);for(o=0;o<s.length;o+=3)a.push(s.slice(o,o+3));return a}};function ro(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function ao(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function io(e,t){Wt.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new oo(e,t)),this.mergeVertices()}function oo(e,t){gt.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];for(var n=this,r=[],a=[],i=0,o=e.length;i<o;i++){s(e[i])}function s(e){var i=[],o=void 0!==t.curveSegments?t.curveSegments:12,s=void 0!==t.steps?t.steps:1,u=void 0!==t.depth?t.depth:100,c=void 0===t.bevelEnabled||t.bevelEnabled,l=void 0!==t.bevelThickness?t.bevelThickness:6,h=void 0!==t.bevelSize?t.bevelSize:l-2,d=void 0!==t.bevelOffset?t.bevelOffset:0,f=void 0!==t.bevelSegments?t.bevelSegments:3,p=t.extrudePath,v=void 0!==t.UVGenerator?t.UVGenerator:so;void 0!==t.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),u=t.amount);var g,b,y,x,w,O,k,S,_=!1;p&&(g=p.getSpacedPoints(s),_=!0,c=!1,b=p.computeFrenetFrames(s,!1),y=new j,x=new j,w=new j),c||(f=0,l=0,h=0,d=0);var E=e.extractPoints(o),T=E.shape,C=E.holes;if(!no.isClockWise(T))for(T=T.reverse(),k=0,S=C.length;k<S;k++)O=C[k],no.isClockWise(O)&&(C[k]=O.reverse());var M=no.triangulateShape(T,C),A=T;for(k=0,S=C.length;k<S;k++)O=C[k],T=T.concat(O);function N(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}var R,I,L,D,P,z,F=T.length,B=M.length;function U(e,t,n){var r,a,i,o=e.x-t.x,s=e.y-t.y,u=n.x-e.x,c=n.y-e.y,l=o*o+s*s,h=o*c-s*u;if(Math.abs(h)>Number.EPSILON){var d=Math.sqrt(l),f=Math.sqrt(u*u+c*c),p=t.x-s/d,v=t.y+o/d,g=((n.x-c/f-p)*c-(n.y+u/f-v)*u)/(o*c-s*u),b=(r=p+o*g-e.x)*r+(a=v+s*g-e.y)*a;if(b<=2)return new m(r,a);i=Math.sqrt(b/2)}else{var y=!1;o>
vendor: 4,236 bytes, line 2
2Number.EPSILON?u>Number.EPSILON&&(y=!0):o<-Number.EPSILON?u<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(c)&&(y=!0),y?(r=-s,a=o,i=Math.sqrt(l)):(r=o,a=s,i=Math.sqrt(l/2))}return new m(r/i,a/i)}for(var W=[],V=0,G=A.length,H=G-1,q=V+1;V<G;V++,H++,q++)H===G&&(H=0),q===G&&(q=0),W[V]=U(A[V],A[H],A[q]);var X,Y,K=[],Z=W.concat();for(k=0,S=C.length;k<S;k++){for(O=C[k],X=[],V=0,H=(G=O.length)-1,q=V+1;V<G;V++,H++,q++)H===G&&(H=0),q===G&&(q=0),X[V]=U(O[V],O[H],O[q]);K.push(X),Z=Z.concat(X)}for(R=0;R<f;R++){for(L=R/f,D=l*Math.cos(L*Math.PI/2),I=h*Math.sin(L*Math.PI/2)+d,V=0,G=A.length;V<G;V++)Q((P=N(A[V],W[V],I)).x,P.y,-D);for(k=0,S=C.length;k<S;k++)for(O=C[k],X=K[k],V=0,G=O.length;V<G;V++)Q((P=N(O[V],X[V],I)).x,P.y,-D)}for(I=h+d,V=0;V<F;V++)P=c?N(T[V],Z[V],I):T[V],_?(x.copy(b.normals[0]).multiplyScalar(P.x),y.copy(b.binormals[0]).multiplyScalar(P.y),w.copy(g[0]).add(x).add(y),Q(w.x,w.y,w.z)):Q(P.x,P.y,0);for(Y=1;Y<=s;Y++)for(V=0;V<F;V++)P=c?N(T[V],Z[V],I):T[V],_?(x.copy(b.normals[Y]).multiplyScalar(P.x),y.copy(b.binormals[Y]).multiplyScalar(P.y),w.copy(g[Y]).add(x).add(y),Q(w.x,w.y,w.z)):Q(P.x,P.y,u/s*Y);for(R=f-1;R>=0;R--){for(L=R/f,D=l*Math.cos(L*Math.PI/2),I=h*Math.sin(L*Math.PI/2)+d,V=0,G=A.length;V<G;V++)Q((P=N(A[V],W[V],I)).x,P.y,u+D);for(k=0,S=C.length;k<S;k++)for(O=C[k],X=K[k],V=0,G=O.length;V<G;V++)P=N(O[V],X[V],I),_?Q(P.x,P.y+g[s-1].y,g[s-1].x+D):Q(P.x,P.y,u+D)}function J(e,t){var n,r;for(V=e.length;--V>=0;){n=V,(r=V-1)<0&&(r=e.length-1);var a=0,i=s+2*f;for(a=0;a<i;a++){var o=F*a,u=F*(a+1);ee(t+n+o,t+r+o,t+r+u,t+n+u)}}}function Q(e,t,n){i.push(e),i.push(t),i.push(n)}function $(e,t,a){te(e),te(t),te(a);var i=r.length/3,o=v.generateTopUV(n,r,i-3,i-2,i-1);ne(o[0]),ne(o[1]),ne(o[2])}function ee(e,t,a,i){te(e),te(t),te(i),te(t),te(a),te(i);var o=r.length/3,s=v.generateSideWallUV(n,r,o-6,o-3,o-2,o-1);ne(s[0]),ne(s[1]),ne(s[3]),ne(s[1]),ne(s[2]),ne(s[3])}function te(e){r.push(i[3*e+0]),r.push(i[3*e+1]),r.push(i[3*e+2])}function ne(e){a.push(e.x),a.push(e.y)}!function(){var e=r.length/3;if(c){var t=0,a=F*t;for(V=0;V<B;V++)$((z=M[V])[2]+a,z[1]+a,z[0]+a);for(a=F*(t=s+2*f),V=0;V<B;V++)$((z=M[V])[0]+a,z[1]+a,z[2]+a)}else{for(V=0;V<B;V++)$((z=M[V])[2],z[1],z[0]);for(V=0;V<B;V++)$((z=M[V])[0]+F*s,z[1]+F*s,z[2]+F*s)}n.addGroup(e,r.length/3-e,0)}(),function(){var e=r.length/3,t=0;for(J(A,t),t+=A.length,k=0,S=C.length;k<S;k++)J(O=C[k],t),t+=O.length;n.addGroup(e,r.length/3-e,1)}()}this.setAttribute("position",new ot(r,3)),this.setAttribute("uv",new ot(a,2)),this.computeVertexNormals()}io.prototype=Object.create(Wt.prototype),io.prototype.constructor=io,io.prototype.toJSON=function(){var e=Wt.prototype.toJSON.call(this);return uo(this.parameters.shapes,this.parameters.options,e)},oo.prototype=Object.create(gt.prototype),oo.prototype.constructor=oo,oo.prototype.toJSON=function(){var e=gt.prototype.toJSON.call(this);return uo(this.parameters.shapes,this.parameters.options,e)};var so={generateTopUV:function(e,t,n,r,a){var i=t[3*n],o=t[3*n+1],s=t[3*r],u=t[3*r+1],c=t[3*a],l=t[3*a+1];return[new m(i,o),new m(s,u),new m(c,l)]},generateSideWallUV:function(e,t,n,r,a,i){var o=t[3*n],s=t[3*n+1],u=t[3*n+2],c=t[3*r],l=t[3*r+1],h=t[3*r+2],d=t[3*a],f=t[3*a+1],p=t[3*a+2],v=t[3*i],g=t[3*i+1],b=t[3*i+2];return Math.abs(s-l)<.01?[new m(o,1-u),new m(c,1-h),new m(d,1-p),new m(v,1-b)]:[new m(s,1-u),new m(l,1-h),new m(f,1-p),new m(g,1-b)]}};function uo(e,t,n){if(n.shapes=[],Array.isArray(e))for(var r=0,a=e.length;r<a;r++){var i=e[r];n.shapes.push(i.uuid)}else n.shapes.push(e.uuid);return void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON()),n}function co(e,t){Wt.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new lo(e,t)),this.mergeVertices()}function lo(e,t){var n=(t=t||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Wt;var r=n.generateShapes(e,t.size);t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),oo.call(this,r,t),this.type="TextBufferGeometry"}function ho(e,t,n,r,a,i,o){Wt.call(this),this.type="SphereGeometry",this.parameters={radiu
vendor: 5,374 bytes, line 2
2s:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:a,thetaStart:i,thetaLength:o},this.fromBufferGeometry(new fo(e,t,n,r,a,i,o)),this.mergeVertices()}function fo(e,t,n,r,a,i,o){gt.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:a,thetaStart:i,thetaLength:o},e=e||1,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),r=void 0!==r?r:0,a=void 0!==a?a:2*Math.PI,i=void 0!==i?i:0,o=void 0!==o?o:Math.PI;var s,u,c=Math.min(i+o,Math.PI),l=0,h=[],d=new j,f=new j,p=[],m=[],v=[],g=[];for(u=0;u<=n;u++){var b=[],y=u/n,x=0;for(0==u&&0==i?x=.5/t:u==n&&c==Math.PI&&(x=-.5/t),s=0;s<=t;s++){var w=s/t;d.x=-e*Math.cos(r+w*a)*Math.sin(i+y*o),d.y=e*Math.cos(i+y*o),d.z=e*Math.sin(r+w*a)*Math.sin(i+y*o),m.push(d.x,d.y,d.z),f.copy(d).normalize(),v.push(f.x,f.y,f.z),g.push(w+x,1-y),b.push(l++)}h.push(b)}for(u=0;u<n;u++)for(s=0;s<t;s++){var O=h[u][s+1],k=h[u][s],S=h[u+1][s],_=h[u+1][s+1];(0!==u||i>0)&&p.push(O,k,_),(u!==n-1||c<Math.PI)&&p.push(k,S,_)}this.setIndex(p),this.setAttribute("position",new ot(m,3)),this.setAttribute("normal",new ot(v,3)),this.setAttribute("uv",new ot(g,2))}function po(e,t,n,r,a,i){Wt.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:a,thetaLength:i},this.fromBufferGeometry(new mo(e,t,n,r,a,i)),this.mergeVertices()}function mo(e,t,n,r,a,i){gt.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:a,thetaLength:i},e=e||.5,t=t||1,a=void 0!==a?a:0,i=void 0!==i?i:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var o,s,u,c=[],l=[],h=[],d=[],f=e,p=(t-e)/(r=void 0!==r?Math.max(1,r):1),v=new j,g=new m;for(s=0;s<=r;s++){for(u=0;u<=n;u++)o=a+u/n*i,v.x=f*Math.cos(o),v.y=f*Math.sin(o),l.push(v.x,v.y,v.z),h.push(0,0,1),g.x=(v.x/t+1)/2,g.y=(v.y/t+1)/2,d.push(g.x,g.y);f+=p}for(s=0;s<r;s++){var b=s*(n+1);for(u=0;u<n;u++){var y=o=u+b,x=o+n+1,w=o+n+2,O=o+1;c.push(y,x,O),c.push(x,w,O)}}this.setIndex(c),this.setAttribute("position",new ot(l,3)),this.setAttribute("normal",new ot(h,3)),this.setAttribute("uv",new ot(d,2))}function vo(e,t,n,r){Wt.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},this.fromBufferGeometry(new go(e,t,n,r)),this.mergeVertices()}function go(e,t,n,r){gt.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t)||12,n=n||0,r=r||2*Math.PI,r=p.clamp(r,0,2*Math.PI);var a,i,o,s=[],u=[],c=[],l=1/t,h=new j,d=new m;for(i=0;i<=t;i++){var f=n+i*l*r,v=Math.sin(f),g=Math.cos(f);for(o=0;o<=e.length-1;o++)h.x=e[o].x*v,h.y=e[o].y,h.z=e[o].x*g,u.push(h.x,h.y,h.z),d.x=i/t,d.y=o/(e.length-1),c.push(d.x,d.y)}for(i=0;i<t;i++)for(o=0;o<e.length-1;o++){var b=a=o+i*e.length,y=a+e.length,x=a+e.length+1,w=a+1;s.push(b,y,w),s.push(y,x,w)}if(this.setIndex(s),this.setAttribute("position",new ot(u,3)),this.setAttribute("uv",new ot(c,2)),this.computeVertexNormals(),r===2*Math.PI){var O=this.attributes.normal.array,k=new j,S=new j,_=new j;for(a=t*e.length*3,i=0,o=0;i<e.length;i++,o+=3)k.x=O[o+0],k.y=O[o+1],k.z=O[o+2],S.x=O[a+o+0],S.y=O[a+o+1],S.z=O[a+o+2],_.addVectors(k,S).normalize(),O[o+0]=O[a+o+0]=_.x,O[o+1]=O[a+o+1]=_.y,O[o+2]=O[a+o+2]=_.z}}function bo(e,t){Wt.call(this),this.type="ShapeGeometry","object"===typeof t&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new yo(e,t)),this.mergeVertices()}function yo(e,t){gt.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t},t=t||12;var n=[],r=[],a=[],i=[],o=0,s=0;if(!1===Array.isArray(e))c(e);else for(var u=0;u<e.length;u++)c(e[u]),this.addGroup(o,s,u),o+=s,s=0;function c(e){var o,u,c,l=r.length/3,h=e.extractPoints(t),d=h.shape,f=h.holes;for(!1===no.isClockWise(d)&&(d=d.reverse()),o=0,u=f.length;o<u;o++)c=f[o],!0===no.isClockWise(c)&&(f[o]=c.reverse());var p=no.triangulateShape(d,f);for(o=0,u=f.length;o<u;o++)c=f[o],d=d.concat(c);for(o=0,u=d.length;o<u;o++){var m=d[o];r.push(m.x,m.y,0),a.push(0,0,1),i.push(m.x,m.y)}for(o=0,u=p.length;o<u;o++){var v=p[o],g=v[0]+l,b=v[1]+l,y=v[2]+l;n.push(g,b,y),s+=3}}this.setIndex(n),this.setAttribute("position",new ot(r,3)),this.setAttribute("normal",new ot(a,3)),this.setAttribute("uv",new ot(i,2))}function xo(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,r=e.length;n<r;n++){var a=e[n];t.shapes.push(a.uuid)}else t.shapes.push(e.uuid);return t}function wo(e,t){gt.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1;var n,r,a,i,o=[],s=Math.cos(p.DEG2RAD*t),u=[0,0],c={},l=["a","b","c"];e.isBufferGeometry?(i=new Wt).fromBufferGeometry(e):i=e.clone(),i.mergeVertices(),i.computeFaceNormals();for(var h=i.vertices,d=i.faces,f=0,m=d.length;f<m;f++)for(var v=d[f],g=0;g<3;g++)n=v[l[g]],r=v[l[(g+1)%3]],u[0]=Math.min(n,r),u[1]=Math.max(n,r),void 0===c[a=u[0]+","+u[1]]?c[a]={index1:u[0],index2:u[1],face1:f,face2:void 0}:c[a].face2=f;for(a in c){var b=c[a];if(void 0===b.face2||d[b.face1].normal.dot(d[b.face2].normal)<=s){var y=h[b.index1];o.push(y.x,y.y,y.z),y=h[b.index2],o.push(y.x,y.y,y.z)}}this.setAttribute("position",new ot(o,3))}function Oo(e,t,n,r,a,i,o,s){Wt.call(this),this.type="CylinderGeometry",this.parameters={radiu
vendor: 1,655 bytes, line 2
2sTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:a,openEnded:i,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new ko(e,t,n,r,a,i,o,s)),this.mergeVertices()}function ko(e,t,n,r,a,i,o,s){gt.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:a,openEnded:i,thetaStart:o,thetaLength:s};var u=this;e=void 0!==e?e:1,t=void 0!==t?t:1,n=n||1,r=Math.floor(r)||8,a=Math.floor(a)||1,i=void 0!==i&&i,o=void 0!==o?o:0,s=void 0!==s?s:2*Math.PI;var c=[],l=[],h=[],d=[],f=0,p=[],v=n/2,g=0;function b(n){var a,i,p,b=new m,y=new j,x=0,w=!0===n?e:t,O=!0===n?1:-1;for(i=f,a=1;a<=r;a++)l.push(0,v*O,0),h.push(0,O,0),d.push(.5,.5),f++;for(p=f,a=0;a<=r;a++){var k=a/r*s+o,S=Math.cos(k),_=Math.sin(k);y.x=w*_,y.y=v*O,y.z=w*S,l.push(y.x,y.y,y.z),h.push(0,O,0),b.x=.5*S+.5,b.y=.5*_*O+.5,d.push(b.x,b.y),f++}for(a=0;a<r;a++){var E=i+a,T=p+a;!0===n?c.push(T,T+1,E):c.push(T+1,T,E),x+=3}u.addGroup(g,x,!0===n?1:2),g+=x}!function(){var i,m,b=new j,y=new j,x=0,w=(t-e)/n;for(m=0;m<=a;m++){var O=[],k=m/a,S=k*(t-e)+e;for(i=0;i<=r;i++){var _=i/r,E=_*s+o,T=Math.sin(E),C=Math.cos(E);y.x=S*T,y.y=-k*n+v,y.z=S*C,l.push(y.x,y.y,y.z),b.set(T,w,C).normalize(),h.push(b.x,b.y,b.z),d.push(_,1-k),O.push(f++)}p.push(O)}for(i=0;i<r;i++)for(m=0;m<a;m++){var M=p[m][i],A=p[m+1][i],N=p[m+1][i+1],R=p[m][i+1];c.push(M,A,R),c.push(A,N,R),x+=6}u.addGroup(g,x,0),g+=x}(),!1===i&&(e>0&&b(!0),t>0&&b(!1)),this.setIndex(c),this.setAttribute("position",new ot(l,3)),this.setAttribute("normal",new ot(h,3)),this.setAttribute("uv",new ot(d,2))}function So(e,t,n,r,a,i,o){Oo.call(this,0,e,t,n,r,a,i,o),this.type="C
2oneGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:a,thetaStart:i,thetaLength:o}}function _o(e,t,n,r,a,i,o){ko.call(this,0,e,t,n,r,a,i,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:a,thetaStart:i,thetaLength:o}}function jo(e,t,n,r){Wt.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new Eo(e,t,n,r)),this.mergeVertices()}function Eo(e,t,n,r){gt.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},e=e||1,t=void 0!==t?Math.max(3,t):8,n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var a,i,o=[],s=[],u=[],c=[],l=new j,h=new m;for(s.push(0,0,0),u.push(0,0,1),c.push(.5,.5),i=0,a=3;i<=t;i++,a+=3){var d=n+i/t*r;l.x=e*Math.cos(d),l.y=e*Math.sin(d),s.push(l.x,l.y,l.z),u.push(0,0,1),h.x=(s[a]/e+1)/2,h.y=(s[a+1]/e+1)/2,c.push(h.x,h.y)}for(a=1;a<=t;a++)o.push(a,a+1,0);this.setIndex(o),this.setAttribute("position",new ot(s,3)),this.setAttribute("normal",new ot(u,3)),this.setAttribute("uv",new ot(c,2))}co.prototype=Object.create(Wt.prototype),co.prototype.constructor=co,lo.prototype=Object.create(oo.prototype),lo.prototype.constructor=lo,ho.prototype=Object.create(Wt.prototype),ho.prototype.constructor=ho,fo.prototype=Object.create(gt.prototype),fo.prototype.constructor=fo,po.prototype=Object.create(Wt.prototype),po.prototype.constructor=po,mo.prototype=Object.create(gt.prototype),mo.prototype.constructor=mo,vo.prototype=Object.create(Wt.prototype),vo.prototype.constructor=vo,go.prototype=Object.create(gt.prototype),go.prototype.constructor=go,bo.prototype=Object.create(Wt.prototype),bo.prototype.constructor=bo,bo.prototype.toJSON=function(){var e=Wt.prototype.toJSON.call(this);return xo(this.parameters.shapes,e)},yo.prototype=Object.create(gt.prototype),yo.prototype.constructor=yo,yo.prototype.toJSON=function(){var e=gt.prototype.toJSON.call(this);return xo(this.parameters.shapes,e)},wo.prototype=Object.create(gt.prototype),wo.prototype.constructor=wo,Oo.prototype=Object.create(Wt.prototype),Oo.prototype.constructor=Oo,ko.prototype=Object.create(gt.prototype),ko.prototype.constructor=ko,So.prototype=Object.create(Oo.prototype),So.prototype.constructor=So,_o.prototype=Object.create(ko.prototype),_o.prototype.constructor=_o,jo.prototype=Object.create(Wt.prototype),jo.prototype.constructor=jo,Eo.prototype=Object.create(gt.prototype),Eo.prototype.constructor=Eo;var To=Object.freeze({__proto__:null,WireframeGeometry:di,ParametricGeometry:fi,ParametricBufferGeometry:pi,TetrahedronGeometry:gi,TetrahedronBufferGeometry:bi,OctahedronGeometry:yi,OctahedronBufferGeometry:xi,IcosahedronGeometry:wi,IcosahedronBufferGeometry:Oi,DodecahedronGeometry:ki,DodecahedronBufferGeometry:Si,PolyhedronGeometry:mi,PolyhedronBufferGeometry:vi,TubeGeometry:_i,TubeBufferGeometry:ji,TorusKnotGeometry:Ei,TorusKnotBufferGeometry:Ti,TorusGeometry:Ci,TorusBufferGeometry:Mi,TextGeometry:co,TextBufferGeometry:lo,SphereGeometry:ho,SphereBufferGeometry:fo,RingGeometry:po,RingBufferGeometry:mo,PlaneGeometry:sn,PlaneBufferGeometry:un,LatheGeometry:vo,LatheBufferGeometry:go,ShapeGeometry:bo,ShapeBufferGeometry:yo,ExtrudeGeometry:io,ExtrudeBufferGeometry:oo,EdgesGeometry:wo,ConeGeometry:So,ConeBufferGeometry:_o,CylinderGeometry:Oo,CylinderBufferGeometry:ko,CircleGeometry:jo,CircleBufferGeometry:Eo,BoxGeometry:Vt,BoxBufferGeometry:Gt});function Co(e){Ke.call(this),this.type="ShadowMaterial",this.color=new Ve(0),this.transparent=!0,this.setValues(e)}function Mo(e){Yt.call(this,e),this.type="RawShaderMaterial"}function Ao(e){Ke.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ve(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ve(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new m(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.vertexTangents=!1,this.setValues(e)}function No(e){Ao.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new m(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(e)}function Ro(e){Ke.call(this),this.type="MeshPhongMaterial",this.color=new Ve(16777215),this.specular=new Ve(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ve(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new m(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Io(e){Ke.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ve(16777215),this.specular=new Ve(1118481),this.shininess=30,this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ve(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new m(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Lo(e){Ke.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new m(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Do(e){Ke.call(this),this.type="MeshLambertMaterial",this.color=new Ve(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ve(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Po(e){Ke.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ve(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new m(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function zo(e){Ga.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}Co.prototype=Object.create(Ke.prototype),Co.prototype.constructor=Co,Co.prototype.isShadowMaterial=!0,Co.prototype.copy=function(e){return Ke.prototype.copy.call(this,e),this.color.copy(e.color),this},Mo.prototype=Object.create(Yt.prototype),Mo.prototype.constructor=Mo,Mo.prototype.isRawShaderMaterial=!0,Ao.prototype=Object.create(Ke.prototype),Ao.prototype.constructor=Ao,Ao.prototype.isMeshStandardMaterial=!0,Ao.prototype.copy=function(e){return Ke.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.vertexTangents=e.vertexTangents,this},No.prototype=Object.create(Ao.prototype),No.prototype.constructor=No,No.prototype.isMeshPhysicalMaterial=!0,No.prototype.copy=function(e){return Ao.prototype.copy.call(this,e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.reflectivity=e.reflectivity,e.sheen?this.sheen=(this.sheen||new Ve).copy(e.sheen):this.sheen=null,this.transparency=e.transparency,this},Ro.prototype=Object.create(Ke.prototype),Ro.prototype.constructor=Ro,Ro.prototype.isMeshPhongMaterial=!0,Ro.prototype.copy=function(e){return Ke.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Io.prototype=Object.create(Ke.prototype),Io.prototype.constructor=Io,Io.prototype.isMeshToonMaterial=!0,Io.prototype.copy=function(e){return Ke.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Lo.prototype=Object.create(Ke.prototype),Lo.prototype.constructor=Lo,Lo.prototype.isMeshNormalMaterial=!0,Lo.prototype.copy=function(e){return Ke.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Do.prototype=Object.create(Ke.prototype),Do.prototype.constructor=Do,Do.prototype.isMeshLambertMaterial=!0,Do.prototype.copy=function(e){return Ke.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Po.prototype=Object.create(Ke.prototype),Po.prototype.constructor=Po,Po.prototype.isMeshMat
2capMaterial=!0,Po.prototype.copy=function(e){return Ke.prototype.copy.call(this,e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},zo.prototype=Object.create(Ga.prototype),zo.prototype.constructor=zo,zo.prototype.isLineDashedMaterial=!0,zo.prototype.copy=function(e){return Ga.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var Fo=Object.freeze({__proto__:null,ShadowMaterial:Co,SpriteMaterial:va,RawShaderMaterial:Mo,ShaderMaterial:Yt,PointsMaterial:ti,MeshPhysicalMaterial:No,MeshStandardMaterial:Ao,MeshPhongMaterial:Ro,MeshToonMaterial:Io,MeshNormalMaterial:Lo,MeshLambertMaterial:Do,MeshDepthMaterial:Qr,MeshDistanceMaterial:$r,MeshBasicMaterial:Ze,MeshMatcapMaterial:Po,LineDashedMaterial:zo,LineBasicMaterial:Ga,Material:Ke}),Bo={arraySlice:function(e,t,n){return Bo.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"===typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,n=new Array(t),r=0;r!==t;++r)n[r]=r;return n.sort((function(t,n){return e[t]-e[n]})),n},sortedArray:function(e,t,n){for(var r=e.length,a=new e.constructor(r),i=0,o=0;o!==r;++i)for(var s=n[i]*t,u=0;u!==t;++u)a[o++]=e[s+u];return a},flattenJSON:function(e,t,n,r){for(var a=1,i=e[0];void 0!==i&&void 0===i[r];)i=e[a++];if(void 0!==i){var o=i[r];if(void 0!==o)if(Array.isArray(o))do{void 0!==(o=i[r])&&(t.push(i.time),n.push.apply(n,o)),i=e[a++]}while(void 0!==i);else if(void 0!==o.toArray)do{void 0!==(o=i[r])&&(t.push(i.time),o.toArray(n,n.length)),i=e[a++]}while(void 0!==i);else do{void 0!==(o=i[r])&&(t.push(i.time),n.push(o)),i=e[a++]}while(void 0!==i)}},subclip:function(e,t,n,r,a){a=a||30;var i=e.clone();i.name=t;for(var o=[],s=0;s<i.tracks.length;++s){for(var u=i.tracks[s],c=u.getValueSize(),l=[],h=[],d=0;d<u.times.length;++d){var f=u.times[d]*a;if(!(f<n||f>=r)){l.push(u.times[d]);for(var p=0;p<c;++p)h.push(u.values[d*c+p])}}0!==l.length&&(u.times=Bo.convertArray(l,u.times.constructor),u.values=Bo.convertArray(h,u.values.constructor),o.push(u))}i.tracks=o;var m=1/0;for(s=0;s<i.tracks.length;++s)m>i.tracks[s].times[0]&&(m=i.tracks[s].times[0]);for(s=0;s<i.tracks.length;++s)i.tracks[s].shift(-1*m);return i.resetDuration(),i},makeClipAdditive:function(e,t,n,r){void 0===t&&(t=0),void 0===n&&(n=e),(void 0===r||r<=0)&&(r=30);for(var a=e.tracks.length,i=t/r,o=0;o<a;++o){var s=n.tracks[o],u=s.ValueTypeName;if("bool"!==u&&"string"!==u){var c=e.tracks.find((function(e){return e.name===s.name&&e.ValueTypeName===u}));if(void 0!==c){var l,h=s.getValueSize(),d=s.times.length-1;if(i<=s.times[0])l=Bo.arraySlice(s.values,0,s.valueSize);else if(i>=s.times[d]){var f=d*h;l=Bo.arraySlice(s.values,f)}else{var p=s.createInterpolant();p.evaluate(i),l=p.resultBuffer}if("quaternion"===u)new k(l[0],l[1],l[2],l[3]).normalize().conjugate().toArray(l);for(var m=c.times.length,v=0;v<m;++v){var g=v*h;if("quaternion"===u)k.multiplyQuaternionsFlat(c.values,g,l,0,c.values,g);else for(var b=0;b<h;++b)c.values[g+b]-=l[b]}}}}return e.blendMode=2501,e}};function Uo(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n}function Wo(e,t,n,r){Uo.call(this,e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Vo(e,t,n,r){Uo.call(this,e,t,n,r)}function Go(e,t,n,r){Uo.call(this,e,t,n,r)}function Ho(e,t,n,r){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Bo.convertArray(t,this.TimeBufferType),this.values=Bo.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}function qo(e,t,n){Ho.call(this,e,t,n)}function Xo(e,t,n,r){Ho.call(this,e,t,n,r)}function Yo(e,t,n,r){Ho.call(this,e,t,n,r)}function Ko(e,t,n,r){Uo.call(this,e,t,n,r)}function Zo(e,t,n,r){Ho.call(this,e,t,n,r)}function Jo(e,t,n,r){Ho.call(this,e,t,n,r)}function Qo(e,t,n,r){Ho.call(this,e,t,n,r)}function $o(e,t,n,r){this.name=e,this.tracks=n,this.duration=void 0!==t?t:-1,this.blendMode=void 0!==r?r:2500,this.uuid=p.generateUUID(),this.duration<0&&this.resetDuration()}function es(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Yo;
vendor: 7,517 bytes, line 2
2case"vector":case"vector2":case"vector3":case"vector4":return Qo;case"color":return Xo;case"quaternion":return Zo;case"bool":case"boolean":return qo;case"string":return Jo}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){var n=[],r=[];Bo.flattenJSON(e.keys,n,r,"value"),e.times=n,e.values=r}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}Object.assign(Uo.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,r=t[n],a=t[n-1];e:{t:{var i;n:{r:if(!(e<r)){for(var o=n+2;;){if(void 0===r){if(e<a)break r;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,a)}if(n===o)break;if(a=r,e<(r=t[++n]))break t}i=t.length;break n}if(e>=a)break e;var s=t[1];e<s&&(n=2,a=s);for(o=n-2;;){if(void 0===a)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(n===o)break;if(r=a,e>=(a=t[--n-1]))break t}i=n,n=0}for(;n<i;){var u=n+i>>>1;e<t[u]?i=u:n=u+1}if(r=t[n],void 0===(a=t[n-1]))return this._cachedIndex=0,this.beforeStart_(0,e,r);if(void 0===r)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,a,e)}this._cachedIndex=n,this.intervalChanged_(n,a,r)}return this.interpolate_(n,a,e,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,a=e*r,i=0;i!==r;++i)t[i]=n[a+i];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(Uo.prototype,{beforeStart_:Uo.prototype.copySampleValue_,afterEnd_:Uo.prototype.copySampleValue_}),Wo.prototype=Object.assign(Object.create(Uo.prototype),{constructor:Wo,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(e,t,n){var r=this.parameterPositions,a=e-2,i=e+1,o=r[a],s=r[i];if(void 0===o)switch(this.getSettings_().endingStart){case 2401:a=e,o=2*t-n;break;case 2402:o=t+r[a=r.length-2]-r[a+1];break;default:a=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:i=e,s=2*n-t;break;case 2402:i=1,s=n+r[1]-r[0];break;default:i=e-1,s=t}var u=.5*(n-t),c=this.valueSize;this._weightPrev=u/(t-o),this._weightNext=u/(s-n),this._offsetPrev=a*c,this._offsetNext=i*c},interpolate_:function(e,t,n,r){for(var a=this.resultBuffer,i=this.sampleValues,o=this.valueSize,s=e*o,u=s-o,c=this._offsetPrev,l=this._offsetNext,h=this._weightPrev,d=this._weightNext,f=(n-t)/(r-t),p=f*f,m=p*f,v=-h*m+2*h*p-h*f,g=(1+h)*m+(-1.5-2*h)*p+(-.5+h)*f+1,b=(-1-d)*m+(1.5+d)*p+.5*f,y=d*m-d*p,x=0;x!==o;++x)a[x]=v*i[c+x]+g*i[u+x]+b*i[s+x]+y*i[l+x];return a}}),Vo.prototype=Object.assign(Object.create(Uo.prototype),{constructor:Vo,interpolate_:function(e,t,n,r){for(var a=this.resultBuffer,i=this.sampleValues,o=this.valueSize,s=e*o,u=s-o,c=(n-t)/(r-t),l=1-c,h=0;h!==o;++h)a[h]=i[u+h]*l+i[s+h]*c;return a}}),Go.prototype=Object.assign(Object.create(Uo.prototype),{constructor:Go,interpolate_:function(e){return this.copySampleValue_(e-1)}}),Object.assign(Ho,{toJSON:function(e){var t,n=e.constructor;if(void 0!==n.toJSON)t=n.toJSON(e);else{t={name:e.name,times:Bo.convertArray(e.times,Array),values:Bo.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t}}),Object.assign(Ho.prototype,{constructor:Ho,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(e){return new Go(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new Vo(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new Wo(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]*=e;return this},trim:function(e,t){for(var n=this.times,r=n.length,a=0,i=r-1;a!==r&&n[a]<e;)++a;for(;-1!==i&&n[i]>t;)--i;if(++i,0!==a||i!==r){a>=i&&(a=(i=Math.max(i,1))-1);var o=this.getValueSize();this.times=Bo.arraySlice(n,a,i),this.values=Bo.arraySlice(this.values,a*o,i*o)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,r=this.values,a=n.length;0===a&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var i=null,o=0;o!==a;o++){var s=n[o];if("number"===typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),e=!1;break}if(null!==i&&i>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,i),e=!1;break}i=s}if(void 0!==r&&Bo.isTypedArray(r)){o=0;for(var u=r.length;o!==u;++o){var c=r[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),e=!1;break}}}return e},optimize:function(){for(var e=Bo.arraySlice(this.times),t=Bo.arraySlice(this.values),n=this.getValueSize(),r=2302===this.getInterpolation(),a=1,i=e.length-1,o=1;o<i;++o){var s=!1,u=e[o];if(u!==e[o+1]&&(1!==o||u!==u[0]))if(r)s=!0;else for(var c=o*n,l=c-n,h=c+n,d=0;d!==n;++d){var f=t[c+d];if(f!==t[l+d]||f!==t[h+d]){s=!0;break}}if(s){if(o!==a){e[a]=e[o];var p=o*n,m=a*n;for(d=0;d!==n;++d)t[m+d]=t[p+d]}++a}}if(i>0){e[a]=e[i];for(p=i*n,m=a*n,d=0;d!==n;++d)t[m+d]=t[p+d];++a}return a!==e.length?(this.times=Bo.arraySlice(e,0,a),this.values=Bo.arraySlice(t,0,a*n)):(this.times=e,this.values=t),this},clone:function(){var e=Bo.arraySlice(this.times,0),t=Bo.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}),qo.prototype=Object.assign(Object.create(Ho.prototype),{constructor:qo,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Xo.prototype=Object.assign(Object.create(Ho.prototype),{constructor:Xo,ValueTypeName:"color"}),Yo.prototype=Object.assign(Object.create(Ho.prototype),{constructor:Yo,ValueTypeName:"number"}),Ko.prototype=Object.assign(Object.create(Uo.prototype),{constructor:Ko,interpolate_:function(e,t,n,r){for(var a=this.resultBuffer,i=this.sampleValues,o=this.valueSize,s=e*o,u=(n-t)/(r-t),c=s+o;s!==c;s+=4)k.slerpFlat(a,0,i,s-o,i,s,u);return a}}),Zo.prototype=Object.assign(Object.create(Ho.prototype),{constructor:Zo,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(e){return new Ko(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),Jo.prototype=Object.assign(Object.create(Ho.prototype),{constructor:Jo,
2ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Qo.prototype=Object.assign(Object.create(Ho.prototype),{constructor:Qo,ValueTypeName:"vector"}),Object.assign($o,{parse:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),a=0,i=n.length;a!==i;++a)t.push(es(n[a]).scale(r));return new $o(e.name,e.duration,t,e.blendMode)},toJSON:function(e){for(var t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode},a=0,i=n.length;a!==i;++a)t.push(Ho.toJSON(n[a]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){for(var a=t.length,i=[],o=0;o<a;o++){var s=[],u=[];s.push((o+a-1)%a,o,(o+1)%a),u.push(0,1,0);var c=Bo.getKeyframeOrder(s);s=Bo.sortedArray(s,1,c),u=Bo.sortedArray(u,1,c),r||0!==s[0]||(s.push(a),u.push(u[0])),i.push(new Yo(".morphTargetInfluences["+t[o].name+"]",s,u).scale(1/n))}return new $o(e,-1,i)},findByName:function(e,t){var n=e;if(!Array.isArray(e)){var r=e;n=r.geometry&&r.geometry.animations||r.animations}for(var a=0;a<n.length;a++)if(n[a].name===t)return n[a];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var r={},a=/^([\w-]*?)([\d]+)$/,i=0,o=e.length;i<o;i++){var s=e[i],u=s.name.match(a);if(u&&u.length>1){var c=r[h=u[1]];c||(r[h]=c=[]),c.push(s)}}var l=[];for(var h in r)l.push($o.CreateFromMorphTargetSequence(h,r[h],t,n));return l},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,r,a){if(0!==n.length){var i=[],o=[];Bo.flattenJSON(n,i,o,r),0!==i.length&&a.push(new e(t,i,o))}},r=[],a=e.name||"default",i=e.length||-1,o=e.fps||30,s=e.blendMode,u=e.hierarchy||[],c=0;c<u.length;c++){var l=u[c].keys;if(l&&0!==l.length)if(l[0].morphTargets){for(var h={},d=0;d<l.length;d++)if(l[d].morphTargets)for(var f=0;f<l[d].morphTargets.length;f++)h[l[d].morphTargets[f]]=-1;for(var p in h){var m=[],v=[];for(f=0;f!==l[d].morphTargets.length;++f){var g=l[d];m.push(g.time),v.push(g.morphTarget===p?1:0)}r.push(new Yo(".morphTargetInfluence["+p+"]",m,v))}i=h.length*(o||1)}else{var b=".bones["+t[c].name+"]";n(Qo,b+".position",l,"pos",r),n(Zo,b+".quaternion",l,"rot",r),n(Qo,b+".scale",l,"scl",r)}}return 0===r.length?null:new $o(a,i,r,s)}}),Object.assign($o.prototype,{resetDuration:function(){for(var e=0,t=0,n=this.tracks.length;t!==n;++t){var r=this.tracks[t];e=Math.max(e,r.times[r.times.length-1])}return this.duration=e,this},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},validate:function(){for(var e=!0,t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this},clone:function(){for(var e=[],t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new $o(this.name,this.duration,e,this.blendMode)}});var ts={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function ns(e,t,n){var r=this,a=!1,i=0,o=0,s=void 0,u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===a&&void 0!==r.onStart&&r.onStart(e,i,o),a=!0},this.itemEnd=function(e){i++,void 0!==r.onProgress&&r.onProgress(e,i,o),i===o&&(a=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return u.push(e,t),this},this.removeHandler=function(e){var t=u.indexOf(e);return-1!==t&&u.splice(t,2),this},this.getHandler=function(e){for(var t=0,n=u.length;t<n;t+=2){var r=u[t],a=u[t+1];if(r.global&&(r.lastIndex=0),r.test(e))return a}return null}}var rs=new ns;function as(e){this.manager=void 0!==e?e:rs,this.crossOrigin="anonymous",this.path="",this.resourcePath="",this.requestHeader={}}Object.assign(as.prototype,{load:function(){},loadAsync:function(e,t){var n=this;return new Promise((function(r,a){n.load(e,r,t,a)}))},parse:function(){},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this},setResourcePath:function(e){return this.resourcePath=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}});var is={};function os(e){as.call(this,e)}function ss(e){as.call(this,e)}function us(e){as.call(this,e)}function cs(e){as.call(this,e)}function ls(e){as.call(this,e)}function hs(e){as.call(this,e)}function ds(e){as.call(this,e)}function fs(){this.type="Curve",this.arcLengthDivisions=200}
vendor: 5,082 bytes, line 2
2function ps(e,t,n,r,a,i,o,s){fs.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=a||0,this.aEndAngle=i||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function ms(e,t,n,r,a,i){ps.call(this,e,t,n,n,r,a,i),this.type="ArcCurve"}function vs(){var e=0,t=0,n=0,r=0;function a(a,i,o,s){e=a,t=o,n=-3*a+3*i-2*o-s,r=2*a-2*i+o+s}return{initCatmullRom:function(e,t,n,r,i){a(t,n,i*(n-e),i*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,i,o,s){var u=(t-e)/i-(n-e)/(i+o)+(n-t)/o,c=(n-t)/o-(r-t)/(o+s)+(r-n)/s;a(t,n,u*=o,c*=o)},calc:function(a){var i=a*a;return e+t*a+n*i+r*(i*a)}}}os.prototype=Object.assign(Object.create(as.prototype),{constructor:os,load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var a=this,i=ts.get(e);if(void 0!==i)return a.manager.itemStart(e),setTimeout((function(){t&&t(i),a.manager.itemEnd(e)}),0),i;if(void 0===is[e]){var o=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(o){var s=o[1],u=!!o[2],c=o[3];c=decodeURIComponent(c),u&&(c=atob(c));try{var l,h=(this.responseType||"").toLowerCase();switch(h){case"arraybuffer":case"blob":for(var d=new Uint8Array(c.length),f=0;f<c.length;f++)d[f]=c.charCodeAt(f);l="blob"===h?new Blob([d.buffer],{type:s}):d.buffer;break;case"document":var p=new DOMParser;l=p.parseFromString(c,s);break;case"json":l=JSON.parse(c);break;default:l=c}setTimeout((function(){t&&t(l),a.manager.itemEnd(e)}),0)}catch(g){setTimeout((function(){r&&r(g),a.manager.itemError(e),a.manager.itemEnd(e)}),0)}}else{is[e]=[],is[e].push({onLoad:t,onProgress:n,onError:r});var m=new XMLHttpRequest;for(var v in m.open("GET",e,!0),m.addEventListener("load",(function(t){var n=this.response,r=is[e];if(delete is[e],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),ts.add(e,n);for(var i=0,o=r.length;i<o;i++){(s=r[i]).onLoad&&s.onLoad(n)}a.manager.itemEnd(e)}else{for(i=0,o=r.length;i<o;i++){var s;(s=r[i]).onError&&s.onError(t)}a.manager.itemError(e),a.manager.itemEnd(e)}}),!1),m.addEventListener("progress",(function(t){for(var n=is[e],r=0,a=n.length;r<a;r++){var i=n[r];i.onProgress&&i.onProgress(t)}}),!1),m.addEventListener("error",(function(t){var n=is[e];delete is[e];for(var r=0,i=n.length;r<i;r++){var o=n[r];o.onError&&o.onError(t)}a.manager.itemError(e),a.manager.itemEnd(e)}),!1),m.addEventListener("abort",(function(t){var n=is[e];delete is[e];for(var r=0,i=n.length;r<i;r++){var o=n[r];o.onError&&o.onError(t)}a.manager.itemError(e),a.manager.itemEnd(e)}),!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(v,this.requestHeader[v]);m.send(null)}return a.manager.itemStart(e),m}is[e].push({onLoad:t,onProgress:n,onError:r})},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this}}),ss.prototype=Object.assign(Object.create(as.prototype),{constructor:ss,load:function(e,t,n,r){var a=this,i=new os(a.manager);i.setPath(a.path),i.load(e,(function(n){try{t(a.parse(JSON.parse(n)))}catch(i){r?r(i):console.error(i),a.manager.itemError(e)}}),n,r)},parse:function(e){for(var t=[],n=0;n<e.length;n++){var r=$o.parse(e[n]);t.push(r)}return t}}),us.prototype=Object.assign(Object.create(as.prototype),{constructor:us,load:function(e,t,n,r){var a=this,i=[],o=new ci;o.image=i;var s=new os(this.manager);function u(u){s.load(e[u],(function(e){var n=a.parse(e,!0);i[u]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(c+=1)&&(1===n.mipmapCount&&(o.minFilter=1006),o.format=n.format,o.needsUpdate=!0,t&&t(o))}),n,r)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(e))for(var c=0,l=0,h=e.length;l<h;++l)u(l);else s.load(e,(function(e){var n=a.parse(e,!0);if(n.isCubemap)for(var r=n.mipmaps.length/n.mipmapCount,s=0;s<r;s++){i[s]={mipmaps:[]};for(var u=0;u<n.mipmapCount;u++)i[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+u]),i[s].format=n.format,i[s].width=n.width,i[s].height=n.height}else o.image.width=n.width,o.image.height=n.height,o.mipmaps=n.mipmaps;1===n.mipmapCount&&(o.minFilter=1006),o.format=n.format,o.needsUpdate=!0,t&&t(o)}),n,r);return o}}),cs.prototype=Object.assign(Object.create(as.prototype),{constructor:cs,load:function(e,t,n,r){var a=this,i=new $t,o=new os(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(e,(function(e){var n=a.parse(e);n&&(void 0!==n.image?i.image=n.image:void 0!==n.data&&(i.image.width=n.width,i.image.height=n.height,i.image.data=n.data),i.wrapS=void 0!==n.wrapS?n.wrapS:1001,i.wrapT=void 0!==n.wrapT?n.wrapT:1001,i.magFilter=void 0!==n.magFilter?n.magFilter:1006,i.minFilter=void 0!==n.minFilter?n.minFilter:1006,i.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(i.format=n.format),void 0!==n.t
vendor: 16,492 bytes, line 2
2ype&&(i.type=n.type),void 0!==n.mipmaps&&(i.mipmaps=n.mipmaps,i.minFilter=1008),1===n.mipmapCount&&(i.minFilter=1006),i.needsUpdate=!0,t&&t(i,n))}),n,r),i}}),ls.prototype=Object.assign(Object.create(as.prototype),{constructor:ls,load:function(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var a=this,i=ts.get(e);if(void 0!==i)return a.manager.itemStart(e),setTimeout((function(){t&&t(i),a.manager.itemEnd(e)}),0),i;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){o.removeEventListener("load",s,!1),o.removeEventListener("error",u,!1),ts.add(e,this),t&&t(this),a.manager.itemEnd(e)}function u(t){o.removeEventListener("load",s,!1),o.removeEventListener("error",u,!1),r&&r(t),a.manager.itemError(e),a.manager.itemEnd(e)}return o.addEventListener("load",s,!1),o.addEventListener("error",u,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),a.manager.itemStart(e),o.src=e,o}}),hs.prototype=Object.assign(Object.create(as.prototype),{constructor:hs,load:function(e,t,n,r){var a=new On,i=new ls(this.manager);i.setCrossOrigin(this.crossOrigin),i.setPath(this.path);var o=0;function s(n){i.load(e[n],(function(e){a.images[n]=e,6===++o&&(a.needsUpdate=!0,t&&t(a))}),void 0,r)}for(var u=0;u<e.length;++u)s(u);return a}}),ds.prototype=Object.assign(Object.create(as.prototype),{constructor:ds,load:function(e,t,n,r){var a=new y,i=new ls(this.manager);return i.setCrossOrigin(this.crossOrigin),i.setPath(this.path),i.load(e,(function(n){a.image=n;var r=e.search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/);a.format=r?1022:1023,a.needsUpdate=!0,void 0!==t&&t(a)}),n,r),a}}),Object.assign(fs.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n,r=[],a=this.getPoint(0),i=0;for(r.push(0),n=1;n<=e;n++)i+=(t=this.getPoint(n/e)).distanceTo(a),r.push(i),a=t;return this.cacheArcLengths=r,r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),a=0,i=r.length;n=t||e*r[i-1];for(var o,s=0,u=i-1;s<=u;)if((o=r[a=Math.floor(s+(u-s)/2)]-n)<0)s=a+1;else{if(!(o>0)){u=a;break}u=a-1}if(r[a=u]===n)return a/(i-1);var c=r[a];return(a+(n-c)/(r[a+1]-c))/(i-1)},getTangent:function(e,t){var n=e-1e-4,r=e+1e-4;n<0&&(n=0),r>1&&(r=1);var a=this.getPoint(n),i=this.getPoint(r),o=t||(a.isVector2?new m:new j);return o.copy(i).sub(a).normalize(),o},getTangentAt:function(e,t){var n=this.getUtoTmapping(e);return this.getTangent(n,t)},computeFrenetFrames:function(e,t){var n,r,a,i=new j,o=[],s=[],u=[],c=new j,l=new I;for(n=0;n<=e;n++)r=n/e,o[n]=this.getTangentAt(r,new j),o[n].normalize();s[0]=new j,u[0]=new j;var h=Number.MAX_VALUE,d=Math.abs(o[0].x),f=Math.abs(o[0].y),m=Math.abs(o[0].z);for(d<=h&&(h=d,i.set(1,0,0)),f<=h&&(h=f,i.set(0,1,0)),m<=h&&i.set(0,0,1),c.crossVectors(o[0],i).normalize(),s[0].crossVectors(o[0],c),u[0].crossVectors(o[0],s[0]),n=1;n<=e;n++)s[n]=s[n-1].clone(),u[n]=u[n-1].clone(),c.crossVectors(o[n-1],o[n]),c.length()>Number.EPSILON&&(c.normalize(),a=Math.acos(p.clamp(o[n-1].dot(o[n]),-1,1)),s[n].applyMatrix4(l.makeRotationAxis(c,a))),u[n].crossVectors(o[n],s[n]);if(!0===t)for(a=Math.acos(p.clamp(s[0].dot(s[e]),-1,1)),a/=e,o[0].dot(c.crossVectors(s[0],s[e]))>0&&(a=-a),n=1;n<=e;n++)s[n].applyMatrix4(l.makeRotationAxis(o[n],a*n)),u[n].crossVectors(o[n],s[n]);return{tangents:o,normals:s,binormals:u}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),ps.prototype=Object.create(fs.prototype),ps.prototype.constructor=ps,ps.prototype.isEllipseCurve=!0,ps.prototype.getPoint=function(e,t){for(var n=t||new m,r=2*Math.PI,a=this.aEndAngle-this.aStartAngle,i=Math.abs(a)<Number.EPSILON;a<0;)a+=r;for(;a>r;)a-=r;a<Number.EPSILON&&(a=i?0:r),!0!==this.aClockwise||i||(a===r?a=-r:a-=r);var o=this.aStartAngle+e*a,s=this.aX+this.xRadius*Math.cos(o),u=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var c=Math.cos(this.aRotation),l=Math.sin(this.aRotation),h=s-this.aX,d=u-this.aY;s=h*c-d*l+this.aX,u=h*l+d*c+this.aY}return n.set(s,u)},ps.prototype.copy=function(e){return fs.prototype.copy.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},ps.prototype.toJSON=function(){var e=fs.prototype.toJSON.call(this);return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e},ps.prototype.fromJSON=function(e){return fs.prototype.fromJSON.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},ms.prototype=Object.create(ps.prototype),ms.prototype.constructor=ms,ms.prototype.isArcCurve=!0;var gs=new j,bs=new vs,ys=new vs,xs=new vs;function ws(e,t,n,r){fs.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=r||.5}function Os(e,t,n,r,a){var i=.5*(r-t),o=.5*(a-n),s=e*e;return(2*n-2*r+i+o)*(e*s)+(-3*n+3*r-2*i-o)*s+i*e+n}function ks(e,t,n,r){return function(e,t){var n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function Ss(e,t,n,r,a){return function(e,t){var n=1-e;return n*n*n*t}(e,t)+function(e,t){var n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,a)}function _s(e,t,n,r){fs.call(this),this.type="CubicBezierCurve",this.v0=e||new m,this.v1=t||new m,this.v2=n||new m,this.v3=r||new m}function js(e,t,n,r){fs.call(this),this.type="CubicBezierCurve3",this.v0=e||new j,this.v1=t||new j,this.v2=n||new j,this.v3=r||new j}function Es(e,t){fs.call(this),this.type="LineCurve",this.v1=e||new m,this.v2=t||new m}function Ts(e,t){fs.call(this),this.type="LineCurve3",this.v1=e||new j,this.v2=t||new j}function Cs(e,t,n){fs.call(this),this.type="QuadraticBezierCurve",this.v0=e||new m,this.v1=t||new m,this.v2=n||new m}function Ms(e,t,n){fs.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new j,this.v1=t||new j,this.v2=n||new j}function As(e){fs.call(this),this.type="SplineCurve",this.points=e||[]}ws.prototype=Object.create(fs.prototype),ws.prototype.constructor=ws,ws.prototype.isCatmullRomCurve3=!0,ws.prototype.getPoint=function(e,t){var n,r,a,i,o=t||new j,s=this.points,u=s.length,c=(u-(this.closed?0:1))*e,l=Math.floor(c),h=c-l;if(this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/u)+1)*u:0===h&&l===u-1&&(l=u-2,h=1),this.closed||l>0?n=s[(l-1)%u]:(gs.subVectors(s[0],s[1]).add(s[0]),n=gs),r=s[l%u],a=s[(l+1)%u],this.closed||l+2<u?i=s[(l+2)%u]:(gs.subVectors(s[u-1],s[u-2]).add(s[u-1]),i=gs),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,f=Math.pow(n.distanceToSquared(r),d),p=Math.pow(r.distanceToSquared(a),d),m=Math.pow(a.distanceToSquared(i),d);p<1e-4&&(p=1),f<1e-4&&(f=p),m<1e-4&&(m=p),bs.initNonuniformCatmullRom(n.x,r.x,a.x,i.x,f,p,m),ys.initNonuniformCatmullRom(n.y,r.y,a.y,i.y,f,p,m),xs.initNonuniformCatmullRom(n.z,r.z,a.z,i.z,f,p,m)}else"catmullrom"===this.curveType&&(bs.initCatmullRom(n.x,r.x,a.x,i.x,this.tension),ys.initCatmullRom(n.y,r.y,a.y,i.y,this.tension),xs.initCatmullRom(n.z,r.z,a.z,i.z,this.tension));return o.set(bs.calc(h),ys.calc(h),xs.calc(h)),o},ws.prototype.copy=function(e){fs.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},ws.prototype.toJSON=function(){var e=fs.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},ws.prototype.fromJSON=function(e){fs.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new j).fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},_s.prototype=Object.create(fs.prototype),_s.prototype.constructor=_s,_s.prototype.isCubicBezierCurve=!0,_s.prototype.getPoint=function(e,t){var n=t||new m,r=this.v0,a=this.v1,i=this.v2,o=this.v3;return n.set(Ss(e,r.x,a.x,i.x,o.x),Ss(e,r.y,a.y,i.y,o.y)),n},_s.prototype.copy=function(e){return fs.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},_s.prototype.toJSON=function(){var e=fs.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},_s.prototype.fromJSON=function(e){return fs.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},js.prototype=Object.create(fs.prototype),js.prototype.constructor=js,js.prototype.isCubicBezierCurve3=!0,js.prototype.getPoint=function(e,t){var n=t||new j,r=this.v0,a=this.v1,i=this.v2,o=this.v3;return n.set(Ss(e,r.x,a.x,i.x,o.x),Ss(e,r.y,a.y,i.y,o.y),Ss(e,r.z,a.z,i.z,o.z)),n},js.prototype.copy=function(e){return fs.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},js.prototype.toJSON=function(){var e=fs.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},js.prototype.fromJSON=function(e){return fs.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},Es.prototype=Object.create(fs.prototype),Es.prototype.constructor=Es,Es.prototype.isLineCurve=!0,Es.prototype.getPoint=function(e,t){var n=t||new m;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Es.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Es.prototype.getTangent=function(e,t){return(t||new m).copy(this.v2).sub(this.v1).normalize()},Es.prototype.copy=function(e){return fs.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Es.prototype.toJSON=function(){var e=fs.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Es.prototype.fromJSON=function(e){return fs.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Ts.prototype=Object.create(fs.prototype),Ts.prototype.constructor=Ts,Ts.prototype.isLineCurve3=!0,Ts.prototype.getPoint=function(e,t){var n=t||new j;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Ts.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Ts.prototype.copy=function(e){return fs.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Ts.prototype.toJSON=function(){var e=fs.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Ts.prototype.fromJSON=function(e){return fs.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Cs.prototype=Object.create(fs.prototype),Cs.prototype.constructor=Cs,Cs.prototype.isQuadraticBezierCurve=!0,Cs.prototype.getPoint=function(e,t){var n=t||new m,r=this.v0,a=this.v1,i=this.v2;return n.set(ks(e,r.x,a.x,i.x),ks(e,r.y,a.y,i.y)),n},Cs.prototype.copy=function(e){return fs.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Cs.prototype.toJSON=function(){var e=fs.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Cs.prototype.fromJSON=function(e){return fs.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Ms.prototype=Object.create(fs.prototype),Ms.prototype.constructor=Ms,Ms.prototype.isQuadraticBezierCurve3=!0,Ms.prototype.getPoint=function(e,t){var n=t||new j,r=this.v0,a=this.v1,i=this.v2;return n.set(ks(e,r.x,a.x,i.x),ks(e,r.y,a.y,i.y),ks(e,r.z,a.z,i.z)),n},Ms.prototype.copy=function(e){return fs.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Ms.prototype.toJSON=function(){var e=fs.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Ms.prototype.fromJSON=function(e){return fs.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},As.prototype=Object.create(fs.prototype),As.prototype.constructor=As,As.prototype.isSplineCurve=!0,As.prototype.getPoint=function(e,t){var n=t||new m,r=this.points,a=(r.length-1)*e,i=Math.floor(a),o=a-i,s=r[0===i?i:i-1],u=r[i],c=r[i>r.length-2?r.length-1:i+1],l=r[i>r.length-3?r.length-1:i+2];return n.set(Os(o,s.x,u.x,c.x,l.x),Os(o,s.y,u.y,c.y,l.y)),n},As.prototype.copy=function(e){fs.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this},As.prototype.toJSON=function(){var e=fs.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e},As.prototype.fromJSON=function(e){fs.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new m).fromArray(r))}return this};var Ns=Object.freeze({__proto__:null,ArcCurve:ms,CatmullRomCurve3:ws,CubicBezierCurve:_s,CubicBezierCurve3:js,EllipseCurve:ps,LineCurve:Es,LineCurve3:Ts,QuadraticBezierCurve:Cs,QuadraticBezierCurve3:Ms,SplineCurve:As});function Rs(){fs.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Is(e){Rs.call(this),this.type="Path",this.currentPoint=new m,e&&this.setFromPoints(e)}function Ls(e){Is.call(this,e),this.uuid=p.generateUUID(),this.type="Shape",this.holes=[]}function Ds(e,t){Q.call(this),this.type="Light",this.color=new Ve(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function Ps(e,t,n){Ds.call(this,e,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(Q.DefaultUp),this.updateMatrix(),this.groundColor=new Ve(t)}function zs(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new m(512,512),this.map=null,this.mapPass=null,this.matrix=new I,this._frustum=new nn,this._frameExtents=new m(1,1),this._viewportCount=1,this._viewports=[new x(0,0,1,1)]}function Fs(){zs.call(this,new Zt(50,1,.5,500))}function Bs(e,t,n,r,a,i){Ds.call(this,e,t),this.type="SpotLight",this.position.copy(Q.DefaultUp),this.updateMatrix(),this.target=new Q,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==a?a:0,this.decay=void 0!==i?i:1,this.shadow=new Fs}function Us(){zs.call(this,new Zt(90,1,.5,500)),this._frameExtents=new m(4,2),this._viewportCount=6,this._viewports=[new x(2,1,1,1),new x(0,1,1,1),new x(3,1,1,1),new x(1,1,1,1),new x(3,0,1,1),new x(1,0,1,1)],this._cubeDirections=[new j(1,0,0),new j(-1,0,0),new j(0,0,1),new j(0,0,-1),new j(0,1,0),new j(0,-1,0)],this._cubeUps=[new j(0,1,0),new j(0,1,0),new j(0,1,0),new j(0,1,0),new j(0,0,1),new j(0,0,-1)]}function Ws(e,t,n,r){Ds.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new Us}
vendor: 7,355 bytes, line 2
2function Vs(e,t,n,r,a,i){Kt.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==e?e:-1,this.right=void 0!==t?t:1,this.top=void 0!==n?n:1,this.bottom=void 0!==r?r:-1,this.near=void 0!==a?a:.1,this.far=void 0!==i?i:2e3,this.updateProjectionMatrix()}function Gs(){zs.call(this,new Vs(-5,5,5,-5,.5,500))}function Hs(e,t){Ds.call(this,e,t),this.type="DirectionalLight",this.position.copy(Q.DefaultUp),this.updateMatrix(),this.target=new Q,this.shadow=new Gs}function qs(e,t){Ds.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function Xs(e,t,n,r){Ds.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}function Ys(){this.coefficients=[];for(var e=0;e<9;e++)this.coefficients.push(new j)}function Ks(e,t){Ds.call(this,void 0,t),this.type="LightProbe",this.sh=void 0!==e?e:new Ys}function Zs(e){as.call(this,e),this.textures={}}Rs.prototype=Object.assign(Object.create(fs.prototype),{constructor:Rs,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Es(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=t){var a=n[r]-t,i=this.curves[r],o=i.getLength(),s=0===o?0:1-a/o;return i.getPointAt(s)}r++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,n=[],r=0,a=this.curves;r<a.length;r++)for(var i=a[r],o=i&&i.isEllipseCurve?2*e:i&&(i.isLineCurve||i.isLineCurve3)?1:i&&i.isSplineCurve?e*i.points.length:e,s=i.getPoints(o),u=0;u<s.length;u++){var c=s[u];t&&t.equals(c)||(n.push(c),t=c)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){fs.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=fs.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var r=this.curves[t];e.curves.push(r.toJSON())}return e},fromJSON:function(e){fs.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push((new Ns[r.type]).fromJSON(r))}return this}}),Is.prototype=Object.assign(Object.create(Rs.prototype),{constructor:Is,setFromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this},moveTo:function(e,t){return this.currentPoint.set(e,t),this},lineTo:function(e,t){var n=new Es(this.currentPoint.clone(),new m(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this},quadraticCurveTo:function(e,t,n,r){var a=new Cs(this.currentPoint.clone(),new m(e,t),new m(n,r));return this.curves.push(a),this.currentPoint.set(n,r),this},bezierCurveTo:function(e,t,n,r,a,i){var o=new _s(this.currentPoint.clone(),new m(e,t),new m(n,r),new m(a,i));return this.curves.push(o),this.currentPoint.set(a,i),this},splineThru:function(e){var t=new As([this.currentPoint.clone()].concat(e));return this.curves.push(t),this.currentPoint.copy(e[e.length-1]),this},arc:function(e,t,n,r,a,i){var o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(e+o,t+s,n,r,a,i),this},absarc:function(e,t,n,r,a,i){return this.absellipse(e,t,n,n,r,a,i),this},ellipse:function(e,t,n,r,a,i,o,s){var u=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+u,t+c,n,r,a,i,o,s),this},absellipse:function(e,t,n,r,a,i,o,s){var u=new ps(e,t,n,r,a,i,o,s);if(this.curves.length>0){var c=u.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(u);var l=u.getPoint(1);return this.currentPoint.copy(l),this},copy:function(e){return Rs.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=Rs.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return Rs.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),Ls.prototype=Object.assign(Object.create(Is.prototype),{constructor:Ls,getPointsHoles:function(e){for(var t=[],n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t},extractPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},copy:function(e){Is.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push(r.clone())}return this},toJSON:function(){var e=Is.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var r=this.holes[t];e.holes.push(r.toJSON())}return e},fromJSON:function(e){Is.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push((new Is).fromJSON(r))}return this}}),Ds.prototype=Object.assign(Object.create(Q.prototype),{constructor:Ds,isLight:!0,copy:function(e){return Q.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=Q.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}),Ps.prototype=Object.assign(Object.create(Ds.prototype),{constructor:Ps,isHemisphereLight:!0,copy:function(e){return Ds.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(zs.prototype,{_projScreenMatrix:new I,_lightPositionWorld:new j,_lookTarget:new j,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(e){var t=this.camera,n=this.matrix,r=this._projScreenMatrix,a=this._lookTarget,i=this._lightPositionWorld;i.setFromMatrixPosition(e.matrixWorld),t.position.copy(i),a.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(a),t.updateMatrixWorld(),r.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(r),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)},getViewport:function(e){return this._viewports[e]},getFrameExtents:function(){return this._frameExtents},copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),1!==this.radius&&(e.radiu
2s=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}),Fs.prototype=Object.assign(Object.create(zs.prototype),{constructor:Fs,isSpotLightShadow:!0,updateMatrices:function(e){var t=this.camera,n=2*p.RAD2DEG*e.angle,r=this.mapSize.width/this.mapSize.height,a=e.distance||t.far;n===t.fov&&r===t.aspect&&a===t.far||(t.fov=n,t.aspect=r,t.far=a,t.updateProjectionMatrix()),zs.prototype.updateMatrices.call(this,e)}}),Bs.prototype=Object.assign(Object.create(Ds.prototype),{constructor:Bs,isSpotLight:!0,copy:function(e){return Ds.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Us.prototype=Object.assign(Object.create(zs.prototype),{constructor:Us,isPointLightShadow:!0,updateMatrices:function(e,t){void 0===t&&(t=0);var n=this.camera,r=this.matrix,a=this._lightPositionWorld,i=this._lookTarget,o=this._projScreenMatrix;a.setFromMatrixPosition(e.matrixWorld),n.position.copy(a),i.copy(n.position),i.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(i),n.updateMatrixWorld(),r.makeTranslation(-a.x,-a.y,-a.z),o.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(o)}}),Ws.prototype=Object.assign(Object.create(Ds.prototype),{constructor:Ws,isPointLight:!0,copy:function(e){return Ds.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),Vs.prototype=Object.assign(Object.create(Kt.prototype),{constructor:Vs,isOrthographicCamera:!0,copy:function(e,t){return Kt.prototype.copy.call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this},setViewOffset:function(e,t,n,r,a,i){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=a,this.view.height=i,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,a=n-e,i=n+e,o=r+t,s=r-t;if(null!==this.view&&this.view.enabled){var u=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i=(a+=u*this.view.offsetX)+u*this.view.width,s=(o-=c*this.view.offsetY)-c*this.view.height}this.projectionMatrix.makeOrthographic(a,i,o,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=Q.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}),Gs.prototype=Object.assign(Object.create(zs.prototype),{constructor:Gs,isDirectionalLightShadow:!0,updateMatrices:function(e){zs.prototype.updateMatrices.call(this,e)}}),Hs.prototype=Object.assign(Object.create(Ds.prototype),{constructor:Hs,isDirectionalLight:!0,copy:function(e){return Ds.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),qs.prototype=Object.assign(Object.create(Ds.prototype),{constructor:qs,isAmbientLight:!0}),Xs.prototype=Object.assign(Object.create(Ds.prototype),{constructor:Xs,isRectAreaLight:!0,copy:function(e){return Ds.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=Ds.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}),Object.assign(Ys.prototype,{isSphericalHarmonics3:!0,set:function(e){for(var t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this},zero:function(){for(var e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this},getAt:function(e,t){var n=e.x,r=e.y,a=e.z,i=this.coefficients;return t.copy(i[0]).multiplyScalar(.282095),t.addScaledVector(i[1],.488603*r),t.addScaledVector(i[2],.488603*a),t.addScaledVector(i[3],.488603*n),t.addScaledVector(i[4],n*r*1.092548),t.addScaledVector(i[5],r*a*1.092548),t.addScaledVector(i[6],.315392*(3*a*a-1)),t.addScaledVector(i[7],n*a*1.092548),t.addScaledVector(i[8],.546274*(n*n-r*r)),t},getIrradianceAt:function(e,t){var n=e.x,r=e.y,a=e.z,i=this.coefficients;return t.copy(i[0]).multiplyScalar(.886227),t.addScaledVector(i[1],1.023328*r),t.addScaledVector(i[2],1.023328*a),t.addScaledVector(i[3],1.023328*n),t.addScaledVector(i[4],.858086*n*r),t.addScaledVector(i[5],.858086*r*a),t.addScaledVector(i[6],.743125*a*a-.247708),t.addScaledVector(i[7],.858086*n*a
2),t.addScaledVector(i[8],.429043*(n*n-r*r)),t},add:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this},addScaledSH:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this},scale:function(e){for(var t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this},lerp:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this},equals:function(e){for(var t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0},copy:function(e){return this.set(e.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(e,t){void 0===t&&(t=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}}),Object.assign(Ys,{getBasisAt:function(e,t){var n=e.x,r=e.y,a=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*a,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*a,t[6]=.315392*(3*a*a-1),t[7]=1.092548*n*a,t[8]=.546274*(n*n-r*r)}}),Ks.prototype=Object.assign(Object.create(Ds.prototype),{constructor:Ks,isLightProbe:!0,copy:function(e){return Ds.prototype.copy.call(this,e),this.sh.copy(e.sh),this},fromJSON:function(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this},toJSON:function(e){var t=Ds.prototype.toJSON.call(this,e);return t.object.sh=this.sh.toArray(),t}}),Zs.prototype=Object.assign(Object.create(as.prototype),{constructor:Zs,load:function(e,t,n,r){var a=this,i=new os(a.manager);i.setPath(a.path),i.load(e,(function(n){try{t(a.parse(JSON.parse(n)))}catch(i){r?r(i):console.error(i),a.manager.itemError(e)}}),n,r)},parse:function(e){var t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}var r=new Fo[e.type];if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.sheen&&(r.sheen=(new Ve).setHex(e.sheen)),void 0!==e.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&r.specular.setHex(e.specular),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearcoat&&(r.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(r.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(r.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(r.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(r.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(r.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(r.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(r.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(r.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(r.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),1!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.skinning&&(r.skinning=e.skinning),void 0!==e.morphTargets&&(r.morphTargets=e.morphTargets),void 0!==e.morphNormals&&
2(r.morphNormals=e.morphNormals),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.vertexTangents&&(r.vertexTangents=e.vertexTangents),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.toneMapped&&(r.toneMapped=e.toneMapped),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.vertexColors&&("number"===typeof e.vertexColors?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(var a in e.uniforms){var i=e.uniforms[a];switch(r.uniforms[a]={},i.type){case"t":r.uniforms[a].value=n(i.value);break;case"c":r.uniforms[a].value=(new Ve).setHex(i.value);break;case"v2":r.uniforms[a].value=(new m).fromArray(i.value);break;case"v3":r.uniforms[a].value=(new j).fromArray(i.value);break;case"v4":r.uniforms[a].value=(new x).fromArray(i.value);break;case"m3":r.uniforms[a].value=(new v).fromArray(i.value);case"m4":r.uniforms[a].value=(new I).fromArray(i.value);break;default:r.uniforms[a].value=i.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(var o in e.extensions)r.extensions[o]=e.extensions[o];if(void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){var s=e.normalScale;!1===Array.isArray(s)&&(s=[s,s]),r.normalScale=(new m).fromArray(s)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new m).fromArray(e.clearcoatNormalScale)),r},setTextures:function(e){return this.textures=e,this}});var Js=function(e){var t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)};function Qs(){gt.call(this),this.type="InstancedBufferGeometry",this.instanceCount=1/0}function $s(e,t,n,r){"number"===typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),Qe.call(this,e,t,n),this.meshPerAttribute=r||1}function eu(e){as.call(this,e)}Qs.prototype=Object.assign(Object.create(gt.prototype),{constructor:Qs,isInstancedBufferGeometry:!0,copy:function(e){return gt.prototype.copy.call(this,e),this.instanceCount=e.instanceCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e=gt.prototype.toJSON.call(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}),$s.prototype=Object.assign(Object.create(Qe.prototype),{constructor:$s,isInstancedBufferAttribute:!0,copy:function(e){return Qe.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},toJSON:function(){var e=Qe.prototype.toJSON.call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}),eu.prototype=Object.assign(Object.create(as.prototype),{constructor:eu,load:function(e,t,n,r){var a=this,i=new os(a.manager);i.setPath(a.path),i.load(e,(function(n){try{t(a.parse(JSON.parse(n)))}catch(i){r?r(i):console.error(i),a.manager.itemError(e)}}),n,r)},parse:function(e){var t=e.isInstancedBufferGeometry?new Qs:new gt,n=e.data.index;if(void 0!==n){var r=new tu[n.type](n.array);t.setIndex(new Qe(r,1))}var a=e.data.attributes;for(var i in a){var o=a[i],s=(r=new tu[o.type](o.array),new(o.isInstancedBufferAttribute?$s:Qe)(r,o.itemSize,o.normalized));void 0!==o.name&&(s.name=o.name),t.setAttribute(i,s)}var u=e.data.morphAttributes;if(u)for(var i in u){for(var c=u[i],l=[],h=0,d=c.length;h<d;h++){o=c[h],s=new Qe(r=new tu[o.type](o.array),o.itemSize,o.normalized);void 0!==o.name&&(s.name=o.name),l.push(s)}t.morphAttributes[i]=l}e.data.morphTargetsRelative&&(t.morphTargetsRelative=!0);var f=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==f){h=0;for(var p=f.length;h!==p;++h){var m=f[h];t.addGroup(m.start,m.count,m.materialIndex)}}var v=e.data.boundingSphere;if(void 0!==v){var g=new j;void 0!==v.center&&g.fromArray(v.center),t.boundingSphere=new ve(g,v.radius)}return e.name&&(t.name=e.name),e.userData&&(t.userData=e.userData),t}});var tu={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!==typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function nu(e){as.call(this,e)}nu.prototype=Object.assign(Object.create(as.prototype),{constructor:nu,load:function(e,t,n,r){var a=this,i=""===this.path?Js(e):this.path;this.resourcePath=this.resourcePath||i;var o=new os(a.manager);o.setPath(this.path),o.load(e,(function(n){var i=null;try{i=JSON.parse(n)}catch(s){return void 0!==r&&r(s),void console.error("THREE:ObjectLoader: Can't parse "+e+".",s.message)}var o=i.metadata;void 0!==o&&void 0!==o.type&&"geometry"!==o.type.toLowerCase()?a.parse(i,t):console.error("THREE.ObjectLoader: Can't load "+e)}),n,r)},parse:function(e,t){var n=this.parseShape(e.shapes),r=this.parseGeometries(e.geometries,n),a=this.parseImages(e.images,(function(){void 0!==t&&t(s)})),i=this.parseTextures(e.textures,a),o=this.parseMaterials(e.materials,i),s=this.parseObject(e.object,r,o);return e.animations&&(s.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0!==t&&t(s),s},parseShape:function(e){var t={};if(void 0!==e)for(var n=0,r=e.length;n<r;n++){var a=(new Ls).fromJSON(e[n]);t[a.uuid]=a}return t},parseGeometries:function(e,t){var n={};if(void 0!==e)for(var r=new eu,a=0,i=e.length;a<i;a++){var o,s=e[a];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new To[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new To[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;
vendor: 4,603 bytes, line 2
2case"CircleGeometry":case"CircleBufferGeometry":o=new To[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new To[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new To[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new To[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":o=new To[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new To[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new To[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new To[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":o=new To[s.type]((new Ns[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":o=new To[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new To[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var u=[],c=0,l=s.shapes.length;c<l;c++){var h=t[s.shapes[c]];u.push(h)}o=new To[s.type](u,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(u=[],c=0,l=s.shapes.length;c<l;c++){h=t[s.shapes[c]];u.push(h)}var d=s.options.extrudePath;void 0!==d&&(s.options.extrudePath=(new Ns[d.type]).fromJSON(d)),o=new To[s.type](u,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":o=r.parse(s);break;case"Geometry":console.error('THREE.ObjectLoader: Loading "Geometry" is not supported anymore.');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),!0===o.isBufferGeometry&&void 0!==s.userData&&(o.userData=s.userData),n[s.uuid]=o}return n},parseMaterials:function(e,t){var n={},r={};if(void 0!==e){var a=new Zs;a.setTextures(t);for(var i=0,o=e.length;i<o;i++){var s=e[i];if("MultiMaterial"===s.type){for(var u=[],c=0;c<s.materials.length;c++){var l=s.materials[c];void 0===n[l.uuid]&&(n[l.uuid]=a.parse(l)),u.push(n[l.uuid])}r[s.uuid]=u}else void 0===n[s.uuid]&&(n[s.uuid]=a.parse(s)),r[s.uuid]=n[s.uuid]}}return r},parseAnimations:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],a=$o.parse(r);void 0!==r.uuid&&(a.uuid=r.uuid),t.push(a)}return t},parseImages:function(e,t){var n=this,r={};function a(e){return n.manager.itemStart(e),i.load(e,(function(){n.manager.itemEnd(e)}),void 0,(function(){n.manager.itemError(e),n.manager.itemEnd(e)}))}if(void 0!==e&&e.length>0){var i=new ls(new ns(t));i.setCrossOrigin(this.crossOrigin);for(var o=0,s=e.length;o<s;o++){var u=e[o],c=u.url;if(Array.isArray(c)){r[u.uuid]=[];for(var l=0,h=c.length;l<h;l++){var d=c[l],f=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(d)?d:n.resourcePath+d;r[u.uuid].push(a(f))}}else{f=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(u.url)?u.url:n.resourcePath+u.url;r[u.uuid]=a(f)}}}return r},parseTextures:function(e,t){function n(e,t){return"number"===typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var r={};if(void 0!==e)for(var a=0,i=e.length;a<i;a++){var o,s=e[a];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image),(o=Array.isArray(t[s.image])?new On(t[s.image]):new y(t[s.image])).needsUpdate=!0,o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),void 0!==s.mapping&&(o.mapping=n(s.mapping,au)),void 0!==s.offset&&o.offset.fromArray(s.offset),void 0!==s.repeat&&o.repeat.fromArray(s.repeat),void 0!==s.center&&o.center.fromArray(s.center),void 0!==s.rotation&&(o.rotation=s.rotation),void 0!==s.wrap&&(o.wrapS=n(s.wrap[0],iu),o.wrapT=n(s.wrap[1],iu)),void 0!==s.format&&(o.format=s.format),void 0!==s.type&&(o.type=s.type),void 0!==s.encoding&&(o.encoding=s.encoding),void 0!==s.minFilter&&(
vendor: 7,022 bytes, line 2
2o.minFilter=n(s.minFilter,ou)),void 0!==s.magFilter&&(o.magFilter=n(s.magFilter,ou)),void 0!==s.anisotropy&&(o.anisotropy=s.anisotropy),void 0!==s.flipY&&(o.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(o.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(o.unpackAlignment=s.unpackAlignment),r[s.uuid]=o}return r},parseObject:function(e,t,n){var r;function a(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function i(e){if(void 0!==e){if(Array.isArray(e)){for(var t=[],r=0,a=e.length;r<a;r++){var i=e[r];void 0===n[i]&&console.warn("THREE.ObjectLoader: Undefined material",i),t.push(n[i])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}switch(e.type){case"Scene":r=new $,void 0!==e.background&&Number.isInteger(e.background)&&(r.background=new Ve(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?r.fog=new ha(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(r.fog=new la(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":r=new Zt(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(r.focus=e.focus),void 0!==e.zoom&&(r.zoom=e.zoom),void 0!==e.filmGauge&&(r.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(r.filmOffset=e.filmOffset),void 0!==e.view&&(r.view=Object.assign({},e.view));break;case"OrthographicCamera":r=new Vs(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(r.zoom=e.zoom),void 0!==e.view&&(r.view=Object.assign({},e.view));break;case"AmbientLight":r=new qs(e.color,e.intensity);break;case"DirectionalLight":r=new Hs(e.color,e.intensity);break;case"PointLight":r=new Ws(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":r=new Xs(e.color,e.intensity,e.width,e.height);break;case"SpotLight":r=new Bs(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":r=new Ps(e.color,e.groundColor,e.intensity);break;case"LightProbe":r=(new Ks).fromJSON(e);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":r=new Lt(o=a(e.geometry),s=i(e.material));break;case"InstancedMesh":var o=a(e.geometry),s=i(e.material),u=e.count,c=e.instanceMatrix;(r=new Va(o,s,u)).instanceMatrix=new Qe(new Float32Array(c.array),16);break;case"LOD":r=new Ra;break;case"Line":r=new Za(a(e.geometry),i(e.material),e.mode);break;case"LineLoop":r=new ei(a(e.geometry),i(e.material));break;case"LineSegments":r=new $a(a(e.geometry),i(e.material));break;case"PointCloud":case"Points":r=new oi(a(e.geometry),i(e.material));break;case"Sprite":r=new Ca(i(e.material));break;case"Group":r=new ia;break;default:r=new Q}if(r.uuid=e.uuid,void 0!==e.name&&(r.name=e.name),void 0!==e.matrix?(r.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(r.matrixAutoUpdate=e.matrixAutoUpdate),r.matrixAutoUpdate&&r.matrix.decompose(r.position,r.quaternion,r.scale)):(void 0!==e.position&&r.position.fromArray(e.position),void 0!==e.rotation&&r.rotation.fromArray(e.rotation),void 0!==e.quaternion&&r.quaternion.fromArray(e.quaternion),void 0!==e.scale&&r.scale.fromArray(e.scale)),void 0!==e.castShadow&&(r.castShadow=e.castShadow),void 0!==e.receiveShadow&&(r.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(r.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(r.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&r.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(r.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.frustumCulled&&(r.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(r.renderOrder=e.renderOrder),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.layers&&(r.layers.mask=e.layers),void 0!==e.children)for(var l=e.children,h=0;h<l.length;h++)r.add(this.parseObject(l[h],t,n));if("LOD"===e.type){void 0!==e.autoUpdate&&(r.autoUpdate=e.autoUpdate);for(var d=e.levels,f=0;f<d.length;f++){var p=d[f],m=r.getObjectByProperty("uuid",p.object);void 0!==m&&r.addLevel(m,p.distance)}}return r}});var ru,au={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},iu={RepeatWrapping:1e3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},ou={NearestFilter:1003,NearestMipmapNearestFilter:1004,NearestMipmapLinearFilter:1005,LinearFilter:1006,LinearMipmapNearestFilter:1007,LinearMipmapLinearFilter:1008};function su(e){"undefined"===typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"===typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),as.call(this,e),this.options=void 0}function uu(){this.type="ShapePath",this.color=new Ve,this.subPaths=[],this.currentPath=null}function cu(e){this.type="Font",this.data=e}function lu(e,t,n,r,a){var i=a.glyphs[e]||a.glyphs["?"];if(i){var o,s,u,c,l,h,d,f,p=new uu;if(i.o)for(var m=i._cachedOutline||(i._cachedOutline=i.o.split(" ")),v=0,g=m.length;v<g;){switch(m[v++]){case"m":o=m[v++]*t+n,s=m[v++]*t+r,p.moveTo(o,s);break;case"l":o=m[v++]*t+n,s=m[v++]*t+r,p.lineTo(o,s);break;case"q":u=m[v++]*t+n,c=m[v++]*t+r,l=m[v++]*t+n,h=m[v++]*t+r,p.quadraticCurveTo(l,h,u,c);break;case"b":u=m[v++]*t+n,c=m[v++]*t+r,l=m[v++]*t+n,h=m[v++]*t+r,d=m[v++]*t+n,f=m[v++]*t+r,p.bezierCurveTo(l,h,d,f,u,c)}}return{offsetX:i.ha*t,path:p}}console.error('THREE.Font: character "'+e+'" does not exists in font family '+a.familyName+".")}function hu(e){as.call(this,e)}su.prototype=Object.assign(Object.create(as.prototype),{constructor:su,setOptions:function(e){return this.options=e,this},load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var a=this,i=ts.get(e);if(void 0!==i)return a.manager.itemStart(e),setTimeout((function(){t&&t(i),a.manager.itemEnd(e)}),0),i;fetch(e).then((function(e){return e.blob()})).then((function(e){return void 0===a.options?createImageBitmap(e):createImageBitmap(e,a.options)})).then((function(n){ts.add(e,n),t&&t(n),a.manager.itemEnd(e)})).catch((function(t){r&&r(t),a.manager.itemError(e),a.manager.itemEnd(e)})),a.manager.itemStart(e)}}),Object.assign(uu.prototype,{moveTo:function(e,t){return this.currentPath=new Is,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this},lineTo:function(e,t){return this.currentPath.lineTo(e,t),this},quadraticCurveTo:function(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this},bezierCurveTo:function(e,t,n,r,a,i){return this.currentPath.bezierCurveTo(e,t,n,r,a,i),this},splineThru:function(e){return this.currentPath.splineThru(e),this},toShapes:function(e,t){function n(e){for(var t=[],n=0,r=e.length;n<r;n++){var a=e[n],i=new Ls;i.curves=a.curves,t.push(i)}return t}function r(e,t){for(var n=t.length,r=!1,a=n-1,i=0;i<n;a=i++){var o=t[a],s=t[i],u=s.x-o.x,c=s.y-o.y;if(Math.abs(c)>Number.EPSILON){if(c<0&&(o=t[i],u=-u,s=t[a],c=-c),e.y<o.y||e.y>s.y)continue;
2if(e.y===o.y){if(e.x===o.x)return!0}else{var l=c*(e.x-o.x)-u*(e.y-o.y);if(0===l)return!0;if(l<0)continue;r=!r}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return!0}}return r}var a=no.isClockWise,i=this.subPaths;if(0===i.length)return[];if(!0===t)return n(i);var o,s,u,c=[];if(1===i.length)return s=i[0],(u=new Ls).curves=s.curves,c.push(u),c;var l=!a(i[0].getPoints());l=e?!l:l;var h,d,f=[],p=[],m=[],v=0;p[v]=void 0,m[v]=[];for(var g=0,b=i.length;g<b;g++)o=a(h=(s=i[g]).getPoints()),(o=e?!o:o)?(!l&&p[v]&&v++,p[v]={s:new Ls,p:h},p[v].s.curves=s.curves,l&&v++,m[v]=[]):m[v].push({h:s,p:h[0]});if(!p[0])return n(i);if(p.length>1){for(var y=!1,x=[],w=0,O=p.length;w<O;w++)f[w]=[];for(w=0,O=p.length;w<O;w++)for(var k=m[w],S=0;S<k.length;S++){for(var _=k[S],j=!0,E=0;E<p.length;E++)r(_.p,p[E].p)&&(w!==E&&x.push({froms:w,tos:E,hole:S}),j?(j=!1,f[E].push(_)):y=!0);j&&f[w].push(_)}x.length>0&&(y||(m=f))}g=0;for(var T=p.length;g<T;g++){u=p[g].s,c.push(u);for(var C=0,M=(d=m[g]).length;C<M;C++)u.holes.push(d[C].h)}return c}}),Object.assign(cu.prototype,{isFont:!0,generateShapes:function(e,t){void 0===t&&(t=100);for(var n=[],r=function(e,t,n){for(var r=Array.from?Array.from(e):String(e).split(""),a=t/n.resolution,i=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*a,o=[],s=0,u=0,c=0;c<r.length;c++){var l=r[c];if("\n"===l)s=0,u-=i;else{var h=lu(l,a,s,u,n);s+=h.offsetX,o.push(h.path)}}return o}(e,t,this.data),a=0,i=r.length;a<i;a++)Array.prototype.push.apply(n,r[a].toShapes());return n}}),hu.prototype=Object.assign(Object.create(as.prototype),{constructor:hu,load:function(e,t,n,r){var a=this,i=new os(this.manager);i.setPath(this.path),i.load(e,(function(e){var n;try{n=JSON.parse(e)}catch(i){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}var r=a.parse(n);t&&t(r)}),n,r)},parse:function(e){return new cu(e)}});var du=function(){return void 0===ru&&(ru=new(window.AudioContext||window.webkitAudioContext)),ru};function fu(e){as.call(this,e)}function pu(e,t,n){Ks.call(this,void 0,n);var r=(new Ve).set(e),a=(new Ve).set(t),i=new j(r.r,r.g,r.b),o=new j(a.r,a.g,a.b),s=Math.sqrt(Math.PI),u=s*Math.sqrt(.75);this.sh.coefficients[0].copy(i).add(o).multiplyScalar(s),this.sh.coefficients[1].copy(i).sub(o).multiplyScalar(u)}function mu(e,t){Ks.call(this,void 0,t);var n=(new Ve).set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}fu.prototype=Object.assign(Object.create(as.prototype),{constructor:fu,load:function(e,t,n,r){var a=this,i=new os(a.manager);i.setResponseType("arraybuffer"),i.setPath(a.path),i.load(e,(function(n){try{var i=n.slice(0);du().decodeAudioData(i,(function(e){t(e)}))}catch(o){r?r(o):console.error(o),a.manager.itemError(e)}}),n,r)}}),pu.prototype=Object.assign(Object.create(Ks.prototype),{constructor:pu,isHemisphereLightProbe:!0,copy:function(e){return Ks.prototype.copy.call(this,e),this},toJSON:function(e){return Ks.prototype.toJSON.call(this,e)}}),mu.prototype=Object.assign(Object.create(Ks.prototype),{constructor:mu,isAmbientLightProbe:!0,copy:function(e){return Ks.prototype.copy.call(this,e),this},toJSON:function(e){return Ks.prototype.toJSON.call(this,e)}});var vu=new I,gu=new I;function bu(e){this.autoStart=void 0===e||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}Object.assign(function(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Zt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Zt,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}.prototype,{update:function(e){var t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;var n,r,a=e.projectionMatrix.clone(),i=t.eyeSep/2,o=i*t.near/t.focus,s=t.near*Math.tan(p.DEG2RAD*t.fov*.5)/t.zoom;gu.elements[12]=-i,vu.elements[12]=i,n=-s*t.aspect+o,r=s*t.aspect+o,a.elements[0]=2*t.near/(r-n),a.elements[8]=(r+n)/(r-n),this.cameraL.projectionMatrix.copy(a),n=-s*t.aspect-o,r=s*t.aspect-o,a.elements[0]=2*t.near/(r-n),a.elements[8]=(r+n)/(r-n),this.cameraR.projectionMatrix.copy(a)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(gu),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(vu)}}),Object.assign(bu.prototype,{start:function(){this.startTime=("undefined"===typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=("undefined"===typeof performance?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}});var yu=new j,xu=new k,wu=new j,Ou=new j;function ku(){Q.call(this),this.type="AudioListener",this.context=du(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new bu}function Su(e){Q.call(this),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl
2=!0,this.sourceType="empty",this._startedAt=0,this._progress=0,this.filters=[]}ku.prototype=Object.assign(Object.create(Q.prototype),{constructor:ku,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this},updateMatrixWorld:function(e){Q.prototype.updateMatrixWorld.call(this,e);var t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(yu,xu,wu),Ou.set(0,0,-1).applyQuaternion(xu),t.positionX){var r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(yu.x,r),t.positionY.linearRampToValueAtTime(yu.y,r),t.positionZ.linearRampToValueAtTime(yu.z,r),t.forwardX.linearRampToValueAtTime(Ou.x,r),t.forwardY.linearRampToValueAtTime(Ou.y,r),t.forwardZ.linearRampToValueAtTime(Ou.z,r),t.upX.linearRampToValueAtTime(n.x,r),t.upY.linearRampToValueAtTime(n.y,r),t.upZ.linearRampToValueAtTime(n.z,r)}else t.setPosition(yu.x,yu.y,yu.z),t.setOrientation(Ou.x,Ou.y,Ou.z,n.x,n.y,n.z)}}),Su.prototype=Object.assign(Object.create(Q.prototype),{constructor:Su,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},setMediaElementSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this},setMediaStreamSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(e){if(void 0===e&&(e=0),!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+e;var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(e){return e||(e=[]),!0===this.isPlaying?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},setDetune:function(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},setLoopStart:function(e){return this.loopStart=e,this},setLoopEnd:function(e){return this.loopEnd=e,this},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}});var _u=new j,ju=new k,Eu=new j,Tu=new j;function Cu(e){Su.call(this,e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function Mu(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function Au(e,t,n){var r,a,i;switch(this.binding=e,this.valueSize=n,t){case"quaternion":r=this._slerp,a=this._slerpAdditive,i=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,a=this._select,i=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:r=this._lerp,a=this._lerpAdditive,i=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=a,this._setIdentity=i,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}Cu.prototype=Object.assign(Object.create(Su.prototype),{constructor:Cu,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(e){return this.panner.refDistance=e,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(e){return this.panner.rolloffFactor=e,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(e){return this.panner.distanceModel=e,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(e){return this.panner.maxDistance=e,this},setDirectionalCone:function(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(e){if(Q.prototype.updateMatrixWorld.call(this,e),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(_u,ju,Eu),Tu.set(0,0,1).applyQuaternion(ju);var t=this.panner;if(t.positionX){var n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(_u.x,n),t.positionY.linearRampToValueAtTime(_u.y,n),t.positionZ.linearRampToValueAtTime(_u.z,n),t.orientationX.linearRampToValueAtTime(Tu.x,n),t.orientationY.linearRampToValueAtTime(Tu.y,n),t.orientationZ.linearRampToValueAtTime(Tu.z,n)}else t.setPosition(_u.x,_u.y,_u.z),t.setOrientation(Tu.x,Tu.y,Tu.z)}}}),Object.assign(Mu.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),n=0;n<t.length;n++)e+=t[n];return e/t.length}}),Object.assign(Au.prototype,{accumulate:function(e,t){var n=this.buffer,r=this.valueSize,a=e*r+r,i=this.cumulativeWeight;if(0===i){for(var o=0;o!==r;++o)n[a+o]=n[o];i=t}else{var s=t/(i+=t);
2this._mixBufferRegion(n,a,0,s,r)}this.cumulativeWeight=i},accumulateAdditive:function(e){var t=this.buffer,n=this.valueSize,r=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,n),this.cumulativeWeightAdditive+=e},apply:function(e){var t=this.valueSize,n=this.buffer,r=e*t+t,a=this.cumulativeWeight,i=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,a<1){var s=t*this._origIndex;this._mixBufferRegion(n,r,s,1-a,t)}i>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(var u=t,c=t+t;u!==c;++u)if(n[u]!==n[u+t]){o.setValue(n,r);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(var a=n,i=r;a!==i;++a)t[a]=t[r+a%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_setAdditiveIdentityNumeric:function(){for(var e=this._addIndex*this.valueSize,t=e+this.valueSize,n=e;n<t;n++)this.buffer[n]=0},_setAdditiveIdentityQuaternion:function(){this._setAdditiveIdentityNumeric(),this.buffer[4*this._addIndex+3]=1},_setAdditiveIdentityOther:function(){for(var e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize,n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]},_select:function(e,t,n,r,a){if(r>=.5)for(var i=0;i!==a;++i)e[t+i]=e[n+i]},_slerp:function(e,t,n,r){k.slerpFlat(e,t,e,t,e,n,r)},_slerpAdditive:function(e,t,n,r,a){var i=this._workIndex*a;k.multiplyQuaternionsFlat(e,i,e,t,e,n),k.slerpFlat(e,t,e,t,e,i,r)},_lerp:function(e,t,n,r,a){for(var i=1-r,o=0;o!==a;++o){var s=t+o;e[s]=e[s]*i+e[n+o]*r}},_lerpAdditive:function(e,t,n,r,a){for(var i=0;i!==a;++i){var o=t+i;e[o]=e[o]+e[n+i]*r}}});var Nu=new RegExp("[\\[\\]\\.:\\/]","g"),Ru="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Iu=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Lu=/(WCOD+)?/.source.replace("WCOD",Ru),Du=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Pu=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),zu=new RegExp("^"+Iu+Lu+Du+Pu+"$"),Fu=["material","materials","bones"];function Bu(e,t,n){var r=n||Uu.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function Uu(e,t,n){this.path=t,this.parsedPath=n||Uu.parseTrackName(t),this.node=Uu.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function Wu(e,t,n,r){this._mixer=e,this._clip=t,this._localRoot=n||null,this.blendMode=r||t.blendMode;for(var a=t.tracks,i=a.length,o=new Array(i),s={endingStart:2400,endingEnd:2400},u=0;u!==i;++u){var c=a[u].createInterpolant(null);o[u]=c,c.settings=s}this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=new Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function Vu(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Gu(e){"string"===typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}function Hu(e,t,n){da.call(this,e,t),this.meshPerAttribute=n||1}function qu(e,t,n,r){this.ray=new Se(e,t),this.near=n||0,this.far=r||1/0,this.camera=null,this.layers=new z,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function Xu(e,t){return e.distance-t.distance}function Yu(e,t,n,r){if(e.layers.test(t.layers)&&e.raycast(t,n),!0===r)for(var a=e.children,i=0,o=a.length;i<o;i++)Yu(a[i],t,n,!0)}Object.assign(Bu.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,a=n.length;r!==a;++r)n[r].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(Uu,{Composite:Bu,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new Uu.Composite(e,t,n):new Uu(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(Nu,"")},parseTrackName:function(e){var t=zu.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var a=n.nodeName.substring(r+1);-1!==Fu.indexOf(a)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=a)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n},findNode:function(e,t){if(!t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){var r=function e(n){for(var r=0;r<n.length;r++){var a=n[r];if(a.name===t||a.uuid===t)return a;var i=e(a.children);if(i)return i}return null}(e.children);if(r)return r}return null}}),Object.assign(Uu.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var n=this.resolvedProperty,r=0,a=n.length;r!==a;++r)e[t++]=n[r]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var n=this.resolvedProperty,r=0,a=n.length;r!==a;++r)n[r]=e[t++]},function(e,t){for(var n=this.resolvedProperty,r=0,a=n.length;r!==a;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var n=this.resolvedProperty,r=0,a=n.length;r!==a;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,r=t.propertyName,a=t.propertyIndex;if(e||(e=Uu.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(n){var i=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as no
2de does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var o=0;o<e.length;o++)if(e[o].name===i){i=o;break}break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==i){if(void 0===e[i])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[i]}}var s=e[r];if(void 0!==s){var u=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?u=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(u=this.Versioning.MatrixWorldNeedsUpdate);var c=this.BindingType.Direct;if(void 0!==a){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[a]&&(a=e.morphTargetDictionary[a])}c=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=a}else void 0!==s.fromArray&&void 0!==s.toArray?(c=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(c=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][u]}else{var l=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+l+"."+r+" but it wasn't found.",e)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(Uu.prototype,{_getValue_unbound:Uu.prototype.getValue,_setValue_unbound:Uu.prototype.setValue}),Object.assign(function(){this.uuid=p.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}.prototype,{isAnimationObjectGroup:!0,add:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,a=this._paths,i=this._parsedPaths,o=this._bindings,s=o.length,u=void 0,c=0,l=arguments.length;c!==l;++c){var h=arguments[c],d=h.uuid,f=r[d];if(void 0===f){f=t++,r[d]=f,e.push(h);for(var p=0,m=s;p!==m;++p)o[p].push(new Uu(h,a[p],i[p]))}else if(f<n){u=e[f];var v=--n,g=e[v];r[g.uuid]=f,e[f]=g,r[d]=v,e[v]=h;for(p=0,m=s;p!==m;++p){var b=o[p],y=b[v],x=b[f];b[f]=y,void 0===x&&(x=new Uu(h,a[p],i[p])),b[v]=x}}else e[f]!==u&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var e=this._objects,t=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,a=r.length,i=0,o=arguments.length;i!==o;++i){var s=arguments[i],u=s.uuid,c=n[u];if(void 0!==c&&c>=t){var l=t++,h=e[l];n[h.uuid]=c,e[c]=h,n[u]=l,e[l]=s;for(var d=0,f=a;d!==f;++d){var p=r[d],m=p[l],v=p[c];p[c]=m,p[l]=v}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,a=this._bindings,i=a.length,o=0,s=arguments.length;o!==s;++o){var u=arguments[o],c=u.uuid,l=r[c];if(void 0!==l)if(delete r[c],l<n){var h=--n,d=e[h],f=e[b=--t];r[d.uuid]=l,e[l]=d,r[f.uuid]=h,e[h]=f,e.pop();for(var p=0,m=i;p!==m;++p){var v=(y=a[p])[h],g=y[b];y[l]=v,y[h]=g,y.pop()}}else{var b;r[(f=e[b=--t]).uuid]=l,e[l]=f,e.pop();for(p=0,m=i;p!==m;++p){var y;(y=a[p])[l]=y[b],y.pop()}}}this.nCachedObjects_=n},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,r=n[e],a=this._bindings;if(void 0!==r)return a[r];var i=this._paths,o=this._parsedPaths,s=this._objects,u=s.length,c=this.nCachedObjects_,l=new Array(u);r=a.length,n[e]=r,i.push(e),o.push(t),a.push(l);for(var h=c,d=s.length;h!==d;++h){var f=s[h];l[h]=new Uu(f,e,t)}return l},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var r=this._paths,a=this._parsedPaths,i=this._bindings,o=i.length-1,s=i[o];t[e[o]]=n,i[n]=s,i.pop(),a[n]=a[o],a.pop(),r[n]=r[o],r.pop()}}}),Object.assign(Wu.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight}
2,fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){var r=this._clip.duration,a=e._clip.duration,i=a/r,o=r/a;e.warp(1,i,t),this.warp(o,1,t)}return this},crossFadeTo:function(e,t,n){return e.crossFadeFrom(this,t,n)},stopFading:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._effectiveTimeScale,0,e)},warp:function(e,t,n){var r=this._mixer,a=r.time,i=this._timeScaleInterpolant,o=this.timeScale;null===i&&(i=r._lendControlInterpolant(),this._timeScaleInterpolant=i);var s=i.parameterPositions,u=i.sampleValues;return s[0]=a,s[1]=a+n,u[0]=e/o,u[1]=t/o,this},stopWarping:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,n,r){if(this.enabled){var a=this._startTime;if(null!==a){var i=(e-a)*n;if(i<0||0===n)return;this._startTime=null,t=n*i}t*=this._updateTimeScale(e);var o=this._updateTime(t),s=this._updateWeight(e);if(s>0){var u=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case 2501:for(var l=0,h=u.length;l!==h;++l)u[l].evaluate(o),c[l].accumulateAdditive(s);break;case 2500:default:for(l=0,h=u.length;l!==h;++l)u[l].evaluate(o),c[l].accumulate(r,s)}}}else this._updateWeight(e)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e,n=this._clip.duration,r=this.loop,a=this._loopCount,i=2202===r;if(0===e)return-1===a?t:i&&1===(1&a)?n-t:t;if(2200===r){-1===a&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(t>=n)t=n;else{if(!(t<0)){this.time=t;break e}t=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===a&&(e>=0?(a=0,this._setEndings(!0,0===this.repetitions,i)):this._setEndings(0===this.repetitions,!0,i)),t>=n||t<0){var o=Math.floor(t/n);t-=n*o,a+=Math.abs(o);var s=this.repetitions-a;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=e>0?n:0,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var u=e<0;this._setEndings(u,!u,i)}else this._setEndings(!1,!1,i);this._loopCount=a,this.time=t,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=t;if(i&&1===(1&a))return n-t}return t},_setEndings:function(e,t,n){var r=this._interpolantSettings;n?(r.endingStart=2401,r.endingEnd=2401):(r.endingStart=e?this.zeroSlopeAtStart?2401:2400:2402,r.endingEnd=t?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(e,t,n){var r=this._mixer,a=r.time,i=this._weightInterpolant;null===i&&(i=r._lendControlInterpolant(),this._weightInterpolant=i);var o=i.parameterPositions,s=i.sampleValues;return o[0]=a,s[0]=t,o[1]=a+e,s[1]=n,this}}),Vu.prototype=Object.assign(Object.create(l.prototype),{constructor:Vu,_bindAction:function(e,t){var n=e._localRoot||this._root,r=e._clip.tracks,a=r.length,i=e._propertyBindings,o=e._interpolants,s=n.uuid,u=this._bindingsByRootAndName,c=u[s];void 0===c&&(c={},u[s]=c);for(var l=0;l!==a;++l){var h=r[l],d=h.name,f=c[d];if(void 0!==f)i[l]=f;else{if(void 0!==(f=i[l])){null===f._cacheIndex&&(++f.referenceCount,this._addInactiveBinding(f,s,d));continue}var p=t&&t._propertyBindings[l].binding.parsedPath;++(f=new Au(Uu.create(n,d,p),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(f,s,d),i[l]=f}o[l].resultBuffer=f.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r
vendor: 6,160 bytes, line 2
2=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}for(var a=e._propertyBindings,i=0,o=a.length;i!==o;++i){var s=a[i];0===s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var a=t[n];0===--a.useCount&&(a.restoreOriginalState(),this._takeBackBinding(a))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(e,t,n){var r=this._actions,a=this._actionsByClip,i=a[t];if(void 0===i)i={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,a[t]=i;else{var o=i.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=r.length,r.push(e),i.actionByRoot[n]=e},_removeInactiveAction:function(e){var t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;var a=e._clip.uuid,i=this._actionsByClip,o=i[a],s=o.knownActions,u=s[s.length-1],c=e._byClipCacheIndex;u._byClipCacheIndex=c,s[c]=u,s.pop(),e._byClipCacheIndex=null,delete o.actionByRoot[(e._localRoot||this._root).uuid],0===s.length&&delete i[a],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var a=t[n];0===--a.referenceCount&&this._removeInactiveBinding(a)}},_lendAction:function(e){var t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,a=t[r];e._cacheIndex=r,t[r]=e,a._cacheIndex=n,t[n]=a},_takeBackAction:function(e){var t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,a=t[r];e._cacheIndex=r,t[r]=e,a._cacheIndex=n,t[n]=a},_addInactiveBinding:function(e,t,n){var r=this._bindingsByRootAndName,a=r[t],i=this._bindings;void 0===a&&(a={},r[t]=a),a[n]=e,e._cacheIndex=i.length,i.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,n=e.binding,r=n.rootNode.uuid,a=n.path,i=this._bindingsByRootAndName,o=i[r],s=t[t.length-1],u=e._cacheIndex;s._cacheIndex=u,t[u]=s,t.pop(),delete o[a],0===Object.keys(o).length&&delete i[r]},_lendBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,a=t[r];e._cacheIndex=r,t[r]=e,a._cacheIndex=n,t[n]=a},_takeBackBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,a=t[r];e._cacheIndex=r,t[r]=e,a._cacheIndex=n,t[n]=a},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return void 0===n&&((n=new Vo(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=t,e[t]=n),n},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,a=t[r];e.__cacheIndex=r,t[r]=e,a.__cacheIndex=n,t[n]=a},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t,n){var r=t||this._root,a=r.uuid,i="string"===typeof e?$o.findByName(r,e):e,o=null!==i?i.uuid:e,s=this._actionsByClip[o],u=null;if(void 0===n&&(n=null!==i?i.blendMode:2500),void 0!==s){var c=s.actionByRoot[a];if(void 0!==c&&c.blendMode===n)return c;u=s.knownActions[0],null===i&&(i=u._clip)}if(null===i)return null;var l=new Wu(this,i,t,n);return this._bindAction(l,u),this._addInactiveAction(l,o,a),l},existingAction:function(e,t){var n=t||this._root,r=n.uuid,a="string"===typeof e?$o.findByName(n,e):e,i=a?a.uuid:e,o=this._actionsByClip[i];return void 0!==o&&o.actionByRoot[r]||null},stopAllAction:function(){for(var e=this._actions,t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,r=this.time+=e,a=Math.sign(e),i=this._accuIndex^=1,o=0;o!==n;++o){t[o]._update(r,e,a,i)}var s=this._bindings,u=this._nActiveBindings;for(o=0;o!==u;++o)s[o].apply(i);return this},setTime:function(e){this.time=0;for(var t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,n=e.uuid,r=this._actionsByClip,a=r[n];if(void 0!==a){for(var i=a.knownActions,o=0,s=i.length;o!==s;++o){var u=i[o];this._deactivateAction(u);var c=u._cacheIndex,l=t[t.length-1];u._cacheIndex=null,u._byClipCacheIndex=null,l._cacheIndex=c,t[c]=l,t.pop(),this._removeInactiveBindingsForAction(u)}delete r[n]}},uncacheRoot:function(e){var t=e.uuid,n=this._actionsByClip;for(var r in n){var a=n[r].actionByRoot[t];void 0!==a&&(this._deactivateAction(a),this._removeInactiveAction(a))}var i=this._bindingsByRootAndName[t];if(void 0!==i)for(var o in i){var s=i[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(e,t){var n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),Gu.prototype.clone=function(){return new Gu(void 0===this.value.clone?this.value:this.value.clone())},Hu.prototype=Object.assign(Object.create(da.prototype),{constructor:Hu,isInstancedInterleavedBuffer:!0,copy:function(e){return da.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),Object.assign(qu.prototype,{set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster:
2Unsupported camera type.")},intersectObject:function(e,t,n){var r=n||[];return Yu(e,this,r,t),r.sort(Xu),r},intersectObjects:function(e,t,n){var r=n||[];if(!1===Array.isArray(e))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var a=0,i=e.length;a<i;a++)Yu(e[a],this,r,t);return r.sort(Xu),r}}),Object.assign(function(e,t,n){return this.radius=void 0!==e?e:1,this.phi=void 0!==t?t:0,this.theta=void 0!==n?n:0,this}.prototype,{set:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(p.clamp(t/this.radius,-1,1))),this}}),Object.assign(function(e,t,n){return this.radius=void 0!==e?e:1,this.theta=void 0!==t?t:0,this.y=void 0!==n?n:0,this}.prototype,{set:function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}});var Ku=new m;function Zu(e,t){this.min=void 0!==e?e:new m(1/0,1/0),this.max=void 0!==t?t:new m(-1/0,-1/0)}Object.assign(Zu.prototype,{set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){var n=Ku.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box2: .getCenter() target is now required"),e=new m),this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box2: .getSize() target is now required"),e=new m),this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new m),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new m),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return Ku.copy(e).clamp(this.min,this.max).sub(e).length()},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var Ju=new j,Qu=new j;function $u(e,t){this.start=void 0!==e?e:new j,this.end=void 0!==t?t:new j}function ec(e){Q.call(this),this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUv
vendor: 5,028 bytes, line 2
2s=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}Object.assign($u.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new j),e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new j),e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new j),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(e,t){Ju.subVectors(e,this.start),Qu.subVectors(this.end,this.start);var n=Qu.dot(Qu),r=Qu.dot(Ju)/n;return t&&(r=p.clamp(r,0,1)),r},closestPointToPoint:function(e,t,n){var r=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new j),this.delta(n).multiplyScalar(r).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),ec.prototype=Object.create(Q.prototype),ec.prototype.constructor=ec,ec.prototype.isImmediateRenderObject=!0;var tc=new j;function nc(e,t){Q.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new gt,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],a=0,i=1;a<32;a++,i++){var o=a/32*Math.PI*2,s=i/32*Math.PI*2;r.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}n.setAttribute("position",new ot(r,3));var u=new Ga({fog:!1,toneMapped:!1});this.cone=new $a(n,u),this.add(this.cone),this.update()}nc.prototype=Object.create(Q.prototype),nc.prototype.constructor=nc,nc.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},nc.prototype.update=function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),tc.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(tc),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var rc=new j,ac=new I,ic=new I;function oc(e){for(var t=function e(t){var n=[];t&&t.isBone&&n.push(t);for(var r=0;r<t.children.length;r++)n.push.apply(n,e(t.children[r]));return n}(e),n=new gt,r=[],a=[],i=new Ve(0,0,1),o=new Ve(0,1,0),s=0;s<t.length;s++){var u=t[s];u.parent&&u.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),a.push(i.r,i.g,i.b),a.push(o.r,o.g,o.b))}n.setAttribute("position",new ot(r,3)),n.setAttribute("color",new ot(a,3));var c=new Ga({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});$a.call(this,n,c),this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}function sc(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var r=new fo(t,4,2),a=new Ze({wireframe:!0,fog:!1,toneMapped:!1});Lt.call(this,r,a),this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}oc.prototype=Object.create($a.prototype),oc.prototype.constructor=oc,oc.prototype.isSkeletonHelper=!0,oc.prototype.updateMatrixWorld=function(e){var t=this.bones,n=this.geometry,r=n.getAttribute("position");ic.getInverse(this.root.matrixWorld);for(var a=0,i=0;a<t.length;a++){var o=t[a];o.parent&&o.parent.isBone&&(ac.multiplyMatrices(ic,o.matrixWorld),rc.setFromMatrixPosition(ac),r.setXYZ(i,rc.x,rc.y,rc.z),ac.multiplyMatrices(ic,o.parent.matrixWorld),rc.setFromMatrixPosition(ac),r.setXYZ(i+1,rc.x,rc.y,rc.z),i+=2)}n.getAttribute("position").needsUpdate=!0,Q.prototype.updateMatrixWorld.call(this,e)},sc.prototype=Object.create(Lt.prototype),sc.prototype.constructor=sc,sc.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},sc.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};var uc=new j,cc=new Ve,lc=new Ve;function hc(e,t,n){Q.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new xi(t);r.rotateY(.5*Math.PI),this.material=new Ze({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);var a=r.getAttribute("position"),i=new Float32Array(3*a.count);r.setAttribute("color",new Qe(i,3)),this.add(new Lt(r,this.material)),this.update()}function dc(e,t,n,r){e=e||10,t=t||10,n=new Ve(void 0!==n?n:4473924),r=new Ve(void 0!==r?r:8947848);for(var a=t/2,i=e/t,o=e/2,s=[],u=[],c=0,l=0,h=-o;c<=t;
2c++,h+=i){s.push(-o,0,h,o,0,h),s.push(h,0,-o,h,0,o);var d=c===a?n:r;d.toArray(u,l),l+=3,d.toArray(u,l),l+=3,d.toArray(u,l),l+=3,d.toArray(u,l),l+=3}var f=new gt;f.setAttribute("position",new ot(s,3)),f.setAttribute("color",new ot(u,3));var p=new Ga({vertexColors:!0,toneMapped:!1});$a.call(this,f,p),this.type="GridHelper"}function fc(e,t,n,r,a,i){e=e||10,t=t||16,n=n||8,r=r||64,a=new Ve(void 0!==a?a:4473924),i=new Ve(void 0!==i?i:8947848);var o,s,u,c,l,h,d,f=[],p=[];for(c=0;c<=t;c++)u=c/t*(2*Math.PI),o=Math.sin(u)*e,s=Math.cos(u)*e,f.push(0,0,0),f.push(o,0,s),d=1&c?a:i,p.push(d.r,d.g,d.b),p.push(d.r,d.g,d.b);for(c=0;c<=n;c++)for(d=1&c?a:i,h=e-e/n*c,l=0;l<r;l++)u=l/r*(2*Math.PI),o=Math.sin(u)*h,s=Math.cos(u)*h,f.push(o,0,s),p.push(d.r,d.g,d.b),u=(l+1)/r*(2*Math.PI),o=Math.sin(u)*h,s=Math.cos(u)*h,f.push(o,0,s),p.push(d.r,d.g,d.b);var m=new gt;m.setAttribute("position",new ot(f,3)),m.setAttribute("color",new ot(p,3));var v=new Ga({vertexColors:!0,toneMapped:!1});$a.call(this,m,v),this.type="PolarGridHelper"}hc.prototype=Object.create(Q.prototype),hc.prototype.constructor=hc,hc.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},hc.prototype.update=function(){var e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var t=e.geometry.getAttribute("color");cc.copy(this.light.color),lc.copy(this.light.groundColor);for(var n=0,r=t.count;n<r;n++){var a=n<r/2?cc:lc;t.setXYZ(n,a.r,a.g,a.b)}t.needsUpdate=!0}e.lookAt(uc.setFromMatrixPosition(this.light.matrixWorld).negate())},dc.prototype=Object.assign(Object.create($a.prototype),{constructor:dc,copy:function(e){return $a.prototype.copy.call(this,e),this.geometry.copy(e.geometry),this.material.copy(e.material),this},clone:function(){return(new this.constructor).copy(this)}}),fc.prototype=Object.create($a.prototype),fc.prototype.constructor=fc;var pc=new j,mc=new j,vc=new j;function gc(e,t,n){Q.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1);var r=new gt;r.setAttribute("position",new ot([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var a=new Ga({fog:!1,toneMapped:!1});this.lightPlane=new Za(r,a),this.add(this.lightPlane),(r=new gt).setAttribute("position",new ot([0,0,0,0,0,1],3)),this.targetLine=new Za(r,a),this.add(this.targetLine),this.update()}gc.prototype=Object.create(Q.prototype),gc.prototype.constructor=gc,gc.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},gc.prototype.update=function(){pc.setFromMatrixPosition(this.light.matrixWorld),mc.setFromMatrixPosition(this.light.target.matrixWorld),vc.subVectors(mc,pc),this.lightPlane.lookAt(mc),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(mc),this.targetLine.scale.z=vc.length()};var bc=new j,yc=new Kt;function xc(e){var t=new gt,n=new Ga({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],a=[],i={},o=new Ve(16755200),s=new Ve(16711680),u=new Ve(43775),c=new Ve(16777215),l=new Ve(3355443);function h(e,t,n){d(e,n),d(t,n)}function d(e,t){r.push(0,0,0),a.push(t.r,t.g,t.b),void 0===i[e]&&(i[e]=[]),i[e].push(r.length/3-1)}h("n1","n2",o),h("n2","n4",o),h("n4","n3",o),h("n3","n1",o),h("f1","f2",o),h("f2","f4",o),h("f4","f3",o),h("f3","f1",o),h("n1","f1",o),h("n2","f2",o),h("n3","f3",o),h("n4","f4",o),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",u),h("u2","u3",u),h("u3","u1",u),h("c","t",c),h("p","c",l),h("cn1","cn2",l),h("cn3","cn4",l),h("cf1","cf2",l),h("cf3","cf4",l),t.setAttribute("position",new ot(r,3)),t.setAttribute("color",new ot(a,3)),$a.call(this,t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=i,this.update()}function wc(e,t,n,r,a,i,o){bc.set(a,i,o).unproject(r);var s=t[e];if(void 0!==s)for(var u=n.getAttribute("position"),c=0,l=s.length;c<l;c++)u.setXYZ(s[c],bc.x,bc.y,bc.z)}xc.prototype=Object.create($a.prototype),xc.prototype.constructor=xc,xc.prototype.update=function(){var e=this.geometry,t=this.pointMap;yc.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),wc("c",t,e,yc,0,0,-1),wc("t",t,e,yc,0,0,1),wc("n1",t,e,yc,-1,-1,-1),wc("n2",t,e,yc,1,-1,-1),wc("n3",t,e,yc,-1,1,-1),wc("n4",t,e,yc,1,1,-1),wc("f1",t,e,yc,-1,-1,1),wc("f2",t,e,yc,1,-1,1),wc("f3",t,e,yc,-1,1,1),wc("f4",t,e,yc,1,1,1),wc("u1",t,e,yc,.7,1.1,-1),wc("u2",t,e,yc,-.7,1.1,-1),wc("u3",t,e,yc,0,2,-1),wc("cf1",t,e,yc,-1,0,1),wc("cf2",t,e,yc,1,0,1),wc("cf3",t,e,yc,0,-1,1),wc("cf4",t,e,yc,0,1,1),wc("cn1",t,e,yc,-1,0,-1),wc("cn2",t,e,yc,1,0,-1),wc("cn3",t,e,yc,0,-1,-1),wc("cn4",t,e,yc,0,1,-1),e.getAttribute("position").needsUpdate=!0};var Oc=new fe;function kc(e,t){this.object=e,void 0===t&&(t=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),a=new gt;a.setIndex(new Qe(n,1)),a.setAttribute("position",new Qe(r,3)),$a.call(this,a,new Ga({color:t,toneMapped:!1})),this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}function Sc(e,t){this.type="Box3Helper",this.box=e,t=t||16776960;var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new gt;r.setIndex(new Qe(n,1)),r.setAttribute("position",new ot([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),$a.call(this,r,new Ga({color:t,toneMapped:!1})),this.type="Box3Helper",this.geometry.computeBoundingSphere()}function _c(e,t,n){this.plane=e,this.size=void 0===t?1:t;var r=void 0!==n?n:16776960,a=new gt;a.setAttribute("position",new ot([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),a.computeBoundingSphere(),Za.call(this,a,new Ga({color:r,toneMapped:!1})),this.type="PlaneHelper";var i=new gt;i.setAttribute("position",new ot([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),i.computeBoundingSphere(),this.add(new Lt(i,new Ze({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}kc.prototype=Object.create($a.prototype),kc.prototype.constructor=kc,kc.prototype.update=function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update(
2) has no longer arguments."),void 0!==this.object&&Oc.setFromObject(this.object),!Oc.isEmpty()){var t=Oc.min,n=Oc.max,r=this.geometry.attributes.position,a=r.array;a[0]=n.x,a[1]=n.y,a[2]=n.z,a[3]=t.x,a[4]=n.y,a[5]=n.z,a[6]=t.x,a[7]=t.y,a[8]=n.z,a[9]=n.x,a[10]=t.y,a[11]=n.z,a[12]=n.x,a[13]=n.y,a[14]=t.z,a[15]=t.x,a[16]=n.y,a[17]=t.z,a[18]=t.x,a[19]=t.y,a[20]=t.z,a[21]=n.x,a[22]=t.y,a[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}},kc.prototype.setFromObject=function(e){return this.object=e,this.update(),this},kc.prototype.copy=function(e){return $a.prototype.copy.call(this,e),this.object=e.object,this},kc.prototype.clone=function(){return(new this.constructor).copy(this)},Sc.prototype=Object.create($a.prototype),Sc.prototype.constructor=Sc,Sc.prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),Q.prototype.updateMatrixWorld.call(this,e))},_c.prototype=Object.create(Za.prototype),_c.prototype.constructor=_c,_c.prototype.updateMatrixWorld=function(e){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?1:0,this.lookAt(this.plane.normal),Q.prototype.updateMatrixWorld.call(this,e)};var jc,Ec,Tc=new j;function Cc(e,t,n,r,a,i){Q.call(this),this.type="ArrowHelper",void 0===e&&(e=new j(0,0,1)),void 0===t&&(t=new j(0,0,0)),void 0===n&&(n=1),void 0===r&&(r=16776960),void 0===a&&(a=.2*n),void 0===i&&(i=.2*a),void 0===jc&&((jc=new gt).setAttribute("position",new ot([0,0,0,0,1,0],3)),(Ec=new ko(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new Za(jc,new Ga({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Lt(Ec,new Ze({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,a,i)}function Mc(e){var t=[0,0,0,e=e||1,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new gt;n.setAttribute("position",new ot(t,3)),n.setAttribute("color",new ot([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var r=new Ga({vertexColors:!0,toneMapped:!1});$a.call(this,n,r),this.type="AxesHelper"}Cc.prototype=Object.create(Q.prototype),Cc.prototype.constructor=Cc,Cc.prototype.setDirection=function(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Tc.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Tc,t)}},Cc.prototype.setLength=function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},Cc.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},Cc.prototype.copy=function(e){return Q.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},Cc.prototype.clone=function(){return(new this.constructor).copy(this)},Mc.prototype=Object.create($a.prototype),Mc.prototype.constructor=Mc;var Ac=Math.pow(2,8),Nc=[.125,.215,.35,.446,.526,.582],Rc=5+Nc.length,Ic=(r={},Object(a.a)(r,3e3,0),Object(a.a)(r,3001,1),Object(a.a)(r,3002,2),Object(a.a)(r,3004,3),Object(a.a)(r,3005,4),Object(a.a)(r,3006,5),Object(a.a)(r,3007,6),r),Lc=new Vs,Dc=function(){for(var e=[],t=[],n=[],r=8,a=0;a<Rc;a++){var i=Math.pow(2,r);t.push(i);var o=1/i;a>4?o=Nc[a-8+4-1]:0==a&&(o=0),n.push(o);for(var s=1/(i-1),u=-s/2,c=1+s/2,l=[u,u,c,u,c,c,u,u,c,c,u,c],h=new Float32Array(108),d=new Float32Array(72),f=new Float32Array(36),p=0;p<6;p++){var m=p%3*2/3-1,v=p>2?0:-1,g=[m,v,0,m+2/3,v,0,m+2/3,v+1,0,m,v,0,m+2/3,v+1,0,m,v+1,0];h.set(g,18*p),d.set(l,12*p);var b=[p,p,p,p,p,p];f.set(b,6*p)}var y=new gt;y.setAttribute("position",new Qe(h,3)),y.setAttribute("uv",new Qe(d,2)),y.setAttribute("faceIndex",new Qe(f,1)),e.push(y),r>4&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}(),Pc=Dc._lodPlanes,zc=Dc._sizeLods,Fc=Dc._sigmas,Bc=null,Uc=(1+Math.sqrt(5))/2,Wc=1/Uc,Vc=[new j(1,1,1),new j(-1,1,1),new j(1,1,-1),new j(-1,1,-1),new j(0,Uc,Wc),new j(0,Uc,-Wc),new j(Wc,0,Uc),new j(-Wc,0,Uc),new j(Uc,Wc,0),new j(-Uc,Wc,0)];function Gc(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=function(e){var t=new Float32Array(e),n=new j(0,1,0),r=new Mo({defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:t},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n},inputEncoding:{value:Ic[3e3]},outputEncoding:{value:Ic[3e3]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\n\n// RH coordinate system; PMREM face-indexing convention\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\t} else if (face == 2.0) {\n\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\t} else if (face == 5.0) {\n\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\t}\n\treturn direction;\n}\n\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n".concat("\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t","\n\n#define ENVMAP_TYPE_CUBE_UV\n#include <cube_uv_reflection_fragment>\n\nvec3 getSample(float theta, vec3 axis) {\n\tfloat cosTheta = cos(theta);\n\t// Rodrigues' axis-angle rotation\n\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t+ cross(axis, vOutputDirection) *
2sin(theta)\n\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\treturn bilinearCubeUV(envMap, sampleDirection, mipInt);\n}\n\nvoid main() {\n\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\tif (all(equal(axis, vec3(0.0))))\n\t\taxis = vec3(vOutputDirection.z, 0.0, - vOutputDirection.x);\n\taxis = normalize(axis);\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb += weights[0] * getSample(0.0, axis);\n\tfor (int i = 1; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfloat theta = dTheta * float(i);\n\t\tgl_FragColor.rgb += weights[i] * getSample(-1.0 * theta, axis);\n\t\tgl_FragColor.rgb += weights[i] * getSample(theta, axis);\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t"),blending:0,depthTest:!1,depthWrite:!1});return r.type="SphericalGaussianBlur",r}(20),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}function Hc(e){return void 0!==e&&1009===e.type&&(3e3===e.encoding||3001===e.encoding||3007===e.encoding)}function qc(e){var t=new w(3*Ac,3*Ac,e);return t.texture.mapping=306,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function Xc(e,t,n,r,a){e.viewport.set(t,n,r,a),e.scissor.set(t,n,r,a)}function Yc(){var e=new Mo({uniforms:{envMap:{value:null},texelSize:{value:new m(1,1)},inputEncoding:{value:Ic[3e3]},outputEncoding:{value:Ic[3e3]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\n\n// RH coordinate system; PMREM face-indexing convention\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\t} else if (face == 2.0) {\n\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\t} else if (face == 5.0) {\n\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\t}\n\treturn direction;\n}\n\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform vec2 texelSize;\n\n".concat("\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t","\n\n#include <common>\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tvec3 outputDirection = normalize(vOutputDirection);\n\tvec2 uv = equirectUv( outputDirection );\n\tvec2 f = fract(uv / texelSize - 0.5);\n\tuv -= f * texelSize;\n\tvec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x += texelSize.x;\n\tvec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.y += texelSize.y;\n\tvec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x -= texelSize.x;\n\tvec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tvec3 tm = mix(tl, tr, f.x);\n\tvec3 bm = mix(bl, br, f.x);\n\tgl_FragColor.rgb = mix(tm, bm, f.y);\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t"),blending:0,depthTest:!1,depthWrite:!1});return e.type="EquirectangularToCubeUV",e}function Kc(){var e=new Mo({uniforms:{envMap:{value:null},inputEncoding:{value:Ic[3e3]},outputEncoding:{value:Ic[3e3]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\n\n// RH coordinate system; PMREM face-indexing convention\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\t} else if (face == 2.0) {\n\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\t} else if (face == 5.0) {\n\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\t}\n\treturn direction;\n}\n\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform samplerCube envMap;\n\n".concat("\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t","\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb = envMapTexelToLinear(textureCube(envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ))).rgb;\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t"),blending:0,depthTest:!1,depthWrite:!1});return e.type="CubemapToCubeUV",e}Gc.prototype={constructor:Gc,fromScene:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;Bc=this._renderer.getRenderTarget();var a=this._allocateTargets();return this._sceneToCubeUV(e,n,r,a),t>0&&this._blur(a,0,0,t),this._applyPMREM(a),this._cleanup(a),a},fromEquirectangular:function(e){return e.magFilter=1003,e.minFilter=1003,e.generateMipmaps=!1,this.fromCubemap(e)},fromCubemap:function(e){Bc=this._renderer.getRenderTarget();var t=this._allocateTargets(e);return this._textureToCubeUV(e,t),this._applyPMREM(t),this._cleanup(t),t},compileCubemapShader:function(){null===this._cubemapShader&&(this._cubemapShader=Kc(),this._compileMaterial(this._cubemapShader))},compileEquirectangularShader:function(){null===this._equirectShader&&(this._equirectShader=Yc(),this._compileMaterial(this._equirectShader))},dispose:function(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(var e=0;e<Pc.length;e++)Pc[e].dispose()},_cleanup:function(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(Bc),e.scissorTest=!1,e.setSize(e.width,e.height)},_allocateTargets:function(e){var t={magFilter:1003,minFilter:1003,generateMipmaps:!1,type:1009,format:1023,encoding:Hc(e)?e.encoding:3002,depthBuffer:!1,stencilBuffer:!1},n=qc(t);return n.depthBuffer=!e,this._pingPongRenderTarget=qc(t),n},_compileMaterial:function(e){var t=new Lt(Pc[0],e);this._renderer.compile(t,Lc)},_sceneToCubeUV:function(e,t,n,r){var a=new Zt(90,1,t,n),i=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],s=this._renderer,u=s.outputEncoding,c=s.toneMapping,l=s.toneMappingExposure,h=s.getClearColor(),d=s.getClearAlpha();s.toneMapping=1,s.toneMappingExposure=1,s.outputEncoding=3e3;var f=e.background;if(f&&f.isColor){f.convertSRGBToLinear();var p=Math.max(f.r,f.g,f.b),m=Math.min(Math.max(Math.ceil(Math.log2(p)),-128),127);f=f.multiplyScalar(Math.pow(2,-m));var v=(m+128)/255;s.setClearColor(f,v),e.background=null}for(var g=0;g<6;g++){var b=g%3;0==b?(a.up.set(0,i[g],0),a.lookAt(o[g],0,0)):1==b?(a.up.set(0,0,i[g]),a.lookAt(0,o[g],0)):(a.up.set(0,i[g],0),a.lookAt(0,0,o[g])),Xc(r,b*Ac,g>2?Ac:0,Ac,Ac),s.setRenderTarget(r),s.render(e,a)}s.toneMapping=c,s.toneMappingExposure=l,s.outputEncoding=u,s.setClearColor(h,d)},_textureToCubeUV:function(e,t){var n=this._renderer;e.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=Kc()):null==this._equirectShader&&(this._equirectShader=Yc());var r=e.isCubeTexture?this._cubemapShader:this._equirectShader,a=new Lt(Pc[0],r),i=r.uniforms;i.envMap.value=e,e.isCubeTexture||i.texelSize.value.set(1/e.image.width,1/e.image.height),i.inputEncoding.value=
2Ic[e.encoding],i.outputEncoding.value=Ic[t.texture.encoding],Xc(t,0,0,3*Ac,2*Ac),n.setRenderTarget(t),n.render(a,Lc)},_applyPMREM:function(e){var t=this._renderer,n=t.autoClear;t.autoClear=!1;for(var r=1;r<Rc;r++){var a=Math.sqrt(Fc[r]*Fc[r]-Fc[r-1]*Fc[r-1]),i=Vc[(r-1)%Vc.length];this._blur(e,r-1,r,a,i)}t.autoClear=n},_blur:function(e,t,n,r,a){var i=this._pingPongRenderTarget;this._halfBlur(e,i,t,n,r,"latitudinal",a),this._halfBlur(i,e,n,n,r,"longitudinal",a)},_halfBlur:function(e,t,n,r,a,i,o){var s=this._renderer,u=this._blurMaterial;"latitudinal"!==i&&"longitudinal"!==i&&console.error("blur direction must be either latitudinal or longitudinal!");var c=new Lt(Pc[r],u),l=u.uniforms,h=zc[n]-1,d=isFinite(a)?Math.PI/(2*h):2*Math.PI/39,f=a/d,p=isFinite(a)?1+Math.floor(3*f):20;p>20&&console.warn("sigmaRadians, ".concat(a,", is too large and will clip, as it requested ").concat(p," samples when the maximum is set to ").concat(20));for(var m=[],v=0,g=0;g<20;++g){var b=g/f,y=Math.exp(-b*b/2);m.push(y),0==g?v+=y:g<p&&(v+=2*y)}for(g=0;g<m.length;g++)m[g]=m[g]/v;l.envMap.value=e.texture,l.samples.value=p,l.weights.value=m,l.latitudinal.value="latitudinal"===i,o&&(l.poleAxis.value=o),l.dTheta.value=d,l.mipInt.value=8-n,l.inputEncoding.value=Ic[e.texture.encoding],l.outputEncoding.value=Ic[e.texture.encoding];var x=zc[r];Xc(t,b=3*Math.max(0,Ac-2*x),(0===r?0:2*Ac)+2*x*(r>4?r-8+4:0),3*x,2*x),s.setRenderTarget(t),s.render(c,Lc)}};function Zc(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),ws.call(this,e),this.type="catmullrom"}fs.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(fs.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(Rs.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var t=new Wt,n=0,r=e.length;n<r;n++){var a=e[n];t.vertices.push(new j(a.x,a.y,a.z||0))}return t}}),Object.assign(Is.prototype,{fromPoints:function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),Object.create(ws.prototype),Object.create(ws.prototype),Zc.prototype=Object.create(ws.prototype),Object.assign(Zc.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),dc.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},oc.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(as.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Js(e)}}),as.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(nu.prototype,{setTexturePath:function(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}),Object.assign(Zu.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.get
vendor: 1,835 bytes, line 2
2Size(e)}}),Object.assign(fe.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(ve.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),nn.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},$u.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(p,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),p.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),p.ceilPowerOfTwo(e)}}),Object.assign(v.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3(
2) has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(I.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new j).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3(
2) has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,r,a,i){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,a,i)}}),Te.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},k.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3(
2) has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},Object.assign(Se.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(Fe.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(Fe,{barycoordFromPoint:function(e,t,n,r,a){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Fe.getBarycoord(e,t,n,r,a)},normal:function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Fe.getNormal(e,t,n,r)}}),Object.assign(Ls.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new io(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new bo(this,e)}}),Object.assign(m.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(j.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(x.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Wt.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(e){return console.warn("THREE.Geometry: .applyM
2atrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.assign(Q.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(Q.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(Lt.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(Lt.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(Ra.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Pa.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}
2,set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Ia.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(fs.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),Zt.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(Ds.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(Qe.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),35048===this.usage},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),Object.assign(Qe.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?35048:35044),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(gt.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addAttribute:function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new Qe(arguments[1],arguments[2])))},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyM
2atrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(gt.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(Qs.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(e){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=e}}}),Object.defineProperties(qu.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(e){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=e}}}),Object.defineProperties(da.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),35048===this.usage},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(da.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?35048:35044),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(oo.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(Gu.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(Ke.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")}
vendor: 4,745 bytes, line 2
2,set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Ve}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(Ro.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(Yt.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(ca.prototype,{clearTarget:function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling(
2) has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(ca.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?3001:3e3}}}),Object.defineProperties(ea.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(w.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy
2is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(Su.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new fu).load(e,(function(e){t.setBuffer(e)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),Mu.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Jt.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update(
2)."),this.update(e,t)};g.crossOrigin=void 0,g.loadTexture=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var a=new ds;a.setCrossOrigin(this.crossOrigin);var i=a.load(e,n,void 0,r);return t&&(i.mapping=t),i},g.loadTextureCube=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var a=new hs;a.setCrossOrigin(this.crossOrigin);var i=a.load(e,n,void 0,r);return t&&(i.mapping=t),i},g.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},g.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"117"}}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(8),a=n(10),i=n(7),o=n(36),s=n(4),u=n(9);var c=Object(u.b)({add_:function(e,t){var n=Object(s.a)(e,"a","add"),u=Object(s.a)(t,"b","add"),c=Object(o.makeTypesMatch)(n,u),l=Object(r.a)(c,2);n=l[0],u=l[1];var h={a:n,b:u};return a.a.runKernelFunc((function(e,t){var r=e.add(n,u);return t([n,u]),r}),h,null,i.d)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(8),a=n(10),i=n(7),o=n(36),s=n(4),u=n(9);var c=Object(u.b)({sub_:function(e,t){var n=Object(s.a)(e,"a","sub"),u=Object(s.a)(t,"b","sub"),c=Object(o.makeTypesMatch)(n,u),l=Object(r.a)(c,2);n=l[0],u=l[1];var h={a:n,b:u};return a.a.runKernelFunc((function(e,t){var r=e.subtract(n,u);return t([n,u]),r}),h,null,i.Hc)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(2),a=n(72);function i(e,t){if((Object(r.isTypedArray)(e)&&"string"!==t||Array.isArray(e))&&"complex64"!==t)throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if("string"===t&&Object(r.isTypedArray)(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return Object(a.a)(e,[],[],t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(8),a=n(10),i=n(7),o=n(36),s=n(4),u=n(143),c=n(9);var l=Object(c.b)({div_:function(e,t){var n=Object(s.a)(e,"a","div"),c=Object(s.a)(t,"b","div"),l=Object(o.makeTypesMatch)(n,c),h=Object(r.a)(l,2);if(n=h[0],c=h[1],"int32"===n.dtype&&"int32"===c.dtype)return Object(u.a)(n,c);var d={a:n,b:c};return a.a.runKernelFunc((function(e,t){var r=e.realDivide(n,c);return t([n,c]),r}),d,null,i.S,{})}})},function(e,t,n){"use strict";function r(e,t){for(var n=e.length,r=[],a=0;a<n;a++){var i=n-1-a,o=e[i]||1;(t[t.length-1-a]||1)>1&&1===o&&r.unshift(i)}return r}function a(e,t){for(var n=[],r=0;r<t.length;r++){var a=e[e.length-r-1],i=t.length-r-1,o=t[i];(null==a||1===a&&o>1)&&n.unshift(i)}return n}function i(e,t){for(var n=[],r=Math.max(e.length,t.length),a=0;a<r;a++){var i=e[e.length-a-1];null==i&&(i=1);var o=t[t.length-a-1];if(null==o&&(o=1),1===i)n.unshift(o);else if(1===o)n.unshift(i);else{if(i!==o){var s="Operands could not be broadcast together with shapes "+"".concat(e," and ").concat(t,".");throw Error(s)}n.unshift(i)}}return n}n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return i}))},function(e,t,n){"use strict";n.d(t,"b",(function(){return a.a})),n.d(t,"c",(function(){return i.a})),n.d(t,"d",(function(){return o.a})),n.d(t,"e",(function(){return s.a})),n.d(t,"f",(function(){return u.a})),n.d(t,"h",(function(){return c.a})),n.d(t,"i",(function(){return l.a})),n.d(t,"j",(function(){return h.a})),n.d(t,"k",(function(){return d.a})),n.d(t,"l",(function(){return f.a})),n.d(t,"m",(function(){return p.a})),n.d(t,"n",(function(){return m.a})),n.d(t,"o",(function(){return v.a})),n.d(t,"p",(function(){return g.a})),n.d(t,"q",(function(){return b.a})),n.d(t,"r",(function(){return y.a})),n.d(t,"s",(function(){return T})),n.d(t,"x",(function(){return C.a})),n.d(t,"t",(function(){return M.a}
2)),n.d(t,"u",(function(){return N})),n.d(t,"v",(function(){return R})),n.d(t,"w",(function(){return I})),n.d(t,"z",(function(){return L.a})),n.d(t,"A",(function(){return D.a})),n.d(t,"B",(function(){return P.a})),n.d(t,"C",(function(){return z.a})),n.d(t,"D",(function(){return F.a})),n.d(t,"E",(function(){return B.a})),n.d(t,"F",(function(){return U.a})),n.d(t,"G",(function(){return w.a})),n.d(t,"H",(function(){return W})),n.d(t,"I",(function(){return V})),n.d(t,"J",(function(){return G})),n.d(t,"K",(function(){return H})),n.d(t,"L",(function(){return q.a})),n.d(t,"M",(function(){return X.a})),n.d(t,"N",(function(){return Y.a})),n.d(t,"O",(function(){return K.a})),n.d(t,"P",(function(){return J})),n.d(t,"Q",(function(){return Q.a})),n.d(t,"R",(function(){return $.a})),n.d(t,"T",(function(){return ee.a})),n.d(t,"U",(function(){return te.a})),n.d(t,"V",(function(){return ne.a})),n.d(t,"W",(function(){return se})),n.d(t,"X",(function(){return ue.a})),n.d(t,"Y",(function(){return ce.a})),n.d(t,"Z",(function(){return le.a})),n.d(t,"bb",(function(){return he.a})),n.d(t,"db",(function(){return de.a})),n.d(t,"fb",(function(){return fe.a})),n.d(t,"hb",(function(){return pe.a})),n.d(t,"ib",(function(){return me.a})),n.d(t,"jb",(function(){return ve.a})),n.d(t,"kb",(function(){return ge.a})),n.d(t,"lb",(function(){return ye})),n.d(t,"nb",(function(){return xe.a})),n.d(t,"ob",(function(){return we.a})),n.d(t,"pb",(function(){return Oe.a})),n.d(t,"rb",(function(){return ke.a})),n.d(t,"tb",(function(){return Se.a})),n.d(t,"ub",(function(){return _e.a})),n.d(t,"yb",(function(){return je.a})),n.d(t,"Cb",(function(){return Ee.a})),n.d(t,"Db",(function(){return Te.a})),n.d(t,"Eb",(function(){return Ce.a})),n.d(t,"Fb",(function(){return Me.a})),n.d(t,"Gb",(function(){return Ae.a})),n.d(t,"Hb",(function(){return Ne.a})),n.d(t,"Lb",(function(){return Re.a})),n.d(t,"Mb",(function(){return Ie.a})),n.d(t,"Nb",(function(){return Le.a})),n.d(t,"Ob",(function(){return De.a})),n.d(t,"Pb",(function(){return Pe.a})),n.d(t,"Qb",(function(){return ze.a})),n.d(t,"Rb",(function(){return Fe.a})),n.d(t,"Sb",(function(){return Be.a})),n.d(t,"Tb",(function(){return Ue.a})),n.d(t,"Ub",(function(){return We.a})),n.d(t,"Vb",(function(){return Ve.a})),n.d(t,"Xb",(function(){return O.a})),n.d(t,"Yb",(function(){return Ge.a})),n.d(t,"Zb",(function(){return He.a})),n.d(t,"ac",(function(){return qe.a})),n.d(t,"bc",(function(){return Xe.a})),n.d(t,"cc",(function(){return Ye.a})),n.d(t,"ec",(function(){return Ke.a})),n.d(t,"fc",(function(){return Ze.a})),n.d(t,"gc",(function(){return Je.a})),n.d(t,"ic",(function(){return Qe.a})),n.d(t,"kc",(function(){return nt})),n.d(t,"mc",(function(){return k.a})),n.d(t,"oc",(function(){return rt})),n.d(t,"pc",(function(){return at.a})),n.d(t,"qc",(function(){return it.a})),n.d(t,"sc",(function(){return ot.a})),n.d(t,"uc",(function(){return st.a})),n.d(t,"vc",(function(){return ut.a})),n.d(t,"wc",(function(){return ct.a})),n.d(t,"yc",(function(){return lt})),n.d(t,"zc",(function(){return ht.a})),n.d(t,"Ac",(function(){return dt})),n.d(t,"Bc",(function(){return ft})),n.d(t,"Cc",(function(){return pt})),n.d(t,"Dc",(function(){return mt})),n.d(t,"Ec",(function(){return vt.a})),n.d(t,"Fc",(function(){return gt.a})),n.d(t,"Hc",(function(){return bt.a})),n.d(t,"Ic",(function(){return yt.a})),n.d(t,"Jc",(function(){return xt.a})),n.d(t,"Kc",(function(){return wt})),n.d(t,"Lc",(function(){return kt})),n.d(t,"Mc",(function(){return St})),n.d(t,"Nc",(function(){return _t.a})),n.d(t,"Oc",(function(){return jt.a})),n.d(t,"Pc",(function(){return Et.a})),n.d(t,"Qc",(function(){return Tt.a})),n.d(t,"Rc",(function(){return Ct.a})),n.d(t,"Sc",(function(){return Mt.a})),n.d(t,"Tc",(function(){return oe.a})),n.d(t,"Uc",(function(){return At.a})),n.d(t,"Vc",(function(){return Nt})),n.d(t,"Wc",(function(){return Rt})),n.d(t,"Xc",(function(){return It})),n.d(t,"Yc",(function(){return Lt})),n.d(t,"ad",(function(){return Dt.a})),n.d(t,"bd",(function(){return Pt.a})),n.d(t,"cd",(function(){return zt.a})),n.d(t,"ed",(function(){return Ft.a})),n.d(t,"fd",(function(){return Bt.a})),n.d(t,"gd",(function(){return Ut.a})),n.d(t,"hd",(function(){return _.a})),n.d(t,"id",(function(){return Wt.a})),n.d(t,"kd",(function(){return Vt.a})),n.d(t,"ld",(function(){return Gt.a})),n.d(t,"md",(function(){return j.a})),n.d(t,"nd",(function(){return Ht})),n.d(t,"od",(function(){return qt})),n.d(t,"pd",(function(){return Xt})),n.d(t,"qd",(function(){return Yt})),n.d(t,"rd",(function(){return Kt.a})),n.d(t,"sd",(function(){return Zt.a})),n.d(t,"td",(function(){return Jt.a})),n.d(t,"mb",(function(){return Qt.a})),n.d(t,"xb",(function(){return $t.a})),n.d(t,"Bb",(function(){return en.a})),n.d(t,"Zc",(function(){return tn.a})),n.d(t,"wd",(function(){return nn.a})),n.d(t,"xd",(function(){return rn.a})),n.d(t,"yd",(function(){return et.a})),n.d(t,"zd",(function(){return an.a})),n.d(t,"Bd",(function(){return on.a}
2)),n.d(t,"Cd",(function(){return sn.a})),n.d(t,"Dd",(function(){return un.a})),n.d(t,"Ed",(function(){return cn.a})),n.d(t,"Fd",(function(){return tt.a})),n.d(t,"Hd",(function(){return ln.a})),n.d(t,"Id",(function(){return hn.a})),n.d(t,"Jd",(function(){return E.a})),n.d(t,"Kd",(function(){return dn.a})),n.d(t,"Ld",(function(){return fn.a})),n.d(t,"Md",(function(){return mn})),n.d(t,"Nd",(function(){return vn.a})),n.d(t,"Od",(function(){return gn})),n.d(t,"Pd",(function(){return bn})),n.d(t,"Qd",(function(){return yn})),n.d(t,"Rd",(function(){return be.a})),n.d(t,"Sd",(function(){return xn.a})),n.d(t,"Ud",(function(){return wn.a})),n.d(t,"Vd",(function(){return On.a})),n.d(t,"Wd",(function(){return kn.a})),n.d(t,"Xd",(function(){return Sn})),n.d(t,"Yd",(function(){return _n.a})),n.d(t,"Zd",(function(){return jn.a})),n.d(t,"ae",(function(){return En.a})),n.d(t,"be",(function(){return Tn.a})),n.d(t,"y",(function(){return Rn})),n.d(t,"gb",(function(){return In.a})),n.d(t,"vb",(function(){return In.b})),n.d(t,"wb",(function(){return In.c})),n.d(t,"Ib",(function(){return In.d})),n.d(t,"Jb",(function(){return In.e})),n.d(t,"tc",(function(){return In.f})),n.d(t,"g",(function(){return Ln.a})),n.d(t,"ab",(function(){return Ln.b})),n.d(t,"dc",(function(){return Ln.c})),n.d(t,"hc",(function(){return Ln.d})),n.d(t,"jc",(function(){return Ln.e})),n.d(t,"nc",(function(){return Ln.f})),n.d(t,"Gc",(function(){return Ln.g})),n.d(t,"Ad",(function(){return Ln.h})),n.d(t,"Gd",(function(){return Ln.i})),n.d(t,"Td",(function(){return Dn.a})),n.d(t,"rc",(function(){return Pn.a})),n.d(t,"lc",(function(){return Fn})),n.d(t,"dd",(function(){return Bn.a})),n.d(t,"ud",(function(){return Un.a})),n.d(t,"sb",(function(){return Wn.a})),n.d(t,"cb",(function(){return Gn})),n.d(t,"eb",(function(){return Hn})),n.d(t,"S",(function(){return qn})),n.d(t,"Ab",(function(){return Yn})),n.d(t,"xc",(function(){return S.b})),n.d(t,"a",(function(){return S.a})),n.d(t,"zb",(function(){return qr})),n.d(t,"Kb",(function(){return Xr})),n.d(t,"Wb",(function(){return Yr})),n.d(t,"vd",(function(){return Gr})),n.d(t,"qb",(function(){return r})),n.d(t,"jd",(function(){return Hr}));var r={};n.r(r),n.d(r,"conv2d",(function(){return nr})),n.d(r,"depthwiseConv2d",(function(){return ir})),n.d(r,"matMul",(function(){return or}));var a=n(63),i=n(250),o=n(251),s=n(25),u=n(252),c=n(186),l=n(187),h=n(188),d=n(189),f=n(253),p=n(254),m=n(255),v=n(190),g=n(256),b=n(145),y=n(257),x=n(4),w=n(49),O=n(43),k=n(17),S=n(9),_=n(105),j=n(41),E=n(171);var T=Object(S.b)({basicLSTMCell_:function(e,t,n,r,a,i){var o=Object(x.a)(e,"forgetBias","basicLSTMCell"),u=Object(x.a)(t,"lstmKernel","basicLSTMCell"),c=Object(x.a)(n,"lstmBias","basicLSTMCell"),l=Object(x.a)(r,"data","basicLSTMCell"),h=Object(x.a)(a,"c","basicLSTMCell"),d=Object(x.a)(i,"h","basicLSTMCell"),f=Object(w.a)([l,d],1),p=Object(O.a)(f,u),m=Object(s.a)(p,c),v=m.shape[0],g=m.shape[1]/4,b=[v,g],y=Object(j.a)(m,[0,0],b),S=Object(j.a)(m,[0,g],b),T=Object(j.a)(m,[0,2*g],b),C=Object(j.a)(m,[0,3*g],b),M=Object(s.a)(Object(k.a)(Object(_.a)(y),Object(E.a)(S)),Object(k.a)(h,Object(_.a)(Object(s.a)(o,T))));return[M,Object(k.a)(Object(E.a)(M),Object(_.a)(C))]}}),C=n(119),M=n(104),A=n(2);var N=Object(S.b)({batchNorm2d_:function(e,t,n,r,a,i){var o,s,u=Object(x.a)(e,"x","batchNorm"),c=Object(x.a)(t,"mean","batchNorm"),l=Object(x.a)(n,"variance","batchNorm");return null!=a&&(o=Object(x.a)(a,"scale","batchNorm")),null!=r&&(s=Object(x.a)(r,"offset","batchNorm")),A.assert(2===u.rank,(function(){return"Error in batchNorm2D: x must be rank 2 but got rank "+"".concat(u.rank,".")})),A.assert(2===c.rank||1===c.rank,(function(){return"Error in batchNorm2D: mean must be rank 2 or rank 1 but "+"got rank ".concat(c.rank,".")})),A.assert(2===l.rank||1===l.rank,(function(){return"Error in batchNorm2D: variance must be rank 2 or rank 1 "+"but got rank ".concat(l.rank,".")})),null!=o&&A.assert(2===o.rank||1===o.rank,(function(){return"Error in batchNorm2D: scale must be rank 2 or rank 1 "+"but got rank ".concat(o.rank,".")})),null!=s&&A.assert(2===s.rank||1===s.rank,(function(){return"Error in batchNorm2D: offset must be rank 2 or rank 1 "+"but got rank ".concat(s.rank,".")})),Object(M.a)(u,c,l,s,o,i)}});var R=Object(S.b)({batchNorm3d_:function(e,t,n,r,a,i){var o,s,u=Object(x.a)(e,"x","batchNorm"),c=Object(x.a)(t,"mean","batchNorm"),l=Object(x.a)(n,"variance","batchNorm");return null!=a&&(o=Object(x.a)(a,"scale","batchNorm")),null!=r&&(s=Object(x.a)(r,"offset","batchNorm")),A.assert(3===u.rank,(function(){return"Error in batchNorm3D: x must be rank 3 but got rank "+"".concat(u.rank,".")})),A.assert(3===c.rank||1===c.rank,(function(){return"Error in batchNorm3D: mean must be rank 3 or rank 1 but "+"got rank ".concat(c.rank,".")})),A.assert(3===l.rank||1===l.rank,(function(){return"Error in batchNorm3D: variance must be rank 3 or rank 1 "+"but got rank ".concat(l.rank,".")})),null!=o&&A.assert(3===o.rank||1===o.rank,(function(){return"Error in batchNorm3D: scale must be rank 3 or rank 1 "+"but got rank ".concat(o.rank,".")})),null!=s&&A.assert(3===s.rank||1===s.rank,(function(){return"Error in batchNorm3D: offset must be rank 3 or rank 1 "+"but got rank ".concat(s.rank,".")})),Object(M.a)(u,c,l,s,o,i)}});var I=Object(S.b)({batchNorm4d_:function(e,t,n,r,a,i){var o,s,u=Object(x.a)(e,"x","batchNorm"),c=Object(x.a)(t,"mean","batchNorm"),l=Object(x.a)(n,"variance","batchNorm");return null!=a&&(o=Object(x.a)(a,"scale","batchNorm")),null!=r&&(s=Object(x.a)(r,"offset","batchNorm")),A.assert(4===u.rank,(function(){return"Error in batchNorm4D: x must be rank 4 but got rank "+"".concat(u.rank,".")})),A.assert(4===c.rank||1===c.rank,(function(){return"Error in batchNorm4D: mean must be rank 4 or rank 1 but "+"got rank ".concat(c.rank,".")})),A.assert(4===l.rank||1===l.rank,(function(){return"Error in batchNorm4D: variance must be rank 4 or rank 1 "+"but got rank ".concat(l.rank,".")})),null!=o&&A.assert(4===o.rank||1===o.rank,(function(){return"Error in batchNorm4D: scale must be rank 4 or rank 1 "+"but got rank ".concat(o.rank,".")})),null!=s&&A.assert(4===s.rank||1===s.rank,(function(){return"Error in batchNorm4D: offset must be rank 4 or rank 1 "+"but got rank ".concat(s.rank,".")})),Object(M.a)(u,c,l,s,o,i)}}),L=n(134),D=n(61),P=n(20),z=n(258),F=n(259),B=n(89),U=n(74);var W=Object(S.b)({concat1d_:function(e){return Object(w.a)(e,0)}});var V=Object(S.b)({concat2d_:function(e,t){return Object(w.a)(e,t)}});var G=Object(S.b)({concat3d_:function(e,t){return Object(w.a)(e,t)}});var H=Object(S.b)({concat4d_:function(e,t){return Object(w.a)(e,t)}}),q=n(191),X=n(88),Y=n(192),K=n(260),Z=n(221);var J=Object(S.b)({conv3dTranspose_:function(e,t,n,r,a){var i=Object(x.a)(e,"x","conv3dTranspose"),o=Object(x.a)(t,"filter","conv3dTranspose");return Object(Z.a)(n,i,o,r,a)}}),Q=n(146),$=n(193),ee=n(147),te=n(194),ne=n(99),re=n(19),ae=n(10),ie=n(7),oe=n(14);var se=Object(S.b)({diag_:function(e){var t=Object(x.a)(e,"x","diag"),n={x:t};return ae.a.runKernelFunc((function(n){var r=Object(oe.a)(t,[t.size]),a=n.diag(r),i=[].concat(Object(re.a)(e.shape),Object(re.a)(e.shape));return Object(oe.a)(a,i)}),n,null,ie.O)}}),ue=n(195),ce=n(28),le=n(196),he=n(197),de=n(148),fe=n(100),pe=n(261),me=n(62),ve=n(73),ge=n(262),be=n(106);var ye=Object(S.b)({eye_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"float32";null==t&&(t=e);for(var a=Object(D.a)([e,t],r),i=e<=t?e:t,o=0;o<i;++o)a.set(1,o,o);var s=Object(oe.a)(a.toTensor(),[e,t]);if(null==n)return s;if(1===n.length)return Object(be.a)(Object(ve.a)(s,0),[n[0],1,1]);if(2===n.length)return Object(be.a)(Object(ve.a)(Object(ve.a)(s,0),0),[n[0],n[1],1,1]);if(3===n.length)return Object(be.a)(Object(ve.a)(Object(ve.a)(Object(ve.a)(s,0),0),0),[n[0],n[1],n[2],
21,1]);throw new Error("eye() currently supports only 1D and 2D "+"batchShapes, but received ".concat(n.length,"D."))}}),xe=n(144),we=n(149),Oe=n(143),ke=n(120),Se=n(71),_e=n(77),je=n(121),Ee=n(263),Te=n(264),Ce=n(265),Me=n(200),Ae=n(122),Ne=n(78),Re=n(266),Ie=n(201),Le=n(94),De=n(202),Pe=n(267),ze=n(268),Fe=n(150),Be=n(81),Ue=n(123),We=n(151),Ve=n(204),Ge=n(90),He=n(152),qe=n(269),Xe=n(270),Ye=n(87),Ke=n(113),Ze=n(135),Je=n(124),Qe=n(153),$e=n(35),et=n(40),tt=n(26);var nt=Object(S.b)({moments_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e=Object(x.a)(e,"x","moments");var r=Object(A.parseAxisParam)(t,e.shape),a=Object(Ke.a)(e,r,n),i=a.shape;n||(i=Object($e.e)(a.shape,r));var o=Object(et.a)(Object(tt.a)(Object(P.a)(e,"float32"),Object(oe.a)(a,i))),s=Object(Ke.a)(o,r,n);return{mean:a,variance:s}}});var rt=Object(S.b)({multiRNNCell_:function(e,t,n,r){for(var a=Object(x.a)(t,"data","multiRNNCell"),i=Object(x.b)(n,"c","multiRNNCell"),o=Object(x.b)(r,"h","multiRNNCell"),s=a,u=[],c=0;c<e.length;c++){var l=e[c](s,i[c],o[c]);u.push(l[0]),u.push(l[1]),s=l[1]}for(var h=[],d=[],f=0;f<u.length;f+=2)h.push(u[f]),d.push(u[f+1]);return[h,d]}}),at=n(271),it=n(47),ot=n(125),st=n(136),ut=n(101),ct=n(272);var lt=Object(S.b)({outerProduct_:function(e,t){var n=Object(x.a)(e,"v1","outerProduct"),r=Object(x.a)(t,"v2","outerProduct");A.assert(1===n.rank&&1===r.rank,(function(){return"Error in outerProduct: inputs must be rank 1, but got ranks "+"".concat(n.rank," and ").concat(r.rank,".")}));var a=Object(oe.a)(n,[-1,1]),i=Object(oe.a)(r,[1,-1]);return Object(O.a)(a,i)}}),ht=n(80);var dt=Object(S.b)({pad1d_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(A.assert)(2===t.length,(function(){return"Invalid number of paddings. Must be length of 2."})),Object(ht.a)(e,[t],n)}});var ft=Object(S.b)({pad2d_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(A.assert)(2===t.length&&2===t[0].length&&2===t[1].length,(function(){return"Invalid number of paddings. Must be length of 2 each."})),Object(ht.a)(e,t,n)}});var pt=Object(S.b)({pad3d_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(A.assert)(3===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length,(function(){return"Invalid number of paddings. Must be length of 2 each."})),Object(ht.a)(e,t,n)}});var mt=Object(S.b)({pad4d_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(A.assert)(4===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length&&2===t[3].length,(function(){return"Invalid number of paddings. Must be length of 2 each."})),Object(ht.a)(e,t,n)}}),vt=n(205),gt=n(68),bt=n(154),yt=n(185),xt=n(206);var wt=Object(S.b)({rand_:function(e,t,n){var r=Object(A.sizeFromShape)(e),a=null;if(null==n||"float32"===n)a=new Float32Array(r);else if("int32"===n)a=new Int32Array(r);else{if("bool"!==n)throw new Error("Unknown data type ".concat(n));a=new Uint8Array(r)}for(var i=0;i<r;i++)a[i]=t();return ae.a.makeTensor(a,e,n)}}),Ot=n(130);var kt=Object(S.b)({randomGamma_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"float32",a=arguments.length>4?arguments[4]:void 0;if(null==n&&(n=1),null==r&&(r="float32"),"float32"!==r&&"int32"!==r)throw new Error("Unsupported data type ".concat(r));for(var i=new Ot.b(t,n,r,a),o=Object(D.a)(e,r),s=0;s<o.values.length;s++)o.values[s]=i.nextValue();return o.toTensor()}});var St=Object(S.b)({randomNormal_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;if(null!=r&&"bool"===r)throw new Error("Unsupported data type ".concat(r));for(var i=new Ot.a(t,n,r,!1,a),o=Object(D.a)(e,r),s=0;s<o.values.length;s++)o.values[s]=i.nextValue();return o.toTensor()}}),_t=n(207),jt=n(172),Et=n(114),Tt=n(273),Ct=n(102),Mt=n(155),At=n(69);var Nt=Object(S.b)({reverse1d_:function(e){var t=Object(x.a)(e,"x","reverse");return A.assert(1===t.rank,(function(){return"Error in reverse1D: x must be rank 1 but got rank ".concat(t.rank,".")})),Object(At.a)(t,0)}});var Rt=Object(S.b)({reverse2d_:function(e,t){var n=Object(x.a)(e,"x","reverse");return A.assert(2===n.rank,(function(){return"Error in reverse2D: x must be rank 2 but got rank ".concat(n.rank,".")})),Object(At.a)(n,t)}});var It=Object(S.b)({reverse3d_:function(e,t){var n=Object(x.a)(e,"x","reverse");return A.assert(3===n.rank,(function(){return"Error in reverse3D: x must be rank 3 but got rank ".concat(n.rank,".")})),Object(At.a)(n,t)}});var Lt=Object(S.b)({reverse4d_:function(e,t){var n=Object(x.a)(e,"x","reverse");return A.assert(4===n.rank,(function(){return"Error in reverse4D: x must be rank 4 but got rank ".concat(n.rank,".")})),Object(At.a)(n,t)}}),Dt=n(274),Pt=n(208),zt=n(27),Ft=n(209),Bt=n(210),Ut=n(275),Wt=n(276),Vt=n(211),Gt=n(212);var Ht=Object(S.b)({slice1d_:function(e,t,n){var r=Object(x.a)(e,"x","slice1d");return A.assert(1===r.rank,(function(){return"slice1d expects a rank-1 tensor, but got a rank-".concat(r.rank," tensor")})),Object(j.a)(r,[t],[n])}});var qt=Object(S.b)({slice2d_:function(e,t,n){var r=Object(x.a)(e,"x","slice2d");return A.assert(2===r.rank,(function(){return"slice2d expects a rank-2 tensor, but got a rank-".concat(r.rank," tensor")})),Object(j.a)(r,t,n)}});var Xt=Object(S.b)({slice3d_:function(e,t,n){var r=Object(x.a)(e,"x","slice3d");return A.assert(3===r.rank,(function(){return"slice3d expects a rank-3 tensor, but got a rank-".concat(r.rank," tensor")})),Object(j.a)(r,t,n)}});var Yt=Object(S.b)({slice4d_:function(e,t,n){var r=Object(x.a)(e,"x","slice4d");return A.assert(4===r.rank,(function(){return"slice4d expects a rank-4 tensor, but got a rank-".concat(r.rank," tensor")})),Object(j.a)(r,t,n)}}),Kt=n(277),Zt=n(203),Jt=n(126),Qt=n(156),$t=n(137),en=n(213),tn=n(157),nn=n(96),rn=n(58),an=n(127),on=n(128),sn=n(82),un=n(103),cn=n(278),ln=n(31),hn=n(279),dn=n(84),fn=n(95),pn=n(72);
2function mn(e,t,n){if(Object(A.assertNonNull)(e),null!=t&&2!==t.length)throw new Error("tensor2d() requires shape to have two numbers");var r=Object(x.c)(e,n);if(2!==r.length&&1!==r.length)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return Object(pn.a)(e,t,r,n)}var vn=n(215);function gn(e,t,n){if(Object(A.assertNonNull)(e),null!=t&&4!==t.length)throw new Error("tensor4d() requires shape to have four numbers");var r=Object(x.c)(e,n);if(4!==r.length&&1!==r.length)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return Object(pn.a)(e,t,r,n)}function bn(e,t,n){if(Object(A.assertNonNull)(e),null!=t&&5!==t.length)throw new Error("tensor5d() requires shape to have five numbers");var r=Object(x.c)(e,n);if(5!==r.length&&1!==r.length)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return Object(pn.a)(e,t,r,n)}function yn(e,t,n){if(Object(A.assertNonNull)(e),null!=t&&6!==t.length)throw new Error("tensor6d() requires shape to have six numbers");var r=Object(x.c)(e,n);if(6!==r.length&&1!==r.length)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return t=t||r,Object(pn.a)(e,t,r,n)}var xn=n(216),wn=n(280),On=n(158),kn=n(129);function Sn(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;return ae.a.makeVariable(e,t,n,r)}var _n=n(59),jn=n(217),En=n(79),Tn=n(34),Cn=n(3),Mn=n.n(Cn),An=n(13);function Nn(){return(Nn=Object(An.a)(Mn.a.mark((function e(t,n,r){var a,i,o,s,u,c,l,h,d,f,p,m,v;return Mn.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(a=Object(x.a)(t,"tensor","boolMask"),i=Object(x.a)(n,"mask","boolMask","bool"),o=null==r?0:r,s=i.rank,u=a.shape,A.assert(s>0,(function(){return"mask cannot be scalar"})),A.assertShapesMatch(u.slice(o,o+s),i.shape,"mask's shape must match the first K dimensions of tensor's shape,"),c=1,l=o;l<o+s;l++)c*=u[l];return h=u.slice(0,o).concat([c],u.slice(o+s)),d=Object(oe.a)(a,h),f=Object(oe.a)(i,[-1]),e.next=14,Object(jn.a)(f);case 14:return p=e.sent,m=Object(on.a)(p,[1]),v=Object(ke.a)(d,m,o),t!==a&&a.dispose(),n!==i&&i.dispose(),m.dispose(),d.dispose(),f.dispose(),p.dispose(),e.abrupt("return",v);case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Rn=function(e,t,n){return Nn.apply(this,arguments)},In=n(281),Ln=n(282),Dn=n(45),Pn=n(159),zn=n(36);var Fn=Object(S.b)({movingAverage_:function(e,t,n,r){var a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=Object(x.a)(e,"v","movingAverage"),o=Object(x.a)(t,"x","movingAverage"),u=Object(x.a)(n,"decay","movingAverage");Object(zn.assertTypesMatch)(i,o),A.assert(A.arraysEqual(i.shape,o.shape),(function(){return"Shape mismatch in v and x"}));var c=Object(zt.a)(1),l=Object(tt.a)(c,u),h=Object(k.a)(Object(tt.a)(o,i),l);if(a){A.assert(null!=r,(function(){return"When using zeroDebias: true, step is required."}));var d=Object(x.a)(r,"step","movingAverage");h=Object(ce.a)(h,Object(tt.a)(c,Object(gt.a)(u,d)))}return Object(s.a)(i,h)}}),Bn=n(283),Un=n(296),Wn=n(284),Vn=n(12);var Gn=Object(S.b)({dropout_:function(e,t,n,r){var a=Object(x.a)(e,"x","dropout");if(A.assert("float32"===a.dtype,(function(){return"x has to be a floating point tensor since it's going to be "+"scaled, but got a ".concat(a.dtype," tensor instead.")})),A.assert(t>=0&&t<1,(function(){return"rate must be a float in the range [0, 1), but got ".concat(t,".")})),0===t)return e instanceof Vn.a?a.clone():a;var i=function(e,t){if(null==t)return e.shape.slice();if(A.arraysEqual(e.shape,t))return t;if(e.shape.length===t.length){for(var n=[],r=0;r<e.shape.length;r++)null==t[r]&&null!=e.shape[r]?n.push(e.shape[r]):n.push(t[r]);return n}return t}(a,n),o=1-t,u=Object(ce.a)(Object(we.a)(Object(s.a)(Object(_t.a)(i,0,1,"float32",r),o)),o);return Object(k.a)(a,u)}});function Hn(e){return Math.floor(Math.pow(2,Math.ceil(Math.log(e)/Math.log(2))))}
2function qn(e,t,n){for(var r=1-e%2,a=new Float32Array(e),i=0;i<e;++i){var o=2*Math.PI*i/(e+r-1);a[i]=t-n*Math.cos(o)}return Object(fn.a)(a,"float32")}function Xn(){return(Xn=Object(An.a)(Mn.a.mark((function e(t,n){var r,a,i,o,s,u,c,l,h,d,f,p,m,v,g,b=arguments;return Mn.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=b.length>2&&void 0!==b[2]?b[2]:1,a=Object(x.a)(t,"predictions","inTopK"),i=Object(x.a)(n,"targets","inTopK"),Object(A.assert)(a.rank>1,(function(){return"inTopK() expects the predictions to be of rank 2 or higher, "+"but got ".concat(a.rank)})),Object(A.assert)(a.rank-1===i.rank,(function(){return"predictions rank should be 1 larger than targets rank, but got predictions rank "+"".concat(a.rank," and targets rank ").concat(i.rank)})),Object(A.assertShapesMatch)(a.shape.slice(0,a.shape.length-1),i.shape,"predictions's shape should be align with the targets' shape, except the last dimension."),o=a.shape[a.shape.length-1],Object(A.assert)(r>0&&r<=o,(function(){return"'k' passed to inTopK() must be > 0 && <= the predictions last "+"dimension (".concat(o,"), but got ").concat(r)})),e.next=10,a.data();case 10:return s=e.sent,e.next=13,i.data();case 13:u=e.sent,c=s.length/o,l=o,h=Object(A.getTypedArrayFromDType)("bool",c),d=0;case 17:if(!(d<c)){e.next=35;break}for(f=d*l,p=s.subarray(f,f+l),m=[],v=0;v<p.length;v++)m.push({value:p[v],index:v});m.sort((function(e,t){return t.value-e.value})),h[d]=0,g=0;case 25:if(!(g<r)){e.next=32;break}if(m[g].index!==u[d]){e.next=29;break}return h[d]=1,e.abrupt("break",32);case 29:g++,e.next=25;break;case 32:d++,e.next=17;break;case 35:return t!==a&&a.dispose(),n!==i&&i.dispose(),e.abrupt("return",Object(dn.a)(h,i.shape,"bool"));case 38:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Yn=function(e,t){return Xn.apply(this,arguments)},Kn=n(8),Zn=n(55),Jn=n(29),Qn=n(165),$n=n(163),er=n(33),tr=n(64);var nr=Object(S.b)({fusedConv2d_:function(e){var t=e.x,n=e.filter,r=e.strides,a=e.pad,i=e.dataFormat,o=void 0===i?"NHWC":i,u=e.dilations,c=void 0===u?[1,1]:u,l=e.dimRoundingMode,h=e.bias,d=e.activation,f=void 0===d?"linear":d,p=e.preluActivationWeights;if(f=f||"linear",!1===Object(tr.d)(ae.a.state.gradientDepth,f)){var m=Object(X.a)(t,n,r,a,o,c,l);return null!=h&&(m=Object(s.a)(m,h)),Object(tr.a)(m,f,p)}var v=Object(x.a)(t,"x","conv2d"),g=Object(x.a)(n,"filter","conv2d"),b=v,y=!1;3===v.rank&&(y=!0,b=Object(oe.a)(v,[1,v.shape[0],v.shape[1],v.shape[2]])),A.assert(4===b.rank,(function(){return"Error in fused conv2d: input must be rank 4, but got rank "+"".concat(b.rank,".")})),A.assert(4===g.rank,(function(){return"Error in fused conv2d: filter must be rank 4, but got rank "+"".concat(g.rank,".")})),null!=l&&A.assert(A.isInt(a),(function(){return"Error in fused conv2d: pad must be an integer when using, "+"dimRoundingMode ".concat(l," but got pad ").concat(a,".")})),A.assert(b.shape[3]===g.shape[2],(function(){return"Error in conv2d: depth of input (".concat(b.shape[3],") must match ")+"input depth for filter ".concat(g.shape[2],".")})),A.assert(er.h(r,c),(function(){return"Error in conv2D: Either strides or dilations must be 1. "+"Got strides ".concat(r," and dilations '").concat(c,"'")})),A.assert("NHWC"===o,(function(){return"Error in conv2d: got dataFormat of ".concat(o," but only NHWC is currently supported.")}));var w,O,k=er.a(b.shape,g.shape,r,c,a,l);if(null!=h){w=Object(x.a)(h,"bias","fused conv2d");var S=Object(zn.makeTypesMatch)(w,v),_=Object(Kn.a)(S,1);w=_[0],Jn.a(k.outShape,w.shape)}null!=p&&(O=Object(x.a)(p,"prelu weights","fused conv2d"));var j=function(e,t){var n=Object(Kn.a)(t,4),i=n[0],o=n[1],s=n[2],u=n[3],l=Object(tr.c)(e,s,f);A.assert(er.i(c),(function(){return"Error in gradient of fused conv2D: dilation rates greater than 1 "+"are not yet supported in gradients. Got dilations '".concat(c,"'")}));var h=[Object($n.a)(o.shape,l,i,r,a),Object(Qn.a)(o,l,i.shape,r,a)];if(null!=u){var d=Object(tr.b)(u,l);h.push(d)}return h},E=function(e){return e.fusedConv2d({input:b,filter:g,convInfo:k,bias:w,activation:f,preluActivationWeights:O})},T={x:b,filter:g,bias:w,preluActivationWeights:O},C={strides:r,pad:a,dataFormat:o,dilations:c,dimRoundingMode:l,activation:f};return null==h?Object(Zn.a)((function(e,t,n){var r=ae.a.runKernelFunc(E,T,null,ie.gb,C);return n([t,e,r]),y&&(r=Object(oe.a)(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:j}}))(b,g):Object(Zn.a)((function(e,t,n,r){var a=ae.a.runKernelFunc(E,T,null,ie.gb,C);return r([t,e,a,n]),y&&(a=Object(oe.a)(a,[a.shape[1],a.shape[2],a.shape[3]])),{value:a,gradFunc:j}}))(b,g,w)}}),rr=n(225),ar=n(224);var ir=Object(S.b)({fusedDepthwiseConv2d_:function(e){var t=e.x,n=e.filter,r=e.strides,a=e.pad,i=e.dataFormat,o=void 0===i?"NHWC":i,u=e.dilations,c=void 0===u?[1,1]:u,l=e.dimRoundingMode,h=e.bias,d=e.activation,f=void 0===d?"linear":d,p=e.preluActivationWeights;if(!1===Object(tr.d)(ae.a.state.gradientDepth,f)){var m=Object(ne.a)(t,n,r,a,o,c,l);return null!=h&&(m=Object(s.a)(m,h)),Object(tr.a)(m,f,p)}var v=Object(x.a)(t,"x","depthwiseConv2d"),g=Object(x.a)(n,"filter","depthwiseConv2d"),b=v,y=!1;3===v.rank&&(y=!0,b=Object(oe.a)(v,[1,v.shape[0],v.shape[1],v.shape[2]])),A.assert(4===b.rank,(function(){return"Error in fused depthwiseConv2d: input must be rank 4, but got "+"rank ".concat(b.rank,".")})),A.assert(4===g.rank,(function(){return"Error in fused depthwiseConv2d: filter must be rank 4, "+"but got rank ".concat(g.rank,".")})),A.assert(b.shape[3]===g.shape[2],(function(){return"Error in fused depthwiseConv2d: number of input channels "+"(".concat(b.shape[3],") must match the inChannels dimension in ")+"filter ".concat(g.shape[2],".")})),null==c&&(c=[1,1]),A.assert(er.h(r,c),(function(){return"Error in fused depthwiseConv2d: Either strides or dilations must "+"be 1. Got strides ".concat(r," and dilations '").concat(c,"'")})),null!=l&&A.assert(A.isInt(a),(function(){return"Error in fused depthwiseConv2d: pad must be an integer when "+"using dimRoundingMode ".concat(l," but got pad ").concat(a,".")}));var w,O,k=er.a(b.shape,g.shape,r,c,a,l,!0);if(null!=h){w=Object(x.a)(h,"bias","fused conv2d");var S=Object(zn.makeTypesMatch)(w,v),_=Object(Kn.a)(S,1);w=_[0],Jn.a(k.outShape,w.shape)}null!=p&&(O=Object(x.a)(p,"prelu weights","fused depthwiseConv2d"));var j=function(e,t){A.assert(er.i(c),(function(){return"Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations "+"'".concat(c,"'")}));var n=Object(Kn.a)(t,4),r=n[0],a=n[1],i=n[2],o=n[3],s=Object(tr.c)(e,i,f),u=Object(ar.a)(a.shape,s,r,k),l=Object(rr.a)(a,s,r.shape,k);return null!=o?[u,l,Object(tr.b)(w,s)]:[u,l]},E=function(e){return e.fusedDepthwiseConv2D({input:b,filter:g,convInfo:k,bias:w,activation:f,preluActivationWeights:O})},T={x:b,filter:g,bias:w,preluActivationWeights:O},C={strides:r,pad:a,dataFormat:o,dilations:c,dimRoundingMode:l,activation:f};return null==h?Object(Zn.a)((function(e,t,n){var r=ae.a.runKernelFunc(E,T,null,ie.hb,C);return n([t,e,r]),y&&(r=Object(oe.a)(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:j}}))(b,g):Object(Zn.a)((function(e,t,n,r){var a=ae.a.runKernelFunc(E,T,null,ie.hb,C);return r([t,e,a,n]),y&&(a=Object(oe.a)(a,[a.shape[1],a.shape[2],a.shape[3]])),{value:a,gradFunc:j}}))(b,g,w)}});var or=Object(S.b)({fusedMatMul_:function(e){var t=e.a,n=e.b,r=e.transposeA,a=void 0!==r&&r,i=e.transposeB,o=void 0!==i&&i,u=e.bias,c=e.activation,l=void 0===c?"linear":c,h=e.preluActivationWeights;if(!1===Object(tr.d)(ae.a.state.gradientDepth,l)){var d=Object(O.a)(t,
2n,a,o);return null!=u&&(d=Object(s.a)(d,u)),Object(tr.a)(d,l,h)}var f=Object(x.a)(t,"a","fused matMul"),p=Object(x.a)(n,"b","fused matMul"),m=Object(zn.makeTypesMatch)(f,p),v=Object(Kn.a)(m,2);f=v[0],p=v[1];var g=a?f.shape[f.rank-2]:f.shape[f.rank-1],b=o?p.shape[p.rank-1]:p.shape[p.rank-2],y=a?f.shape[f.rank-1]:f.shape[f.rank-2],w=o?p.shape[p.rank-2]:p.shape[p.rank-1],k=f.shape.slice(0,-2),S=p.shape.slice(0,-2),_=A.sizeFromShape(k),j=A.sizeFromShape(S);A.assert(f.rank>=2&&p.rank>=2&&f.rank===p.rank,(function(){return"Error in fused matMul: inputs must have the same rank of at least "+"2, got ranks ".concat(f.rank," and ").concat(p.rank,".")})),A.assert(A.arraysEqual(k,S),(function(){return"Error in fused matMul: outer dimensions (".concat(k,") and (")+"".concat(S,") of Tensors with shapes ").concat(f.shape," and ")+"".concat(p.shape," must match.")})),A.assert(g===b,(function(){return"Error in fused matMul: inner shapes (".concat(g,") and (")+"".concat(b,") of Tensors with shapes ").concat(f.shape," and ")+"".concat(p.shape," and transposeA=").concat(a)+" and transposeB=".concat(o," must match.")}));var E,T,C=f.shape.slice(0,-2).concat([y,w]),M=a?Object(oe.a)(f,[_,g,y]):Object(oe.a)(f,[_,y,g]),N=o?Object(oe.a)(p,[j,w,b]):Object(oe.a)(p,[j,b,w]);if(null!=u){E=Object(x.a)(u,"bias","fused matMul");var R=Object(zn.makeTypesMatch)(E,f),I=Object(Kn.a)(R,1);E=I[0],Jn.a(C,E.shape)}null!=h&&(T=Object(x.a)(h,"prelu weights","fused matMul"));var L=function(e,t){var n,r,i=Object(Kn.a)(t,4),s=i[0],c=i[1],h=i[2],d=i[3],f=Object(tr.c)(Object(oe.a)(e,h.shape),h,l);return a||o?!a&&o?(n=Object(O.a)(f,c,!1,!1),r=Object(O.a)(f,s,!0,!1)):a&&!o?(n=Object(O.a)(c,f,!1,!0),r=Object(O.a)(s,f,!1,!1)):(n=Object(O.a)(c,f,!0,!0),r=Object(O.a)(f,s,!0,!0)):(n=Object(O.a)(f,c,!1,!0),r=Object(O.a)(s,f,!0,!1)),null!=u?[n,r,Object(tr.b)(d,f)]:[n,r]},D=function(e){return e.fusedBatchMatMul({a:M,b:N,transposeA:a,transposeB:o,bias:E,activation:l,preluActivationWeights:T})},P={a:M,b:N,bias:E,preluActivationWeights:T},z={transposeA:a,transposeB:o,activation:l};return null==u?Object(Zn.a)((function(e,t,n){var r=ae.a.runKernelFunc(D,P,null,ie.Rc,z);return n([e,t,r]),{value:Object(oe.a)(r,C),gradFunc:L}}))(M,N):Object(Zn.a)((function(e,t,n,r){var a=ae.a.runKernelFunc(D,P,null,ie.Rc,z);return r([e,t,a,n]),{value:Object(oe.a)(a,C),gradFunc:L}}))(M,N,E)}});var sr=Object(S.b)({hammingWindow_:function(e){return qn(e,.54,.46)}});var ur=Object(S.b)({hannWindow_:function(e){return qn(e,.5,.5)}});var cr=Object(S.b)({frame_:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i=0,o=[];i+t<=e.size;)o.push(Object(j.a)(e,i,t)),i+=n;if(r)for(;i<e.size;){var s=i+t-e.size,u=Object(w.a)([Object(j.a)(e,i,t-s),Object(xe.a)([s],a)]);o.push(u),i+=n}return 0===o.length?mn([],[0,t]):Object(oe.a)(Object(w.a)(o),[o.length,t])}});var lr=Object(S.b)({stft_:function(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:ur;null==r&&(r=Hn(t));for(var i=cr(e,t,n),o=Object(k.a)(i,a(t)),s=[],u=0;u<i.shape[0];u++)s.push(Object(tn.a)(Object(j.a)(o,[u,0],[1,t]),r));return Object(w.a)(s)}});var hr=Object(S.b)({cropAndResize_:function(e,t,n,r,a,i){var o=Object(x.a)(e,"image","cropAndResize"),s=Object(x.a)(t,"boxes","cropAndResize","float32"),u=Object(x.a)(n,"boxInd","cropAndResize","int32");a=a||"bilinear",i=i||0;var c=s.shape[0];A.assert(4===o.rank,(function(){return"Error in cropAndResize: image must be rank 4,"+"but got rank ".concat(o.rank,".")})),A.assert(2===s.rank&&4===s.shape[1],(function(){return"Error in cropAndResize: boxes must be have size [".concat(c,",4] ")+"but had shape ".concat(s.shape,".")})),A.assert(1===u.rank&&u.shape[0]===c,(function(){return"Error in cropAndResize: boxInd must be have size [".concat(c,"] ")+"but had shape ".concat(s.shape,".")})),A.assert(2===r.length,(function(){return"Error in cropAndResize: cropSize must be of length 2, but got "+"length ".concat(r.length,".")})),A.assert(r[0]>=1&&r[1]>=1,(function(){return"cropSize must be atleast [1,1], but was ".concat(r)})),A.assert("bilinear"===a||"nearest"===a,(function(){return"method must be bilinear or nearest, but was ".concat(a)}
2));var l={image:o,boxes:s,boxInd:u},h={method:a,extrapolationValue:i,cropSize:r};return ae.a.runKernelFunc((function(e){return e.cropAndResize(o,s,u,r,a,i)}),l,null,ie.I,h)}});var dr=Object(S.b)({flipLeftRight_:function(e){var t=Object(x.a)(e,"image","flipLeftRight","float32");A.assert(4===t.rank,(function(){return"Error in flipLeftRight: image must be rank 4,"+"but got rank ".concat(t.rank,".")}));var n={image:t};return ae.a.runKernel(ie.bb,n,{})}});var fr=Object(S.b)({rotateWithOffset_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,a=Object(x.a)(e,"image","rotateWithOffset","float32");A.assert(4===a.rank,(function(){return"Error in rotateWithOffset: image must be rank 4,"+"but got rank ".concat(a.rank,".")}));var i={image:a},o={radians:t,fillValue:n,center:r},s=ae.a.runKernel(ie.mc,i,o);return s}});function pr(e,t,n,r,a,i){null==r&&(r=.5),null==a&&(a=Number.NEGATIVE_INFINITY),null==i&&(i=0);var o=e.shape[0];return n=Math.min(n,o),A.assert(0<=r&&r<=1,(function(){return"iouThreshold must be in [0, 1], but was '".concat(r,"'")})),A.assert(2===e.rank,(function(){return"boxes must be a 2D tensor, but was of rank '".concat(e.rank,"'")})),A.assert(4===e.shape[1],(function(){return"boxes must have 4 columns, but 2nd dimension was ".concat(e.shape[1])})),A.assert(1===t.rank,(function(){return"scores must be a 1D tensor"})),A.assert(t.shape[0]===o,(function(){return"scores has incompatible shape with boxes. Expected ".concat(o,", ")+"but was ".concat(t.shape[0])})),A.assert(0<=i&&i<=1,(function(){return"softNmsSigma must be in [0, 1], but was '".concat(i,"'")})),{maxOutputSize:n,iouThreshold:r,scoreThreshold:a,softNmsSigma:i}}var mr=Object(S.b)({nonMaxSuppression_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Number.NEGATIVE_INFINITY,i=Object(x.a)(e,"boxes","nonMaxSuppression"),o=Object(x.a)(t,"scores","nonMaxSuppression"),s=pr(i,o,n,r,a);n=s.maxOutputSize,r=s.iouThreshold,a=s.scoreThreshold;var u={maxOutputSize:n,iouThreshold:r,scoreThreshold:a};return ae.a.runKernelFunc((function(e){return e.nonMaxSuppression(i,o,n,r,a)}),{boxes:i,scores:o},null,ie.Qb,u)}}),vr=n(98);function gr(){return(gr=Object(An.a)(Mn.a.mark((function e(t,n,r){var a,i,o,s,u,c,l,h,d,f=arguments;return Mn.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=f.length>3&&void 0!==f[3]?f[3]:.5,i=f.length>4&&void 0!==f[4]?f[4]:Number.NEGATIVE_INFINITY,o=Object(x.a)(t,"boxes","nonMaxSuppressionAsync"),s=Object(x.a)(n,"scores","nonMaxSuppressionAsync"),u=pr(o,s,r,a,i),r=u.maxOutputSize,a=u.iouThreshold,i=u.scoreThreshold,e.next=10,Promise.all([o.data(),s.data()]);case 10:return c=e.sent,l=c[0],h=c[1],d=Object(vr.a)(l,h,r,a,i),o!==t&&o.dispose(),s!==n&&s.dispose(),e.abrupt("return",d);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var br=function(e,t,n){return gr.apply(this,arguments)};var yr=Object(S.b)({nonMaxSuppressionWithScore_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Number.NEGATIVE_INFINITY,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=Object(x.a)(e,"boxes","nonMaxSuppression"),s=Object(x.a)(t,"scores","nonMaxSuppression"),u=pr(o,s,n,r,a,i),c={boxes:o,scores:s},l={maxOutputSize:n=u.maxOutputSize,iouThreshold:r=u.iouThreshold,scoreThreshold:a=u.scoreThreshold,softNmsSigma:i=u.softNmsSigma},h=ae.a.runKernel(ie.Sb,c,l);return{selectedIndices:h[0],selectedScores:h[1]}}});function xr(){return(xr=Object(An.a)(Mn.a.mark((function e(t,n,r){var a,i,o,s,u,c,l,h,d,f,p=arguments;return Mn.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=p.length>3&&void 0!==p[3]?p[3]:.5,i=p.length>4&&void 0!==p[4]?p[4]:Number.NEGATIVE_INFINITY,o=p.length>5&&void 0!==p[5]?p[5]:0,s=Object(x.a)(t,"boxes","nonMaxSuppressionAsync"),u=Object(x.a)(n,"scores","nonMaxSuppressionAsync"),c=pr(s,u,r,a,i,o),r=c.maxOutputSize,a=c.iouThreshold,i=c.scoreThreshold,o=c.softNmsSigma,e.next=12,Promise.all([s.data(),u.data()]);case 12:return l=e.sent,h=l[0],d=l[1],f=Object(vr.c)(h,d,r,a,i,o),s!==t&&s.dispose(),u!==n&&u.dispose(),e.abrupt("return",f);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var wr=function(e,t,n){return xr.apply(this,arguments)};var Or=Object(S.b)({nonMaxSuppressionPadded_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Number.NEGATIVE_INFINITY,i=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=Object(x.a)(e,"boxes","nonMaxSuppression"),s=Object(x.a)(t,"scores","nonMaxSuppression"),u=pr(o,s,n,r,a,null),
2c=u.maxOutputSize,l=u.iouThreshold,h=u.scoreThreshold,d={boxes:o,scores:s},f={maxOutputSize:c,iouThreshold:l,scoreThreshold:h,padToMaxOutputSize:i},p=ae.a.runKernel(ie.Rb,d,f);return{selectedIndices:p[0],validOutputs:p[1]}}});function kr(){return(kr=Object(An.a)(Mn.a.mark((function e(t,n,r){var a,i,o,s,u,c,l,h,d,f,p,m,v,g,b=arguments;return Mn.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=b.length>3&&void 0!==b[3]?b[3]:.5,i=b.length>4&&void 0!==b[4]?b[4]:Number.NEGATIVE_INFINITY,o=b.length>5&&void 0!==b[5]&&b[5],s=Object(x.a)(t,"boxes","nonMaxSuppressionAsync"),u=Object(x.a)(n,"scores","nonMaxSuppressionAsync"),c=pr(s,u,r,a,i,null),l=c.maxOutputSize,h=c.iouThreshold,d=c.scoreThreshold,e.next=11,Promise.all([s.data(),u.data()]);case 11:return f=e.sent,p=Object(Kn.a)(f,2),m=p[0],v=p[1],g=Object(vr.b)(m,v,l,h,d,o),s!==t&&s.dispose(),u!==n&&u.dispose(),e.abrupt("return",g);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Sr=function(e,t,n){return kr.apply(this,arguments)},_r=n(223),jr=n(222);var Er=Object(S.b)({bandPart_:function(e,t,n){Object(A.assert)(t%1===0,(function(){return"bandPart(): numLower must be an integer, got ".concat(t,".")})),Object(A.assert)(n%1===0,(function(){return"bandPart(): numUpper must be an integer, got ".concat(n,".")}));var r=Object(x.a)(e,"a","bandPart");Object(A.assert)(r.rank>=2,(function(){return"bandPart(): Rank must be at least 2, got ".concat(r.rank,".")}));var a=r.shape,i=r.shape.slice(-2),o=Object(Kn.a)(i,2),s=o[0],u=o[1];if(!(t<=s))throw new Error("bandPart(): numLower (".concat(t,")")+" must not be greater than the number of rows (".concat(s,")."));if(!(n<=u))throw new Error("bandPart(): numUpper (".concat(n,")")+" must not be greater than the number of columns (".concat(u,")."));t<0&&(t=s),n<0&&(n=u);var c=Object(oe.a)(Object(jt.a)(0,s,1,"int32"),[-1,1]),l=Object(jt.a)(0,u,1,"int32"),h=Object(tt.a)(c,l),d=Object(Be.a)(Object(Ne.a)(h,Object(zt.a)(+t,"int32")),Object(_e.a)(h,Object(zt.a)(-n,"int32"))),f=Object(En.a)([s,u],r.dtype);return Object(oe.a)(Object(sn.a)(Object(kn.a)(Object(oe.a)(r,[-1,s,u])).map((function(e){return Object(_n.a)(d,e,f)}))),a)}});var Tr=Object(S.b)({gramSchmidt_:function(e){var t;Array.isArray(e)?function(){t=!1,Object(A.assert)(null!=e&&e.length>0,(function(){return"Gram-Schmidt process: input must not be null, undefined, or empty"}));for(var n=e[0].shape[0],r=function(t){Object(A.assert)(e[t].shape[0]===n,(function(){return"Gram-Schmidt: Non-unique lengths found in the input vectors: "+"(".concat(e[t].shape[0]," vs. ").concat(n,")")}))},a=1;a<e.length;++a)r(a)}():(t=!0,e=Object(nn.a)(e,e.shape[0],0).map((function(e){return Object(on.a)(e,[0])}))),Object(A.assert)(e.length<=e[0].shape[0],(function(){return"Gram-Schmidt: Number of vectors (".concat(e.length,") exceeds ")+"number of dimensions (".concat(e[0].shape[0],").")}));for(var n=[],r=e,a=function(e){n.push(ae.a.tidy((function(){var t=r[e];if(e>0)for(var a=0;a<e;++a){var i=Object(k.a)(Object(ln.a)(Object(k.a)(n[a],t)),n[a]);t=Object(tt.a)(t,i)}return Object(ce.a)(t,Object(Pn.a)(t,"euclidean"))})))},i=0;i<e.length;++i)a(i);return t?Object(sn.a)(n,0):n}}),Cr=n(32);function Mr(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return ae.a.tidy((function(){Object(A.assert)(2===e.shape.length,(function(){return"qr2d() requires a 2D Tensor, but got a ".concat(e.shape.length,"D Tensor.")}));for(var n=e.shape[0],r=e.shape[1],a=ye(n),i=Object(B.a)(e),o=mn([[1]],[1,1]),s=Object(B.a)(o),u=n>=r?r:n,c=function(e){var t=i,u=s,c=a,l=ae.a.tidy((function(){var t=Object(j.a)(i,[e,e],[n-e,1]),u=Object(Pn.a)(t),c=Object(j.a)(i,[e,e],[1,1]),l=Object(_n.a)(Object(Se.a)(c,0),mn([[-1]]),mn([[1]])),h=Object(tt.a)(c,Object(k.a)(l,u)),d=Object(ce.a)(t,h);s=1===d.shape[0]?Object(B.a)(o):Object(w.a)([o,Object(j.a)(d,[1,0],[d.shape[0]-1,d.shape[1]])],0);var f=Object(it.a)(Object(ce.a)(Object(O.a)(l,h),u)),p=Object(j.a)(i,[e,0],[n-e,r]),m=Object(k.a)(f,s),v=Object(Dn.a)(s);if(0===e)i=Object(tt.a)(p,Object(O.a)(m,Object(O.a)(v,p)));else{var g=Object(tt.a)(p,Object(O.a)(m,Object(O.a)(v,p)));i=Object(w.a)([Object(j.a)(i,[0,0],[e,r]),g],0)}var b=Object(Dn.a)(m),y=Object(j.a)(a,[0,e],[n,a.shape[1]-e]);if(0===e)a=Object(tt.a)(y,Object(O.a)(Object(O.a)(y,s),b));else{var x=Object(tt.a)(y,Object(O.a)(Object(O.a)(y,s),b));a=Object(w.a)([Object(j.a)(a,[0,0],[n,e]),x],1)}return[s,i,a]})),h=Object(Kn.a)(l,3);s=h[0],i=h[1],a=h[2],Object(Cr.d)([t,u,c])},l=0;l<u;++l)c(l);return!t&&n>r&&(a=Object(j.a)(a,[0,0],[n,r]),i=Object(j.a)(i,[0,0],[r,r])),[a,i]}))}var Ar=Object(S.b)({qr_:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Object(A.assert)(e.rank>=2,(function(){return"qr() requires input tensor to have a rank >= 2, but got rank ".concat(e.rank)})),2===e.rank)return Mr(e,t);var n=e.shape.slice(0,e.shape.length-2).reduce((function(e,t){return e*t})),r=Object(kn.a)(Object(oe.a)(e,[n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),a=[],i=[];r.forEach((function(e){var n=Mr(e,t),r=Object(Kn.a)(n,2),o=r[0],s=r[1];a.push(o),i.push(s)}));var o=Object(oe.a)(Object(sn.a)(a,0),e.shape),s=Object(oe.a)(Object(sn.a)(i,0),e.shape);return[o,s]}}),Nr=n(56);var Rr=Object(S.b)({computeWeightedLoss_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Nr.a.SUM_BY_NONZERO_WEIGHTS,r=Object(x.a)(e,"losses","computeWeightedLoss"),a=null;null!=t&&(a=Object(x.a)(t,"weights","computeWeightedLoss"));var i=null==a?r:Object(k.a)(r,a);if(n===Nr.a.NONE)return i;if(n===Nr.a.SUM)return Object(ln.a)(i);if(n===Nr.a.MEAN){if(null==a)return Object(Ke.a)(i);
2var o=r.size/a.size,s=Object(ce.a)(Object(ln.a)(i),Object(ln.a)(a));return o>1?Object(ce.a)(s,Object(zt.a)(o)):s}if(n===Nr.a.SUM_BY_NONZERO_WEIGHTS){if(null==a)return Object(ce.a)(Object(ln.a)(i),Object(zt.a)(r.size));var u=Object(k.a)(a,Object(ut.a)(r.shape)),c=Object(P.a)(Object(ln.a)(Object(ot.a)(u,Object(zt.a)(0))),"float32");return Object(ce.a)(Object(ln.a)(i),c)}throw Error("Unknown reduction: ".concat(n))}});var Ir=Object(S.b)({absoluteDifference_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Nr.a.SUM_BY_NONZERO_WEIGHTS,i=Object(x.a)(e,"labels","absoluteDifference"),o=Object(x.a)(t,"predictions","absoluteDifference"),s=null;null!=n&&(s=Object(x.a)(n,"weights","absoluteDifference")),Object(A.assertShapesMatch)(i.shape,o.shape,"Error in absoluteDifference: ");var u=Object(a.a)(Object(tt.a)(i,o));return Rr(u,s,r)}});var Lr=Object(S.b)({cosineDistance_:function(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Nr.a.SUM_BY_NONZERO_WEIGHTS,i=Object(x.a)(e,"labels","cosineDistance"),o=Object(x.a)(t,"predictions","cosineDistance"),s=null;null!=r&&(s=Object(x.a)(r,"weights","cosineDistance")),Object(A.assertShapesMatch)(i.shape,o.shape,"Error in cosineDistance: ");var u=Object(zt.a)(1),c=Object(tt.a)(u,Object(ln.a)(Object(k.a)(i,o),n,!0));return Rr(c,s,a)}});var Dr=Object(S.b)({hingeLoss_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Nr.a.SUM_BY_NONZERO_WEIGHTS,a=Object(x.a)(e,"labels","hingeLoss"),i=Object(x.a)(t,"predictions","hingeLoss"),o=null;null!=n&&(o=Object(x.a)(n,"weights","hingeLoss")),Object(A.assertShapesMatch)(a.shape,i.shape,"Error in hingeLoss: ");var s=Object(zt.a)(1);a=Object(tt.a)(Object(k.a)(Object(zt.a)(2),a),s);var u=Object(Ct.a)(Object(tt.a)(s,Object(k.a)(a,i)));return Rr(u,o,r)}});var Pr=Object(S.b)({huberLoss_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Nr.a.SUM_BY_NONZERO_WEIGHTS,o=Object(x.a)(e,"labels","huberLoss"),u=Object(x.a)(t,"predictions","huberLoss"),c=null;null!=n&&(c=Object(x.a)(n,"weights","huberLoss")),Object(A.assertShapesMatch)(o.shape,u.shape,"Error in huberLoss: ");var l=Object(zt.a)(r),h=Object(a.a)(Object(tt.a)(u,o)),d=Object(Je.a)(h,l),f=Object(tt.a)(h,d),p=Object(s.a)(Object(k.a)(Object(zt.a)(.5),Object(et.a)(d)),Object(k.a)(l,f));return Rr(p,c,i)}});var zr=Object(S.b)({logLoss_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e-7,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Nr.a.SUM_BY_NONZERO_WEIGHTS,i=Object(x.a)(e,"labels","logLoss"),o=Object(x.a)(t,"predictions","logLoss"),u=null;null!=n&&(u=Object(x.a)(n,"weights","logLoss")),Object(A.assertShapesMatch)(i.shape,o.shape,"Error in logLoss: ");var c=Object(zt.a)(1),l=Object(zt.a)(r),h=Object(it.a)(Object(k.a)(i,Object(Le.a)(Object(s.a)(o,l)))),d=Object(k.a)(Object(tt.a)(c,i),Object(Le.a)(Object(s.a)(Object(tt.a)(c,o),l))),f=Object(tt.a)(h,d);return Rr(f,u,a)}});var Fr=Object(S.b)({meanSquaredError_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Nr.a.SUM_BY_NONZERO_WEIGHTS,a=Object(x.a)(e,"labels","meanSquaredError"),i=Object(x.a)(t,"predictions","meanSquaredError"),o=null;null!=n&&(o=Object(x.a)(n,"weights","meanSquaredError")),Object(A.assertShapesMatch)(a.shape,i.shape,"Error in meanSquaredError: ");var s=Object(an.a)(a,i);return Rr(s,o,r)}});function Br(e,t){var n=Object(x.a)(e,"labels","sigmoidCrossEntropyWithLogits"),r=Object(x.a)(t,"logits","sigmoidCrossEntropyWithLogits");Object(A.assertShapesMatch)(n.shape,r.shape,"Error in sigmoidCrossEntropyWithLogits: ");var i=Object(Ct.a)(r),o=Object(k.a)(r,n),u=Object(De.a)(Object(me.a)(Object(it.a)(Object(a.a)(r))));return Object(s.a)(Object(tt.a)(i,o),u)}var Ur=Object(S.b)({sigmoidCrossEntropy_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Nr.a.SUM_BY_NONZERO_WEIGHTS,i=Object(x.a)(e,"multiClassLabels","sigmoidCrossEntropy"),o=Object(x.a)(t,"logits","sigmoidCrossEntropy"),u=null;if(null!=n&&(u=Object(x.a)(n,"weights","sigmoidCrossEntropy")),Object(A.assertShapesMatch)(i.shape,o.shape,"Error in sigmoidCrossEntropy: "),r>0){var c=Object(zt.a)(r),l=Object(zt.a)(1),h=Object(zt.a)(.5);i=Object(s.a)(Object(k.a)(i,Object(tt.a)(l,c)),Object(k.a)(h,c))}var d=Br(i,o);return Rr(d,u,a)}});function Wr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(-1===n&&(n=t.rank-1),n!==t.rank-1)throw Error("Softmax cross entropy along a non-last dimension is not yet "+"supported. Labels / logits was rank ".concat(t.rank," ")+"and dim was ".concat(n));var r=Object(Zn.a)((function(e,t,r){var a=Object(Fe.a)(t,[n],!0),i=Object(tt.a)(Object(P.a)(t,"float32"),a);r([e,i]);var o=Object(it.a)(Object(k.a)(i,e));return{value:Object(ln.a)(o,[n]),gradFunc:function(e,t){var r=Object(Kn.a)(t,2),a=r[0],i=r[1],o=Object($e.e)(e.shape,[n]);return[Object(k.a)(Object(oe.a)(e,o),Object(tt.a)(Object(P.a)(a,"float32"),Object(me.a)(i))),Object(k.a)(Object(oe.a)(e,o),Object(tt.a)(Object(me.a)(i),Ob
2ject(P.a)(a,"float32")))]}}}));return r(e,t)}var Vr=Object(S.b)({softmaxCrossEntropy_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Nr.a.SUM_BY_NONZERO_WEIGHTS,i=Object(x.a)(e,"onehotLabels","softmaxCrossEntropy"),o=Object(x.a)(t,"logits","softmaxCrossEntropy"),u=null;if(null!=n&&(u=Object(x.a)(n,"weights","softmaxCrossEntropy")),Object(A.assertShapesMatch)(i.shape,o.shape,"Error in softmaxCrossEntropy: "),r>0){var c=Object(zt.a)(r),l=Object(zt.a)(1),h=Object(zt.a)(i.shape[1]);i=Object(s.a)(Object(k.a)(i,Object(tt.a)(l,c)),Object(ce.a)(c,h))}var d=Wr(i,o);return Rr(d,u,a)}}),Gr={fft:Qt.a,ifft:$t.a,rfft:tn.a,irfft:en.a},Hr={hammingWindow:sr,hannWindow:ur,frame:cr,stft:lr},qr={flipLeftRight:dr,resizeNearestNeighbor:jr.a,resizeBilinear:_r.a,rotateWithOffset:fr,cropAndResize:hr,nonMaxSuppression:mr,nonMaxSuppressionAsync:br,nonMaxSuppressionWithScore:yr,nonMaxSuppressionWithScoreAsync:wr,nonMaxSuppressionPadded:Or,nonMaxSuppressionPaddedAsync:Sr},Xr={bandPart:Er,gramSchmidt:Tr,qr:Ar},Yr={absoluteDifference:Ir,computeWeightedLoss:Rr,cosineDistance:Lr,hingeLoss:Dr,huberLoss:Pr,logLoss:zr,meanSquaredError:Fr,sigmoidCrossEntropy:Ur,softmaxCrossEntropy:Vr}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(35),u=n(20),c=n(9),l=n(14),h=n(45);var d=Object(c.b)({sum_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=Object(i.a)(e,"x","sum");"bool"===c.dtype&&(c=Object(u.a)(c,"int32"));var d=function(e,r){r([c]);var a=Object(o.parseAxisParam)(t,c.shape),i=Object(s.f)(a,c.rank),u=a,d=c;null!=i&&(d=Object(h.a)(c,i),u=Object(s.g)(u.length,c.rank));var f=e.sum(d,u);if(n){var p=Object(s.e)(f.shape,a);f=Object(l.a)(f,p)}return f},f={x:c},p={axis:t,keepDims:n};return r.a.runKernelFunc(d,f,null,a.Ic,p)}})},function(e,t,n){"use strict";n.d(t,"g",(function(){return s})),n.d(t,"f",(function(){return u})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return l})),n.d(t,"e",(function(){return h})),n.d(t,"h",(function(){return d})),n.d(t,"m",(function(){return f})),n.d(t,"n",(function(){return p})),n.d(t,"t",(function(){return m})),n.d(t,"d",(function(){return v})),n.d(t,"l",(function(){return g})),n.d(t,"u",(function(){return b})),n.d(t,"r",(function(){return y})),n.d(t,"o",(function(){return x})),n.d(t,"k",(function(){return w})),n.d(t,"q",(function(){return O})),n.d(t,"i",(function(){return k})),n.d(t,"j",(function(){return S})),n.d(t,"p",(function(){return _})),n.d(t,"a",(function(){return j})),n.d(t,"s",(function(){return E}));var r=n(10),a=n(39),i=n(12),o=n(36);function s(){Object(a.c)().set("PROD",!0)}function u(){Object(a.c)().set("DEBUG",!0)}function c(){Object(a.c)().set("DEPRECATION_WARNINGS_ENABLED",!1),console.warn("TensorFlow.js deprecation warnings have been disabled.")}function l(e){Object(a.c)().getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(e+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")}function h(){r.a.disposeVariables()}function d(){return r.a}function f(){return r.a.memory()}function p(e){return r.a.profile(e)}function m(e,t){return r.a.tidy(e,t)}function v(e){Object(o.getTensorsInContainer)(e).forEach((function(e){return e.dispose()}))}function g(e){return r.a.keep(e)}function b(e){return r.a.time(e)}function y(e){return r.a.setBackend(e)}function x(){return r.a.ready()}function w(){return r.a.backendName}function O(e){r.a.removeBackend(e)}function k(e){return r.a.findBackend(e)}function S(e){return r.a.findBackendFactory(e)}function _(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return r.a.registerBackend(e,t,n)}function j(){return r.a.backend}function E(e,t){Object(a.c)().setPlatform(e,t)}Object(i.d)(l)},function(e,t,n){"use strict";n.d(t,"d",(function(){return o})),n.d(t,"e",(function(){return s})),n.d(t,"f",(function(){return u})),n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return l})),n.d(t,"c",(function(){return h})),n.d(t,"i",(function(){return b})),n.d(t,"h",(function(){return y}
2)),n.d(t,"g",(function(){return x}));var r=n(8),a=n(19),i=n(2);function o(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"NHWC",o=arguments.length>5?arguments[5]:void 0,s=e[3],u=[].concat(Object(a.a)(t),[s]),l=x(i);return c(e,u,n,o,r,null,null,l)}function s(e,t,n,a,i,o){var s,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"channelsLast",l=d(t),h=Object(r.a)(l,2),f=h[0],p=h[1];if("channelsLast"===u)s=[f,p,e[3],e[3]];else{if("channelsFirst"!==u)throw new Error("Unknown dataFormat ".concat(u));s=[f,p,e[1],e[1]]}return c(e,s,n,a,i,o,!1,u)}function u(e,t,n,a,i,o){var s,u,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"NDHWC",h=f(t),d=Object(r.a)(h,3),p=d[0],m=d[1],v=d[2];if("NDHWC"===c)u="channelsLast",s=[p,m,v,e[4],e[4]];else{if("NCDHW"!==c)throw new Error("Unknown dataFormat ".concat(c));u="channelsFirst",s=[p,m,v,e[1],e[1]]}return l(e,s,n,a,i,!1,u,o)}function c(e,t,n,a,i,o){var s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"channelsLast",c=-1,l=-1,h=-1,f=-1;if("channelsLast"===u){var v=Object(r.a)(e,4);c=v[0],l=v[1],h=v[2],f=v[3]}else{if("channelsFirst"!==u)throw new Error("Unknown dataFormat ".concat(u));var g=Object(r.a)(e,4);c=g[0],f=g[1],l=g[2],h=g[3]}var b,y=Object(r.a)(t,4),x=y[0],w=y[1],O=y[3],k=d(n),S=Object(r.a)(k,2),_=S[0],j=S[1],E=d(a),T=Object(r.a)(E,2),C=T[0],M=T[1],A=p(x,C),N=p(w,M),R=m(i,l,h,_,j,A,N,o,u),I=R.padInfo,L=R.outHeight,D=R.outWidth,P=s?O*f:O;return"channelsFirst"===u?b=[c,P,L,D]:"channelsLast"===u&&(b=[c,L,D,P]),{batchSize:c,dataFormat:u,inHeight:l,inWidth:h,inChannels:f,outHeight:L,outWidth:D,outChannels:P,padInfo:I,str
2ideHeight:_,strideWidth:j,filterHeight:x,filterWidth:w,effectiveFilterHeight:A,effectiveFilterWidth:N,dilationHeight:C,dilationWidth:M,inShape:e,outShape:b,filterShape:t}}function l(e,t,n,a,i){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"channelsLast",u=arguments.length>7?arguments[7]:void 0,c=-1,l=-1,h=-1,d=-1,m=-1;if("channelsLast"===s){var g=Object(r.a)(e,5);c=g[0],l=g[1],h=g[2],d=g[3],m=g[4]}else{if("channelsFirst"!==s)throw new Error("Unknown dataFormat ".concat(s));var b=Object(r.a)(e,5);c=b[0],m=b[1],l=b[2],h=b[3],d=b[4]}var y,x=Object(r.a)(t,5),w=x[0],O=x[1],k=x[2],S=x[4],_=f(n),j=Object(r.a)(_,3),E=j[0],T=j[1],C=j[2],M=f(a),A=Object(r.a)(M,3),N=A[0],R=A[1],I=A[2],L=p(w,N),D=p(O,R),P=p(k,I),z=v(i,l,h,d,E,T,C,L,D,P,u),F=z.padInfo,B=z.outDepth,U=z.outHeight,W=z.outWidth,V=o?S*m:S;return"channelsFirst"===s?y=[c,V,B,U,W]:"channelsLast"===s&&(y=[c,B,U,W,V]),{batchSize:c,dataFormat:s,inDepth:l,inHeight:h,inWidth:d,inChannels:m,outDepth:B,outHeight:U,outWidth:W,outChannels:V,padInfo:F,strideDepth:E,strideHeight:T,strideWidth:C,filterDepth:w,filterHeight:O,filterWidth:k,effectiveFilterDepth:L,effectiveFilterHeight:D,effectiveFilterWidth:P,dilationDepth:N,dilationHeight:R,dilationWidth:I,inShape:e,outShape:y,filterShape:t}}function h(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=p(t,r);return Math.floor((e[0]*(n-1)-n+a)/2)}function d(e){return"number"===typeof e?[e,e,e]:2===e.length?[e[0],e[1],1]:e}function f(e){return"number"===typeof e?[e,e,e]:e}function p(e,t){return t<=1?e:e+(e-1)*(t-1)}function m(e,t,n,r,a,o,s,u,c){var l,d,f;if("number"===typeof e){l={top:e,bottom:e,left:e,right:e,type:0===e?"VALID":"NUMBER"};var p=function(e,t,n,r,a){null==r&&(r=h(e,t,n));var o=e[0],s=e[1],u=g((o-t+2*r)/n+1,a);i.assert(i.isInt(u),(function(){return"The output # of rows (".concat(u,") must be an integer. ")+"Change the stride and/or zero pad parameters"}));var c=g((s-t+2*r)/n+1,a);return i.assert(i.isInt(c),(function(){return"The output # of columns (".concat(c,") must be an integer. ")+"Change the stride and/or zero pad parameters"})),[u,c]}([t,n],o,r,e,u);d=p[0],f=p[1]}else if("same"===e){d=Math.ceil(t/r),f=Math.ceil(n/a);var m=Math.max(0,(d-1)*r+o-t),v=Math.max(0,(f-1)*a+s-n),b=Math.floor(m/2),y=m-b,x=Math.floor(v/2);l={top:b,bottom:y,left:x,right:v-x,type:"SAME"}}else if("valid"===e)l={top:0,bottom:0,left:0,right:0,type:"VALID"},d=Math.ceil((t-o+1)/r),f=Math.ceil((n-s+1)/a);else{if("object"!==typeof e)throw Error("Unknown padding parameter: ".concat(e));var w="channelsLast"===c?e[1][0]:e[2][0],O="channelsLast"===c?e[1][1]:e[2][1],k="channelsLast"===c?e[2][0]:e[3][0],S="channelsLast"===c?e[2][1]:e[3][1];l={top:w,bottom:O,left:k,right:S,type:0===w&&0===O&&0===k&&0===S?"VALID":"EXPLICIT"},d=g((t-o+w+O)/r+1,u),f=g((n-s+k+S)/a+1,u)}return{padInfo:l,outHeight:d,outWidth:f}}function v(e,t,n,r,a,o,s,u,c,l,d){var f,p,m,v;if("number"===typeof e){f={top:e,bottom:e,left:e,right:e,front:e,back:e,type:0===e?"VALID":"NUMBER"};var b=function(e,t,n,r,a,o){null==a&&(a=h(e,t,r));var s=e[0],u=e[1],c=e[2],l=g((s-t+2*a)/r+1,o);i.assert(i.isInt(l),(function(){return"The output # of depths (".concat(l,") must be an integer. ")+"Change the stride and/or zero pad parameters"}));var d=g((u-t+2*a)/r+1,o);i.assert(i.isInt(d),(function(){return"The output # of rows (".concat(d,") must be an integer. ")+"Change the stride and/or zero pad parameters"}));var f=g((c-t+2*a)/r+1,o);return i.assert(i.isInt(f),(function(){return"The output # of columns (".concat(f,") must be an integer. ")+"Change the stride and/or zero pad parameters"})),[l,d,f,n]}([t,n,r,1],u,1,a,e,d);p=b[0],m=b[1],v=b[2]}else if("same"===e){var y=((p=Math.ceil(t/a))-1)*a+u-t,x=((m=Math.ceil(n/o))-1)*o+c-n,w=((v=Math.ceil(r/s))-1)*s+l-r,O=Math.floor(y/2),k=y-O,S=Math.floor(x/2),_=x-S,j=Math.floor(w/2);f={top:S,bottom:_,left:j,right:w-j,front:O,back:k,type:"SAME"}}else{if("valid"!==e)throw Error("Unknown padding parameter: ".concat(e));f={top:0,bottom:0,left:0,right:0,front:0,back:0,type:"VALID"},p=Math.ceil((t-u+1)/a),m=Math.ceil((n-c+1)/o),v=Math.ceil((r-l+1)/s)}return{padInfo:f,outDepth:p,outHeight:m,outWidth:v}}function g(e,t){if(!t)return e;switch(t){case"round":return Math.round(e);case"ceil":return Math.ceil(e);case"floor":return Math.floor(e);default:throw new Error("Unknown roundingMode ".concat(t))}}function b(e){var t=d(e),n=Object(r.a)(t,3),a=n[0],i=n[1],o=n[2];return 1===a&&1===i&&1===o}function y(e,t){return b(e)||b(t)}function x(e){if("NHWC"===e)return"channelsLast";if("NCHW"===e)return"channelsFirst";throw new Error("Unknown dataFormat ".concat(e))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({zerosLike_:function(e){var t=Object(i.a)(e,"x","zerosLike"),n={x:t};return r.a.runKernelFunc((function(e){return e.zerosLike(t)}),n,null,a.Qc)}})},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"d",(function(){return o}
2)),n.d(t,"e",(function(){return s})),n.d(t,"a",(function(){return u})),n.d(t,"f",(function(){return c})),n.d(t,"h",(function(){return l})),n.d(t,"g",(function(){return h}));var r=n(2);function a(e,t){for(var n=0;n<e.length;++n)if(e[e.length-n-1]!==t-1-n)return!1;return!0}function i(e,t,n){for(var r=e.length+t.length,a=[],i=0,o=0,s=0;s<r;s++)-1===n.indexOf(s)?a.push(e[i++]):a.push(t[o++]);return a}function o(e,t){for(var n=[],r=e.length,a=0;a<r;a++)-1===t.indexOf(a)&&n.push(e[a]);return[n,t.map((function(t){return e[t]}))]}function s(e,t){return i(e,t.map((function(e){return 1})),t)}function u(e,t,n){r.assert(a(t,n),(function(){return"".concat(e," supports only inner-most axes for now. ")+"Got axes ".concat(t," and rank-").concat(n," input.")}))}function c(e,t){if(a(e,t))return null;for(var n=[],r=0;r<t;++r)-1===e.indexOf(r)&&n.push(r);return e.forEach((function(e){return n.push(e)})),n}function l(e){return e.map((function(e,t){return[t,e]})).sort((function(e,t){return e[1]-t[1]})).map((function(e){return e[0]}))}function h(e,t){for(var n=[],r=t-e;r<t;++r)n.push(r);return n}},function(e,t,n){"use strict";n.r(t),n.d(t,"makeTypesMatch",(function(){return o})),n.d(t,"assertTypesMatch",(function(){return s})),n.d(t,"isTensorInList",(function(){return u})),n.d(t,"getTensorsInContainer",(function(){return c}));var r=n(12),a=n(117),i=n(2);function o(e,t){if(e.dtype===t.dtype)return[e,t];var n=Object(a.c)(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function s(e,t){Object(i.assert)(e.dtype===t.dtype,(function(){return"The dtypes of the first(".concat(e.dtype,") and")+" second(".concat(t.dtype,") input must match")}))}function u(e,t){return t.some((function(t){return t.id===e.id}))}function c(e){var t=[];return function e(t,n,a){if(null==t)return;if(t instanceof r.a)return void n.push(t);if(i=t,!Array.isArray(i)&&"object"!==typeof i)return;var i;var o=t;for(var s in o){var u=o[s];a.has(u)||(a.add(u),e(u,n,a))}}(e,t,new Set),t}},function(e,t,n){"use strict";function r(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";(function(e){var r=n(160),a=n(1),i=n.n(a),o=(n(317),n(318)),s=n(319),u=n(244),c=n(131),l=n.n(c);function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var d=function(e,t){for(var n=[e[0]],r=0,a=t.length;r<a;r+=1)n.push(t[r],e[r+1]);return n},f=function(e){return null!==e&&"object"===typeof e&&"[object Object]"===(e.toString?e.toString():Object.prototype.toString.call(e))&&!Object(r.typeOf)(e)},p=Object.freeze([]),m=Object.freeze({});function v(e){return"function"===typeof e}function g(e){return e.displayName||e.name||"Component"}function b(e){return e&&"string"===typeof e.styledComponentId}var y="undefined"!==typeof e&&(Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).REACT_APP_SC_ATTR||Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).SC_ATTR)||"data-styled",x="undefined"!==typeof window&&"HTMLElement"in window,w="boolean"===typeof SC_DISABLE_SPEEDY&&SC_DISABLE_SPEEDY||"undefined"!==typeof e&&(Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).REACT_APP_SC_DISABLE_SPEEDY||Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).SC_DISABLE_SPEEDY)||!1,O=function(){return n.nc};function k(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/master/packages/styled-components/src/utils/errors.md#"+e+" for more information."+(n.length>0?" Additional arguments: "+n.join(", "):""))}var S=function(e){var t=document.head,n=e||t,r=document.createElement("style"),a=function(e){for(var t=e.childNodes,n=t.length;n>=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(y))return r}}(n),i=void 0!==a?a.nextSibling:null;r.setAttribute(y,"active"),r.setAttribute("data-styled-version","5.1.1");var o=O();return o&&r.setAttribute("nonce",o),n.insertBefore(r,i),r},_=function(){function e(e){var t=this.element=S(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var a=t[n];if(a.ownerNode===e)return a}k(17)}(t),this.length=0}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(n){return!1}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"===typeof t.cssText?t.cssText:""},e}(),j=function(){function e(e){var t=this.element=S(e);this.nodes=t.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),E=function(){function e(e){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},t.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),T=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,a=r;e>=a;)(a<<=1)<0&&k(16,""+e);this.groupSizes=new Uint32Array(a),this.groupSizes.set(n),this.length=a;for(var i=r;i<a;i++)this.groupSizes[i]=0}for(var o=this.indexOfGroup(e+1),s=0,u=t.length;s<u;s++)this.tag.insertRule(o,t[s])&&(this.groupSizes[e]++,o++)},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var a=n;a<r;a++)this.tag.deleteRule(n)}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),a=r+n,i=r;i<a;i++)t+=this.tag.getRule(i)+"/*!sc*/\n";return t},e}(),C=new Map,M=new Map,A=1,N=function(e){if(C.has(e))return C.get(e);var t=A++;return C.set(e,t),M.set(t,e),t},R=function(e){return M.get(e)},I=function(e,t){t>=A&&(A=t+1),C.set(e,t),M.set(t,e)},L="style["+y+'][data-styled-version="5.1.1"]',D=new RegExp("^"+y+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),P=function(e,t,n){for(var r,a=n.split(","),i=0,o=a.length;i<o;i++)(r=a[i])&&e.registerName(t,r)},z=function(e,t){for(var n=t.innerHTML.split("/*!sc*/\n"),r=[],a=0,i=n.length;a<i;a++){var o=n[a].trim();if(o){var s=o.match(D);if(s){var u=0|parseInt(s[1],10),c=s[2];0!==u&&(I(c,u),P(e,c,s[3]),e.getTag().insertRules(u,r)),r.length=0}else r.push(o)}}},F=x,B={isServer:!x,useCSSOMInjection:!w},U=function(){function e(e,t,n){void 0===e&&(e=B),void 0===t&&(t={}),this.options=h({},B,{},e),this.gs=t,this.names=new Map(n),!this.options.isServer&&x&&F&&(F=!1,function(e){for(var t=document.querySelectorAll(L),n=0,r=t.length;n<r;n++){var a=t[n];a&&"active"!==a.getAttribute(y)&&(z(e,a),a.parentNode&&a.parentNode.removeChild(a))}}(this))}e.registerId=function(e){return N(e)};var t=e.prototype;return t.reconstructWithOptions=function(t){return new e(h({},this.options,{},t),this.gs,this.names)},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.isServer,n=e.useCSSOMInjection,r=e.target;return t?new E(r):n?new _(r):new j(r)}(this.options),new T(e)));var e},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.registerName=function(e,t){if(N(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},t.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(N(e),n)}
2,t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.clearRules=function(e){this.getTag().clearGroup(N(e)),this.clearNames(e)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(e){for(var t=e.getTag(),n=t.length,r="",a=0;a<n;a++){var i=R(a);if(void 0!==i){var o=e.names.get(i),s=t.getGroup(a);if(void 0!==o&&0!==s.length){var u=y+".g"+a+'[id="'+i+'"]',c="";void 0!==o&&o.forEach((function(e){e.length>0&&(c+=e+",")})),r+=""+s+u+'{content:"'+c+'"}/*!sc*/\n'}}}return r}(this)},e}(),W=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},V=function(e){return W(5381,e)};var G=/^\s*\/\/.*$/gm;function H(e){var t,n,r,a=void 0===e?m:e,i=a.options,s=void 0===i?m:i,u=a.plugins,c=void 0===u?p:u,l=new o.a(s),h=[],d=function(e){function t(t){if(t)try{e(t+"}")}catch(n){}}return function(n,r,a,i,o,s,u,c,l,h){switch(n){case 1:if(0===l&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===c)return r+"/*|*/";break;case 3:switch(c){case 102:case 112:return e(a[0]+r),"";default:return r+(0===h?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){h.push(e)})),f=function(e,r,a){return r>0&&-1!==a.slice(0,r).indexOf(n)&&a.slice(r-n.length,r)!==n?"."+t:e};function v(e,a,i,o){void 0===o&&(o="&");var s=e.replace(G,""),u=a&&i?i+" "+a+" { "+s+" }":s;return t=o,n=a,r=new RegExp("\\"+n+"\\b","g"),l(i||!a?"":a,u)}return l.use([].concat(c,[function(e,t,a){2===e&&a.length&&a[0].lastIndexOf(n)>0&&(a[0]=a[0].replace(r,f))},d,function(e){if(-2===e){var t=h;return h=[],t}}])),v.hash=c.length?c.reduce((function(e,t){return t.name||k(15),W(e,t.name)}),5381).toString():"",v}var q=i.a.createContext(),X=(q.Consumer,i.a.createContext()),Y=(X.Consumer,new U),K=H();function Z(){return Object(a.useContext)(q)||Y}function J(){return Object(a.useContext)(X)||K}var Q=function(){function e(e,t){var n=this;this.inject=function(e){e.hasNameForId(n.id,n.name)||e.insertRules(n.id,n.name,K.apply(void 0,n.stringifyArgs))},this.toString=function(){return k(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.stringifyArgs=t}return e.prototype.getName=function(){return this.name},e}(),$=/([A-Z])/g,ee=/^ms-/;function te(e){return e.replace($,"-$1").toLowerCase().replace(ee,"-ms-")}var ne=function(e){return void 0===e||null===e||!1===e||""===e},re=function e(t,n){var r=[];return Object.keys(t).forEach((function(n){if(!ne(t[n])){if(f(t[n]))return r.push.apply(r,e(t[n],n)),r;if(v(t[n]))return r.push(te(n)+":",t[n],";"),r;r.push(te(n)+": "+(a=n,(null==(i=t[n])||"boolean"===typeof i||""===i?"":"number"!==typeof i||0===i||a in s.a?String(i).trim():i+"px")+";"))}var a,i;return r})),n?[n+" {"].concat(r,["}"]):r};function ae(e,t,n){if(Array.isArray(e)){for(var r,a=[],i=0,o=e.length;i<o;i+=1)""!==(r=ae(e[i],t,n))&&(Array.isArray(r)?a.push.apply(a,r):a.push(r));return a}return ne(e)?"":b(e)?"."+e.styledComponentId:v(e)?"function"!==typeof(s=e)||s.prototype&&s.prototype.isReactComponent||!t?e:ae(e(t),t,n):e instanceof Q?n?(e.inject(n),e.getName()):e:f(e)?re(e):e.toString();var s}function ie(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return v(e)||f(e)?ae(d(p,[e].concat(n))):0===n.length&&1===e.length&&"string"===typeof e[0]?e:ae(d(e,n))}var oe=function(e){return"function"===typeof e||"object"===typeof e&&null!==e&&!Array.isArray(e)},se=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function ue(e,t,n){var r=e[n];oe(t)&&oe(r)?ce(r,t):e[n]=t}function ce(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var a=0,i=n;a<i.length;a++){var o=i[a];if(oe(o))for(var s in o)se(s)&&ue(e,o[s],s)}return e}var le=/(a)(d)/gi,he=function(e){return String.fromCharCode(e+(e>25?39:97))};function de(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=he(t%52)+n;return(he(t%52)+n).replace(le,"$1-$2")}function fe(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(v(n)&&!b(n))return!1}return!0}var pe=function(){function e(e,t){this.rules=e,this.staticRulesId="",this.isStatic=fe(e),this.componentId=t,this.baseHash=V(t),U.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.componentId;if(this.isStatic&&!n.hash){if(this.staticRulesId&&t.hasNameForId(r,this.staticRulesId))return this.staticRulesId;var a=ae(this.rules,e,t).join(""),i=de(W(this.baseHash,a.length)>>>0);if(!t.hasNameForId(r,i)){var o=n(a,"."+i,void 0,r);t.insertRules(r,i,o)}return this.staticRulesId=i,i}for(var s=this.rules.length,u=W(this.baseHash,n.hash),c="",l=0;l<s;l++){var h=this.rules[l];if("string"===typeof h)c+=h;else{var d=ae(h,e,t),f=Array.isArray(d)?d.join(""):d;u=W(u,f+l),c+=f}}var p=de(u>>>0);if(!t.hasNameForId(r,p)){var m=n(c,"."+p,void 0,r);t.insertRules(r,p,m)}return p},e}(),me=(new Set,function(e,t,n){return void 0===n&&(n=m),e.theme!==n.theme&&e.theme||t||n.theme}),ve=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,ge=/(^-|-$)/g;function be(e){return e.replace(ve,"-").replace(ge,"")}function ye(e){return"string"===typeof e&&!0}var xe=function(e){return de(V(e)>>>0)};var we=i.a.createContext();we.Consumer;var Oe={};function ke(e,t,n){var r=e.attrs,i=e.componentStyle,o=e.defaultProps,s=e.foldedComponentIds,c=e.shouldForwardProp,l=e.styledComponentId,d=e.target;Object(a.useDebugValue)(l);var f=function(e,t,n){void 0===e&&(e=m);var r=h({},t,{theme:e}),a={};
2return n.forEach((function(e){var t,n,i,o=e;for(t in v(o)&&(o=o(r)),o)r[t]=a[t]="className"===t?(n=a[t],i=o[t],n&&i?n+" "+i:n||i):o[t]})),[r,a]}(me(t,Object(a.useContext)(we),o)||m,t,r),p=f[0],g=f[1],b=function(e,t,n,r){var i=Z(),o=J(),s=e.isStatic&&!t?e.generateAndInjectStyles(m,i,o):e.generateAndInjectStyles(n,i,o);return Object(a.useDebugValue)(s),s}(i,r.length>0,p),y=n,x=g.$as||t.$as||g.as||t.as||d,w=ye(x),O=g!==t?h({},t,{},g):t,k=c||w&&u.a,S={};for(var _ in O)"$"!==_[0]&&"as"!==_&&("forwardedAs"===_?S.as=O[_]:k&&!k(_,u.a)||(S[_]=O[_]));return t.style&&g.style!==t.style&&(S.style=h({},t.style,{},g.style)),S.className=Array.prototype.concat(s,l,b!==l?b:null,t.className,g.className).filter(Boolean).join(" "),S.ref=y,Object(a.createElement)(x,S)}function Se(e,t,n){var r=b(e),a=!ye(e),o=t.displayName,s=void 0===o?function(e){return ye(e)?"styled."+e:"Styled("+g(e)+")"}(e):o,u=t.componentId,c=void 0===u?function(e,t){var n="string"!==typeof e?"sc":be(e);Oe[n]=(Oe[n]||0)+1;var r=n+"-"+xe(n+Oe[n]);return t?t+"-"+r:r}(t.displayName,t.parentComponentId):u,d=t.attrs,f=void 0===d?p:d,m=t.displayName&&t.componentId?be(t.displayName)+"-"+t.componentId:t.componentId||c,v=r&&e.attrs?Array.prototype.concat(e.attrs,f).filter(Boolean):f,y=t.shouldForwardProp;r&&e.shouldForwardProp&&(y=y?function(n,r){return e.shouldForwardProp(n,r)&&t.shouldForwardProp(n,r)}:e.shouldForwardProp);var x,w=new pe(r?e.componentStyle.rules.concat(n):n,m),O=function(e,t){return ke(x,e,t)};return O.displayName=s,(x=i.a.forwardRef(O)).attrs=v,x.componentStyle=w,x.displayName=s,x.shouldForwardProp=y,x.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):p,x.styledComponentId=m,x.target=r?e.target:e,x.withComponent=function(e){var r=t.componentId,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(t,["componentId"]),i=r&&r+"-"+(ye(e)?e:be(g(e)));return Se(e,h({},a,{attrs:v,componentId:i}),n)},Object.defineProperty(x,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?ce({},e.defaultProps,t):t}}),x.toString=function(){return"."+x.styledComponentId},a&&l()(x,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,self:!0,styledComponentId:!0,target:!0,withComponent:!0}),x}var _e=function(e){return function e(t,n,a){if(void 0===a&&(a=m),!Object(r.isValidElementType)(n))return k(1,String(n));var i=function(){return t(n,a,ie.apply(void 0,arguments))};return i.withConfig=function(r){return e(t,n,h({},a,{},r))},i.attrs=function(r){return e(t,n,h({},a,{attrs:Array.prototype.concat(a.attrs,r).filter(Boolean)}))},i}(Se,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){_e[e]=_e(e)}));t.a=_e}).call(this,n(115))},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return h})),n.d(t,"a",(function(){return d})),n.d(t,"d",(function(){return f}));var r=n(8),a=n(3),i=n.n(a),o=n(13),s=n(5),u=n(11),c=function(){function e(t){Object(s.a)(this,e),this.global=t,this.flags={},this.flagRegistry={},this.urlFlags={},this.populateURLFlags()}return Object(u.a)(e,[{key:"setPlatform",value:function(e,t){null!=this.platform&&console.warn("Platform ".concat(this.platformName," has already been set. ")+"Overwriting the platform with ".concat(t,".")),this.platformName=e,this.platform=t}},{key:"registerFlag",value:function(e,t,n){if(this.flagRegistry[e]={evaluationFn:t,setHook:n},null!=this.urlFlags[e]){var r=this.urlFlags[e];console.warn("Setting feature override from URL ".concat(e,": ").concat(r,".")),this.set(e,r)}}},{key:"getAsync",value:function(){var e=Object(o.a)(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t in this.flags)){e.next=2;break}return e.abrupt("return",this.flags[t]);case 2:return e.next=4,this.evaluateFlag(t);case 4:return this.flags[t]=e.sent,e.abrupt("return",this.flags[t]);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"get",value:function(e){if(e in this.flags)return this.flags[e];var t=this.evaluateFlag(e);if(t instanceof Promise)throw new Error("Flag ".concat(e," cannot be synchronously evaluated. ")+"Please use getAsync() instead.");return this.flags[e]=t,this.flags[e]}},{key:"getNumber",value:function(e){return this.get(e)}},{key:"getBool",value:function(e){return this.get(e)}},{key:"getFlags",value:function(){return this.flags}},{key:"set",value:function(e,t){if(null==this.flagRegistry[e])throw new Error("Cannot set flag ".concat(e," as it has not been registered."));this.flags[e]=t,null!=this.flagRegistry[e].setHook&&this.flagRegistry[e].setHook(t)}},{key:"evaluateFlag",value:function(e){if(null==this.flagRegistry[e])throw new Error("Cannot evaluate flag '".concat(e,"': no evaluation function found."));return this.flagRegistry[e].evaluationFn()}},{key:"setFlags",value:function(e){this.flags=Object.assign({},e)}},{key:"reset",value:function(){this.flags={},this.urlFlags={},this.populateURLFlags()}},{key:"populateURLFlags",value:function(){var e=this;if("undefined"!==typeof this.global&&"undefined"!==typeof this.global.location&&"undefined"!==typeof this.global.location.search){var t=function(e){var t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return l(t,r[0],r[1]),r.join("=")})),t}(this.global.location.search);if("tfjsflags"in t)t.tfjsflags.split(",").forEach((function(t){var n=t.split(":"),a=Object(r.a)(n,2),i=a[0],o=a[1];e.urlFlags[i]=function(e,t){if("true"===(t=t.toLowerCase())||"false"===t)return"true"===t;if("".concat(+t)===t)return+t;throw new Error("Could not parse value flag value ".concat(t," for flag ").concat(e,"."))}(i,o)}))}}},{key:"features",get:function(){return this.flags}}]),e}();function l(e,t,n){e[decodeURIComponent(t)]=decodeURIComponent(n||"")}function h(){return d}var d=null;function f(e){d=e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}
2));var r=n(10),a=n(4),i=n(9);var o=Object(i.b)({square_:function(e){var t=Object(a.a)(e,"x","square"),n=[t];return r.a.runKernelFunc((function(e,n){return n([t]),e.square(t)}),{x:t},null,"Square",{},n,[])}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(8),a=n(10),i=n(7),o=n(4),s=n(9),u=n(75);var c=Object(s.b)({slice_:function(e,t,n){var s=Object(o.a)(e,"x","slice");if(0===s.rank)throw new Error("Slicing scalar is not possible");var c=u.parseSliceParams(s,t,n),l=Object(r.a)(c,2),h=l[0],d=l[1];u.assertParamsValid(s,h,d);var f={x:s},p={begin:t,size:n};return a.a.runKernelFunc((function(e,t){return t([s]),e.slice(s,h,d)}),f,null,i.wc,p)}})},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(8),a=n(10),i=n(7),o=n(36),s=n(4),u=n(2),c=n(9),l=n(14);var h=Object(c.b)({matMul_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=arguments.length>3&&void 0!==arguments[3]&&arguments[3],h=Object(s.a)(e,"a","matMul"),d=Object(s.a)(t,"b","matMul"),f=Object(o.makeTypesMatch)(h,d),p=Object(r.a)(f,2);
2h=p[0],d=p[1],u.assert(h.rank>=2&&d.rank>=2&&h.rank===d.rank,(function(){return"Error in matMul: inputs must have the same rank of at least 2, "+"got ranks ".concat(h.rank," and ").concat(d.rank,".")}));var m=n?h.shape[h.rank-2]:h.shape[h.rank-1],v=c?d.shape[d.rank-1]:d.shape[d.rank-2],g=n?h.shape[h.rank-1]:h.shape[h.rank-2],b=c?d.shape[d.rank-2]:d.shape[d.rank-1],y=h.shape.slice(0,-2),x=d.shape.slice(0,-2),w=u.sizeFromShape(y),O=u.sizeFromShape(x);u.assert(u.arraysEqual(y,x),(function(){return"Error in matMul: outer dimensions (".concat(y,") and (")+"".concat(x,") of Tensors with shapes ").concat(h.shape," and ")+"".concat(d.shape," must match.")})),u.assert(m===v,(function(){return"Error in matMul: inner shapes (".concat(m,") and (")+"".concat(v,") of Tensors with shapes ").concat(h.shape," and ")+"".concat(d.shape," and transposeA=").concat(n)+" and transposeB=".concat(c," must match.")}));var k=h.shape.slice(0,-2).concat([g,b]),S=n?Object(l.a)(h,[w,m,g]):Object(l.a)(h,[w,g,m]),_=c?Object(l.a)(d,[O,b,v]):Object(l.a)(d,[O,v,b]),j=function(e,t){return t([S,_]),e.batchMatMul(S,_,n,c)},E={a:S,b:_},T={transposeA:n,transposeB:c},C=a.a.runKernelFunc(j,E,null,i.s,T);return Object(l.a)(C,k)}})},function(e,t,n){"use strict";function r(e){var t,n,a="";if("string"===typeof e||"number"===typeof e)a+=e;else if("object"===typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(a&&(a+=" "),a+=n);else for(t in e)e[t]&&(a&&(a+=" "),a+=t);return a}t.a=function(){for(var e,t,n=0,a="";n<arguments.length;)(e=arguments[n++])&&(t=r(e))&&(a&&(a+=" "),a+=t);return a}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(9);var u=Object(s.b)({transpose_:function(e,t){var n=Object(i.a)(e,"x","transpose");if(null==t&&(t=n.shape.map((function(e,t){return t})).reverse()),o.assert(n.rank===t.length,(function(){return"Error in transpose: rank of input ".concat(n.rank," ")+"must match length of perm ".concat(t,".")})),t.forEach((function(e){o.assert(e>=0&&e<n.rank,(function(){return"All entries in 'perm' must be between 0 and ".concat(n.rank-1)+" but got ".concat(t)}))})),n.rank<=1)return n.clone();var s={x:n},u={perm:t};return r.a.runKernelFunc((function(e){return e.transpose(n,t)}),s,null,a.Nc,u)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(83);function a(e,t){if(null==e)return{};var n,a,i=Object(r.a)(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({neg_:function(e){var t=Object(i.a)(e,"x","neg"),n={x:t};return r.a.runKernelFunc((function(e){return e.neg(t)}),n,null,a.Pb)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return U})),n.d(t,"c",(function(){return q})),n.d(t,"d",(function(){return Z}));var r=n(1),a=n.n(r),i=(n(54),a.a.createContext(null));var o=function(e){e()},s={notify:function(){}};function u(){var e=o,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,a=n={callback:e,next:null,prev:n};return a.prev?a.prev.next=a:t=a,function(){r&&null!==t&&(r=!1,a.next?a.next.prev=a.prev:n=a.prev,a.prev?a.prev.next=a.next:t=a.next)}}}}var c=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=s,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=u())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=s)},e}();var l=function(e){var t=e.store,n=e.context,o=e.children,s=Object(r.useMemo)((function(){var e=new c(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),u=Object(r.useMemo)((function(){return t.getState()}),[t]);Object(r.useEffect)((function(){var e=s.subscription;return e.trySubscribe(),u!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[s,u]);var l=n||i;return a.a.createElement(l.Provider,{value:s},o)},h=n(21),d=n(83),f=n(131),p=n.n(f),m=n(160),v="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?r.useLayoutEffect:r.useEffect,g=[],b=[null,
2null];function y(e,t){var n=e[1];return[t.payload,n+1]}function x(e,t,n){v((function(){return e.apply(void 0,t)}),n)}function w(e,t,n,r,a,i,o){e.current=r,t.current=a,n.current=!1,i.current&&(i.current=null,o())}function O(e,t,n,r,a,i,o,s,u,c){if(e){var l=!1,h=null,d=function(){if(!l){var e,n,d=t.getState();try{e=r(d,a.current)}catch(f){n=f,h=f}n||(h=null),e===i.current?o.current||u():(i.current=e,s.current=e,o.current=!0,c({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=d,n.trySubscribe(),d();return function(){if(l=!0,n.tryUnsubscribe(),n.onStateChange=null,h)throw h}}}var k=function(){return[null,0]};function S(e,t){void 0===t&&(t={});var n=t,o=n.getDisplayName,s=void 0===o?function(e){return"ConnectAdvanced("+e+")"}:o,u=n.methodName,l=void 0===u?"connectAdvanced":u,f=n.renderCountProp,v=void 0===f?void 0:f,S=n.shouldHandleStateChanges,_=void 0===S||S,j=n.storeKey,E=void 0===j?"store":j,T=(n.withRef,n.forwardRef),C=void 0!==T&&T,M=n.context,A=void 0===M?i:M,N=Object(d.a)(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),R=A;return function(t){var n=t.displayName||t.name||"Component",i=s(n),o=Object(h.a)({},N,{getDisplayName:s,methodName:l,renderCountProp:v,shouldHandleStateChanges:_,storeKey:E,displayName:i,wrappedComponentName:n,WrappedComponent:t}),u=N.pure;var f=u?r.useMemo:function(e){return e()};function S(n){var i=Object(r.useMemo)((function(){var e=n.reactReduxForwardedRef,t=Object(d.a)(n,["reactReduxForwardedRef"]);return[n.context,e,t]}),[n]),s=i[0],u=i[1],l=i[2],p=Object(r.useMemo)((function(){return s&&s.Consumer&&Object(m.isContextConsumer)(a.a.createElement(s.Consumer,null))?s:R}),[s,R]),v=Object(r.useContext)(p),S=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(v)&&Boolean(v.store);var j=S?n.store:v.store,E=Object(r.useMemo)((function(){return function(t){return e(t.dispatch,o)}(j)}),[j]),T=Object(r.useMemo)((function(){if(!_)return b;var e=new c(j,S?null:v.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[j,S,v]),C=T[0],M=T[1],A=Object(r.useMemo)((function(){return S?v:Object(h.a)({},v,{subscription:C})}),[S,v,C]),N=Object(r.useReducer)(y,g,k),I=N[0][0],L=N[1];if(I&&I.error)throw I.error;var D=Object(r.useRef)(),P=Object(r.useRef)(l),z=Object(r.useRef)(),F=Object(r.useRef)(!1),B=f((function(){return z.current&&l===P.current?z.current:E(j.getState(),l)}),[j,I,l]);x(w,[P,D,F,l,B,z,M]),x(O,[_,j,C,E,P,D,F,z,M,L],[j,C,E]);var U=Object(r.useMemo)((function(){return a.a.createElement(t,Object(h.a)({},B,{ref:u}))}),[u,t,B]);return Object(r.useMemo)((function(){return _?a.a.createElement(p.Provider,{value:A},U):U}),[p,U,A])}var j=u?a.a.memo(S):S;if(j.WrappedComponent=t,j.displayName=i,C){var T=a.a.forwardRef((function(e,t){return a.a.createElement(j,Object(h.a)({},e,{reactReduxForwardedRef:t}))}));return T.displayName=i,T.WrappedComponent=t,p()(T,t)}return p()(j,t)}}function _(e,t){return e===t?0!==e||0!==t||1/e===1/t:e!==e&&t!==t}function j(e,t){if(_(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var a=0;a<n.length;a++)if(!Object.prototype.hasOwnProperty.call(t,n[a])||!_(e[n[a]],t[n[a]]))return!1;return!0}var E=n(175);function T(e){return function(t,n){var r=e(t,n);function a(){return r}return a.dependsOnOwnProps=!1,a}}function C(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function M(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=C(e);var a=r(t,n);return"function"===typeof a&&(r.mapToProps=a,r.dependsOnOwnProps=C(a),a=r(t,n)),a},r}}var A=[function(e){return"function"===typeof e?M(e):void 0},function(e){return e?void 0:T((function(e){return{dispatch:e}}))},function(e){return e&&"object"===typeof e?T((function(t){return Object(E.a)(e,t)})):void 0}];var N=[function(e){return"function"===typeof e?M(e):void 0},function(e){return e?void 0:T((function(){return{}}))}];function R(e,t,n){return Object(h.a)({},n,{},e,{},t)}var I=[function(e){return"function"===typeof e?function(e){return function(t,n){n.displayName;var r,a=n.pure,i=n.areMergedPropsEqual,o=!1;return function(t,n,s){var u=e(t,n,s);return o?a&&i(u,r)||(r=u):(o=!0,r=u),r}}}(e):void 0},function(e){return e?void 0:function(){return R}}];function L(e,t,n,r){return function(a,i){return n(e(a,i),t(r,i),i)}}function D(e,t,n,r,a){var i,o,s,u,c,l=a.areStatesEqual,h=a.areOwnPropsEqual,d=a.areStatePropsEqual,f=!1;function p(a,f){var p=!h(f,o),m=!l(a,i);
2return i=a,o=f,p&&m?(s=e(i,o),t.dependsOnOwnProps&&(u=t(r,o)),c=n(s,u,o)):p?(e.dependsOnOwnProps&&(s=e(i,o)),t.dependsOnOwnProps&&(u=t(r,o)),c=n(s,u,o)):m?function(){var t=e(i,o),r=!d(t,s);return s=t,r&&(c=n(s,u,o)),c}():c}return function(a,l){return f?p(a,l):(s=e(i=a,o=l),u=t(r,o),c=n(s,u,o),f=!0,c)}}function P(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,a=t.initMergeProps,i=Object(d.a)(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),o=n(e,i),s=r(e,i),u=a(e,i);return(i.pure?D:L)(o,s,u,e,i)}function z(e,t,n){for(var r=t.length-1;r>=0;r--){var a=t[r](e);if(a)return a}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function F(e,t){return e===t}function B(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?S:n,a=t.mapStateToPropsFactories,i=void 0===a?N:a,o=t.mapDispatchToPropsFactories,s=void 0===o?A:o,u=t.mergePropsFactories,c=void 0===u?I:u,l=t.selectorFactory,f=void 0===l?P:l;return function(e,t,n,a){void 0===a&&(a={});var o=a,u=o.pure,l=void 0===u||u,p=o.areStatesEqual,m=void 0===p?F:p,v=o.areOwnPropsEqual,g=void 0===v?j:v,b=o.areStatePropsEqual,y=void 0===b?j:b,x=o.areMergedPropsEqual,w=void 0===x?j:x,O=Object(d.a)(o,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),k=z(e,i,"mapStateToProps"),S=z(t,s,"mapDispatchToProps"),_=z(n,c,"mergeProps");return r(f,Object(h.a)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:k,initMapDispatchToProps:S,initMergeProps:_,pure:l,areStatesEqual:m,areOwnPropsEqual:g,areStatePropsEqual:y,areMergedPropsEqual:w},O))}}var U=B();function W(){return Object(r.useContext)(i)}function V(e){void 0===e&&(e=i);var t=e===i?W:function(){return Object(r.useContext)(e)};return function(){return t().store}}var G=V();function H(e){void 0===e&&(e=i);var t=e===i?G:V(e);return function(){return t().dispatch}}var q=H(),X=function(e,t){return e===t};function Y(e){void 0===e&&(e=i);var t=e===i?W:function(){return Object(r.useContext)(e)};return function(e,n){void 0===n&&(n=X);var a=t(),i=function(e,t,n,a){var i,o=Object(r.useReducer)((function(e){return e+1}),0)[1],s=Object(r.useMemo)((function(){return new c(n,a)}),[n,a]),u=Object(r.useRef)(),l=Object(r.useRef)(),h=Object(r.useRef)(),d=Object(r.useRef)(),f=n.getState();try{i=e!==l.current||f!==h.current||u.current?e(f):d.current}catch(p){throw u.current&&(p.message+="\nThe error may be correlated with this previous error:\n"+u.current.stack+"\n\n"),p}return v((function(){l.current=e,h.current=f,d.current=i,u.current=void 0})),v((function(){function e(){try{var e=l.current(n.getState());if(t(e,d.current))return;d.current=e}catch(p){u.current=p}o()}return s.onStateChange=e,s.trySubscribe(),e(),function(){return s.tryUnsubscribe()}}),[n,s]),i}(e,n,a.store,a.subscription);return Object(r.useDebugValue)(i),i}}var K,Z=Y(),J=n(118);K=J.unstable_batchedUpdates,o=K},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(170),u=n(9),c=n(84);var l=Object(u.b)({concat_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(o.assert)(e.length>=1,(function(){return"Pass at least one tensor to concat"}));var n=Object(i.b)(e,"tensors","concat");
2"complex64"===n[0].dtype&&n.forEach((function(e){if("complex64"!==e.dtype)throw new Error("Cannot concatenate complex64 tensors with a tensor\n with dtype ".concat(e.dtype,". "))}));var u=Object(o.parseAxisParam)(t,n[0].shape)[0],l=Object(s.b)(n.map((function(e){return e.shape})),u);if(0===Object(o.sizeFromShape)(l))return Object(c.a)([],l);if(1===(n=n.filter((function(e){return e.size>0}))).length)return n[0];var h=n.map((function(e){return e.shape}));Object(s.a)(h,u);var d=function(e,t){var r=e.concat(n,u);return t(n),r},f=n,p={axis:t};return r.a.runKernelFunc(d,f,null,a.z,p)}})},function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return l})),n.d(t,"d",(function(){return h}));var r=n(329);function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function i(e){if(e.type)return e;if("#"===e.charAt(0))return i(function(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(Object(r.a)(3,e));var a=e.substring(t+1,e.length-1).split(",");return{type:n,values:a=a.map((function(e){return parseFloat(e)}))}}function o(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function s(e,t){var n=u(e),r=u(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function u(e){var t="hsl"===(e=i(e)).type?i(function(e){var t=(e=i(e)).values,n=t[0],r=t[1]/100,a=t[2]/100,s=r*Math.min(a,1-a),u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return a-s*Math.max(Math.min(t-3,9-t,1),-1)},c="rgb",l=[Math.round(255*u(0)),Math.round(255*u(8)),Math.round(255*u(4))];return"hsla"===e.type&&(c+="a",l.push(t[3])),o({type:c,values:l})}(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function c(e,t){return e=i(e),t=a(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),e.values[3]=t,o(e)}function l(e,t){if(e=i(e),t=a(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return o(e)}function h(e,t){if(e=i(e),t=a(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return o(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(329);function a(e){if("string"!==typeof e)throw new Error(Object(r.a)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,a=n(1),i=(r=a)&&"object"===typeof r&&"default"in r?r.default:r,o=new(n(364)),s=o.getBrowser(),u=(o.getCPU(),o.getDevice()),c=o.getEngine(),l=o.getOS(),h=o.getUA(),d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none";return e||t},f=function(){return!("undefined"===typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},p=function(e){var t=f();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)};function m(e){return(m="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(){return(b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}
2function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var k="mobile",S="tablet",_="smarttv",j="console",E="wearable",T=void 0,C="Chrome",M="Firefox",A="Opera",N="Yandex",R="Safari",I="Internet Explorer",L="Edge",D="Chromium",P="IE",z="Mobile Safari",F="iOS",B="Android",U="Windows Phone",W="Windows",V="Mac OS",G={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},H=function(e,t,n,r){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(n,!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e,{vendor:d(t.vendor),model:d(t.model),os:d(n.name),osVersion:d(n.version),ua:d(r)})},q=function(e){switch(e){case k:return{isMobile:!0};case S:return{isTablet:!0};case _:return{isSmartTV:!0};case j:return{isConsole:!0};case E:return{isWearable:!0};case T:return{isBrowser:!0};default:return G}}(u.type);var X=function(){return l.name===W&&"10"===l.version&&("string"===typeof h&&-1!==h.indexOf("Edg/"))},Y=function(){return s.name===L},K=function(){return p("iPad")},Z=u.type===_,J=u.type===j,Q=u.type===E,$=s.name===z||K(),ee=s.name===D,te=function(){switch(u.type){case k:case S:return!0;default:return!1}}()||K(),ne=u.type===k,re=u.type===S||K(),ae=u.type===T,ie=l.name===B,oe=l.name===U,se=l.name===F||K(),ue=s.name===C,ce=s.name===M,le=s.name===R||s.name===z,he=s.name===A,de=s.name===I||s.name===P,fe=d(l.version),pe=d(l.name),me=d(s.version),ve=d(s.major),ge=d(s.name),be=d(u.vendor),ye=d(u.model),xe=d(c.name),we=d(c.version),Oe=d(h),ke=Y()||X(),Se=s.name===N,_e=d(u.type,"browser"),je=function(){var e=f();return e&&(/iPad|iPhone|iPod/.test(e.platform)||"MacIntel"===e.platform&&e.maxTouchPoints>1)&&!window.MSStream}(),Ee=K(),Te=p("iPhone"),Ce=p("iPod"),Me=function(){var e=f(),t=e&&e.userAgent.toLowerCase();return"string"===typeof t&&/electron/.test(t)}(),Ae=X(),Ne=Y(),Re=l.name===W,Ie=l.name===V;t.AndroidView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,o=e.style;return ie?t?i.createElement(a.Fragment,null,n):i.createElement("div",{className:r,style:o},n):null},t.BrowserView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,o=e.style;return ae?t?i.createElement(a.Fragment,null,n):i.createElement("div",{className:r,style:o},n):null},t.ConsoleView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,o=e.style;return J?t?i.createElement(a.Fragment,null,n):i.createElement("div",{className:r,style:o},n):null},t.CustomView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,o=e.style;return e.condition?t?i.createElement(a.Fragment,null,n):i.createElement("div",{className:r,style:o},n):null},t.IEView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,o=e.style;return de?t?i.createElement(a.Fragment,null,n):i.createElement("div",{className:r,style:o},n):null},t.IOSView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,o=e.style;return se?t?i.createElement(a.Fragment,null,n):i.createElement("div",{className:r,style:o},n):null},t.MobileOnlyView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,o=e.style;return ne?t?i.createElement(a.Fragment,null,n):i.createElement("div",{className:r,style:o},n):null},t.MobileView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,o=e.style;return te?t?i.createElement(a.Fragment,null,n):i.createElement("div",{className:r,style:o},n):null},t.SmartTVView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,o=e.style;return Z?t?i.createElement(a.Fragment,null,n):i.createElement("div",{className:r,style:o},n):null},t.TabletView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,o=e.style;return re?t?i.createElement(a.Fragment,null,n):i.createElement("div",{className:r,style:o},n):null},t.WearableView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,o=e.style;return Q?t?i.createElement(a.Fragment,null,n):i.createElement("div",{className:r,style:o},n):null},t.WinPhoneView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,o=e.style;return oe?t?i.createElement(a.Fragment,null,n):i.createElement("div",{className:r,style:o},n):null},t.browserName=ge,t.browserVersion=ve,t.deviceDetect=function(){var e=q.isBrowser,t=q.isMobile,n=q.isTablet,r=q.isSmartTV,a=q.isConsole,i=q.isWearable;return e?function(e,t,n,r,a){return{isBrowser:e,browserMajorVersion:d(t.major),browserFullVersion:d(t.version),browserName:d(t.name),engineName:d(n.name),engineVersion:d(n.version),osName:d(r.name),osVersion:d(r.version),userAgent:d(a)}}(e,s,c,l,h):r?function(e,t,n,r){return{isSmartTV:e,engineName:d(t.name),engineVersion:d(t.version),osName:d(n.name),osVersion:d(n.version),userAgent:d(r)}}(r,c,l,h):a?function(e,t,n,r){return{isConsole:e,engineName:d(t.name),engineVersion:d(t.version),osName:d(n.name),osVersion:d(n.version),userAgent:d(r)}}(a,c,l,h):t||n?H(q,u,l,h):i?function(e,t,n,r){return{isWearable:e,engineName:d(t.name),engineVersion:d(t.version),osName:d(n.name),osVersion:d(n.version),userAgent:d(r)}}(i,c,l,h):void 0},t.deviceType=_e,t.engineName=xe,t.engineVersion=we,t.fullBrowserVersion=me,t.getUA=Oe,t.isAndroid=ie,t.isBrowser=ae,t.isChrome=ue,t.isChromium=ee,t.isConsole=J,t.isEdge=ke,t.isEdgeChromium=Ae,t.isElectron=Me,t.isFirefox=ce,t.isIE=de,t.isIOS=se,t.isIOS13=je,t.isIPad13=Ee,t.isIPhone13=Te,t.isIPod13=Ce,t.isLegacyEdge=Ne,t.isMacOs=Ie,t.isMobile=te,t.isMobileOnly=ne,t.isMobileSafari=$,t.isOpera=he,t.isSafari=le,t.isSmartTV=Z,t.isTablet=re,t.isWearable=Q,t.isWinPhone=oe,t.isWindows=Re,t.isYandex=Se,t.mobileModel=ye,t.mobileVendor=be,t.osName=pe,t.osVersion=fe,t.withOr
2ientationChange=function(e){return function(t){function n(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(t=function(e,t){return!t||"object"!==typeof t&&"function"!==typeof t?O(e):t}(this,x(n).call(this,e))).isEventListenerAdded=!1,t.handleOrientationChange=t.handleOrientationChange.bind(O(t)),t.onOrientationChange=t.onOrientationChange.bind(O(t)),t.onPageLoad=t.onPageLoad.bind(O(t)),t.state={isLandscape:!1,isPortrait:!1},t}var r,a,o;return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&w(e,t)}(n,t),r=n,(a=[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var e=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:0===e,isLandscape:90===e})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){void 0!==("undefined"===typeof window?"undefined":m(window))&&te&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return i.createElement(e,b({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}])&&v(r.prototype,a),o&&v(r,o),n}(i.Component)}},function(e,t,n){"use strict";var r=n(21),a=n(46),i=n(1),o=n.n(i),s=(n(54),n(131)),u=n.n(s),c="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l="object"===("undefined"===typeof window?"undefined":c(window))&&"object"===("undefined"===typeof document?"undefined":c(document))&&9===document.nodeType;function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t,n){return t&&h(e.prototype,t),n&&h(e,n),e}var f=n(181),p=n(180),m=n(83),v={}.constructor;function g(e){if(null==e||"object"!==typeof e)return e;if(Array.isArray(e))return e.map(g);if(e.constructor!==v)return e;var t={};for(var n in e)t[n]=g(e[n]);return t}function b(e,t,n){void 0===e&&(e="unnamed");var r=n.jss,a=g(t),i=r.plugins.onCreateRule(e,a,n);return i||(e[0],null)}var y=function(e,t){for(var n="",r=0;r<e.length&&"!important"!==e[r];r++)n&&(n+=t),n+=e[r];return n};function x(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))return e;var n="";if(Array.isArray(e[0]))for(var r=0;r<e.length&&"!important"!==e[r];r++)n&&(n+=", "),n+=y(e[r]," ");else n=y(e,", ");return t||"!important"!==e[e.length-1]||(n+=" !important"),n}function w(e,t){for(var n="",r=0;r<t;r++)n+=" ";return n+e}function O(e,t,n){void 0===n&&(n={});var r="";if(!t)return r;var a=n.indent,i=void 0===a?0:a,o=t.fallbacks;if(e&&i++,o)if(Array.isArray(o))for(var s=0;s<o.length;s++){var u=o[s];for(var c in u){var l=u[c];null!=l&&(r&&(r+="\n"),r+=""+w(c+": "+x(l)+";",i))}}else for(var h in o){var d=o[h];null!=d&&(r&&(r+="\n"),r+=""+w(h+": "+x(d)+";",i))}for(var f in t){var p=t[f];null!=p&&"fallbacks"!==f&&(r&&(r+="\n"),r+=""+w(f+": "+x(p)+";",i))}return(r||n.allowEmpty)&&e?(r&&(r="\n"+r+"\n"),w(e+" {"+r,--i)+w("}",i)):r}var k=/([[\].#*$><+~=|^:(),"'`\s])/g,S="undefined"!==typeof CSS&&CSS.escape,_=function(e){return S?S(e):e.replace(k,"\\$1")},j=function(){function e(e,t,n){this.type="style",this.key=void 0,this.isProcessed=!1,this.style=void 0,this.renderer=void 0,this.renderable=void 0,this.options=void 0;var r=n.sheet,a=n.Renderer;this.key=e,this.options=n,this.style=t,r?this.renderer=r.renderer:a&&(this.renderer=new a)}return e.prototype.prop=function(e,t,n){if(void 0===t)return this.style[e];var r=!!n&&n.force;if(!r&&this.style[e]===t)return this;var a=t;n&&!1===n.process||(a=this.options.jss.plugins.onChangeValue(t,e,this));var i=null==a||!1===a,o=e in this.style;if(i&&!o&&!r)return this;var s=i&&o;if(s?delete this.style[e]:this.style[e]=a,this.renderable&&this.renderer)return s?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,a),this;var u=this.options.sheet;return u&&u.attached,this},e}(),E=function(e){function t(t,n,r){var a;(a=e.call(this,t,n,r)||this).selectorText=void 0,a.id=void 0,a.renderable=void 0;var i=r.selector,o=r.scoped,s=r.sheet,u=r.generateId;return i?a.selectorText=i:!1!==o&&(a.id=u(Object(p.a)(Object(p.a)(a)),s),a.selectorText="."+_(a.id)),a}Object(f.a)(t,e);var n=t.prototype;return n.applyTo=function(e){var t=this.renderer;if(t){var n=this.toJSON();for(var r in n)t.setProperty(e,r,n[r])}return this},n.toJSON=function(){var e={};for(var t in this.style){var n=this.style[t];"object"!==typeof n?e[t]=n:Array.isArray(n)&&(e[t]=x(n))}return e},n.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?Object(r.a)({},e,{allowEmpty:!0}):e;return O(this.selectorText,this.style,n)},d(t,[{key:"selector",set:function(e){if(e!==this.selectorText){this.selectorText=e;var t=this.renderer,n=this.renderable;if(n&&t)t.setSelector(n,e)||t.replaceRule(n,this)}},get:function(){return this.selectorText}}]),t}(j),T={onCreateRule:function(e,t,n){return"@"===e[0]||n.parent&&"keyframes"===n.parent.type?null:new E(e,t,n)}},C={indent:1,children:!0},M=/@([\w-]+)/,A=function(){function e(e,t,n){this.type="conditional",this.at=void 0,this.key=void 0,this.query=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.query=n.name;var a=e.match(M);for(var i in this.at=a?a[1]:"unknown",this.options=n,this.rules=new ee(Object(r.a)({},n,{parent:this})),t)this.rules.add(i,t[i]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.indexOf=function(e){return this.rules.indexOf(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},t.toString=function(e){if(void 0===e&&(e=C),null==e.indent&&(e.indent=C.indent),null==e.children&&(e.children=C.children),!1===e.children)return this.query+" {}";var t=this.rules.toString(e);return t?this.query+" {\n"+t+"\n}":""},e}(),N=/@media|@supports\s+/,R={onCreateRule:function(e,t,n){return N.test(e)?new A(e,t,n):null}},I={indent:1,children:!0},L=/@keyframes\s+([\w-]+)/,D=function(){function e(e,t,n){this.type="keyframes",this.at="@keyframes",this.key=void 0,this.name=void 0,this.id=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0;var a=e.match(L);a&&a[1]?this.name=a[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=n;var i=n.scoped,o=n.sheet,s=n.generateId;for(var u in this.id=!1===i?this.name:_(s(this,o)),this.rules=new ee(Object(r.a)({},n,{parent:this})),t)this.rules.add(u,t[u],Object(r.a)({},n,{parent:this}));this.rules.process()}return e.prototype.toString=function(e){if(void 0===e&&(e=I),null==e.indent&&(e.indent=I.indent),null==e.children&&(e.children=I.children),!1===e.children)return this.at+" "+this.id+" {}";var t=this.rules.toString(e);return t&&(t="\n"+t+"\n"),this.at+" "+this.id+" {"+t+"}"},e}(),P=/@keyframes\s+/,z=/\$([\w-]+)/g,F=function(e,t){return"string"===typeof e?e.replace(z,(function(e,n){return n in t?t[n]:e})):e},B=function(e,t,n){var r=e[t],a=F(r,n);a!==r&&(e[t]=a)},U={onCreateRule:function(e,t,n){return"string"===typeof e&&P.test(e)?new D(e,t,n):null},onProcessStyle:function(e,t,n){return"style"===t.type&&n?("animation-name"in e&&B(e,"animation-name",n.keyframes),"animation"in e&&B(e,"animation",n.keyframes),e):e},onChangeValue:function(e,t,n){var r=n.options.sheet;if(!r)return e;switch(t){case"animation":case"animation-name":return F(e,r.keyframes);default:return e}}},W=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).renderable=void 0,t}return Object(f.a)(t,e),t.prototype.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?Object(r.a)({},e,{allowEmpty:!0}):e;return O(this.key,this.style,n)},t}(j),V={onCreateRule:function(e,t,n){return n.parent&&"keyframes"===n.parent.type?new W(e,t,n):null}},G=function(){function e(e,t,n){this.type="font-face",this.at="@font-face",this.key=void 0,this.style=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){if(Array.isArray(this.style)){for(var t="",n=0;n<this.style.length;n++)t+=O(this.at,this.style[n]),this.style[n+1]&&(t+="\n");return t}return O(this.at,this.style,e)},e}(),H=/@font-face/,q={onCreateRule:function(e,t,n){return H.test(e)?new G(e,t,n):null}},X=function(){function e(e,t,n){this.type="viewport",this.at="@viewport",this.key=void 0,this.style=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){return O(this.key,this.style,e)},e}(),Y={onCreateRule:function(e,t,n){return"@viewport"===e||"@-ms-v
2iewport"===e?new X(e,t,n):null}},K=function(){function e(e,t,n){this.type="simple",this.key=void 0,this.value=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.value=t,this.options=n}return e.prototype.toString=function(e){if(Array.isArray(this.value)){for(var t="",n=0;n<this.value.length;n++)t+=this.key+" "+this.value[n]+";",this.value[n+1]&&(t+="\n");return t}return this.key+" "+this.value+";"},e}(),Z={"@charset":!0,"@import":!0,"@namespace":!0},J=[T,R,U,V,q,Y,{onCreateRule:function(e,t,n){return e in Z?new K(e,t,n):null}}],Q={process:!0},$={force:!0,process:!0},ee=function(){function e(e){this.map={},this.raw={},this.index=[],this.counter=0,this.options=void 0,this.classes=void 0,this.keyframes=void 0,this.options=e,this.classes=e.classes,this.keyframes=e.keyframes}var t=e.prototype;return t.add=function(e,t,n){var a=this.options,i=a.parent,o=a.sheet,s=a.jss,u=a.Renderer,c=a.generateId,l=a.scoped,h=Object(r.a)({classes:this.classes,parent:i,sheet:o,jss:s,Renderer:u,generateId:c,scoped:l,name:e,keyframes:this.keyframes,selector:void 0},n),d=e;e in this.raw&&(d=e+"-d"+this.counter++),this.raw[d]=t,d in this.classes&&(h.selector="."+_(this.classes[d]));var f=b(d,t,h);if(!f)return null;this.register(f);var p=void 0===h.index?this.index.length:h.index;return this.index.splice(p,0,f),f},t.get=function(e){return this.map[e]},t.remove=function(e){this.unregister(e),delete this.raw[e.key],this.index.splice(this.index.indexOf(e),1)},t.indexOf=function(e){return this.index.indexOf(e)},t.process=function(){var e=this.options.jss.plugins;this.index.slice(0).forEach(e.onProcessRule,e)},t.register=function(e){this.map[e.key]=e,e instanceof E?(this.map[e.selector]=e,e.id&&(this.classes[e.key]=e.id)):e instanceof D&&this.keyframes&&(this.keyframes[e.name]=e.id)},t.unregister=function(e){delete this.map[e.key],e instanceof E?(delete this.map[e.selector],delete this.classes[e.key]):e instanceof D&&delete this.keyframes[e.name]},t.update=function(){var e,t,n;if("string"===typeof(arguments.length<=0?void 0:arguments[0])?(e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],n=arguments.length<=2?void 0:arguments[2]):(t=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],e=null),e)this.updateOne(this.map[e],t,n);else for(var r=0;r<this.index.length;r++)this.updateOne(this.index[r],t,n)},t.updateOne=function(t,n,r){void 0===r&&(r=Q);var a=this.options,i=a.jss.plugins,o=a.sheet;if(t.rules instanceof e)t.rules.update(n,r);else{var s=t,u=s.style;if(i.onUpdate(n,t,o,r),r.process&&u&&u!==s.style){for(var c in i.onProcessStyle(s.style,s,o),s.style){var l=s.style[c];l!==u[c]&&s.prop(c,l,$)}for(var h in u){var d=s.style[h],f=u[h];null==d&&d!==f&&s.prop(h,null,$)}}}},t.toString=function(e){for(var t="",n=this.options.sheet,r=!!n&&n.options.link,a=0;a<this.index.length;a++){var i=this.index[a].toString(e);(i||r)&&(t&&(t+="\n"),t+=i)}return t},e}(),te=function(){function e(e,t){for(var n in this.options=void 0,this.deployed=void 0,this.attached=void 0,this.rules=void 0,this.renderer=void 0,this.classes=void 0,this.keyframes=void 0,this.queue=void 0,this.attached=!1,this.deployed=!1,this.classes={},this.keyframes={},this.options=Object(r.a)({},t,{sheet:this,parent:this,classes:this.classes,keyframes:this.keyframes}),t.Renderer&&(this.renderer=new t.Renderer(this)),this.rules=new ee(this.options),e)this.rules.add(n,e[n]);this.rules.process()}var t=e.prototype;return t.attach=function(){return this.attached||(this.renderer&&this.renderer.attach(),this.attached=!0,this.deployed||this.deploy()),this},t.detach=function(){return this.attached?(this.renderer&&this.renderer.detach(),this.attached=!1,this):this},t.addRule=function(e,t,n){var r=this.queue;this.attached&&!r&&(this.queue=[]);var a=this.rules.add(e,t,n);return a?(this.options.jss.plugins.onProcessRule(a),this.attached?this.deployed?(r?r.push(a):(this.insertRule(a),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0)),a):a:(this.deployed=!1,a)):null},t.insertRule=function(e){this.renderer&&this.renderer.insertRule(e)},t.addRules=function(e,t){var n=[];for(var r in e){var a=this.addRule(r,e[r],t);a&&n.push(a)}return n},t.getRule=function(e){return this.rules.get(e)},t.deleteRule=function(e){var t="object"===typeof e?e:this.rules.get(e);return!!t&&(this.rules.remove(t),!(this.attached&&t.renderable&&this.renderer)||this.renderer.deleteRule(t.renderable))},t.indexOf=function(e){return this.rules.indexOf(e)},t.deploy=function(){return this.renderer&&this.renderer.deploy(),this.deployed=!0,this},t.update=function(){var e;return(e=this.rules).update.apply(e,arguments),this},t.updateOne=function(e,t,n){return this.rules.updateOne(e,t,n),this},t.toString=function(e){return this.rules.toString(e)},e}(),ne=function(){function e(){this.plugins={internal:[],external:[]},this.registry=void 0}var t=e.prototype;return t.onCreateRule=function(e,t,n){for(var r=0;r<this.registry.onCreateRule.length;r++){var a=this.registry.onCreateRule[r](e,t,n);if(a)return a}return null},t.onProcessRule=function(e){if(!e.isProcessed){for(var t=e.options.sheet,n=0;n<this.registry.onProcessRule.length;n++)this.registry.onProcessRule[n](e,t);e.style&&this.onProcessStyle(e.style,e,t),e.isProcessed=!0}},t.onProcessStyle=function(e,t,n){for(var r=0;r<this.registry.onProcessStyle.length;r++)t.style=this.registry.onProcessStyle[r](t.style,t,n)},t.onProcessSheet=function(e){for(var t=0;t<this.registry.onProcessSheet.length;t++)this.registry.onProcessSheet[t](e)},t.onUpdate=function(e,t,n,r){for(var a=0;a<this.registry.onUpdate.length;a++)this.registry.onUpdate[a](e,t,n,r)},t.onChangeValue=function(e,t,n){for(var r=e,a=0;a<this.registry.onChangeValue.length;a++)r=this.registry.onChangeValue[a](r,t,n);return r},t.use=function(e,t){void 0===t&&(t={queue:"external"});var n=this.plugins[t.queue];-1===n.indexOf(e)&&(n.push(e),this.registry=[].concat(this.plugins.external,this.plugins.internal).reduce((function(e,t){for(var n in t)n in e&&e[n].push(t[n]);return e}),{onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}))},e}(),re=new(function(){function e(){this.registry=[]}var t=e.prototype;return t.add=function(e){var t=this.registry,n=e.options.index;if(-1===t.indexOf(e))if(0===t.length||n>=this.index)t.push(e);else for(var r=0;r<t.length;r++)if(t[r].options.index>n)return void t.splice(r,0,e)},t.reset=function(){this.registry=[]},t.remove=function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},t.toString=function(e){for(var t=void 0===e?{}:e,n=t.attached,r=Object(m.a)(t,["attached"]),a="",i=0;i<this.registry.length;i++){var o=this.registry[i];null!=n&&o.attached!==n||(a&&(a+="\n"),a+=o.toString(r))}return a},d(e,[{key:"index",get:function(){return 0===this.registry.length?0:this.registry[this.registry.length-1].options.index}}]),e}()),ae="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),ie="2f1acc6c3a606b082e5eef5e54414ffb";null==ae[ie]&&(ae[ie]=0);var oe=ae[ie]++,se=function(e){void 0===e&&(e={});var t=0;return function(n,r){t+=1;var a="",i="";return r&&(r.options.classNamePrefix&&(i=r.options.classNamePrefix),null!=r.options.jss.id&&(a=String(r.options.jss.id))),e.minify?""+(i||"c")+oe+a+t:i+n.key+"-"+oe+(a?"-"+a:"")+"-"+t}},ue=function(e){var t;return function(){return t||(t=e()),t}};function ce(e,t){try{return e.attributeStyleMap?e.attributeStyleMap.get(t):e.style.getPropertyValue(t)}catch(n){return""}}function le(e,t,n){try{var r=n;if(Array.isArray(n)&&(r=x(n,!0),"!important"===n[n.length-1]))return e.style.setProperty(t,r,"
2important"),!0;e.attributeStyleMap?e.attributeStyleMap.set(t,r):e.style.setProperty(t,r)}catch(a){return!1}return!0}function he(e,t){try{e.attributeStyleMap?e.attributeStyleMap.delete(t):e.style.removeProperty(t)}catch(n){}}function de(e,t){return e.selectorText=t,e.selectorText===t}var fe=ue((function(){return document.querySelector("head")}));function pe(e){var t=re.registry;if(t.length>0){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.attached&&r.options.index>t.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if((n=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e))&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&"string"===typeof r){var a=function(e){for(var t=fe(),n=0;n<t.childNodes.length;n++){var r=t.childNodes[n];if(8===r.nodeType&&r.nodeValue.trim()===e)return r}return null}(r);if(a)return{parent:a.parentNode,node:a.nextSibling}}return!1}var me=ue((function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null})),ve=function(e,t,n){var r=e.cssRules.length;(void 0===n||n>r)&&(n=r);try{if("insertRule"in e)e.insertRule(t,n);else if("appendRule"in e){e.appendRule(t)}}catch(a){return!1}return e.cssRules[n]},ge=function(){function e(e){this.getPropertyValue=ce,this.setProperty=le,this.removeProperty=he,this.setSelector=de,this.element=void 0,this.sheet=void 0,this.hasInsertedRules=!1,e&&re.add(e),this.sheet=e;var t=this.sheet?this.sheet.options:{},n=t.media,r=t.meta,a=t.element;this.element=a||function(){var e=document.createElement("style");return e.textContent="\n",e}(),this.element.setAttribute("data-jss",""),n&&this.element.setAttribute("media",n),r&&this.element.setAttribute("data-meta",r);var i=me();i&&this.element.setAttribute("nonce",i)}var t=e.prototype;return t.attach=function(){if(!this.element.parentNode&&this.sheet){!function(e,t){var n=t.insertionPoint,r=pe(t);if(!1!==r&&r.parent)r.parent.insertBefore(e,r.node);else if(n&&"number"===typeof n.nodeType){var a=n,i=a.parentNode;i&&i.insertBefore(e,a.nextSibling)}else fe().appendChild(e)}(this.element,this.sheet.options);var e=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&e&&(this.hasInsertedRules=!1,this.deploy())}},t.detach=function(){var e=this.element.parentNode;e&&e.removeChild(this.element)},t.deploy=function(){var e=this.sheet;e&&(e.options.link?this.insertRules(e.rules):this.element.textContent="\n"+e.toString()+"\n")},t.insertRules=function(e,t){for(var n=0;n<e.index.length;n++)this.insertRule(e.index[n],n,t)},t.insertRule=function(e,t,n){if(void 0===n&&(n=this.element.sheet),e.rules){var r=e,a=n;return("conditional"!==e.type&&"keyframes"!==e.type||!1!==(a=ve(n,r.toString({children:!1}),t)))&&(this.insertRules(r.rules,a),a)}if(e.renderable&&e.renderable.parentStyleSheet===this.element.sheet)return e.renderable;var i=e.toString();if(!i)return!1;var o=ve(n,i,t);return!1!==o&&(this.hasInsertedRules=!0,e.renderable=o,o)},t.deleteRule=function(e){var t=this.element.sheet,n=this.indexOf(e);return-1!==n&&(t.deleteRule(n),!0)},t.indexOf=function(e){for(var t=this.element.sheet.cssRules,n=0;n<t.length;n++)if(e===t[n])return n;return-1},t.replaceRule=function(e,t){var n=this.indexOf(e);return-1!==n&&(this.element.sheet.deleteRule(n),this.insertRule(t,n))},t.getRules=function(){return this.element.sheet.cssRules},e}(),be=0,ye=function(){function e(e){this.id=be++,this.version="10.4.0",this.plugins=new ne,this.options={id:{minify:!1},createGenerateId:se,Renderer:l?ge:null,plugins:[]},this.generateId=se({minify:!1});for(var t=0;t<J.length;t++)this.plugins.use(J[t],{queue:"internal"});this.setup(e)}var t=e.prototype;return t.setup=function(e){return void 0===e&&(e={}),e.createGenerateId&&(this.options.createGenerateId=e.createGenerateId),e.id&&(this.options.id=Object(r.a)({},this.options.id,e.id)),(e.createGenerateId||e.id)&&(this.generateId=this.options.createGenerateId(this.options.id)),null!=e.insertionPoint&&(this.options.insertionPoint=e.insertionPoint),"Renderer"in e&&(this.options.Renderer=e.Renderer),e.plugins&&this.use.apply(this,e.plugins),this},t.createStyleSheet=function(e,t){void 0===t&&(t={});var n=t.index;"number"!==typeof n&&(n=0===re.index?0:re.index+1);var a=new te(e,Object(r.a)({},t,{jss:this,generateId:t.generateId||this.generateId,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:n}));return this.plugins.onProcessSheet(a),a},t.removeStyleSheet=function(e){return e.detach(),re.remove(e),this},t.createRule=function(e,t,n){if(void 0===t&&(t={}),void 0===n&&(n={}),"object"===typeof e)return this.createRule(void 0,e,t);var a=Object(r.a)({},n,{name:e,jss:this,Renderer:this.options.Renderer});a.generateId||(a.generateId=this.generateId),a.classes||(a.classes={}),a.keyframes||(a.keyframes={});var i=b(e,t,a);return i&&this.plugins.onProcessRule(i),i},t.use=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];
2return n.forEach((function(t){e.plugins.use(t)})),this},e}();var xe="undefined"!==typeof CSS&&CSS&&"number"in CSS,we=function(e){return new ye(e)};we();function Oe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.baseClasses,n=e.newClasses;e.Component;if(!n)return t;var a=Object(r.a)({},t);return Object.keys(n).forEach((function(e){n[e]&&(a[e]="".concat(t[e]," ").concat(n[e]))})),a}var ke={set:function(e,t,n,r){var a=e.get(t);a||(a=new Map,e.set(t,a)),a.set(n,r)},get:function(e,t,n){var r=e.get(t);return r?r.get(n):void 0},delete:function(e,t,n){e.get(t).delete(n)}},Se=n(396),_e="function"===typeof Symbol&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__",je=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];var Ee=Date.now(),Te="fnValues"+Ee,Ce="fnStyle"+ ++Ee;var Me=function(){return{onCreateRule:function(e,t,n){if("function"!==typeof t)return null;var r=b(e,{},n);return r[Ce]=t,r},onProcessStyle:function(e,t){if(Te in t||Ce in t)return e;var n={};for(var r in e){var a=e[r];"function"===typeof a&&(delete e[r],n[r]=a)}return t[Te]=n,e},onUpdate:function(e,t,n,r){var a=t,i=a[Ce];i&&(a.style=i(e)||{});var o=a[Te];if(o)for(var s in o)a.prop(s,o[s](e),r)}}},Ae="@global",Ne=function(){function e(e,t,n){for(var a in this.type="global",this.at=Ae,this.rules=void 0,this.options=void 0,this.key=void 0,this.isProcessed=!1,this.key=e,this.options=n,this.rules=new ee(Object(r.a)({},n,{parent:this})),t)this.rules.add(a,t[a]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return this.options.jss.plugins.onProcessRule(r),r},t.indexOf=function(e){return this.rules.indexOf(e)},t.toString=function(){return this.rules.toString()},e}(),Re=function(){function e(e,t,n){this.type="global",this.at=Ae,this.options=void 0,this.rule=void 0,this.isProcessed=!1,this.key=void 0,this.key=e,this.options=n;var a=e.substr("@global ".length);this.rule=n.jss.createRule(a,t,Object(r.a)({},n,{parent:this}))}return e.prototype.toString=function(e){return this.rule?this.rule.toString(e):""},e}(),Ie=/\s*,\s*/g;function Le(e,t){for(var n=e.split(Ie),r="",a=0;a<n.length;a++)r+=t+" "+n[a].trim(),n[a+1]&&(r+=", ");return r}var De=function(){return{onCreateRule:function(e,t,n){if(!e)return null;if(e===Ae)return new Ne(e,t,n);if("@"===e[0]&&"@global "===e.substr(0,"@global ".length))return new Re(e,t,n);var r=n.parent;return r&&("global"===r.type||r.options.parent&&"global"===r.options.parent.type)&&(n.scoped=!1),!1===n.scoped&&(n.selector=e),null},onProcessRule:function(e){"style"===e.type&&(function(e){var t=e.options,n=e.style,a=n?n[Ae]:null;if(a){for(var i in a)t.sheet.addRule(i,a[i],Object(r.a)({},t,{selector:Le(i,e.selector)}));delete n[Ae]}}(e),function(e){var t=e.options,n=e.style;for(var a in n)if("@"===a[0]&&a.substr(0,Ae.length)===Ae){var i=Le(a.substr(Ae.length),e.selector);t.sheet.addRule(i,n[a],Object(r.a)({},t,{selector:i})),delete n[a]}}(e))}}},Pe=/\s*,\s*/g,ze=/&/g,Fe=/\$([\w-]+)/g;var Be=function(){function e(e,t){return function(n,r){var a=e.getRule(r)||t&&t.getRule(r);return a?(a=a).selector:r}}function t(e,t){for(var n=t.split(Pe),r=e.split(Pe),a="",i=0;i<n.length;i++)for(var o=n[i],s=0;s<r.length;s++){var u=r[s];a&&(a+=", "),a+=-1!==u.indexOf("&")?u.replace(ze,o):o+" "+u}return a}function n(e,t,n){if(n)return Object(r.a)({},n,{index:n.index+1});var a=e.options.nestingLevel;a=void 0===a?1:a+1;var i=Object(r.a)({},e.options,{nestingLevel:a,index:t.indexOf(e)+1});return delete i.name,i}return{onProcessStyle:function(a,i,o){if("style"!==i.type)return a;var s,u,c=i,l=c.options.parent;for(var h in a){var d=-1!==h.indexOf("&"),f="@"===h[0];if(d||f){if(s=n(c,l,s),d){var p=t(h,c.selector);u||(u=e(l,o)),p=p.replace(Fe,u),l.addRule(p,a[h],Object(r.a)({},s,{selector:p}))}else f&&l.addRule(h,{},s).addRule(c.key,a[h],{selector:c.selector});delete a[h]}}return a}}},Ue=/[A-Z]/g,We=/^ms-/,Ve={};function Ge(e){return"-"+e.toLowerCase()}var He=function(e){if(Ve.hasOwnProperty(e))return Ve[e];var t=e.replace(Ue,Ge);return Ve[e]=We.test(t)?"-"+t:t};function qe(e){var t={};for(var n in e){t[0===n.indexOf("--")?n:He(n)]=e[n]}return e.fallbacks&&(Array.isArray(e.fallbacks)?t.fallbacks=e.fallbacks.map(qe):t.fallbacks=qe(e.fallbacks)),t}var Xe=function(){return{onProcessStyle:function(e){if(Array.isArray(e)){for(var t=0;t<e.length;t++)e[t]=qe(e[t]);return e}return qe(e)},onChangeValue:function(e,t,n){if(0===t.indexOf("--"))return e;var r=He(t);return t===r?e:(n.prop(r,e),null)}}},Ye=xe&&CSS?CSS.px:"px",Ke=xe&&CSS?CSS.ms:"ms",Ze=xe&&CSS?CSS.percent:"%";function Je(e){var t=/(-[a-z])/g,n=function(e){return e[1].toUpperCase()},r={};for(var a in e)r[a]=e[a],r[a.replace(t,n)]=e[a];return r}var Qe=Je({"animation-delay":Ke,"animation-duration":Ke,"background-position":Ye,"background-position-x":Ye,"background-position-y":Ye,"background-size":Ye,border:Ye,"border-bottom":Ye,"border-bottom-left-radius":Ye,"border-bottom-right-radius":Ye,"border-bottom-width":Ye,"border-left":Ye,"border-left-width":Ye,"border-radius":Ye,"border-right":Ye,"border-right-width":Ye,"border-top":Ye,"border-top-left-radius":Ye,"border-top-right-radius":Ye,"border-top-width":Ye,"border-width":Ye,margin:Ye,"margin-bottom":Ye,"margin-left":Ye,"margin-right":Ye,"margin-top":Ye,padding:Ye,"padding-bottom":Ye,"padding-left":Ye,"padding-right":Ye,"padding-top":Ye,"mask-position-x":Ye,"mask-position-y":Ye,"mask-size":Ye,height:Ye,width:Ye,"min-height":Ye,"max-height":Ye,"min-width":Ye,"max-width":Ye,bottom:Ye,left:Ye,top:Ye,right:Ye,"box-shadow":Ye,"text-shadow":Ye,"column-gap":Ye,"column-rule":Ye,"column-rule-width":Ye,"column-width":Ye,"font-size":Ye,"font-size-delta":Ye,"letter-spacing":Ye,"text-indent":Ye,"text-stroke":Ye,"text-stroke-width":Ye,"word-spacing":Ye,motion:Ye,"motion-offset":Ye,outline:Ye,"outline-offset":Ye,"outline-width":Ye,perspective:Ye,"perspective-origin-x":Ze,"perspective-origin-y":Ze,"transform-origin":Ze,"transform-origin-x":Ze,"transform-origin-y":Ze,"transform-origin-z":Ze,"transition-delay":Ke,"transition-duration":Ke,"vertical-align":Ye,"flex-basis":Ye,"shape-margin":Ye,size:Ye,grid:Ye,"grid-gap":Ye,"grid-row-gap":Ye,"grid-column-gap":Ye,"grid-template-rows":Ye,"grid-template-columns":Ye,"grid-auto-rows":Ye,"grid-auto-columns":Ye,"box-shadow-x":Ye,"box-shadow-y":Ye,"box-shadow-blur":Ye,"box-shadow-spread":Ye,"font-line-height":Ye,"text-shadow-x":Ye,"text-shadow-y":Ye,"text-shadow-blur":Ye});function $e(e,t,n){if(!t)return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)t[r]=$e(e,t[r],n);else if("object"===typeof t)if("fallbacks"===e)for(var a in t)t[a]=$e(a,t[a],n);else for(var i in t)t[i]=$e(e+"-"+i,t[i],n);else if("number"===typeof t){var o=n[e]||Qe[e];return o?"function"===typeof o?o(t).toString():""+t+o:t.toString()}return t}var et=function(e){void 0===e&&(e={});var t=Je(e);return{onProcessStyle:function(e,n){if("style"!==n.type)return e;for(var r in e)e[r]=$e(r,e[r],t);return e},onChangeValue:function(e,n){return $e(n,e,t)}}},tt=n(108),nt="",rt="",at="",it="",ot=l&&"ontouchstart"in document.documentElement;if(l){var st={Moz:"-moz-",ms:"-ms-",O:"-o-",Webkit:"-webkit-"},ut=document.createElement("p").style;for(var ct in st)if(ct+"Transform"in ut){nt=ct,rt=st[ct];break}"Webkit"===nt&&"msHyphens"in ut&&(nt="ms",rt=st.ms,it="edge"),"Webkit"===nt&&"-apple-trailing-word"in ut&&(at="apple")}var lt=nt,ht=rt,dt=at,ft=it,pt=ot;var mt={noPrefill:["appearance"],supportedProperty:function(e){return"appearance"===e&&("ms"===lt?"-webkit-"+e:ht+e)}},vt={noPrefill:["color-adjust"],supportedProperty:function(e){return"color-adjust"===e&&("Webkit"===lt?ht+"print-"+e:e)}},gt=/[-\s]+(.)?/g;function bt(e,t){return t?t.toUpperCase():""}function yt(e){return e.replace(gt,bt)}function xt(e){return yt("-"+e)}var wt,Ot={noPrefill:["mask"],supportedProperty:function(e,t){if(!/^mask/.test(e))return!1;if("Webkit"===lt){if(yt("mask-image")in t)return e;if(lt+xt("mask-image")in t)return ht+e}return e}},kt={noPrefill:["text-orientation"],supportedProperty:function(e){return"text-orientation"===e&&("apple"!==dt||pt?e:ht+e)}},St={noPrefill:["transform"],supportedProperty:function(e,t,n){return"transform"===e&&(n.transform?e:ht+e)}},_t={noPrefill:["transition"],supportedProperty:function(e,t,n){return"transition"===e&&(n.transition?e:ht+e)}},jt={noPrefill:["writing-mode"],supportedProperty:function(e){return"writing-mode"===e&&("Webkit"===lt||"ms"===lt&&"edge"!==ft?ht+e:e)}},Et={noPrefill:["user-select"],supportedProperty:function(e){return"user-select"===e&&("Moz"===lt||"ms"===lt||"apple"===dt?ht+e:e)}}
2,Tt={supportedProperty:function(e,t){return!!/^break-/.test(e)&&("Webkit"===lt?"WebkitColumn"+xt(e)in t&&ht+"column-"+e:"Moz"===lt&&("page"+xt(e)in t&&"page-"+e))}},Ct={supportedProperty:function(e,t){if(!/^(border|margin|padding)-inline/.test(e))return!1;if("Moz"===lt)return e;var n=e.replace("-inline","");return lt+xt(n)in t&&ht+n}},Mt={supportedProperty:function(e,t){return yt(e)in t&&e}},At={supportedProperty:function(e,t){var n=xt(e);return"-"===e[0]||"-"===e[0]&&"-"===e[1]?e:lt+n in t?ht+e:"Webkit"!==lt&&"Webkit"+n in t&&"-webkit-"+e}},Nt={supportedProperty:function(e){return"scroll-snap"===e.substring(0,11)&&("ms"===lt?""+ht+e:e)}},Rt={supportedProperty:function(e){return"overscroll-behavior"===e&&("ms"===lt?ht+"scroll-chaining":e)}},It={"flex-grow":"flex-positive","flex-shrink":"flex-negative","flex-basis":"flex-preferred-size","justify-content":"flex-pack",order:"flex-order","align-items":"flex-align","align-content":"flex-line-pack"},Lt={supportedProperty:function(e,t){var n=It[e];return!!n&&(lt+xt(n)in t&&ht+n)}},Dt={flex:"box-flex","flex-grow":"box-flex","flex-direction":["box-orient","box-direction"],order:"box-ordinal-group","align-items":"box-align","flex-flow":["box-orient","box-direction"],"justify-content":"box-pack"},Pt=Object.keys(Dt),zt=function(e){return ht+e},Ft=[mt,vt,Ot,kt,St,_t,jt,Et,Tt,Ct,Mt,At,Nt,Rt,Lt,{supportedProperty:function(e,t,n){var r=n.multiple;if(Pt.indexOf(e)>-1){var a=Dt[e];if(!Array.isArray(a))return lt+xt(a)in t&&ht+a;if(!r)return!1;for(var i=0;i<a.length;i++)if(!(lt+xt(a[0])in t))return!1;return a.map(zt)}return!1}}],Bt=Ft.filter((function(e){return e.supportedProperty})).map((function(e){return e.supportedProperty})),Ut=Ft.filter((function(e){return e.noPrefill})).reduce((function(e,t){return e.push.apply(e,Object(tt.a)(t.noPrefill)),e}),[]),Wt={};if(l){wt=document.createElement("p");var Vt=window.getComputedStyle(document.documentElement,"");for(var Gt in Vt)isNaN(Gt)||(Wt[Vt[Gt]]=Vt[Gt]);Ut.forEach((function(e){return delete Wt[e]}))}function Ht(e,t){if(void 0===t&&(t={}),!wt)return e;if(null!=Wt[e])return Wt[e];"transition"!==e&&"transform"!==e||(t[e]=e in wt.style);for(var n=0;n<Bt.length&&(Wt[e]=Bt[n](e,wt.style,t),!Wt[e]);n++);try{wt.style[e]=""}catch(r){return!1}return Wt[e]}var qt,Xt={},Yt={transition:1,"transition-property":1,"-webkit-transition":1,"-webkit-transition-property":1},Kt=/(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g;function Zt(e,t,n){if("var"===t)return"var";if("all"===t)return"all";if("all"===n)return", all";var r=t?Ht(t):", "+Ht(n);return r||(t||n)}function Jt(e,t){var n=t;if(!qt||"content"===e)return t;if("string"!==typeof n||!isNaN(parseInt(n,10)))return n;var r=e+n;if(null!=Xt[r])return Xt[r];try{qt.style[e]=n}catch(a){return Xt[r]=!1,!1}if(Yt[e])n=n.replace(Kt,Zt);else if(""===qt.style[e]&&("-ms-flex"===(n=ht+n)&&(qt.style[e]="-ms-flexbox"),qt.style[e]=n,""===qt.style[e]))return Xt[r]=!1,!1;return qt.style[e]="",Xt[r]=n,Xt[r]}l&&(qt=document.createElement("p"));var Qt=function(){function e(t){for(var n in t){var r=t[n];if("fallbacks"===n&&Array.isArray(r))t[n]=r.map(e);else{var a=!1,i=Ht(n);i&&i!==n&&(a=!0);var o=!1,s=Jt(i,x(r));s&&s!==r&&(o=!0),(a||o)&&(a&&delete t[n],t[i||n]=s||r)}}return t}return{onProcessRule:function(e){if("keyframes"===e.type){var t=e;t.at="-"===(n=t.at)[1]||"ms"===lt?n:"@"+ht+"keyframes"+n.substr(10)}var n},onProcessStyle:function(t,n){return"style"!==n.type?t:e(t)},onChangeValue:function(e,t){return Jt(t,x(e))||e}}};var $t=function(){var e=function(e,t){return e.length===t.length?e>t?1:-1:e.length-t.length};return{onProcessStyle:function(t,n){if("style"!==n.type)return t;for(var r={},a=Object.keys(t).sort(e),i=0;i<a.length;i++)r[a[i]]=t[a[i]];return r}}};function en(){return{plugins:[Me(),De(),Be(),Xe(),et(),"undefined"===typeof window?null:Qt(),$t()]}}var tn=we(en()),nn={disableGeneration:!1,generateClassName:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.disableGlobal,n=void 0!==t&&t,r=e.productionPrefix,a=void 0===r?"jss":r,i=e.seed,o=void 0===i?"":i,s=""===o?"":"".concat(o,"-"),u=0,c=function(){return u+=1};return function(e,t){var r=t.options.name;if(r&&0===r.indexOf("Mui")&&!t.options.link&&!n){if(-1!==je.indexOf(e.key))return"Mui-".concat(e.key);var i="".concat(s).concat(r,"-").concat(e.key);return t.options.theme[_e]&&""===o?"".concat(i,"-").concat(c()):i}return"".concat(s).concat(a).concat(c())}}(),jss:tn,sheetsCache:null,sheetsManager:new Map,sheetsRegistry:null},rn=o.a.createContext(nn);var an=-1e9;function on(){return an+=1}n(173);var sn=n(413);function un(e){var t="function"===typeof e;return{create:function(n,a){var i;try{i=t?e(n):e}catch(u){throw u}if(!a||!n.overrides||!n.overrides[a])return i;var o=n.overrides[a],s=Object(r.a)({},i);
2return Object.keys(o).forEach((function(e){s[e]=Object(sn.a)(s[e],o[e])})),s},options:{}}}var cn={};function ln(e,t,n){var r=e.state;if(e.stylesOptions.disableGeneration)return t||{};r.cacheClasses||(r.cacheClasses={value:null,lastProp:null,lastJSS:{}});var a=!1;return r.classes!==r.cacheClasses.lastJSS&&(r.cacheClasses.lastJSS=r.classes,a=!0),t!==r.cacheClasses.lastProp&&(r.cacheClasses.lastProp=t,a=!0),a&&(r.cacheClasses.value=Oe({baseClasses:r.cacheClasses.lastJSS,newClasses:t,Component:n})),r.cacheClasses.value}function hn(e,t){var n=e.state,a=e.theme,i=e.stylesOptions,o=e.stylesCreator,s=e.name;if(!i.disableGeneration){var u=ke.get(i.sheetsManager,o,a);u||(u={refs:0,staticSheet:null,dynamicStyles:null},ke.set(i.sheetsManager,o,a,u));var c=Object(r.a)(Object(r.a)(Object(r.a)({},o.options),i),{},{theme:a,flip:"boolean"===typeof i.flip?i.flip:"rtl"===a.direction});c.generateId=c.serverGenerateClassName||c.generateClassName;var l=i.sheetsRegistry;if(0===u.refs){var h;i.sheetsCache&&(h=ke.get(i.sheetsCache,o,a));var d=o.create(a,s);h||((h=i.jss.createStyleSheet(d,Object(r.a)({link:!1},c))).attach(),i.sheetsCache&&ke.set(i.sheetsCache,o,a,h)),l&&l.add(h),u.staticSheet=h,u.dynamicStyles=function e(t){var n=null;for(var r in t){var a=t[r],i=typeof a;if("function"===i)n||(n={}),n[r]=a;else if("object"===i&&null!==a&&!Array.isArray(a)){var o=e(a);o&&(n||(n={}),n[r]=o)}}return n}(d)}if(u.dynamicStyles){var f=i.jss.createStyleSheet(u.dynamicStyles,Object(r.a)({link:!0},c));f.update(t),f.attach(),n.dynamicSheet=f,n.classes=Oe({baseClasses:u.staticSheet.classes,newClasses:f.classes}),l&&l.add(f)}else n.classes=u.staticSheet.classes;u.refs+=1}}function dn(e,t){var n=e.state;n.dynamicSheet&&n.dynamicSheet.update(t)}function fn(e){var t=e.state,n=e.theme,r=e.stylesOptions,a=e.stylesCreator;if(!r.disableGeneration){var i=ke.get(r.sheetsManager,a,n);i.refs-=1;var o=r.sheetsRegistry;0===i.refs&&(ke.delete(r.sheetsManager,a,n),r.jss.removeStyleSheet(i.staticSheet),o&&o.remove(i.staticSheet)),t.dynamicSheet&&(r.jss.removeStyleSheet(t.dynamicSheet),o&&o.remove(t.dynamicSheet))}}function pn(e,t){var n,r=o.a.useRef([]),a=o.a.useMemo((function(){return{}}),t);r.current!==a&&(r.current=a,n=e()),o.a.useEffect((function(){return function(){n&&n()}}),[a])}function mn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.name,i=t.classNamePrefix,s=t.Component,u=t.defaultTheme,c=void 0===u?cn:u,l=Object(a.a)(t,["name","classNamePrefix","Component","defaultTheme"]),h=un(e),d=n||i||"makeStyles";h.options={index:on(),name:n,meta:d,classNamePrefix:d};var f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object(Se.a)()||c,a=Object(r.a)(Object(r.a)({},o.a.useContext(rn)),l),i=o.a.useRef(),u=o.a.useRef();
2pn((function(){var r={name:n,state:{},stylesCreator:h,stylesOptions:a,theme:t};return hn(r,e),u.current=!1,i.current=r,function(){fn(r)}}),[t,h]),o.a.useEffect((function(){u.current&&dn(i.current,e),u.current=!0}));var d=ln(i.current,e.classes,s);return d};return f}function vn(e){var t=e.theme,n=e.name,r=e.props;if(!t||!t.props||!t.props[n])return r;var a,i=t.props[n];for(a in i)void 0===r[a]&&(r[a]=i[a]);return r}var gn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var i=t.defaultTheme,s=t.withTheme,c=void 0!==s&&s,l=t.name,h=Object(a.a)(t,["defaultTheme","withTheme","name"]);var d=l,f=mn(e,Object(r.a)({defaultTheme:i,Component:n,name:l||n.displayName,classNamePrefix:d},h)),p=o.a.forwardRef((function(e,t){e.classes;var s,u=e.innerRef,h=Object(a.a)(e,["classes","innerRef"]),d=f(Object(r.a)(Object(r.a)({},n.defaultProps),e)),p=h;return("string"===typeof l||c)&&(s=Object(Se.a)()||i,l&&(p=vn({theme:s,name:l,props:h})),c&&!p.theme&&(p.theme=s)),o.a.createElement(n,Object(r.a)({ref:u||t,classes:d},p))}));return u()(p,n),p}},bn=n(233);t.a=function(e,t){return gn(e,Object(r.a)({defaultTheme:bn.a},t))}},function(e,t,n){e.exports=n(341)()},function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"f",(function(){return d})),n.d(t,"d",(function(){return l})),n.d(t,"e",(function(){return h})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return c}));var r=n(19),a=n(10),i=n(12),o=n(4),s=n(2);function u(e){return s.assert(s.isFunction(e),(function(){return"The f passed in grad(f) must be a function"})),function(t,n){var r=Object(o.a)(t,"x","tf.grad",null),i=null!=n?Object(o.a)(n,"dy","tf.grad"):null;return a.a.tidy((function(){var t=a.a.gradients((function(){return e(r)}),[r],i),n=t.value,o=t.grads;return null!=i&&s.assertShapesMatch(n.shape,i.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),p(o),o[0]}))}}function c(e){return s.assert(s.isFunction(e),(function(){return"The f passed in grads(f) must be a function"})),function(t,n){s.assert(Array.isArray(t),(function(){return"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s"}));var i=Object(o.b)(t,"args","tf.grads",null),u=null!=n?Object(o.a)(n,"dy","tf.grads"):null;return a.a.tidy((function(){var t=a.a.gradients((function(){return e.apply(void 0,Object(r.a)(i))}),i,u),n=t.value,o=t.grads;return null!=u&&s.assertShapesMatch(n.shape,u.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),p(o),o}))}}function l(e){return s.assert(s.isFunction(e),(function(){return"The f passed in valueAndGrad(f) must be a function"})),function(t,n){s.assert(t instanceof i.a,(function(){return"The x passed in valueAndGrad(f)(x) must be a tensor"})),s.assert(null==n||n instanceof i.a,(function(){return"The dy passed in valueAndGrad(f)(x, dy) must be a tensor"}));var r=a.a.gradients((function(){return e(t)}),[t],n),o=r.grads,u=r.value;return p(o),{grad:o[0],value:u}}}function h(e){return s.assert(s.isFunction(e),(function(){return"The f passed in valueAndGrads(f) must be a function"})),function(t,n){s.assert(Array.isArray(t)&&t.every((function(e){return e instanceof i.a})),(function(){return"The args passed in valueAndGrads(f)(args) must be array of tensors"})),s.assert(null==n||n instanceof i.a,(function(){return"The dy passed in valueAndGrads(f)(args, dy) must be a tensor"}));var o=a.a.gradients((function(){return e.apply(void 0,Object(r.a)(t))}),t,n);return null!=n&&s.assertShapesMatch(o.value.shape,n.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),p(o.grads),o}}function d(e,t){s.assert(s.isFunction(e),(function(){return"The f passed in variableGrads(f) must be a function"})),s.assert(null==t||Array.isArray(t)&&t.every((function(e){return e instanceof i.c})),(function(){return"The varList passed in variableGrads(f, varList) must be an array of variables"}));var n=null!=t;if(!n)for(var r in t=[],a.a.registeredVariables)t.push(a.a.registeredVariables[r]);var o=n?t.filter((function(e){return!e.trainable})):null,u=t.length;t=t.filter((function(e){return e.trainable})),s.assert(t.length>0,(function(){return"variableGrads() expects at least one of the input variables to "+"be trainable, but none of the ".concat(u," variables is ")+"trainable."}));var c=a.a.gradients(e,t,null,!0),l=c.value,h=c.grads;s.assert(h.some((function(e){return null!=e})),(function(){return"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize()."})),s.assert(0===l.rank,(function(){return"The f passed in variableGrads(f) must return a scalar, but it "+"returned a rank-".concat(l.rank," tensor")}));var d={};
2return t.forEach((function(e,t){null!=h[t]&&(d[e.name]=h[t])})),null!=o&&o.forEach((function(e){return d[e.name]=null})),{value:l,grads:d}}function f(e){return a.a.customGrad(e)}function p(e){if(e.filter((function(e){return null==e})).length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.")}},function(e,t,n){"use strict";var r;n.d(t,"a",(function(){return r})),function(e){e[e.NONE=0]="NONE",e[e.MEAN=1]="MEAN",e[e.SUM=2]="SUM",e[e.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"}(r||(r={}))},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({sqrt_:function(e){var t=Object(i.a)(e,"x","sqrt"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.sqrt(t);return n([t]),r}),n,null,a.Cc)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(134),u=n(29),c=n(9);var l=Object(c.b)({where_:function(e,t,n){var c=Object(i.a)(t,"a","where"),l=Object(i.a)(n,"b","where"),h=Object(i.a)(e,"condition","where","bool"),d=Object(u.a)(c.shape,l.shape),f=Object(s.a)(c,d),p=Object(s.a)(l,d);1===h.rank&&Object(o.assert)(h.shape[0]===c.shape[0],(function(){return"The first dimension of `a` must match the size of `condition`."})),1!==h.rank&&Object(o.assertShapesMatch)(h.shape,p.shape,"Error in where: ");var m={condition:h,t:f,e:p};return r.a.runKernelFunc((function(e,t){var n=e.select(h,f,p);return t([h]),n}),m,null,a.qc)}})},function(e,t,n){"use strict";(function(e){n.d(t,"f",(function(){return h})),n.d(t,"e",(function(){return f})),n.d(t,"a",(function(){return g})),n.d(t,"b",(function(){return b})),n.d(t,"d",(function(){return y})),n.d(t,"c",(function(){return x})),n.d(t,"g",(function(){return w}));var r=n(3),a=n.n(r),i=n(18),o=n(13),s=n(74),u=n(84),c=n(2),l=n(178);function h(e,t){return d.apply(this,arguments)}function d(){return(d=Object(o.a)(a.a.mark((function e(t,n){var r,i,s,u,c,l;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=[],i=[],s=Array.isArray(t)?t.map((function(e){return e.name})):Object.keys(t),u=function(e){var u=s[e],c=Array.isArray(t)?t[e].tensor:t[u];if("float32"!==c.dtype&&"int32"!==c.dtype&&"bool"!==c.dtype&&"string"!==c.dtype&&"complex64"!==c.dtype)throw new Error("Unsupported dtype in weight '".concat(u,"': ").concat(c.dtype));var l={name:u,shape:c.shape,dtype:c.dtype};if("string"===c.dtype){var h=new Promise(function(){var e=Object(o.a)(a.a.mark((function e(t){var n,r,i,o,s,u,l;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.bytes();case 2:for(n=e.sent,r=n.reduce((function(e,t){return e+t.length}),0)+4*n.length,i=new Uint8Array(r),o=0,s=0;s<n.length;s++)u=n[s],l=new Uint8Array(new Uint32Array([u.length]).buffer),i.set(l,o),o+=4,i.set(u,o),o+=u.length;t(i);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());i.push(h)}else i.push(c.data());null!=n&&(l.group=n),r.push(l)},c=0;c<s.length;++c)u(c);return e.next=7,Promise.all(i);case 7:return l=e.sent,e.abrupt("return",{data:p(l),specs:r});case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(e,t){var n,r,a={},o=0,h=Object(i.a)(t);try{for(h.s();!(r=h.n()).done;){var d=r.value,f=d.name,p=d.dtype,m=d.shape,v=Object(c.sizeFromShape)(m),g=void 0;if("quantization"in d){var b=d.quantization;if("uint8"===b.dtype||"uint16"===b.dtype){if(!("min"in b)||!("scale"in b))throw new Error("Weight ".concat(d.name," with quantization ").concat(b.dtype," ")+"doesn't have corresponding metadata min and scale.")}else{if("float16"!==b.dtype)throw new Error("Weight ".concat(d.name," has unknown ")+"quantization dtype ".concat(b.dtype,". ")+"Supported quantization dtypes are: 'uint8', 'uint16', and 'float16'.");if("float32"!==p)throw new Error("Weight ".concat(d.name," is quantized with ").concat(b.dtype," ")+"which only supports weights of type float32 not ".concat(p,"."))}var y=l.a[b.dtype],x=e.slice(o,o+v*y),w="uint8"===b.dtype?new Uint8Array(x):new Uint16Array(x);if("float32"===p)if("uint8"===b.dtype||"uint16"===b.dtype){g=new Float32Array(w.length);for(var k=0;k<w.length;k++){var S=w[k];g[k]=S*b.scale+b.min}}else{if("float16"!==b.dtype)throw new Error("Unsupported quantization type ".concat(b.dtype," ")+"for weight type float32.");void 0===n&&(n=O()),g=n(w)}else{if("int32"!==p)throw new Error("Unsupported dtype in weight '".concat(f,"': ").concat(p));if("uint8"!==b.dtype&&"uint16"!==b.dtype)throw new Error("Unsupported quantization type ".concat(b.dtype," ")+"for weight type int32.");g=new Int32Array(w.length);for(var _=0;_<w.length;_++){var j=w[_];g[_]=Math.round(j*b.scale+b.min)}}o+=v*y}else if("string"===p){var E=Object(c.sizeFromShape)(d.shape);g=[];for(var T=0;T<E;T++){var C=new Uint32Array(e.slice(o,o+4))[0];o+=4;var M=new Uint8Array(e.slice(o,o+C));g.push(M),o+=C}}else{var A=l.a[p],N=e.slice(o,o+v*A);if("float32"===p)g=new Float32Array(N);else if("int32"===p)g=new Int32Array(N);else if("bool"===p)g=new Uint8Array(N);else{if("complex64"!==p)throw new Error("Unsupported dtype in weight '".concat(f,"': ").concat(p));g=new Float32Array(N);for(var R=new Float32Array(g.length/2),I=new Float32Array(g.length/2),L=0;L<R.length;L++)R[L]=g[2*L],I[L]=g[2*L+1];var D=Object(u.a)(R,m,"float32"),P=Object(u.a)(I,m,"float32");a[f]=Object(s.a)(D,P)}o+=v*A}
2"complex64"!==p&&(a[f]=Object(u.a)(g,m,p))}}catch(z){h.e(z)}finally{h.f()}return a}function p(e){if(null===e)throw new Error("Invalid input value: ".concat(JSON.stringify(e)));var t=0,n=[];e.forEach((function(e){if(t+=e.byteLength,n.push(e.byteLength===e.buffer.byteLength?e:new e.constructor(e)),!(e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array))throw new Error("Unsupported TypedArray subtype: ".concat(e.constructor.name))}));var r=new Uint8Array(t),a=0;return n.forEach((function(e){r.set(new Uint8Array(e.buffer),a),a+=e.byteLength})),r.buffer}var m="undefined"!==typeof e&&("undefined"===typeof Blob||"undefined"===typeof atob||"undefined"===typeof btoa);function v(t){return m?e.byteLength(t):new Blob([t]).size}function g(t){if(m)return e.from(t).toString("base64");for(var n=new Uint8Array(t),r="",a=0,i=n.length;a<i;a++)r+=String.fromCharCode(n[a]);return btoa(r)}function b(t){if(m){var n=e.from(t,"base64");return n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength)}for(var r=atob(t),a=new Uint8Array(r.length),i=0;i<r.length;++i)a.set([r.charCodeAt(i)],i);return a.buffer}function y(e){if(1===e.length)return e[0];var t=0;e.forEach((function(e){t+=e.byteLength}));var n=new Uint8Array(t),r=0;return e.forEach((function(e){n.set(new Uint8Array(e),r),r+=e.byteLength})),n.buffer}function x(e){for(e=e.trim();e.endsWith("/");)e=e.slice(0,e.length-1);var t=e.split("/");return t[t.length-1]}function w(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:null==e.modelTopology?0:v(JSON.stringify(e.modelTopology)),weightSpecsBytes:null==e.weightSpecs?0:v(JSON.stringify(e.weightSpecs)),weightDataBytes:null==e.weightData?0:e.weightData.byteLength}}function O(){var e=function(){var e=function(e){for(var t=e<<13,n=0;0===(8388608&t);)n-=8388608,t<<=1;return(t&=-8388609)|(n+=947912704)},t=new Uint32Array(2048);t[0]=0;for(var n=1;n<1024;n++)t[n]=e(n);for(var r=1024;r<2048;r++)t[r]=939524096+(r-1024<<13);return t}(),t=function(){var e=new Uint32Array(64);e[0]=0,e[31]=1199570944,e[32]=2147483648,e[63]=3347054592;for(var t=1;t<31;t++)e[t]=t<<23;for(var n=33;n<63;n++)e[n]=2147483648+(n-32<<23);return e}(),n=function(){for(var e=new Uint32Array(64),t=0;t<64;t++)e[t]=1024;return e[0]=e[32]=0,e}();return function(r){for(var a=new ArrayBuffer(4*r.length),i=new Uint32Array(a),o=0;o<r.length;o++){var s=r[o],u=e[n[s>>10]+(1023&s)]+t[s>>10];i[o]=u}return new Float32Array(a)}}}).call(this,n(116).Buffer)},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(12),a=n(2);function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"float32",n=arguments.length>2?arguments[2]:void 0;return t=t||"float32",a.assertNonNegativeIntegerDimensions(e),new r.b(e,t,n)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({exp_:function(e){var t=Object(i.a)(e,"x","exp"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.exp(t);return n([r]),r}),n,null,a.X)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({abs_:function(e){var t=Object(i.a)(e,"x","abs"),n={x:t};return r.a.runKernelFunc((function(e,n){return n([t]),"complex64"===t.dtype?e.complexAbs(t):e.abs(t)}),n,null,a.a)}})},function(e,t,n){"use strict";n.d(t,"c",(function(){return d})),n.d(t,"b",(function(){return f})),n.d(t,"a",(function(){return p})),n.d(t,"d",(function(){return m}));var r=n(29),a=n(148),i=n(17),o=n(154),s=n(102),u=n(155),c=n(14),l=n(103),h=n(31);function d(e,t,n){if(null==n||"linear"===n)return e;if("relu"===n)return Object(i.a)(e,Object(l.a)(t));throw new Error("Cannot compute gradient for fused activation ".concat(n,"."))}function f(e,t){var n=t,a=r.c(e.shape,t.shape);return a.length>0&&(n=Object(h.a)(n,a)),Object(c.a)(n,e.shape)}function p(e,t,n){if("linear"===t)return e;if("relu"===t)return Object(s.a)(e);if("elu"===t)return Object(a.a)(e);if("relu6"===t)return Object(u.a)(e);if("prelu"===t)return Object(o.a)(e,n);throw new Error("Unknown fused activation ".concat(t,"."))}var m=function(e,t){return!(e>0)||"linear"===t}},function(e,t,n){"use strict";n.d(t,"f",(function(){return y}
2)),n.d(t,"e",(function(){return x})),n.d(t,"d",(function(){return w})),n.d(t,"g",(function(){return O})),n.d(t,"a",(function(){return S})),n.d(t,"b",(function(){return L})),n.d(t,"c",(function(){return k}));var r=n(18),a=n(15),i=n(16),o=n(3),s=n.n(o),u=n(13),c=n(5),l=n(11),h=n(0),d=n(109),f=n(92);function p(e){return e instanceof h.Tensor?{value:e.clone(),recurse:!1}:Object(f.e)(e)?{value:null,recurse:!0}:{value:e,recurse:!1}}var m=n(23),v=n(22),g=function(){function e(t){if(Object(c.a)(this,e),this.capacity=t,this.begin=0,this.end=0,null==t)throw new RangeError("Can't create a ring buffer of unknown capacity.");if(t<1)throw new RangeError("Can't create ring buffer of capacity < 1.");this.data=new Array(t),this.doubledCapacity=2*t}return Object(l.a)(e,[{key:"wrap",value:function(e){for(;e<0;)e+=this.doubledCapacity;return e%this.doubledCapacity}},{key:"get",value:function(e){if(e<0)throw new RangeError("Can't get item at a negative index.");return this.data[e%this.capacity]}},{key:"set",value:function(e,t){if(e<0)throw new RangeError("Can't set item at a negative index.");this.data[e%this.capacity]=t}},{key:"length",value:function(){var e=this.end-this.begin;return e<0&&(e=this.doubledCapacity+e),e}},{key:"isFull",value:function(){return this.length()===this.capacity}},{key:"isEmpty",value:function(){return 0===this.length()}},{key:"push",value:function(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.set(this.end,e),this.end=this.wrap(this.end+1)}},{key:"pushAll",value:function(e){var t,n=Object(r.a)(e);try{for(n.s();!(t=n.n()).done;){var a=t.value;this.push(a)}}catch(i){n.e(i)}finally{n.f()}}},{key:"pop",value:function(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");this.end=this.wrap(this.end-1);var e=this.get(this.end);return this.set(this.end,void 0),e}},{key:"unshift",value:function(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.begin=this.wrap(this.begin-1),this.set(this.begin,e)}},{key:"shift",value:function(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");var e=this.get(this.begin);return this.set(this.begin,void 0),this.begin=this.wrap(this.begin+1),e}},{key:"shuffleExcise",value:function(e){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");var t=this.wrap(this.begin+e),n=this.get(t);return this.set(t,this.pop()),n}}]),e}(),b=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(){return Object(c.a)(this,n),t.call(this,n.INITIAL_CAPACITY)}return Object(l.a)(n,[{key:"isFull",value:function(){return!1}},{key:"push",value:function(e){Object(m.a)(Object(v.a)(n.prototype),"isFull",this).call(this)&&this.expand(),Object(m.a)(Object(v.a)(n.prototype),"push",this).call(this,e)}},{key:"unshift",value:function(e){Object(m.a)(Object(v.a)(n.prototype),"isFull",this).call(this)&&this.expand(),Object(m.a)(Object(v.a)(n.prototype),"unshift",this).call(this,e)}},{key:"expand",value:function(){for(var e=2*this.capacity,t=new Array(e),n=this.length(),r=0;r<n;r++)t[r]=this.get(this.wrap(this.begin+r));this.data=t,this.capacity=e,this.doubledCapacity=2*this.capacity,this.begin=0,this.end=n}}]),n}(g);function y(e){return new _(e)}function x(e){return new j(e)}function w(e,t){return new P(e,t)}function O(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.FAIL;return new z(e,t)}b.INITIAL_CAPACITY=32;var k,S=function(){function e(){Object(c.a)(this,e)}return Object(l.a)(e,[{key:"toArray",value:function(){var e=Object(u.a)(s.a.mark((function e(){var t,n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[],e.next=3,this.next();case 3:n=e.sent;case 4:if(n.done){e.next=11;break}return t.push(n.value),e.next=8,this.next();case 8:n=e.sent,e.next=4;break;case 11:return e.abrupt("return",t);case 12:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"toArrayForTest",value:function(){var e=Object(u.a)(s.a.mark((function e(){var t,n,r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.prefetch(100),n=[],e.next=4,t.next();case 4:r=e.sent;case 5:if(r.done){e.next=12;break}return n.push(r.value),e.next=9,t.next();case 9:r=e.sent,e.next=5;break;case 12:return e.abrupt("return",n);case 13:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"resolveFully",value:function(){var e=Object(u.a)(s.a.mark((function e(){var t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.next();case 2:t=e.sent;case 3:if(t.done){e.next=9;break}return e.next=6,this.next();case 6:t=e.sent,e.next=3;break;case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"resolveWhile",value:function(){var e=Object(u.a)(s.a.mark((function e(t){var n,r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.next();case 2:n=e.sent,r=t(n.value);case 4:if(n.done||!r){e.next=11;break}return e.next=7,this.next();case 7:n=e.sent,r=t(n.value),e.next=4;break;case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"handleErrors",value:function(e){return new R(this,e)}},{key:"filter",value:function(e){return new A(this,e)}},{key:"map",value:function(e){return new N(this,e)}},{key:"mapAsync",value:function(e){return new I(this,e)}},{key:"serialMapAsync",value:function(e){return new I(this,e).serial()}},{key:"flatmap",value:function(e){return new D(this,e)}}
2,{key:"forEachAsync",value:function(){var e=Object(u.a)(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.map(t).resolveFully());case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"serialForEach",value:function(){var e=Object(u.a)(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialMapAsync(t).resolveWhile((function(e){return!0===e})));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"rowMajorBatch",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return new M(this,e,t)}},{key:"columnMajorBatch",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:f.f,r=this.rowMajorBatch(e,t);return r.map((function(e){return Object(f.d)(e,n)}))}},{key:"concatenate",value:function(e,t){return new P(y([this,e]),t)}},{key:"take",value:function(e){return e<0||null==e?this:new C(this,e)}},{key:"skip",value:function(e){return e<0||null==e?this:new T(this,e)}},{key:"prefetch",value:function(e){return new F(this,e)}},{key:"shuffle",value:function(e,t){return new B(this,e,t)}},{key:"serial",value:function(){return new E(this)}}]),e}(),_=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e){var r;return Object(c.a)(this,n),(r=t.call(this)).items=e,r.trav=0,r}return Object(l.a)(n,[{key:"summary",value:function(){return"Array of ".concat(this.items.length," items")}},{key:"next",value:function(){var e=Object(u.a)(s.a.mark((function e(){var t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this.trav>=this.items.length)){e.next=2;break}return e.abrupt("return",{value:null,done:!0});case 2:return t=this.items[this.trav],this.trav++,e.abrupt("return",{value:(n=t,Object(f.b)(n,p)),done:!1});case 5:case"end":return e.stop()}var n}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(S),j=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e){var r;return Object(c.a)(this,n),(r=t.call(this)).nextFn=e,r}return Object(l.a)(n,[{key:"summary",value:function(){return"Function call"}},{key:"next",value:function(){var e=Object(u.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.abrupt("return",this.nextFn());case 4:throw e.prev=4,e.t0=e.catch(0),e.t0.message="Error thrown while iterating through a dataset: ".concat(e.t0.message),e.t0;case 8:case"end":return e.stop()}}),e,this,[[0,4]])})));return function(){return e.apply(this,arguments)}}()}]),n}(S),E=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e){var r;return Object(c.a)(this,n),(r=t.call(this)).upstream=e,r.lastRead=Promise.resolve({value:null,done:!1}),r}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> Serial")}},{key:"next",value:function(){var e=Object(u.a)(s.a.mark((function e(){var t=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.lastRead=this.lastRead.then((function(){return t.serialNext()})),e.abrupt("return",this.lastRead);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"serialNext",value:function(){var e=Object(u.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.upstream.next());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(S),T=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r){var a;return Object(c.a)(this,n),(a=t.call(this)).upstream=e,a.maxCount=r,a.count=0,a.lastRead=Promise.resolve({value:null,done:!1}),a}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> Skip")}},{key:"next",value:function(){var e=Object(u.a)(s.a.mark((function e(){var t=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.lastRead=this.lastRead.then((function(){return t.serialNext()})),e.abrupt("return",this.lastRead);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"serialNext",value:function(){var e=Object(u.a)(s.a.mark((function e(){var t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this.count++<this.maxCount)){e.next=9;break}return e.next=3,this.upstream.next();case 3:if(!(t=e.sent).done){e.next=6;break}return e.abrupt("return",t);case 6:h.dispose(t.value),e.next=0;break;case 9:return e.abrupt("return",this.upstream.next());case 10:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(S),C=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r){var a;return Object(c.a)(this,n),(a=t.call(this)).upstream=e,a.maxCount=r,a.count=0,a}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> Take")}},{key:"next",value:function(){var e=Object(u.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this.count++>=this.maxCount)){e.next=2;break}return e.abrupt("return",{value:null,done:!0});case 2:return e.abrupt("return",this.upstream.next());case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(S),M=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r){var a,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Object(c.a)(this,n),(a=t.call(this)).upstream=e,a.batchSize=r,a.enableSmallLastBatch=i,a.lastRead=Promise.resolve({value:null,done:!1}),a}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> RowMajorBatch")}},{key:"next",value:function(){var e=Object(u.a)(s.a.mark((function e(){var t=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.lastRead=this.lastRead.then((function(){return t.serialNext()})),e.abrupt("return",this.lastRead);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"serialNext",value:function(){var e=Object(u.a)(s.a.mark((function e(){var t,n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=[];case 1:if(!(t.length<this.batchSize)){e.next=12;break}return e.next=4,this.upstream.next();case 4:if(!(n=e.sent).done){e.next=9;break}if(!(this.enableSmallLastBatch&&t.length>0)){e.next=8;break}return e.abrupt("return",{value:t,done:!1});case 8:return e.abrupt("return",{value:null,done:!0});case 9:t.push(n.value),e.next=1;break;case 12:return e.abrupt("return",{value:t,done:!1});case 13:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(S),A=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r){var a;return Object(c.a)(this,n),(a=t.call(this)).upstream=e,a.predicate=r,a.lastRead=Promise.resolve({value:null,done:!1}),a}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> Filter")}},{key:"next",value:function(){var e=Object(u.a)(s.a.mark((function e(){var t=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.lastRead=this.lastRead.then((function(){return t.serialNext()})),e.abrupt("return",this.lastRead);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"serialNext",value:function(){var e=Object(u.a)(s.a.mark((function e(){var t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=3,this.upstream.next();case 3:if(!(t=e.sent).done&&!this.predicate(t.value)){e.next=6;break}return e.abrupt("return",t);case 6:h.dispose(t.value),e.next=0;break;case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(S),N=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r){var a;return Object(c.a)(this,n),(a=t.call(this)).upstream=e,a.transform=r,a}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> Map")}},{key:"next",value:function(){var e=Object(u.a)(s.a.mark((function e(){var t,n,a,i,o,u,c;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.upstream.next();case 2:if(!(t=e.sent).done){e.next=5;break}return e.abrupt("return",{value:null,done:!0});case 5:n=h.tensor_util.getTensorsInContainer(t.value),a=this.transform(t.value),i=h.tensor_util.getTensorsInContainer(a),o=Object(r.a)(n);try{for(o.s();!(u=o.n()).done;)c=u.value,h.tensor_util.isTensorInList(c,i)||c.dispose()}catch(s){o.e(s)}finally{o.f()}return e.abrupt("return",{value:a,done:!1});case 11:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(S),R=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r){var a;return Object(c.a)(this,n),(a=t.call(this)).upstream=e,a.handler=r,a.count=0,a.lastRead=Promise.resolve({value:null,done:!1}),a}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> handleErrors")}},{key:"next",value:function(){var e=Object(u.a)(s.a.mark((function e(){var t=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.lastRead=this.lastRead.then((function(){return t.serialNext()})),e.abrupt("return",this.lastRead);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"serialNext",value:function(){var e=Object(u.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=1,e.next=4,this.upstream.next();case 4:return e.abrupt("return",e.sent);case 7:if(e.prev=7,e.t0=e.catch(1),this.handler(e.t0)){e.next=11;break}return e.abrupt("return",{value:null,done:!0});case 11:e.next=0;break;case 13:case"end":return e.stop()}}),e,this,[[1,7]])})));return function(){return e.apply(this,arguments)}}()}]),n}(S),I=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r){var a;return Object(c.a)(this,n),(a=t.call(this)).upstream=e,a.transform=r,a}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> AsyncMap")}},{key:"next",value:function(){var e=Object(u.a)(s.a.mark((function e(){var t,n,a,i,o,u,c;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.upstream.next();case 2:if(!(t=e.sent).done){e.next=5;break}return e.abrupt("return",{value:null,done:!0});case 5:return n=h.tensor_util.getTensorsInContainer(t.value),e.next=8,this.transform(t.value);case 8:a=e.sent,i=h.tensor_util.getTensorsInContainer(a),o=Object(r.a)(n);try{for(o.s();!(u=o.n()).done;)c=u.value,h.tensor_util.isTensorInList(c,i)||c.dispose()}catch(s){o.e(s)}finally{o.f()}return e.abrupt("return",{value:a,done:!1});case 13:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(S),L=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(){var e;return Object(c.a)(this,n),(e=t.call(this)).outputQueue=new b,e.lastRead=Promise.resolve({value:null,done:!1}),e}return Object(l.a)(n,[{key:"next",value:function(){var e=Object(u.a)(s.a.mark((function e(){var t=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.lastRead=this.lastRead.then((function(){return t.serialNext()})),e.abrupt("return",this.lastRead);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"serialNext",value:function(){var e=Object(u.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==this.outputQueue.length()){e.
2next=7;break}return e.next=3,this.pump();case 3:if(e.sent){e.next=5;break}return e.abrupt("return",{value:null,done:!0});case 5:e.next=0;break;case 7:return e.abrupt("return",{value:this.outputQueue.shift(),done:!1});case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(S),D=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r){var a;return Object(c.a)(this,n),(a=t.call(this)).upstream=e,a.transform=r,a}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> Flatmap")}},{key:"pump",value:function(){var e=Object(u.a)(s.a.mark((function e(){var t,n,a,i,o,u,c;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.upstream.next();case 2:if(!(t=e.sent).done){e.next=5;break}return e.abrupt("return",!1);case 5:n=h.tensor_util.getTensorsInContainer(t.value),a=this.transform(t.value),i=h.tensor_util.getTensorsInContainer(a),this.outputQueue.pushAll(a),o=Object(r.a)(n);try{for(o.s();!(u=o.n()).done;)c=u.value,h.tensor_util.isTensorInList(c,i)||c.dispose()}catch(s){o.e(s)}finally{o.f()}return e.abrupt("return",!0);case 12:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(L),P=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r){var a;return Object(c.a)(this,n),(a=t.call(this)).baseErrorHandler=r,a.lastRead=null,a.iterator=null,a.moreIterators=e,a}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat("TODO: fill in upstream of chained summaries"," -> Chained")}},{key:"next",value:function(){var e=Object(u.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.lastRead=this.readFromChain(this.lastRead),e.abrupt("return",this.lastRead);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"readFromChain",value:function(){var e=Object(u.a)(s.a.mark((function e(t){var n,r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:if(null!=this.iterator){e.next=10;break}return e.next=5,this.moreIterators.next();case 5:if(!(n=e.sent).done){e.next=8;break}return e.abrupt("return",{value:null,done:!0});case 8:this.iterator=n.value,null!=this.baseErrorHandler&&(this.iterator=this.iterator.handleErrors(this.baseErrorHandler));case 10:return e.next=12,this.iterator.next();case 12:if(!(r=e.sent).done){e.next=16;break}return this.iterator=null,e.abrupt("return",this.readFromChain(t));case 16:return e.abrupt("return",r);case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),n}(S);!function(e){e[e.FAIL=0]="FAIL",e[e.SHORTEST=1]="SHORTEST",e[e.LONGEST=2]="LONGEST"}(k||(k={}));var z=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.FAIL;return Object(c.a)(this,n),(r=t.call(this)).iterators=e,r.mismatchMode=a,r.count=0,r.currentPromise=null,r}return Object(l.a)(n,[{key:"summary",value:function(){return"{".concat("TODO: fill in upstream of zip summaries","} -> Zip")}},{key:"nextState",value:function(){var e=Object(u.a)(s.a.mark((function e(t){var n,r,a,i;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=function(e){return e instanceof S?{value:e.next().then((function(e){return n++,e.done&&r++,e.value})),recurse:!1}:{value:null,recurse:!0}},e.next=3,t;case 3:return n=0,r=0,e.next=7,Object(f.c)(this.iterators,a);case 7:if(i=e.sent,n!==r){e.next=10;break}return e.abrupt("return",{value:null,done:!0});case 10:if(!(r>0)){e.next=16;break}e.t0=this.mismatchMode,e.next=e.t0===k.FAIL?14:e.t0===k.SHORTEST?15:(e.t0,k.LONGEST,16);break;case 14:throw new Error("Zipped streams should have the same length. "+"Mismatched at element ".concat(this.count,"."));case 15:return e.abrupt("return",{value:null,done:!0});case 16:return this.count++,e.abrupt("return",{value:i,done:!1});case 18:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"next",value:function(){var e=Object(u.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.currentPromise=this.nextState(this.currentPromise),e.abrupt("return",this.currentPromise);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(S),F=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r){var a;return Object(c.a)(this,n),(a=t.call(this)).upstream=e,a.bufferSize=r,a.buffer=new g(r),a}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> Prefetch")}},{key:"refill",value:function(){for(;!this.buffer.isFull();){var e=this.upstream.next();this.buffer.push(e)}}},{key:"next",value:function(){return this.refill(),this.buffer.shift()}}]),n}(S),B=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r,a){var i;return Object(c.a)(this,n),(i=t.call(this,e,r)).upstream=e,i.windowSize=r,i.upstreamExhausted=!1,i.random=d.alea(a||h.util.now().toString()),i.lastRead=Promise.resolve({value:null,done:!1}),i}return Object(l.a)(n,[{key:"next",value:function(){var e=Object(u.a)(s.a.mark((function e(){var t=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.lastRead=this.lastRead.then((function(){return t.serialNext()})),e.abrupt("return",this.lastRead);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"randomInt",value:function(e){return Math.floor(this.random()*e)}},{key:"chooseIndex",value:function(){return this.randomInt(this.buffer.length())}},{key:"serialNext",value:function(){var e=Object(u.a)(s.a.mark((function e(){var t,n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.upstreamExhausted||this.refill();case 1:if(this.buffer.isEmpty()){e.next=14;break}return t=this.chooseIndex(),e.next=5,this.buffer.shuffleExcise(t);case 5:if(!(n=e.sent).done){e.next=10;break}this.upstreamExhausted=!0,e.next=12;break;case 10:return this.refill(),e.abrupt("return",n);case 12:e.next=1;break;case 14:return e.abrupt("return",{value:null,done:!0});case 15:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(F)},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(42);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
2t%2?a(Object(n),!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(8),a=n(10),i=n(7),o=n(36),s=n(4),u=n(9);var c=Object(u.b)({pow_:function(e,t){var n=Object(s.a)(e,"base","pow"),u=Object(s.a)(t,"exp","pow"),c=Object(o.makeTypesMatch)(n,u),l=Object(r.a)(c,2);n=l[0],u=l[1];var h={a:n,b:u};return a.a.runKernelFunc((function(e,t){var r=e.pow(n,u);return t([n,u,r]),r}),h,null,i.Yb)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(89),u=n(9),c=n(14);var l=Object(u.b)({reverse_:function(e,t){var n=Object(i.a)(e,"x","reverse"),u={x:n},l={dims:t};return r.a.runKernelFunc((function(e){var r=Object(o.parseAxisParam)(t,n.shape);if(0===n.rank)return Object(s.a)(n);var a=e.reverse(n,r);return Object(c.a)(a,n.shape)}),u,null,a.lc,l)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(1),a="undefined"!==typeof window?r.useLayoutEffect:r.useEffect;function i(e){var t=r.useRef(e);return a((function(){t.current=e})),r.useCallback((function(){return t.current.apply(void 0,arguments)}),[])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(8),a=n(10),i=n(7),o=n(36),s=n(4),u=n(29),c=n(9);var l=Object(c.b)({greater_:function(e,t){var n=Object(s.a)(e,"a","greater"),c=Object(s.a)(t,"b","greater"),l=Object(o.makeTypesMatch)(n,c),h=Object(r.a)(l,2);n=h[0],c=h[1],Object(u.a)(n.shape,c.shape);var d={a:n,b:c};return a.a.runKernelFunc((function(e){return e.greater(n,c)}),d,null,i.kb)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(10),a=n(2);function i(e,t,n,i){if(null==i&&(i=Object(a.inferDtype)(e)),"complex64"===i)throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!Object(a.isTypedArray)(e)&&!Array.isArray(e)&&"number"!==typeof e&&"boolean"!==typeof e&&"string"!==typeof e)throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(null!=t){Object(a.assertNonNegativeIntegerDimensions)(t);var o=Object(a.sizeFromShape)(t),s=Object(a.sizeFromShape)(n);Object(a.assert)(o===s,(function(){return"Based on the provided shape, [".concat(t,"], the tensor should have ")+"".concat(o," values but has ").concat(s)}));for(var u=0;u<n.length;++u){var c=n[u],l=u!==n.length-1||c!==Object(a.sizeFromShape)(t.slice(u));Object(a.assert)(n[u]===t[u]||!l,(function(){return"Error creating a new Tensor. Inferred shape "+"(".concat(n,") does not match the provided ")+"shape (".concat(t,"). ")}))}}return Object(a.isTypedArray)(e)||Array.isArray(e)||(e=[e]),t=t||n,e="string"!==i?Object(a.toTypedArray)(e,i):Object(a.flatten)(e,[],!0),r.a.makeTensor(e,t,i)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(4),a=n(2),i=n(9),o=n(14);var s=Object(i.b)({expandDims_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=null,i=Object(r.a)(e,"x","expandDims",n);a.assert(t<=i.rank,(function(){return"Axis must be <= rank of the tensor"}));var s=i.shape.slice();return t<0&&(a.assert(-(i.rank+1)<=t,(function(){return"Axis must be in the interval [".concat(-(i.rank+1),", ").concat(i.rank,"]")})),t=i.rank+t+1),s.splice(t,0,1),Object(o.a)(i,s)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(9);var u=Object(s.b)({complex_:function(e,t){var n=Object(i.a)(e,"real","complex"),s=Object(i.a)(t,"imag","complex");o.assertShapesMatch(n.shape,s.shape,"real and imag shapes, ".concat(n.shape," and ").concat(s.shape,", ")+"must match in call to tf.complex().");var u={real:n,imag:s};return r.a.runKernelFunc((function(e){return e.complex(n,s)}),u,null,a.y)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"assertParamsValid",(function(){return i})),n.d(t,"maskToAxes",(function(){return o}
2)),n.d(t,"computeOutShape",(function(){return s})),n.d(t,"stridesWithElidedDims",(function(){return u})),n.d(t,"getNormalizedAxes",(function(){return h})),n.d(t,"startIndicesWithElidedDims",(function(){return d})),n.d(t,"stopIndicesWithElidedDims",(function(){return f})),n.d(t,"stridesForAxis",(function(){return p})),n.d(t,"startForAxis",(function(){return m})),n.d(t,"stopForAxis",(function(){return v})),n.d(t,"isSliceContinous",(function(){return g})),n.d(t,"computeFlatOffset",(function(){return b})),n.d(t,"parseSliceParams",(function(){return y}));var r=n(19),a=n(2);function i(e,t,n){a.assert(e.rank===t.length,(function(){return"Error in slice".concat(e.rank,"D: Length of begin ").concat(t," must ")+"match the rank of the array (".concat(e.rank,").")})),a.assert(e.rank===n.length,(function(){return"Error in slice".concat(e.rank,"D: Length of size ").concat(n," must ")+"match the rank of the array (".concat(e.rank,").")}));for(var r=function(r){a.assert(t[r]+n[r]<=e.shape[r],(function(){return"Error in slice".concat(e.rank,"D: begin[").concat(r,"] + size[").concat(r,"] ")+"(".concat(t[r]+n[r],") would overflow input.shape[").concat(r,"] (").concat(e.shape[r],")")}))},i=0;i<e.rank;++i)r(i)}function o(e){for(var t=[],n=0;e>0;)1&e&&t.push(n),e/=2,n++;return t}function s(e,t,n){for(var r=[],a=0;a<e.length;a++)r[a]=Math.ceil((t[a]-e[a])/n[a]);return r}function u(e,t,n,a){for(var i=Object(r.a)(e),o=i.length;o<a.length;o++)i.push(1);for(var s=0;s<n;s++)0===s?i[t]=1:(i.splice(t,0,1),i.pop());return i}function c(e,t,n){return n<=e?n:n-(t-1)}function l(e,t){for(var n=[],r=0;r<e;r++)n.push(t+r);return n}function h(e,t,n,r,a,i,o,s,c){var l=e.length,h=new Array(l),g=new Array(l),b=new Array(l);if(t.length&&n>0){var y=t[0],x=n+1;h=d(o,y,x,r,e),g=f(s,y,x,a,e),b=u(i,y,x,e)}else for(var w=0;w<l;w++)h[w]=m(o,r,i,e,w,c),g[w]=v(s,a,i,e,w,c),b[w]=p(i,w,c);return{begin:h,end:g,strides:b}}function d(e,t,n,a,i){for(var o=Object(r.a)(i),s=l(n,t),u=0;u<o.length;u++)if(s.indexOf(u)>-1)o[u]=0;else{var h=c(t,n,u),d=a[h];e&1<<h&&(d=0),o[u]=d}return o}function f(e,t,n,i,o){for(var s=Object(r.a)(o),u=l(n,t),h=0;h<s.length;h++)if(u.indexOf(h)>-1)s[h]=Number.MAX_SAFE_INTEGER;else{var d=c(t,n,h),f=i[d];e&1<<d&&(f=Number.MAX_SAFE_INTEGER),s[h]=f}for(var p=0;p<s.length;p++){var m=o[p];s[p]<0&&(s[p]+=m),s[p]=a.clamp(0,s[p],o[p])}return s}function p(e,t,n){var r=e[t];return(n&1<<t||null==r)&&(r=1),r}function m(e,t,n,r,i,o){var s=t[i],u=n[i]||1;(e&1<<i||o&1<<i||null==s)&&(s=u>0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);var c=r[i];return s<0&&(s+=c),s=a.clamp(0,s,c-1)}function v(e,t,n,r,i,o){var s=t[i],u=n[i]||1;(e&1<<i||o&1<<i||null==s)&&(s=u>0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);var c=r[i];return s<0&&(s+=c),s=u>0?a.clamp(0,s,c):a.clamp(-1,s,c-1)}function g(e,t,n){for(var r=n.length,a=0;a<n.length;a++)if(n[a]>1){r=a;break}for(var i=r+1;i<n.length;i++)if(t[i]>0||n[i]!==e[i])return!1;return!0}function b(e,t){for(var n=e.length>0?e[e.length-1]:1,r=0;r<e.length-1;r++)n+=e[r]*t[r];return n}function y(e,t,n){var i,o;return(i="number"===typeof t?[t].concat(Object(r.a)(new Array(e.rank-1).fill(0))):t.length<e.rank?t.concat(new Array(e.rank-t.length).fill(0)):t.slice()).forEach((function(e){a.assert(-1!==e,(function(){return"slice() does not support negative begin indexing."}))})),o=(o=null==n?new Array(e.rank).fill(-1):"number"===typeof n?[n].concat(Object(r.a)(new Array(e.rank-1).fill(-1))):n.length<e.rank?n.concat(new Array(e.rank-n.length).fill(-1)):n).map((function(t,n){return t>=0?t:(a.assert(-1===t,(function(){return"Negative size values should be exactly -1 but got "+"".concat(t," for the slice() size at index ").concat(n,".")})),e.shape[n]-i[n])})),[i,o]}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(8),a=n(10),i=n(7),o=n(36),s=n(4),u=n(29),c=n(9);var l=Object(c.b)({greaterEqual_:function(e,t){var n=Object(s.a)(e,"a","greaterEqual"),c=Object(s.a)(t,"b","greaterEqual"),l=Object(o.makeTypesMatch)(n,c),h=Object(r.a)(l,2);n=h[0],c=h[1],Object(u.a)(n.shape,c.shape);var d={a:n,b:c};return a.a.runKernelFunc((function(e,t){var r=e.greaterEqual(n,c);return t([n,c]),r}),d,null,i.lb)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(8),a=n(10),i=n(7),o=n(36),s=n(4),u=n(29),c=n(9);var l=Object(c.b)({lessEqual_:function(e,t){var n=Object(s.a)(e,"a","lessEqual"),c=Object(s.a)(t,"b","lessEqual"),l=Object(o.makeTypesMatch)(n,c),h=Object(r.a)(l,2);
2n=h[0],c=h[1],Object(u.a)(n.shape,c.shape);var d={a:n,b:c};return a.a.runKernelFunc((function(e,t){var r=e.lessEqual(n,c);return t([n,c]),r}),d,null,i.vb)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(10),a=n(2),i=n(74);function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"float32";if("complex64"===t){var n=o(e,"float32"),s=o(e,"float32");return Object(i.a)(n,s)}var u=Object(a.makeZerosTypedArray)(Object(a.sizeFromShape)(e),t);return r.a.makeTensor(u,e,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({pad_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=Object(i.a)(e,"x","pad");if(0===o.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");var s=function(e,r){return r([o]),e.pad(o,t,n)},u={paddings:t,constantValue:n},c={x:o};return r.a.runKernelFunc(s,c,null,a.Wb,u)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),a=n(7),i=n(4),o=n(29),s=n(9);var u=Object(s.b)({logicalAnd_:function(e,t){var n=Object(i.a)(e,"a","logicalAnd","bool"),s=Object(i.a)(t,"b","logicalAnd","bool");Object(o.a)(n.shape,s.shape);var u={a:n,b:s};return r.a.runKernelFunc((function(e){return e.logicalAnd(n,s)}),u,null,a.Ab)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(4),a=n(2),i=n(49),o=n(73),s=n(9);var u=Object(s.b)({stack_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Object(r.b)(e,"tensors","stack");if(a.assert(n.length>=1,(function(){return"Pass at least one tensor to tf.stack"})),1===n.length)return Object(o.a)(n[0],t);var s=n[0].rank,u=n[0].shape,c=n[0].dtype;a.assert(t<=s,(function(){return"Axis must be <= rank of the tensor"})),n.forEach((function(e){a.assertShapesMatch(u,e.shape,"All tensors passed to stack must have matching shapes"),a.assert(c===e.dtype,(function(){return"All tensors passed to stack must have matching dtypes"}))}));var l=n.map((function(e){return Object(o.a)(e,t)}));return Object(i.a)(l,t)}})},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(4),a=n(72);function i(e,t,n){var i=Object(r.c)(e,n);return Object(a.a)(e,t,i,n)}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return E})),n.d(t,"i",(function(){return C})),n.d(t,"c",(function(){return M})),n.d(t,"f",(function(){return A})),n.d(t,"e",(function(){return I})),n.d(t,"d",(function(){return L})),n.d(t,"k",(function(){return P})),n.d(t,"g",(function(){return z})),n.d(t,"h",(function(){return F})),n.d(t,"j",(function(){return B})),n.d(t,"b",(function(){return U}));var r=n(8),a=n(19),i=n(5),o=n(11),s=n(0),u=n(111),c=n(133),l=n(6),h=n(298),d=n(299),f=n(300),p=n(301),m=n(302),v=n(303),g=n(304),b=n(305),y=n(306),x=n(307),w=n(308),O=n(309),k=n(310),S=n(311),_=n(312),j=n(313),E=function(){function e(){var t;Object(i.a)(this,e);var n=[h,d,f,p,m,v,g,x,y,b,w,O,k,S,_,j],r=(t=[]).concat.apply(t,Object(a.a)(n.map((function(e){return e.json}))));this.opMappers=r.reduce((function(e,t){return e[t.tfOpName]=t,e}),{})}return Object(o.a)(e,null,[{key:"Instance",get:function(){return this._instance||(this._instance=new this)}}]),Object(o.a)(e,[{key:"transformGraph",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=e.node,i=[],o=[],s=a.reduce((function(e,n){return e[n.name]=t.mapNode(n),n.op.startsWith("Placeholder")&&i.push(e[n.name]),"Const"===n.op&&o.push(e[n.name]),e}),{}),u=[],c=[],h={},d={};null!=n&&(h=this.mapSignatureEntries(n.inputs),d=this.mapSignatureEntries(n.outputs));var f=Object.keys(s);f.forEach((function(e){var t=s[e];t.inputNames.forEach((function(e){var n=Object(l.b)(e),a=Object(r.a)(n,1)[0];t.inputs.push(s[a]),s[a].children.push(t)}))})),0===Object.keys(d).length?f.forEach((function(e){var t=s[e];0===t.children.length&&c.push(t)}
2)):Object.keys(d).forEach((function(e){var t=Object(l.b)(e),n=Object(r.a)(t,1)[0],a=s[n];null!=a&&(a.signatureKey=d[e],c.push(a))})),Object.keys(h).length>0?Object.keys(h).forEach((function(e){var t=Object(l.b)(e),n=Object(r.a)(t,1)[0],a=s[n];a&&(a.signatureKey=h[e],u.push(a))})):u=i;var p={};return null!=e.library&&null!=e.library.function&&(p=e.library.function.reduce((function(e,n){return e[n.signature.name]=t.mapFunction(n),e}),{})),{nodes:s,inputs:u,outputs:c,weights:o,placeholders:i,signature:n,functions:p}}},{key:"mapSignatureEntries",value:function(e){return Object.keys(e||{}).reduce((function(t,n){return t[e[n].name]=n,t}),{})}},{key:"mapNode",value:function(e){var t=Object(c.a)(e.op)||this.opMappers[e.op]||{};null==e.attr&&(e.attr={});var n={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map((function(e){return e.startsWith("^")?e.substr(1):e})),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr};return null!=t.inputs&&(n.inputParams=t.inputs.reduce((function(e,t){return e[t.name]={type:t.type,inputIndexStart:t.start,inputIndexEnd:t.end},e}),{})),null!=t.attrs&&(n.attrParams=t.attrs.reduce((function(t,n){var r=n.type,a=void 0;switch(n.type){case"string":void 0===(a=C(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(a=C(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"string[]":void 0===(a=F(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(a=F(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number":void 0===(a=A(e.attr,n.tfName,n.defaultValue||0))&&n.tfDeprecatedName&&(a=A(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number[]":void 0===(a=z(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(a=z(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool":void 0===(a=M(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(a=M(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool[]":void 0===(a=U(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(a=U(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape":void 0===(a=P(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(a=P(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape[]":void 0===(a=B(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(a=B(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype":void 0===(a=I(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(a=I(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype[]":void 0===(a=L(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(a=L(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"func":void 0===(a=R(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(a=R(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error("Unsupported param type: ".concat(n.type," for op: ").concat(e.op))}return t[n.name]={value:a,type:r},t}),{})),n}},{key:"mapFunction",value:function(e){var t=this,n=e.nodeDef,a=[],i={};null!=n&&(i=n.reduce((function(e,n){return e[n.name]=t.mapNode(n),"Const"===n.op&&a.push(e[n.name]),e}),{}));var o=[],s=[];e.signature.inputArg.forEach((function(e){var t=Object(l.b)(e.name),n=Object(r.a)(t,1)[0],a={name:n,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:N(e.type),type:"dtype"}},children:[]};a.signatureKey=e.name,o.push(a),i[n]=a}
2)),Object.keys(i).forEach((function(e){var t=i[e];t.inputNames.forEach((function(e){var n=Object(l.b)(e),a=Object(r.a)(n,1)[0];t.inputs.push(i[a]),i[a].children.push(t)}))}));var u=e.ret;e.signature.outputArg.forEach((function(e){var t=Object(l.b)(u[e.name]),n=Object(r.a)(t,2),a=n[0],o=n[1],c=i[a];null!=c&&(c.defaultOutput=o,s.push(c))}));var c=this.mapArgsToSignature(e);return{nodes:i,inputs:o,outputs:s,weights:a,placeholders:[],signature:c}}},{key:"mapArgsToSignature",value:function(e){var t=this;return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce((function(e,n){return e[n.name]=t.mapArgToTensorInfo(n),e}),{}),outputs:e.signature.outputArg.reduce((function(n,r){return n[r.name]=t.mapArgToTensorInfo(r,e.ret),n}),{})}}},{key:"mapArgToTensorInfo",value:function(e,t){var n=e.name;return null!=t&&(n=t[n]),{name:n,dtype:e.type}}}]),e}();function T(t,n){var r=Array.isArray(t)?String.fromCharCode.apply(null,t):function(t){var n=Object(s.env)().global;if("undefined"!==typeof n.atob)return n.atob(t);if("undefined"!==typeof e)return new e(t,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}(t);return n?r:r.toLowerCase()}function C(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=e[t];return null!=a?T(a.s,r):n}function M(e,t,n){var r=e[t];return r?r.b:n}function A(e,t,n){var r=e[t]||{},a=null!=r.i?r.i:null!=r.f?r.f:n;return"number"===typeof a?a:parseInt(a,10)}function N(e){switch("string"===typeof e&&(e=u.a[e]),e){case u.a.DT_FLOAT:return"float32";case u.a.DT_INT32:case u.a.DT_INT64:case u.a.DT_INT8:case u.a.DT_UINT8:return"int32";case u.a.DT_BOOL:return"bool";case u.a.DT_DOUBLE:return"float32";case u.a.DT_STRING:return"string";default:return null}}function R(e,t,n){var r=e[t];return r&&r.func?r.func.name:n}function I(e,t,n){var r=e[t];return r&&r.type?N(r.type):n}function L(e,t,n){var r=e[t];return r&&r.list&&r.list.type?r.list.type.map((function(e){return N(e)})):n}function D(e){if(!e.unknownRank)return null!=e.dim?e.dim.map((function(e){return"number"===typeof e.size?e.size:parseInt(e.size,10)})):[]}function P(e,t,n){var r=e[t];return r&&r.shape?D(r.shape):n}function z(e,t,n){var r=e[t];return r?((r.list.f&&r.list.f.length?r.list.f:r.list.i)||[]).map((function(e){return"number"===typeof e?e:parseInt(e,10)})):n}function F(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=e[t];return a&&a.list&&a.list.s?a.list.s.map((function(e){return T(e,r)})):n}function B(e,t,n){var r=e[t];return r&&r.list&&r.list.shape?r.list.shape.map((function(e){return D(e)})):n}function U(e,t,n){var r=e[t];return r&&r.list&&r.list.b?r.list.b:n}}).call(this,n(116).Buffer)},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(8),a=n(10),i=n(7),o=n(36),s=n(4),u=n(29),c=n(20),l=n(9);var h=Object(l.b)({maximum_:function(e,t){var n=Object(s.a)(e,"a","maximum"),l=Object(s.a)(t,"b","maximum"),h=Object(o.makeTypesMatch)(n,l),d=Object(r.a)(h,2);n=d[0],l=d[1],"bool"===n.dtype&&(n=Object(c.a)(n,"int32"),l=Object(c.a)(l,"int32")),Object(u.a)(n.shape,l.shape);var f={a:n,b:l};return a.a.runKernelFunc((function(e,t){var r=e.maximum(n,l);return t([n,l]),r}),f,null,i.Jb)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(33),u=n(9),c=n(14);var l=Object(u.b)({conv2d_:function(e,t,n,u){var l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"NHWC",h=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[1,1],d=arguments.length>6?arguments[6]:void 0,f=Object(i.a)(e,"x","conv2d"),p=Object(i.a)(t,"filter","conv2d"),m=f,v=!1;3===f.rank&&(v=!0,m=Object(c.a)(f,[1,f.shape[0],f.shape[1],f.shape[2]])),o.assert(4===m.rank,(function(){return"Error in conv2d: input must be rank 4, but got rank ".concat(m.rank,".")})),o.assert(4===p.rank,(function(){return"Error in conv2d: filter must be rank 4, but got rank "+"".concat(p.rank,".")})),null!=d&&o.assert(o.isInt(u),(function(){return"Error in conv2d: pad must be an integer when using, "+"dimRoundingMode ".concat(d," but got pad ").concat(u,".")}));var g="NHWC"===l?m.shape[3]:m.shape[1];o.assert(g===p.shape[2],(function(){return"Error in conv2d: depth of input (".concat(g,") must match ")+"input depth for filter ".concat(p.shape[2],".")})),o.assert(s.h(n,h),(function(){return"Error in conv2D: Either strides or dilations must be 1. "+"Got strides ".concat(n," and dilations '").concat(h,"'")}));var b=function(e,t){var r=s.g(l),a=s.a(m.shape,p.shape,n,h,u,d,!1,r),i=e.conv2d(m,p,a);return t([m,p]),i},y={x:m,filter:p},x={strides:n,pad:u,dataFormat:l,dilations:h,dimRoundingMode:d},w=r.a.runKernelFunc(b,y,null,a.A,x);return v?Object(c.a)(w,[w.shape[1],w.shape[2],w.shape[3]]):w}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({clone_:function(e){var t=Object(i.a)(e,"x","clone",null),n={x:t};return r.a.runKernelFunc((function(){return r.a.makeTensorFromDataId(t.dataId,t.shape,t.dtype)}),n,null,a.nb)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(35),u=n(9),c=n(14),l=n(45);var h=Object(u.b)({max_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],u=Object(i.a)(e,"x","max"),h=function(e,r){var a=o.parseAxisParam(t,u.shape),i=s.f(a,u.rank),h=u;null!=i&&(h=Object(l.a)(u,i),a=s.g(a.length,h.rank));var d=e.max(h,a);null!=i&&h.dispose();var f=d;
2if(n){var p=s.e(f.shape,o.parseAxisParam(t,u.shape));f=Object(c.a)(f,p),d.dispose()}return r([u,f]),f},d={x:u},f={reductionIndices:t,keepDims:n};return r.a.runKernelFunc(h,d,null,a.Db,f)}})},function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return l})),n.d(t,"e",(function(){return h})),n.d(t,"d",(function(){return d})),n.d(t,"g",(function(){return f})),n.d(t,"f",(function(){return p}));var r=n(8),a=n(39),i=n(177),o=Object(i.a)("kernelRegistry",(function(){return new Map})),s=Object(i.a)("gradRegistry",(function(){return new Map}));function u(e,t){var n=m(e,t);return o.get(n)}function c(e){return s.get(e)}function l(e){for(var t=o.entries(),n=[];;){var a=t.next(),i=a.done,s=a.value;if(i)break;var u=Object(r.a)(s,2),c=u[0],l=u[1],h=c.split("_");Object(r.a)(h,1)[0]===e&&n.push(l)}return n}function h(e){var t=e.kernelName,n=e.backendName,r=m(t,n);o.has(r)&&console.warn("The kernel '".concat(t,"' for backend ")+"'".concat(n,"' is already registered")),o.set(r,e)}function d(e){var t=e.kernelName;s.has(t)&&Object(a.c)().getBool("DEBUG")&&console.warn("Overriding the gradient for '".concat(t,"'")),s.set(t,e)}function f(e,t){var n=m(e,t);if(!o.has(n))throw new Error("The kernel '".concat(e,"' for backend ")+"'".concat(t,"' is not registered"));o.delete(n)}function p(e){if(!s.has(e))throw new Error("The gradient '".concat(e,"' for backend is not registered"));s.delete(e)}function m(e,t){return"".concat(t,"_").concat(e)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"d",(function(){return c})),n.d(t,"f",(function(){return h})),n.d(t,"c",(function(){return d})),n.d(t,"e",(function(){return p})),n.d(t,"a",(function(){return m}));var r=n(3),a=n.n(r),i=n(13),o=n(0);function s(e,t){return u(e,t)}function u(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Map,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Set;if(null==e)return null;if(r.has(e))throw new Error("Circular references are not supported.");if(n.has(e))return n.get(e);var a=t(e);if(a.recurse&&null!==a.value)throw new Error("A deep map function may not return both a value and recurse=true.");if(a.recurse){if(p(e)){var i=Array.isArray(e)?[]:{};for(var o in r.add(e),e){var s=e[o],c=u(s,t,n,r);i[o]=c}return r.delete(e),i}throw new Error("Can't recurse into non-iterable type: ".concat(e))}return n.set(e,a.value),a.value}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h;return l(e,t)}function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set,r=e[0];if(n.has(r))throw new Error("Circular references are not supported.");var a=t(e);if(a.recurse&&null!==a.value)throw new Error("A deep zip function may not return both a value and recurse=true.");if(a.recurse){if(p(r)){var i=Array.isArray(r)?[]:{};n.add(r);var o=function(r){var a=l(e.map((function(e){return e[r]})),t,n);i[r]=a};for(var s in r)o(s);return n.delete(r),i}throw new Error("Can't recurse into non-iterable type: ".concat(r))}return a.value}function h(e){return null===e?null:p(e[0])?{value:null,recurse:!0}:{value:e,recurse:!1}}function d(e,t){return f.apply(this,arguments)}function f(){return(f=Object(i.a)(a.a.mark((function e(t,n){var r,i,o,s,c,l,h;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=new Map,u(t,n,r),i=0,o=Array.from(r.keys());case 3:if(!(i<o.length)){e.next=14;break}if(s=o[i],!((c=r.get(s))instanceof Promise)){e.next=11;break}return e.next=9,c;case 9:l=e.sent,r.set(s,l);case 11:i++,e.next=3;break;case 14:return h=u(t,n,r),e.abrupt("return",h);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e){return null!=e&&!ArrayBuffer.isView(e)&&(Array.isArray(e)||"object"===typeof e&&!(e instanceof o.Tensor))}function m(e){return null==e||(null===(t=e)||"object"!==typeof t&&"function"!==typeof t)||Array.isArray(e)||"object"===typeof e&&e instanceof o.Tensor||o.util.isTypedArray(e);var t}},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({log_:function(e){var t=Object(i.a)(e,"x","log"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.log(t);return n([t]),r}),n,null,a.xb)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}
2));var r=n(4),a=n(2),i=n(72);function o(e,t){Object(a.assertNonNull)(e);var n=Object(r.c)(e,t);if(1!==n.length)throw new Error("tensor1d() requires values to be a flat/TypedArray");return Object(i.a)(e,null,n,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(9),u=n(214);var c=Object(s.b)({split_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=Object(i.a)(e,"x","split"),c=function(e,r){var a=Object(o.parseAxisParam)(n,s.shape)[0],i=Object(u.a)(s,t,a);return e.split(s,i,a)},l={x:s},h={numOrSizeSplits:t,axis:n};return r.a.runKernelFunc(c,l,null,a.Bc,h)}})},function(e,t,n){"use strict";var r=n(93);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=i.default.memo(i.default.forwardRef((function(t,n){return i.default.createElement(o.default,(0,a.default)({ref:n},t),e)})));0;return n.muiName=o.default.muiName,n};var a=r(n(365)),i=r(n(1)),o=r(n(395))},function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return l}));var r=n(19),a=n(27),i=n(95);function o(e,t,n){var r=function(e,t,n){return function(e,t,n){var r=0,a=e.length,i=0,o=!1;for(;r<a;){var s=n(t,e[i=r+(a-r>>>1)]);s>0?r=i+1:(a=i,o=!s)}return o?r:-r-1}(e,t,n||s)}(e,t,n),a=r<0?-(r+1):r;e.splice(a,0,t)}function s(e,t){return e>t?1:e<t?-1:0}function u(e,t,n,r,a){return h(e,t,n,r,a,0).selectedIndices}function c(e,t,n,r,a,i){return h(e,t,n,r,a,0,!1,i,!0)}function l(e,t,n,r,a,i){return h(e,t,n,r,a,i,!0)}function h(e,t,n,s,u,c){for(var l=arguments.length>6&&void 0!==arguments[6]&&arguments[6],h=arguments.length>7&&void 0!==arguments[7]&&arguments[7],m=arguments.length>8&&void 0!==arguments[8]&&arguments[8],v=[],g=0;g<t.length;g++)t[g]>u&&v.push({score:t[g],boxIndex:g,suppressBeginIndex:0});v.sort(p);for(var b=c>0?-.5/c:0,y=[],x=[];y.length<n&&v.length>0;){var w=v.pop(),O=w.score,k=w.boxIndex,S=w.suppressBeginIndex;if(O<u)break;for(var _=!1,j=y.length-1;j>=S;--j){var E=d(e,k,y[j]);if(E>=s){_=!0;break}if(w.score=w.score*f(s,b,E),w.score<=u)break}w.suppressBeginIndex=y.length,_||(w.score===O?(y.push(k),x.push(w.score)):w.score>u&&o(v,w,p))}var T=y.length,C=n-T;h&&C>0&&(y.push.apply(y,Object(r.a)(new Array(C).fill(0))),x.push.apply(x,Object(r.a)(new Array(C).fill(0))));var M={selectedIndices:Object(i.a)(y,"int32")};return l&&(M.selectedScores=Object(i.a)(x,"float32")),m&&(M.validOutputs=Object(a.a)(T,"int32")),M}function d(e,t,n){var r=e.subarray(4*t,4*t+4),a=e.subarray(4*n,4*n+4),i=Math.min(r[0],r[2]),o=Math.min(r[1],r[3]),s=Math.max(r[0],r[2]),u=Math.max(r[1],r[3]),c=Math.min(a[0],a[2]),l=Math.min(a[1],a[3]),h=Math.max(a[0],a[2]),d=Math.max(a[1],a[3]),f=(s-i)*(u-o),p=(h-c)*(d-l);if(f<=0||p<=0)return 0;var m=Math.max(i,c),v=Math.max(o,l),g=Math.min(s,h),b=Math.min(u,d),y=Math.max(g-m,0)*Math.max(b-v,0);return y/(f+p-y)}function f(e,t,n){var r=Math.exp(t*n*n);return n<=e?r:0}function p(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(33),u=n(9),c=n(14);var l=Object(u.b)({depthwiseConv2d_:function(e,t,n,u){var l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"NHWC",h=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[1,1],d=arguments.length>6?arguments[6]:void 0,f=Object(i.a)(e,"x","depthwiseConv2d"),p=Object(i.a)(t,"filter","depthwiseConv2d"),m=f,v=!1;3===f.rank&&(v=!0,m=Object(c.a)(f,[1,f.shape[0],f.shape[1],f.shape[2]])),o.assert(4===m.rank,(function(){return"Error in depthwiseConv2d: input must be rank 4, but got "+"rank ".concat(m.rank,".")})),o.assert(4===p.rank,(function(){return"Error in depthwiseConv2d: filter must be rank 4, but got rank "+"".concat(p.rank,".")})),o.assert(m.shape[3]===p.shape[2],(function(){return"Error in depthwiseConv2d: number of input channels "+"(".concat(m.shape[3],") must match the inChannels dimension in ")+"filter ".concat(p.shape[2],".")})),null!=d&&o.assert(o.isInt(u),(function(){return"Error in depthwiseConv2d: pad must be an integer when using, "+"dimRoundingMode ".concat(d," but got pad ").concat(u,".")}));var g=function(e,t){null==h&&(h=[1,1]),o.assert(s.h(n,h),(function(){return"Error in depthwiseConv2d: Either strides or dilations must be "+"1. Got strides ".concat(n," and dilations '").concat(h,"'")}));var r=s.a(m.shape,p.shape,n,h,u,d,!0),a=e.depthwiseConv2D(m,p,r);return t([m,p]),a},b={x:m,filter:p},y={strides:n,pad:u,dataFormat:l,dilations:h,dimRoundingMode:d},x=r.a.runKernelFunc(g,b,null,a.L,y);return v?Object(c.a)(x,[x.shape[1],x.shape[2],x.shape[3]]):x}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(8),a=n(10),i=n(7),o=n(36),s=n(4),u=n(29),c=n(9);var l=Object(c.b)({equal_:function(e,t){var n=Object(s.a)(e,"a","equal"),c=Object(s.a)(t,"b","equal"),l=Object(o.makeTypesMatch)(n,c),h=Object(r.a)(l,2);
2n=h[0],c=h[1],Object(u.a)(n.shape,c.shape);var d={a:n,b:c};return a.a.runKernelFunc((function(e){return e.equal(n,c)}),d,null,i.V)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(2),i=n(74),o=n(79);function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"float32";if("complex64"===t){var n=s(e,"float32"),u=Object(o.a)(e,"float32");return Object(i.a)(n,u)}var c=Object(a.makeOnesTypedArray)(Object(a.sizeFromShape)(e),t);return r.a.makeTensor(c,e,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),a=n(7),i=n(4),o=n(9),s=n(20);var u=Object(o.b)({relu_:function(e){var t=Object(i.a)(e,"x","relu"),n={x:t};return r.a.runKernelFunc((function(e,n){return n([t]),"bool"===t.dtype?Object(s.a)(t,"int32"):e.relu(t)}),n,null,a.ec)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({step_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Object(i.a)(e,"x","step"),o={x:n},s={alpha:t};return r.a.runKernelFunc((function(e){return e.step(n,t)}),o,null,a.Fc,s)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(14);var u=n(9);function c(e){return null==e?null:0===e.rank?Object(s.a)(e,[e.size]):1===e.rank?e:2===e.rank?Object(s.a)(e,[1,1,e.shape[0],e.shape[1]]):3===e.rank?Object(s.a)(e,[1,e.shape[0],e.shape[1],e.shape[2]]):e}var l=Object(u.b)({batchNorm_:function(e,t,n,u,l,h){null==h&&(h=.001);var d,f,p=Object(i.a)(e,"x","batchNorm"),m=Object(i.a)(t,"mean","batchNorm"),v=Object(i.a)(n,"variance","batchNorm");null!=l&&(d=Object(i.a)(l,"scale","batchNorm")),null!=u&&(f=Object(i.a)(u,"offset","batchNorm")),o.assert(m.rank===v.rank,(function(){return"Batch normalization gradient requires mean and variance to have equal ranks."})),o.assert(null==f||m.rank===f.rank,(function(){return"Batch normalization gradient requires mean and offset to have equal ranks."})),o.assert(null==d||m.rank===d.rank,(function(){return"Batch normalization gradient requires mean and scale to have equal ranks."}));var g=function(e){return 0===e.rank||1===e.rank?Object(s.a)(e,[1,1,1,e.size]):2===e.rank?Object(s.a)(e,[1,1,e.shape[0],e.shape[1]]):3===e.rank?Object(s.a)(e,[1,e.shape[0],e.shape[1],e.shape[2]]):e}(p),b={x:g,scale:d,offset:f,mean:m,variance:v},y={varianceEpsilon:h},x=r.a.runKernelFunc((function(e,t){return t([g,m,v,d]),e.batchNorm(g,c(m),c(v),c(f),c(d),h)}),b,null,a.fb,y);return Object(s.a)(x,p.shape)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({sigmoid_:function(e){var t=Object(i.a)(e,"x","sigmoid"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.sigmoid(t);return n([r]),r}),n,null,a.sc)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(9);var u=Object(s.b)({tile_:function(e,t){var n=Object(i.a)(e,"x","tile",null);o.assert(n.rank===t.length,(function(){return"Error in transpose: rank of input ".concat(n.rank," ")+"must match length of reps ".concat(t,".")}));var s=[n],u={x:n},c={reps:t};return r.a.runKernelFunc((function(e,r){var a=e.tile(n,t);return r([n]),a}),u,null,a.Lc,c,s)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return an})),n.d(t,"b",(function(){return sn}));var r=n(3),a=n.n(r),i=n(13),o=n(5),s=n(11),u=n(0),c=n(85),l=n(19),h=n(8),d=n(6),f=function(){function e(t,n,r){var a=this;Object(o.a)(this,e),this.node=t,this.tensorMap=n,this.context=r,this.inputs=[],this.attrs={},this.inputs=t.inputNames.map((function(e){return a.getInput(e)})),null!=t.rawAttrs&&(this.attrs=Object.keys(t.rawAttrs).reduce((function(e,t){return e[t]=a.getAttr(t),e}),{}))}return Object(s.a)(e,[{key:"getInput",value:function(e){return Object(d.e)(e,this.tensorMap,this.context)}},{key:"getAttr",value:function(e,t){var n=this.node.rawAttrs[e];if(null!=n.tensor)return Object(d.e)(e,this.tensorMap,this.context);if(null!=n.i||null!=n.f)return Object(c.f)(this.node.rawAttrs,e,t);if(null!=n.s)return Object(c.i)(this.node.rawAttrs,e,t);if(null!=n.b)return Object(c.c)(this.node.rawAttrs,e,t);if(null!=n.shape)return Object(c.k)(this.node.rawAttrs,e,t);if(null!=n.type)return Object(c.e)(this.node.rawAttrs,e,t);if(null!=n.list){if(null!=n.list.i||null!=n.list.f)return Object(c.g)(this.node.rawAttrs,e,t);if(null!=n.list.s)return Object(c.h)(this.node.rawAttrs,e,t);if(null!=n.list.shape)return Object(c.j)(this.node.rawAttrs,e,t);if(null!=n.list.b)return Object(c.b)(this.node.rawAttrs,e,t);if(null!=n.list.type)return Object(c.d)(this.node.rawAttrs,e,t)}return t}}]),e}(),p=n(133),m=n(25),v=n(252),g=n(153),b=n(17),y=n(28),x=n(196),w=n(143),O=n(26),k=n(124),S=n(87),_=n(68),j=n(127),E=n(63),T=n(250),C=n(251),M=n(253),A=n(254),N=n(255),R=n(190),I=n(256),L=n(258),D=n(74),P=n(146),z=n(193),F=n(148),B=n(261),U=n(62),W=n(262),V=n(149),G=n(94),H=n(202),q=n(121),X=n(47),Y=n(273),K=n(114),Z=n(102),J=n(274),Q=n(209),$=n(105),ee=n(211),te=n(276),ne=n(212),re=n(203),ae=n(58),ie=n(40),oe=n(171),se=n(279),ue=n(259),ce=n(208),le=n(206),he=n(200),de=n(154);function fe(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";u.util.assert(pe(e,t),(function(){return n+" Shapes ".concat(e," and ").concat(t," must match")}))}function pe(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(-1!==e[n]&&-1!==t[n]&&e[n]!==t[n])return!1;return!0}var me=function(){function e(t,n,r,a,i,s,c){Object(o.a)(this,e),this.name=t,this.dtype=n,this.maxSize=r,this.elementShape=a,this.identicalElementShapes=i,this.dynamicSize=s,this.clearAfterRead=c,this.tensors=[],this.closed_
2=!1,this.idTensor=Object(u.scalar)(0),Object(u.keep)(this.idTensor)}return Object(s.a)(e,[{key:"clearAndClose",value:function(e){this.tensors.forEach((function(t){null!=e&&e.has(t.tensor.id)||t.tensor.dispose()})),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}},{key:"size",value:function(){return this.tensors.length}},{key:"read",value:function(e){if(this.closed_)throw new Error("TensorArray ".concat(this.name," has already been closed."));if(e<0||e>=this.size())throw new Error("Tried to read from index ".concat(e,", but array size is: ").concat(this.size()));var t=this.tensors[e];if(t.cleared)throw new Error("TensorArray ".concat(this.name,": Could not read index ").concat(e," twice because it was cleared after a previous read ")+"(perhaps try setting clear_after_read = false?).");return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor}},{key:"readMany",value:function(e){var t=this;return e.map((function(e){return t.read(e)}))}},{key:"write",value:function(e,t){if(this.closed_)throw new Error("TensorArray ".concat(this.name," has already been closed."));if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error("Tried to write to index ".concat(e,", but array is not resizeable and size is: ").concat(this.maxSize));var n=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error("TensorArray ".concat(this.name,": Could not write to TensorArray index ").concat(e,",\n because the value dtype is ").concat(t.dtype,", but TensorArray dtype is ").concat(this.dtype,"."));if(0!==this.size()||null!=this.elementShape&&0!==this.elementShape.length||(this.elementShape=t.shape),fe(this.elementShape,t.shape,"TensorArray ".concat(this.name,": Could not write to TensorArray index ").concat(e,".")),n.read)throw new Error("TensorArray ".concat(this.name,": Could not write to TensorArray index ").concat(e,", because it has already been read."));if(n.written)throw new Error("TensorArray ".concat(this.name,": Could not write to TensorArray index ").concat(e,", because it has already been written."));n.tensor=t,Object(u.keep)(t),n.written=!0,this.tensors[e]=n}},{key:"writeMany",value:function(e,t){var n=this;if(e.length!==t.length)throw new Error("TensorArray ".concat(this.name,": could not write multiple tensors,")+"because the index size: ".concat(e.length," is not the same as tensors size: ").concat(t.length,"."));e.forEach((function(e,r){return n.write(e,t[r])}))}},{key:"gather",value:function(e,t){if(t&&t!==this.dtype)throw new Error("TensorArray dtype is ".concat(this.dtype," but gather requested dtype ").concat(t));if(e)e=e.slice(0,this.size());else{e=[];for(var n=0;n<this.size();n++)e.push(n)}if(0===e.length)return Object(u.tensor)([],[0].concat(this.elementShape));var r=this.readMany(e);return fe(this.elementShape,r[0].shape,"TensorArray shape mismatch: "),Object(u.stack)(r,0)}},{key:"concat",value:function(e){if(e&&e!==this.dtype)throw new Error("TensorArray dtype is ".concat(this.dtype," but concat requested dtype ").concat(e));if(0===this.size())return Object(u.tensor)([],[0].concat(this.elementShape));for(var t=[],n=0;n<this.size();n++)t.push(n);var r=this.readMany(t);return fe(this.elementShape,r[0].shape,"TensorArray shape mismatch: tensor array shape (".concat(this.elementShape,") vs first tensor shape (").concat(r[0].shape,")")),Object(u.concat)(r,0)}},{key:"scatter",value:function(e,t){if(t.dtype!==this.dtype)throw new Error("TensorArray dtype is ".concat(this.dtype," but tensor has dtype ").concat(t.dtype));if(e.length!==t.shape[0])throw new Error("Expected len(indices) == tensor.shape[0], but saw: ".concat(e.length," vs. ").concat(t.shape[0]));var n=Math.max.apply(Math,Object(l.a)(e));if(!this.dynamicSize&&n>=this.maxSize)throw new Error("Max index must be < array size (".concat(n," vs. ").concat(this.maxSize,")"));this.writeMany(e,Object(u.unstack)(t,0))}},{key:"split",value:function(e,t){var n=this;if(t.dtype!==this.dtype)throw new Error("TensorArray dtype is ".concat(this.dtype," but tensor has dtype ").concat(t.dtype));var r=0,a=e.map((function(e){return r+=e}));if(r!==t.shape[0])throw new Error("Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ".concat(r,", and tensor's shape is: ").concat(t.shape));if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error("TensorArray's size is not equal to the size of lengths (".concat(this.maxSize," vs. ").concat(e.length,"), ")+"and the TensorArray is not marked as dynamically resizeable");var i=0===r?0:t.size/r,o=[];Object(u.tidy)((function(){t=Object(u.reshape)(t,[1,r,i]);for(var s=0;s<e.length;++s){var c=[0,0===s?0:a[s-1],0],l=[1,e[s],i];o[s]=Object(u.reshape)(Object(u.slice)(t,c,l),n.elementShape)}return o}
2));for(var s=[],c=0;c<e.length;c++)s[c]=c;this.writeMany(s,o)}},{key:"id",get:function(){return this.idTensor.id}},{key:"closed",get:function(){return this.closed_}}]),e}(),ve=function(){function e(t,n,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1;Object(o.a)(this,e),this.tensors=t,this.elementShape=n,this.elementDtype=r,null!=t&&t.forEach((function(e){if(r!==e.dtype)throw new Error("Invalid data types; op elements ".concat(r,", but list elements ").concat(e.dtype));fe(n,e.shape,"TensorList shape mismatch: "),Object(u.keep)(e)})),this.idTensor=Object(u.scalar)(0),this.maxNumElements=a,Object(u.keep)(this.idTensor)}return Object(s.a)(e,[{key:"copy",value:function(){return new e(Object(l.a)(this.tensors),this.elementShape,this.elementDtype)}},{key:"clearAndClose",value:function(e){this.tensors.forEach((function(t){null!=e&&e.has(t.id)||t.dispose()})),this.tensors.length=0,this.idTensor.dispose()}},{key:"size",value:function(){return this.tensors.length}},{key:"stack",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(t!==this.elementDtype)throw new Error("Invalid data types; op elements ".concat(t,", but list elements ").concat(this.elementDtype));if(-1!==r&&this.tensors.length!==r)throw new Error("Operation expected a list with ".concat(r," elements but got a list with ").concat(this.tensors.length," elements."));return fe(e,this.elementShape,"TensorList shape mismatch: "),Object(u.tidy)((function(){var t=n.tensors.map((function(t){return Object(u.reshape)(t,e)}));return Object(u.stack)(t,0)}))}},{key:"popBack",value:function(e,t){if(t!==this.elementDtype)throw new Error("Invalid data types; op elements ".concat(t,", but list elements ").concat(this.elementDtype));if(0===this.size())throw new Error("Trying to pop from an empty list.");var n=this.tensors.pop();return fe(n.shape,e,"TensorList shape mismatch: "),Object(u.reshape)(n,e)}},{key:"pushBack",value:function(e){if(e.dtype!==this.elementDtype)throw new Error("Invalid data types; op elements ".concat(e.dtype,", but list elements ").concat(this.elementDtype));if(fe(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");Object(u.keep)(e),this.tensors.push(e)}},{key:"resize",value:function(e){if(e<0)throw new Error("TensorListResize expects size to be non-negative. Got: ".concat(e));if(-1!==this.maxNumElements&&e>this.maxNumElements)throw new Error("TensorListResize input size ".concat(e," is greater maxNumElement ").concat(this.maxNumElements,"."));this.tensors.length=e}},{key:"getItem",value:function(e,t,n){if(n!==this.elementDtype)throw new Error("Invalid data types; op elements ".concat(n,", but list elements ").concat(this.elementDtype));if(e<0||e>this.tensors.length)throw new Error("Trying to access element ".concat(e," in a list with ").concat(this.tensors.length," elements."));if(null==this.tensors[e])throw new Error("element at index ".concat(e," is null."));return fe(this.tensors[e].shape,t,"TensorList shape mismatch: "),this.tensors[e]}},{key:"setItem",value:function(e,t){if(t.dtype!==this.elementDtype)throw new Error("Invalid data types; op elements ".concat(t.dtype,", but list elements ").concat(this.elementDtype));if(e<0||-1!==this.maxNumElements&&e>=this.maxNumElements)throw new Error("Trying to set element ".concat(e," in a list with max ").concat(this.maxNumElements," elements."));fe(this.elementShape,t.shape,"TensorList shape mismatch: "),Object(u.keep)(t),this.tensors[e]=t}},{key:"gather",value:function(e,t,n){var r=this;if(t!==this.elementDtype)throw new Error("Invalid data types; op elements ".concat(t,", but list elements ").concat(this.elementDtype));return fe(this.elementShape,n,"TensorList shape mismatch: "),0===(e=e.slice(0,this.size())).length?Object(u.tensor)([],[0].concat(this.elementShape)):Object(u.tidy)((function(){var t=e.map((function(e){return Object(u.reshape)(r.tensors[e],n)}));return Object(u.stack)(t,0)}))}},{key:"concat",value:function(e,t){var n=this;if(e&&e!==this.elementDtype)throw new Error("TensorList dtype is ".concat(this.elementDtype," but concat requested dtype ").concat(e));return fe(this.elementShape,t,"TensorList shape mismatch: "),0===this.size()?Object(u.tensor)([],[0].concat(this.elementShape)):Object(u.tidy)((function(){var e=n.tensors.map((function(e){return Object(u.reshape)(e,t)}));return Object(u.concat)(e,0)}))}},{key:"id",get:function(){return this.idTensor.id}}]),e}();function ge(e,t,n){var r=e.dtype;if(e.shape.length<1)throw new Error("Tensor must be at least a vector, but saw shape: ".concat(e.shape));if(e.dtype!==n)throw new Error("Invalid data types; op elements ".concat(e.dtype,", but list elements ").concat(n));fe(e.shape.slice(1),t,"TensorList shape mismatch: ");var a=Object(u.unstack)(e);return new ve(a,t,r)}function be(e,t,n){return new ve([],e,t,n)}function ye(e,t,n,r){if(t.length!==e.shape[0])throw new Error("Expected len(indices) == tensor.shape[0], but saw: ".concat(t.length," vs. ").concat(e.shape[0]));var a=Math.max.apply(Math,Object(l.a)(t));if(null!=r&&-1!==r&&a>=r)throw new Error("Max index must be < array size (".concat(a," vs. ").concat(r,")"));var i=new ve([],n,e.dtype,r),o=Object(u.unstack)(e,0);return t.forEach((function(e,t){i.setItem(e,o[t])})),i}function xe(e,t,n){var r=0,a=t.map((function(e){return r+=e}));if(r!==e.shape[0])throw new Error("Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ".concat(r,", and tensor's shape is: ").concat(e.shape));for(var i=0===r?0:e.size/r,o=Object(u.tidy)((function(){var o=[];e=Object(u.reshape)(e,[1,r,i]);for(var s=0;s<t.length;++s){var c=[0,0===s?0:a[s-1],0],l=[1,t[s],i];o[s]=Object(u.reshape)(Object(u.slice)(e,c,l),n)}return e.dispose(),o})),s=new ve([],n,e.dtype,t.length),c=0;c<o.length;c++)s.setItem(c,o[c]);return s}var we=function(){var e=Object(i.a)(a.a.mark((function e(t,n,r){var i,o,s,c,l,h,f,p,m,v,g,b,y,x,w,O,k,S,_,j,E,T,C,M,A,N,R,I,L,D,P,z,F,B,U,W,V,G,H,q,X,Y,K,Z,J,Q,$,ee,te,ne,re,ae,ie,oe,se,ue,ce,le,he,de,fe,pe,ve,we,Oe,ke,Se,_e,je,Ee,Te,Ce,Me,Ae,Ne,Re,Ie,Le,De,Pe,ze,Fe,Be,Ue,We,Ve,Ge,He,qe,Xe,Ye,Ke,Ze,Je,Qe;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.op,e.next="If"===e.t0||"StatelessIf"===e.t0?3:"While"===e.t0||"StatelessWhile"===e.t0?15:"LoopCond"===e.t0?19:"Switch"===e.t0?21:"Merge"===e.t0?32:"Enter"===e.t0?37:"Exit"===e.t0?41:"NextIteration"===e.t0?44:"TensorArrayV3"===e.t0?47:"TensorArrayWriteV3"===e.t0?57:"TensorArrayReadV3"===e.t0?63:"TensorArrayGatherV3"===e.t0?67:"TensorArrayScatterV3"===e.t0?72:"TensorArrayConcatV3"===e.t0?78:"TensorArraySplitV3"===e.t0?82:"TensorArraySizeV3"===e.t0?88:"TensorArrayCloseV3"===e.t0?91:"TensorListSetItem"===e.t0?95:"TensorListGetItem"===e.t0?101:"TensorListScatterV2"===e.t0||"TensorListScatter"===e.t0?107:"TensorListReserve"===e.t0?114:"TensorListGather"===e.t0?120:"TensorListStack"===e.t0?126:"TensorListFromTensor"===e.t0?132:"TensorListConcat"===e.t0?138:"TensorListPushBack"===e.t0?143:"TensorListPopBack"===e.t0?148:"TensorListSplit"===e.t0?153:159;break;case 3:return i=Object(d.d)("thenBranch",t,n,r),o=Object(d.d)("elseBranch",t,n,r),s=Object(d.d)("cond",t,n,r),c=Object(d.d)("args",t,n,r),e.next=9,s.data();case 9:if(!e.sent[0]){e.next=14;break}return e.abrupt("return",r.functionMap[i].executeFunctionAsync(c,r.tensorArrayMap,r.tensorListMap));case 14:return e.abrupt("return",r.functionMap[o].executeFunctionAsync(c,r.tensorArrayMap,r.tensorListMap));case 15:return e.delegateYield(a.a.mark((function e(){var i,o,s,u,c,l,h,f;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Object(d.d)("body",t,n,r),o=Object(d.d)("cond",t,n,r),s=Object(d.d)("args",t,n,r),e.next=5,r.functionMap[o].executeFunctionAsync(s,r.tensorArrayMap,r.tensorListMap);case 5:return u=e.sent,c=s.map((function(e){return e.id})),e.next=9,u[0].data();case 9:l=e.sent,u.forEach((function(e){e.kept||-1!==c.indexOf(e.id)||e.dispose()})),h=s,f=a.a.mark((function e(){var t,n,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=h,e.next=3,r.functionMap[i].executeFunctionAsync(h,r.tensorArrayMap,r.tensorListMap);case 3:return h=e.sent,n=h.map((function(e){return e.id})),t.forEach((function(e){e.kept||-1!==c.indexOf(e.id)||-1!==n.indexOf(e.id)||e.dispose()})),e.next=8,r.functionMap[o].executeFunctionAsync(h,r.tensorArrayMap,r.tensorListMap);case 8:return s=e.sent,e.next=11,s[0].data();
2case 11:l=e.sent,s.forEach((function(e){e.kept||-1!==c.indexOf(e.id)||-1!==n.indexOf(e.id)||e.dispose()}));case 13:case"end":return e.stop()}}),e)}));case 13:if(!l[0]){e.next=17;break}return e.delegateYield(f(),"t0",15);case 15:e.next=13;break;case 17:return e.abrupt("return",{v:h});case 18:case"end":return e.stop()}}),e)}))(),"t1",16);case 16:if("object"!==typeof(l=e.t1)){e.next=19;break}return e.abrupt("return",l.v);case 19:return h=Object(d.d)("pred",t,n,r),e.abrupt("return",[Object(d.a)(h)]);case 21:return f=Object(d.d)("pred",t,n,r),(p=Object(d.d)("data",t,n,r)).kept||(p=Object(d.a)(p)),e.next=26,f.data();case 26:if(!e.sent[0]){e.next=30;break}e.t2=[void 0,p],e.next=31;break;case 30:e.t2=[p,void 0];case 31:return e.abrupt("return",e.t2);case 32:if(!(m=t.inputNames.find((function(e){return void 0!==Object(d.e)(e,n,r)})))){e.next=36;break}return v=Object(d.e)(m,n,r),e.abrupt("return",[Object(d.a)(v)]);case 36:return e.abrupt("return",void 0);case 37:return g=Object(d.d)("frameName",t,n,r),b=Object(d.d)("tensor",t,n,r),r.enterFrame(g),e.abrupt("return",[Object(d.a)(b)]);case 41:return y=Object(d.d)("tensor",t,n,r),r.exitFrame(),e.abrupt("return",[Object(d.a)(y)]);case 44:return x=Object(d.d)("tensor",t,n,r),r.nextIteration(),e.abrupt("return",[Object(d.a)(x)]);case 47:return w=Object(d.d)("size",t,n,r),O=Object(d.d)("dtype",t,n,r),k=Object(d.d)("elementShape",t,n,r),S=Object(d.d)("dynamicSize",t,n,r),_=Object(d.d)("clearAfterRead",t,n,r),j=Object(d.d)("identicalElementShapes",t,n,r),E=Object(d.d)("name",t,n,r),T=new me(E,O,w,k,j,S,_),r.addTensorArray(T),e.abrupt("return",[T.idTensor,Object(u.scalar)(1)]);case 57:return C=Object(d.d)("tensorArrayId",t,n,r),M=Object(d.d)("index",t,n,r),A=Object(d.d)("tensor",t,n,r),(N=r.getTensorArray(C.id)).write(M,A),e.abrupt("return",[N.idTensor]);case 63:return R=Object(d.d)("tensorArrayId",t,n,r),I=Object(d.d)("index",t,n,r),L=r.getTensorArray(R.id),e.abrupt("return",[L.read(I)]);case 67:return D=Object(d.d)("tensorArrayId",t,n,r),P=Object(d.d)("indices",t,n,r),z=Object(d.d)("dtype",t,n,r),F=r.getTensorArray(D.id),e.abrupt("return",[F.gather(P,z)]);case 72:return B=Object(d.d)("tensorArrayId",t,n,r),U=Object(d.d)("indices",t,n,r),W=Object(d.d)("tensor",t,n,r),(V=r.getTensorArray(B.id)).scatter(U,W),e.abrupt("return",[V.idTensor]);case 78:return G=Object(d.d)("tensorArrayId",t,n,r),H=r.getTensorArray(G.id),q=Object(d.d)("dtype",t,n,r),e.abrupt("return",[H.concat(q)]);case 82:return X=Object(d.d)("tensorArrayId",t,n,r),Y=Object(d.d)("tensor",t,n,r),K=Object(d.d)("lengths",t,n,r),(Z=r.getTensorArray(X.id)).split(K,Y),e.abrupt("return",[Z.idTensor]);case 88:return J=Object(d.d)("tensorArrayId",t,n,r),Q=r.getTensorArray(J.id),e.abrupt("return",[Object(u.scalar)(Q.size(),"int32")]);case 91:return $=Object(d.d)("tensorArrayId",t,n,r),(ee=r.getTensorArray($.id)).clearAndClose(),e.abrupt("return",[ee.idTensor]);case 95:return te=Object(d.d)("tensorListId",t,n,r),ne=Object(d.d)("index",t,n,r),re=Object(d.d)("tensor",t,n,r),(ae=r.getTensorList(te.id)).setItem(ne,re),e.abrupt("return",[ae.idTensor]);case 101:return ie=Object(d.d)("tensorListId",t,n,r),oe=Object(d.d)("index",t,n,r),se=Object(d.d)("elementShape",t,n,r),ue=Object(d.d)("elementDType",t,n,r),ce=r.getTensorList(ie.id),e.abrupt("return",[ce.getItem(oe,se,ue)]);case 107:return le=Object(d.d)("indices",t,n,r),he=Object(d.d)("tensor",t,n,r),de=Object(d.d)("elementShape",t,n,r),fe=Object(d.d)("numElements",t,n,r),pe=ye(he,le,de,fe),r.addTensorList(pe),e.abrupt("return",[pe.idTensor]);case 114:return ve=Object(d.d)("elementShape",t,n,r),we=Object(d.d)("elementDType",t,n,r),Oe=Object(d.d)("numElements",t,n,r),ke=be(ve,we,Oe),r.addTensorList(ke),e.abrupt("return",[ke.idTensor]);case 120:return Se=Object(d.d)("tensorListId",t,n,r),_e=Object(d.d)("indices",t,n,r),je=Object(d.d)("elementShape",t,n,r),Ee=Object(d.d)("elementDType",t,n,r),Te=r.getTensorList(Se.id),e.abrupt("return",[Te.gather(_e,Ee,je)]);case 126:return Ce=Object(d.d)("tensorListId",t,n,r),Me=Object(d.d)("elementShape",t,n,r),Ae=Object(d.d)("elementDType",t,n,r),Ne=Object(d.d)("numElements",t,n,r),Re=r.getTensorList(Ce.id),e.abrupt("return",[Re.stack(Me,Ae,Ne)]);case 132:return Ie=Object(d.d)("tensor",t,n,r),Le=Object(d.d)("elementShape",t,n,r),De=Object(d.d)("elementDType",t,n,r),Pe=ge(Ie,Le,De),r.addTensorList(Pe),e.abrupt("return",[Pe.idTensor]);case 138:return ze=Object(d.d)("tensorListId",t,n,r),Fe=r.getTensorList(ze.id),Be=Object(d.d)("dtype",t,n,r),Ue=Object(d.d)("elementShape",t,n,r),e.abrupt("return",[Fe.concat(Be,Ue)]);case 143:return We=Object(d.d)("tensorListId",t,n,r),Ve=Object(d.d)("tensor",t,n,r),(Ge=r.getTensorList(We.id)).pushBack(Ve),e.abrupt("return",[Ge.idTensor]);case 148:return He=Object(d.d)("tensorListId",t,n,r),qe=Object(d.d)("elementShape",t,n,r),Xe=Object(d.d)("elementDType",t,n,r),Ye=r.getTensorList(He.id),e.abrupt("return",[Ye.popBack(qe,Xe)]);case 153:return Ke=Object(d.d)("tensor",t,n,r),Ze=Object(d.d)("elementShape",t,n,r),Je=Object(d.d)("lengths",t,n,r),Qe=xe(Ke,Je,Ze),r.addTensorList(Qe),e.abrupt("return",[Qe.idTensor]);case 159:throw TypeError("Node type ".concat(t.op," is not implemented"));case 160:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),Oe=n(191),ke=n(88),Se=n(30),_e=n(192),je=n(99),Ee=n(260),Te=n(145),Ce=n(152),Me=n(270),Ae=n(257),Ne=n(269),Re=n(195);function Ie(e,t,n){var r=Object(d.d)("fusedOps",e,t,n),a=Object(h.a)(r,2),i=a[0],o=a[1],s="biasadd"===i,u="prelu"===o,c="fusedbatchnorm"===i,l=Object(d.d)("numArgs",e,t,n);if(s){if(u&&2!==l)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!u&&1!==l)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.")}if(c)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported.");var f=Object(d.d)("strides",e,t,n),p=Object(d.c)(e,t,n),m=Object(d.d)("dataFormat",e,t,n).toUpperCase(),v=Object(d.d)("dilations",e,t,n),g=Object(d.d)("args",e,t,n),b=Object(h.a)(g,2);return{stride:f,pad:p,dataFormat:m,dilations:v,biasArg:b[0],preluArg:b[1],activationFunc:o}}var Le=n(144),De=n(266),Pe=n(271),ze=n(136),Fe=n(101),Be=n(272),Ue=n(207),We=n(172),Ve=n(280),Ge=n(79),He=n(34),qe=n(20),Xe=n(217),Ye=n(275);function Ke(e,t,n){return{boxes:Object(d.d)("boxes",e,t,n),scores:Object(d.d)("scores",e,t,n),maxOutputSize:Object(d.d)("maxOutputSize",e,t,n),iouThreshold:Object(d.d)("iouThreshold",e,t,n),scoreThreshold:Object(d.d)("scoreThreshold",e,t,n),softNmsSigma:Object(d.d)("softNmsSigma",e,t,n)}}var Ze=function(){var e=Object(i.a)(a.a.mark((function e(t,n,r){var i,o,s,u,c,l,h,f,p,m,v,g,b,y,x,w,O,k,S,_,j,E,T,C;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.op,e.next="NonMaxSuppressionV5"===e.t0?3:"NonMaxSuppressionV4"===e.t0?8:"NonMaxSuppressionV3"===e.t0||"NonMaxSuppressionV2"===e.t0?14:"Where"===e.t0?19:"ListDiff"===e.t0?26:27;break;case 3:return i=Ke(t,n,r),o=i.boxes,s=i.scores,u=i.maxOutputSize,c=i.iouThreshold,l=i.scoreThreshold,h=i.softNmsSigma,e.next=6,Se.zb.nonMaxSuppressionWithScoreAsync(o,s,u,c,l,h);case 6:return f=e.sent,e.abrupt("return",[f.selectedIndices,f.selectedScores]);case 8:return p=Ke(t,n,r),m=p.boxes,v=p.scores,g=p.maxOutputSize,b=p.iouThreshold,y=p.scoreThreshold,x=Object(d.d)("padToMaxOutputSize",t,n,r),e.next=12,Se.zb.n
2onMaxSuppressionPaddedAsync(m,v,g,b,y,x);case 12:return w=e.sent,e.abrupt("return",[w.selectedIndices,w.validOutputs]);case 14:return O=Ke(t,n,r),k=O.boxes,S=O.scores,_=O.maxOutputSize,j=O.iouThreshold,E=O.scoreThreshold,e.next=17,Se.zb.nonMaxSuppressionAsync(k,S,_,j,E);case 17:return e.t1=e.sent,e.abrupt("return",[e.t1]);case 19:return T=qe.a(Object(d.d)("condition",t,n,r),"bool"),e.next=22,Xe.a(T);case 22:return e.t2=e.sent,C=[e.t2],T.dispose(),e.abrupt("return",C);case 26:return e.abrupt("return",Ye.a(Object(d.d)("x",t,n,r),Object(d.d)("y",t,n,r)));case 27:throw TypeError("Node type ".concat(t.op," is not implemented"));case 28:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),Je=n(216),Qe=n(95),$e=n(27),et=n(100),tt=n(125),nt=n(71),rt=n(77),at=n(122),it=n(78),ot=n(81),st=n(123),ut=n(151),ct=n(59),lt=n(43),ht=n(45),dt=n(104),ft=n(201),pt=n(277),mt=n(268),vt=n(296),gt=n(90),bt=n(113),yt=n(135),xt=n(31),wt=n(186),Ot=n(187),kt=n(188),St=n(189),_t=n(147),jt=n(49),Et=n(120),Tt=n(69),Ct=n(41),Mt=n(278),At=n(128),Nt=n(14),Rt=n(82),It=n(129),Lt=n(106),Dt=n(96),Pt=n(283),zt=n(284),Ft=n(156),Bt=n(137),Ut=n(157),Wt=n(213),Vt=n(73),Gt=n(80),Ht=n(126),qt=n(119),Xt=n(194),Yt=n(134);function Kt(e,t,n){var r=function(e,t,n){switch(e.category){case"arithmetic":return u.tidy((function(){return function(e,t,n){switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[m.a(Object(d.d)("a",e,t,n),Object(d.d)("b",e,t,n))];case"AddN":return[v.a(Object(d.d)("tensors",e,t,n))];case"FloorMod":case"Mod":return[g.a(Object(d.d)("a",e,t,n),Object(d.d)("b",e,t,n))];case"Mul":return[b.a(Object(d.d)("a",e,t,n),Object(d.d)("b",e,t,n))];case"RealDiv":case"Div":return[y.a(Object(d.d)("a",e,t,n),Object(d.d)("b",e,t,n))];case"DivNoNan":return[x.a(Object(d.d)("a",e,t,n),Object(d.d)("b",e,t,n))];case"FloorDiv":return[w.a(Object(d.d)("a",e,t,n),Object(d.d)("b",e,t,n))];case"Sub":return[O.a(Object(d.d)("a",e,t,n),Object(d.d)("b",e,t,n))];case"Minimum":return[k.a(Object(d.d)("a",e,t,n),Object(d.d)("b",e,t,n))];case"Maximum":return[S.a(Object(d.d)("a",e,t,n),Object(d.d)("b",e,t,n))];case"Pow":return[_.a(Object(d.d)("a",e,t,n),Object(d.d)("b",e,t,n))];case"SquaredDifference":return[j.a(Object(d.d)("a",e,t,n),Object(d.d)("b",e,t,n))];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"basic_math":return u.tidy((function(){return function(e,t,n){switch(e.op){case"Abs":case"ComplexAbs":return[E.a(Object(d.d)("x",e,t,n))];case"Acos":return[T.a(Object(d.d)("x",e,t,n))];case"Acosh":return[C.a(Object(d.d)("x",e,t,n))];case"Asin":return[M.a(Object(d.d)("x",e,t,n))];case"Asinh":return[A.a(Object(d.d)("x",e,t,n))];case"Atan":return[N.a(Object(d.d)("x",e,t,n))];case"Atan2":return[R.a(Object(d.d)("x",e,t,n),Object(d.d)("y",e,t,n))];case"Atanh":return[I.a(Object(d.d)("x",e,t,n))];case"Ceil":return[L.a(Object(d.d)("x",e,t,n))];case"Complex":return[D.a(Object(d.d)("real",e,t,n),Object(d.d)("imag",e,t,n))];case"Cos":return[P.a(Object(d.d)("x",e,t,n))];case"Cosh":return[z.a(Object(d.d)("x",e,t,n))];case"Elu":return[F.a(Object(d.d)("x",e,t,n))];case"Erf":return[B.a(Object(d.d)("x",e,t,n))];case"Exp":return[U.a(Object(d.d)("x",e,t,n))];case"Expm1":return[W.a(Object(d.d)("x",e,t,n))];case"Floor":return[V.a(Object(d.d)("x",e,t,n))];case"Log":return[G.a(Object(d.d)("x",e,t,n))];case"Log1p":return[H.a(Object(d.d)("x",e,t,n))];case"Imag":return[q.a(Object(d.d)("x",e,t,n))];case"Neg":return[X.a(Object(d.d)("x",e,t,n))];case"Reciprocal":return[Y.a(Object(d.d)("x",e,t,n))];case"Real":return[K.a(Object(d.d)("x",e,t,n))];case"Relu":return[Z.a(Object(d.d)("x",e,t,n))];case"Round":return[J.a(Object(d.d)("x",e,t,n))];case"Selu":return[Q.a(Object(d.d)("x",e,t,n))];case"Sigmoid":return[$.a(Object(d.d)("x",e,t,n))];case"Sin":return[ee.a(Object(d.d)("x",e,t,n))];case"Sign":return[te.a(Object(d.d)("x",e,t,n))];case"Sinh":return[ne.a(Object(d.d)("x",e,t,n))];case"Softplus":return[re.a(Object(d.d)("x",e,t,n))];case"Sqrt":return[ae.a(Object(d.d)("x",e,t,n))];case"Square":return[ie.a(Object(d.d)("x",e,t,n))];case"Tanh":return[oe.a(Object(d.d)("x",e,t,n))];case"Tan":return[se.a(Object(d.d)("x",e,t,n))];case"Relu6":case"ClipByValue":return[ue.a(Object(d.d)("x",e,t,n),Object(d.d)("clipValueMin",e,t,n),Object(d.d)("clipValueMax",e,t,n))];case"Rsqrt":return[ce.a(Object(d.e)(e.inputNames[0],t,n))];case"Prod":return[le.a(Object(d.d)("x",e,t,n),Object(d.d)("axes",e,t,n))];case"LeakyRelu":return[he.a(Object(d.d)("x",e,t,n),Object(d.d)("alph
2a",e,t,n))];case"Prelu":return[de.a(Object(d.d)("x",e,t,n),Object(d.d)("alpha",e,t,n))];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"control":return we(e,t,n);case"convolution":return u.tidy((function(){return function(e,t,n){switch(e.op){case"Conv1D":var r=Object(d.d)("stride",e,t,n),a=Object(d.d)("pad",e,t,n),i=Object(d.d)("dataFormat",e,t,n).toUpperCase(),o=Object(d.d)("dilation",e,t,n);return[Oe.a(Object(d.d)("x",e,t,n),Object(d.d)("filter",e,t,n),r,a,i,o)];case"Conv2D":var s=Object(d.d)("strides",e,t,n),u=Object(d.c)(e,t,n),c=Object(d.d)("dataFormat",e,t,n).toUpperCase(),l=Object(d.d)("dilations",e,t,n);return[ke.a(Object(d.d)("x",e,t,n),Object(d.d)("filter",e,t,n),[s[1],s[2]],u,c,[l[1],l[2]])];case"_FusedConv2D":var h=Ie(e,t,n),f=h.stride,p=h.pad,m=h.dataFormat,v=h.dilations,g=h.biasArg,b=h.preluArg,y=h.activationFunc;return[Se.qb.conv2d({x:Object(d.d)("x",e,t,n),filter:Object(d.d)("filter",e,t,n),strides:[f[1],f[2]],pad:p,dataFormat:m,dilations:[v[1],v[2]],bias:g,activation:y,preluActivationWeights:b})];case"FusedDepthwiseConv2dNative":var x=Ie(e,t,n),w=x.stride,O=x.pad,k=x.dataFormat,S=x.dilations,_=x.biasArg,j=x.preluArg,E=x.activationFunc;return[Se.qb.depthwiseConv2d({x:Object(d.d)("x",e,t,n),filter:Object(d.d)("filter",e,t,n),strides:[w[1],w[2]],pad:O,dataFormat:k,dilations:[S[1],S[2]],bias:_,activation:E,preluActivationWeights:j})];case"Conv2DBackpropInput":case"Conv2dTranspose":var T=Object(d.d)("outputShape",e,t,n),C=Object(d.d)("strides",e,t,n),M=Object(d.c)(e,t,n);return[_e.a(Object(d.d)("x",e,t,n),Object(d.d)("filter",e,t,n),T,[C[1],C[2]],M)];case"DepthwiseConv2dNative":case"DepthwiseConv2d":var A=Object(d.d)("strides",e,t,n),N=Object(d.c)(e,t,n),R=Object(d.d)("dilations",e,t,n),I=Object(d.d)("dataFormat",e,t,n).toUpperCase();return[je.a(Object(d.d)("input",e,t,n),Object(d.d)("filter",e,t,n),[A[1],A[2]],N,I,[R[1],R[2]])];case"Conv3D":var L=Object(d.d)("strides",e,t,n),D=Object(d.d)("pad",e,t,n),P=Object(d.d)("dataFormat",e,t,n).toUpperCase(),z=Object(d.d)("dilations",e,t,n);return[Ee.a(Object(d.d)("x",e,t,n),Object(d.d)("filter",e,t,n),[L[1],L[2],L[3]],D,P,[z[1],z[2],z[3]])];case"AvgPool":var F=Object(d.d)("strides",e,t,n),B=Object(d.d)("pad",e,t,n),U=Object(d.d)("kernelSize",e,t,n);return[Te.a(Object(d.d)("x",e,t,n),[U[1],U[2]],[F[1],F[2]],B)];case"MaxPool":var W=Object(d.d)("strides",e,t,n),V=Object(d.d)("pad",e,t,n),G=Object(d.d)("kernelSize",e,t,n);return[Ce.a(Object(d.d)("x",e,t,n),[G[1],G[2]],[W[1],W[2]],V)];case"MaxPoolWithArgmax":var H=Object(d.d)("strides",e,t,n),q=Object(d.d)("pad",e,t,n),X=Object(d.d)("kernelSize",e,t,n),Y=Object(d.d)("includeBatchInIndex",e,t,n),K=Me.a(Object(d.d)("x",e,t,n),[X[1],X[2]],[H[1],H[2]],q,Y);return[K.result,K.indexes];case"AvgPool3D":var Z=Object(d.d)("strides",e,t,n),J=Object(d.d)("pad",e,t,n),Q=Object(d.d)("kernelSize",e,t,n);return[Ae.a(Object(d.d)("x",e,t,n),[Q[1],Q[2],Q[3]],[Z[1],Z[2],Z[3]],J)];case"MaxPool3D":var $=Object(d.d)("strides",e,t,n),ee=Object(d.d)("pad",e,t,n),te=Object(d.d)("kernelSize",e,t,n);return[Ne.a(Object(d.d)("x",e,t,n),[te[1],te[2],te[3]],[$[1],$[2],$[3]],ee)];case"Dilation2D":var ne=Object(d.d)("strides",e,t,n),re=Object(d.d)("pad",e,t,n),ae=Object(d.d)("dilations",e,t,n),ie=ne[1],oe=ne[2],se=ae[1],ue=ae[2];return[Re.a(Object(d.d)("x",e,t,n),Object(d.d)("filter",e,t,n),[ie,oe],re,[se,ue],"NHWC")];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"creation":return u.tidy((function(){return function(e,t,n){switch(e.op){case"Fill":var r=Object(d.d)("shape",e,t,n),a=Object(d.d)("dtype",e,t,n),i=Object(d.d)("value",e,t,n);return[Le.a(r,i,a)];case"LinSpace":var o=Object(d.d)("start",e,t,n),s=Object(d.d)("stop",e,t,n),u=Object(d.d)("num",e,t,n);return[De.a(o,s,u)];case"Multinomial":var c=Object(d.d)("logits",e,t,n),l=Object(d.d)("numSamples",e,t,n),h=Object(d.d)("seed",e,t,n);return[Pe.a(c,l,h)];case"OneHot":var f=Object(d.d)("indices",e,t,n),p=Object(d.d)("depth",e,t,n),m=Object(d.d)("onValue",e,t,n),v=Object(d.d)("offValue",e,t,n);return[ze.a(f,p,m,v)];case"Ones":return[Fe.a(Object(d.d)("shape",e,t,n),Object(d.d)("dtype",e,t,n))];case"OnesLike":return[Be.a(Object(d.d)("x",e,t,n))];case"RandomUniform":return[Ue.a(Object(d.d)("shape",e,t,n),Object(d.d)("minval",e,t,n),Object(d.d)("maxval",e,t,n),Object(d.d)("dtype",e,t,n))];case"Range":var g=Object(d.d)("start",e,t,n),b=Object(d.d)("stop",e,t,n),y=Object(d.d)("step",e,t,n);return[We.a(g,b,y,Object(d.d)("dtype",e,t,n))];case"TruncatedNormal":var x=Object(d.d)("shape",e,t,n),w=Object(d.d)("mean",e,t,n),O=Object(d.d)("stdDev",e,t,n),k=Object(d.d)("seed",e,t,n);return[Ve.a(x,w,O,Object(d.d)("dtype",e,t,n),k)];case"Zeros":return[Ge.a(Object(d.d)("shape",e,t,n),Object(d.d)("dtype",e,t,n))];case"ZerosLike":return[He.a(Object(d.d)("x",e,t,n))];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}
2(e,t,n)}));case"dynamic":return Ze(e,t,n);case"evaluation":return u.tidy((function(){return function(e,t,n){switch(e.op){case"TopKV2":var r=Object(d.d)("x",e,t,n),a=Object(d.d)("k",e,t,n),i=Object(d.d)("sorted",e,t,n),o=Je.a(r,a,i);return[o.values,o.indices];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"image":return u.tidy((function(){return function(e,t,n){switch(e.op){case"ResizeBilinear":var r=Object(d.d)("images",e,t,n),a=Object(d.d)("size",e,t,n),i=Object(d.d)("alignCorners",e,t,n);return[Se.zb.resizeBilinear(r,[a[0],a[1]],i)];case"ResizeNearestNeighbor":var o=Object(d.d)("images",e,t,n),s=Object(d.d)("size",e,t,n),u=Object(d.d)("alignCorners",e,t,n);return[Se.zb.resizeNearestNeighbor(o,[s[0],s[1]],u)];case"CropAndResize":var c=Object(d.d)("image",e,t,n),l=Object(d.d)("boxes",e,t,n),h=Object(d.d)("boxInd",e,t,n),f=Object(d.d)("cropSize",e,t,n),p=Object(d.d)("method",e,t,n),m=Object(d.d)("extrapolationValue",e,t,n);return[Se.zb.cropAndResize(c,l,h,f,p,m)];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"graph":return u.tidy((function(){return function(e,t,n){switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":var r=Object(d.d)("default",e,t,n);return[Object(d.e)(e.name,t,n)||r];case"Placeholder":return[Object(d.e)(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":var a=Object(d.d)("x",e,t,n);return[Object(d.a)(a)];case"IdentityN":return Object(d.d)("x",e,t,n).map((function(e){return Object(d.a)(e)}));case"Snapshot":var i=Object(d.d)("x",e,t,n);return[Object(d.a)(i)];case"Shape":return[Qe.a(Object(d.d)("x",e,t,n).shape,"int32")];case"ShapeN":return Object(d.d)("x",e,t,n).map((function(e){return Qe.a(e.shape)}));case"Size":return[$e.a(Object(d.d)("x",e,t,n).size,"int32")];case"Rank":return[$e.a(Object(d.d)("x",e,t,n).rank,"int32")];case"NoOp":return[$e.a(1)];case"Print":var o=Object(d.d)("x",e,t,n),s=Object(d.d)("data",e,t,n),u=Object(d.d)("message",e,t,n),c=Object(d.d)("summarize",e,t,n);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(u);for(var l=0;l<s.length;l++)console.log(Array.prototype.slice.call(s[l].dataSync()).slice(0,c));return[o];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"logical":return u.tidy((function(){return function(e,t,n){switch(e.op){case"Equal":return[et.a(Object(d.d)("a",e,t,n),Object(d.d)("b",e,t,n))];case"NotEqual":return[tt.a(Object(d.d)("a",e,t,n),Object(d.d)("b",e,t,n))];case"Greater":return[nt.a(Object(d.d)("a",e,t,n),Object(d.d)("b",e,t,n))];case"GreaterEqual":return[rt.a(Object(d.d)("a",e,t,n),Object(d.d)("b",e,t,n))];case"Less":return[at.a(Object(d.d)("a",e,t,n),Object(d.d)("b",e,t,n))];case"LessEqual":return[it.a(Object(d.d)("a",e,t,n),Object(d.d)("b",e,t,n))];case"LogicalAnd":return[ot.a(Object(d.d)("a",e,t,n),Object(d.d)("b",e,t,n))];case"LogicalNot":return[st.a(Object(d.d)("a",e,t,n))];case"LogicalOr":return[ut.a(Object(d.d)("a",e,t,n),Object(d.d)("b",e,t,n))];case"Select":case"SelectV2":return[ct.a(Object(d.d)("condition",e,t,n),Object(d.d)("a",e,t,n),Object(d.d)("b",e,t,n))];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"matrices":return u.tidy((function(){return function(e,t,n){switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[lt.a(Object(d.d)("a",e,t,n),Object(d.d)("b",e,t,n),Object(d.d)("transposeA",e,t,n),Object(d.d)("transposeB",e,t,n))];case"Transpose":return[ht.a(Object(d.d)("x",e,t,n),Object(d.d)("perm",e,t,n))];case"_FusedMatMul":var r=Object(d.d)("fusedOps",e,t,n),a=Object(h.a)(r,2),i=a[0],o=a[1],s="biasadd"===i,u="prelu"===o,c=Object(d.d)("numArgs",e,t,n);if(s){if(u&&2!==c)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!u&&1!==c)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}var l=Object(d.d)("args",e,t,n),f=Object(h.a)(l,2),p=f[0],m=f[1];return[Se.qb.matMul({a:Object(d.d)("a",e,t,n),b:Object(d.d)("b",e,t,n),transposeA:Object(d.d)("transposeA",e,t,n),transposeB:Object(d.d)("transposeB",e,t,n),bias:p,activation:o,preluActivationWeights:m})];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}
2(e,t,n)}));case"normalization":return u.tidy((function(){return function(e,t,n){switch(e.op){case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[dt.a(Object(d.d)("x",e,t,n),Object(d.d)("mean",e,t,n),Object(d.d)("variance",e,t,n),Object(d.d)("offset",e,t,n),Object(d.d)("scale",e,t,n),Object(d.d)("epsilon",e,t,n))];case"LRN":return[ft.a(Object(d.d)("x",e,t,n),Object(d.d)("radius",e,t,n),Object(d.d)("bias",e,t,n),Object(d.d)("alpha",e,t,n),Object(d.d)("beta",e,t,n))];case"Softmax":return[pt.a(Object(d.d)("x",e,t,n))];case"LogSoftmax":return[mt.a(Object(d.d)("x",e,t,n))];case"SparseToDense":return[vt.a(Object(d.d)("sparseIndices",e,t,n),Object(d.d)("outputShape",e,t,n),Object(d.d)("sparseValues",e,t,n),Object(d.d)("defaultValue",e,t,n))];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"reduction":return u.tidy((function(){return function(e,t,n){switch(e.op){case"Max":var r=Object(d.d)("axis",e,t,n),a=Object(d.d)("keepDims",e,t,n);return[gt.a(Object(d.d)("x",e,t,n),r,a)];case"Mean":var i=Object(d.d)("axis",e,t,n),o=Object(d.d)("keepDims",e,t,n);return[bt.a(Object(d.d)("x",e,t,n),i,o)];case"Min":var s=Object(d.d)("axis",e,t,n),u=Object(d.d)("keepDims",e,t,n);return[yt.a(Object(d.d)("x",e,t,n),s,u)];case"Sum":var c=Object(d.d)("axis",e,t,n),l=Object(d.d)("keepDims",e,t,n);return[xt.a(Object(d.d)("x",e,t,n),c,l)];case"All":var h=Object(d.d)("axis",e,t,n),f=Object(d.d)("keepDims",e,t,n);return[wt.a(Object(d.d)("x",e,t,n),h,f)];case"Any":var p=Object(d.d)("axis",e,t,n),m=Object(d.d)("keepDims",e,t,n);return[Ot.a(Object(d.d)("x",e,t,n),p,m)];case"ArgMax":var v=Object(d.d)("axis",e,t,n);return[kt.a(Object(d.d)("x",e,t,n),v)];case"ArgMin":var g=Object(d.d)("axis",e,t,n);return[St.a(Object(d.d)("x",e,t,n),g)];case"Prod":var b=Object(d.d)("axis",e,t,n),y=Object(d.d)("keepDims",e,t,n);return[le.a(Object(d.d)("x",e,t,n),b,y)];case"Cumsum":var x=Object(d.d)("axis",e,t,n),w=Object(d.d)("exclusive",e,t,n),O=Object(d.d)("reverse",e,t,n);return[_t.a(Object(d.d)("x",e,t,n),x,w,O)];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"slice_join":return u.tidy((function(){return function(e,t,n){switch(e.op){case"ConcatV2":case"Concat":var r=Object(d.d)("n",e,t,n),a=Object(d.d)("axis",e,t,n),i=Object(d.d)("tensors",e,t,n);return i=i.slice(0,r),[jt.a(i,a)];case"GatherV2":case"Gather":var o=Object(d.d)("axis",e,t,n),s=Object(d.d)("x",e,t,n),c=Object(d.d)("indices",e,t,n);return[Et.a(s,qe.a(c,"int32"),o)];case"ReverseV2":case"Reverse":var l=Object(d.d)("axis",e,t,n),h=Object(d.d)("x",e,t,n);return[Tt.a(h,l)];case"Slice":var f=Object(d.d)("begin",e,t,n),p=Object(d.d)("size",e,t,n);return[Ct.a(Object(d.d)("x",e,t,n),f,p)];case"StridedSlice":var m=Object(d.d)("begin",e,t,n),v=Object(d.d)("end",e,t,n),g=Object(d.d)("strides",e,t,n),b=Object(d.d)("beginMask",e,t,n),y=Object(d.d)("endMask",e,t,n),x=Object(d.d)("ellipsisMask",e,t,n),w=Object(d.d)("newAxisMask",e,t,n),O=Object(d.d)("shrinkAxisMask",e,t,n),k=Object(d.d)("x",e,t,n);return[Mt.a(k,m,v,g,b,y,x,w,O)];case"Pack":return Object(u.tidy)((function(){var r=Object(d.d)("axis",e,t,n),a=Object(d.d)("tensors",e,t,n),i=a[0].shape,o=At.a(a[0]).shape,s=a.map((function(e){var t=u.util.arraysEqual(e.shape,i);if(!t&&!u.util.arraysEqual(At.a(e).shape,o))throw new Error("the input tensors shape does not match");return t?e:Nt.a(e,i)}));return[Rt.a(s,r)]}));case"Unpack":var S=Object(d.d)("axis",e,t,n),_=Object(d.d)("tensor",e,t,n);return It.a(_,S);case"Tile":var j=Object(d.d)("reps",e,t,n);return[Lt.a(Object(d.d)("x",e,t,n),j)];case"Split":case"SplitV":var E=Object(d.d)("axis",e,t,n),T=Object(d.d)("numOrSizeSplits",e,t,n),C=Object(d.d)("x",e,t,n);return Dt.a(C,T,E);case"ScatterNd":var M=Object(d.d)("indices",e,t,n),A=Object(d.d)("values",e,t,n),N=Object(d.d)("shape",e,t,n);return[Pt.a(M,A,N)];case"GatherNd":var R=Object(d.d)("x",e,t,n),I=Object(d.d)("indices",e,t,n);return[zt.a(R,I)];case"SparseToDense":var L=Object(d.d)("sparseIndices",e,t,n),D=Object(d.d)("outputShape",e,t,n),P=Object(d.d)("sparseValues",e,t,n),z=Object(d.d)("defaultValue",e,t,n);return[vt.a(L,P,D,P.dtype===z.dtype?z:qe.a(z,P.dtype))];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}
2(e,t,n)}));case"spectral":return u.tidy((function(){return function(e,t,n){switch(e.op){case"FFT":return[Ft.a(Object(d.d)("x",e,t,n))];case"IFFT":return[Bt.a(Object(d.d)("x",e,t,n))];case"RFFT":return[Ut.a(Object(d.d)("x",e,t,n))];case"IRFFT":return[Wt.a(Object(d.d)("x",e,t,n))];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"transformation":return u.tidy((function(){return function(e,t,n){switch(e.op){case"Cast":return[qe.a(Object(d.d)("x",e,t,n),Object(d.d)("dtype",e,t,n))];case"ExpandDims":var r=Object(d.d)("axis",e,t,n);return[Vt.a(Object(d.d)("x",e,t,n),r)];case"Squeeze":var a=Object(d.d)("axis",e,t,n);return[At.a(Object(d.d)("x",e,t,n),a)];case"Reshape":return[Nt.a(Object(d.d)("x",e,t,n),Object(d.d)("shape",e,t,n))];case"PadV2":case"Pad":return[Gt.a(Object(d.d)("x",e,t,n),Object(d.d)("padding",e,t,n),Object(d.d)("constantValue",e,t,n))];case"SpaceToBatchND":var i=Object(d.d)("blockShape",e,t,n),o=Object(d.d)("paddings",e,t,n);return[Ht.a(Object(d.d)("x",e,t,n),i,o)];case"BatchToSpaceND":var s=Object(d.d)("blockShape",e,t,n),u=Object(d.d)("crops",e,t,n);return[qt.a(Object(d.d)("x",e,t,n),s,u)];case"DepthToSpace":var c=Object(d.d)("blockSize",e,t,n),l=Object(d.d)("dataFormat",e,t,n).toUpperCase();
2return[Xt.a(Object(d.d)("x",e,t,n),c,l)];case"BroadcastTo":return[Yt.a(Object(d.d)("x",e,t,n),Object(d.d)("shape",e,t,n))];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"custom":var r=Object(p.a)(e.op);if(r&&r.customExecutor)return r.customExecutor(new f(e,t,n));throw TypeError("Custom op ".concat(e.op," is not registered."));default:throw TypeError("Unknown op '".concat(e.op,"'. File an issue at ")+"https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()")}}(e,t,n);return r instanceof Promise?r.then((function(e){return[].concat(e)})):[].concat(r)}var Zt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};Object(o.a)(this,e),this.weightMap=t,this.tensorArrayMap=n,this.tensorListMap=r,this.functionMap=a,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}return Object(s.a)(e,[{key:"newFrame",value:function(e,t){return{id:e,frameName:t,iterationId:0}}},{key:"generateCurrentContextIds",value:function(){for(var e=[],t=0;t<this.contexts.length-1;t++){var n=this.contexts.slice(0,this.contexts.length-t);e.push(this.contextIdforContexts(n))}e.push(""),this._currentContextIds=e}},{key:"contextIdforContexts",value:function(e){return e?e.map((function(e){return 0===e.id&&0===e.iterationId?"":"".concat(e.frameName,"-").concat(e.iterationId)})).join("/"):""}},{key:"enterFrame",value:function(e){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,e)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))}},{key:"exitFrame",value:function(){if(!(this.contexts&&this.contexts.length>1))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()}},{key:"nextIteration",value:function(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");this.contexts=this.contexts.slice(),this.lastId++;var e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}},{key:"getWeight",value:function(e){return this.weightMap[e]}},{key:"addTensorArray",value:function(e){this.tensorArrayMap[e.id]=e}},{key:"getTensorArray",value:function(e){return this.tensorArrayMap[e]}},{key:"addTensorList",value:function(e){this.tensorListMap[e.id]=e}},{key:"getTensorList",value:function(e){return this.tensorListMap[e]}},{key:"dispose",value:function(e){for(var t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(var n in this.tensorListMap)this.tensorListMap[n].clearAndClose(e)}},{key:"currentContext",set:function(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())},get:function(){return this.contexts}},{key:"currentContextId",get:function(){return this._currentContextIds[0]}},{key:"currentContextIds",get:function(){return this._currentContextIds}}]),e}();function Jt(e,t,n){for(var r=new Set,a=[],i=null,o=null,s=new Set,u=Object.keys(e).map((function(e){return Object(d.g)(e)[0]})),c=Object(l.a)(t);c.length>0;){var h=c.pop();(en(h)||tn(h))&&null==i&&(o=(i=h).children.map((function(e){return e.name})).filter((function(e){return r.has(e)}))),r.add(h.name),null==n[h.name]&&(-1===u.indexOf(h.name)&&(0!==h.inputs.length?h.inputs.forEach((function(e){s.has(e.name)||(s.add(e.name),c.push(e))})):a.push(h.name)))}return{inputs:e,outputs:t,usedNodes:r,missingInputs:a,dynamicNode:i,syncInputs:o}}var Qt=["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"],$t=["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"];function en(e){return Qt.indexOf(e.op)>=0}function tn(e){return $t.indexOf(e.op)>=0}var nn=function(){function e(t,n){var r=this;Object(o.a)(this,e),this.graph=t,this.parent=n,this.compiledMap=new Map,this._weightMap={},this.SEPERATOR=",",this._functions={},this._functionExecutorMap={},this._outputs=t.outputs,this._inputs=t.inputs,this._signature=t.signature,this._functions=t.functions,null!=t.functions&&Object.keys(t.functions).forEac
2h((function(n){r._functionExecutorMap[n]=new e(t.functions[n],r)}))}return Object(s.a)(e,[{key:"getCompilationKey",value:function(e,t){var n=e.map((function(e){return e.name})).sort(),r=t.map((function(e){return e.name})).sort();return n.join(this.SEPERATOR)+"--"+r.join(this.SEPERATOR)}},{key:"compile",value:function(e,t){var n=Jt(e,t,this.weightMap),r=n.missingInputs,a=n.dynamicNode,i=n.syncInputs;if(null!=a)throw new Error("This execution contains the node '".concat(a.name,"', which has ")+"the dynamic op '".concat(a.op,"'. Please use ")+"model.executeAsync() instead. Alternatively, to avoid the "+"dynamic ops, specify the inputs [".concat(i,"]"));if(r.length>0){var o=t.map((function(e){return e.name})),s=Object.keys(e);throw new Error("Cannot compute the outputs [".concat(o,"] from the provided inputs ")+"[".concat(s,"]. Missing the following inputs: [").concat(r,"]"))}return function(e,t,n){var r=n.usedNodes,a=n.inputs,i=[];Object.keys(a).map((function(e){return Object(d.g)(e)[0]})).map((function(t){return e.nodes[t]})).forEach((function(e){r.has(e.name)&&i.push(e)})),e.weights.forEach((function(e){r.has(e.name)&&i.push(e)}));for(var o=new Set,s=[];i.length>0;){var u=i.pop();o.add(u.name),t[u.name]||s.push(u),u.children.forEach((function(e){!o.has(e.name)&&r.has(e.name)&&e.inputs.every((function(e){return o.has(e.name)}))&&i.push(e)}))}return s}(this.graph,this.weightMap,n)}},{key:"execute",value:function(e,t){var n=this;e=this.mapInputs(e);var r=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);var a=r.map((function(e){return n.graph.nodes[Object(d.g)(e)[0]]})),i=t.map((function(e){return n.graph.nodes[Object(d.g)(e)[0]]})),o=this.getCompilationKey(a,i),s=this.compiledMap.get(o);null==s&&(s=this.compile(e,i),this.compiledMap.set(o,s));var c={},l={};return Object(u.tidy)((function(){var r=new Zt(n.weightMap,c,l,n.functionExecutorMap),a=Object.assign({},n.weightMap);Object.keys(e).forEach((function(t){var n=Object(d.g)(t),r=Object(h.a)(n,2),i=r[0],o=[];o[r[1]]=e[t],a[i]=o}));for(var i=n.getFrozenTensorIds(a),o={},u=0;u<s.length;u++){var f=s[u];if(!a[f.name]){var p=Kt(f,a,r);if(p instanceof Promise)throw new Error("The execution of the op '".concat(f.op,"' returned a promise. ")+"Please use model.executeAsync() instead.");a[f.name]=p,n.checkTensorForDisposal(f.name,f,a,r,i,t,o)}}return null==n.parent&&r.dispose(i),t.map((function(e){return Object(d.e)(e,a,r)}))}))}},{key:"getFrozenTensorIds",value:function(e){var t=[].concat.apply([],Object.keys(e).map((function(t){return e[t]})).map((function(e){return e.map((function(e){return e.id}))})));return new Set(t)}},{key:"checkTensorForDisposal",value:function(e,t,n,r,a,i,o){"control"!==t.category&&-1===i.indexOf(e)&&(n[e].forEach((function(e){null!=e&&(o[e.id]=(o[e.id]||0)+t.children.length)})),t.inputs.forEach((function(e){if("control"!==e.category){var t=Object(d.f)(e.name,n,r);null!=t&&t.forEach((function(e){if(e&&!a.has(e.id)){var t=o[e.id];1===t?(e.dispose(),delete o[e.id]):null!=t&&o[e.id]--}}))}})))}},{key:"executeAsync",value:function(){var e=Object(i.a)(a.a.mark((function e(t,n){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._executeAsync(t,n));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"_executeAsync",value:function(){var e=Object(i.a)(a.a.mark((function e(t,n){var r,i,o,s,u,c,h,f,p,m=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=m.length>2&&void 0!==m[2]&&m[2],i=m.length>3&&void 0!==m[3]?m[3]:{},o=m.length>4&&void 0!==m[4]?m[4]:{},r||(t=this.mapInputs(t),this.checkInputs(t),this.checkInputShapeAndType(t),n=this.mapOutputs(n),this.checkOutputs(n)),s=new Zt(this.weightMap,i,o,this.functionExecutorMap),e.next=7,this.executeWithControlFlow(t,s,n,r);case 7:return u=e.sent,c=n.map((function(e){return Object(d.e)(e,u,s)})),h=c.map((function(e){return e.id})),f=Object.keys(t).map((function(e){return t[e].id})),p=new Set([].concat(Object(l.a)(h),Object(l.a)(f),Object(l.a)(this.weightIds))),Object.keys(u).forEach((function(e){u[e].forEach((function(e){!e||e.isDisposed||p.has(e.id)||e.dispose()}))})),null==this.parent&&s.dispose(p),e.abrupt("return",c);case 15:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"executeFunctionAsync",value:function(){var e=Object(i.a)(a.a.mark((function e(t,n,r){var i,o=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.reduce((function(e,t,n){return e[o.inputs[n].name]=t,e}),{}),e.abrupt("return",this._executeAsync(i,this.outputNodes,!0,n,r));case 2:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"executeWithControlFlow",value:function(){var e=Object(i.a)(a.a.mark((function e(t,n,r,i){var o,s,u,c,f,p,m,v,g,b,y,x,w,O,k,S,_=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=Object.keys(t),s=o.map((function(e){return _.graph.nodes[Object(d.g)(e)[0]]})),u=r.map((function(e){return _.graph.nodes[Object(d.g)(e)[0]]})),c=Jt(t,u,this.weightMap),f=c.usedNodes,p=c.missingInputs,m=c.dynamicNode,v=c.syncInputs,g=[].concat(Object(l.a)(s),Object(l.a)(this.graph.weights)).map((function(e){return{node:e,contexts:n.currentContext}})),b=Object.assign({},this.weightMap),Object.keys(t).forEach((function(e){var n=Object(d.g)(e),r=Object(h.a)(n,2),a=r[0],i=[];i[r[1]]=t[e],b[a]=i})),y={},x=this.getFrozenTensorIds(b),w={};case 10:if(!(g.length>0)){e.next=16;break}return O=this.processStack(s,g,n,b,w,x,r,y,f),e.next=14,Promise.all(O);case 14:e.next=10;break;case 16:if(null!=m||i||console.warn("This model execution did not contain any no
2des with control flow or dynamic output shapes. You can use model.execute() instead."),!((k=u.filter((function(e){return!en(e)&&!Object(d.e)(e.name,b,n)})).map((function(e){return e.name}))).length>0)){e.next=22;break}throw S="",null!=m&&(S="Alternatively, to avoid the dynamic ops, use model.execute() "+"and specify the inputs [".concat(v,"]")),new Error("Cannot compute the outputs [".concat(k,"] from the provided ")+"inputs [".concat(o,"]. Consider providing the following inputs: ")+"[".concat(p,"]. ").concat(S));case 22:return e.abrupt("return",b);case 23:case"end":return e.stop()}}),e,this)})));return function(t,n,r,a){return e.apply(this,arguments)}}()},{key:"processStack",value:function(e,t,n,r,a,i,o,s,u){for(var c=this,l=[],f=function(){var f=t.pop();n.currentContext=f.contexts;var p="";if("Enter"===f.node.op&&Object(d.d)("isConstant",f.node,r,n)){var m=Object(d.b)(f.node.name,n),v=Object(h.a)(m,1);p=v[0]}if(-1===e.indexOf(f.node)){var g=Kt(f.node,r,n);if(!p){var b=Object(d.b)(f.node.name,n),y=Object(h.a)(b,1);p=y[0]}var x=n.currentContext;g instanceof Promise?l.push(g.then((function(e){return r[p]=e,n.currentContext=x,c.checkTensorForDisposal(p,f.node,r,n,i,o,s),c.processChildNodes(f.node,t,n,r,a,u),e}))):(r[p]=g,c.checkTensorForDisposal(p,f.node,r,n,i,o,s),c.processChildNodes(f.node,t,n,r,a,u))}else c.processChildNodes(f.node,t,n,r,a,u)};t.length>0;)f();return l}},{key:"processChildNodes",value:function(e,t,n,r,a,i){e.children.forEach((function(e){var o=Object(d.b)(e.name,n),s=Object(h.a)(o,1)[0];!a[s]&&i.has(e.name)&&("Merge"===e.op?e.inputNames.some((function(e){return!!Object(d.e)(e,r,n)}))&&(a[s]=!0,t.push({contexts:n.currentContext,node:e})):e.inputNames.every((function(e){return!!Object(d.e)(e,r,n)}))&&(a[s]=!0,t.push({contexts:n.currentContext,node:e})))}))}},{key:"dispose",value:function(){var e=this;Object.keys(this.weightMap).forEach((function(t){return e.weightMap[t].forEach((function(e){return e.dispose()}))}))}},{key:"checkInputShapeAndType",value:function(e){var t=this;Object.keys(e).forEach((function(n){var r=e[n],a=Object(d.g)(n),i=Object(h.a)(a,1)[0],o=t.graph.nodes[i];if(o.attrParams.shape&&o.attrParams.shape.value){var s=o.attrParams.shape.value,c=s.length===r.shape.length&&r.shape.every((function(e,t){return-1===s[t]||s[t]===e}));u.util.assert(c,(function(){return"The shape of dict['".concat(o.name,"'] provided in ")+"model.execute(dict) must be [".concat(s,"], but was ")+"[".concat(r.shape,"]")}))}o.attrParams.dtype&&o.attrParams.dtype.value&&u.util.assert(r.dtype===o.attrParams.dtype.value,(function(){return"The dtype of dict['".concat(o.name,"'] provided in ")+"model.execute(dict) must be "+"".concat(o.attrParams.dtype.value,", but was ").concat(r.dtype)}))}))}},{key:"mapInputs",value:function(e){var t={};for(var n in e){if(null!=this._signature&&null!=this._signature.inputs&&null!=this._signature.inputs[n])t[this._signature.inputs[n].name]=e[n];else t[n]=e[n]}return t}},{key:"checkInputs",value:function(e){var t=this,n=Object.keys(e).filter((function(e){var n=Object(d.g)(e),r=Object(h.a)(n,1)[0];return null==t.graph.nodes[r]}));if(n.length>0)throw new Error("The dict provided in model.execute(dict) has "+"keys: [".concat(n,"] that are not part of graph"))}},{key:"mapOutputs",value:function(e){var t=this;return e.map((function(e){return null!=t._signature&&null!=t._signature.outputs&&null!=t._signature.outputs[e]?t._signature.outputs[e].name:e}),{})}},{key:"checkOutputs",value:function(e){var t=this;e.forEach((function(e){var n=Object(d.g)(e),r=Object(h.a)(n,1)[0];if(!t.graph.nodes[r])throw new Error("The output '".concat(e,"' is not found in the graph"))}))}},{key:"weightIds",get:function(){return this.parent?this.parent.weightIds:this._weightIds}},{key:"functionExecutorMap",get:function(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}},{key:"weightMap",get:function(){return this.parent?this.parent.weightMap:this._weightMap},set:function(e){var t,n=Object.keys(e).map((function(t){return e[t].map((function(e){return e.id}))}));this._weightIds=(t=[]).concat.apply(t,Object(l.a)(n)),this._weightMap=e}},{key:"inputs",get:function(){return this._inputs.map((function(e){return{name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}}))}},{key:"outputs",get:function(){return this._outputs.map((function(e){return{name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}}))}},{key:"inputNodes",get:function(){return this._inputs.map((function(e){return e.signatureKey||e.name}))}},{key:"outputNodes",get:function(){return this._outputs.map((function(e){var t=e.signatureKey||e.name;return e.defaultOutput?"".concat(t,":").concat(e.defaultOutput):t}))}},{key:"functions",get:function(){var e=this;return Object.keys(this._functions).reduce((function(t,n){return t[n]=e._functions[n].signature,t}),{})}}]),e}(),rn=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(o.a)(this,e),this.modelUrl=t,this.loadOptions=n,this.version="n/a",null==n&&(this.loadOptions={})}return Object(s.a)(e,[{key:"findIOHandler",value:function(){var e=this.modelUrl;if(null!=e.load)this.handler=e;else if(null!=this.loadOptions.requestInit)this.handler=u.io.browserHTTPRequest
2(e,this.loadOptions);else{var t=u.io.getLoadHandlers(e,this.loadOptions);if(0===t.length)t.push(u.io.browserHTTPRequest(e,this.loadOptions));else if(t.length>1)throw new Error("Found more than one (".concat(t.length,") load handlers for ")+"URL '".concat([e],"'"));this.handler=t[0]}}},{key:"load",value:function(){var e=Object(i.a)(a.a.mark((function e(){var t;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.findIOHandler(),null!=this.handler.load){e.next=3;break}throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");case 3:return e.next=5,this.handler.load();case 5:return t=e.sent,e.abrupt("return",this.loadSync(t));case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"loadSync",value:function(e){this.artifacts=e;var t=this.artifacts.modelTopology,n={};null!=this.artifacts.userDefinedMetadata&&(n=this.artifacts.userDefinedMetadata.signature),this.version="".concat(t.versions.producer,".").concat(t.versions.minConsumer);var r=u.io.decodeWeights(this.artifacts.weightData,this.artifacts.weightSpecs);return this.executor=new nn(c.a.Instance.transformGraph(t,n)),this.executor.weightMap=this.convertTensorMapToTensorsMap(r),!0}},{key:"save",value:function(){var e=Object(i.a)(a.a.mark((function e(t,n){var r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!==typeof t){e.next=9;break}if(0!==(r=u.io.getSaveHandlers(t)).length){e.next=6;break}throw new Error("Cannot find any save handlers for URL '".concat(t,"'"));case 6:if(!(r.length>1)){e.next=8;break}throw new Error("Found more than one (".concat(r.length,") save handlers for ")+"URL '".concat(t,"'"));case 8:t=r[0];case 9:if(null!=t.save){e.next=11;break}throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");case 11:return e.abrupt("return",t.save(this.artifacts));case 12:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"predict",value:function(e,t){return this.execute(e,this.outputNodes)}},{key:"normalizeInputs",value:function(e){if(!(e instanceof u.Tensor)&&!Array.isArray(e))return e;if((e=Array.isArray(e)?e:[e]).length!==this.inputNodes.length)throw new Error("Input tensor count mismatch,"+"the graph model has ".concat(this.inputNodes.length," placeholders, ")+"while there are ".concat(e.length," input tensors."));return this.inputNodes.reduce((function(t,n,r){return t[n]=e[r],t}),{})}},{key:"normalizeOutputs",value:function(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}},{key:"execute",value:function(e,t){e=this.normalizeInputs(e),t=this.normalizeOutputs(t);var n=this.executor.execute(e,t);return n.length>1?n:n[0]}},{key:"executeAsync",value:function(){var e=Object(i.a)(a.a.mark((function e(t,n){var r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.normalizeInputs(t),n=this.normalizeOutputs(n),e.next=4,this.executor.executeAsync(t,n);case 4:return r=e.sent,e.abrupt("return",r.length>1?r:r[0]);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"convertTensorMapToTensorsMap",value:function(e){return Object.keys(e).reduce((function(t,n){return t[n]=[e[n]],t}),{})}},{key:"dispose",value:function(){this.executor.dispose()}},{key:"modelVersion",get:function(){return this.version}},{key:"inputNodes",get:function(){return this.executor.inputNodes}},{key:"outputNodes",get:function(){return this.executor.outputNodes}},{key:"inputs",get:function(){return this.executor.inputs}},{key:"outputs",get:function(){return this.executor.outputs}},{key:"weights",get:function(){return this.executor.weightMap}}]),e}();function an(e){return on.apply(this,arguments)}function on(){return(on=Object(i.a)(a.a.mark((function e(t){var n,r,i=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=i.length>1&&void 0!==i[1]?i[1]:{},null!=t){e.next=3;break}throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");case 3:return null==n&&(n={}),n.fromTFHub&&null==t.load&&(t.endsWith("/")||(t+="/"),t="".concat(t).concat("model.json").concat("?tfjs-format=file")),r=new rn(t,n),e.next=8,r.load();case 8:return e.abrupt("return",r);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var sn="2.4.0"},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(179);var a=n(227);function i(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Object(a.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){var r=n(352),a=n(353),i=n(354),o=n(355),s=n(356),u=n(357),c=n(358);c.alea=r,c.xor128=a,c.xorwow=i,c.xorshift7=o,c.xor4096=s,c.tychei=u,e.exports=c},function(e,t,n){"use strict";var r={};n.r(r),n.d(r,"addTrackers",(function(){return H})),n.d(r,"initialize",(function(){return q})),n.d(r,"ga",(function(){return X})),n.d(r,"set",(function(){return Y})),n.d(r,"send",(function(){return K})),n.d(r,"pageview",(function(){return Z})),n.d(r,"modalview",(function(){return J})),n.d(r,"timing",(function(){return Q})),n.d(r,"event",(function(){return $})),n.d(r,"exception",(function(){return ee})),n.d(r,"plugin",(function(){return te})),n.d(r,"outboundLink",(function(){return ne})),n.d(r,"testModeAPI",(function(){return re})),n.d(r,"default",(function(){return ae}));var a=n(1),i=n.n(a),o=n(54),s=n.n(o);function u(e){console.warn("[react-ga]",e)}function c(e){return(c="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
2t%2?l(Object(n),!0).forEach((function(t){x(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y(e);if(t){var a=y(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return g(this,n)}}function g(e,t){return!t||"object"!==c(t)&&"function"!==typeof t?b(e):t}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(o,e);var t,n,r,a=v(o);function o(){var e;f(this,o);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return x(b(e=a.call.apply(a,[this].concat(n))),"handleClick",(function(t){var n=e.props,r=n.target,a=n.eventLabel,i=n.to,s=n.onClick,u=n.trackerNames,c={label:a},l="_blank"!==r,h=!(t.ctrlKey||t.shiftKey||t.metaKey||1===t.button);l&&h?(t.preventDefault(),o.trackLink(c,(function(){window.location.href=i}),u)):o.trackLink(c,(function(){}),u),s&&s(t)})),e}return t=o,(n=[{key:"render",value:function(){var e=this.props,t=e.to,n=e.target,r=h(h({},d(e,["to","target"])),{},{target:n,href:t,onClick:this.handleClick});return"_blank"===n&&(r.rel="noopener noreferrer"),delete r.eventLabel,delete r.trackerNames,i.a.createElement("a",r)}}])&&p(t.prototype,n),r&&p(t,r),o}(a.Component);x(w,"trackLink",(function(){u("ga tracking not enabled")})),w.propTypes={eventLabel:s.a.string.isRequired,target:s.a.string,to:s.a.string,onClick:s.a.func,trackerNames:s.a.arrayOf(s.a.string)},w.defaultProps={target:null,to:null,onClick:null,trackerNames:null};function O(e){return"string"===typeof(t=e)&&-1!==t.indexOf("@")?(u("This arg looks like an email address, redacting."),"REDACTED (Potential Email Address)"):e;var t}function k(e){return e&&e.toString().replace(/^\s+|\s+$/g,"")}var S=/^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;function _(e){return k(e).replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g,(function(e,t,n){return t>0&&t+e.length!==n.length&&e.search(S)>-1&&":"!==n.charAt(t-2)&&("-"!==n.charAt(t+e.length)||"-"===n.charAt(t-1))&&n.charAt(t-1).search(/[^\s-]/)<0?e.toLowerCase():e.substr(1).search(/[A-Z]|\../)>-1?e:e.charAt(0).toUpperCase()+e.substr(1)}))}function j(e){console.info("[react-ga]",e)}var E=[],T={calls:E,ga:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];E.push([].concat(t))},resetCalls:function(){E.length=0}};function C(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e){return(N="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function R(e){return function(e){if(Array.isArray(e))return I(e)}(e)||function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return I(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return I(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var L="undefined"===typeof window||"undefined"===typeof document,D=!1,P=!0,z=!1,F=!0,B=!0,U=function(){var e;return z?T.ga.apply(T,arguments):!L&&(window.ga?(e=window).ga.apply(e,arguments):u("ReactGA.initialize must be called first or GoogleAnalytics should be loaded manually"))};function W(e){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=e||"";return t&&(r=_(e)),n&&(r=O(r)),r}(e,P,B)}function V(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var a=n[0];"string"===typeof a?(!F&&Array.isArray(e)||U.apply(void 0,n),Array.isArray(e)&&e.forEach((function(e){U.apply(void 0,R(["".concat(e,".").concat(a)].concat(n.slice(1))))}))):u("ga command must be a string")}function G(e,t){e?t&&(t.debug&&!0===t.debug&&(D=!0),!1===t.titleCase&&(P=!1),!1===t.redactEmail&&(B=!1),t.useExistingGa)||(t&&t.gaOptions?U("create",e,t.gaOptions):U("create",e,"auto")):u("gaTrackingID is required in initialize()")}function H(e,t){return Array.isArray(e)?e.forEach((function(e){"object"===N(e)?G(e.trackingId,e):u("All configs must be an object")})):G(e,t),!0}function q(e,t){if(t&&!0===t.testMode)z=!0;else{if(L)return;t&&!0===t.standardImplementation||function(e){var t="https://www.google-analytics.com/analytics.js";e&&e.gaAddress?t=e.gaAddress:e&&e.debug&&(t="https://www.google-analytics.com/analytics_debug.js");var n,r,a,i,o,s,u,c=e&&e.onerror;n=window,r=document,a="script",i=t,o="ga",n.GoogleAnalyticsObject=o,n.ga=n.ga||function(){(n.ga.q=n.ga.q||[]).push(arguments)},n.ga.l=1*new Date,s=r.createElement(a),u=r.getElementsByTagName(a)[0],s.async=1,s.src=i,s.onerror=c,u.parentNode.insertBefore(s,u)}(t)}F=!t||"boolean"!==typeof t.alwaysSendToDefaultTracker||t.alwaysSendToDefaultTracker,H(e,t)}function X(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length>0&&(U.apply(void 0,t),D&&(j("called ga('arguments');"),j("with arguments: ".concat(JSON.stringify(t))))),window.ga}function Y(e,t){e?"object"===N(e)?(0===Object.keys(e).length&&u("empty `fieldsObject` given to .set()"),V(t,"
2set",e),D&&(j("called ga('set', fieldsObject);"),j("with fieldsObject: ".concat(JSON.stringify(e))))):u("Expected `fieldsObject` arg to be an Object"):u("`fieldsObject` is required in .set()")}function K(e,t){V(t,"send",e),D&&(j("called ga('send', fieldObject);"),j("with fieldObject: ".concat(JSON.stringify(e))),j("with trackers: ".concat(JSON.stringify(t))))}function Z(e,t,n){if(e){var r=k(e);if(""!==r){var a={};if(n&&(a.title=n),V(t,"send",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){A(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({hitType:"pageview",page:r},a)),D){j("called ga('send', 'pageview', path);");var i="";n&&(i=" and title: ".concat(n)),j("with path: ".concat(r).concat(i))}}else u("path cannot be an empty string in .pageview()")}else u("path is required in .pageview()")}function J(e,t){if(e){var n,r="/"===(n=k(e)).substring(0,1)?n.substring(1):n;if(""!==r){var a="/modal/".concat(r);V(t,"send","pageview",a),D&&(j("called ga('send', 'pageview', path);"),j("with path: ".concat(a)))}else u("modalName cannot be an empty string or a single / in .modalview()")}else u("modalName is required in .modalview(modalName)")}function Q(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.category,n=e.variable,r=e.value,a=e.label,i=arguments.length>1?arguments[1]:void 0;if(t&&n&&"number"===typeof r){var o={hitType:"timing",timingCategory:W(t),timingVar:W(n),timingValue:r};a&&(o.timingLabel=W(a)),K(o,i)}else u("args.category, args.variable AND args.value are required in timing() AND args.value has to be a number")}function $(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.category,n=e.action,r=e.label,a=e.value,i=e.nonInteraction,o=e.transport,s=C(e,["category","action","label","value","nonInteraction","transport"]),c=arguments.length>1?arguments[1]:void 0;if(t&&n){var l={hitType:"event",eventCategory:W(t),eventAction:W(n)};r&&(l.eventLabel=W(r)),"undefined"!==typeof a&&("number"!==typeof a?u("Expected `args.value` arg to be a Number."):l.eventValue=a),"undefined"!==typeof i&&("boolean"!==typeof i?u("`args.nonInteraction` must be a boolean."):l.nonInteraction=i),"undefined"!==typeof o&&("string"!==typeof o?u("`args.transport` must be a string."):(-1===["beacon","xhr","image"].indexOf(o)&&u("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`"),l.transport=o)),Object.keys(s).filter((function(e){return"dimension"===e.substr(0,"dimension".length)})).forEach((function(e){l[e]=s[e]})),Object.keys(s).filter((function(e){return"metric"===e.substr(0,"metric".length)})).forEach((function(e){l[e]=s[e]})),K(l,c)}else u("args.category AND args.action are required in event()")}function ee(e,t){var n=e.description,r=e.fatal,a={hitType:"exception"};n&&(a.exDescription=W(n)),"undefined"!==typeof r&&("boolean"!==typeof r?u("`args.fatal` must be a boolean."):a.exFatal=r),K(a,t)}var te={require:function(e,t,n){if(e){var r=k(e);if(""!==r){var a=n?"".concat(n,".require"):"require";if(t){if("object"!==N(t))return void u("Expected `options` arg to be an Object");0===Object.keys(t).length&&u("Empty `options` given to .require()"),X(a,r,t),D&&j("called ga('require', '".concat(r,"', ").concat(JSON.stringify(t)))}else X(a,r),D&&j("called ga('require', '".concat(r,"');"))}else u("`name` cannot be an empty string in .require()")}else u("`name` is required in .require()")},execute:function(e,t){for(var n,r,a=arguments.length,i=new Array(a>2?a-2:0),o=2;o<a;o++)i[o-2]=arguments[o];if(1===i.length?n=i[0]:(r=i[0],n=i[1]),"string"!==typeof e)u("Expected `pluginName` arg to be a String.");else if("string"!==typeof t)u("Expected `action` arg to be a String.");else{var s="".concat(e,":").concat(t);n=n||null,r&&n?(X(s,r,n),D&&(j("called ga('".concat(s,"');")),j('actionType: "'.concat(r,'" with payload: ').concat(JSON.stringify(n))))):n?(X(s,n),D&&(j("called ga('".concat(s,"');")),j("with payload: ".concat(JSON.stringify(n))))):(X(s),D&&j("called ga('".concat(s,"');")))}}};function ne(e,t,n){if("function"===typeof t)if(e&&e.label){var r={hitType:"event",eventCategory:"Outbound",eventAction:"Click",eventLabel:W(e.label)},a=!1,i=setTimeout((function(){a=!0,t()}),250);r.hitCallback=function(){clearTimeout(i),a||t()},K(r,n)}else u("args.label is required in outboundLink()");else u("hitCallback function is required")}var re=T,ae={initialize:q,ga:X,set:Y,send:K,pageview:Z,modalview:J,timing:Q,event:$,exception:ee,plugin:te,outboundLink:ne,testModeAPI:T};function ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
2t%2?ie(Object(n),!0).forEach((function(t){se(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}w.origTrackLink=w.trackLink,w.trackLink=ne;var ue=w;t.a=oe(oe({},r),{},{OutboundLink:ue})},function(e,t,n){"use strict";var r,a;n.d(t,"a",(function(){return r})),function(e){e[e.DT_INVALID=0]="DT_INVALID",e[e.DT_FLOAT=1]="DT_FLOAT",e[e.DT_DOUBLE=2]="DT_DOUBLE",e[e.DT_INT32=3]="DT_INT32",e[e.DT_UINT8=4]="DT_UINT8",e[e.DT_INT16=5]="DT_INT16",e[e.DT_INT8=6]="DT_INT8",e[e.DT_STRING=7]="DT_STRING",e[e.DT_COMPLEX64=8]="DT_COMPLEX64",e[e.DT_INT64=9]="DT_INT64",e[e.DT_BOOL=10]="DT_BOOL",e[e.DT_QINT8=11]="DT_QINT8",e[e.DT_QUINT8=12]="DT_QUINT8",e[e.DT_QINT32=13]="DT_QINT32",e[e.DT_BFLOAT16=14]="DT_BFLOAT16",e[e.DT_FLOAT_REF=101]="DT_FLOAT_REF",e[e.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",e[e.DT_INT32_REF=103]="DT_INT32_REF",e[e.DT_UINT8_REF=104]="DT_UINT8_REF",e[e.DT_INT16_REF=105]="DT_INT16_REF",e[e.DT_INT8_REF=106]="DT_INT8_REF",e[e.DT_STRING_REF=107]="DT_STRING_REF",e[e.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",e[e.DT_INT64_REF=109]="DT_INT64_REF",e[e.DT_BOOL_REF=110]="DT_BOOL_REF",e[e.DT_QINT8_REF=111]="DT_QINT8_REF",e[e.DT_QUINT8_REF=112]="DT_QUINT8_REF",e[e.DT_QINT32_REF=113]="DT_QINT32_REF",e[e.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF"}(r||(r={})),function(e){!function(e){e[e.LEGACY=0]="LEGACY",e[e.V1=1]="V1",e[e.V2=2]="V2"}(e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))}(a||(a={}))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var r=n(55),a=n(4),i=n(2),o=n(35),s=n(20),u=n(28),c=n(17),l=n(101),h=n(9),d=n(14),f=n(27),p=n(31);var m=Object(h.b)({mean_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],h=Object(a.a)(e,"x","mean"),m=Object(i.parseAxisParam)(t,h.shape),v=Object(o.d)(h.shape,m),g=v[1],b=Object(i.sizeFromShape)(g),y=Object(r.a)((function(e){var r=Object(f.a)(b),a=r.dtype===e.dtype?e:Object(s.a)(e,r.dtype),i=Object(u.a)(a,r);return{value:Object(p.a)(i,t,n),gradFunc:function(t){var n=e.shape.slice();m.forEach((function(e){n[e]=1}));var r=Object(d.a)(t,n);return Object(u.a)(Object(c.a)(r,Object(l.a)(e.shape,"float32")),b)}}}));return y(h)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({real_:function(e){var t=Object(i.a)(e,"input","real"),n={input:t};return r.a.runKernelFunc((function(e){return e.real(t)}),n,null,a.cc)}})},function(e,t){var n,r,a=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"===typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"===typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var u,c=[],l=!1,h=-1;function d(){l&&u&&(l=!1,u.length?c=u.concat(c):h=-1,c.length&&f())}function f(){if(!l){var e=s(d);l=!0;for(var t=c.length;t;){for(u=c,c=[];++h<t;)u&&u[h].run();h=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||l||s(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=m,a.addListener=m,a.once=m,a.off=m,a.removeListener=m,a.removeAllListeners=m,a.emit=m,a.prependListener=m,a.prependOnceListener=m,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(e,t,n){"use strict";(function(e){var r=n(347),a=n(348),i=n(249);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(e,t,n);if("number"===typeof e){if("string"===typeof t)throw new Error("If encoding is specified then the first argument must be a string");return h(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"===typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!==typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=d(e,t);return e}(e,t,n,r):"string"===typeof t?function(e,t,n){"string"===typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|p(t,n),a=(e=s(e,r)).write(t,n);a!==r&&(e=e.slice(0,a));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|f(t.length);return 0===(e=s(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!==typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!==typeof t.length||(r=t.length)!==r?s(e,0):d(e,t);if("Buffer"===t.type&&i(t.data))return d(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!==typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function h(e,t){if(l(t),e=s(e,t<0?0:0|f(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function d(e,t){var n=t.length<0?0:0|f(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function f(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&
vendor: 8,569 bytes, line 2
2(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!==typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(r)return B(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,n);case"utf8":case"utf-8":return j(this,t,n);case"ascii":return E(this,t,n);case"latin1":case"binary":return T(this,t,n);case"base64":return _(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,a){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"===typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,a);if("number"===typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,a);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,a){var i,o=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(a){var l=-1;for(i=n;i<s;i++)if(c(e,i)===c(t,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*o}else-1!==l&&(i-=i-l),l=-1}else for(n+u>s&&(n=s-u),i=n;i>=0;i--){for(var h=!0,d=0;d<u;d++)if(c(e,i+d)!==c(t,d)){h=!1;break}if(h)return i}return-1}function y(e,t,n,r){n=Number(n)||0;var a=e.length-n;r?(r=Number(r))>a&&(r=a):r=a;var i=t.length;if(i%2!==0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[n+o]=s}return o}function x(e,t,n,r){return W(B(t,e.length-n),e,n,r)}function w(e,t,n,r){return W(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function O(e,t,n,r){return w(e,t,n,r)}function k(e,t,n,r){return W(U(t),e,n,r)}function S(e,t,n,r){return W(function(e,t){for(var n,r,a,i=[],o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,a=n%256,i.push(a),i.push(r);return i}(t,e.length-n),e,n,r)}function _(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function j(e,t,n){n=Math.min(e.length,n);for(var r=[],a=t;a<n;){var i,o,s,u,c=e[a],l=null,h=c>239?4:c>223?3:c>191?2:1;if(a+h<=n)switch(h){case 1:c<128&&(l=c);break;case 2:128===(192&(i=e[a+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=e[a+1],o=e[a+2],128===(192&i)&&128===(192&o)&&(u=(15&c)<<12|(63&i)<<6|63&o)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=e[a+1],o=e[a+2],s=e[a+3],128===(192&i)&&128===(192&o)&&128===(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),a+=h}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"===typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}(),t.kMaxLength=o(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return c(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return l(t),t<=0?s(e,t):void 0!==n?"string"===typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return h(null,e)},u.allocUnsafeSlow=function(e){return h(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,a=0,i=Math.min(n,r);a<i;++a)if(e[a]!==t[a]){n=e[a],r=t[a];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),a=0;for(n=0;n<e.length;++n){var o=e[n];if(!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,a),a+=o.length}return r},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?j(this,0,e):m.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,a){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),t<0||n>e.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&t>=n)return 0;if(r>=a)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(a>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),s=Math.min(i,o),c=this.slice(r,a),l=e.slice(t,n),h=0;h<s;++h)if(c[h]!==l[h]){i=c[h],o=l[h];break}return i<o?-1:o<i?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return g(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"===typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var a=this.length-t;if((void 0===n||n>a)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return O(this,e,t,n);case"base64":return k(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function E(e,t,n){var r="";n=Math.min(e.length,n);for(var a=t;a<n;++a)r+=String.fromCharCode(127&e[a]);return r}function T(e,t,n){var r="";n=Math.min(e.length,n);for(var a=t;a<n;++a)r+=String.fromCharCode(e[a]);return r}
vendor: 7,921 bytes, line 2
2function C(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var a="",i=t;i<n;++i)a+=F(e[i]);return a}function M(e,t,n){for(var r=e.slice(t,n),a="",i=0;i<r.length;i+=2)a+=String.fromCharCode(r[i]+256*r[i+1]);return a}function A(e,t,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,a,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function R(e,t,n,r){t<0&&(t=65535+t+1);for(var a=0,i=Math.min(e.length-n,2);a<i;++a)e[n+a]=(t&255<<8*(r?a:1-a))>>>8*(r?a:1-a)}function I(e,t,n,r){t<0&&(t=4294967295+t+1);for(var a=0,i=Math.min(e.length-n,4);a<i;++a)e[n+a]=t>>>8*(r?a:3-a)&255}function L(e,t,n,r,a,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,r,i){return i||L(e,0,n,4),a.write(e,t,n,r,23,4),n+4}function P(e,t,n,r,i){return i||L(e,0,n,8),a.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var a=t-e;n=new u(a,void 0);for(var i=0;i<a;++i)n[i]=this[i+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||A(e,t,this.length);for(var r=this[e],a=1,i=0;++i<t&&(a*=256);)r+=this[e+i]*a;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||A(e,t,this.length);for(var r=this[e+--t],a=1;t>0&&(a*=256);)r+=this[e+--t]*a;return r},u.prototype.readUInt8=function(e,t){return t||A(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||A(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||A(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||A(e,t,this.length);for(var r=this[e],a=1,i=0;++i<t&&(a*=256);)r+=this[e+i]*a;return r>=(a*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||A(e,t,this.length);for(var r=t,a=1,i=this[e+--r];r>0&&(a*=256);)i+=this[e+--r]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||A(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||A(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||A(e,4,this.length),a.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||A(e,4,this.length),a.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||A(e,8,this.length),a.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||A(e,8,this.length),a.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||N(this,e,t,n,Math.pow(2,8*n)-1,0);var a=1,i=0;for(this[t]=255&e;++i<n&&(a*=256);)this[t+i]=e/a&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||N(this,e,t,n,Math.pow(2,8*n)-1,0);var a=n-1,i=1;for(this[t+a]=255&e;--a>=0&&(i*=256);)this[t+a]=e/i&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):I(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var a=Math.pow(2,8*n-1);N(this,e,t,n,a-1,-a)}var i=0,o=1,s=0;for(this[t]=255&e;++i<n&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var a=Math.pow(2,8*n-1);N(this,e,t,n,a-1,-a)}var i=n-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):I(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return P(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return P(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var a,i=r-n;if(this===e&&n<t&&t<r)for(a=i-1;a>=0;--a)e[a+t]=this[a+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)e[a+t]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},u.prototype.fill=function(e,t,n,r){if("string"===typeof e){if("string"===typeof t?(r=t,t=0,n=this.length):"string"===typeof n&&(r=n,n=this.length),1===e.length){var a=e.charCodeAt(0);a<256&&(e=a)}if(void 0!==r&&"string"!==typeof r)throw new TypeError("encoding must be a string");if("string"===typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"===typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(i=t;i<n;++i)this[i]=e;else{var o=u.isBuffer(e)?e:B(new u(e,r).toString()),s=o.length;for(i=0;i<n-t;++i)this[i+t]=o[i%s]}return this};var z=/[^+\/0-9A-Za-z-_]/g;function F(e){return e<16?"0"+e.toString(16):e.toString(16)}function B(e,t){var n;t=t||1/0;for(var r=e.length,a=null,i=[],o=0;o<r;++o){if((n=e.charCodeAt(o))>55295&&n<57344){if(!a){if(n>56319){(t-=3)>
2-1&&i.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&i.push(239,191,189);continue}a=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(t-=3)>-1&&i.push(239,191,189);if(a=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function U(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(z,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function W(e,t,n,r){for(var a=0;a<r&&!(a+n>=t.length||a>=e.length);++a)t[a+n]=e[a];return a}}).call(this,n(112))},function(e,t,n){"use strict";var r,a,i,o,s;n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return l})),function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"}(r||(r={})),function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"}(a||(a={})),function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"}(i||(i={})),function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"}(o||(o={})),function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"}(s||(s={}));var u={float32:o,int32:a,bool:i,complex64:s};function c(e,t){if("string"===e||"string"===t){if("string"===e&&"string"===t)return"string";throw new Error("Can not upcast ".concat(e," with ").concat(t))}return u[e][t]}function l(e){return c(e,"int32")}},function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}}(),e.exports=n(338)},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(9);var u=Object(s.b)({batchToSpaceND_:function(e,t,n){var s=Object(i.a)(e,"x","batchToSpaceND"),u=t.reduce((function(e,t){return e*t}));o.assert(s.rank>=1+t.length,(function(){return"input rank is ".concat(s.rank," but should be > than blockShape.length ").concat(t.length)})),o.assert(n.length===t.length,(function(){return"crops.length is ".concat(n.length," but should be equal to blockShape.length ").concat(t.length)})),o.assert(s.shape[0]%u===0,(function(){return"input tensor batch is ".concat(s.shape[0]," but is not divisible by the product of ")+"the elements of blockShape ".concat(t.join(" * ")," === ").concat(u)}));var c={x:s},l={blockShape:t,crops:n};return r.a.runKernelFunc((function(e){return e.batchToSpaceND(s,t,n)}),c,null,a.t,l)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(9),u=n(14),c=n(198);var l=Object(s.b)({gather_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=Object(i.a)(e,"x","gather"),l=Object(i.a)(t,"indices","gather","int32"),h={x:s,indices:l},d={axis:n},f=function(e,t){var r=Object(o.parseAxisParam)(n,s.shape)[0],a=Object(c.collectGatherOpShapeInfo)(s,l,r),i=e.gather(s,Object(u.a)(l,[l.size]),r);return t([s,l]),Object(u.a)(i,a.outputShape)};return r.a.runKernelFunc(f,h,null,a.jb,d)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({imag_:function(e){var t=Object(i.a)(e,"input","imag"),n={input:t};return r.a.runKernelFunc((function(e){return e.imag(t)}),n,null,a.ob)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(8),a=n(10),i=n(7),o=n(36),s=n(4),u=n(29),c=n(9);var l=Object(c.b)({less_:function(e,t){var n=Object(s.a)(e,"a","less"),c=Object(s.a)(t,"b","less"),l=Object(o.makeTypesMatch)(n,c),h=Object(r.a)(l,2);n=h[0],c=h[1],Object(u.a)(n.shape,c.shape);var d={a:n,b:c};return a.a.runKernelFunc((function(e){return e.less(n,c)}),d,null,i.ub)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({logicalNot_:function(e){var t=Object(i.a)(e,"x","logicalNot","bool"),n={x:t};return r.a.runKernelFunc((function(e){return e.logicalNot(t)}),n,null,a.Bb)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(8),a=n(10),i=n(7),o=n(36),s=n(4),u=n(29),c=n(20),l=n(9);var h=Object(l.b)({minimum_:function(e,t){var n=Object(s.a)(e,"a","minimum"),l=Object(s.a)(t,"b","minimum"),h=Object(o.makeTypesMatch)(n,l),d=Object(r.a)(h,2);n=d[0],l=d[1],"bool"===n.dtype&&(n=Object(c.a)(n,"int32"),l=Object(c.a)(l,"int32")),Ob
2ject(u.a)(n.shape,l.shape);var f={a:n,b:l};return a.a.runKernelFunc((function(e,t){var r=e.minimum(n,l);return t([n,l]),r}),f,null,i.Mb)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(8),a=n(10),i=n(7),o=n(36),s=n(4),u=n(29),c=n(9);var l=Object(c.b)({notEqual_:function(e,t){var n=Object(s.a)(e,"a","notEqual"),c=Object(s.a)(t,"b","notEqual"),l=Object(o.makeTypesMatch)(n,c),h=Object(r.a)(l,2);n=h[0],c=h[1],Object(u.a)(n.shape,c.shape);var d={a:n,b:c};return a.a.runKernelFunc((function(e){return e.notEqual(n,c)}),d,null,i.Tb)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(9);var u=Object(s.b)({spaceToBatchND_:function(e,t,n){var s=Object(i.a)(e,"x","spaceToBatchND");o.assert(s.rank>=1+t.length,(function(){return"input rank ".concat(s.rank," should be > than [blockShape] ").concat(t.length)})),o.assert(n.length===t.length,(function(){return"paddings.shape[0] ".concat(n.length," must be equal to [blockShape] ").concat(t.length)})),o.assert(s.shape.reduce((function(e,r,a){return a>0&&a<=t.length?e&&(r+n[a-1][0]+n[a-1][1])%t[a-1]===0:e}),!0),(function(){return"input spatial dimensions ".concat(s.shape.slice(1)," with paddings ").concat(n.toString()," must be divisible by blockShapes ").concat(t.toString())}));var u={x:s},c={blockShape:t,paddings:n};return r.a.runKernelFunc((function(e){return e.spaceToBatchND(s,t,n)}),u,null,a.zc,c)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(8),a=n(10),i=n(7),o=n(36),s=n(4),u=n(29),c=n(9);var l=Object(c.b)({squaredDifference_:function(e,t){var n=Object(s.a)(e,"a","squaredDifference"),c=Object(s.a)(t,"b","squaredDifference"),l=Object(o.makeTypesMatch)(n,c),h=Object(r.a)(l,2);n=h[0],c=h[1],Object(u.a)(n.shape,c.shape);var d={a:n,b:c};return a.a.runKernelFunc((function(e,t){var r=e.squaredDifference(n,c);return t([n,c]),r}),d,null,i.Ec,{})}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(4),a=n(2),i=n(9),o=n(14);var s=Object(i.b)({squeeze_:function(e,t){var n=Object(r.a)(e,"x","squeeze");return Object(o.a)(n,Object(a.squeezeShape)(n.shape,t).newShape)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(9);var u=Object(s.b)({unstack_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Object(i.a)(e,"x","unstack");o.assert(t>=-n.shape.length&&t<n.shape.length,(function(){return"Axis = ".concat(t," is not in [-").concat(n.shape.length,", ").concat(n.shape.length,")")})),t<0&&(t+=n.shape.length);var s={value:n},u={axis:t},c=function(e){return e.unstack(n,t)};return r.a.runKernelFunc(c,s,null,a.Oc,u)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return u}));var r=n(5),a=n(11),i=n(109),o=(n(164),function(){function e(t,n,a,o,s){Object(r.a)(this,e),this.mean=t,this.stdDev=n,this.dtype=a,this.nextVal=NaN,this.truncated=o,this.truncated&&(this.upper=this.mean+2*this.stdDev,this.lower=this.mean-2*this.stdDev);var u=s||Math.random();this.random=i.alea(u.toString())}return Object(a.a)(e,[{key:"nextValue",value:function(){if(!isNaN(this.nextVal)){var e=this.nextVal;return this.nextVal=NaN,e}for(var t,n,r=!1;!r;){var a=void 0,i=void 0,o=void 0;do{o=(a=2*this.random()-1)*a+(i=2*this.random()-1)*i}while(o>=1||0===o);var s=Math.sqrt(-2*Math.log(o)/o);t=this.mean+this.stdDev*a*s,n=this.mean+this.stdDev*i*s,this.truncated&&!this.isValidTruncated(t)||(r=!0)}return this.truncated&&!this.isValidTruncated(n)||(this.nextVal=this.convertValue(n)),this.convertValue(t)}},{key:"convertValue",value:function(e){return null==this.dtype||"float32"===this.dtype?e:Math.round(e)}},{key:"isValidTruncated",value:function(e){return e<=this.upper&&e>=this.lower}}]),e}()),s=function(){function e(t,n,a,s){Object(r.a)(this,e),this.alpha=t,this.beta=1/n,this.dtype=a;var u=s||Math.random();this.randu=i.alea(u.toString()),this.randn=new o(0,1,a,!1,this.randu()),this.d=t<1?t+2/3:t-1/3,this.c=1/Math.sqrt(9*this.d)}return Object(a.a)(e,[{key:"nextValue",value:function(){for(var e,t,n,r,a,i;;){do{r=this.randn.nextValue(),i=1+this.c*r}while(i<=0);if(i*=i*i,t=1-.331*(e=r*r)*e,n=.5*e+this.d*(1-i+Math.log(i)),(a=this.randu())<t||Math.log(a)<n)break}return i=1/this.beta*this.d*i,this.alpha<1&&(i*=Math.pow(this.randu(),1/this.alpha)),this.convertValue(i)}},{key:"convertValue",value:function(e){return"float32"===this.dtype?e:Math.round(e)}}]),e}(),u=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;if(Object(r.a)(this,e),this.canReturnFloat=function(){return null==t.dtype||"float32"===t.dtype}
2,this.min=n,this.range=a-n,this.dtype=o,null==s&&(s=Math.random()),"number"===typeof s&&(s=s.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error("The difference between ".concat(n," - ").concat(a," <= 1 and dtype is not float"));this.random=i.alea(s)}return Object(a.a)(e,[{key:"convertValue",value:function(e){return this.canReturnFloat()?e:Math.round(e)}},{key:"nextValue",value:function(){return this.convertValue(this.min+this.range*this.random())}}]),e}()},function(e,t,n){"use strict";var r=n(160),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(e){return r.isMemo(e)?o:s[e.$$typeof]||a}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=o;var c=Object.defineProperty,l=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(p){var a=f(n);a&&a!==p&&e(t,a,r)}var o=l(n);h&&(o=o.concat(h(n)));for(var s=u(t),m=u(n),v=0;v<o.length;++v){var g=o[v];if(!i[g]&&(!r||!r[g])&&(!m||!m[g])&&(!s||!s[g])){var b=d(n,g);try{c(t,g,b)}catch(y){}}}}return t}},function(e,t,n){"use strict";var r=n(183),a=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=h;var i=Object.create(n(169));i.inherits=n(141);var o=n(291),s=n(238);i.inherits(h,o);for(var u=a(s.prototype),c=0;c<u.length;c++){var l=u[c];h.prototype[l]||(h.prototype[l]=s.prototype[l])}function h(e){if(!(this instanceof h))return new h(e);o.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",d)}function d(){this.allowHalfOpen||this._writableState.ended||r.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),h.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r={};function a(e){return r[e]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(10),a=n(7),i=n(4),o=n(89),s=n(9),u=n(14);var c=Object(s.b)({broadcastTo_:function(e,t){var n=Object(i.a)(e,"broadcastTo","x"),s=n.shape;if(t.some((function(e){return!(e>0)||e%1!==0})))throw new Error("broadcastTo(): Invalid broadcast shape [".concat(t,"]."));if(t.length<n.rank)throw new Error("broadcastTo(): shape.length=".concat(t.length," < input.rank=").concat(n.rank,"."));if(t.length>n.rank){for(var c=n.shape.slice();c.length<t.length;)c.unshift(1);n=Object(u.a)(n,c)}for(var l=n.shape,h=Array.from(t),d=t.length-1;d>=0;d--)if(l[d]===t[d])h[d]=1;else if(1!==n.shape[d])throw new Error("broadcastTo(): [".concat(s,"] cannot be broadcast to [").concat(t,"]."));if(0===h.map((function(e,t){return e>1?t:-1})).filter((function(e){return e>=0})).length)return Object(o.a)(n);var f={x:n},p={shape:t,inputShape:l};return r.a.runKernelFunc((function(e){return e.tile(n,h)}),f,null,a.u,p)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(35),u=n(9),c=n(14),l=n(45);var h=Object(u.b)({min_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],u=Object(i.a)(e,"x","min"),h=function(e,r){var a=Object(o.parseAxisParam)(t,u.shape),i=a,h=s.f(i,u.rank),d=u;null!=h&&(d=Object(l.a)(u,h),i=s.g(i.length,u.rank));var f=e.min(d,i);null!=h&&d.dispose();var p=f;if(n){var m=s.e(p.shape,a);
2p=Object(c.a)(f,m),f.dispose()}return r([u,p]),p},d={x:u},f={axis:t,keepDims:n};return r.a.runKernelFunc(h,d,null,a.Lb,f)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(19),a=n(10),i=n(7),o=n(4),s=n(9),u=n(14);var c=Object(s.b)({oneHot_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(t<2)throw new Error("Error in oneHot: depth must be >=2, but it is ".concat(t));var c=Object(o.a)(e,"indices","oneHot","int32"),l=[].concat(Object(r.a)(c.shape),[t]),h=function(e,r){return r([c]),Object(u.a)(e.oneHot(Object(u.a)(c,[c.size]),t,n,s),l)},d={indices:c},f={depth:t,onValue:n,offValue:s};return a.a.runKernelFunc(h,d,null,i.Ub,f)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),a=n(7),i=n(2),o=n(9),s=n(14);var u=Object(o.b)({ifft_:function(e){Object(i.assert)("complex64"===e.dtype,(function(){return"The dtype for tf.spectral.ifft() must be complex64 "+"but got ".concat(e.dtype,".")}));var t={input:e};return r.a.runKernelFunc((function(t){var n=e.shape[e.shape.length-1],r=e.size/n,a=Object(s.a)(e,[r,n]),i=t.ifft(a);return Object(s.a)(i,e.shape)}),t,null,a.mb)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(1);function a(e,t){"function"===typeof e?e(t):e&&(e.current=t)}function i(e,t){return r.useMemo((function(){return null==e&&null==t?null:function(n){a(e,n),a(t,n)}}),[e,t])}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t){"function"===typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t,n){"use strict";n.r(t),n.d(t,"validateUpdateShape",(function(){return i})),n.d(t,"validateInput",(function(){return o})),n.d(t,"calculateShapes",(function(){return s}));var r=n(19),a=n(2);function i(e,t,n){var r=t.rank>1?t.shape[t.rank-1]:1,a=t.rank>1?t.rank-1:1,i="Must have updates.shape = indices.shape[:batchDim] + "+"shape[sliceDim:], got updates.shape: ".concat(n.shape)+", indices.shape: ".concat(t.shape,", shape: ").concat(e)+", sliceDim: ".concat(r,", and batchDim: ").concat(a,".");if(n.rank<a)throw new Error(i+" update.rank < ".concat(a,". "));if(e.length<r+(n.rank-a))throw new Error(i+" Output shape length < ".concat(r+(n.rank-a)));if(n.rank!==a+e.length-r)throw new Error(i+" update.rank != ".concat(a+e.length-r));for(var o=0;o<a;++o)if(n.shape[o]!==t.shape[o])throw new Error(i+" updates.shape[".concat(o,"] (").concat(n.shape[o],") != indices.shape[").concat(o,"] (").concat(t.shape[o],")."));for(var s=0;s<n.rank-a;++s)if(n.shape[s+a]!==e[s+r])throw new Error(i+" updates.shape[".concat(s+a,"] (").concat(n.shape[s+a],") != shape[").concat(s+a,"] (").concat(e[s+a],")"))}function o(e,t,n){if(t.rank<1)throw new Error("tf.scatterND() expects the indices to be rank 1 or higher,"+" but the rank was ".concat(t.rank,"."));if(e.rank<1)throw new Error("tf.scatterND() expects the updates to be rank 1 or higher,"+" but the rank was ".concat(e.rank,"."));if("int32"!==t.dtype)throw new Error("The dtype of 'indices' should be int32, but got dtype: ".concat(t.dtype));if(n.length<1)throw new Error("Output rank must be greater or equal to 1, but got shape: ".concat(n));if(0===n.length){if(0===t.size)throw new Error("Indices specified for empty output. indices shape: ".concat(t.shape));if(0===e.size)throw new Error("Updates specified for empty output. updates shape: ".concat(e.shape))}i(n,t,e)}function s(e,t,n){for(var i=t.shape.length,o=i>1?t.shape[i-1]:1,s=n.length,u=1,c=o;c<s;++c)u*=n[c];var l=o<1?1:o;return{sliceRank:o,numUpdates:Object(a.sizeFromShape)(t.shape)/l,sliceSize:u,strides:[].concat(Object(r.a)(Object(a.computeStrides)(n.slice(0,o))),[1]),outputSize:Object(a.sizeFromShape)(n)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(8),a=n(10),i=n(7),o=n(36),s=n(4),u=n(9);var c=Object(u.b)({floorDiv_:function(e,t){var n=Object(s.a)(e,"a","floorDiv"),u=Object(s.a)(t,"b","floorDiv"),c=Object(o.makeTypesMatch)(n,u),l=Object(r.a)(c,2);n=l[0],u=l[1];var h={a:n,b:u};return a.a.runKernelFunc((function(e,t){var r=e.floorDiv(n,u);return t([n,u]),r}),h,null,i.db)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(10),a=n(7);function i(e,t,n){var i={shape:e,value:t,dtype:n};return r.a.runKernelFunc((function(r){return r.fill(e,t,n)}),{},null,a.ab,i)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(20),u=n(33),c=n(9),l=n(14);var h=Object(c.b)({avgPool_:function(e,t,n,c,h){var d=Object(i.a)(e,"x","avgPool","float32");o.assert(u.h(n,1),(function(){return"Error in avgPool: Either strides or dilations must be 1. "+"Got strides ".concat(n," and dilations '").concat(1,"'")}));var f=d,p=!1;3===d.rank&&(p=!0,f=Object(l.a)(d,[1,d.shape[0],d.shape[1],d.shape[2]])),o.assert(4===f.rank,(function(){return"Error in avgPool: x must be rank 4 but got rank ".concat(f.rank,".")})),null!=h&&o.assert(o.isInt(c),(function(){return"Error in avgPool: pad must be an integer when using, "+"dimRoundingMode ".concat(h," but got pad ").concat(c,".")}));var m={x:f},v={filterSize:t,strides:n,pad:c,dimRoundingMode:h},g=r.a.runKernelFunc((function(e,r){var a=u.e(f.shape,t,n,1,c,h);return r([f]),1===a.filterWidth&&1===a.filterHeight&&o.arraysEqual(a.inShape,a.outShape)?f.clone():e.avgPool(f,a)}),m,null,a.o,v);return g=Object(s.a)(g,d.dtype),p?Object(l.a)(g,[g.shape[1],g.shape[2],g.shape[3]]):g}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({cos_:function(e){var t=Object(i.a)(e,"x","cos"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.cos(t);return n([t]),r}),n,null,a.G)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(10),a=n(7),i=n(4),o=n(35),s=n(9),u=n(45);var c=Object(s.b)({cumsum_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],c=Object(i.a)(e,"x","cumsum"),l=function(e,r){var a=Object(o.f)([t],c.rank),i=c;null!=a&&(i=Object(u.a)(c,a));var l=Object(o.g)(1,c.rank)[0],h=e.cumsum(i,l,n,s);if(r([c]),null!=a){var d=Object(o.h)(a);h=Object(u.a)(h,d)}return h},h={x:c},d={axis:t,exclusive:n,reverse:s};return r.a.runKernelFunc(l,h,null,a.J,d)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({elu_:function(e){var t=Object(i.a)(e,"x","elu"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.elu(t);return n([r]),r}),n,null,a.T)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({floor_:function(e){var t=Object(i.a)(e,"x","floor"),n={x:t};return r.a.runKernelFunc((function(e){return e.floor(t)}),n,null,a.cb)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(4),a=n(2),i=n(25),o=n(35),s=n(62),u=n(94),c=n(90),l=n(9),h=n(14),d=n(26),f=n(31);var p=Object(l.b)({logSumExp_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],l=Object(r.a)(e,"x","logSumExp"),p=Object(a.parseAxisParam)(t,l.shape),m=Object(c.a)(l,p,!0),v=Object(d.a)(l,m),g=Object(s.a)(v),b=Object(f.a)(g,p),y=Object(u.a)(b),x=Object(i.a)(Object(h.a)(m,y.shape),y);if(n){var w=Object(o.e)(x.shape,p);return Object(h.a)(x,w)}return x}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),a=n(7),i=n(4),o=n(29),s=n(9);var u=Object(s.b)({logicalOr_:function(e,t){var n=Object(i.a)(e,"a","logicalOr","bool"),s=Object(i.a)(t,"b","logicalOr","bool");Object(o.a)(n.shape,s.shape);var u={a:n,b:s};return r.a.runKernelFunc((function(e){return e.logicalOr(n,s)}),u,null,a.Cb)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(33),u=n(9),c=n(14);var l=Object(u.b)({maxPool_:function(e,t,n,u,l){var h=Object(i.a)(e,"x","maxPool"),d=h,f=!1;3===h.rank&&(f=!0,d=Object(c.a)(h,[1,h.shape[0],h.shape[1],h.shape[2]])),o.assert(4===d.rank,(function(){return"Error in maxPool: input must be rank 4 but got rank ".concat(d.rank,".")})),o.assert(s.h(n,1),(function(){return"Error in maxPool: Either strides or dilations must be 1. "+"Got strides ".concat(n," and dilations '").concat(1,"'")})),null!=l&&o.assert(o.isInt(u),(function(){return"Error in maxPool: pad must be an integer when using, "+"dimRoundingMode ".concat(l," but got pad ").concat(u,".")}));var p={x:d},m={filterSize:t,strides:n,pad:u,dimRoundingMode:l},v=r.a.runKernelFunc((function(e,r){var a,i=s.e(d.shape,t,n,1,u,l);return a=1===i.filterWidth&&1===i.filterHeight&&o.arraysEqual(i.inShape,i.outShape)?d.clone():e.maxPool(d,i),r([d,a]),a}),p,null,a.Eb,m);return f?Object(c.a)(v,[v.shape[1],v.shape[2],v.shape[3]]):v}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(8),a=n(10),i=n(7),o=n(36),s=n(4),u=n(9);var c=Object(u.b)({mod_:function(e,t){var n=Object(s.a)(e,"a","mod"),u=Object(s.a)(t,"b","mod"),c=Object(o.makeTypesMatch)(n,u),l=Object(r.a)(c,2);n=l[0],u=l[1];var h={a:n,b:u};return a.a.runKernelFunc((function(e,t){var r=e.mod(n,u);return t([n,u]),r}),h,null,i.Nb)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({prelu_:function(e,t){var n=Object(i.a)(e,"x","prelu"),o=Object(i.a)(t,"alpha","prelu"),s={x:n,alpha:o};return r.a.runKernelFunc((function(e,t){var r=e.prelu(n,o);return t([n,o]),r}),s,null,a.Zb)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),a=n(7),i=n(4),o=n(20),s=n(9);var u=Object(s.b)({relu6_:function(e){var t=Object(i.a)(e,"x","relu6"),n={x:t};return r.a.runKernelFunc((function(e,n){return n([t]),"bool"===t.dtype?Object(o.a)(t,"int32"):e.relu6(t)}),n,null,a.fc)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(2),o=n(9);var s=Object(o.b)({fft_:function(e){Object(i.assert)("complex64"===e.dtype,(function(){return"The dtype for tf.spectral.fft() must be complex64 "+"but got ".concat(e.dtype,".")}));var t={input:e};return r.a.runKernelFunc((function(t){var n=e.shape[e.shape.length-1],r=e.size/n,a=e.as2D(r,n);return t.fft(a).reshape(e.shape)}),t,null,a.Z)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var r=n(2),a=n(74),i=n(49),o=n(121),s=n(9),u=n(114),c=n(14),l=n(41),h=n(96),d=n(79),f=n(34),p=n(156);var m=Object(s.b)({rfft_:function(e,t){Object(r.assert)("float32"===e.dtype,(function(){return"The dtype for rfft() must be real value but got ".concat(e.dtype)}));var n,s=e.shape[e.shape.length-1],m=e.size/s;
2if(null!=t&&t<s){var v=e.shape.map((function(e){return 0})),g=e.shape.map((function(e){return e}));g[e.shape.length-1]=t,n=Object(l.a)(e,v,g),s=t}else if(null!=t&&t>s){var b=e.shape.map((function(e){return e}));b[e.shape.length-1]=t-s,n=Object(i.a)([e,Object(d.a)(b)],e.shape.length-1),s=t}else n=e;var y=Object(f.a)(n),x=Object(c.a)(Object(a.a)(n,y),[m,s]),w=Object(p.a)(x),O=Math.floor(s/2)+1,k=Object(u.a)(w),S=Object(o.a)(w),_=Object(h.a)(k,[O,s-O],k.shape.length-1),j=Object(h.a)(S,[O,s-O],S.shape.length-1),E=n.shape.slice();return E[n.shape.length-1]=O,Object(c.a)(Object(a.a)(_[0],j[0]),E)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(9);var u=Object(s.b)({unsortedSegmentSum_:function(e,t,n){var s=Object(i.a)(e,"x","unsortedSegmentSum"),u=Object(i.a)(t,"segmentIds","unsortedSegmentSum","int32");Object(o.assert)(Object(o.isInt)(n),(function(){return"numSegments must be of dtype int"}));var c={x:s,segmentIds:u},l={numSegments:n};return r.a.runKernelFunc((function(e,t){var r=e.unsortedSegmentSum(s,u,n);return t([u]),r}),c,null,a.Pc,l)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var r=n(4),a=n(2),i=n(63),o=n(35),s=n(90),u=n(135),c=n(9),l=n(68),h=n(14),d=n(27),f=n(58),p=n(40),m=n(31);function v(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(0===e.rank)return Object(i.a)(e);if(1!==e.rank&&null===n)return v(Object(h.a)(e,[-1]),t,n);if(1===e.rank||"number"===typeof n||Array.isArray(n)&&1===n.length){if(1===t)return Object(m.a)(Object(i.a)(e),n);if(t===1/0)return Object(s.a)(Object(i.a)(e),n);if(t===-1/0)return Object(u.a)(Object(i.a)(e),n);if("euclidean"===t||2===t)return Object(f.a)(Object(m.a)(Object(l.a)(Object(i.a)(e),Object(d.a)(2,"int32")),n));throw new Error("Error in norm: invalid ord value: ".concat(t))}if(Array.isArray(n)&&2===n.length){if(1===t)return Object(s.a)(Object(m.a)(Object(i.a)(e),n[0]),n[1]-1);if(t===1/0)return Object(s.a)(Object(m.a)(Object(i.a)(e),n[1]),n[0]);if(t===-1/0)return Object(u.a)(Object(m.a)(Object(i.a)(e),n[1]),n[0]);if("fro"===t||"euclidean"===t)return Object(f.a)(Object(m.a)(Object(p.a)(e),n));throw new Error("Error in norm: invalid ord value: ".concat(t))}throw new Error("Error in norm: invalid axis: ".concat(n))}var g=Object(c.b)({norm_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"euclidean",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=v(e=Object(r.a)(e,"x","norm"),t,n),u=s.shape;if(i){var c=Object(a.parseAxisParam)(n,e.shape);u=o.e(s.shape,c)}return Object(h.a)(s,u)}})},function(e,t,n){"use strict";e.exports=n(343)},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(176);function a(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(10),a=n(7),i=n(2),o=n(33),s=n(9),u=n(14);var c=Object(s.b)({conv2DBackpropInput_:function(e,t,n,s,c){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"NHWC",h=arguments.length>6?arguments[6]:void 0;i.assert(e.length===t.rank,(function(){return"Length of inShape "+"(".concat(e.length,") and rank of dy (").concat(t.rank,") must match")}));var d=e,f=t,p=!1;3===t.rank&&(p=!0,f=Object(u.a)(t,[1,t.shape[0],t.shape[1],t.shape[2]]),d=[1,e[0],e[1],e[2]]),i.assert(4===d.length,(function(){return"Error in conv2dDerInput: inShape must be length 4, but got length "+"".concat(d.length,".")})),i.assert(4===f.rank,(function(){return"Error in conv2dDerInput: dy must be rank 4, but got "+"rank ".concat(f.rank)})),i.assert(4===n.rank,(function(){return"Error in conv2dDerInput: filter must be rank 4, but got "+"rank ".concat(n.rank)}));var m="NHWC"===l?d[3]:d[1],v="NHWC"===l?f.shape[3]:f.shape[1];
2i.assert(m===n.shape[2],(function(){return"Error in conv2dDerInput: depth of input (".concat(m,") must ")+"match input depth for filter ".concat(n.shape[2],".")})),i.assert(v===n.shape[3],(function(){return"Error in conv2dDerInput: depth of output (".concat(v,") must ")+"match output depth for filter ".concat(n.shape[3],".")})),null!=h&&i.assert(i.isInt(c),(function(){return"Error in conv2dDerInput: pad must be an integer when using, "+"dimRoundingMode ".concat(h," but got pad ").concat(c,".")}));var g=function(e,t){var r=o.g(l),a=o.a(d,n.shape,s,1,c,h,!1,r),i=e.conv2dDerInput(f,n,a);return t([f,n]),i},b={dy:f,filter:n},y={strides:s,pad:c,dataFormat:l,dimRoundingMode:h,inputShape:d},x=r.a.runKernelFunc(g,b,null,a.C,y);return p?Object(u.a)(x,[x.shape[1],x.shape[2],x.shape[3]]):x}})},function(e,t,n){"use strict";n.r(t),n.d(t,"TEST_EPSILON_FLOAT16",(function(){return o})),n.d(t,"expectArraysClose",(function(){return s})),n.d(t,"testEpsilon",(function(){return u})),n.d(t,"expectPromiseToFail",(function(){return l})),n.d(t,"expectArraysEqual",(function(){return h})),n.d(t,"expectNumbersClose",(function(){return d})),n.d(t,"expectValuesInRange",(function(){return p})),n.d(t,"expectArrayBuffersEqual",(function(){return m}));var r=n(10),a=n(4),i=n(2),o=.1;function s(e,t,n){return null==n&&(n=u()),c(e,t,(function(e,t){return f(e,t,n)}))}function u(){return 32===r.a.backend.floatPrecision()?.001:o}function c(e,t,n){var r=!0;if((Object(i.isTypedArray)(e)||Object(i.isTypedArray)(t))&&(r=!1),Object(i.isTypedArray)(e)&&Object(i.isTypedArray)(t)&&(r=!0),r){var o=e.constructor.name,s=t.constructor.name;if(o!==s)throw new Error("Arrays are of different type. Actual: ".concat(o,". ")+"Expected: ".concat(s))}if(Array.isArray(e)&&Array.isArray(t)){var u=Object(a.c)(e),c=Object(a.c)(t);if(!Object(i.arraysEqual)(u,c))throw new Error("Arrays have different shapes. "+"Actual: [".concat(u,"]. Expected: [").concat(c,"]"))}var l=Object(i.isTypedArray)(e)?e:Object(i.flatten)(e),h=Object(i.isTypedArray)(t)?t:Object(i.flatten)(t);if(l.length!==h.length)throw new Error("Arrays have different lengths actual: ".concat(l.length," vs ")+"expected: ".concat(h.length,".\n")+"Actual: ".concat(l,".\n")+"Expected: ".concat(h,"."));for(var d=0;d<h.length;++d){var f=l[d],p=h[d];if(!n(f,p))throw new Error("Arrays differ: actual[".concat(d,"] = ").concat(f,", expected[").concat(d,"] = ").concat(p,".\n")+"Actual: ".concat(l,".\n")+"Expected: ".concat(h,"."))}}function l(e,t){e().then((function(){return t.fail()}),(function(){return t()}))}function h(e,t){var n="string"===typeof t||"number"===typeof t||"boolean"===typeof t?[t]:t;return Object(i.isString)(e)||Object(i.isString)(e[0])||Object(i.isString)(t)||Object(i.isString)(t[0])?c(e,n,(function(e,t){return e==t})):c(e,t,(function(e,t){return f(e,t,0)}))}function d(e,t,n){if(null==n&&(n=u()),!f(e,t,n))throw new Error("Numbers differ: actual === ".concat(e,", expected === ").concat(t))}function f(e,t,n){return!isFinite(e)&&!isFinite(t)||!(isNaN(e)||isNaN(t)||Math.abs(e-t)>n)}function p(e,t,n){for(var r=0;r<e.length;r++)if(e[r]<t||e[r]>n)throw new Error("Value out of range:".concat(e[r]," low: ").concat(t,", high: ").concat(n))}function m(e,t){expect(new Float32Array(e)).toEqual(new Float32Array(t))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(10),a=n(7),i=n(2),o=n(33),s=n(9),u=n(14);var c=Object(s.b)({conv2DBackpropFilter_:function(e,t,n,s,c){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"NHWC",h=arguments.length>6?arguments[6]:void 0,d=e;3===e.rank&&(d=Object(u.a)(e,[1,e.shape[0],e.shape[1],e.shape[2]]));var f=t;3===f.rank&&(f=Object(u.a)(t,[1,t.shape[0],t.shape[1],t.shape[2]])),i.assert(4===d.rank,(function(){return"Error in conv2dDerFilter: input must be rank 4, but got shape "+"".concat(d.shape,".")})),i.assert(4===f.rank,(function(){return"Error in conv2dDerFilter: dy must be rank 4, but got shape "+"".concat(f.shape,".")})),i.assert(4===n.length,(function(){return"Error in conv2dDerFilter: filterShape must be length 4, but got "+"".concat(n,".")}));var p="NHWC"===l?d.shape[3]:d.shape[1],m="NHWC"===l?f.shape[3]:f.shape[1];i.assert(p===n[2],(function(){return"Error in conv2dDerFilter: depth of input ".concat(p,") must ")+"match input depth in filter (".concat(n[2],".")})),i.assert(m===n[3],(function(){return"Error in conv2dDerFilter: depth of dy (".concat(m,") must ")+"match output depth for filter (".concat(n[3],").")})),null!=h&&i.assert(i.isInt(c),(function(){return"Error in conv2dDerFilter: pad must be an integer when using, "+"dimRoundingMode ".concat(h," but got pad ").concat(c,".")}));var v=function(e){var t=o.g(l),r=o.a(d.shape,n,s,1,c,h,!1,t);return e.conv2dDerFilter(d,f,r)},g={x:d,dy:f},b={strides:s,pad:c,dataFormat:l,dimRoundingMode:h};return r.a.runKernelFunc(v,g,null,a.B,b)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(227);function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(u){a=!0,i=u}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}}(e,t)||Object(r.a)(e,t)||function(){throw new TypeError("Invalid attempt to de
2structure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}n.d(t,"a",(function(){return m})),n.d(t,"b",(function(){return v}));var a=!1;if("undefined"!==typeof window){var i={get passive(){a=!0}};window.addEventListener("testPassive",null,i),window.removeEventListener("testPassive",null,i)}var o="undefined"!==typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),s=[],u=!1,c=-1,l=void 0,h=void 0,d=function(e){return s.some((function(t){return!(!t.options.allowTouchMove||!t.options.allowTouchMove(e))}))},f=function(e){var t=e||window.event;return!!d(t.target)||(t.touches.length>1||(t.preventDefault&&t.preventDefault(),!1))},p=function(){setTimeout((function(){void 0!==h&&(document.body.style.paddingRight=h,h=void 0),void 0!==l&&(document.body.style.overflow=l,l=void 0)}))},m=function(e,t){if(o){if(!e)return void console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");if(e&&!s.some((function(t){return t.targetElement===e}))){var n={targetElement:e,options:t||{}};s=[].concat(r(s),[n]),e.ontouchstart=function(e){1===e.targetTouches.length&&(c=e.targetTouches[0].clientY)},e.ontouchmove=function(t){1===t.targetTouches.length&&function(e,t){var n=e.targetTouches[0].clientY-c;!d(e.target)&&(t&&0===t.scrollTop&&n>0||function(e){return!!e&&e.scrollHeight-e.scrollTop<=e.clientHeight}(t)&&n<0?f(e):e.stopPropagation())}(t,e)},u||(document.addEventListener("touchmove",f,a?{passive:!1}:void 0),u=!0)}}else{!function(e){if(void 0===h){var t=!!e&&!0===e.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;t&&n>0&&(h=document.body.style.paddingRight,document.body.style.paddingRight=n+"px")}void 0===l&&(l=document.body.style.overflow,setTimeout((function(){document.body.style.overflow="hidden"})))}(t);var i={targetElement:e,options:t||{}};s=[].concat(r(s),[i])}},v=function(e){if(o){if(!e)return void console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");e.ontouchstart=null,e.ontouchmove=null,s=s.filter((function(t){return t.targetElement!==e})),u&&0===s.length&&(document.removeEventListener("touchmove",f,a?{passive:!1}:void 0),u=!1)}else(s=s.filter((function(t){return t.targetElement!==e}))).length||p()}},function(e,t,n){"use strict";(function(e){var t=n(184),r=n(39),a=Object(r.c)();a.registerFlag("DEBUG",(function(){return!1}),(function(e){e&&console.warn("Debugging mode is ON. The output of every math call will be downloaded to CPU and checked for NaNs. This significantly impacts performance.")})),a.registerFlag("IS_BROWSER",(function(){return t.isBrowser()})),a.registerFlag("IS_NODE",(function(){return"undefined"!==typeof e&&"undefined"!==typeof e.versions&&"undefined"!==typeof e.versions.node})),a.registerFlag("IS_CHROME",(function(){return"undefined"!==typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)})),a.registerFlag("PROD",(function(){return!1})),a.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",(function(){return a.getBool("DEBUG")})),a.registerFlag("DEPRECATION_WARNINGS_ENABLED",(function(){return!0})),a.registerFlag("IS_TEST",(function(){return!1}))}).call(this,n(115))},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"===typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"===typeof e},t.isString=function(e){return"string"===typeof e},t.isSymbol=function(e){return"symbol"===typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"===typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"===typeof e},t.isPrimitive=function(e){return null===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||"symbol"===typeof e||"undefined"===typeof e},t.isBuffer=e.isBuffer}).call(this,n(116).Buffer)},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return i}));var r=n(2);function a(e,t){var n=e[0].length;e.forEach((function(e,t){r.assert(e.length===n,(function(){return"Error in concat".concat(n,"D: rank of tensors[").concat(t,"] must be the same ")+"as the rank of the rest (".concat(n,")")}))})),r.assert(t>=0&&t<n,(function(){return"Error in concat".concat(n,"D: axis must be between 0 and ").concat(n-1,".")}));var a=e[0];e.forEach((function(e,i){for(var o=0;o<n;o++)r.assert(o===t||e[o]===a[o],(function(){return"Error in concat".concat(n,"D: Shape of tensors[").concat(i,"] (").concat(e,") ")+"does not match the shape of the rest (".concat(a,") ")+"along the non-concatenated axis ".concat(i,".")}))}))}function i(e,t){for(var n=e[0].slice(),r=1;r<e.length;r++)n[t]+=e[r][t];return n}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({tanh_:function(e){var t=Object(i.a)(e,"x","tanh"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.tanh(t);return n([r]),r}),n,null,a.Kc)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),a=n(7),i=n(2),o=n(95),s=n(79);function u(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"float32";if(0===n)throw new Error("Cannot have a step of zero");var c=function(){if(e===t||e<t&&n<0||t<e&&n>1)return Object(s.a)([0],u);var r=Math.abs(Math.ceil((t-e)/n)),a=Object(i.makeZerosTypedArray)(r,u);t<e&&1===n&&(n=-1),a[0]=e;for(var c=1;c<a.length;c++)a[c]=a[c-1]+n;return Object(o.a)(a,u)},l={start:e,stop:t,step:n,dtype:u};return r.a.runKernelFunc(c,{},null,a.bc,l)}},function(e,t,n){"use strict";function r(e){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(93);
2Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(1)),i=(0,r(n(97)).default)(a.default.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add");t.default=i},function(e,t,n){"use strict";n.d(t,"a",(function(){return h})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return s}));var r=n(239),a=function(){return Math.random().toString(36).substring(7).split("").join(".")},i={INIT:"@@redux/INIT"+a(),REPLACE:"@@redux/REPLACE"+a(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+a()}};function o(e){if("object"!==typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function s(e,t,n){var a;if("function"===typeof t&&"function"===typeof n||"function"===typeof n&&"function"===typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"===typeof t&&"undefined"===typeof n&&(n=t,t=void 0),"undefined"!==typeof n){if("function"!==typeof n)throw new Error("Expected the enhancer to be a function.");return n(s)(e,t)}if("function"!==typeof e)throw new Error("Expected the reducer to be a function.");var u=e,c=t,l=[],h=l,d=!1;function f(){h===l&&(h=l.slice())}function p(){if(d)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return c}function m(e){if("function"!==typeof e)throw new Error("Expected the listener to be a function.");if(d)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribelistener for more details.");var t=!0;return f(),h.push(e),function(){if(t){if(d)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribelistener for more details.");t=!1,f();var n=h.indexOf(e);h.splice(n,1),l=null}}}function v(e){if(!o(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if("undefined"===typeof e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(d)throw new Error("Reducers may not dispatch actions.");try{d=!0,c=u(c,e)}finally{d=!1}for(var t=l=h,n=0;n<t.length;n++){(0,t[n])()}return e}function g(e){if("function"!==typeof e)throw new Error("Expected the nextReducer to be a function.");u=e,v({type:i.REPLACE})}function b(){var e,t=m;return(e={subscribe:function(e){if("object"!==typeof e||null===e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(p())}return n(),{unsubscribe:t(n)}}})[r.a]=function(){return this},e}return v({type:i.INIT}),(a={dispatch:v,subscribe:m,getState:p,replaceReducer:g})[r.a]=b,a}function u(e,t){var n=t&&t.type;return"Given "+(n&&'action "'+String(n)+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function c(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var a=t[r];0,"function"===typeof e[a]&&(n[a]=e[a])}var o,s=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if("undefined"===typeof n(void 0,{type:i.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if("undefined"===typeof n(void 0,{type:i.PROBE_UNKNOWN_ACTION()}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+i.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')}))}(n)}catch(c){o=c}return function(e,t){if(void 0===e&&(e={}),o)throw o;for(var r=!1,a={},i=0;i<s.length;i++){var c=s[i],l=n[c],h=e[c],d=l(h,t);
2if("undefined"===typeof d){var f=u(c,t);throw new Error(f)}a[c]=d,r=r||d!==h}return(r=r||s.length!==Object.keys(e).length)?a:e}}function l(e,t){return function(){return t(e.apply(this,arguments))}}function h(e,t){if("function"===typeof e)return l(e,t);if("object"!==typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');var n={};for(var r in e){var a=e[r];"function"===typeof a&&(n[r]=l(a,t))}return n}},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";(function(e,r){var a;function i(){if(null==a){var t;if("undefined"!==typeof window)t=window;else if("undefined"!==typeof e)t=e;else if("undefined"!==typeof r)t=r;else{if("undefined"===typeof self)throw new Error("Could not find a global object");t=self}a=t}return a}function o(e,t){var n=function(){var e=i();return null==e._tfGlobals&&(e._tfGlobals=new Map),e._tfGlobals}();if(n.has(e))return n.get(e);var r=t();return n.set(e,r),n.get(e)}n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}))}).call(this,n(112),n(115))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8}},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r,a="object"===typeof Reflect?Reflect:null,i=a&&"function"===typeof a.apply?a.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=a&&"function"===typeof a.ownKeys?a.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,r){function a(){void 0!==i&&e.removeListener("error",i),n([].slice.call(arguments))}var i;"error"!==t&&(i=function(n){e.removeListener(t,a),r(n)},e.once("error",i)),e.once(t,a)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function h(e,t,n,r){var a,i,o,s;if(c(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),o=i[t]),void 0===o)o=i[t]=n,++e._eventsCount;else if("function"===typeof o?o=i[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(a=l(e))>0&&o.length>a&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=d.bind(r);return a.listener=n,r.wrapFn=a,a}function p(e,t,n){var r=e._events;if(void 0===r)return[];var a=r[t];return void 0===a?[]:"function"===typeof a?n?[a.listener||a]:[a]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(a):v(a,a.length)}function m(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"===typeof n)return 1;if(void 0!==n)return n.length}return 0}function v(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!==typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!==typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,a=this._events;if(void 0!==a)r=r&&void 0===a.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var u=a[e];if(void 0===u)return!1;if("function"===typeof u)i(u,this,t);else{var c=u.length,l=v(u,c);for(n=0;n<c;++n)i(l[n],this,t)}return!0},s.prototype.addListener=function(e,t){return h(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return h(this,e,t,!0)},s.prototype.once=function(e,t){return c(t),this.on(e,f(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,f(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,a,i,o;
2if(c(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!==typeof n){for(a=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){o=n[i].listener,a=i;break}if(a<0)return this;0===a?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,a),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var a,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(a=i[r])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"===typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){"use strict";(function(t){"undefined"===typeof t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,a){if("function"!==typeof e)throw new TypeError('"callback" argument must be a function');var i,o,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,n)}));case 3:return t.nextTick((function(){e.call(null,n,r)}));case 4:return t.nextTick((function(){e.call(null,n,r,a)}));default:for(i=new Array(s-1),o=0;o<i.length;)i[o++]=arguments[o];return t.nextTick((function(){e.apply(null,i)}))}}}:e.exports=t}).call(this,n(115))},function(e,t,n){"use strict";function r(){if("undefined"!==typeof navigator&&null!=navigator){var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4))}return!1}function a(){return"undefined"!==typeof window&&null!=window.document||"undefined"!==typeof WorkerGlobalScope}n.r(t),n.d(t,"isMobile",(function(){return r})),n.d(t,"isBrowser",(function(){return a}))},function(e,t,n){"use strict";function r(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];console.log(e.toString(t))}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(35),u=n(9),c=n(14),l=n(45);var h=Object(u.b)({all_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],u=Object(i.a)(e,"x","all","bool"),h=function(e){var r=Object(o.parseAxisParam)(t,u.shape),a=r,i=Object(s.f)(a,u.rank);null!=i&&(u=Object(l.a)(u,i),a=Object(s.g)(a.length,u.rank));var h=e.all(u,a);if(n){var d=Object(s.e)(h.shape,r);return Object(c.a)(h,d)}return h},d={x:u},f={axis:t,keepDims:n};return r.a.runKernelFunc(h,d,null,a.f,f)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(35),u=n(9),c=n(14),l=n(45);var h=Object(u.b)({any_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],u=Object(i.a)(e,"x","any","bool"),h=function(e){var r=Object(o.parseAxisParam)(t,u.shape),a=r,i=Object(s.f)(a,u.rank);null!=i&&(u=Object(l.a)(u,i),a=Object(s.g)(a.length,u.rank));var h=e.any(u,a);if(n){var d=Object(s.e)(h.shape,r);return Object(c.a)(h,d)}return h},d={x:u},f={axis:t,keepDims:n};return r.a.runKernelFunc(h,d,null,a.g,f)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(35),u=n(9),c=n(45);var l=Object(u.b)({argMax_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Object(i.a)(e,"x","argMax"),u=function(e,r){r([n]);var a=o.parseAxisParam(t,n.shape),i=s.f(a,n.rank);return null!=i&&(n=Object(c.a)(n,i),a=s.g(a.length,n.rank)),e.argMax(n,a[0])},l={x:n},h={axis:t};return r.a.runKernelFunc(u,l,null,a.h,h)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(35),u=n(9),c=n(45);var l=Object(u.b)({argMin_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Object(i.a)(e,"x","argMin"),u=function(e,r){r([n]),null==t&&(t=0);var a=o.parseAxisParam(t,n.shape),i=s.f(a,n.rank);return null!=i&&(n=Object(c.a)(n,i),a=s.g(a.length,n.rank)),e.argMin(n,a[0])},l={x:n},h={axis:t};return r.a.runKernelFunc(u,l,null,a.i,h)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(8),a=n(10),i=n(7),o=n(36),s=n(4),u=n(9);var c=Object(u.b)({atan2_:function(e,t){var n=Object(s.a)(e,"a","atan2"),u=Object(s.a)(t,"b","atan2"),c=Object(o.makeTypesMatch)(n,u),l=Object(r.a)(c,2);n=l[0],u=l[1];var h={a:n,b:u};return a.a.runKernelFunc((function(e,t){var r=e.atan2(n,u);return t([n,u]),r}),h,null,i.m)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(4),a=n(2),i=n(88),o=n(33),s=n(9),u=n(14);var c=Object(s.b)({conv1d_:function(e,t,n,s){var c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"NWC",l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,h=arguments.length>6?arguments[6]:void 0,d=Object(r.a)(e,"x","conv1d"),f=Object(r.a)(t,"filter","conv1d"),p=d,m=!1;2===d.rank&&(m=!0,p=Object(u.a)(d,[1,d.shape[0],d.shape[1]])),a.assert(3===p.rank,(function(){return"Error in conv1d: input must be rank 3, but got rank ".concat(p.rank,".")})),a.assert(3===f.rank,(function(){return"Error in conv1d: filter must be rank 3, but got rank "+"".concat(f.rank,".")})),null!=h&&a.assert(a.isInt(s),(function(){return"Error in conv1d: pad must be an integer when using, "+"dimRoundingMode ".concat(h," but got pad ").concat(s,".")})),a.assert(p.shape[2]===f.shape[1],(function(){return"Error in conv1d: depth of input (".concat(p.shape[2],") must match ")+"input depth for filter ".concat(f.shape[1],".")})),a.assert(o.h(n,l),(function(){return"Error in conv1D: Either stride or dilation must be 1. "+"Got stride ".concat(n," and dilation '").concat(l,"'")})),a.assert("NWC"===c,(function(){return"Error in conv1d: got dataFormat of ".concat(c," but only NWC is currently supported.")}));var v=Object(u.a)(f,[1,f.shape[0],f.shape[1],f.shape[2]]),g=Object(u.a)(p,[p.shape[0],1,p.shape[1],p.shape[2]]),b=[1,n],y=[1,l],x="NHWC",w=Object(i.a)(g,v,b,s,x,y,h);return m?Object(u.a)(w,[w.shape[2],w.shape[3]]):Object(u.a)(w,[w.shape[0],w.shape[2],w.shape[3]])}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}
2));var r=n(4),a=n(163),i=n(9);var o=Object(i.b)({conv2dTranspose_:function(e,t,n,i,o,s){var u=Object(r.a)(e,"x","conv2dTranspose"),c=Object(r.a)(t,"filter","conv2dTranspose");return Object(a.a)(n,u,c,i,o,"NHWC",s)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({cosh_:function(e){var t=Object(i.a)(e,"x","cosh"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.cosh(t);return n([t]),r}),n,null,a.H)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(9);var u=Object(s.b)({depthToSpace_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"NHWC",s=Object(i.a)(e,"x","depthToSpace"),u="NHWC"===n?s.shape[1]:s.shape[2],c="NHWC"===n?s.shape[2]:s.shape[3],l="NHWC"===n?s.shape[3]:s.shape[1];o.assert(u*t>=0,(function(){return"Negative dimension size caused by overflow when multiplying\n ".concat(u," and ").concat(t," for depthToSpace with input shape\n ").concat(s.shape)})),o.assert(c*t>=0,(function(){return"Negative dimension size caused by overflow when multiplying\n ".concat(c," and ").concat(t," for depthToSpace with input shape\n ").concat(s.shape)})),o.assert(l%(t*t)===0,(function(){return"Dimension size must be evenly divisible by ".concat(t*t," but is ").concat(l," for depthToSpace with input shape ").concat(s.shape)}));var h=function(e){return e.depthToSpace(s,t,n)},d={x:s},f={blockSize:t,dataFormat:n};return r.a.runKernelFunc(h,d,null,a.K,f)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(9),u=n(14);var c=Object(s.b)({dilation2d_:function(e,t,n,s){var c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[1,1],l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"NHWC",h=Object(i.a)(e,"x","dilation2d"),d=Object(i.a)(t,"filter","dilation2d");o.assert(3===h.rank||4===h.rank,(function(){return"Error in dilation2d: input must be rank 3 or 4, but got rank "+"".concat(h.rank,".")})),o.assert(3===d.rank,(function(){return"Error in dilation2d: filter must be rank 3, but got rank "+"".concat(d.rank,".")})),o.assert("NHWC"===l,(function(){return"Error in dilation2d: Only NHWC is currently supported, "+"but got dataFormat of ".concat(l)}));var f=h,p=!1;3===h.rank&&(f=Object(u.a)(h,[1,h.shape[0],h.shape[1],h.shape[2]]),p=!0);var m={x:f,filter:d},v={strides:n,pad:s,dilations:c},g=r.a.runKernel(a.P,m,v);return p?Object(u.a)(g,[g.shape[1],g.shape[2],g.shape[3]]):g}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(8),a=n(36),i=n(4),o=n(28),s=n(100),u=n(9),c=n(59),l=n(34);var h=Object(u.b)({divNoNan_:function(e,t){var n=Object(i.a)(e,"a","div"),u=Object(i.a)(t,"b","div"),h=Object(a.makeTypesMatch)(n,u),d=Object(r.a)(h,2);n=d[0],u=d[1];var f=Object(o.a)(n,u),p=Object(l.a)(f),m=Object(s.a)(u,p);return Object(c.a)(m,p,f)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(4),a=n(2),i=n(43),o=n(9),s=n(14);var u=Object(o.b)({dot_:function(e,t){var n=Object(r.a)(e,"t1","dot"),o=Object(r.a)(t,"t2","dot");a.assert((1===n.rank||2===n.rank)&&(1===o.rank||2===o.rank),(function(){return"Error in dot: inputs must all be rank 1 or 2, but got ranks "+"".concat(n.rank," and ").concat(o.rank,".")}));var u=1===n.rank?n.size:n.shape[1],c=1===o.rank?o.size:o.shape[0];if(a.assert(u===c,(function(){return"Error in dot: inner dimensions of inputs must match, but got "+"".concat(u," and ").concat(c,".")})),1===n.rank&&1===o.rank){var l=Object(s.a)(n,[1,-1]),h=Object(s.a)(o,[-1,1]),d=Object(i.a)(l,h);return Object(s.a)(d,[])}if(1===n.rank&&2===o.rank){var f=Object(s.a)(n,[1,-1]),p=Object(s.a)(o,[o.shape[0],o.shape[1]]),m=Object(i.a)(f,p);return Object(s.a)(m,[m.size])}if(2===n.rank&&1===o.rank){var v=Object(s.a)(o,[-1,1]),g=Object(i.a)(n,v);return Object(s.a)(g,[g.size])}var b=Object(s.a)(o,[o.shape[0],o.shape[1]]);return Object(i.a)(n,b)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"segOpComputeOptimalWindowSize",(function(){return i})),n.d(t,"computeOutShape",(function(){return o})),n.d(t,"collectGatherOpShapeInfo",(function(){return s}));var r=n(2),a=n(199);function i(e,t){var n,i=!1;for(e<=a.a?(n=e,i=!0):n=Object(r.nearestDivisor)(e,Math.floor(Math.sqrt(e)));!i;)n>t||n===e?i=!0:n=Object(r.nearestDivisor)(e,n+1);return n}function o(e,t,n){for(var r=[],a=e.length,i=0;i<a;i++)i!==t?r.push(e[i]):r.push(n);return r}function s(e,t,n){for(var r=e.shape[n],a=[],i=1,o=1,s=0;s<n;s++)a.push(e.shape[s]),i*=e.shape[s];for(var u=0;u<t.rank;u++)a.push(t.shape[u]);for(var c=n+1;c<e.rank;c++)a.push(e.shape[c]),o*=e.shape[c];return{batchSize:i,sliceSize:o,dimSize:r,outputShape:a}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return i}));var r=n(2),a=30;function i(e){return e<=a?e:Object(r.nearestDivisor)(e,Math.floor(Math.sqrt(e)))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(4),a=n(87),i=n(17),o=n(9),s=n(27);var u=Object(o.b)({leakyRelu_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.2,n=Object(r.a)(e,"x","leakyRelu");return Object(a.a)(Object(i.a)(Object(s.a)(t),n),n)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(9),u=n(14);var c=Object(s.b)({localResponseNormalization_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5,l=Object(i.a)(e,"x","localResponseNormalization");o.assert(4===l.rank||3===l.rank,(function(){return"Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ".concat(l.rank,".")})),o.assert(o.isInt(t),(function(){return"Error in localResponseNormalization: depthRadius must be an "+"integer but got depthRadius ".concat(t,".")}));var h=l,d=!1;3===l.rank&&(d=!0,h=Object(u.a)(l,[1,l.shape[0],l.shape[1],l.shape[2]]));var f=function(e,r){var a=e.localResponseNormalization4D(h,t,n,s,c);return r([h,a]),a},p={x:h},m={depthRadius:t,bias:n,alpha:s,beta:c},v=r.a.runKernelFunc(f,p,null,a.sb,m);return d?Object(u.a)(v,[v.shape[1],v.shape[2],v.shape[3]]):v}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({log1p_:function(e){var t=Object(i.a)(e,"x","log1p"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.log1p(t);return n([t]),r}),n,null,a.yb)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({softplus_:function(e){var t=Object(i.a)(e,"x","softplus"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.softplus(t);return n([t]),r}),n,null,a.yc)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(4),a=n(29),i=n(81),o=n(123),s=n(151),u=n(9);var c=Object(u.b)({logicalXor_:function(e,t){var n=Object(r.a)(e,"a","logicalXor","bool"),u=Object(r.a)(t,"b","logicalXor","bool");return Object(a.a)(n.shape,u.shape),Object(i.a)(Object(s.a)(e,t),Object(o.a)(Object(i.a)(e,t)))}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(8),a=n(4),i=n(2),o=n(145),s=n(119),u=n(33),c=n(152),l=n(9),h=n(14),d=n(126);var f=Object(l.b)({pool_:function(e,t,n,l,f,p){null==f&&(f=[1,1]),null==p&&(p=1),0===l&&(l="valid");var m=Object(a.a)(e,"x","maxPool"),v=m,g=!1;3===m.rank&&(g=!0,v=Object(h.a)(m,[1,m.shape[0],m.shape[1],m.shape[2]])),i.assert(u.h(p,f),(function(){return"Error in pool: Either strides or dilations must be 1. "+"Got strides ".concat(p," and dilations '").concat(f,"'")}));var b,y=u.e(v.shape,t,p,f,l),x=[y.dilationHeight,y.dilationWidth];b="same"===l?function(e,t){var n=e.map((function(e,n){return e+(e-1)*(t[n]-1)})).map((function(e){return e-1})),r=n.map((function(e){return Math.floor(e/2)})),a=n.map((function(e,t){return e-r[t]}));return n.map((function(e,t){return[r[t],a[t]]}))}([y.filterHeight,y.filterWidth],x):[[0,0],[0,0]];var w=1===x[0]&&1===x[1],O=function(e,t,n){var r=n.map((function(e){return e[0]})),a=n.map((function(e){return e[1]})),i=e.concat(r,a),o=t.map((function(e,t){return(e-i[t]%e)%e})),s=a.map((function(e,t){return e+o[t]})),u=t.map((function(e,t){return[r[t],s[t]]})),c=t.map((function(e,t){return[0,o[t]]}));return[u,c]}
2([y.inHeight,y.inWidth],x,b),k=Object(r.a)(O,2),S=k[0],_=k[1],j=w?l:"valid",E=w?v:Object(d.a)(v,x,S),T=("avg"===n?function(){return Object(o.a)(E,t,p,j)}:function(){return Object(c.a)(E,t,p,j)})(),C=w?T:Object(s.a)(T,x,_);return g?Object(h.a)(C,[C.shape[1],C.shape[2],C.shape[3]]):C}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(35),u=n(20),c=n(9),l=n(14),h=n(45);var d=Object(c.b)({prod_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=Object(i.a)(e,"x","prod"),d=function(e){"bool"===c.dtype&&(c=Object(u.a)(c,"int32"));var r=Object(o.parseAxisParam)(t,c.shape),a=Object(s.f)(r,c.rank),i=r,d=c;null!=a&&(d=Object(h.a)(c,a),i=Object(s.g)(i.length,c.rank));var f=e.prod(d,i);if(n){var p=Object(s.e)(f.shape,r);f=Object(l.a)(f,p)}return f},f={x:c},p={axis:t,keepDims:n};return r.a.runKernelFunc(d,f,null,a.ac,p)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(61),a=n(9),i=n(130);var o=Object(a.b)({randomUniform_:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"float32",o=arguments.length>4?arguments[4]:void 0,s=Object(r.a)(e,a),u=new i.c(t,n,null,o),c=0;c<s.values.length;c++)s.values[c]=u.nextValue();return s.toTensor()}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({rsqrt_:function(e){var t=Object(i.a)(e,"x","rsqrt"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.rsqrt(t);return n([t]),r}),n,null,a.oc)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({selu_:function(e){var t=Object(i.a)(e,"x","selu"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.selu(t);return n([t]),r}),n,null,a.rc)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(4),a=n(2),i=n(88),o=n(99),s=n(9),u=n(14);var c=Object(s.b)({separableConv2d_:function(e,t,n,s,c){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[1,1],h=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"NHWC",d=Object(r.a)(e,"x","separableConv2d"),f=Object(r.a)(t,"depthwiseFilter","separableConv2d"),p=Object(r.a)(n,"pointwiseFilter","separableConv2d"),m=d,v=!1;if(3===d.rank&&(v=!0,m=Object(u.a)(d,[1,d.shape[0],d.shape[1],d.shape[2]])),"NCHW"===h)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");a.assert(4===m.rank,(function(){return"Error in separableConv2d: input must be rank 4, but got "+"rank ".concat(m.rank,".")})),a.assert(4===f.rank,(function(){return"Error in separableConv2d: depthwise filter must be rank 4, but "+"got rank ".concat(f.rank,".")})),a.assert(4===p.rank,(function(){return"Error in separableConv2d: pointwise filter must be rank 4, but "+"got rank ".concat(f.rank,".")})),a.assert(1===p.shape[0],(function(){return"Error in separableConv2d: the first dimension of pointwise filter "+" must be 1, but got ".concat(p.shape[0],".")})),a.assert(1===p.shape[1],(function(){return"Error in separableConv2d: the second dimension of pointwise "+"filter must be 1, but got ".concat(p.shape[1],".")}));var g=f.shape[2],b=f.shape[3];a.assert(p.shape[2]===g*b,(function(){return"Error in separableConv2d: the third dimension of pointwise filter "+"must be ".concat(g*b,", ")+"but got ".concat(p.shape[2],".")}));var y=Object(o.a)(m,f,s,c,h,l),x=1,w=Object(i.a)(y,p,x,"valid",h);return v?Object(u.a)(w,[w.shape[1],w.shape[2],w.shape[3]]):w}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({sin_:function(e){var t=Object(i.a)(e,"x","sin"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.sin(t);return n([t]),r}),n,null,a.uc)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({sinh_:function(e){var t=Object(i.a)(e,"x","sinh"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.sinh(t);return n([t]),r}),n,null,a.vc)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(74),a=n(49),i=n(121),o=n(17),s=n(9),u=n(114),c=n(14),l=n(69),h=n(27),d=n(41),f=n(137);var p=Object(s.b)({irfft_:function(e){var t,n=e.shape[e.shape.length-1],s=e.size/n;
2if(n<=2){var p=Object(c.a)(e,[s,n]);t=Object(f.a)(p)}else{var m=[s,2*(n-1)],v=Object(c.a)(Object(u.a)(e),[s,n]),g=Object(c.a)(Object(i.a)(e),[s,n]),b=Object(l.a)(Object(d.a)(v,[0,1],[s,n-2]),1),y=Object(o.a)(Object(l.a)(Object(d.a)(g,[0,1],[s,n-2]),1),Object(h.a)(-1)),x=Object(a.a)([v,b],1),w=Object(a.a)([g,y],1),O=Object(c.a)(Object(r.a)(x,w),[m[0],m[1]]);t=Object(f.a)(O)}if(t=Object(u.a)(t),3===e.rank&&0!==e.shape[0]){var k=t,S=e.shape[0];t=Object(c.a)(t,[S,t.shape[0]/S,t.shape[1]]),k.dispose()}return t}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(2);function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=[];if("number"===typeof t)Object(r.assert)(e.shape[n]%t===0,(function(){return"Number of splits must evenly divide the axis."})),a=new Array(t).fill(e.shape[n]/t);else{var i=t.reduce((function(e,t){return-1===t&&(e+=1),e}),0);Object(r.assert)(i<=1,(function(){return"There should be only one negative value in split array."}));var o=t.indexOf(-1);if(-1!==o){var s=t.reduce((function(e,t){return t>0?e+t:e}));t[o]=e.shape[n]-s}Object(r.assert)(e.shape[n]===t.reduce((function(e,t){return e+t})),(function(){return"The sum of sizes must match the size of the axis dimension."})),a=t}return a}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(4),a=n(2),i=n(72);function o(e,t,n){if(Object(a.assertNonNull)(e),null!=t&&3!==t.length)throw new Error("tensor3d() requires shape to have three numbers");var o=Object(r.c)(e,n);if(3!==o.length&&1!==o.length)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(1===o.length&&null==t)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return Object(i.a)(e,t,o,n)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(8),a=n(10),i=n(7),o=n(4),s=n(9);var u=Object(s.b)({topk_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],s=Object(o.a)(e,"x","topk");
2if(0===s.rank)throw new Error("topk() expects the input to be of rank 1 or higher");var u=s.shape[s.shape.length-1];if(t>u)throw new Error("'k' passed to topk() must be <= the last dimension (".concat(u,") ")+"but got ".concat(t));var c={x:s},l={k:t,sorted:n},h=a.a.runKernelFunc((function(e){return e.topk(s,t,n)}),c,null,i.Mc,l),d=Object(r.a)(h,2),f=d[0],p=d[1];return{values:f,indices:p}}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(3),a=n.n(r),i=n(13),o=n(218),s=n(4);function u(){return(u=Object(i.a)(a.a.mark((function e(t){var n,r,i;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Object(s.a)(t,"condition","whereAsync","bool"),e.next=3,n.data();case 3:return r=e.sent,i=Object(o.a)(n.shape,r),t!==n&&n.dispose(),e.abrupt("return",i);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var c=function(e){return u.apply(this,arguments)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(61);function a(e,t){for(var n=[],a=0;a<t.length;a++)t[a]&&n.push(a);for(var i=Object(r.a)(e,"int32"),o=Object(r.a)([n.length,e.length],"int32"),s=0;s<n.length;s++){var u=i.indexToLoc(n[s]),c=s*e.length;o.values.set(u,c)}return o.toTensor()}},function(e,t,n){"use strict";n.d(t,"b",(function(){return oe})),n.d(t,"a",(function(){return B}));var r=n(0),a=n(107),i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function o(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var s=function(){return(s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function u(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?a(e.value):new n((function(t){t(e.value)})).then(o,s)}u((r=r.apply(e,t||[])).next())}))}function c(e,t){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}
2if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],r=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var l=function(){function e(e,t){this.model=e,this.outputStride=t;var n=this.model.inputs[0].shape;r.util.assert(-1===n[1]&&-1===n[2],(function(){return"Input shape ["+n[1]+", "+n[2]+"] must both be equal to or -1"}))}return e.prototype.predict=function(e){var t=this;return Object(r.tidy)((function(){var n=t.preprocessInput(e.toFloat()).expandDims(0),r=t.model.predict(n).map((function(e){return e.squeeze([0])})),a=t.nameOutputResults(r);return{heatmapScores:a.heatmap.sigmoid(),offsets:a.offsets,displacementFwd:a.displacementFwd,displacementBwd:a.displacementBwd}}))},e.prototype.dispose=function(){this.model.dispose()},e}(),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.preprocessInput=function(e){return Object(r.tidy)((function(){return Object(r.div)(e,127.5).sub(1)}))},t.prototype.nameOutputResults=function(e){return{offsets:e[0],heatmap:e[1],displacementFwd:e[2],displacementBwd:e[3]}},t}(l);function d(e){return Math.floor(e/2)}var f=function(){function e(e,t){this.priorityQueue=new Array(e),this.numberOfElements=-1,this.getElementValue=t}return e.prototype.enqueue=function(e){this.priorityQueue[++this.numberOfElements]=e,this.swim(this.numberOfElements)},e.prototype.dequeue=function(){var e=this.priorityQueue[0];return this.exchange(0,this.numberOfElements--),this.sink(0),this.priorityQueue[this.numberOfElements+1]=null,e},e.prototype.empty=function(){return-1===this.numberOfElements},e.prototype.size=function(){return this.numberOfElements+1},e.prototype.all=function(){return this.priorityQueue.slice(0,this.numberOfElements+1)},e.prototype.max=function(){return this.priorityQueue[0]},e.prototype.swim=function(e){for(;e>0&&this.less(d(e),e);)this.exchange(e,d(e)),e=d(e)},e.prototype.sink=function(e){for(;2*e<=this.numberOfElements;){var t=2*e;if(t<this.numberOfElements&&this.less(t,t+1)&&t++,!this.less(e,t))break;this.exchange(e,t),e=t}},e.prototype.getValueAt=function(e){return this.getElementValue(this.priorityQueue[e])},e.prototype.less=function(e,t){return this.getValueAt(e)<this.getValueAt(t)},e.prototype.exchange=function(e,t){var n=this.priorityQueue[e];this.priorityQueue[e]=this.priorityQueue[t],this.priorityQueue[t]=n},e}();function p(e,t,n,r,a,i){for(var o=i.shape,s=o[0],u=o[1],c=!0,l=Math.max(n-a,0),h=Math.min(n+a+1,s),d=l;d<h;++d){for(var f=Math.max(r-a,0),p=Math.min(r+a+1,u),m=f;m<p;++m)if(i.get(d,m,e)>t){c=!1;break}if(!c)break}return c}var m=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],v=m.length,g=m.reduce((function(e,t,n){return e[t]=n,e}),{}),b=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]].map((function(e){var t=e[0],n=e[1];return[g[t],g[n]]}));function y(e,t,n,r){return{y:r.get(e,t,n),x:r.get(e,t,n+v)}}function x(e,t,n){var r=y(e.heatmapY,e.heatmapX,e.id,n),a=r.y,i=r.x;return{x:e.heatmapX*t+i,y:e.heatmapY*t+a}}function w(e,t,n){return e<t?t:e>n?n:e}function O(e,t){return{x:e.x+t.x,y:e.y+t.y}}var k=[["nose","leftEye"],["leftEye","leftEar"],["nose","rightEye"],["rightEye","rightEar"],["nose","leftShoulder"],["leftShoulder","leftElbow"],["leftElbow","leftWrist"],["leftShoulder","leftHip"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["nose","rightShoulder"],["rightShoulder","rightElbow"],["rightElbow","rightWrist"],["rightShoulder","rightHip"],["rightHip","rightKnee"],["rightKnee","rightAnkle"]].map((function(e){var t=e[0],n=e[1];return[g[t],g[n]]})),S=k.map((function(e){return e[1]})),_=k.map((function(e){return e[0]}));
2function j(e,t,n,r){return{y:w(Math.round(e.y/t),0,n-1),x:w(Math.round(e.x/t),0,r-1)}}function E(e,t,n,r,a,i,o,s){void 0===s&&(s=2);for(var u=r.shape,c=u[0],l=u[1],h=function(e,t,n){var r=n.shape[2]/2;return{y:n.get(t.y,t.x,e),x:n.get(t.y,t.x,r+e)}}(e,j(t.position,i,c,l),o),d=O(t.position,h),f=0;f<s;f++){var p=j(d,i,c,l),v=y(p.y,p.x,n,a);d=O({x:p.x*i,y:p.y*i},{x:v.x,y:v.y})}var g=j(d,i,c,l),b=r.get(g.y,g.x,n);return{position:d,part:m[n],score:b}}function T(e,t,n,r,a,i){var o=t.shape[2],s=S.length,u=new Array(o),c=e.part,l=e.score,h=x(c,r,n);u[c.id]={score:l,part:m[c.id],position:h};for(var d=s-1;d>=0;--d){var f=S[d],p=_[d];u[f]&&!u[p]&&(u[p]=E(d,u[f],p,t,n,r,i))}for(d=0;d<s;++d)f=_[d],p=S[d],u[f]&&!u[p]&&(u[p]=E(d,u[f],p,t,n,r,a));return u}function C(e,t,n,r){var a=n.x,i=n.y;return e.some((function(e){var n=e.keypoints[r].position;return function(e,t,n,r){var a=n-e,i=r-t;return a*a+i*i}(i,a,n.y,n.x)<=t}))}function M(e,t,n){return n.reduce((function(n,r,a){var i=r.position,o=r.score;return C(e,t,i,a)||(n+=o),n}),0)/n.length}function A(e,t,n,r,a,i,o,s){void 0===o&&(o=.5),void 0===s&&(s=20);for(var u=[],c=function(e,t,n){for(var r=n.shape,a=r[0],i=r[1],o=r[2],s=new f(a*i*o,(function(e){return e.score})),u=0;u<a;++u)for(var c=0;c<i;++c)for(var l=0;l<o;++l){var h=n.get(u,c,l);h<e||p(l,h,u,c,t,n)&&s.enqueue({score:h,part:{heatmapY:u,heatmapX:c,id:l}})}return s}(o,1,e),l=s*s;u.length<i&&!c.empty();){var h=c.dequeue();if(!C(u,l,x(h.part,a,t),h.part.id)){var d=T(h,e,t,a,n,r),m=M(u,l,d);u.push({keypoints:d,score:m})}}return u}function N(e){var t=e.shape,n=t[0],a=t[1],i=t[2];return Object(r.tidy)((function(){var t=e.reshape([n*a,i]).argMax(0),o=t.div(Object(r.scalar)(a,"int32")).expandDims(1),s=function(e,t){return Object(r.tidy)((function(){var n=e.div(Object(r.scalar)(t,"int32"));return e.sub(n.mul(Object(r.scalar)(t,"int32")))}))}(t,a).expandDims(1);return Object(r.concat)([o,s],1)}))}function R(e,t,n,r){return{y:r.get(e,t,n),x:r.get(e,t,n+v)}}function I(e,t,n){return Object(r.tidy)((function(){var a=function(e,t){for(var n=[],a=0;a<v;a++){var i=R(e.get(a,0).valueOf(),e.get(a,1).valueOf(),a,t),o=i.x,s=i.y;n.push(s),n.push(o)}return Object(r.tensor2d)(n,[v,2])}(e,n);return e.toTensor().mul(Object(r.scalar)(t,"int32")).toFloat().add(a)}))}function L(e,t,n){return u(this,void 0,void 0,(function(){var r,a,i,o,s,u,l,h,d,f;return c(this,(function(c){switch(c.label){case 0:return r=0,a=N(e),[4,Promise.all([e.buffer(),t.buffer(),a.buffer()])];case 1:return i=c.sent(),o=i[0],s=i[1],u=i[2],[4,(l=I(u,n,s)).buffer()];case 2:return h=c.sent(),d=Array.from(function(e,t){for(var n=t.shape[0],r=new Float32Array(n),a=0;a<n;a++){var i=t.get(a,0),o=t.get(a,1);r[a]=e.get(i,o,a)}return r}(o,u)),f=d.map((function(e,t){return r+=e,{position:{y:h.get(t,0),x:h.get(t,1)},part:m[t],score:e}})),a.dispose(),l.dispose(),[2,{keypoints:f,score:r/f.length}]}}))}))}var D="https://storage.googleapis.com/tfjs-models/savedmodel/posenet/mobilenet/",P="https://storage.googleapis.com/tfjs-models/savedmodel/posenet/resnet50/";var z=[-123.15,-115.9,-103.06],F=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.preprocessInput=function(e){return e.add(z)},t.prototype.nameOutputResults=function(e){var t=e[0],n=e[1];return{offsets:e[2],heatmap:e[3],displacementFwd:t,displacementBwd:n}},t}(l);function B(e,t){return b.reduce((function(n,r){var a=r[0],i=r[1];return function(e,t,n){return e<n||t<n}(e[a].score,e[i].score,t)||n.push([e[a],e[i]]),n}),[])}Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY;function U(e){return u(this,void 0,void 0,(function(){return c(this,(function(t){return[2,Promise.all(e.map((function(e){return e.buffer()})))]}))}))}function W(e,t){return q(e,t)?e:Math.floor(e/t)*t+1}function V(e){r.util.assert("number"==typeof e||"object"==typeof e,(function(){return"Invalid inputResolution "+e+". Should be a number or an object with width and height"})),"object"==typeof e&&(r.util.assert("number"==typeof e.width,(function(){return"inputResolution.width has a value of "+e.width+" which is invalid; it must be a number"})),r.util.assert("number"==typeof e.height,(function(){return"inputResolution.height has a value of "+e.height+" which is invali
2d; it must be a number"})))}function G(e,t){return V(e),"object"==typeof e?[W(e.height,t),W(e.width,t)]:[W(e,t),W(e,t)]}var H=[8,16,32];function q(e,t){return(e-1)%t==0}function X(e){return e instanceof r.Tensor?[e.shape[0],e.shape[1]]:[e.height,e.width]}function Y(e,t){var n=t[0],a=t[1],i=X(e),o=i[0],s=i[1],u=a/n,c=[0,0,0,0],l=c[0],h=c[1],d=c[2],f=c[3];return s/o<u?(l=0,h=0,d=Math.round(.5*(u*o-s)),f=Math.round(.5*(u*o-s))):(l=Math.round(.5*(1/u*s-o)),h=Math.round(.5*(1/u*s-o)),d=0,f=0),{resized:Object(r.tidy)((function(){var t=function(e){return e instanceof r.Tensor?e:r.browser.fromPixels(e)}(e);return(t=Object(r.pad3d)(t,[[l,h],[d,f],[0,0]])).resizeBilinear([n,a])})),padding:{top:l,left:d,right:f,bottom:h}}}function K(e,t,n,r,a){var i=t[0],o=t[1],s=n[0],u=n[1],c=function(e,t,n,r,a){return void 0===r&&(r=0),void 0===a&&(a=0),1===n&&1===t&&0===r&&0===a?e:e.map((function(e){return function(e,t,n,r,a){return void 0===r&&(r=0),void 0===a&&(a=0),{score:e.score,keypoints:e.keypoints.map((function(e){var i=e.score,o=e.part,s=e.position;return{score:i,part:o,position:{x:s.x*n+a,y:s.y*t+r}}}))}}(e,t,n,r,a)}))}(e,(i+r.top+r.bottom)/s,(o+r.left+r.right)/u,-r.top,-r.left);return a?function(e,t){return t<=0?e:e.map((function(e){return function(e,t){return{score:e.score,keypoints:e.keypoints.map((function(e){var n=e.score,r=e.part,a=e.position;return{score:n,part:r,position:{x:t-1-a.x,y:a.y}}}))}}(e,t)}))}(c,o):c}var Z={architecture:"MobileNetV1",outputStride:16,multiplier:.75,inputResolution:257},J=["MobileNetV1","ResNet50"],Q={MobileNetV1:[8,16,32],ResNet50:[32,16]},$={MobileNetV1:[.5,.75,1],ResNet50:[1]},ee=[1,2,4];var te={flipHorizontal:!1},ne={flipHorizontal:!1,maxDetections:5,scoreThreshold:.5,nmsRadius:20};var re=function(){function e(e,t){(function(e){r.util.assert("number"==typeof e,(function(){return"outputStride is not a number"})),r.util.assert(H.indexOf(e)>=0,(function(){return"outputStride of "+e+" is invalid. It must be either 8, 16, or 32"}))})(e.outputStride),function(e,t){r.util.assert("number"==typeof e[0]&&"number"==typeof e[1],(function(){return"both resolution values must be a number but had values "+e})),r.util.assert(q(e[0],t),(function(){return"height of "+e[0]+" is invalid for output stride "+t+"."})),r.util.assert(q(e[1],t),(function(){return"width of "+e[1]+" is invalid for output stride "+t+"."}))}(t,e.outputStride),this.baseModel=e,this.inputResolution=t}return e.prototype.estimateMultiplePoses=function(e,t){return void 0===t&&(t=ne),u(this,void 0,void 0,(function(){var n,r,a,i,o,u,l,h,d,f,p,m,v,g,b,y,x,w,O,k,S;return c(this,(function(c){switch(c.label){case 0:return n=s({},ne,t),function(e){var t=e.maxDetections,n=e.scoreThreshold,r=e.nmsRadius;if(t<=0)throw new Error("Invalid maxDetections "+t+". Should be > 0");if(n<0||n>1)throw new Error("Invalid scoreThreshold "+n+". Should be in range [0.0, 1.0]");if(r<=0)throw new Error("Invalid nmsRadius "+r+".")}(t),r=this.baseModel.outputStride,a=this.inputResolution,i=X(e),o=i[0],u=i[1],l=Y(e,a),h=l.resized,d=l.padding,f=this.baseModel.predict(h),p=f.heatmapScores,m=f.offsets,v=f.displacementFwd,g=f.displacementBwd,[4,U([p,m,v,g])];case 1:return b=c.sent(),y=b[0],x=b[1],w=b[2],O=b[3],[4,A(y,x,w,O,r,n.maxDetections,n.scoreThreshold,n.nmsRadius)];case 2:return k=c.sent(),S=K(k,[o,u],a,d,n.flipHorizontal),p.dispose(),m.dispose(),v.dispose(),g.dispose(),h.dispose(),[2,S]}}))}))},e.prototype.estimateSinglePose=function(e,t){return void 0===t&&(t=te),u(this,void 0,void 0,(function(){var n,r,a,i,o,u,l,h,d,f,p,m,v,g,b,y;return c(this,(function(c){switch(c.label){case 0:return n=s({},te,t),r=this.baseModel.outputStride,a=this.inputResolution,i=X(e),o=i[0],u=i[1],l=Y(e,a),h=l.resized,d=l.padding,f=this.baseModel.predict(h),p=f.heatmapScores,m=f.offsets,v=f.displacementFwd,g=f.displacementBwd,[4,L(p,m,r)];case 1:return b=c.sent(),y=K([b],[o,u],a,d,n.flipHorizontal),p.dispose(),m.dispose(),v.dispose(),g.dispose(),h.dispose(),[2,y[0]]}}))}))},e.prototype.estimatePoses=function(e,t){return u(this,void 0,void 0,(function(){return c(this,(function(n){switch(n.label){case 0:return"single-person"!==t.decodingMethod?[3,2]:[4,this.estimateSinglePose(e,t)];case 1:return[2,[n.sent()]];case 2:return[2,this.estimateMultiplePoses(e,t)]}}))}))},e.prototype.dispose=function(){this.baseModel.dispose()},e}();function ae(e){return u(this,void 0,void 0,(function(){var t,n,i,o,s,u,l;return c(this,(function(c){switch(c.label){case 0:if(t=e.outputStride,n=e.quantBytes,i=e.multiplier,null==r)throw new Error("Cannot find TensorFlow.js. If you are using a <script> tag, please also include @tensorflow/tfjs on the page before using this\n model.");return o=function(e,t,n){var r={1:"100",.75:"075",.5:"050"},a="model-stride"+e+".json";return 4===n?D+"float/"+r[t]+"/"+a:D+"quant"+n+"/"+r[t]+"/"+a}(t,i,n),[4,Object(a.a)(e.modelUrl||o)];case 1:return s=c.sent(),u=new h(s,t),l=G(e.inputResolution,u.outputStride),[2,new re(u,l)]}}))}))}function ie(e){return u(this,void 0,void 0,(function(){var t,n,i,o,s,u;return c(this,(function(c){switch(c.label){case 0:if(t=e.outputStride,n=e.quantBytes,null==r)throw new Error("Cannot find TensorFlow.js. If you are using a <script> tag, please also include @tensorflow/tfjs on the page before using this\n model.");return i=function(e,t){var n="model-stride"+e+".json";return 4===t?P+"float/"+n:P+"quant"+t+"/"+n}(t,n),[4,Object(a.a)(e.modelUrl||i)];case 1:return o=c.sent(),s=new F(o,t),u=G(e.inputResolution,s.outputStride),[2,new re(s,u)]}}))}))}function oe(e){return void 0===e&&(e=Z),u(this,void 0,void 0,(function(){return c(this,(function(t){return"ResNet50"===(e=function(e){if(null==(e=e||Z).architecture&&(e.architecture="MobileNetV1"),J.indexOf(e.architecture)<0)throw new Error("Invalid architecture "+e.architecture+". Should be one of "+J);if(null==e.inputResolution&&(e.inputResolution=257),V(e.inputResolution),null==e.outputStride&&(e.outputStride=16),Q[e.architecture].indexOf(e.outputStride)<0)throw new Error("Invalid outputStride "+e.outputStride+". Should be one of "+Q[e.architecture]+" for ar
2chitecutre "+e.architecture+".");if(null==e.multiplier&&(e.multiplier=1),$[e.architecture].indexOf(e.multiplier)<0)throw new Error("Invalid multiplier "+e.multiplier+". Should be one of "+$[e.architecture]+" for architecutre "+e.architecture+".");if(null==e.quantBytes&&(e.quantBytes=4),ee.indexOf(e.quantBytes)<0)throw new Error("Invalid quantBytes "+e.quantBytes+". Should be one of "+ee+" for architecutre "+e.architecture+".");return e}(e)).architecture?[2,ie(e)]:"MobileNetV1"===e.architecture?[2,ae(e)]:[2,null]}))}))}},function(e,t,n){"use strict";function r(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(10),a=n(7),i=n(2),o=n(33),s=n(9),u=n(14);var c=Object(s.b)({conv3DBackpropInput_:function(e,t,n,s,c){i.assert(e.length===t.rank,(function(){return"Length of inShape "+"(".concat(e.length,") and rank of dy (").concat(t.rank,") must match")}));var l=e,h=t,d=!1;4===t.rank&&(d=!0,h=Object(u.a)(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),l=[1,e[0],e[1],e[2],e[3]]);var f=l[4],p=h.shape[4];i.assert(5===l.length,(function(){return"Error in conv3dDerInput: inShape must be length 5, but got length "+"".concat(l.length,".")})),i.assert(5===h.rank,(function(){return"Error in conv3dDerInput: dy must be rank 5, but got "+"rank ".concat(h.rank)})),i.assert(5===n.rank,(function(){return"Error in conv3dDerInput: filter must be rank 5, but got "+"rank ".concat(n.rank)})),i.assert(f===n.shape[3],(function(){return"Error in conv3dDerInput: depth of input (".concat(f,") must ")+"match input depth for filter ".concat(n.shape[3],".")})),i.assert(p===n.shape[4],(function(){return"Error in conv3dDerInput: depth of output (".concat(p,") must ")+"match output depth for filter ".concat(n.shape[4],".")}));var m={dy:h},v={pad:c},g=r.a.runKernelFunc((function(e){var t=o.b(l,n.shape,s,1,c);return e.conv3dDerInput(h,n,t)}),m,null,a.F,v);return d?Object(u.a)(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(8),a=n(10),i=n(7),o=n(4),s=n(2),u=n(9),c=n(14);var l=Object(u.b)({resizeNearestNeighbor_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],u=Object(o.a)(e,"images","resizeNearestNeighbor");s.assert(3===u.rank||4===u.rank,(function(){return"Error in resizeNearestNeighbor: x must be rank 3 or 4, but got "+"rank ".concat(u.rank,".")})),s.assert(2===t.length,(function(){return"Error in resizeNearestNeighbor: new shape must 2D, but got shape "+"".concat(t,".")})),s.assert("float32"===u.dtype||"int32"===u.dtype,(function(){return"`images` must have `int32` or `float32` as dtype"}));var l=u,h=!1;3===u.rank&&(h=!0,l=Object(c.a)(u,[1,u.shape[0],u.shape[1],u.shape[2]]));var d=Object(r.a)(t,2),f=d[0],p=d[1],m={images:l},v={alignCorners:n,size:t},g=function(e,t){return t([l]),e.resizeNearestNeighbor(l,f,p,n)},b=a.a.runKernelFunc(g,m,null,i.jc,v);return h?Object(c.a)(b,[b.shape[1],b.shape[2],b.shape[3]]):b}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(8),a=n(10),i=n(7),o=n(4),s=n(2),u=n(9),c=n(14);var l=Object(u.b)({resizeBilinear_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],u=Object(o.a)(e,"images","resizeBilinear");s.assert(3===u.rank||4===u.rank,(function(){return"Error in resizeBilinear: x must be rank 3 or 4, but got "+"rank ".concat(u.rank,".")})),s.assert(2===t.length,(function(){return"Error in resizeBilinear: new shape must 2D, but got shape "+"".concat(t,".")}));var l=u,h=!1;3===u.rank&&(h=!0,l=Object(c.a)(u,[1,u.shape[0],u.shape[1],u.shape[2]]));var d=Object(r.a)(t,2),f=d[0],p=d[1],m=function(e,t){return t([l]),e.resizeBilinear(l,f,p,n)},v={images:l},g={alignCorners:n,size:t},b=a.a.runKernelFunc(m,v,null,i.hc,g);return h?Object(c.a)(b,[b.shape[1],b.shape[2],b.shape[3]]):b}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(9),o=n(14);var s=Object(i.b)({depthwiseConv2dNativeBackpropInput_:function(e,t,n,i){var s=t,u=!1;3===t.rank&&(u=!0,s=Object(o.a)(t,[1,t.shape[0],t.shape[1],t.shape[2]]));var c={dy:s},l=r.a.runKernelFunc((function(e){return e.depthwiseConv2DDerInput(s,n,i)}),c,null,a.N);return u?Object(o.a)(l,[l.shape[1],l.shape[2],l.shape[3]]):l}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(9),o=n(14);var s=Object(i.b)({depthwiseConv2dNativeBackpropFilter_:function(e,t,n,i){var s=e;3===e.rank&&(s=Object(o.a)(e,[1,e.shape[0],e.shape[1],e.shape[2]]));var u=t;3===u.rank&&(u=Object(o.a)(t,[1,t.shape[0],t.shape[1],t.shape[2]]));var c={x:s,dy:u};return r.a.runKernelFunc((function(e){return e.depthwiseConv2DDerFilter(s,u,i)}),c,null,a.M)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(1),a=n(118),i=!0,o=!1,s=null,u={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function c(e){e.metaKey||e.altKey||e.ctrlKey||(i=!0)}function l(){i=!1}function h(){"hidden"===this.visibilityState&&o&&(i=!0)}function d(e){var t=e.target;try{return t.matches(":focus-visible")}catch(n){}return i||function(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!u[t]||e.readOnly)||("TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable)}(t)}function f(){o=!0,window.clearTimeout(s),s=window.setTimeout((function(){o=!1}
2),100)}function p(){return{isFocusVisible:d,onBlurVisible:f,ref:r.useCallback((function(e){var t,n=a.findDOMNode(e);null!=n&&((t=n.ownerDocument).addEventListener("keydown",c,!0),t.addEventListener("mousedown",l,!0),t.addEventListener("pointerdown",l,!0),t.addEventListener("touchstart",l,!0),t.addEventListener("visibilitychange",h,!0))}),[])}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(179);function a(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";var r=n(93);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(1)),i=(0,r(n(97)).default)(a.default.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft");t.default=i},function(e,t,n){"use strict";var r=n(93);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(1)),i=(0,r(n(97)).default)(a.default.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");t.default=i},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(1);function a(e){var t=e.controlled,n=e.default,a=(e.name,e.state,r.useRef(void 0!==t).current),i=r.useState(n),o=i[0],s=i[1];return[a?t:o,r.useCallback((function(e){a||s(e)}),[])]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(396),a=(n(1),n(233));function i(){return Object(r.a)()||a.a}},function(e,t,n){"use strict";var r=n(93);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(1)),i=(0,r(n(97)).default)(a.default.createElement("path",{d:"M8 6h8c1.1 0 2 .9 2 2v8c0 1.1-.9 2-2 2H8c-1.1 0-2-.9-2-2V8c0-1.1.9-2 2-2z"}),"StopRounded");t.default=i},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=n(46),i=n(413),o=n(21),s=["xs","sm","md","lg","xl"];function u(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,r=e.unit,i=void 0===r?"px":r,u=e.step,c=void 0===u?5:u,l=Object(a.a)(e,["values","unit","step"]);function h(e){var t="number"===typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(i,")")}function d(e,t){var r=s.indexOf(t);return r===s.length-1?h(e):"@media (min-width:".concat("number"===typeof n[e]?n[e]:e).concat(i,") and ")+"(max-width:".concat((-1!==r&&"number"===typeof n[s[r+1]]?n[s[r+1]]:t)-c/100).concat(i,")")}return Object(o.a)({keys:s,values:n,up:h,down:function(e){var t=s.indexOf(e)+1,r=n[s[t]];return t===s.length?h("xs"):"@media (max-width:".concat(("number"===typeof r&&t>0?r:e)-c/100).concat(i,")")},between:d,only:function(e){return d(e,e)},width:function(e){return n[e]}},l)}function c(e,t,n){var a;return Object(o.a)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(o.a)({paddingLeft:t(2),paddingRight:t(2)},n,r({},e.up("sm"),Object(o.a)({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(a={minHeight:56},r(a,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),r(a,e.up("sm"),{minHeight:64}),a)},n)}var l=n(329),h={black:"#000",white:"#fff"},d={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},f={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},p={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},m={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},v={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},g={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},b={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},y=n(50),x={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:h.white,default:d[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackgroun
2d:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},w={text:{primary:h.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:d[800],default:"#303030"},action:{active:h.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function O(e,t,n,r){var a=r.light||r,i=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=Object(y.d)(e.main,a):"dark"===t&&(e.dark=Object(y.a)(e.main,i)))}function k(e){var t=e.primary,n=void 0===t?{light:f[300],main:f[500],dark:f[700]}:t,r=e.secondary,s=void 0===r?{light:p.A200,main:p.A400,dark:p.A700}:r,u=e.error,c=void 0===u?{light:m[300],main:m[500],dark:m[700]}:u,k=e.warning,S=void 0===k?{light:v[300],main:v[500],dark:v[700]}:k,_=e.info,j=void 0===_?{light:g[300],main:g[500],dark:g[700]}:_,E=e.success,T=void 0===E?{light:b[300],main:b[500],dark:b[700]}:E,C=e.type,M=void 0===C?"light":C,A=e.contrastThreshold,N=void 0===A?3:A,R=e.tonalOffset,I=void 0===R?.2:R,L=Object(a.a)(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function D(e){return Object(y.c)(e,w.text.primary)>=N?w.text.primary:x.text.primary}var P=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=Object(o.a)({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(Object(l.a)(4,t));if("string"!==typeof e.main)throw new Error(Object(l.a)(5,JSON.stringify(e.main)));return O(e,"light",n,I),O(e,"dark",r,I),e.contrastText||(e.contrastText=D(e.main)),e},z={dark:w,light:x};return Object(i.a)(Object(o.a)({common:h,type:M,primary:P(n),secondary:P(s,"A400","A200","A700"),error:P(c),warning:P(S),info:P(j),success:P(T),grey:d,contrastThreshold:N,getContrastText:D,augmentColor:P,tonalOffset:I},z[M]),L)}function S(e){return Math.round(1e5*e)/1e5}var _={textTransform:"uppercase"};function j(e,t){var n="function"===typeof t?t(e):t,r=n.fontFamily,s=void 0===r?'"Roboto", "Helvetica", "Arial", sans-serif':r,u=n.fontSize,c=void 0===u?14:u,l=n.fontWeightLight,h=void 0===l?300:l,d=n.fontWeightRegular,f=void 0===d?400:d,p=n.fontWeightMedium,m=void 0===p?500:p,v=n.fontWeightBold,g=void 0===v?700:v,b=n.htmlFontSize,y=void 0===b?16:b,x=n.allVariants,w=n.pxToRem,O=Object(a.a)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var k=c/14,j=w||function(e){return"".concat(e/y*k,"rem")},E=function(e,t,n,r,a){return Object(o.a)({fontFamily:s,fontWeight:e,fontSize:j(t),lineHeight:n},'"Roboto", "Helvetica", "Arial", sans-serif'===s?{letterSpacing:"".concat(S(r/t),"em")}:{},a,x)},T={h1:E(h,96,1.167,-1.5),h2:E(h,60,1.2,-.5),h3:E(f,48,1.167,0),h4:E(f,34,1.235,.25),h5:E(f,24,1.334,0),h6:E(m,20,1.6,.15),subtitle1:E(f,16,1.75,.15),subtitle2:E(m,14,1.57,.1),body1:E(f,16,1.5,.15),body2:E(f,14,1.43,.15),button:E(m,14,1.75,.4,_),caption:E(f,12,1.66,.4),overline:E(f,12,2.66,1,_)};return Object(i.a)(Object(o.a)({htmlFontSize:y,pxToRem:j,round:S,fontFamily:s,fontSize:c,fontWeightLight:h,fontWeightRegular:f,fontWeightMedium:m,fontWeightBold:g},T),O,{clone:!1})}function E(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var T=["none",E(0,2,1,-1,0,1,1,0,0,1,3,0),E(0,3,1,-2,0,2,2,0,0,1,5,0),E(0,3,3,-2,0,3,4,0,0,1,8,0),E(0,2,4,-1,0,4,5,0,0,1,10,0),E(0,3,5,-1,0,5,8,0,0,1,14,0),E(0,3,5,-1,0,6,10,0,0,1,18,0),E(0,4,5,-2,0,7,10,1,0,2,16,1),E(0,5,5,-3,0,8,10,1,0,3,14,2),E(0,5,6,-3,0,9,12,1,0,3,16,2),E(0,6,6,-3,0,10,14,1,0,4,18,3),E(0,6,7,-4,0,11,15,1,0,4,20,3),E(0,7,8,-4,0,12,17,2,0,5,22,4),E(0,7,8,-4,0,13,19,2,0,5,24,4),E(0,7,9,-4,0,14,21,2,0,5,26,4),E(0,8,9,-5,0,15,22,2,0,6,28,5),E(0,8,10,-5,0,16,24,2,0,6,30,5),E(0,8,11,-5,0,17,26,2,0,6,32,5),E(0,9,11,-5,0,18,28,2,0,7,34,6),E(0,9,12,-6,0,19,29,2,0,7,36,6
2),E(0,10,13,-6,0,20,31,3,0,8,38,7),E(0,10,13,-6,0,21,33,3,0,8,40,7),E(0,10,14,-6,0,22,35,3,0,8,42,7),E(0,11,14,-7,0,23,36,3,0,9,44,8),E(0,11,15,-7,0,24,38,3,0,9,46,8)],C={borderRadius:4},M=n(166),A=(n(108),n(173));n(54);var N=function(e,t){return t?Object(i.a)(e,t,{clone:!1}):e},R={xs:0,sm:600,md:960,lg:1280,xl:1920},I={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(R[e],"px)")}};var L={m:"margin",p:"padding"},D={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},P={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},z=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){if(e.length>2){if(!P[e])return[e];e=P[e]}var t=e.split(""),n=Object(M.a)(t,2),r=n[0],a=n[1],i=L[r],o=D[a]||"";return Array.isArray(o)?o.map((function(e){return i+e})):[i+o]})),F=["m","mt","mr","mb","ml","mx","my","p","pt","pr","pb","pl","px","py","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY"];function B(e){var t=e.spacing||8;return"number"===typeof t?function(e){return t*e}:Array.isArray(t)?function(e){return t[e]}:"function"===typeof t?t:function(){}}function U(e,t){return function(n){return e.reduce((function(e,r){return e[r]=function(e,t){if("string"===typeof t)return t;var n=e(Math.abs(t));return t>=0?n:"number"===typeof n?-n:"-".concat(n)}(t,n),e}),{})}}function W(e){var t=B(e.theme);return Object.keys(e).map((function(n){if(-1===F.indexOf(n))return null;var r=U(z(n),t),a=e[n];return function(e,t,n){if(Array.isArray(t)){var r=e.theme.breakpoints||I;return t.reduce((function(e,a,i){return e[r.up(r.keys[i])]=n(t[i]),e}),{})}if("object"===Object(A.a)(t)){var a=e.theme.breakpoints||I;return Object.keys(t).reduce((function(e,r){return e[a.up(r)]=n(t[r]),e}),{})}return n(t)}(e,a,r)})).reduce(N,{})}W.propTypes={},W.filterProps=F;function V(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=B({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return 0===n.length?t(1):1===n.length?t(n[0]):n.map((function(e){if("string"===typeof e)return e;var n=t(e);return"number"===typeof n?"".concat(n,"px"):n})).join(" ")};return Object.defineProperty(n,"unit",{get:function(){return e}}),n.mui=!0,n}var G={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},H={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function q(e){return"".concat(Math.round(e),"ms")}var X={easing:G,duration:H,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,r=void 0===n?H.standard:n,i=t.easing,o=void 0===i?G.easeInOut:i,s=t.delay,u=void 0===s?0:s;Object(a.a)(t,["duration","easing","delay"]);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"===typeof r?r:q(r)," ").concat(o," ").concat("string"===typeof u?u:q(u))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}},Y={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};var K=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,o=void 0===r?{}:r,s=e.palette,l=void 0===s?{}:s,h=e.spacing,d=e.typography,f=void 0===d?{}:d,p=Object(a.a)(e,["breakpoints","mixins","palette","spacing","typography"]),m=k(l),v=u(n),g=V(h),b=Object(i.a)({breakpoints:v,direction:"ltr",mixins:c(v,g,o),overrides:{},palette:m,props:{},shadows:T,typography:j(m,f),spacing:g,shape:C,transitions:X,zIndex:Y},p),y=arguments.length,x=new Array(y>1?y-1:0),w=1;w<y;w++)x[w-1]=arguments[w];return b=x.reduce((function(e,t){return Object(i.a)(e,t)}),b)}();t.a=K},function(e,t,n){"use strict";function r(e){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,"a",(function(){return i}));var a=n(57);function i(e,t){return!t||"object"!==r(t)&&"function"!==typeof t?Object(a.a)(e):t}},function(e,t,n){(function(e){var r="undefined"!==typeof e&&e||"undefined"!==typeof self&&self||window,a=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(a.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(a.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(360),t.setImmediate="undefined"!==typeof self&&self.setImmediate||"undefined"!==typeof e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!==typeof self&&self.clearImmediate||"undefined"!==typeof e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(112))},function(e,t,n){(t=e.exports=n(291)).Stream=t,t.Readable=t,t.Writable=n(238),t.Duplex=n(132),t.Transform=n(295),t.PassThrough=n(381)},function(e,t,n){var r=n(116),a=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return a(e,t,n)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=o),i(a,o),o.from=function(e,t,n){if("number"===typeof e)throw new TypeError("Argument must not be a number");return a(e,t,n)},o.alloc=function(e,t,n){if("number"!==typeof e)throw new TypeError("Argument must be a number");var r=a(e);return void 0!==t?"string"===typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return a(e)},o.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){"use strict";(function(t,r,a){var i=n(183);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var a=r.callback;t.pendingcb--,a(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}
vendor: 4,690 bytes, line 2
2e.exports=b;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:i.nextTick;b.WritableState=g;var c=Object.create(n(169));c.inherits=n(141);var l={deprecate:n(379)},h=n(292),d=n(237).Buffer,f=a.Uint8Array||function(){};var p,m=n(293);function v(){}function g(e,t){s=s||n(132),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var a=e.highWaterMark,c=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:r&&(c||0===c)?c:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===e.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,a=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,a){--t.pendingcb,n?(i.nextTick(a,r),i.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(a(r),e._writableState.errorEmitted=!0,e.emit("error",r),S(e,t))}(e,n,r,t,a);else{var o=O(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||w(e,n),r?u(x,e,n,o,a):x(e,n,o,a)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function b(e){if(s=s||n(132),!p.call(b,this)&&!(this instanceof s))return new b(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"===typeof e.write&&(this._write=e.write),"function"===typeof e.writev&&(this._writev=e.writev),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.final&&(this._final=e.final)),h.call(this)}function y(e,t,n,r,a,i,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,n?e._writev(a,t.onwrite):e._write(a,i,t.onwrite),t.sync=!1}function x(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),S(e,t)}function w(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,a=new Array(r),i=t.corkedRequestsFree;i.entry=n;for(var s=0,u=!0;n;)a[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;a.allBuffers=u,y(e,t,!0,t.length,a,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,h=n.callback;if(y(e,t,!1,t.objectMode?1:c.length,c,l,h),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function O(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),S(e,t)}))}function S(e,t){var n=O(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"===typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(k,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}c.inherits(b,h),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:l.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"===typeof Symbol&&Symbol.hasInstance&&"function"===typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===b&&(e&&e._writableState instanceof g)}})):p=function(e){return e instanceof this},b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},b.prototype.write=function(e,t,n){var r,a=this._writableState,o=!1,s=!a.objectMode&&(r=e,d.isBuffer(r)||r instanceof f);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"===typeof t&&(n=t,t=null),s?t="buffer":t||(t=a.defaultEncoding),"function"!==typeof n&&(n=v),a.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),i.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var a=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"===typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),i.nextTick(r,o),a=!1),a}
2(this,a,e,n))&&(a.pendingcb++,o=function(e,t,n,r,a,i){if(!n){var o=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!==typeof t||(t=d.from(t,n));return t}(t,r,a);r!==o&&(n=!0,a="buffer",r=o)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:a,isBuf:n,callback:i,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else y(e,t,!1,s,r,a,i);return u}(this,a,s,e,t,n)),o},b.prototype.cork=function(){this._writableState.corked++},b.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||w(this,e))},b.prototype.setDefaultEncoding=function(e){if("string"===typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(e,t,n){var r=this._writableState;"function"===typeof e?(n=e,e=null,t=null):"function"===typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,S(e,t),n&&(t.finished?i.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),b.prototype.destroy=m.destroy,b.prototype._undestroy=m.undestroy,b.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(115),n(235).setImmediate,n(112))},function(e,t,n){"use strict";(function(e,r){var a,i=n(297);a="undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof e?e:r;var o=Object(i.a)(a);t.a=o}).call(this,n(112),n(344)(e))},function(e,t,n){var r;!function(a,i,o,s){"use strict";var u,c=["","webkit","Moz","MS","ms","o"],l=i.createElement("div"),h=Math.round,d=Math.abs,f=Date.now;function p(e,t,n){return setTimeout(w(e,n),t)}function m(e,t,n){return!!Array.isArray(e)&&(v(e,n[t],n),!0)}function v(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(void 0!==e.length)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function g(e,t,n){var r="DEPRECATED METHOD: "+t+"\n"+n+" AT \n";return function(){var t=new Error("get-stack-trace"),n=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",i=a.console&&(a.console.warn||a.console.log);return i&&i.call(a.console,r,n),e.apply(this,arguments)}}u="function"!==typeof Object.assign?function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(void 0!==r&&null!==r)for(var a in r)r.hasOwnProperty(a)&&(t[a]=r[a])}return t}:Object.assign;var b=g((function(e,t,n){for(var r=Object.keys(t),a=0;a<r.length;)(!n||n&&void 0===e[r[a]])&&(e[r[a]]=t[r[a]]),a++;return e}),"extend","Use `assign`."),y=g((function(e,t){return b(e,t,!0)}),"merge","Use `assign`.");function x(e,t,n){var r,a=t.prototype;(r=e.prototype=Object.create(a)).constructor=e,r._super=a,n&&u(r,n)}function w(e,t){return function(){return e.apply(t,arguments)}}function O(e,t){return"function"==typeof e?e.apply(t&&t[0]||void 0,t):e}function k(e,t){return void 0===e?t:e}function S(e,t,n){v(T(t),(function(t){e.addEventListener(t,n,!1)}))}function _(e,t,n){v(T(t),(function(t){e.removeEventListener(t,n,!1)}))}function j(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function E(e,t){return e.indexOf(t)>-1}function T(e){return e.trim().split(/\s+/g)}
vendor: 18,341 bytes, line 2
2function C(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function M(e){return Array.prototype.slice.call(e,0)}function A(e,t,n){for(var r=[],a=[],i=0;i<e.length;){var o=t?e[i][t]:e[i];C(a,o)<0&&r.push(e[i]),a[i]=o,i++}return n&&(r=t?r.sort((function(e,n){return e[t]>n[t]})):r.sort()),r}function N(e,t){for(var n,r,a=t[0].toUpperCase()+t.slice(1),i=0;i<c.length;){if((r=(n=c[i])?n+a:t)in e)return r;i++}}var R=1;function I(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||a}var L="ontouchstart"in a,D=void 0!==N(a,"PointerEvent"),P=L&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),z=["x","y"],F=["clientX","clientY"];function B(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){O(e.options.enable,[e])&&n.handler(t)},this.init()}function U(e,t,n){var r=n.pointers.length,a=n.changedPointers.length,i=1&t&&r-a===0,o=12&t&&r-a===0;n.isFirst=!!i,n.isFinal=!!o,i&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,a=r.length;n.firstInput||(n.firstInput=W(t));a>1&&!n.firstMultiple?n.firstMultiple=W(t):1===a&&(n.firstMultiple=!1);var i=n.firstInput,o=n.firstMultiple,s=o?o.center:i.center,u=t.center=V(r);t.timeStamp=f(),t.deltaTime=t.timeStamp-i.timeStamp,t.angle=X(s,u),t.distance=q(s,u),function(e,t){var n=t.center,r=e.offsetDelta||{},a=e.prevDelta||{},i=e.prevInput||{};1!==t.eventType&&4!==i.eventType||(a=e.prevDelta={x:i.deltaX||0,y:i.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y});t.deltaX=a.x+(n.x-r.x),t.deltaY=a.y+(n.y-r.y)}(n,t),t.offsetDirection=H(t.deltaX,t.deltaY);var c=G(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=c.x,t.overallVelocityY=c.y,t.overallVelocity=d(c.x)>d(c.y)?c.x:c.y,t.scale=o?(l=o.pointers,h=r,q(h[0],h[1],F)/q(l[0],l[1],F)):1,t.rotation=o?function(e,t){return X(t[1],t[0],F)+X(e[1],e[0],F)}(o.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,a,i,o=e.lastInterval||t,s=t.timeStamp-o.timeStamp;if(8!=t.eventType&&(s>25||void 0===o.velocity)){var u=t.deltaX-o.deltaX,c=t.deltaY-o.deltaY,l=G(s,u,c);r=l.x,a=l.y,n=d(l.x)>d(l.y)?l.x:l.y,i=H(u,c),e.lastInterval=t}else n=o.velocity,r=o.velocityX,a=o.velocityY,i=o.direction;t.velocity=n,t.velocityX=r,t.velocityY=a,t.direction=i}(n,t);var l,h;var p=e.element;j(t.srcEvent.target,p)&&(p=t.srcEvent.target);t.target=p}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function W(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:h(e.pointers[n].clientX),clientY:h(e.pointers[n].clientY)},n++;return{timeStamp:f(),pointers:t,center:V(t),deltaX:e.deltaX,deltaY:e.deltaY}}function V(e){var t=e.length;if(1===t)return{x:h(e[0].clientX),y:h(e[0].clientY)};for(var n=0,r=0,a=0;a<t;)n+=e[a].clientX,r+=e[a].clientY,a++;return{x:h(n/t),y:h(r/t)}}function G(e,t,n){return{x:t/e||0,y:n/e||0}}function H(e,t){return e===t?1:d(e)>=d(t)?e<0?2:4:t<0?8:16}function q(e,t,n){n||(n=z);var r=t[n[0]]-e[n[0]],a=t[n[1]]-e[n[1]];return Math.sqrt(r*r+a*a)}function X(e,t,n){n||(n=z);var r=t[n[0]]-e[n[0]],a=t[n[1]]-e[n[1]];return 180*Math.atan2(a,r)/Math.PI}B.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(I(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&_(this.element,this.evEl,this.domHandler),this.evTarget&&_(this.target,this.evTarget,this.domHandler),this.evWin&&_(I(this.element),this.evWin,this.domHandler)}};var Y={mousedown:1,mousemove:2,mouseup:4};function K(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,B.apply(this,arguments)}x(K,B,{handler:function(e){var t=Y[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},J={2:"touch",3:"pen",4:"mouse",5:"kinect"},Q="pointerdown",$="pointermove pointerup pointercancel";function ee(){this.evEl=Q,this.evWin=$,B.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}a.MSPointerEvent&&!a.PointerEvent&&(Q="MSPointerDown",$="MSPointerMove MSPointerUp MSPointerCancel"),x(ee,B,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),a=Z[r],i=J[e.pointerType]||e.pointerType,o="touch"==i,s=C(t,e.pointerId,"pointerId");1&a&&(0===e.button||o)?s<0&&(t.push(e),s=t.length-1):12&a&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,a,{pointers:t,changedPointers:[e],pointerType:i,srcEvent:e}),n&&t.splice(s,1))}});var te={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ne(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,B.apply(this,arguments)}function re(e,t){var n=M(e.touches),r=M(e.changedTouches);return 12&t&&(n=A(n.concat(r),"identifier",!0)),[n,r]}x(ne,B,{handler:function(e){var t=te[e.type];if(1===t&&(this.started=!0),this.started){var n=re.call(this,e,t);12&t&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:e})}}});var ae={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ie(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},B.apply(this,arguments)}function oe(e,t){var n=M(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var a,i,o=M(e.changedTouches),s=[],u=this.target;if(i=n.filter((function(e){return j(e.target,u)})),1===t)for(a=0;a<i.length;)r[i[a].identifier]=!0,a++;for(a=0;a<o.length;)r[o[a].identifier]&&s.push(o[a]),12&t&&delete r[o[a].identifier],a++;return s.length?[A(i.concat(s),"identifier",!0),s]:void 0}x(ie,B,{handler:function(e){var t=ae[e.type],n=oe.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:e})}});function se(){B.apply(this,arguments);var e=w(this.handler,this);this.touch=new ie(this.manager,e),this.mouse=new K(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function ue(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,ce.call(this,t)):12&e&&ce.call(this,t)}function ce(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)}),2500)}}function le(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var a=this.lastTouches[r],i=Math.abs(t-a.x),o=Math.abs(n-a.y);if(i<=25&&o<=25)return!0}return!1}x(se,B,{handler:function(e,t,n){var r="touch"==n.pointerType,a="mouse"==n.pointerType;if(!(a&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)ue.call(this,t,n);else if(a&&le.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var he=N(l.style,"touchAction"),de=void 0!==he,fe=function(){if(!de)return!1;var e={},t=a.CSS&&a.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){e[n]=!t||a.CSS.supports("touch-action",n)})),e}();function pe(e,t){this.manager=e,this.set(t)}pe.prototype={set:function(e){"compute"==e&&(e=this.compute()),de&&this.manager.element.style&&fe[e]&&(this.manager.element.style[he]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return v(this.manager.recognizers,(function(t){O(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(E(e,"none"))return"none";var t=E(e,"pan-x"),n=E(e,"pan-y");if(t&&n)return"none";if(t||n)return t?"pan-x":"pan-y";if(E(e,"manipulation"))return"manipulation";return"auto"}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,a=E(r,"none")&&!fe.none,i=E(r,"pan-y")&&!fe["pan-y"],o=E(r,"pan-x")&&!fe["pan-x"];if(a){var s=1===e.pointers.length,u=e.distance<2,c=e.deltaTime<250;if(s&&u&&c)return}if(!o||!i)return a||i&&6&n||o&&24&n?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};function me(e){this.options=u({},this.defaults,e||{}),this.id=R++,this.manager=null,this.options.enable=k(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function ve(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function ge(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function be(e,t){var n=t.manager;return n?n.get(e):e}function ye(){me.apply(this,arguments)}function xe(){ye.apply(this,arguments),this.pX=null,this.pY=null}function we(){ye.apply(this,arguments)}function Oe(){me.apply(this,arguments),this._timer=null,this._input=null}function ke(){ye.apply(this,arguments)}function Se(){ye.apply(this,arguments)}function _e(){me.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function je(e,t){return(t=t||{}).recognizers=k(t.recognizers,je.defaults.preset),new Ee(e,t)}me.prototype={defaults:{},set:function(e){return u(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(m(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=be(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return m(e,"dropRecognizeWith",this)||(e=be(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(m(e,"requireFailure",this))return this;var t=this.requireFail;return-1===C(t,e=be(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(m(e,"dropRequireFailure",this))return this;e=be(e,this);var t=C(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+ve(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+ve(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=32},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=u({},e);if(!O(this.options.enable,[this,t]))return this.reset(),void(this.state=32);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},x(ye,me,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,a=this.attrTest(e);return r&&(8&n||!a)?16|t:r||a?4&n?8|t:2&t?4|t:2:32}}),x(xe,ye,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push("pan-y"),24&e&&t.push("pan-x"),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,a=e.direction,i=e.deltaX,o=e.deltaY;return a&t.direction||(6&t.direction?(a=0===i?1:i<0?2:4,n=i!=this.pX,r=Math.abs(e.deltaX)):(a=0===o?1:o<0?8:16,n=o!=this.pY,r=Math.abs(e.deltaY))),e.direction=a,n&&r>t.threshold&&a&t.direction},attrTest:function(e){return ye.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=ge(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),x(we,ye,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),x(Oe,me,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,a=e.deltaTime>t.time;if(this._input=e,!r||!n||12&e.eventType&&!a)this.reset();else if(1&e.eventType)this.reset(),this._timer=p((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}}),x(ke,ye,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),x(Se,ye,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return xe.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:24&n&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&d(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=ge(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),x(_e,me,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return["manipulation"]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,a=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(r&&a&&n){if(4!=e.eventType)return this.failTimeout();var i=!this.pTime||e.timeStamp-this.pTime<t.interval,o=!this.pCenter||q(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,o&&i?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=p((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return 32},failTimeout:function(){return this._timer=p((function(){this.state=32}),this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),je.VERSION="2.0.7",je.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[ke,{enable:!1}],[we,{enable:!1},["rotate"]],[Se,{direction:6}],[xe,{direction:6},["swipe"]],[_e],[_e,{event:"doubletap",taps:2},["tap"]],[Oe]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Ee(e,t){this.options=u({},je.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=function(e){var t=e.options.inputClass;return new(t||(D?ee:P?ie:L?se:K))(e,U)}(this),this.touchAction=new pe(this,this.options.touchAction),Te(this,!0),v(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Te(e,t){var n,r=e.element;r.style&&(v(e.options.cssProps,(function(a,i){n=N(r.style,i),t?(e.oldCssProps[n]=r.style[n],r.style[n]=a):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}Ee.prototype={set:function(e){return u(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,a=t.curRecognizer;(!a||a&&8&a.state)&&(a=t.curRecognizer=null);for(var i=0;i<r.length;)n=r[i],2===t.stopped||a&&n!=a&&!n.canRecognizeWith(a)?n.reset():n.recognize(e),!a&&14&n.state&&(a=t.curRecognizer=n),i++}},get:function(e){if(e instanceof me)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(m(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(m(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=C(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(void 0!==e&&void 0!==t){var n=this.handlers;return v(T(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(void 0!==e){var n=this.handlers;return v(T(e),(function(e){t?n[e]&&n[e].splice(C(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var n=i.createEvent("Event");n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},destroy:function(){this.element&&Te(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},u(je,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:32,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:Ee,Input:B,TouchAction:pe,TouchInput:ie,MouseInput:K,PointerEventInput:ee,TouchMouseInput:se,SingleTouchInput:ne,Recognizer:me,AttrRecognizer:ye,Tap:_e,Pan:xe,Swipe:Se,Pinch:we,Rotate:ke,Press:Oe,on:S,off:_,each:v,merge:y,extend:b,assign:u,inherit:x,bindFn:w,prefixed:N}),("undefined"!==typeof a?a:"undefined"!==typeof self?self:{}).Hammer=je,void 0===(r=function(){return je}.call(t,n,t,e))||(e.exports=r)}(window,document)},function(e,t,n){"use strict";var r=n(93);
2Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(1)),i=(0,r(n(97)).default)(a.default.createElement("circle",{cx:"12",cy:"12",r:"8"}),"FiberManualRecord");t.default=i},function(e,t,n){"use strict";var r=n(93);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(1)),i=(0,r(n(97)).default)(a.default.createElement("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"}),"Replay");t.default=i},function(e,t,n){"use strict";var r=n(93);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(1)),i=(0,r(n(97)).default)(a.default.createElement("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"}),"GetApp");t.default=i},function(e,t,n){"use strict";var r=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,a=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){return r.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));t.a=a},,,,function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;
2if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(a){return!1}}()?Object.assign:function(e,t){for(var n,s,u=o(e),c=1;c<arguments.length;c++){for(var l in n=Object(arguments[c]))a.call(n,l)&&(u[l]=n[l]);if(r){s=r(n);for(var h=0;h<s.length;h++)i.call(n,s[h])&&(u[s[h]]=n[s[h]])}}return u}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({acos_:function(e){var t=Object(i.a)(e,"x","acos"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.acos(t);return n([t]),r}),n,null,a.b)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({acosh_:function(e){var t=Object(i.a)(e,"x","acosh"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.acosh(t);return n([t]),r}),n,null,a.c)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(9);var u=Object(s.b)({addN_:function(e){o.assert(Array.isArray(e),(function(){return"The argument passed to tf.addN() must be a list of tensors"})),o.assert(e.length>=1,(function(){return"Must pass at least one tensor to tf.addN(), but got "+"".concat(e.length)}));var t=e.map((function(e,t){return Object(i.a)(e,"tensors".concat(t),"addN")})),n=t[0];t.forEach((function(e){if(e.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")})),t.forEach((function(e){if(!o.arraysEqual(e.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")}));var s=t;return r.a.runKernelFunc((function(e,n){var r=e.addN(t);return n(t),r}),s,null,a.e)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({asin_:function(e){var t=Object(i.a)(e,"x","asin"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.asin(t);return n([t]),r}),n,null,a.j)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({asinh_:function(e){var t=Object(i.a)(e,"x","asinh"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.asinh(t);return n([t]),r}),n,null,a.k)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({atan_:function(e){var t=Object(i.a)(e,"x","atan"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.atan(t);return n([t]),r}),n,null,a.l)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({atanh_:function(e){var t=Object(i.a)(e,"x","atanh"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.atanh(t);return n([t]),r}),n,null,a.n)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(10),a=n(32),i=n(7),o=n(4),s=n(2),u=n(20),c=n(33),l=n(9),h=n(14);var d=Object(l.b)({avgPool3d_:function(e,t,n,l,d){var f=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"NDHWC",p=arguments.length>6?arguments[6]:void 0;null==p?p=[1,1,1]:Object(a.b)("dilations is deprecated, this field will be gone in v3.0.0.");var m=Object(o.a)(e,"x","avgPool3d","float32"),v=m,g=!1;4===m.rank&&(g=!0,v=Object(h.a)(m,[1,m.shape[0],m.shape[1],m.shape[2],m.shape[3]])),s.assert(5===v.rank,(function(){return"Error in avgPool3d: x must be rank 5 but got rank ".concat(v.rank,".")})),s.assert("NDHWC"===f,(function(){return"Error in avgPool3d: Only NDHWC is currently supported, "+"but got dataFormat of ".concat(f)})),s.assert(c.h(n,p),(function(){return"Error in avgPool3d: Either strides or dilations must be 1. "+"Got strides ".concat(n," and dilations '").concat(p,"'")})),null!=d&&s.assert(s.isInt(l),(function(){return"Error in avgPool3d: pad must be an integer when using, "+"dimRoundingMode ".concat(d," but got pad ").concat(l,".")}));var b=function(e,r){null==p&&(p=[1,1,1]);var a=c.f(v.shape,t,n,p,l,d,f);return r([v]),e.avgPool3d(v,a)},y={x:v},x={filterSize:t,strides:n,pad:l,dimRoundingMode:d,dataFormat:f,dilations:p},w=r.a.runKernelFunc(b,y,null,i.p,x);return w=Object(u.a)(w,v.dtype),g?Object(h.a)(w,[w.shape[1],w.shape[2],w.shape[3],w.shape[4]]):w}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({ceil_:function(e){var t=Object(i.a)(e,"x","ceil"),n={x:t};return r.a.runKernelFunc((function(e){return e.ceil(t)}),n,null,a.w)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(9);var u=Object(s.b)({clipByValue_:function(e,t,n){var s=Object(i.a)(e,"x","clipByValue");o.assert(t<=n,(function(){return"Error in clip: min (".concat(t,") must be ")+"less than or equal to max (".concat(n,").")}));var u={x:s},c={clipValueMin:t,clipValueMax:n};return r.a.runKernelFunc((function(e,r){var a=e.clip(s,t,n);return r([s]),a}),u,null,a.x,c)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(33),u=n(9),c=n(14);var l=Object(u.b)({conv3d_:function(e,t,n,u){var l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"NDHWC",h=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[1,1,1],d=Object(i.a)(e,"x","conv3d"),f=Object(i.a)(t,"filter","conv3d"),p=d,m=!1;4===d.rank&&(m=!0,p=Object(c.a)(d,[1,d.shape[0],d.shape[1],d.shape[2],d.shape[3]])),o.assert(5===p.rank,(function(){return"Error in conv3d: input must be rank 5, but got rank ".concat(p.rank,".")})),o.assert(5===f.rank,(function(){return"Error in conv3d: filter must be rank 5, but got rank "+"".concat(f.rank,".")})),o.assert(p.shape[4]===f.shape[3],(function(){return"Error in conv3d: depth of input (".concat(p.shape[4],") must match ")+"input depth for filter ".concat(f.shape[3],".")})),o.assert(Object(s.h)(n,h),(function(){return"Error in conv3D: Either strides or dilations must be 1. "+"Got strides ".concat(n," and dilations '").concat(h,"'")})),o.assert("NDHWC"===l,(function(){return"Error in conv3d: got dataFormat of ".concat(l," but only NDHWC is currently supported.")}));var v=function(e,t){var r=s.b(p.shape,f.shape,n,h,u),a=e.conv3d(p,f,r);return t([p,f]),a},g={x:p,filter:f},b={strides:n,pad:u,dataFormat:l,dilations:h},y=r.a.runKernelFunc(v,g,null,a.D,b);return m?Object(c.a)(y,[y.shape[1],y.shape[2],y.shape[3],y.shape[4]]):y}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(10),a=n(7),i=n(4),o=n(2),s=n(20),u=n(9);var c=Object(u.b)({erf_:function(e){var t=Object(i.a)(e,"x","erf");o.assert("int32"===t.dtype||"float32"===t.dtype,(function(){return"Input dtype must be `int32` or `float32`."})),"int32"===t.dtype&&(t=Object(s.a)(t,"float32"));var n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.erf(t);return n([t]),r}),n,null,a.W)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({expm1_:function(e){var t=Object(i.a)(e,"x","expm1"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.expm1(t);return n([t]),r}),n,null,a.Y)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({isFinite_:function(e){var t=Object(i.a)(e,"x","is
2Finite"),n={x:t};return r.a.runKernelFunc((function(e){return e.isFinite(t)}),n,null,a.pb)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({isInf_:function(e){var t=Object(i.a)(e,"x","isInf"),n={x:t};return r.a.runKernelFunc((function(e){return e.isInf(t)}),n,null,a.qb)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({isNaN_:function(e){var t=Object(i.a)(e,"x","isNaN"),n={x:t};return r.a.runKernelFunc((function(e){return e.isNaN(t)}),n,null,a.rb)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(10),a=n(7);function i(e,t,n){if(n<=0)throw new Error("The number of values should be positive.");var i={start:e,stop:t,num:n};return r.a.runKernelFunc((function(r){return r.linspace(e,t,n)}),{},null,a.wb,i)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(55),a=n(4),i=n(17),o=n(47),s=n(9),u=n(105),c=n(203);var l=Object(s.b)({logSigmoid_:function(e){var t=Object(a.a)(e,"x","logSigmoid");return Object(r.a)((function(e){return{value:Object(o.a)(Object(c.a)(Object(o.a)(e))),gradFunc:function(t){return Object(i.a)(t,Object(u.a)(Object(o.a)(e)))}}}))(t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(10),a=n(7),i=n(4),o=n(20),s=n(62),u=n(94),c=n(90),l=n(9),h=n(26),d=n(31);var f=Object(l.b)({logSoftmax_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=Object(i.a)(e,"logits","logSoftmax");if(-1===t&&(t=n.rank-1),t!==n.rank-1)throw Error("Log Softmax along a non-last dimension is not yet supported. "+"Logits was rank ".concat(n.rank," and axis was ").concat(t));var l=function(n,r){var a=Object(c.a)(e,t,!0),i=Object(h.a)(e,a),l=Object(h.a)(Object(o.a)(i,"float32"),Object(u.a)(Object(d.a)(Object(s.a)(i),t,!0)));return r([l]),l},f={logits:n},p={axis:t};return r.a.runKernelFunc(l,f,null,a.zb,p)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(10),a=n(32),i=n(7),o=n(4),s=n(2),u=n(33),c=n(9),l=n(14);var h=Object(c.b)({maxPool3d_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[1,1,1],n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3?arguments[3]:void 0,h=arguments.length>4?arguments[4]:void 0,d=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"NDHWC",f=arguments.length>6?arguments[6]:void 0;null==f?f=[1,1,1]:Object(a.b)("dilations is deprecated, this field will be gone in v3.0.0.");var p=Object(o.a)(e,"x","maxPool3d"),m=p,v=!1;4===p.rank&&(v=!0,m=Object(l.a)(p,[1,p.shape[0],p.shape[1],p.shape[2],p.shape[3]])),s.assert(5===m.rank,(function(){return"Error in maxPool3d: x must be rank 5 but got rank ".concat(m.rank,".")})),s.assert("NDHWC"===d,(function(){return"Error in maxPool3d: Only NDHWC is currently supported, "+"but got dataFormat of ".concat(d)})),s.assert(u.h(n,f),(function(){return"Error in maxPool3d: Either strides or dilations must be 1. "+"Got strides ".concat(n," and dilations '").concat(f,"'")})),null!=h&&s.assert(s.isInt(c),(function(){return"Error in maxPool3d: pad must be an integer when using, "+"dimRoundingMode ".concat(h," but got pad ").concat(c,".")}));var g=function(e,r){null==f&&(f=[1,1,1]);var a=u.f(m.shape,t,n,f,c,h,d),i=e.maxPool3d(m,a);return r([m,i]),i},b={x:m},y={filterSize:t,strides:n,pad:c,dimRoundingMode:h,dataFormat:d,dilations:f},x=r.a.runKernelFunc(g,b,null,i.Fb,y);return v?Object(l.a)(x,[x.shape[1],x.shape[2],x.shape[3],x.shape[4]]):x}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({maxPoolWithArgmax_:function(e,t,n,o){var s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],u=Object(i.a)(e,"x","maxPoolWithArgmax"),c={x:u},l={filterSize:t,strides:n,pad:o,includeBatchInIndex:s},h=r.a.runKernel(a.Ib,c,l);return{result:h[0],indexes:h[1]}}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(4),i=n(9),o=n(14);var s=Object(i.b)({multinomial_:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=Object(a.a)(e,"logits","multinomial"),u=s.size,c=s.rank;if(u<2)throw new Error("Error in multinomial: you need at least 2 outcomes, but got "+"".concat(u,"."));if(c>2)throw new Error("Rank of probabilities must be 1 or 2, but is ".concat(c));n=n||Math.random();var l=1===c?Object(o.a)(s,[1,-1]):s,h=r.a.runKernelFunc((function(e){return e.multinomial(l,i,t,n)}),{logits2D:l});return 1===c?Object(o.a)(h,[h.size]):h}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(10),a=n(7),i=n(4),o=n(74),s=n(121),u=n(9),c=n(114),l=n(34);var h=Object(u.b)({onesLike_:function(e){var t=Object(i.a)(e,"x","onesLike"),n={x:t};return r.a.runKernelFunc((function(e,n){if("complex64"===t.dtype){var r=h(Object(c.a)(t)),a=Object(l.a)(Object(s.a)(t));return Object(o.a)(r,a)}return e.onesLike(t)}),n,null,a.Vb)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({reciprocal_:function(e){var t=Object(i.a)(e,"x","reciprocal"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.reciprocal(t);return n([t]),r}),n,null,a.dc)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({round_:function(e){var t=Object(i.a)(e,"x","round"),n={x:t};return r.a.runKernelFunc((function(e){return e.round(t)}),n,null,a.nc)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(3),a=n.n(r),i=n(13),o=n(12),s=n(4),u=n(2);function c(){return(c=Object(i.a)(a.a.mark((function e(t,n){var r,i,c,l,h,d,f,p,m,v,g;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(s.a)(t,"x","setdiff1d"),i=Object(s.a)(n,"y","setdiff1d"),u.assert(r.dtype===i.dtype,(function(){return"x and y should have the same dtype, but got x (".concat(r.dtype,") and y (").concat(i.dtype,").")}
2)),u.assert(1===r.rank,(function(){return"x should be 1D tensor, but got x (".concat(r.shape,").")})),u.assert(1===i.rank,(function(){return"y should be 1D tensor, but got y (".concat(i.shape,").")})),e.next=7,r.data();case 7:return c=e.sent,e.next=10,i.data();case 10:for(l=e.sent,h=new Set(l),d=0,f=0;f<c.length;f++)h.has(c[f])||d++;for(p=new o.b([d],r.dtype),m=new o.b([d],"int32"),v=0,g=0;v<c.length;v++)h.has(c[v])||(p.values[g]=c[v],m.values[g]=v,g++);return e.abrupt("return",[p.toTensor(),m.toTensor()]);case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var l=function(e,t){return c.apply(this,arguments)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({sign_:function(e){var t=Object(i.a)(e,"x","sign"),n={x:t};return r.a.runKernelFunc((function(e){return e.sign(t)}),n,null,a.tc)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({softmax_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=Object(i.a)(e,"logits","softmax","float32");if(-1===t&&(t=n.rank-1),t!==n.rank-1)throw Error("Softmax along a non-last dimension is not yet supported. "+"Logits was rank ".concat(n.rank," and dim was ").concat(t));var o={logits:n},s={dim:t};return r.a.runKernelFunc((function(e,r){var a=e.softmax(n,t);return r([a]),a}),o,null,a.xc,s)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(10),a=n(7),i=n(4),o=n(9),s=n(14),u=n(41),c=n(75);var l=Object(o.b)({stridedSlice_:function(e,t,n,o){var l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,h=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,d=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,f=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,p=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,m=Object(i.a)(e,"x","stridedSlice"),v=function(e){null==o&&(o=new Array(t.length));var r=Object(c.maskToAxes)(d);if(r.length>1)throw new Error("Multiple ellipses in slice is not allowed.");if(0!==d&&0!==f)throw new Error("Using both ellipsisMask and newAxisMask is not yet supported.");if(0!==d&&0!==p)throw new Error("Using both ellipsisMask and shrinkAxisMask is not yet supported.");var a=m.rank-t.length,i=Object(c.maskToAxes)(f),v=m.shape.slice();i.forEach((function(e){t[e]=0,n[e]=1,v.splice(e,0,1)})),m=Object(s.a)(m,v);var g=Object(c.getNormalizedAxes)(m.shape,r,a,t,n,o,l,h,d),b=g.begin,y=g.end,x=g.strides;t=b,n=y,o=x;var w=Object(c.maskToAxes)(p);w.forEach((function(e){n[e]=t[e]+1,o[e]=1}));var O=Object(c.computeOutShape)(t,n,o),k=O.filter((function(e,t){return-1===w.indexOf(t)}));if(o.every((function(e){return 1===e})))return Object(s.a)(Object(u.a)(m,t,O),k);var S=e.stridedSlice(m,t,n,o);return Object(s.a)(S,k)},g={x:m},b={begin:t,end:n,strides:o,beginMask:l,endMask:h,ellipsisMask:d,newAxisMask:f,shrinkAxisMask:p};return r.a.runKernelFunc(v,g,null,a.Gc,b)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({tan_:function(e){var t=Object(i.a)(e,"x","tan"),n={x:t};return r.a.runKernelFunc((function(e,n){var r=e.tan(t);return n([t]),r}),n,null,a.Jc)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(61),a=n(9),i=n(130);var o=Object(a.b)({truncatedNormal_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(null!=a&&"bool"===a)throw new Error("Unsupported data type $ { dtype }");for(var s=new i.a(t,n,a,!0,o),u=Object(r.a)(e,a),c=0;c<u.values.length;c++)u.values[c]=s.nextValue();return u.toTensor()}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return v})),n.d(t,"e",(function(){return g})),n.d(t,"f",(function(){return b}));var r=n(32),a=n(4),i=n(2),o=n(100),s=n(71),u=n(77),c=n(122),l=n(78),h=n(125),d=n(9);var f=Object(d.b)({equalStrict_:function(e,t){Object(r.b)("strict variants of ops have been deprecated and will be removed in future");var n=Object(a.a)(e,"a","equalStrict"),s=Object(a.a)(t,"b","equalStrict");return Object(i.assertShapesMatch)(n.shape,s.shape,"Error in equalStrict: "),Object(o.a)(n,s)}}),p=Object(d.b)({greaterEqualStrict_:function(e,t){Object(r.b)("strict variants of ops have been deprecated and will be removed in future");var n=Object(a.a)(e,"a","greaterEqualStrict"),o=Object(a.a)(t,"b","greaterEqualStrict");return Object(i.assertShapesMatch)(n.shape,o.shape,"Error in greaterEqualStrict: "),Object(u.a)(n,o)}}),m=Object(d.b)({greaterStrict_:function(e,t){Object(r.b)("strict variants of ops have been deprecated and will be removed in future");var n=Object(a.a)(e,"a","greaterStrict"),o=Object(a.a)(t,"b","greaterStrict");return Object(i.assertShapesMatch)(n.shape,o.shape,"Error in greaterStrict: "),Object(s.a)(n,o)}}),v=Object(d.b)({lessEqualStrict_:function(e,t){Object(r.b)("strict variants of ops have been deprecated and will be removed in future");var n=Object(a.a)(e,"a","lessEqualStrict"),o=Object(a.a)(t,"b","lessEqualStrict");return Object(i.assertShapesMatch)(n.shape,o.shape,"Error in lessEqualStrict: "),Object(l.a)(n,o)}}),g=Object(d.b)({lessStrict_:function(e,t){Object(r.b)("strict variants of ops have been deprecated and will be removed in future");var n=Object(a.a)(e,"a","lessStrict"),o=Object(a.a)(t,"b","lessStrict");return Object(i.assertShapesMatch)(n.shape,o.shape,"Error in lessStrict: "),Object(c.a)(n,o)}}),b=Object(d.b)({notEqualStrict_:function(e,t){Object(r.b)("strict variants of ops have been deprecated and will be removed in future");
2var n=Object(a.a)(e,"a","notEqualStrict"),o=Object(a.a)(t,"b","notEqualStrict");return Object(i.assertShapesMatch)(n.shape,o.shape,"Error in notEqualStrict: "),Object(h.a)(n,o)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return v})),n.d(t,"b",(function(){return g})),n.d(t,"c",(function(){return b})),n.d(t,"d",(function(){return y})),n.d(t,"e",(function(){return x})),n.d(t,"f",(function(){return w})),n.d(t,"g",(function(){return O})),n.d(t,"h",(function(){return k})),n.d(t,"i",(function(){return S}));var r=n(32),a=n(4),i=n(2),o=n(25),s=n(28),u=n(87),c=n(124),l=n(153),h=n(17),d=n(9),f=n(68),p=n(127),m=n(26);var v=Object(d.b)({addStrict_:function(e,t){Object(r.b)("strict variants of ops have been deprecated and will be removed in future");var n=Object(a.a)(e,"a","addStrict"),s=Object(a.a)(t,"b","addStrict");return i.assertShapesMatch(n.shape,s.shape,"Error in addStrict: "),Object(o.a)(n,s)}}),g=Object(d.b)({divStrict_:function(e,t){Object(r.b)("strict variants of ops have been deprecated and will be removed in future");var n=Object(a.a)(e,"a","div"),o=Object(a.a)(t,"b","div");return i.assertShapesMatch(n.shape,o.shape,"Error in divideStrict: "),Object(s.a)(n,o)}}),b=Object(d.b)({maximumStrict_:function(e,t){Object(r.b)("strict variants of ops have been deprecated and will be removed in future");var n=Object(a.a)(e,"a","maximumStrict"),o=Object(a.a)(t,"b","maximumStrict");return i.assertShapesMatch(n.shape,o.shape,"Error in maximumStrict: "),Object(u.a)(n,o)}}),y=Object(d.b)({minimumStrict_:function(e,t){Object(r.b)("strict variants of ops have been deprecated and will be removed in future");var n=Object(a.a)(e,"a","minimumStrict"),o=Object(a.a)(t,"b","minimumStrict");return i.assertShapesMatch(n.shape,o.shape,"Error in minimumStrict: "),Object(c.a)(n,o)}}),x=Object(d.b)({modStrict_:function(e,t){Object(r.b)("strict variants of ops have been deprecated and will be removed in future");var n=Object(a.a)(e,"a","modStrict"),o=Object(a.a)(t,"b","modStrict");return i.assertShapesMatch(n.shape,o.shape,"Error in modStrict: "),Object(l.a)(n,o)}}),w=Object(d.b)({mulStrict_:function(e,t){Object(r.b)("strict variants of ops have been deprecated and will be removed in future");var n=Object(a.a)(e,"a","mul"),o=Object(a.a)(t,"b","mul");return i.assertShapesMatch(n.shape,o.shape,"Error in multiplyStrict: "),Object(h.a)(n,o)}}),O=Object(d.b)({powStrict_:function(e,t){return Object(r.b)("strict variants of ops have been deprecated and will be removed in future"),i.assertShapesMatch(e.shape,t.shape,"Error in powStrict: "),Object(f.a)(e,t)}}),k=Object(d.b)({squaredDifferenceStrict_:function(e,t){Object(r.b)("strict variants of ops have been deprecated and will be removed in future");var n=Object(a.a)(e,"a","squaredDifferenceStrict"),o=Object(a.a)(t,"b","squaredDifferenceStrict");return i.assertShapesMatch(n.shape,o.shape,"Error in squaredDifferenceStrict: "),Object(p.a)(n,o)}}),S=Object(d.b)({subStrict_:function(e,t){Object(r.b)("strict variants of ops have been deprecated and will be removed in future");var n=Object(a.a)(e,"a","subStrict"),o=Object(a.a)(t,"b","subStrict");return i.assertShapesMatch(n.shape,o.shape,"Error in subStrict: "),Object(m.a)(n,o)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),a=n(7),i=n(4),o=n(9),s=n(142);var u=Object(o.b)({scatterND_:function(e,t,n){var o=Object(i.a)(e,"indices","scatterND","int32"),u=Object(i.a)(t,"updates","scatterND");s.validateInput(u,o,n);var c={indices:o,updates:u},l={shape:n};return r.a.runKernelFunc((function(e){return e.scatterND(o,u,n)}),c,null,a.pc,l)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),a=n(7),i=n(4),o=n(9);var s=Object(o.b)({gatherND_:function(e,t){var n=Object(i.a)(t,"indices","gatherND","int32"),o=Object(i.a)(e,"x","gatherND"),s={params:o,indices:n};return r.a.runKernelFunc((function(e){return e.gatherND(o,n)}),s,null,a.ib)}})},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var r="undefined"!==typeof requestAnimationFrame?requestAnimationFrame:"undefined"!==typeof e?e:function(e){return e()};function a(){return new Promise((function(e){return r((function(){return e()}))}))}}).call(this,n(235).setImmediate)},function(e,t,n){var r=n(287);e.exports=function(e){if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=r(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i,o=!0,s=!1;return{s:function(){a=e[Symbol.iterator]()},n:function(){var e=a.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==a.return||a.return()}finally{if(s)throw i}}}}},function(e,t,n){var r=n(288);e.exports=function(e,t){if(e){if("string"===typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}
vendor: 6,627 bytes, line 2
2e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){"use strict";(function(t,r){var a=n(183);e.exports=y;var i,o=n(249);y.ReadableState=b;n(182).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=n(292),c=n(237).Buffer,l=t.Uint8Array||function(){};var h=Object.create(n(169));h.inherits=n(141);var d=n(376),f=void 0;f=d&&d.debuglog?d.debuglog("stream"):function(){};var p,m=n(377),v=n(293);h.inherits(y,u);var g=["error","close","destroy","pause","resume"];function b(e,t){e=e||{};var r=t instanceof(i=i||n(132));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var a=e.highWaterMark,o=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:r&&(o||0===o)?o:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=n(294).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function y(e){if(i=i||n(132),!(this instanceof y))return new y(e);this._readableState=new b(e,this),this.readable=!0,e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function x(e,t,n,r,a){var i,o=e._readableState;null===t?(o.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,k(e)}(e,o)):(a||(i=function(e,t){var n;r=t,c.isBuffer(r)||r instanceof l||"string"===typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(o,t)),i?e.emit("error",i):o.objectMode||t&&t.length>0?("string"===typeof t||o.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),r?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):w(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!n?(t=o.decoder.write(t),o.objectMode||0!==t.length?w(e,o,t,!1):_(e,o)):w(e,o,t,!1))):r||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(o)}function w(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&k(e)),_(e,t)}Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),y.prototype.destroy=v.destroy,y.prototype._undestroy=v.undestroy,y.prototype._destroy=function(e,t){this.push(null),t(e)},y.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"===typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=c.from(e,t),t=""),n=!0),x(this,e,t,!1,n)},y.prototype.unshift=function(e){return x(this,e,null,!0,!1)},y.prototype.isPaused=function(){return!1===this._readableState.flowing},y.prototype.setEncoding=function(e){return p||(p=n(294).StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this};function O(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(f("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?a.nextTick(S,e):S(e))}function S(e){f("emit readable"),e.emit("readable"),C(e)}function _(e,t){t.readingMore||(t.readingMore=!0,a.nextTick(j,e,t))}function j(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(f("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function E(e){f("readable nexttick read 0"),e.read(0)}function T(e,t){t.reading||(f("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),C(e),t.flowing&&!t.reading&&e.read(0)}function C(e){var t=e._readableState;for(f("flow",t.flowing);t.flowing&&null!==e.read(););}function M(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,a=n.data;e-=a.length;for(;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(o===i.length?a+=i:a+=i.slice(0,e),0===(e-=o)){o===i.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(o));break}++r}return t.length-=r,a}(e,t):function(e,t){var n=c.allocUnsafe(e),r=t.head,a=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(n,n.length-e,0,o),0===(e-=o)){o===i.length?(++a,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(o));break}++a}return t.length-=a,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function A(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,a.nextTick(N,t,e))}function N(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function R(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}y.prototype.read=function(e){f("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return f("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?A(this):k(this),null;if(0===(e=O(e,t))&&t.ended)return 0===t.length&&A(this),null;var r,a=t.needReadable;return f("need readable",a),(0===t.length||t.length-e<t.highWaterMark)&&f("length less than watermark",a=!0),t.ended||t.reading?f("reading or ended",a=!1):a&&(f("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=O(n,t))),null===(r=e>0?M(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&A(this)),null!==r&&this.emit
vendor: 1,629 bytes, line 2
2("data",r),r},y.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},y.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,f("pipe count=%d opts=%j",i.pipesCount,t);var u=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?l:y;function c(t,r){f("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,f("cleanup"),e.removeListener("close",g),e.removeListener("finish",b),e.removeListener("drain",h),e.removeListener("error",v),e.removeListener("unpipe",c),n.removeListener("end",l),n.removeListener("end",y),n.removeListener("data",m),d=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||h())}function l(){f("onend"),e.end()}i.endEmitted?a.nextTick(u):n.once("end",u),e.on("unpipe",c);var h=function(e){return function(){var t=e._readableState;f("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,C(e))}}(n);e.on("drain",h);var d=!1;var p=!1;function m(t){f("ondata"),p=!1,!1!==e.write(t)||p||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==R(i.pipes,e))&&!d&&(f("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,p=!0),n.pause())}function v(t){f("onerror",t),y(),e.removeListener("error",v),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",b),y()}function b(){f("onfinish"),e.removeListener("close",g),y()}function y(){f("unpipe"),n.unpipe(e)}return n.on("data",m),function(e,t,n){if("function"===typeof e.prependListener)return e.prepe
vendor: 7,086 bytes, line 2
2ndListener(t,n);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",v),e.once("close",g),e.once("finish",b),e.emit("pipe",n),i.flowing||(f("pipe resume"),n.resume()),e},y.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<a;i++)r[i].emit("unpipe",this,n);return this}var o=R(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},y.prototype.on=function(e,t){var n=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&k(this):a.nextTick(E,this))}return n},y.prototype.addListener=y.prototype.on,y.prototype.resume=function(){var e=this._readableState;return e.flowing||(f("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,a.nextTick(T,e,t))}(this,e)),this},y.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this},y.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var a in e.on("end",(function(){if(f("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(a){(f("wrapped data"),n.decoder&&(a=n.decoder.write(a)),!n.objectMode||null!==a&&void 0!==a)&&((n.objectMode||a&&a.length)&&(t.push(a)||(r=!0,e.pause())))})),e)void 0===this[a]&&"function"===typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var i=0;i<g.length;i++)e.on(g[i],this.emit.bind(this,g[i]));return this._read=function(t){f("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(y.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),y._fromList=M}).call(this,n(112),n(115))},function(e,t,n){e.exports=n(182).EventEmitter},function(e,t,n){"use strict";var r=n(183);function a(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,i=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return i||o?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(a,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(r.nextTick(a,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){"use strict";var r=n(380).Buffer,a=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!==typeof t&&(r.isEncoding===a||!a(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=h,t=3;break;default:return this.write=d,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function o(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!==(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!==(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!==(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2===0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\ufffd":t},i.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var a=o(t[r]);if(a>=0)return a>0&&(e.lastNeed=a-1),a;if(--r<n||-2===a)return 0;if((a=o(t[r]))>=0)return a>0&&(e.lastNeed=a-2),a;if(--r<n||-2===a)return 0;if((a=o(t[r]))>=0)return a>0&&(2===a?a=0:e.lastNeed=a-3),a;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";e.exports=o;var r=n(132),a=Object.create(n(169));function i(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;
2if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var a=this._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);r.call(this,e),this._transformState={afterTransform:i.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"===typeof e.transform&&(this._transform=e.transform),"function"===typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"===typeof this._flush?this._flush((function(t,n){u(e,t,n)})):u(this,null,null)}function u(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}a.inherits=n(141),a.inherits(o,r),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},o.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var a=this._readableState;(r.needTransform||a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},o.prototype._destroy=function(e,t){var n=this;r.prototype._destroy.call(this,e,(function(e){t(e),n.emit("close")}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),a=n(7);function i(e,t,n,r){if("int32"!==e.dtype)throw new Error("tf.sparseToDense() expects the indices to be int32 type,"+" but the dtype was ".concat(e.dtype,"."));if(e.rank>2)throw new Error("sparseIndices should be a scalar, vector, or matrix,"+" but got shape ".concat(e.shape,"."));var a=e.rank>0?e.shape[0]:1,i=e.rank>1?e.shape[1]:1;if(n.length!==i)throw new Error("outputShape has incorrect number of elements:,"+" ".concat(n.length,", should be: ").concat(i,"."));var o=t.size;if(0!==t.rank&&(1!==t.rank||o!==a))throw new Error("sparseValues has incorrect shape "+"".concat(t.shape,", should be [] or [").concat(a,"]"));if(t.dtype!==r.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}var o=n(4),s=n(9);var u=Object(s.b)({sparseToDense_:function(e,t,n){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,u=Object(o.a)(e,"sparseIndices","sparseToDense","int32"),c=Object(o.a)(t,"sparseValues","sparseToDense"),l=Object(o.a)(s,"defaultValue","sparseToDense",c.dtype);i(u,c,n,l);var h={sparseIndices:u,sparseValues:c,defaultValue:l},d={outputShape:n};return r.a.runKernelFunc((function(e){return e.sparseToDense(u,c,n,l)}),h,null,a.Ac,d)}})},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"===typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddV2",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddN",category:"arithmetic",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"BiasAdd",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sub",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}
2]},{tfOpName:"RealDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Div",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"DivNoNan",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mul",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Maximum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}]},{tfOpName:"Minimum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}]},{tfOpName:"Pow",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SquaredDifference",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorMod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"Abs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan2",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ceil",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ClipByValue",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"clip_value_min",name:"clipValueMin",type:"number"},{tfName:"clip_value_max",name:"clipValueMax",type:"number"}]},{tfOpName:"Complex",category:"basic_math",inputs:[{start:0,name:"real",type:"tensor"},{start:1,name:"imag",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ComplexAbs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Elu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Exp",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Floor",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}
2]},{tfOpName:"Log",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Imag",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Neg",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Real",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Prelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"alpha",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu6",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"clipValueMin",name:"clipValueMin",type:"number",defaultValue:0},{tfName:"clipValueMax",name:"clipValueMax",type:"number",defaultValue:6}]},{tfOpName:"Selu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sigmoid",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Rsqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Square",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sign",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Round",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Expm1",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log1p",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Reciprocal",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Softplus",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Erf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}
2]},{tfOpName:"Prod",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axes",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LeakyRelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"alpha",name:"alpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"LoopCond",category:"control",inputs:[{start:0,name:"pred",type:"tensor"}]},{tfOpName:"Switch",category:"control",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"pred",type:"tensor"}]},{tfOpName:"Merge",category:"control",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"Enter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"frame_name",name:"frameName",type:"string"},{tfName:"is_constant",name:"isConstant",type:"bool"}]},{tfOpName:"Exit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NextIteration",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayV3",category:"control",inputs:[{start:0,name:"size",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"dynamic_size",name:"dynamicSize",type:"bool"},{tfName:"clear_after_read",name:"clearAfterRead",type:"bool"},{tfName:"identical_element_shapes",name:"identicalElementShapes",type:"bool"},{tfName:"tensor_array_name",name:"name",type:"string"}]},{tfOpName:"TensorArrayWriteV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayReadV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayGatherV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"}]},{tfOpName:"TensorArrayScatterV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArrayConcatV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape_except0",name:"elementShapeExcept0",type:"shape",notSupported:!0}]},{tfOpName:"TensorArraySplitV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"tensor",type:"tensor"},{start:2,name:"lengths",type:"number[]"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArraySizeV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"}]},{tfOpName:"StatelessIf",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"If",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]}
2,{tfOpName:"StatelessWhile",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"While",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"TensorListScatter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListScatterV2",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"},{start:3,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGather",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListSetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListReserve",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListFromTensor",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListStack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"},{tfName:"num_elements",name:"numElements",type:"dtype"}]},{tfOpName:"TensorListSplit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"},{start:2,name:"lengths",type:"number[]"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcat",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPopBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPushBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"AvgPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPoolWithArgmax",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"include_batch_in_index",name:"includeBatchInIndex",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}
vendor: 4,175 bytes, line 2
2]},{tfOpName:"AvgPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Conv1D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"stride",name:"stride",type:"number"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NWC"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"dilation",name:"dilation",type:"number",defaultValue:1}]},{tfOpName:"Conv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"useCudnnOnGpu",name:"useCudnnOnGpu",type:"bool"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"_FusedConv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"use_cudnn_on_gpu",name:"useCudnnOnGpu",type:"bool",defaultValue:!0},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4}]},{tfOpName:"Conv2DBackpropInput",category:"convolution",inputs:[{start:2,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:0,name:"outputShape",type:"number[]"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]}]},{tfOpName:"DepthwiseConv2d",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"DepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"FusedDepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}
2,{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]}]},{tfOpName:"Conv3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"Dilation2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"rates",name:"dilations",type:"number[]"},{tfName:"padding",name:"pad",type:"string"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"Fill",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"},{start:1,name:"value",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"LinSpace",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"num",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"OneHot",category:"creation",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"depth",type:"number"},{start:2,name:"onValue",type:"number",defaultValue:1},{start:3,name:"offValue",type:"number",defaultValue:0}],attrs:[{tfName:"axis",name:"axis",type:"number",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ones",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"OnesLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"RandomUniform",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number",defaultValue:0},{tfName:"maxval",name:"maxval",type:"number",defaultValue:1},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Range",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"step",type:"number",defaultValue:0}],attrs:[{tfName:"Tidx",name:"dtype",type:"dtype"}]},{tfOpName:"TruncatedNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"means",name:"mean",type:"number",defaultValue:0},{tfName:"stddev",name:"stdDev",type:"number",defaultValue:1},{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Zeros",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"ZerosLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Multinomial",category:"creation",inputs:[{start:0,name:"logits",type:"tensor"},{start:1,name:"numSamples",type:"number"}],attrs:[{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number"},{tfName:"T",name:"dtype",type:"dtype"},{tfName:"output_dtype",name:"output_dtype",type:"dtype"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"NonMaxSuppressionV2",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV3",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV4",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}
2,{tfName:"T_threshold",name:"threshold",type:"dtype",notSupported:!0},{tfName:"pad_to_max_output_size",name:"padToMaxOutputSize",type:"bool"}]},{tfOpName:"NonMaxSuppressionV5",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"},{start:5,name:"softNmsSigma",type:"number"}]},{tfOpName:"Where",category:"dynamic",inputs:[{start:0,name:"condition",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ListDiff",category:"dynamic",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"PlaceholderWithDefault",category:"graph",inputs:[{start:0,name:"default",type:"tensor"}],attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Placeholder",category:"graph",attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Const",category:"graph"},{tfOpName:"Identity",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IdentityN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Snapshot",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Rank",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Size",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Shape",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"ShapeN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Print",category:"graph",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"data",type:"tensors"}],attrs:[{tfName:"message",name:"message",type:"string"},{tfName:"first_n",name:"firstN",type:"number",notSupported:!0},{tfName:"summarize",name:"summarize",type:"number",defaultValue:3}]},{tfOpName:"NoOp",category:"graph",inputs:[]},{tfOpName:"StopGradient",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"FakeQuantWithMinMaxVars",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"min",name:"min",type:"number"},{tfName:"max",name:"max",type:"number"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"ResizeBilinear",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ResizeNearestNeighbor",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"CropAndResize",category:"image",inputs:[{start:0,name:"image",type:"tensor"},{start:1,name:"boxes",type:"tensor"},{start:2,name:"boxInd",type:"tensor"},{start:3,name:"cropSize",type:"number[]"}],attrs:[{tfName:"method",name:"method",type:"string"},{tfName:"extrapolation_value",name:"extrapolationValue",type:"number"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"Equal",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NotEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Greater",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}
2]},{tfOpName:"GreaterEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Less",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LessEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalAnd",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalNot",category:"logical",inputs:[{start:0,name:"a",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalOr",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Select",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SelectV2",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"_FusedMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMulV2",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Transpose",category:"matrices",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"perm",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"FusedBatchNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV2",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}
2]},{tfOpName:"FusedBatchNormV3",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"LRN",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"depth_radius",name:"radius",type:"number",defaultValue:5},{tfName:"bias",name:"bias",type:"number",defaultValue:1},{tfName:"alpha",name:"alpha",type:"number",defaultValue:1},{tfName:"beta",name:"beta",type:"number",defaultValue:.5}]},{tfOpName:"Softmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"LogSoftmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"SparseToDense",category:"normalization",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!0,notSupported:!0}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"Max",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Mean",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Min",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Sum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"All",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Any",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"ArgMax",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"ArgMin",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Prod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Cumsum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"GatherV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"validate_indices",name:"validateIndices",type:"bool",notSupported:!0}]},{tfOpName:"Reverse",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"dims",type:"bool",notSupported:!0}]},{tfOpName:"ReverseV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}]},{tfOpName:"Slice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"size",type:"number[]"}]},{tfOpName:"StridedSlice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"end",type:"number[]"},{start:3,name:"strides",type:"number[]"}],attrs:[{tfName:"begin_mask",name:"beginMask",type:"number",defaultValue:0},{tfName:"end_mask",name:"endMask",type:"number",defaultValue:0},{tfName:"new_axis_mask",name:"newAxisMask",type:"number",defaultValue:0},{tfName:"ellipsis_mask",name:"ellipsisMask",type:"number",defaultValue:0},{tfName:"shrink_axis_mask",name:"shrinkAxisMask",type:"number",defaultValue:0}]},{tfOpName:"Pack",category:"slice_join",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Unpack",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"num",name:"num",type:"number",defaultValue:0,notSupported:!0}
2]},{tfOpName:"Tile",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"reps",type:"number[]"}]},{tfOpName:"Split",category:"slice_join",inputs:[{start:0,name:"axis",type:"number",defaultValue:0},{start:1,name:"x",type:"tensor"}],attrs:[{tfName:"num_split",name:"numOrSizeSplits",type:"number",defaultValue:1}]},{tfOpName:"SplitV",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"numOrSizeSplits",type:"number[]"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"ScatterNd",category:"slice_join",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"shape",type:"number[]"}]},{tfOpName:"GatherNd",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}]},{tfOpName:"SparseToDense",category:"slice_join",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!1,notSupported:!0}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"FFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"RFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]},{tfOpName:"IRFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"Cast",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"SrcT",name:"sdtype",type:"dtype",notSupported:!0},{tfName:"DstT",name:"dtype",type:"dtype"}]},{tfOpName:"ExpandDims",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Pad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"constant_value",name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"PadV2",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"},{start:2,name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"Reshape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"Squeeze",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"axis",tfDeprecatedName:"squeeze_dims",name:"axis",type:"number[]"}]},{tfOpName:"SpaceToBatchND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"paddings",type:"number[]"}]},{tfOpName:"BatchToSpaceND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"crops",type:"number[]"}]},{tfOpName:"DepthToSpace",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"block_size",name:"blockSize",type:"number"},{tfName:"data_format",name:"dataFormat",type:"string"}]},{tfOpName:"BroadcastTo",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}],attrs:[]}]},function(e,t,n){"use strict";n.d(t,"a",(function(){return L}));var r=n(3),a=n.n(r),i=n(13),o=n(5),s=n(11),u=n(8),c=n(0),l=n(107),h=function(){return(h=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function d(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))}function f(e,t){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}
2if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],r=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var p=function(e){return{startEndTensor:e,startPoint:Object(c.slice)(e,[0,0],[-1,2]),endPoint:Object(c.slice)(e,[0,2],[-1,2])}},m={strides:[8,16],anchors:[2,6]};function v(e,t){var n,r,a;if(e.topLeft instanceof c.Tensor&&e.bottomRight instanceof c.Tensor){var i=Object(c.tidy)((function(){return[Object(c.concat)([Object(c.sub)(t-1,e.topLeft.slice(0,1)),e.topLeft.slice(1,1)]),Object(c.concat)([Object(c.sub)(t-1,e.bottomRight.slice(0,1)),e.bottomRight.slice(1,1)])]})),o=Object(u.a)(i,2);n=o[0],r=o[1],null!=e.landmarks&&(a=Object(c.tidy)((function(){var n=Object(c.sub)(Object(c.tensor1d)([t-1,0]),e.landmarks),r=Object(c.tensor1d)([1,-1]);return Object(c.mul)(n,r)})))}else{var s=Object(u.a)(e.topLeft,2),l=s[0],h=s[1],d=Object(u.a)(e.bottomRight,2),f=d[0],p=d[1];n=[t-1-l,h],r=[t-1-f,p],null!=e.landmarks&&(a=e.landmarks.map((function(e){return[t-1-e[0],e[1]]})))}var m={topLeft:n,bottomRight:r};return null!=a&&(m.landmarks=a),null!=e.probability&&(m.probability=e.probability instanceof c.Tensor?e.probability.clone():e.probability),m}function g(e,t){return Object(c.tidy)((function(){return function(e,t){var n=Object(c.mul)(e.startPoint,t),r=Object(c.mul)(e.endPoint,t),a=Object(c.concat2d)([n,r],1);return p(a)}(e.hasOwnProperty("box")?e.box:e,t).startEndTensor.squeeze()}))}var b=function(){function e(t,n,r,a,i,s){Object(o.a)(this,e),this.blazeFaceModel=t,this.width=n,this.height=r,this.maxFaces=a,this.anchorsData=function(e,t,n){for(var r=[],a=0;a<n.strides.length;a++)for(var i=n.strides[a],o=Math.floor((t+i-1)/i),s=Math.floor((e+i-1)/i),u=n.anchors[a],c=0;c<o;c++)for(var l=i*(c+.5),h=0;h<s;h++)for(var d=i*(h+.5),f=0;f<u;f++)r.push([d,l]);return r}(n,r,m),this.anchors=Object(c.tensor2d)(this.anchorsData),this.inputSizeData=[n,r],this.inputSize=Object(c.tensor1d)([n,r]),this.iouThreshold=i,this.scoreThreshold=s}return Object(s.a)(e,[{key:"getBoundingBoxes",value:function(){var e=Object(i.a)(a.a.mark((function e(t,n){var r,o,s,l,h,d,f,m,v,g,b,y,x,w,O,k,S=this,_=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=!(_.length>2&&void 0!==_[2])||_[2],o=Object(c.tidy)((function(){var e=t.resizeBilinear([S.width,S.height]),n=Object(c.mul)(Object(c.sub)(e.div(255),.5),2),r=S.blazeFaceModel.predict(n).squeeze(),a=function(e,t,n){var r=Object(c.slice)(e,[0,1],[-1,2]),a=Object(c.add)(r,t),i=Object(c.slice)(e,[0,3],[-1,2]),o=Object(c.div)(i,n),s=Object(c.div)(a,n),u=Object(c.div)(o,2),l=Object(c.sub)(s,u),h=Object(c.add)(s,u),d=Object(c.mul)(l,n),f=Object(c.mul)(h,n);return Object(c.concat2d)([d,f],1)}(r,S.anchors,S.inputSize),i=Object(c.slice)(r,[0,0],[-1,1]);return[r,a,Object(c.sigmoid)(i).squeeze()]})),s=Object(u.a)(o,3),l=s[0],h=s[1],d=s[2],f=console.warn,console.warn=function(){},m=c.image.nonMaxSuppression(h,d,this.maxFaces,this.iouThreshold,this.scoreThreshold),console.warn=f,e.next=7,m.array();case 7:if(v=e.sent,m.dispose(),g=v.map((function(e){return Object(c.slice)(h,[e,0],[1,-1])})),e.t0=n,e.t0){e.next=15;break}return e.next=14,Promise.all(g.map(function(){var e=Object(i.a)(a.a.mark((function e(t){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.array();case 2:return n=e.sent,e.abrupt("return",(t.dispose(),n));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 14:g=e.sent;case 15:for(b=t.shape[1],y=t.shape[2],x=n?Object(c.div)([y,b],this.inputSize):[y/this.inputSizeData[0],b/this.inputSizeData[1]],w=[],O=function(e){var t=g[e],a=Object(c.tidy)((function(){var a=p(t instanceof c.Tensor?t:Object(c.tensor2d)(t));if(!r)return a;var i,o=v[e];return i=n?S.anchors.slice([o,0],[1,2]):S.anchorsData[o],{box:a,landmarks:Object(c.slice)(l,[o,5],[1,-1]).squeeze().reshape([6,-1]),probability:Object(c.slice)(d,[o],[1]),anchor:i}}));w.push(a)},k=0;k<g.length;k++)O(k);return e.abrupt("return",(h.dispose(),d.dispose(),l.dispose(),{boxes:w,scaleFactor:x}));case 21:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"estimateFaces",value:function(){var e=Object(i.a)(a.a.mark((function e(t){var n,r,o,s,l,h,d,f,p,m,b=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=b.length>1&&void 0!==b[1]&&b[1],r=b.length>2&&void 0!==b[2]&&b[2],o=!(b.length>3&&void 0!==b[3])||b[3],s=function(e){return e instanceof c.Tensor?[e.shape[0],e.shape[1]]:[e.height,e.width]}(t),l=Object(u.a)(s,2),h=l[1],d=Object(c.tidy)((function(){return t instanceof c.Tensor||(t=c.browser.fromPixels(t)),t.toFloat().expandDims(0)})),e.next=9,this.getBoundingBoxes(d,n,o);case 9:return f=e.sent,p=f.boxes,m=f.scaleFactor,e.abrupt("return",(d.dispose(),n?p.map((function(e){var t=g(e,m),n={topLeft:t.slice([0],[2]),bottomRight:t.slice([2],[2])};if(o){var a=e.landmarks,i=e.probability,s=e.anchor,u=a.add(s).mul(m);n.landmarks=u,n.probability=i}return r&&(n=v(n,h)),n})):Promise.all(p.map(function(){var e=Object(i.a)(a.a.mark((function e(t){var n,s,c,l,d,f,p,b,y,x,w,O,k;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=g(t,m),!o){e.next=17;break}return e.next=4,Promise.all([t.landmarks,n,t.probability].map(function(){var e=Object(i.a)(a.a.mark((function e(t){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.array());case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 4:c=e.sent,l=Object(u.a)(c,3),d=l[0],f=l[1],p=l[2],b=t.anchor,y=Object(u.a)(m,2),x=y[0],w=y[1],O=d.map((function(e){return[(e[0]+b[0])*x,(e[1]+b[1])*w]})),s={topLeft:f.slice(0,2),bottomRight:f.slice(2),landmarks:O,probability:p},function(e){e.startEndTensor.dispose(),e.startPoint.dispose(),e.endPoint.dispose()}(t.box),t.landmarks.dispose(),t.probability.dispose(),e.next=21;break;case 17:return e.next=19,n.array();case 19:k=e.sent,s={topLeft:k.slice(0,2),bottomRight:k.slice(2)};case 21:return e.abrupt("return",(n.dispose(),r&&(s=v(s,h)),s));case 22:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()))));case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();function y(){return x.apply(this,arguments)}function x(){return(x=Object(i.a)(a.a.mark((function e(){var t,n,r,i,o,s,u,c,h,d,f,p,m=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=m.length>0&&void 0!==m[0]?m[0]:{},n=t.maxFaces,r=void 0===n?10:n,i=t.inputWidth,o=void 0===i?128:i,s=t.inputHeight,u=void 0===s?128:s,c=t.iouThreshold,h=void 0===c?.3:c,d=t.scoreThreshold,f=void 0===d?.75:d,e.next=3,Object(l.a)("https://tfhub.dev/tensorflow/tfjs-model/blazeface/1/default/1",{fromTFHub:!0});case 3:return p=e.sent,e.abrupt("return",new b(p,o,u,r,h,f));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var w={silhouette:[10,338,297,332,284,251,389,356,454,323,361,288,397,365,379,378,400,377,152,148,176,149,150,136,172,58,132,93,234,127,162,21,54,103,67,109],lipsUpperOuter:[61,185,40,39,37,0,267,269,270,409,291],lipsLowerOuter:[146,91,181,84,17,314,405,321,375,291],lipsUpperInner:[78,191,80,81,82,13,312,311,310,415,308],lipsLowerInner:[78,95,88,178,87,14,317,402,318,324,308],rightEyeUpper0:[246,161,160,
2159,158,157,173],rightEyeLower0:[33,7,163,144,145,153,154,155,133],rightEyeUpper1:[247,30,29,27,28,56,190],rightEyeLower1:[130,25,110,24,23,22,26,112,243],rightEyeUpper2:[113,225,224,223,222,221,189],rightEyeLower2:[226,31,228,229,230,231,232,233,244],rightEyeLower3:[143,111,117,118,119,120,121,128,245],rightEyebrowUpper:[156,70,63,105,66,107,55,193],rightEyebrowLower:[35,124,46,53,52,65],leftEyeUpper0:[466,388,387,386,385,384,398],leftEyeLower0:[263,249,390,373,374,380,381,382,362],leftEyeUpper1:[467,260,259,257,258,286,414],leftEyeLower1:[359,255,339,254,253,252,256,341,463],leftEyeUpper2:[342,445,444,443,442,441,413],leftEyeLower2:[446,261,448,449,450,451,452,453,464],leftEyeLower3:[372,340,346,347,348,349,350,357,465],leftEyebrowUpper:[383,300,293,334,296,336,285,417],leftEyebrowLower:[265,353,276,283,282,295],midwayBetweenEyes:[168],noseTip:[1],noseBottom:[2],noseRightCorner:[98],noseLeftCorner:[327],rightCheek:[205],leftCheek:[425]};function O(e){return[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])]}function k(e){return[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2]}function S(e,t){void 0===t&&(t=1.5);var n=k(e),r=O(e),a=[t*r[0]/2,t*r[1]/2];return{startPoint:[n[0]-a[0],n[1]-a[1]],endPoint:[n[0]+a[0],n[1]+a[1]],landmarks:e.landmarks}}function _(e,t){var n;return(n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]))-2*Math.PI*Math.floor((n+Math.PI)/(2*Math.PI))}function j(e,t){return[[1,0,e],[0,1,t],[0,0,1]]}function E(e,t){for(var n=0,r=0;r<e.length;r++)n+=e[r]*t[r];return n}function T(e,t){for(var n=[],r=0;r<e.length;r++)n.push(e[r][t]);return n}function C(e,t){for(var n=[],r=e.length,a=0;a<r;a++){n.push([]);for(var i=0;i<r;i++)n[a].push(E(e[a],T(t,i)))}return n}function M(e,t){var n=Math.cos(e),r=Math.sin(e),a=[[n,-r,0],[r,n,0],[0,0,1]],i=C(j(t[0],t[1]),a);return C(i,j(-t[0],-t[1]))}var A=[1,168],N=[3,2],R=function(){function e(e,t,n,r,a,i){this.regionsOfInterest=[],this.runsWithoutFaceDetector=0,this.boundingBoxDetector=e,this.meshDetector=t,this.meshWidth=n,this.meshHeight=r,this.maxContinuousChecks=a,this.maxFaces=i}return e.prototype.transformRawCoords=function(e,t,n,r){var a,i,o,s,u=this,c=O({startPoint:t.startPoint,endPoint:t.endPoint}),l=[c[0]/this.meshWidth,c[1]/this.meshHeight],h=e.map((function(e){return[l[0]*(e[0]-u.meshWidth/2),l[1]*(e[1]-u.meshHeight/2),e[2]]})),d=M(n,[0,0]),f=h.map((function(e){return function(e,t){return[E(e,t[0]),E(e,t[1])]}(e,d).concat([e[2]])})),p=(i=[[(a=r)[0][0],a[1][0]],[a[0][1],a[1][1]]],o=[a[0][2],a[1][2]],s=[-E(i[0],o),-E(i[1],o)],[i[0].concat(s[0]),i[1].concat(s[1]),[0,0,1]]),m=k({startPoint:t.startPoint,endPoint:t.endPoint}).concat([1]),v=[E(m,p[0]),E(m,p[1])];return f.map((function(e){return[e[0]+v[0],e[1]+v[1],e[2]]}))},e.prototype.predict=function(e){return d(this,void 0,void 0,(function(){var t,n,r,a,i=this;return f(this,(function(o){switch(o.label){case 0:return this.shouldUpdateRegionsOfInterest()?[4,this.boundingBoxDetector.getBoundingBoxes(e,!1,!0)]:[3,2];case 1:return t=o.sent(),n=t.boxes,r=t.scaleFactor,0===n.length?(this.regionsOfInterest=[],[2,null]):(a=n.map((function(e){var t,n,a={startPoint:e.box.startPoint.squeeze().arraySync(),endPoint:e.box.endPoint.squeeze().arraySync()},i=S((n=r,{startPoint:[(t=a).startPoint[0]*n[0],t.startPoint[1]*n[1]],endPoint:[t.endPoint[0]*n[0],t.endPoint[1]*n[1]]}));return h({},i,{landmarks:e.landmarks.arraySync()})})),n.forEach((function(e){null!=e&&null!=e.startPoint&&(e.startEndTensor.dispose(),e.startPoint.dispose(),e.endPoint.dispose())})),this.updateRegionsOfInterest(a),this.runsWithoutFaceDetector=0,[3,3]);case 2:this.runsWithoutFaceDetector++,o.label=3;case 3:return[2,Object(c.tidy)((function(){return i.regionsOfInterest.map((function(t,n){var r;if(468===t.landmarks.length){var a=A[0],o=A[1];r=_(t.landmarks[a],t.landmarks[o])}else a=N[0],o=N[1],r=_(t.landmarks[a],t.landmarks[o]);var s=k({startPoint:t.startPoint,endPoint:t.endPoint}),u=[s[0]/e.shape[2],s[1]/e.shape[1]],l=c.image.rotateWithOffset(e,r,0,u),d=M(-r,s),f=function(e,t,n){var r=t.shape[1],a=t.shape[2],i=[[e.startPoint[1]/r,e.startPoint[0]/a,e.endPoint[1]/r,e.endPoint[0]/a]];return c.image.cropAndResize(t,i,[0],n)}({startPoint:t.startPoint,endPoint:t.endPoint},l,[i.meshHeight,i.meshWidth]).div(255),p=i.meshDetector.predict(f),m=p[1],v=p[2],g=Object(c.reshape)(v,[-1,3]),b=g.arraySync(),y=i.transformRawCoords(b,t,r,d),x=Object(c.tensor2d)(y),w=i.calculateLandmarksBoundingBox(y);return i.regionsOfInterest[n]=h({},w,{landmarks:x.arraySync()}),{coords:g,scaledCoords:x,box:w,flag:m.squeeze()}}))}))]}}))}))},e.prototype.updateRegionsOfInterest=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=this.regionsOfInterest[t],a=0;if(r&&r.startPoint){var i=n.startPoint,o=i[0],s=i[1],u=n.endPoint,c=u[0],l=u[1],h=r.startPoint,d=h[0],f=h[1],p=r.endPoint,m=p[0],v=p[1],g=Math.max(o,d),b=Math.max(s,f),y=(Math.min(c,m)-g)*(Math.min(l,v)-b);a=y/((c-o)*(l-s)+(m-d)*(v-s)-y)}a<.25&&(this.regionsOfInterest[t]=n)}this.regionsOfInterest=this.regionsOfInterest.slice(0,e.length)},e.prototype.clearRegionOfInterest=function(e){null!=this.regionsOfInterest[e]&&(this.regionsOfInterest=this.regionsOfInterest.slice(0,e).concat(this.regionsOfInterest.slice(e+1)))},e.prototype.shouldUpdateRegionsOfInterest=function(){var e=this.regionsOfInterest.length,t=0===e;return 1===this.maxFaces||t?t:e!==this.maxFaces&&this.runsWithoutFaceDetector>=this.maxContinuousChecks},e.prototype.calculateLandmarksBoundingBox=function(e){var t=e.map((function(e){return e[0]})),n=e.map((function(e){return e[1]})),r={startPoint:[Math.min.apply(Math,t),Math.min.apply(Math,n)],endPoint:[Math.max.apply(Math,t),Math.max.apply(Math,n)]};return S({startPoint:r.startPoint,endPoint:r.endPoint})},e}(),I
vendor: 16,761 bytes, line 2
2=[[.499976992607117,.652534008026123],[.500025987625122,.547487020492554],[.499974012374878,.602371990680695],[.482113003730774,.471979022026062],[.500150978565216,.527155995368958],[.499909996986389,.498252987861633],[.499523013830185,.40106201171875],[.289712011814117,.380764007568359],[.499954998493195,.312398016452789],[.499987006187439,.269918978214264],[.500023007392883,.107050001621246],[.500023007392883,.666234016418457],[.5000159740448,.679224014282227],[.500023007392883,.692348003387451],[.499976992607117,.695277988910675],[.499976992607117,.70593398809433],[.499976992607117,.719385027885437],[.499976992607117,.737019002437592],[.499967992305756,.781370997428894],[.499816000461578,.562981009483337],[.473773002624512,.573909997940063],[.104906998574734,.254140973091125],[.365929991006851,.409575998783112],[.338757991790771,.41302502155304],[.311120003461838,.409460008144379],[.274657994508743,.389131009578705],[.393361985683441,.403706014156342],[.345234006643295,.344011008739471],[.370094001293182,.346076011657715],[.319321990013123,.347265005111694],[.297903001308441,.353591024875641],[.24779200553894,.410809993743896],[.396889001131058,.842755019664764],[.280097991228104,.375599980354309],[.106310002505779,.399955987930298],[.2099249958992,.391353011131287],[.355807989835739,.534406006336212],[.471751004457474,.65040397644043],[.474155008792877,.680191993713379],[.439785003662109,.657229006290436],[.414617002010345,.66654098033905],[.450374007225037,.680860996246338],[.428770989179611,.682690978050232],[.374971002340317,.727805018424988],[.486716985702515,.547628998756409],[.485300987958908,.527395009994507],[.257764995098114,.314490020275116],[.401223003864288,.455172002315521],[.429818987846375,.548614978790283],[.421351999044418,.533740997314453],[.276895999908447,.532056987285614],[.483370006084442,.499586999416351],[.33721199631691,.282882988452911],[.296391993761063,.293242990970612],[.169294998049736,.193813979625702],[.447580009698868,.302609980106354],[.392390012741089,.353887975215912],[.354490011930466,.696784019470215],[.067304998636246,.730105042457581],[.442739009857178,.572826027870178],[.457098007202148,.584792017936707],[.381974011659622,.694710969924927],[.392388999462128,.694203019142151],[.277076005935669,.271932005882263],[.422551989555359,.563233017921448],[.385919004678726,.281364023685455],[.383103013038635,.255840003490448],[.331431001424789,.119714021682739],[.229923993349075,.232002973556519],[.364500999450684,.189113974571228],[.229622006416321,.299540996551514],[.173287004232407,.278747975826263],[.472878992557526,.666198015213013],[.446828007698059,.668527007102966],[.422762006521225,.673889994621277],[.445307999849319,.580065965652466],[.388103008270264,.693961024284363],[.403039008378983,.706539988517761],[.403629004955292,.693953037261963],[.460041999816895,.557139039039612],[.431158006191254,.692366003990173],[.452181994915009,.692366003990173],[.475387006998062,.692366003990173],[.465828001499176,.779190003871918],[.472328990697861,.736225962638855],[.473087012767792,.717857003211975],[.473122000694275,.704625964164734],[.473033010959625,.695277988910675],[.427942007780075,.695277988910675],[.426479011774063,.703539967536926],[.423162013292313,.711845993995667],[.4183090031147,.720062971115112],[.390094995498657,.639572978019714],[.013953999616206,.560034036636353],[.499913990497589,.58014702796936],[.413199990987778,.69539999961853],[.409626007080078,.701822996139526],[.468080013990402,.601534962654114],[.422728985548019,.585985004901886],[.463079988956451,.593783974647522],[.37211999297142,.47341400384903],[.334562003612518,.496073007583618],[.411671012639999,.546965003013611],[.242175996303558,.14767599105835],[.290776997804642,.201445996761322],[.327338010072708,.256527006626129],[.399509996175766,.748921036720276],[.441727995872498,.261676013469696],[.429764986038208,.187834024429321],[.412198007106781,.108901023864746],[.288955003023148,.398952007293701],[.218936994671822,.435410976409912],[.41278201341629,.398970007896423],[.257135003805161,.355440020561218],[.427684992551804,.437960982322693],[.448339998722076,.536936044692993],[.178560003638268,.45755398273468],[.247308000922203,.457193970680237],[.286267012357712,.467674970626831],[.332827985286713,.460712015628815],[.368755996227264,.447206974029541],[.398963987827301,.432654976844788],[.476410001516342,.405806005001068],[.189241006970406,.523923993110657],[.228962004184723,.348950982093811],[.490725994110107,.562400996685028],[.404670000076294,.485132992267609],[.019469000399113,.401564002037048],[.426243007183075,.420431017875671],[.396993011236191,.548797011375427],[.266469985246658,.376977026462555],[.439121007919312,.51895797252655],[.032313998788595,.644356966018677],[.419054001569748,.387154996395111],[.462783008813858,.505746960639954],[.238978996872902,.779744982719421],[.198220998048782,.831938028335571],[.107550002634525,.540755033493042],[.183610007166862,.740257024765015],[.134409993886948,.333683013916016],[.385764002799988,.883153975009918],[.490967005491257,.579378008842468],[.382384985685349,.508572995662689],[.174399003386497,.397670984268188],[.318785011768341,.39623498916626],[.343364000320435,.400596976280212],[.396100014448166,.710216999053955],[.187885001301765,.588537991046906],[.430987000465393,.944064974784851],[.318993002176285,.898285031318665],[.266247987747192,.869701027870178],[.500023007392883,.190576016902924],[.499976992607117,.954452991485596],[.366169989109039,.398822009563446],[.393207013607025,.39553701877594],[.410373002290726,.391080021858215],[.194993004202843,.342101991176605],[.388664990663528,.362284004688263],[.365961998701096,.355970978736877],[.343364000320435,.355356991291046],[.318785011768341,.35834002494812],[.301414996385574,.363156020641327],[.058132998645306,.319076001644135],[.301414996385574,.387449026107788],[.499987989664078,.618434011936188],[.415838003158569,.624195992946625],[.445681989192963,.566076993942261],[.465844005346298,.620640993118286],[.49992299079895,.351523995399475],[.288718998432159,.819945991039276],[.335278987884521,.852819979190826],[.440512001514435,.902418971061707],[.128294005990028,.791940987110138],[.408771991729736,.373893976211548],[.455606997013092,.451801002025604],[.499877005815506,.908990025520325],[.375436991453171,.924192011356354],[.11421000212431,.615022003650665],[.448662012815475,.695277988910675],[.4480200111866,.704632043838501],[.447111994028091,.715808033943176],[.444831997156143,.730794012546539],[.430011987686157,.766808986663818],[.406787008047104,.685672998428345],[.400738000869751,.681069016456604],[.392399996519089,.677703022956848],[.367855995893478,.663918972015381],[.247923001646996,.601333022117615],[.452769994735718,.420849978923798],[.43639200925827,.359887003898621],[.416164010763168,.368713974952698],[.413385987281799,.692366003990173],[.228018000721931,.683571994304657],[.468268007040024,.352671027183533],[.411361992359161,.804327011108398],[.499989002943039,.469825029373169],[.479153990745544,.442654013633728],[.499974012374878,.439637005329132],[.432112008333206,.493588984012604],[.499886006116867,.866917014122009],[.49991300702095,.821729004383087],[.456548988819122,.819200992584229],[.344549000263214,.745438992977142],[.37890899181366,.574010014533997],[.374292999505997,.780184984207153],[.319687992334366,.570737957954407],[.357154995203018,.604269981384277],[.295284003019333,.621580958366394],[.447750002145767,.862477004528046],[.410986006259918,.508723020553589],[.31395098567009,.775308012962341],[.354128003120422,.812552988529205],[.324548006057739,.703992962837219],[.189096003770828,.646299958229065],[.279776990413666,.71465802192688],[.1338230073452,.682700991630554],[.336768001317978,.644733011722565],[.429883986711502,.466521978378296],[.455527991056442,.548622965812683],[.437114000320435,.558896005153656],[.467287987470627,.529924988746643],[.414712011814117,.335219979286194],[.37704598903656,.322777986526489],[.344107985496521,.320150971412659],[.312875986099243,.32233202457428],[.283526003360748,.333190023899078],[.241245999932289,.382785975933075],[.102986000478268,.468762993812561],[.267612010240555,.424560010433197],[.297879010438919,.433175981044769],[.333433985710144,.433878004550934],[.366427004337311,.426115989685059],[.396012008190155,.416696012020111],[.420121014118195,.41022801399231],[.007561000064015,.480777025222778],[.432949006557465,.569517970085144],[.458638995885849,.479089021682739],[.473466008901596,.545744001865387],[.476087987422943,.563830018043518],[.468472003936768,.555056989192963],[.433990985155106,.582361996173859],[.483518004417419,.562983989715576],[.482482999563217,.57784903049469],[.42645001411438,.389798998832703],[.438998997211456,.39649498462677],[.450067013502121,.400434017181396],[.289712011814117,.368252992630005],[.276670008897781,.363372981548309],[.517862021923065,.471948027610779],[.710287988185883,.380764007568359],[.526226997375488,.573909997940063],[.895093023777008,.254140973091125],[.634069979190826,.409575998783112],[.661242008209229,.41302502155304],[.688880026340485,.409460008144379],[.725341975688934,.389131009578705],[.606630027294159,.40370500087738],[.654766023159027,.344011008739471],[.629905998706818,.346076011657715],[.680678009986877,.347265005111694],[.702096998691559,.353591024875641],[.75221198797226,.410804986953735],[.602918028831482,.842862963676453],[.719901978969574,.375599980354309],[.893692970275879,.399959981441498],[.790081977844238,.391354024410248],[.643998026847839,.534487962722778],[.528249025344849,.65040397644043],[.525849997997284,.680191040039062],[.560214996337891,.657229006290436],[.585384011268616,.66654098033905],[.549625992774963,.680860996246338],[.57122802734375,.682691991329193],[.624852001667023,.72809898853302],[.513050019741058,.547281980514526],[.51509702205658,.527251958847046],[.742246985435486,.314507007598877],[.598631024360657,.454979002475739],[.570338010787964,.548575043678284],[.578631997108459,.533622980117798],[.723087012767792,.532054007053375],[.516445994377136,.499638974666595],[.662801027297974,.282917976379395],[.70362401008606,.293271005153656],[.830704987049103,.193813979625702],[.552385985851288,.302568018436432],[.607609987258911,.353887975215912],[.645429015159607,.696707010269165],[.932694971561432,.730105042457581],[.557260990142822,.572826027870178],[.542901992797852,.584792017936707],[.6180260181427,.694710969924927],[.607590973377228,.694203019142151],[.722943007946014,.271963000297546],[.577413976192474,.563166975975037],[.614082992076874,.281386971473694],[.616907000541687,.255886018276215],[.668509006500244,.119913995265961],[.770092010498047,.232020974159241],[.635536015033722,.189248979091644],[.77039098739624,.299556016921997],[.826722025871277,.278755009174347],[.527121007442474,.666198015213013],[.553171992301941,.668527007102966],[.577238023281097,.673889994621277],[.554691970348358,.580065965652466],[.611896991729736,.693961024284363],[.59696102142334,.706539988517761],[.596370995044708,.693953037261963],[.539958000183105,.557139039039612],[.568841993808746,.692366003990173],[.547818005084991,.692366003990173],[.52461302280426,.692366003990173],[.534089982509613,.779141008853912],[.527670979499817,.736225962638855],[.526912987232208,.717857003211975],[.526877999305725,.704625964164734],[.526966989040375,.695277988910675],[.572058022022247,.695277988910675],[.573521018028259,.703539967536926],[.57683801651001,.711845993995667],[.581691026687622,.720062971115112],[.609944999217987,.639909982681274],[.986046016216278,.560034036636353],[.5867999792099,.69539999961853],[.590372025966644,.701822996139526],[.531915009021759,.601536989212036],[.577268004417419,.585934996604919],[.536915004253387,.593786001205444],[.627542972564697,.473352015018463],[.665585994720459,.495950996875763],[.588353991508484,.546862006187439],[.757824003696442,.14767599105835],[.709249973297119,.201507985591888],[.672684013843536,.256581008434296],[.600408971309662,.74900496006012],[.55826598405838,.261672019958496],[.570303976535797,.187870979309082],[.588165998458862,.109044015407562],[.711045026779175,.398952007293701],[.781069993972778,.435405015945435],[.587247014045715,.398931980133057],[.742869973182678,.355445981025696],[.572156012058258,.437651991844177],[.55186802148819,.536570012569427],[.821442008018494,.457556009292603],[.752701997756958,.457181990146637],[.71375697851181,.467626988887787],[.66711300611496,.460672974586487],[.631101012229919,.447153985500336],[.6008620262146,.432473003864288],[.523481011390686,.405627012252808],[.810747981071472,.523926019668579],[.771045982837677,.348959028720856],[.509127020835876,.562718033790588],[.595292985439301,.485023975372314],[.980530977249146,.401564002037048],[.573499977588654,.420000016689301],[.602994978427887,.548687994480133],[.733529984951019,.376977026462555],[.560611009597778,.519016981124878],[.967685997486115,.644356966018677],[.580985009670258,.387160003185272],[.537728011608124,.505385041236877],[.760966002941132,.779752969741821],[.801778972148895,.831938028335571],[.892440974712372,.54076099395752],[.816350996494293,.740260004997253],[.865594983100891,.333687007427216],[.614073991775513,.883246004581451],[.508952975273132,.579437971115112],[.617941975593567,.508316040039062],[.825608015060425,.397674977779388],[.681214988231659,.39623498916626],[.656635999679565,.400596976280212],[.603900015354156,.710216999053955],[.81208598613739,.588539004325867],[.56801301240921,.944564998149872],[.681007981300354,.898285031318665],[.733752012252808,.869701027870178],[.633830010890961,.398822009563446],[.606792986392975,.39553701877594],[.589659988880157,.391062021255493],[.805015981197357,.342108011245728],[.611334979534149,.362284004688263],[.634037971496582,.355970978736877],[.656635999679565,.355356991291046],[.681214988231659,.35834002494812],[.698584973812103,.363156020641327],[.941866993904114,.319076001644135],[.698584973812103,.387449026107788],[.584177017211914,.624107003211975],[.554318010807037,.566076993942261],[.534153997898102,.62064003944397],[.711217999458313,.819975018501282],[.664629995822906,.852871000766754],[.559099972248077,.902631998062134],[.871706008911133,.791940987110138],[.591234028339386,.373893976211548],[.544341027736664,.451583981513977],[.624562978744507,.924192011356354],[.88577002286911,.615028977394104],[.551338016986847,.695277988910675],[.551980018615723,.704632043838501],[.552887976169586,.715808033943176],[.555167973041534,.730794012546539],[.569944024085999,.767035007476807],[.593203008174896,.685675978660583],[.599261999130249,.681069016456604],[.607599973678589,.677703022956848],[.631937980651855,.663500010967255],[.752032995223999,.601315021514893],[.547226011753082,.420395016670227],[.563543975353241,.359827995300293],[.583841025829315,.368713974952698],[.586614012718201,.692366003990173],[.771915018558502,.683578014373779],[.531597018241882,.352482974529266],[.588370978832245,.804440975189209],[.52079701423645,.442565023899078],[.567984998226166,.493479013442993],[.543282985687256,.819254994392395],[.655317008495331,.745514988899231],[.621008992195129,.574018001556396],[.625559985637665,.78031200170517],[.680198013782501,.570719003677368],[.64276397228241,.604337990283966],[.704662978649139,.621529996395111],[.552012026309967,.862591981887817],[.589071989059448,.508637011051178],[.685944974422455,.775357007980347],[.645735025405884,.812640011310577],[.675342977046967,.703978002071381],[.810858011245728,.646304965019226],[.72012197971344,.714666962623596],[.866151988506317,.682704985141754],[.663187026977539,.644596993923187],[.570082008838654,.466325998306274],[.544561982154846,.548375964164734],[.562758982181549,.558784961700439],[.531987011432648,.530140042304993],[.585271000862122,.335177004337311],[.622952997684479,.32277899980545],[.655896008014679,.320163011550903],[.687132000923157,.322345972061157],[.716481983661652,.333200991153717],[.758756995201111,.382786989212036],[.897013008594513,.468769013881683],[.732392013072968,.424547016620636],[.70211398601532,.433162987232208],[.66652500629425,.433866024017334],[.633504986763,.426087975502014],[.603875994682312,.416586995124817],[.579657971858978,.409945011138916],[.992439985275269,.480777025222778],[.567192018032074,.569419980049133],[.54136598110199,.478899002075195],[.526564002037048,.546118021011353],[.523913025856018,.563830018043518],[.531529009342194,.555056989192963],[.566035985946655,.582329034805298],[.51631098985672,.563053965568542],[.5174720287323,.577877044677734],[.573594987392426,.389806985855103],[.560697972774506,.395331978797913],[.549755990505219,.399751007556915],[.710287988185883,.368252992630005],[.723330020904541,.363372981548309]]
2;function L(e){var t=void 0===e?{}:e,n=t.maxContinuousChecks,r=void 0===n?5:n,a=t.detectionConfidence,i=void 0===a?.9:a,o=t.maxFaces,s=void 0===o?10:o,u=t.iouThreshold,c=void 0===u?.3:u,l=t.scoreThreshold,h=void 0===l?.75:l;return d(this,void 0,void 0,(function(){var e,t,n;return f(this,(function(a){switch(a.label){case 0:return[4,Promise.all([D(s,c,h),P()])];case 1:return e=a.sent(),t=e[0],n=e[1],[2,new F(t,n,r,i,s)]}}))}))}function D(e,t,n){return d(this,void 0,void 0,(function(){return f(this,(function(r){return[2,y({maxFaces:e,iouThreshold:t,scoreThreshold:n})]}))}))}function P(){return d(this,void 0,void 0,(function(){return f(this,(function(e){return[2,Object(l.a)("https://tfhub.dev/mediapipe/tfjs-model/facemesh/1/default/1",{fromTFHub:!0})]}))}))}function z(e,t){if(e.mesh instanceof c.Tensor){var n=Object(c.tidy)((function(){var n=Object(c.tensor1d)([t-1,0,0]),r=Object(c.tensor1d)([1,-1,1]);return Object(c.tidy)((function(){return[Object(c.concat)([Object(c.sub)(t-1,e.boundingBox.topLeft.slice(0,1)),e.boundingBox.topLeft.slice(1,1)]),Object(c.concat)([Object(c.sub)(t-1,e.boundingBox.bottomRight.slice(0,1)),e.boundingBox.bottomRight.slice(1,1)]),Object(c.sub)(n,e.mesh).mul(r),Object(c.sub)(n,e.scaledMesh).mul(r)]}))})),r=n[0],a=n[1],i=n[2],o=n[3];return Object.assign({},e,{boundingBox:{topLeft:r,bottomRight:a},mesh:i,scaledMesh:o})}return Object.assign({},e,{boundingBox:{topLeft:[t-1-e.boundingBox.topLeft[0],e.boundingBox.topLeft[1]],bottomRight:[t-1-e.boundingBox.bottomRight[0],e.boundingBox.bottomRight[1]]},mesh:e.mesh.map((function(e){var n=e.slice(0);return n[0]=t-1-e[0],n})),scaledMesh:e.scaledMesh.map((function(e){var n=e.slice(0);return n[0]=t-1-e[0],n}))})}var F=function(){function e(e,t,n,r,a){this.pipeline=new R(e,t,192,192,n,a),this.detectionConfidence=r}return e.getAnnotations=function(){return w},e.getUVCoords=function(){return I},e.prototype.estimateFaces=function(e,t,n){return void 0===t&&(t=!1),void 0===n&&(n=!1),d(this,void 0,void 0,(function(){var r,a,i,o,s,u=this;return f(this,(function(l){switch(l.label){case 0:return r=function(e){return e instanceof c.Tensor?[e.shape[0],e.shape[1]]:[e.height,e.width]}(e),a=r[1],i=Object(c.tidy)((function(){return e instanceof c.Tensor||(e=c.browser.fromPixels(e)),e.toFloat().expandDims(0)})),"webgl"!==Object(c.getBackend)()?[3,2]:(s=Object(c.env)().get("WEBGL_PACK_DEPTHWISECONV"),Object(c.env)().set("WEBGL_PACK_DEPTHWISECONV",!0),[4,this.pipeline.predict(i)]);case 1:return o=l.sent(),Object(c.env)().set("WEBGL_PACK_DEPTHWISECONV",s),[3,4];case 2:return[4,this.pipeline.predict(i)];case 3:o=l.sent(),l.label=4;case 4:return i.dispose(),null!=o&&o.length>0?[2,Promise.all(o.map((function(e,r){return d(u,void 0,void 0,(function(){var i,o,s,u,l,h,p,m,v,g,b,y,x,O,k=this;return f(this,(function(S){switch(S.label){case 0:return i=e.coords,o=e.scaledCoords,s=e.box,u=e.flag,l=[u],t||(l=l.concat([i,o])),[4,Promise.all(l.map((function(e){return d(k,void 0,void 0,(function(){return f(this,(function(t){return[2,e.array()]}))}))})))];case 1:if(h=S.sent(),p=h[0],u.dispose(),p<this.detectionConfidence&&this.pipeline.clearRegionOfInterest(r),t)return m={faceInViewConfidence:p,mesh:i,scaledMesh:o,boundingBox:{topLeft:Object(c.tensor1d)(s.startPoint),bottomRight:Object(c.tensor1d)(s.endPoint)}},n?[2,z(m,a)]:[2,m];for(O in v=h.slice(1),g=v[0],b=v[1],o.dispose(),i.dispose(),y={faceInViewConfidence:p,boundingBox:{topLeft:s.startPoint,bottomRight:s.endPoint},mesh:g,scaledMesh:b},n&&(y=z(y,a)),x={},w)x[O]=w[O].map((function(e){return y.scaledMesh[e]}));return y.annotations=x,[2,y]}}))}))})))]:[2,[]]}}))}))},e}()},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return f}));var r=n(3),a=n.n(r),i=n(13),o=n(5),s=n(11),u=n(15),c=n(16),l=n(0),h=n(65),d=n(316),f=function(e){Object(u.a)(n,e);var t=Object(c.a)(n);function n(){return Object(o.a)(this,n),t.apply(this,arguments)}return Object(s.a)(n,[{key:"decodeUTF8",value:function(){return new p(this)}}]),n}(h.a),p=function(e){Object(u.a)(n,e);var t=Object(c.a)(n);function n(e){var r;return Object(o.a)(this,n),(r=t.call(this)).upstream=e,r.impl=new m(e),r}return Object(s.a)(n,[{key:"summary",value:function(){return this.impl.summary()}},{key:"next",value:function(){var e=Object(i.a)(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.impl.next());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(d.a),m=function(t){Object(u.a)(h,t);var r=Object(c.a)(h);function h(e){var t;if(Object(o.a)(this,h),(t=r.call(this)).upstream=e,Object(l.env)().get("IS_BROW
2SER"))t.decoder=new TextDecoder("utf-8");else{var a=n(361).StringDecoder;t.decoder=new a("utf8")}return t}return Object(s.a)(h,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> Utf8")}},{key:"pump",value:function(){var t=Object(i.a)(a.a.mark((function t(){var n,r,i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.upstream.next();case 2:if(!(n=t.sent).done){t.next=7;break}return t.abrupt("return",!1);case 7:r=n.value;case 8:return i=Object(l.env)().get("IS_BROWSER")?this.decoder.decode(r,{stream:!0}):this.decoder.write(e.from(r.buffer)),this.outputQueue.push(i),t.abrupt("return",!0);case 11:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()}]),h}(h.b)}).call(this,n(116).Buffer)},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(18),a=n(3),i=n.n(a),o=n(13),s=n(5),u=n(11),c=n(15),l=n(16),h=n(65),d=function(e){Object(c.a)(n,e);var t=Object(l.a)(n);function n(){return Object(s.a)(this,n),t.apply(this,arguments)}return Object(u.a)(n,[{key:"split",value:function(e){return new f(this,e)}}]),n}(h.a),f=function(e){Object(c.a)(n,e);var t=Object(l.a)(n);function n(e,r){var a;return Object(s.a)(this,n),(a=t.call(this)).upstream=e,a.impl=new p(e,r),a}return Object(u.a)(n,[{key:"summary",value:function(){return this.impl.summary()}},{key:"next",value:function(){var e=Object(o.a)(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.impl.next());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(d),p=function(e){Object(c.a)(n,e);var t=Object(l.a)(n);function n(e,r){var a;return Object(s.a)(this,n),(a=t.call(this)).upstream=e,a.separator=r,a.carryover="",a}return Object(u.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> Split('").concat(this.separator,"')")}},{key:"pump",value:function(){var e=Object(o.a)(i.a.mark((function e(){var t,n,a,o,s;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.upstream.next();case 2:if(!(t=e.sent).done){e.next=9;break}if(""!==this.carryover){e.next=6;break}return e.abrupt("return",!1);case 6:return this.outputQueue.push(this.carryover),this.carryover="",e.abrupt("return",!0);case 9:(n=t.value.split(this.separator))[0]=this.carryover+n[0],a=Object(r.a)(n.slice(0,-1));try{for(a.s();!(o=a.n()).done;)s=o.value,this.outputQueue.push(s)}catch(i){a.e(i)}finally{a.f()}return this.carryover=n[n.length-1],e.abrupt("return",!0);case 15:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(h.b)},function(e,t){e.exports=function(e,t,n,r){var a=n?n.call(r,e,t):void 0;if(void 0!==a)return!!a;if(e===t)return!0;if("object"!==typeof e||!e||"object"!==typeof t||!t)return!1;var i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),u=0;u<i.length;u++){var c=i[u];if(!s(c))return!1;var l=e[c],h=t[c];if(!1===(a=n?n.call(r,l,h,c):void 0)||void 0===a&&l!==h)return!1}return!0}},function(e,t,n){"use strict";t.a=function(e){function t(e,t,r){var a=t.trim().split(p);t=a;var i=a.length,o=e.length;switch(o){case 0:case 1:var s=0;for(e=0===o?"":e[0]+" ";s<i;++s)t[s]=n(e,t[s],r).trim();break;default:var u=s=0;for(t=[];s<i;++s)for(var c=0;c<o;++c)t[u++]=n(e[c]+" ",a[s],r).trim()}return t}function n(e,t,n){var r=t.charCodeAt(0);switch(33>r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*n&&0<t.indexOf("\f"))return t.replace(m,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function r(e,t,n,i){var o=e+";",s=2*t+3*n+4*i;if(944===s){e=o.indexOf(":",9)+1;var u=o.substring(e,o.length-1).trim();return u=o.substring(0,e).trim()+u+";",1===C||2===C&&a(u,1)?"-webkit-"+u+u:u}if(0===C||2===C&&!a(o,1))return o;switch(s){case 1015:return 97===o.charCodeAt(10)?"-webkit-"+o+o:o;case 951:return 116===o.charCodeAt(3)?"-webkit-"+o+o:o;
vendor: 4,109 bytes, line 2
2case 963:return 110===o.charCodeAt(5)?"-webkit-"+o+o:o;case 1009:if(100!==o.charCodeAt(4))break;case 969:case 942:return"-webkit-"+o+o;case 978:return"-webkit-"+o+"-moz-"+o+o;case 1019:case 983:return"-webkit-"+o+"-moz-"+o+"-ms-"+o+o;case 883:if(45===o.charCodeAt(8))return"-webkit-"+o+o;if(0<o.indexOf("image-set(",11))return o.replace(_,"$1-webkit-$2")+o;break;case 932:if(45===o.charCodeAt(4))switch(o.charCodeAt(5)){case 103:return"-webkit-box-"+o.replace("-grow","")+"-webkit-"+o+"-ms-"+o.replace("grow","positive")+o;case 115:return"-webkit-"+o+"-ms-"+o.replace("shrink","negative")+o;case 98:return"-webkit-"+o+"-ms-"+o.replace("basis","preferred-size")+o}return"-webkit-"+o+"-ms-"+o+o;case 964:return"-webkit-"+o+"-ms-flex-"+o+o;case 1023:if(99!==o.charCodeAt(8))break;return"-webkit-box-pack"+(u=o.substring(o.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+o+"-ms-flex-pack"+u+o;case 1005:return d.test(o)?o.replace(h,":-webkit-")+o.replace(h,":-moz-")+o:o;case 1e3:switch(t=(u=o.substring(13).trim()).indexOf("-")+1,u.charCodeAt(0)+u.charCodeAt(t)){case 226:u=o.replace(y,"tb");break;case 232:u=o.replace(y,"tb-rl");break;case 220:u=o.replace(y,"lr");break;default:return o}return"-webkit-"+o+"-ms-"+u+o;case 1017:if(-1===o.indexOf("sticky",9))break;case 975:switch(t=(o=e).length-10,s=(u=(33===o.charCodeAt(t)?o.substring(0,t):o).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|u.charCodeAt(7))){case 203:if(111>u.charCodeAt(8))break;case 115:o=o.replace(u,"-webkit-"+u)+";"+o;break;case 207:case 102:o=o.replace(u,"-webkit-"+(102<s?"inline-":"")+"box")+";"+o.replace(u,"-webkit-"+u)+";"+o.replace(u,"-ms-"+u+"box")+";"+o}return o+";";case 938:if(45===o.charCodeAt(5))switch(o.charCodeAt(6)){case 105:return u=o.replace("-items",""),"-webkit-"+o+"-webkit-box-"+u+"-ms-flex-"+u+o;case 115:return"-webkit-"+o+"-ms-flex-item-"+o.replace(O,"")+o;default:return"-webkit-"+o+"-ms-flex-line-pack"+o.replace("align-content","").replace(O,"")+o}break;case 973:case 989:if(45!==o.charCodeAt(3)||122===o.charCodeAt(4))break;case 931:case 953:if(!0===S.test(e))return 115===(u=e.substring(e.indexOf(":")+1)).charCodeAt(0)?r(e.replace("stretch","fill-available"),t,n,i).replace(":fill-available",":stretch"):o.replace(u,"-webkit-"+u)+o.replace(u,"-moz-"+u.replace("fill-",""))+o;break;case 962:if(o="-webkit-"+o+(102===o.charCodeAt(5)?"-ms-"+o:"")+o,211===n+i&&105===o.charCodeAt(13)&&0<o.indexOf("transform",10))return o.substring(0,o.indexOf(";",27)+1).replace(f,"$1-webkit-$2")+o}return o}function a(e,t){var n=e.indexOf(1===t?":":"{"),r=e.substring(0,3!==t?n:10);return n=e.substring(n+1,e.length-1),R(2!==t?r:r.replace(k,"$1"),n,t)}function i(e,t){var n=r(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return n!==t+";"?n.replace(w," or ($1)").substring(4):"("+t+")"}function o(e,t,n,r,a,i,o,s,c,l){for(var h,d=0,f=t;d<N;++d)switch(h=A[d].call(u,e,f,n,r,a,i,o,s,c,l)){case void 0:case!1:case!0:case null:break;default:f=h}if(f!==t)return f}function s(e){return void 0!==(e=e.prefix)&&(R=null,e?"function"!==typeof e?C=1:(C=2,R=e):C=0),s}function u(e,n){var s=e;if(33>s.charCodeAt(0)&&(s=s.trim()),s=[s],0<N){var u=o(-1,n,s,s,E,j,0,0,0,0);void 0!==u&&"string"===typeof u&&(n=u)}var h=function e(n,s,u,h,d){for(var f,p,m,y,w,O=0,k=0,S=0,_=0,A=0,R=0,L=m=f=0,D=0,P=0,z=0,F=0,B=u.length,U=B-1,W="",V="",G="",H="";D<B;){if(p=u.charCodeAt(D),D===U&&0!==k+_+S+O&&(0!==k&&(p=47===k?10:47),_=S=O=0,B++,U++),0===k+_+S+O){if(D===U&&(0<P&&(W=W.replace(l,"")),0<W.trim().length)){switch(p){case 32:case 9:case 59:case 13:case 10:break;default:W+=u.charAt(D)}p=59}switch(p){case 123:for(f=(W=W.trim()).charCodeAt(0),m=1,F=++D;D<B;){switch(p=u.charCodeAt(D)){case 123:m++;break;case 125:m--;break;case 47:switch(p=u.charCodeAt(D+1)){case 42:case 47:e:{for(L=D+1;L<U;++L)switch(u.charCodeAt(L)){case 47:if(42===p&&42===u.charCodeAt(L-1)&&D+2!==L){D=L+1;break e}break;case 10:if(47===p){D=L+1;break e}}D=L}}break;case 91:p++;case 40:p++;case 34:case 39:for(;D++<U&&u.charCodeAt(D)!==p;);}if(0===m)break;D++}switch(m=u.substring(F,D),0===f&&(f=(W=W.replace(c,"").trim()).charCo
2deAt(0)),f){case 64:switch(0<P&&(W=W.replace(l,"")),p=W.charCodeAt(1)){case 100:case 109:case 115:case 45:P=s;break;default:P=M}if(F=(m=e(s,P,m,p,d+1)).length,0<N&&(w=o(3,m,P=t(M,W,z),s,E,j,F,p,d,h),W=P.join(""),void 0!==w&&0===(F=(m=w.trim()).length)&&(p=0,m="")),0<F)switch(p){case 115:W=W.replace(x,i);case 100:case 109:case 45:m=W+"{"+m+"}";break;case 107:m=(W=W.replace(v,"$1 $2"))+"{"+m+"}",m=1===C||2===C&&a("@"+m,3)?"@-webkit-"+m+"@"+m:"@"+m;break;default:m=W+m,112===h&&(V+=m,m="")}else m="";break;default:m=e(s,t(s,W,z),m,h,d+1)}G+=m,m=z=P=L=f=0,W="",p=u.charCodeAt(++D);break;case 125:case 59:if(1<(F=(W=(0<P?W.replace(l,""):W).trim()).length))switch(0===L&&(f=W.charCodeAt(0),45===f||96<f&&123>f)&&(F=(W=W.replace(" ",":")).length),0<N&&void 0!==(w=o(1,W,s,n,E,j,V.length,h,d,h))&&0===(F=(W=w.trim()).length)&&(W="\0\0"),f=W.charCodeAt(0),p=W.charCodeAt(1),f){case 0:break;case 64:if(105===p||99===p){H+=W+u.charAt(D);break}default:58!==W.charCodeAt(F-1)&&(V+=r(W,f,p,W.charCodeAt(2)))}z=P=L=f=0,W="",p=u.charCodeAt(++D)}}switch(p){case 13:case 10:47===k?k=0:0===1+f&&107!==h&&0<W.length&&(P=1,W+="\0"),0<N*I&&o(0,W,s,n,E,j,V.length,h,d,h),j=1,E++;break;case 59:case 125:if(0===k+_+S+O){j++;break}default:switch(j++,y=u.charAt(D),p){case 9:case 32:if(0===_+O+k)switch(A){case 44:case 58:case 9:case 32:y="";break;default:32!==p&&(y=" ")}break;case 0:y="\\0";break;case 12:y="\\f";break;case 11:y="\\v";break;case 38:0===_+k+O&&(P=z=1,y="\f"+y);break;case 108:if(0===_+k+O+T&&0<L)switch(D-L){case 2:112===A&&58===u.charCodeAt(D-3)&&(T=A);case 8:111===R&&(T=R)}break;case 58:0===_+k+O&&(L=D);break;case 44:0===k+S+_+O&&(P=1,y+="\r");break;case 34:case 39:0===k&&(_=_===p?0:0===_?p:_);break;case 91:0===_+k+S&&O++;break;case 93:0===_+k+S&&O--;break;case 41:0===_+k+O&&S--;break;case 40:if(0===_+k+O){if(0===f)switch(2*A+3*R){case 533:break;default:f=1}S++}break;case 64:0===k+S+_+O+L+m&&(m=1);break;case 42:case 47:if(!(0<_+O+S))switch(k){case 0:switch(2*p+3*u.charCodeAt(D+1)){case 235:k=47;break;case 220:F=D,k=42}break;case 42:47===p&&42===A&&F+2!==D&&(33===u.charCodeAt(F+2)&&(V+=u.substring(F,D+1)),y="",k=0)}}0===k&&(W+=y)}R=A,A=p,D++}if(0<(F=V.length)){if(P=s,0<N&&(void 0!==(w=o(2,V,P,n,E,j,F,h,d,h))&&0===(V=w).length))return H+V+G;if(V=P.join(",")+"{"+V+"}",0!==C*T){switch(2!==C||a(V,2)||(T=0),T){case 111:V=V.replace(b,":-moz-$1")+V;break;case 112:V=V.replace(g,"::-webkit-input-$1")+V.replace(g,"::-moz-$1")+V.replace(g,":-ms-input-$1")+V}T=0}}return H+V+G}(M,s,n,0,0);return 0<N&&(void 0!==(u=o(-2,h,s,s,E,j,h.length,0,0,0))&&(h=u)),"",T=0,j=E=1,h}var c=/^\0+/g,l=/[\0\r\f]/g,h=/: */g,d=/zoo|gra/,f=/([,: ])(transform)/g,p=/,\r+?/g,m=/([\t\r\n ])*\f?&/g,v=/@(k\w+)\s*(\S*)\s*/,g=/::(place)/g,b=/:(read-only)/g,y=/[svh]\w+-[tblr]{2}/,x=/\(\s*(.*)\s*\)/g,w=/([\s\S]*?);/g,O=/-self|flex-/g,k=/[^]*?(:[rp][el]a[\w-]+)[^]*/,S=/stretch|:\s*\w+\-(?:conte|avail)/,_=/([^-])(image-set\()/,j=1,E=1,T=0,C=1,M=[],A=[],N=0,R=null,I=0;return u.use=function e(t){switch(t){case void 0:case null:N=A.length=0;break;default:if("function"===typeof t)A[N++]=t;else if("object"===typeof t)for(var n=0,r=t.length;n<r;++n)e(t[n]);else I=0|!!t}return e},u.set=s,void 0!==e&&s(e),u}},function(e,t,n){"use strict";t.a={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},function(e,t,n){var r,a,i;a=[e],void 0===(i="function"===typeof(r=function(e){"use strict";function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t,i,o,s){var u,l,h,d,f,p,m,v,g,b,y,x,w;if(2===e.length)return x=c.vectorLen(c.subtract(e[0],e[1]))/3,[u=[e[0],c.addArrays(e[0],c.mulItems(t,x)),c.addArrays(e[1],c.mulItems(i,x)),e[1]]];l=function(e){var t,n,r,a=[];return e.forEach((function(e,i){t=i?n+c.vectorLen(c.subtract(e,r)):0,a.push(t),n=t,r=e})),a=a.map((function(e){return e/n}))}(e);var O=r(e,l,l,t,i,s);if(u=O[0],d=O[1],p=O[2],0===d||d<o)return[u];if(d<o*o)for(h=l,f=d,m=p,w=0;w<20;w++){var k=r(e,l,h=a(u,e,h),t,i,s);if(u=k[0],d=k[1],p=k[2],d<o)return[u];if(p===m){var S=d/f;if(S>.9999&&S<1.0001)break}f=d,m=p}if(y=[],(v=c.subtract(e[p-1],e[p+1])).every((function(e){return 0===e}))){var _=[-(v=c.subtract(e[p-1],e[p]))[1],v[0]];v[0]=_[0],v[1]=_[1]}return g=c.normalize(v),b=c.mulItems(g,-1),y=(y=y.concat(n(e.slice(0,p+1),t,g,o,s))).concat(n(e.slice(p),b,i,o,s))}function r(e,t,n,r,a,i){var u,h,d,f=function(e,t,n){var r,a,i,u,h,d,f,p;a=0,i=Math.floor(e.length/2);var m=o(t,10);for(h=0,d=e.length;h<d;h++)f=e[h],p=s(0,n[h],m,10),u=c.subtract(l.q(t,p),f),(r=u[0]*u[0]+u[1]*u[1])>a&&(a=r,i=h);return[a,i]}(e,u=function(e,t,n,r){var a,i,o,s,u,h,d,f,p,m,v,g,b,y,x,w,O,k=e[0],S=e[e.length-1];for(a=[k,null,null,S],i=c.zeros_Xx2x2(t.length),b=0,y=t.length;b<y;b++)w=t[b],O=1-w,(o=i[b])[0]=c.mulItems(n,3*w*(O*O)),o[1]=c.mulItems(r,3*O*(w*w));for(s=[[0,0],[0,0]],u=[0,0],b=0,y=e.length;b<y;b++)w=t[b],o=i[b],s[0][0]+=c.dot(o[0],o[0]),s[0][1]+=c.dot(o[0],o[1]),s[1][0]+=c.dot(o[0],o[1]),s[1][1]+=c.dot(o[1],o[1]),x=c.subtract(e[b],l.q([k,k,S,S],w)),u[0]+=c.dot(o[0],x),u[1]+=c.dot(o[1],x);return h=s[0][0]*s[1][1]-s[1][0]*s[0][1],d=s[0][0]*u[1]-s[1][0]*u[0],f=u[0]*s[1][1]-u[1]*s[0][1],p=0===h?0:f/h,m=0===h?0:d/h,g=c.vectorLen(c.subtract(k,S)),p<(v=1e-6*g)||m<v?(a[1]=c.addArrays(k,c.mulItems(n,g/3)),a[2]=c.addArrays(S,c.mulItems(r,g/3))):(a[1]=c.addArrays(k,c.mulItems(n,p)),a[2]=c.addArrays(S,c.mulItems(r,m))),a}(e,n,r,a),t);return h=f[0],d=f[1],i&&i({bez:u,points:e,params:t,maxErr:h,maxPoint:d}),[u,h,d]}function a(e,t,n){return n.map((function(n,r){return i(e,t[r],n)}))}function i(e,t,n){var r=c.subtract(l.q(e,n),t),a=l.qprime(e,n),i=c.mulMatrix(r,a),o=c.sum(c.squareItems(a))+2*c.mulMatrix(r,l.qprimeprime(e,n));return 0===o?n:n-i/o}var o=function(e,t){for(var n,r=[0],a=e[0],i=0,o=1;o<=t;o++)n=l.q(e,o/t),i+=c.vectorLen(c.subtract(n,a)),r.push(i),a=n;return r=r.map((function(e){return e/i}))};function s(e,t,n,r){if(t<0)return 0;if(t>1)return 1;for(var a,i,o,s,u=1;u<=r;u++)if(t<=n[u]){o=(u-1)/r,i=u/r,s=(t-(a=n[u-1]))/(n[u]-a)*(i-o)+o;break}return s}function u(e,t){return c.normalize(c.subtract(e,t))}var c=function(){function e(){t(this,e)}return e.zeros_Xx2x2=function(e){for(var t=[];e--;)t.push([0,0]);return t},e.mulItems=function(e,t){return e.map((function(e){return e*t}))},e.mulMatrix=function(e,t){return e.reduce((function(e,n,r){return e+n*t[r]}),0)},e.subtract=function(e,t){return e.map((function(e,n){return e-t[n]}))},e.addArrays=function(e,t){return e.map((function(e,n){return e+t[n]}))},e.addItems=function(e,t){return e.map((function(e){return e+t}))},e.sum=function(e){return e.reduce((function(e,t){return e+t}))},e.dot=function(t,n){return e.mulMatrix(t,n)},e.vectorLen=function(e){return Math.hypot.apply(Math,e)},e.divItems=function(e,t){return e.map((function(e){return e/t}))},e.squareItems=function(e){return e.map((function(e){return e*e}))},e.normalize=function(e){return this.divItems(e,this.vectorLen(e))},e}(),l=function(){function e(){t(this,e)}return e.q=function(e,t){var n=1-t,r=c.mulItems(e[0],n*n*n),a=c.mulItems(e[1],3*n*n*t),i=c.mulItems(e[2],3*n*t*t),o=c.mulItems(e[3],t*t*t);return c.addArrays(c.addArrays(r,a),c.addArrays(i,o))},e.qprime=function(e,t){var n=1-t,r=c.mulItems(c.subtract(e[1],e[0]),3*n*n),a=c.mulItems(c.subtract(e[2],e[1]),6*n*t),i=c.mulItems(c.subtract(e[3],e[2]),3*t*t);return c.addArrays(c.addArrays(r,a),i)},e.qprimeprime=function(e,t){return c.addArrays(c.mulItems(c.addArrays(c.subtract(e[2],c.mulItems(e[1],2)),e[0]),6*(1-t)),c.mulItems(c.addArrays(c.subtract(e[3],c.mulItems(e[2],2)),e[1]),6*t))},e}();e.exports=function(e,t,r){if(!Array.isArray(e))throw new TypeError("First argument should be an array");if(e.forEach((function(t){if(!Array.isArray(t)||t.some((function(e){return"number"!==typeof e}
2))||t.length!==e[0].length)throw Error("Each point should be an array of numbers. Each point should have the same amount of numbers.")})),(e=e.filter((function(t,n){return 0===n||!t.every((function(t,r){return t===e[n-1][r]}))}))).length<2)return[];var a=e.length,i=u(e[1],e[0]),o=u(e[a-2],e[a-1]);return n(e,i,o,t,r)},e.exports.fitCubic=n,e.exports.createTangent=u})?r.apply(t,a):r)||(e.exports=i)},function(e,t,n){e.exports=function(){var e=function e(){function t(e){return a.appendChild(e.dom),e}function n(e){for(var t=0;t<a.children.length;t++)a.children[t].style.display=t===e?"block":"none";r=e}var r=0,a=document.createElement("div");a.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",a.addEventListener("click",(function(e){e.preventDefault(),n(++r%a.children.length)}),!1);var i=(performance||Date).now(),o=i,s=0,u=t(new e.Panel("FPS","#0ff","#002")),c=t(new e.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var l=t(new e.Panel("MB","#f08","#201"));return n(0),{REVISION:16,dom:a,addPanel:t,showPanel:n,begin:function(){i=(performance||Date).now()},end:function(){s++;var e=(performance||Date).now();if(c.update(e-i,200),e>
2o+1e3&&(u.update(1e3*s/(e-o),100),o=e,s=0,l)){var t=performance.memory;l.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){i=this.end()},domElement:a,setMode:n}};return e.Panel=function(e,t,n){var r=1/0,a=0,i=Math.round,o=i(window.devicePixelRatio||1),s=80*o,u=48*o,c=3*o,l=2*o,h=3*o,d=15*o,f=74*o,p=30*o,m=document.createElement("canvas");m.width=s,m.height=u,m.style.cssText="width:80px;height:48px";var v=m.getContext("2d");return v.font="bold "+9*o+"px Helvetica,Arial,sans-serif",v.textBaseline="top",v.fillStyle=n,v.fillRect(0,0,s,u),v.fillStyle=t,v.fillText(e,c,l),v.fillRect(h,d,f,p),v.fillStyle=n,v.globalAlpha=.9,v.fillRect(h,d,f,p),{dom:m,update:function(u,g){r=Math.min(r,u),a=Math.max(a,u),v.fillStyle=n,v.globalAlpha=1,v.fillRect(0,0,s,d),v.fillStyle=t,v.fillText(i(u)+" "+e+" ("+i(r)+"-"+i(a)+")",c,l),v.drawImage(m,h+o,d,f-o,p,h,d,f-o,p),v.fillRect(h+f-o,d,o,p),v.fillStyle=n,v.globalAlpha=.9,v.fillRect(h+f-o,d,o,i((1-u/g)*p))}}},e}()},function(e,t,n){"use strict";var r=n(93);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(1)),i=(0,r(n(97)).default)(a.default.createElement(a.default.Fragment,null,a.default.createElement("path",{d:"M20 5h-3.17L15 3H9L7.17 5H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 14H4V7h4.05l.59-.65L9.88 5h4.24l1.24 1.35.59.65H20v12z"}),a.default.createElement("path",{d:"M12 17c-2.21 0-4-1.79-4-4h2l-2.5-2.5L5 13h2c0 2.76 2.24 5 5 5 .86 0 1.65-.24 2.36-.62l-.74-.74c-.49.23-1.04.36-1.62.36zM12 8c-.86 0-1.65.24-2.36.62l.74.73C10.87 9.13 11.42 9 12 9c2.21 0 4 1.79 4 4h-2l2.5 2.5L19 13h-2c0-2.76-2.24-5-5-5z"})),"FlipCameraIosOutlined");t.default=i},,function(e,t,n){"use strict";var r=n(93);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(1)),i=(0,r(n(97)).default)(a.default.createElement("path",{d:"M8 5v14l11-7z"}),"PlayArrow");t.default=i},function(e,t,n){(function(t,n,r){e.exports=function e(t,n,r){function a(o,s){if(!n[o]){if(!t[o]){if(i)return i(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[o]={exports:{}};t[o][0].call(c.exports,(function(e){return a(t[o][1][e]||e)}),c,c.exports,e,t,n,r)}return n[o].exports}for(var i=!1,o=0;o<r.length;o++)a(r[o]);return a}({1:[function(e,t,n){"use strict";var r=e("./utils"),a=e("./support"),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.encode=function(e){for(var t,n,a,o,s,u,c,l=[],h=0,d=e.length,f=d,p="string"!==r.getTypeOf(e);h<e.length;)f=d-h,a=p?(t=e[h++],n=h<d?e[h++]:0,h<d?e[h++]:0):(t=e.charCodeAt(h++),n=h<d?e.charCodeAt(h++):0,h<d?e.charCodeAt(h++):0),o=t>>2,s=(3&t)<<4|n>>4,u=1<f?(15&n)<<2|a>>6:64,c=2<f?63&a:64,l.push(i.charAt(o)+i.charAt(s)+i.charAt(u)+i.charAt(c));return l.join("")},n.decode=function(e){var t,n,r,o,s,u,c=0,l=0,h="data:";if(e.substr(0,h.length)===h)throw new Error("Invalid base64 input, it looks like a data url.");var d,f=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===i.charAt(64)&&f--,e.charAt(e.length-2)===i.charAt(64)&&f--,f%1!=0)throw new Error("Invalid base64 input, bad content length.");for(d=a.uint8array?new Uint8Array(0|f):new Array(0|f);c<e.length;)t=i.indexOf(e.charAt(c++))<<2|(o=i.indexOf(e.charAt(c++)))>>4,n=(15&o)<<4|(s=i.indexOf(e.charAt(c++)))>>2,r=(3&s)<<6|(u=i.indexOf(e.charAt(c++))),d[l++]=t,64!==s&&(d[l++]=n),64!==u&&(d[l++]=r);return d}},{"./support":30,"./utils":32}],2:[function(e,t,n){"use strict";var r=e("./external"),a=e("./stream/DataWorker"),i=e("./stream/DataLengthProbe"),o=e("./stream/Crc32Probe");function s(e,t,n,r,a){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=a}i=e("./stream/DataLengthProbe"),s.prototype={getContentWorker:function(){var e=new a(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new i("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new a(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new o).pipe(new i("uncompressedSize")).pipe(t.compressWorker(n)).pipe(new i("compressedSize")).withStreamInfo("compression",t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){"use strict";var r=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(e){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){"use strict";var r=e("./utils"),a=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==r.getTypeOf(e)?function(e,t,n,r){var i=a,o=0+n;e^=-1;for(var s=0;s<o;s++)e=e>>>8^i[255&(e^t[s])];return-1^e}(0|t,e,e.length):function(e,t,n,r){var i=a,o=0+n;e^=-1;for(var s=0;s<o;s++)e=e>>>8^i[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length):0}},{"./utils":32}],5:[function(e,t,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){"use strict";var r;r="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,a=e("pako"),i=e("./utils"),o=e("./stream/GenericWorker"),s=r?"uint8array":"array";
vendor: 7,241 bytes, line 2
2function u(e,t){o.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic="\b\0",i.inherits(u,o),u.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(i.transformTo(s,e.data),!1)},u.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new a[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new u("Deflate",e)},n.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){"use strict";function r(e,t){var n,r="";for(n=0;n<t;n++)r+=String.fromCharCode(255&e),e>>>=8;return r}function a(e,t,n,a,o,l){var h,d,f=e.file,p=e.compression,m=l!==s.utf8encode,v=i.transformTo("string",l(f.name)),g=i.transformTo("string",s.utf8encode(f.name)),b=f.comment,y=i.transformTo("string",l(b)),x=i.transformTo("string",s.utf8encode(b)),w=g.length!==f.name.length,O=x.length!==b.length,k="",S="",_="",j=f.dir,E=f.date,T={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(T.crc32=e.crc32,T.compressedSize=e.compressedSize,T.uncompressedSize=e.uncompressedSize);var C=0;t&&(C|=8),m||!w&&!O||(C|=2048);var M=0,A=0;j&&(M|=16),"UNIX"===o?(A=798,M|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(f.unixPermissions,j)):(A=20,M|=function(e){return 63&(e||0)}(f.dosPermissions)),h=E.getUTCHours(),h<<=6,h|=E.getUTCMinutes(),h<<=5,h|=E.getUTCSeconds()/2,d=E.getUTCFullYear()-1980,d<<=4,d|=E.getUTCMonth()+1,d<<=5,d|=E.getUTCDate(),w&&(S=r(1,1)+r(u(v),4)+g,k+="up"+r(S.length,2)+S),O&&(_=r(1,1)+r(u(y),4)+x,k+="uc"+r(_.length,2)+_);var N="";return N+="\n\0",N+=r(C,2),N+=p.magic,N+=r(h,2),N+=r(d,2),N+=r(T.crc32,4),N+=r(T.compressedSize,4),N+=r(T.uncompressedSize,4),N+=r(v.length,2),N+=r(k.length,2),{fileRecord:c.LOCAL_FILE_HEADER+N+v+k,dirRecord:c.CENTRAL_FILE_HEADER+r(A,2)+N+r(y.length,2)+"\0\0\0\0"+r(M,4)+r(a,4)+v+k+y}}var i=e("../utils"),o=e("../stream/GenericWorker"),s=e("../utf8"),u=e("../crc32"),c=e("../signature");function l(e,t,n,r){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}i.inherits(l,o),l.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},l.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=a(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},l.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=a(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:function(e){return c.DATA_DESCRIPTOR+r(e.crc32,4)+r(e.compressedSize,4)+r(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},l.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var n=this.bytesWritten-e,a=function(e,t,n,a,o){var s=i.transformTo("string",o(a));return c.CENTRAL_DIRECTORY_END+"\0\0\0\0"+r(e,2)+r(e,2)+r(t,4)+r(n,4)+r(s.length,2)+s}(this.dirRecords.length,n,e,this.zipComment,this.encodeFileName);this.push({data:a,meta:{percent:100}})},l.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},l.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()})),e.on("error",(function(e){t.error(e)})),this},l.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},l.prototype.error=function(e){var t=this._sources;if(!o.prototype.error.call(this,e))return!1;for(var n=0;n<t.length;n++)try{t[n].error(e)}catch(e){}return!0},l.prototype.lock=function(){o.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=l},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,n){"use strict";var r=e("../compressions"),a=e("./ZipFileWorker");n.generateWorker=function(e,t,n){var i=new a(t.streamFiles,n,t.platform,t.encodeFileName),o=0;try{e.forEach((function(e,n){o++;var a=function(e,t){var n=e||t,a=r[n];if(!a)throw new Error(n+" is not a valid compression method !");return a}(n.options.compression,t.compression),s=n.options.compressionOptions||t.compressionOptions||{},u=n.dir,c=n.date;n._compressWorker(a,s).withStreamInfo("file",{name:e,dir:u,date:c,comment:n.comment||"",unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions}).pipe(i)})),i.entriesCount=o}catch(e){i.error(e)}return i}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,n){"use strict";function r(){if(!(this instanceof r))return new r;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var e=new r;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}(r.prototype=e("./object")).loadAsync=e("./load"),r.support=e("./support"),r.defaults=e("./defaults"),r.version="3.5.0",r.loadAsync=function(e,t){return(new r).loadAsync(e,t)},r.external=e("./external"),t.exports=r},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,n){"use strict";var r=e("./utils"),a=e("./external"),i=e("./utf8"),o=(r=e("./utils"),e("./zipEntries")),s=e("./stream/Crc32Probe"),u=e("./nodejsUtils");function c(e){return new a.Promise((function(t,n){var r=e.decompressed.getContentWorker().pipe(new s);r.on("error",(function(e){n(e)})).on("end",(function(){r.streamInfo.crc32!==e.decompressed.crc32?n(new Error("Corrupted zip : CRC32 mismatch")):t()})).resume()}))}t.exports=function(e,t){var n=this;return t=r.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:i.utf8decode}),u.isNode&&u.isStream(e)?a.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):r.prepareContent("the loaded zip f
2ile",e,!0,t.optimizedBinaryString,t.base64).then((function(e){var n=new o(t);return n.load(e),n})).then((function(e){var n=[a.Promise.resolve(e)],r=e.files;if(t.checkCRC32)for(var i=0;i<r.length;i++)n.push(c(r[i]));return a.Promise.all(n)})).then((function(e){for(var r=e.shift(),a=r.files,i=0;i<a.length;i++){var o=a[i];n.file(o.fileNameStr,o.decompressed,{binary:!0,optimizedBinaryString:!0,date:o.date,dir:o.dir,comment:o.fileCommentStr.length?o.fileCommentStr:null,unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions,createFolders:t.createFolders})}return r.zipComment.length&&(n.comment=r.zipComment),n}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,n){"use strict";var r=e("../utils"),a=e("../stream/GenericWorker");function i(e,t){a.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}r.inherits(i,a),i.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on("data",(function(e){t.push({data:e,meta:{percent:0}})})).on("error",(function(e){t.isPaused?this.generatedError=e:t.error(e)})).on("end",(function(){t.isPaused?t._upstreamEnded=!0:t.end()}))},i.prototype.pause=function(){return!!a.prototype.pause.call(this)&&(this._stream.pause(),!0)},i.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=i},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,n){"use strict";var r=e("readable-stream").Readable;function a(e,t,n){r.call(this,t),this._helper=e;var a=this;e.on("data",(function(e,t){a.push(e)||a._helper.pause(),n&&n(t)})).on("error",(function(e){a.emit("error",e)})).on("end",(function(){a.push(null)}))}e("../utils").inherits(a,r),a.prototype._read=function(){this._helper.resume()},t.exports=a},{"../utils":32,"readable-stream":16}],14:[function(e,n,r){"use strict";n.exports={isNode:"undefined"!=typeof t,newBufferFrom:function(e,n){if(t.from&&t.from!==Uint8Array.from)return t.from(e,n);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new t(e,n)},allocBuffer:function(e){if(t.alloc)return t.alloc(e);var n=new t(e);return n.fill(0),n},isBuffer:function(e){return t.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},{}],15:[function(e,t,n){"use strict";function r(e,t,n){var r,a=i.getTypeOf(t),s=i.extend(n||{},u);s.date=s.date||new Date,null!==s.compression&&(s.compression=s.compression.toUpperCase()),"string"==typeof s.unixPermissions&&(s.unixPermissions=parseInt(s.unixPermissions,8)),s.unixPermissions&&16384&s.unixPermissions&&(s.dir=!0),s.dosPermissions&&16&s.dosPermissions&&(s.dir=!0),s.dir&&(e=m(e)),s.createFolders&&(r=p(e))&&v.call(this,r,!0);var h,g="string"===a&&!1===s.binary&&!1===s.base64;n&&void 0!==n.binary||(s.binary=!g),(t instanceof c&&0===t.uncompressedSize||s.dir||!t||0===t.length)&&(s.base64=!1,s.binary=!0,t="",s.compression="STORE",a="string"),h=t instanceof c||t instanceof o?t:d.isNode&&d.isStream(t)?new f(e,t):i.prepareContent(e,t,s.binary,s.optimizedBinaryString,s.base64);var b=new l(e,h,s);this.files[e]=b}var a=e("./utf8"),i=e("./utils"),o=e("./stream/GenericWorker"),s=e("./stream/StreamHelper"),u=e("./defaults"),c=e("./compressedObject"),l=e("./zipObject"),h=e("./generate"),d=e("./nodejsUtils"),f=e("./nodejs/NodejsStreamInputAdapter"),p=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return 0<t?e.substring(0,t):""},m=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},v=function(e,t){return t=void 0!==t?t:u.createFolders,e=m(e),this.files[e]||r.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function g(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var b={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,n,r;for(t in this.files)this.files.hasOwnProperty(t)&&(r=this.files[t],(n=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(n,r))},filter:function(e){var t=[];return this.forEach((function(n,r){e(n,r)&&t.push(r)})),t},file:function(e,t,n){if(1!==arguments.length)return e=this.root+e,r.call(this,e,t,n),this;if(g(e)){var a=e;return this.filter((function(e,t){return!t.dir&&a.test(e)}))}var i=this.files[this.root+e];return i&&!i.dir?i:null},folder:function(e){if(!e)return this;if(g(e))return this.filter((function(t,n){return n.dir&&e.test(t)}));var t=this.root+e,n=v.call(this,t),r=this.clone();return r.root=n.name,r},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var n=this.filter((function(t,n){return n.name.slice(0,e.length)===e})),r=0;r<n.length;r++)delete this.files[n[r].name];return this},generate:function(e){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")}
vendor: 4,189 bytes, line 2
2,generateInternalStream:function(e){var t,n={};try{if((n=i.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:a.utf8encode})).type=n.type.toLowerCase(),n.compression=n.compression.toUpperCase(),"binarystring"===n.type&&(n.type="string"),!n.type)throw new Error("No output type specified.");i.checkSupport(n.type),"darwin"!==n.platform&&"freebsd"!==n.platform&&"linux"!==n.platform&&"sunos"!==n.platform||(n.platform="UNIX"),"win32"===n.platform&&(n.platform="DOS");var r=n.comment||this.comment||"";t=h.generateWorker(this,n,r)}catch(e){(t=new o("error")).error(e)}return new s(t,n.type||"string",n.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};t.exports=b},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t,n){t.exports=e("stream")},{stream:void 0}],17:[function(e,t,n){"use strict";var r=e("./DataReader");function a(e){r.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e("../utils").inherits(a,r),a.prototype.byteAt=function(e){return this.data[this.zero+e]},a.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),a=e.charCodeAt(3),i=this.length-4;0<=i;--i)if(this.data[i]===t&&this.data[i+1]===n&&this.data[i+2]===r&&this.data[i+3]===a)return i-this.zero;return-1},a.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),a=e.charCodeAt(3),i=this.readData(4);return t===i[0]&&n===i[1]&&r===i[2]&&a===i[3]},a.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=a},{"../utils":32,"./DataReader":18}],18:[function(e,t,n){"use strict";var r=e("../utils");function a(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}a.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(e){},readInt:function(e){var t,n=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=a},{"../utils":32}],19:[function(e,t,n){"use strict";var r=e("./Uint8ArrayReader");function a(e){r.call(this,e)}e("../utils").inherits(a,r),a.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=a},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){"use strict";var r=e("./DataReader");function a(e){r.call(this,e)}e("../utils").inherits(a,r),a.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},a.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},a.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},a.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=a},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){"use strict";var r=e("./ArrayReader");function a(e){r.call(this,e)}e("../utils").inherits(a,r),a.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t}
vendor: 1,639 bytes, line 2
2,t.exports=a},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){"use strict";var r=e("../utils"),a=e("../support"),i=e("./ArrayReader"),o=e("./StringReader"),s=e("./NodeBufferReader"),u=e("./Uint8ArrayReader");t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),"string"!==t||a.uint8array?"nodebuffer"===t?new s(e):a.uint8array?new u(r.transformTo("uint8array",e)):new i(r.transformTo("array",e)):new o(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){"use strict";n.LOCAL_FILE_HEADER="PK\x03\x04",n.CENTRAL_FILE_HEADER="PK\x01\x02",n.CENTRAL_DIRECTORY_END="PK\x05\x06",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07",n.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06",n.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(e,t,n){"use strict";var r=e("./GenericWorker"),a=e("../utils");function i(e){r.call(this,"ConvertWorker to "+e),this.destType=e}a.inherits(i,r),i.prototype.processChunk=function(e){this.push({data:a.transformTo(this.destType,e.data),meta:e.meta})},t.exports=i},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){"use strict";var r=e("./GenericWorker"),a=e("../crc32");function i(){r.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(i,r),i.prototype.processChunk=function(e){this.streamInfo.crc32=a(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=i},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){"use strict";var r=e("../utils"),a=e("./GenericWorker");function i(e){a.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}
vendor: 16,336 bytes, line 2
2r.inherits(i,a),i.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}a.prototype.processChunk.call(this,e)},t.exports=i},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){"use strict";var r=e("../utils"),a=e("./GenericWorker");function i(e){a.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}r.inherits(i,a),i.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this.data=null},i.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},i.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},i.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=i},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){"use strict";function r(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n<this._listeners[e].length;n++)this._listeners[e][n].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.end()})),e.on("error",(function(e){t.error(e)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},t.exports=r},{}],29:[function(e,n,r){"use strict";var a=e("../utils"),i=e("./ConvertWorker"),o=e("./GenericWorker"),s=e("../base64"),u=e("../support"),c=e("../external"),l=null;if(u.nodestream)try{l=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function h(e,t,n){var r=t;switch(t){case"blob":case"arraybuffer":r="uint8array";break;case"base64":r="string"}try{this._internalType=r,this._outputType=t,this._mimeType=n,a.checkSupport(r),this._worker=e.pipe(new i(r)),e.lock()}catch(e){this._worker=new o("error"),this._worker.error(e)}}h.prototype={accumulate:function(e){return function(e,n){return new c.Promise((function(r,i){var o=[],u=e._internalType,c=e._outputType,l=e._mimeType;e.on("data",(function(e,t){o.push(e),n&&n(t)})).on("error",(function(e){o=[],i(e)})).on("end",(function(){try{var e=function(e,t,n){switch(e){case"blob":return a.newBlob(a.transformTo("arraybuffer",t),n);case"base64":return s.encode(t);default:return a.transformTo(e,t)}}(c,function(e,n){var r,a=0,i=null,o=0;for(r=0;r<n.length;r++)o+=n[r].length;switch(e){case"string":return n.join("");case"array":return Array.prototype.concat.apply([],n);case"uint8array":for(i=new Uint8Array(o),r=0;r<n.length;r++)i.set(n[r],a),a+=n[r].length;return i;case"nodebuffer":return t.concat(n);default:throw new Error("concat : unsupported type '"+e+"'")}}(u,o),l);r(e)}catch(e){i(e)}o=[]})).resume()}))}(this,e)},on:function(e,t){var n=this;return"data"===e?this._worker.on(e,(function(e){t.call(n,e.data,e.meta)})):this._worker.on(e,(function(){a.delay(t,arguments,n)})),this},resume:function(){return a.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(a.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new l(this,{objectMode:"nodebuffer"!==this._outputType},e)}},n.exports=h},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,n,r){"use strict";if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,r.nodebuffer="undefined"!=typeof t,r.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)r.blob=!1;else{var a=new ArrayBuffer(0);try{r.blob=0===new Blob([a],{type:"application/zip"}).size}catch(e){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(a),r.blob=0===i.getBlob("application/zip").size}catch(e){r.blob=!1}}}try{r.nodestream=!!e("readable-stream").Readable}catch(e){r.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){"use strict";for(var r=e("./utils"),a=e("./support"),i=e("./nodejsUtils"),o=e("./stream/GenericWorker"),s=new Array(256),u=0;u<256;u++)s[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;function c(){o.call(this,"utf-8 decode"),this.leftOver=null}function l(){o.call(this,"utf-8 encode")}s[254]=s[254]=1,n.utf8encode=function(e){return a.nodebuffer?i.newBufferFrom(e,"utf-8"):function(e){var t,n,r,i,o,s=e.length,u=0;for(i=0;i<s;i++)55296==(64512&(n=e.charCodeAt(i)))&&i+1<s&&56320==(64512&(r=e.charCodeAt(i+1)))&&(n=65536+(n-55296<<10)+(r-56320),i++),u+=n<128?1:n<2048?2:n<65536?3:4;for(t=a.uint8array?new Uint8Array(u):new Array(u),i=o=0;o<u;i++)55296==(64512&(n=e.charCodeAt(i)))&&i+1<s&&56320==(64512&(r=e.charCodeAt(i+1)))&&(n=65536+(n-55296<<10)+(r-56320),i++),n<128?t[o++]=n:(n<2048?t[o++]=192|n>>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t}(e)},n.utf8decode=function(e){return a.nodebuffer?r.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,n,a,i,o=e.length,u=new Array(2*o);for(t=n=0;t<o;)if((a=e[t++])<128)u[n++]=a;else if(4<(i=s[a]))u[n++]=65533,t+=i-1;else{for(a&=2===i?31:3===i?15:7;1<i&&t<o;)a=a<<6|63&e[t++],i--;1<i?u[n++]=65533:a<65536?u[n++]=a:(a-=65536,u[n++]=55296|a>>10&1023,u[n++]=56320|1023&a)}return u.length!==n&&(u.subarray?u=u.subarray(0,n):u.length=n),r.applyFromCharCode(u)}(e=r.transformTo(a.uint8array?"uint8array":"array",e))},r.inherits(c,o),c.prototype.processChunk=function(e){var t=r.transformTo(a.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(a.uint8array){var i=t;(t=new Uint8Array(i.length+this.leftOver.length)).set(this.leftOver,0),t.set(i,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var o=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+s[e[n]]>t?n:t}(t),u=t;o!==t.length&&(a.uint8array?(u=t.subarray(0,o),this.leftOver=t.subarray(o,t.length)):(u=t.slice(0,o),this.leftOver=t.slice(o,t.length))),this.push({data:n.utf8decode(u),meta:e.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=c,r.inherits(l,o),l.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=l},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){"use strict";var r=e("./support"),a=e("./base64"),i=e("./nodejsUtils"),o=e("set-immediate-shim"),s=e("./external");function u(e){return e}function c(e,t){for(var n=0;n<e.length;++n)t[n]=255&e.charCodeAt(n);return t}n.newBlob=function(t,r){n.checkSupport("blob");try{return new Blob([t],{type:r})}catch(e){try{var a=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return a.append(t),a.getBlob(r)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var l={stringifyByChunk:function(e,t,n){var r=[],a=0,i=e.length;if(i<=n)return String.fromCharCode.apply(null,e);for(;a<i;)"array"===t||"nodebuffer"===t?r.push(String.fromCharCode.apply(null,e.slice(a,Math.min(a+n,i)))):r.push(String.fromCharCode.apply(null,e.subarray(a,Math.min(a+n,i)))),a+=n;return r.join("")},stringifyByChar:function(e){for(var t="",n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},applyCanBeUsed:{uint8array:function(){try{return r.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return r.nodebuffer&&1===String.fromCharCode.apply(null,i.allocBuffer(1)).length}catch(e){return!1}}()}};function h(e){var t=65536,r=n.getTypeOf(e),a=!0;if("uint8array"===r?a=l.applyCanBeUsed.uint8array:"nodebuffer"===r&&(a=l.applyCanBeUsed.nodebuffer),a)for(;1<t;)try{return l.stringifyByChunk(e,r,t)}catch(e){t=Math.floor(t/2)}return l.stringifyByChar(e)}function d(e,t){for(var n=0;n<e.length;n++)t[n]=e[n];return t}n.applyFromCharCode=h;var f={};f.string={string:u,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return f.string.uint8array(e).buffer},uint8array:function(e){return c(e,new Uint8Array(e.length))},nodebuffer:function(e){return c(e,i.allocBuffer(e.length))}},f.array={string:h,array:u,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return i.newBufferFrom(e)}},f.arraybuffer={string:function(e){return h(new Uint8Array(e))},array:function(e){return d(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:u,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return i.newBufferFrom(new Uint8Array(e))}},f.uint8array={string:h,array:function(e){return d(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:u,nodebuffer:function(e){return i.newBufferFrom(e)}},f.nodebuffer={string:h,array:function(e){return d(e,new Array(e.length))},arraybuffer:function(e){return f.nodebuffer.uint8array(e).buffer},uint8array:function(e){return d(e,new Uint8Array(e.length))},nodebuffer:u},n.transformTo=function(e,t){if(t=t||"",!e)return t;n.checkSupport(e);var r=n.getTypeOf(t);return f[r][e](t)},n.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":r.nodebuffer&&i.isBuffer(e)?"nodebuffer":r.uint8array&&e instanceof Uint8Array?"uint8array":r.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},n.checkSupport=function(e){if(!r[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(e){var t,n,r="";for(n=0;n<(e||"").length;n++)r+="\\x"+((t=e.charCodeAt(n))<16?"0":"")+t.toString(16).toUpperCase();return r},n.delay=function(e,t,n){o((function(){e.apply(n||null,t||[])}))},n.inherits=function(e,t){function n(){}n.prototype=t.prototype,e.prototype=new n},n.extend=function(){var e,t,n={};for(e=0;e<arguments.length;e++)for(t in arguments[e])arguments[e].hasOwnProperty(t)&&void 0===n[t]&&(n[t]=arguments[e][t]);return n},n.prepareContent=function(e,t,i,o,u){return s.Promise.resolve(t).then((function(e){return r.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new s.Promise((function(t,n){var r=new FileReader;r.onload=function(e){t(e.target.result)},r.onerror=function(e){n(e.target.error)},r.readAsArrayBuffer(e)})):e})).then((function(t){var l=n.getTypeOf(t);return l?("arraybuffer"===l?t=n.transformTo("uint8array",t):"string"===l&&(u?t=a.decode(t):i&&!0!==o&&(t=function(e){return c(e,r.uint8array?new Uint8Array(e.length):new Array(e.length))}(t))),t):s.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,"set-immediate-shim":54}],33:[function(e,t,n){"use strict";var r=e("./reader/readerFor"),a=e("./utils"),i=e("./signature"),o=e("./zipEntry"),s=(e("./utf8"),e("./support"));function u(e){this.files=[],this.loadOptions=e}u.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+a.pretty(t)+", expected "+a.pretty(e)+")")}},isSignature:function(e,t){var n=this.reader.index;this.reader.setIndex(e);var r=this.reader.readString(4)===t;return this.reader.setIndex(n),r},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=s.uint8array?"uint8array":"array",n=a.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(n)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,n,r=this.zip64EndOfCentralSize-44;0<r;)e=this.reader.readInt(2),t=this.reader.readInt(4),n=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(i.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(i.CENTRAL_FILE_HEADER);)(e=new o({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(i.CENTRAL_DIRECTORY_END);if(e<0)throw this.isSignature(0,i.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip f
2ile ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(e);var t=e;if(this.checkSignature(i.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===a.MAX_VALUE_16BITS||this.diskWithCentralDirStart===a.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===a.MAX_VALUE_16BITS||this.centralDirRecords===a.MAX_VALUE_16BITS||this.centralDirSize===a.MAX_VALUE_32BITS||this.centralDirOffset===a.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(i.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(i.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,i.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(i.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(i.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var r=t-n;if(0<r)this.isSignature(t,i.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(r<0)throw new Error("Corrupted zip: missing "+Math.abs(r)+" bytes.")},prepareReader:function(e){this.reader=r(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(e,t,n){"use strict";var r=e("./reader/readerFor"),a=e("./utils"),i=e("./compressedObject"),o=e("./crc32"),s=e("./utf8"),u=e("./compressions"),c=e("./support");function l(e,t){this.options=e,this.loadOptions=t}l.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,n;if(e.skip(22),this.fileNameLength=e.readInt(2),n=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in u)if(u.hasOwnProperty(t)&&u[t].magic===e)return u[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+a.pretty(this.compressionMethod)+" unknown (inner file : "+a.transformTo("string",this.fileName)+")");this.decompressed=new i(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=r(this.extraFields[1].value);this.uncompressedSize===a.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===a.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===a.MAX_VALUE_32BITS&&
vendor: 41,472 bytes, line 2
2(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===a.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,n,r,a=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<a;)t=e.readInt(2),n=e.readInt(2),r=e.readData(n),this.extraFields[t]={id:t,length:n,value:r};e.setIndex(a)},handleUTF8:function(){var e=c.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=s.utf8decode(this.fileName),this.fileCommentStr=s.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var n=a.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var r=this.findExtraFieldUnicodeComment();if(null!==r)this.fileCommentStr=r;else{var i=a.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(i)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=r(e.value);return 1!==t.readInt(1)||o(this.fileName)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=r(e.value);return 1!==t.readInt(1)||o(this.fileComment)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null}},t.exports=l},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,n){"use strict";function r(e,t,n){this.name=e,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=t,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}}var a=e("./stream/StreamHelper"),i=e("./stream/DataWorker"),o=e("./utf8"),s=e("./compressedObject"),u=e("./stream/GenericWorker");r.prototype={internalStream:function(e){var t=null,n="string";try{if(!e)throw new Error("No output type specified.");var r="string"===(n=e.toLowerCase())||"text"===n;"binarystring"!==n&&"text"!==n||(n="string"),t=this._decompressWorker();var i=!this._dataBinary;i&&!r&&(t=t.pipe(new o.Utf8EncodeWorker)),!i&&r&&(t=t.pipe(new o.Utf8DecodeWorker))}catch(e){(t=new u("error")).error(e)}return new a(t,n,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof s&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new o.Utf8EncodeWorker)),s.createWorkerFrom(n,e,t)},_decompressWorker:function(){return this._data instanceof s?this._data.getContentWorker():this._data instanceof u?this._data:new i(this._data)}};for(var c=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],l=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},h=0;h<c.length;h++)r.prototype[c[h]]=l;t.exports=r},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t,r){(function(e){"use strict";var n,r,a=e.MutationObserver||e.WebKitMutationObserver;if(a){var i=0,o=new a(l),s=e.document.createTextNode("");o.observe(s,{characterData:!0}),n=function(){s.data=i=++i%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){l(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(l,0)};else{var u=new e.MessageChannel;u.port1.onmessage=l,n=function(){u.port2.postMessage(0)}}var c=[];function l(){var e,t;r=!0;for(var n=c.length;n;){for(t=c,c=[],e=-1;++e<n;)t[e]();n=c.length}r=!1}t.exports=function(e){1!==c.push(e)||r||n()}}).call(this,"undefined"!=typeof n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(e,t,n){"use strict";var r=e("immediate");function a(){}var i={},o=["REJECTED"],s=["FULFILLED"],u=["PENDING"];function c(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,e!==a&&f(this,e)}function l(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function h(e,t,n){r((function(){var r;try{r=t(n)}catch(r){return i.reject(e,r)}r===e?i.reject(e,new TypeError("Cannot resolve promise with itself")):i.resolve(e,r)}))}function d(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function f(e,t){var n=!1;function r(t){n||(n=!0,i.reject(e,t))}function a(t){n||(n=!0,i.resolve(e,t))}var o=p((function(){t(a,r)}));"error"===o.status&&r(o.value)}function p(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}(t.exports=c).prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){throw n}))}))},c.prototype.catch=function(e){return this.then(null,e)},c.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===o)return this;var n=new this.constructor(a);return this.state!==u?h(n,this.state===s?e:t,this.outcome):this.queue.push(new l(n,e,t)),n},l.prototype.callFulfilled=function(e){i.resolve(this.promise,e)},l.prototype.otherCallFulfilled=function(e){h(this.promise,this.onFulfilled,e)},l.prototype.callRejected=function(e){i.reject(this.promise,e)},l.prototype.otherCallRejected=function(e){h(this.promise,this.onRejected,e)},i.resolve=function(e,t){var n=p(d,t);if("error"===n.status)return i.reject(e,n.value);var r=n.value;if(r)f(e,r);else{e.state=s,e.outcome=t;for(var a=-1,o=e.queue.length;++a<o;)e.queue[a].callFulfilled(t)}return e},i.reject=function(e,t){e.state=o,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},c.resolve=function(e){return e instanceof this?e:i.resolve(new this(a),e)},c.reject=function(e){var t=new this(a);return i.reject(t,e)},c.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=new Array(n),s=0,u=-1,c=new this(a);++u<n;)l(e[u],u);return c;function l(e,a){t.resolve(e).then((function(e){o[a]=e,++s!==n||r||(r=!0,i.resolve(c,o))}),(function(e){r||(r=!0,i.reject(c,e))}))}},c.race=function(e){if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var t=e.length,n=!1;if(!t)return this.resolve([]);for(var r,o=-1,s=new this(a);++o<t;)r=e[o],this.resolve(r).then((function(e){n||(n=!0,i.resolve(s,e))}),(function(e){n||(n=!0,i.reject(s,e))}));return s}},{immediate:36}],38:[function(e,t,n){"use strict";var r={};(0,e("./lib/utils/common").assign)(r,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=r},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,n){"use strict";var r=e("./zlib/deflate"),a=e("./utils/common"),i=e("./utils/strings"),o=e("./zlib/messages"),s=e("./zlib/zstream"),u=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(e);this.options=a.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw new Error(o[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){var l;if(l="string"==typeof t.dictionary?i.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=r.deflateSetDictionary(this.strm,l)))throw new Error(o[n]);this._dict_set=!0}}function l(e,t){var n=new c(t);if(n.push(e,!0),n.err)throw n.msg||o[n.err];return n.result}c.prototype.push=function(e,t){var n,o,s=this.strm,c=this.options.chunkSize;if(this.ended)return!1;o=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=i.string2buf(e):"[object ArrayBuffer]"===u.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new a.Buf8(c),s.next_out=0,s.avail_out=c),1!==(n=r.deflate(s,o))&&0!==n)return this.onEnd(n),!(this.ended=!0);0!==s.avail_out&&(0!==s.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(i.buf2binstring(a.shrinkBuf(s.output,s.next_out))):this.onData(a.shrinkBuf(s.output,s.next_out)))}while((0<s.avail_in||0===s.avail_out)&&1!==n);return 4===o?(n=r.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,0===n):2!==o||(this.onEnd(0),!(s.avail_out=0))},c.prototype.onData=function(e){this.chunks.push(e)},c.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Deflate=c,n.deflate=l,n.deflateRaw=function(e,t){return(t=t||{}).raw=!0,l(e,t)},n.gzip=function(e,t){return(t=t||{}).gzip=!0,l(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,n){"use strict";var r=e("./zlib/inflate"),a=e("./utils/common"),i=e("./utils/strings"),o=e("./zlib/constants"),s=e("./zlib/messages"),u=e("./zlib/zstream"),c=e("./zlib/gzheader"),l=Object.prototype.toString;function h(e){if(!(this instanceof h))return new h(e);this.options=a.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,t.windowBits);if(n!==o.Z_OK)throw new Error(s[n]);this.header=new c,r.inflateGetHeader(this.strm,this.header)}function d(e,t){var n=new h(t);if(n.push(e,!0),n.err)throw n.msg||s[n.err];return n.result}h.prototype.push=function(e,t){var n,s,u,c,h,d,f=this.strm,p=this.options.chunkSize,m=this.options.dictionary,v=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof e?f.input=i.binstring2buf(e):"[object ArrayBuffer]"===l.call(e)?f.input=new Uint8Array(e):f.input=e,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new a.Buf8(p),f.next_out=0,f.avail_out=p),(n=r.inflate(f,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&m&&(d="string"==typeof m?i.string2buf(m):"[object ArrayBuffer]"===l.call(m)?new Uint8Array(m):m,n=r.inflateSetDictionary(this.strm,d)),n===o.Z_BUF_ERROR&&!0===v&&(n=o.Z_OK,v=!1),n!==o.Z_STREAM_END&&n!==o.Z_OK)return this.onEnd(n),!(this.ended=!0);f.next_out&&(0!==f.avail_out&&n!==o.Z_STREAM_END&&(0!==f.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(u=i.utf8border(f.output,f.next_out),c=f.next_out-u,h=i.buf2string(f.output,u),f.next_out=c,f.avail_out=p-c,c&&a.arraySet(f.output,f.output,u,c,0),this.onData(h)):this.onData(a.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(v=!0)}while((0<f.avail_in||0===f.avail_out)&&n!==o.Z_STREAM_END);return n===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),!(f.avail_out=0))},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Inflate=h,n.inflate=d,n.inflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},n.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var a={arraySet:function(e,t,n,r,a){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),a);else for(var i=0;i<r;i++)e[a+i]=t[n+i]},flattenChunks:function(e){var t,n,r,a,i,o;for(t=r=0,n=e.length;t<n;t++)r+=e[t].length;for(o=new Uint8Array(r),t=a=0,n=e.length;t<n;t++)i=e[t],o.set(i,a),a+=i.length;return o}},i={arraySet:function(e,t,n,r,a){for(var i=0;i<r;i++)e[a+i]=t[n+i]},flattenChunks:function(e){return[].concat.apply([],e)}};n.setTyped=function(e){e?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,a)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,i))},n.setTyped(r)},{}],42:[function(e,t,n){"use strict";var r=e("./common"),a=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch(e){a=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){i=!1}for(var o=new r.Buf8(256),s=0;s<256;s++)o[s]=252<=s?6:248<=s?5:240<=s?4:224<=s?3:192<=s?2:1;function u(e,t){if(t<65537&&(e.subarray&&i||!e.subarray&&a))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var n="",o=0;o<t;o++)n+=String.fromCharCode(e[o]);return n}o[254]=o[254]=1,n.string2buf=function(e){var t,n,a,i,o,s=e.length,u=0;for(i=0;i<s;i++)55296==(64512&(n=e.charCodeAt(i)))&&i+1<s&&56320==(64512&(a=e.charCodeAt(i+1)))&&(n=65536+(n-55296<<10)+(a-56320),i++),u+=n<128?1:n<2048?2:n<65536?3:4;for(t=new r.Buf8(u),i=o=0;o<u;i++)55296==(64512&(n=e.charCodeAt(i)))&&i+1<s&&56320==(64512&(a=e.charCodeAt(i+1)))&&(n=65536+(n-55296<<10)+(a-56320),i++),n<128?t[o++]=n:(n<2048?t[o++]=192|n>>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t},n.buf2binstring=function(e){return u(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,a=t.length;n<a;n++)t[n]=e.charCodeAt(n);return t},n.buf2string=function(e,t){var n,r,a,i,s=t||e.length,c=new Array(2*s);for(n=r=0;n<s;)if((a=e[n++])<128)c[r++]=a;else if(4<(i=o[a]))c[r++]=65533,n+=i-1;else{for(a&=2===i?31:3===i?15:7;1<i&&n<s;)a=a<<6|63&e[n++],i--;1<i?c[r++]=65533:a<65536?c[r++]=a:(a-=65536,c[r++]=55296|a>>10&1023,c[r++]=56320|1023&a)}return u(c,r)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+o[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){"use strict";t.exports=function(e,t,n,r){for(var a=65535&e|0,i=e>>>16&65535|0,o=0;0!==n;){for(n-=o=2e3<n?2e3:n;i=i+(a=a+t[r++]|0)|0,--o;);a%=65521,i%=65521}return a|i<<16|0}},{}],44:[function(e,t,n){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,n){"use strict";var r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,a){var i=r,o=a+n;e^=-1;for(var s=a;s<o;s++)e=e>>>8^i[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,n){"use strict";var r,a=e("../utils/common"),i=e("./trees"),o=e("./adler32"),s=e("./crc32"),u=e("./messages"),c=-2,l=258,h=262,d=113;function f(e,t){return e.msg=u[t],t}function p(e){return(e<<1)-(4<e?9:0)}function m(e){for(var t=e.length;0<=--t;)e[t]=0}function v(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(a.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function g(e,t){i._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,v(e.strm)}function b(e,t){e.pending_buf[e.pending++]=t}function y(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function x(e,t){var n,r,a=e.max_chain_length,i=e.strstart,o=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-h?e.strstart-(e.w_size-h):0,c=e.window,d=e.w_mask,f=e.prev,p=e.strstart+l,m=c[i+o-1],v=c[i+o];e.prev_length>=e.good_match&&(a>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(n=t)+o]===v&&c[n+o-1]===m&&c[n]===c[i]&&c[++n]===c[i+1]){i+=2,n++;do{}while(c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&i<p);if(r=l-(p-i),i=p-l,o<r){if(e.match_start=t,s<=(o=r))break;m=c[i+o-1],v=c[i+o]}}}while((t=f[t&d])>u&&0!=--a);return o<=e.lookahead?o:e.lookahead}function w(e){var t,n,r,i,u,c,l,d,f,p,m=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-h)){for(a.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,t=n=e.hash_size;r=e.head[--t],e.head[t]=m<=r?r-m:0,--n;);for(t=n=m;r=e.prev[--t],e.prev[t]=m<=r?r-m:0,--n;);i+=m}if(0===e.strm.avail_in)break;if(c=e.strm,l=e.window,d=e.strstart+e.lookahead,p=void 0,(f=i)<(p=c.avail_in)&&(p=f),n=0===p?0:(c.avail_in-=p,a.arraySet(l,c.input,c.next_in,p,d),1===c.state.wrap?c.adler=o(c.adler,l,p,d):2===c.state.wrap&&(c.adler=s(c.adler,l,p,d)),c.next_in+=p,c.total_in+=p,p),e.lookahead+=n,e.lookahead+e.insert>=3)for(u=e.strstart-e.insert,e.ins_h=e.window[u],e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+3-1])&e.hash_mask,e.prev[u&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=u,u++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<h&&0!==e.strm.avail_in)}function O(e,t){for(var n,r;;){if(e.lookahead<h){if(w(e),e.lookahead<h&&0===t)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-h&&(e.match_length=x(e,n)),e.match_length>=3)if(r=i._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(g(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(g(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(g(e,!1),0===e.strm.avail_out)?1:2}function k(e,t){for(var n,r,a;;){if(e.lookahead<h){if(w(e),e.lookahead<h&&0===t)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-h&&(e.match_length=x(e,n),e.match_length<=5&&(1===e.strategy||3===e.match_length&&4096<e.strstart-e.match_start)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){for(a=e.strstart+e.lookahead-3,r=i._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=a&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(g(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((r=i._tr_tally(e,0,e.window[e.strstart-1]))&&g(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=i._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(g(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(g(e,!1),0===e.strm.avail_out)?1:2}function S(e,t,n,r,a){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=a}function _(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new a.Buf16(1146),this.dyn_dtree=new a.Buf16(122),this.bl_tree=new a.Buf16(78),m(this.dyn_ltree),m(this.dyn_dtree),m(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new a.Buf16(16),this.heap=new a.Buf16(573),m(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new a.Buf16(573),m(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function j(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:d,e.adler=2===t.wrap?0:1,t.last_flush=0,i._tr_init(t),0):f(e,c)}function E(e){var t=j(e);return 0===t&&function(e){e.window_size=2*e.w_size,m(e.head),e.max_lazy_match=r[e.level].max_lazy,e.good_match=r[e.level].good_length,e.nice_match=r[e.level].nice_length,e.max_chain_length=r[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0}(e.state),t}function T(e,t,n,r,i,o){if(!e)return c;var s=1;if(-1===t&&(t=6),r<0?(s=0,r=-r):15<r&&(s=2,r-=16),i<1||9<i||8!==n||r<8||15<r||t<0||9<t||o<0||4<o)return f(e,c);8===r&&(r=9);var u=new _;return(e.state=u).strm=e,u.wrap=s,u.gzhead=null,u.w_bits=r,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=i+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+3-1)/3),u.window=new a.Buf8(2*u.w_size),u.head=new a.Buf16(u.hash_size),u.prev=new a.Buf16(u.w_size),u.lit_bufsize=1<<i+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new a.Buf8(u.pending_buf_size),u.d_buf=1*u.lit_bufsize,u.l_buf=3*u.lit_bufsize,u.level=t,u.strategy=o,u.method=n,E(e)}r=[new S(0,0,0,0,(function(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(w(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,g(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-h&&(g(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(g(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(g(e,!1),e.strm.avail_out),1)})),new S(4,4,8,4,O),new S(4,5,16,8,O),new S(4,6,32,32,O),new S(4,4,16,16,k),new S(8,16,32,32,k),new S(8,16,128,128,k),new S(8,32,128,256,k),new S(32,128,258,1024,k),new S(32,258,258,4096,k)],n.deflateInit=function(e,t){return T(e,t,8,15,8,0)},n.deflateInit2=T,n.deflateReset=E,n.deflateResetKeep=j,n.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?c:(e.state.gzhead=t,0):c},n.deflate=function(e,t){var n,a,o,u;if(!e||!e.state||5<t||t<0)return e?f(e,c):c;if(a=e.state,!e.output||!e.input&&0!==e.avail_in||666===a.status&&4!==t)return f(e,0===e.avail_out?-5:c);if(a.strm=e,n=a.last_flush,a.last_flush=t,42===a.status)if(2===a.wrap)e.adler=0,b(a,31),b(a,139),b(a,8),a.gzhead?(b(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),b(a,255&a.gzhead.time),b(a,a.gzhead.time>>8&255),b(a,a.gzhead.time>>16&255),b(a,a.gzhead.time>>24&255),b(a,9===a.level?2:2<=a.strategy||a.level<2?4:0),b(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(b(a,255&a.gzhead.extra.length),b(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=s(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69):(b(a,0),b(a,0),b(a,0),b(a,0),b(a,0),b(a,9===a.level?2:2<=a.strategy||a.level<2?4:0),b(a,3),a.status=d);else{var h=8+(a.w_bits-8<<4)<<8;h|=(2<=a.strategy||a.level<2?0:a.level<6?1:6===a.level?2:3)<<6,0!==a.strstart&&(h|=32),h+=31-h%31,a.status=d,y(a,h),0!==a.strstart&&(y(a,e.adler>>>16),y(a,65535&e.adler)),e.adler=1}if(69===a.status)if(a.gzhead.extra){for(o=a.pending;a.gzindex<(65535&a.gzhead.extra.length)&&(a.pending!==a.pending_buf_size||(a.gzhead.hcrc&&a.pending>o&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),v(e),o=a.pending,a.pending!==a.pending_buf_size));)b(a,255&a.gzhead.extra[a.gzindex]),a.gzindex++;a.gzhead.hcrc&&a.pending>o&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=73)}else a.status=73;if(73===a.status)if(a.gzhead.name){o=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>o&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),v(e),o=a.pending,a.pending===a.pending_buf_size)){u=1;break}u=a.gzindex<a.gzhead.name.length?255&a.gzhead.name.charCodeAt(a.gzindex++):0,b(a,u)}while(0!==u);a.gzhead.hcrc&&a.pending>o&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),0===u&&(a.gzindex=0,a.status=91)}else a.status=91;if(91===a.status)if(a.gzhead.comment){o=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>o&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),v(e),o=a.pending,a.pending===a.pending_buf_size)){u=1;break}u=a.gzindex<a.gzhead.comment.length?255&a.gzhead.comment.charCodeAt(a.gzindex++):0,b(a,u)}while(0!==u);a.gzhead.hcrc&&a.pending>o&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),0===u&&(a.status=103)}else a.status=103;if(103===a.status&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&v(e),a.pending+2<=a.pending_buf_size&&(b(a,255&e.adler),b(a,e.adler>>8&255),e.adler=0,a.status=d)):a.status=d),0!==a.pending){if(v(e),0===e.avail_out)return a.last_flush=-1,0}else if(0===e.avail_in&&p(t)<=p(n)&&4!==t)return f(e,-5);if(666===a.status&&0!==e.avail_in)return f(e,-5);if(0!==e.avail_in||0!==a.lookahead||0!==t&&666!==a.status){var x=2===a.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(w(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,n=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(g(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(g(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(g(e,!1),0===e.strm.avail_out)?1:2}(a,t):3===a.strategy?function(e,t){for(var n,r,a,o,s=e.window;;){if(e.lookahead<=l){if(w(e),e.lookahead<=l&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&0<e.strstart&&(r=s[a=e.strstart-1])===s[++a]&&r===s[++a]&&r===s[++a]){o=e.strstart+l;do{}while(r===s[++a]&&r===s[++a]&&r===s[++a]&&r===s[++a]&&r===s[++a]&&r===s[++a]&&r===s[++a]&&r===s[++a]&&a<o);e.match_length=l-(o-a),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=i._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(g(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(g(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(g(e,!1),0===e.strm.avail_out)?1:2}(a,t):r[a.level].func(a,t);if(3!==x&&4!==x||(a.status=666),1===x||3===x)return 0===e.avail_out&&(a.last_flush=-1),0;if(2===x&&(1===t?i._tr_align(a):5!==t&&(i._tr_stored_block(a,0,0,!1),3===t&&(m(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),v(e),0===e.avail_out))return a.last_flush=-1,0}return 4!==t?0:a.wrap<=0?1:(2===a.wrap?(b(a,255&e.adler),b(a,e.adler>>8&255),b(a,e.adler>>16&255),b(a,e.adler>>24&255),b(a,255&e.total_in),b(a,e.total_in>>8&255),b(a,e.total_in>>16&255),b(a,e.total_in>>24&255)):(y(a,e.adler>>>16),y(a,65535&e.adler)),v(e),0<a.wrap&&(a.wrap=-a.wrap),0!==a.pending?0:1)},n.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&103!==t&&t!==d&&666!==t?f(e,c):(e.state=null,t===d?f(e,-3):0):c},n.deflateSetDictionary=function(e,t){var n,r,i,s,u,l,h,d,f=t.length;if(!e||!e.state)return c;if(2===(s=(n=e.state).wrap)||1===s&&42!==n.status||n.lookahead)return c;for(1===s&&(e.adler=o(e.adler,t,f,0)),n.wrap=0,f>=n.w_size&&(0===s&&(m(n.head),n.strstart=0,n.block_start=0,n.insert=0),d=new a.Buf8(n.w_size),a.arraySet(d,t,f-n.w_size,n.w_size,0),t=d,f=n.w_size),u=e.avail_in,l=e.next_in,h=e.input,e.avail_in=f,e.next_in=0,e.input=t,w(n);n.lookahead>=3;){for(r=n.strstart,i=n.lookahead-2;n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+3-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++,--i;);n.strstart=r,n.lookahead=2,w(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=l,e.input=h,e.avail_in=u,n.wrap=s,0},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,n){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,t,n){"use strict";t.exports=function(e,t){var n,r,a,i,o,s,u,c,l,h,d,f,p,m,v,g,b,y,x,w,O,k,S,_,j;n=e.state,r=e.next_in,_=e.input,a=r+(e.avail_in-5),i=e.next_out,j=e.output,o=i-(t-e.avail_out),s=i+(e.avail_out-257),u=n.dmax,c=n.wsize,l=n.whave,h=n.wnext,d=n.window,f=n.hold,p=n.bits,m=n.lencode,v=n.distcode,g=(1<<n.lenbits)-1,b=(1<<n.distbits)-1;e:do{p<15&&(f+=_[r++]<<p,p+=8,f+=_[r++]<<p,p+=8),y=m[f&g];t:for(;;){if(f>>>=x=y>>>24,p-=x,0===(x=y>>>16&255))j[i++]=65535&y;else{if(!(16&x)){if(0==(64&x)){y=m[(65535&y)+(f&(1<<x)-1)];continue t}if(32&x){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}w=65535&y,(x&=15)&&(p<x&&(f+=_[r++]<<p,p+=8),w+=f&(1<<x)-1,f>>>=x,p-=x),p<15&&(f+=_[r++]<<p,p+=8,f+=_[r++]<<p,p+=8),y=v[f&b];n:for(;;){if(f>>>=x=y>>>24,p-=x,!(16&(x=y>>>16&255))){if(0==(64&x)){y=v[(65535&y)+(f&(1<<x)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(O=65535&y,p<(x&=15)&&(f+=_[r++]<<p,(p+=8)<x&&(f+=_[r++]<<p,p+=8)),u<(O+=f&(1<<x)-1)){e.msg="invalid distance too far back",n.mode=30;break e}if(f>>>=x,p-=x,(x=i-o)<O){if(l<(x=O-x)&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(S=d,(k=0)===h){if(k+=c-x,x<w){for(w-=x;j[i++]=d[k++],--x;);k=i-O,S=j}}else if(h<x){if(k+=c+h-x,(x-=h)<w){for(w-=x;j[i++]=d[k++],--x;);if(k=0,h<w){for(w-=x=h;j[i++]=d[k++],--x;);k=i-O,S=j}}}else if(k+=h-x,x<w){for(w-=x;j[i++]=d[k++],--x;);k=i-O,S=j}for(;2<w;)j[i++]=S[k++],j[i++]=S[k++],j[i++]=S[k++],w-=3;w&&(j[i++]=S[k++],1<w&&(j[i++]=S[k++]))}else{for(k=i-O;j[i++]=j[k++],j[i++]=j[k++],j[i++]=j[k++],2<(w-=3););w&&(j[i++]=j[k++],1<w&&(j[i++]=j[k++]))}break}}break}}while(r<a&&i<s);r-=w=p>>3,f&=(1<<(p-=w<<3))-1,e.next_in=r,e.next_out=i,e.avail_in=r<a?a-r+5:5-(r-a),e.avail_out=i<s?s-i+257:257-(i-s),n.hold=f,n.bits=p}},{}],49:[function(e,t,n){"use strict";var r=e("../utils/common"),a=e("./adler32"),i=e("./crc32"),o=e("./inffast"),s=e("./inftrees"),u=-2;function c(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function l(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function h(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(852),t.distcode=t.distdyn=new r.Buf32(592),t.sane=1,t.back=-1,0):u}function d(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,h(e)):u}function f(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?u:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,d(e))):u}function p(e,t){var n,r;return e?(r=new l,(e.state=r).window=null,0!==(n=f(e,t))&&(e.state=null),n):u}var m,v,g=!0;function b(e){if(g){var t;for(m=new r.Buf32(512),v=new r.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,m,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,v,0,e.work,{bits:5}),g=!1}e.lencode=m,e.lenbits=9,e.distcode=v,e.distbits=5}function y(e,t,n,a){var i,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new r.Buf8(o.wsize)),a>=o.wsize?(r.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(a<(i=o.wsize-o.wnext)&&(i=a),r.arraySet(o.window,t,n-a,i,o.wnext),(a-=i)?(r.arraySet(o.window,t,n-a,a,0),o.wnext=a,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0}n.inflateReset=d,n.inflateReset2=f,n.inflateResetKeep=h,n.inflateInit=function(e){return p(e,15)},n.inflateInit2=p,n.inflate=function(e,t){var n,l,h,d,f,p,m,v,g,x,w,O,k,S,_,j,E,T,C,M,A,N,R,I,L=0,D=new r.Buf8(4),P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return u;12===(n=e.state).mode&&(n.mode=13),f=e.next_out,h=e.output,m=e.avail_out,d=e.next_in,l=e.input,p=e.avail_in,v=n.hold,g=n.bits,x=p,w=m,N=0;e:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;g<16;){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}if(2&n.wrap&&35615===v){D[n.check=0]=255&v,D[1]=v>>>8&255,n.check=i(n.check,D,2,0),g=v=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&v)<<8)+(v>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&v)){e.msg="unknown compression method",n.mode=30;break}if(g-=4,A=8+(15&(v>>>=4)),0===n.wbits)n.wbits=A;else if(A>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<<A,e.adler=n.check=1,n.mode=512&v?10:12,g=v=0;break;case 2:for(;g<16;){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}if(n.flags=v,8!=(255&n.flags)){e.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=v>>8&1),512&n.flags&&(D[0]=255&v,D[1]=v>>>8&255,n.check=i(n.check,D,2,0)),g=v=0,n.mode=3;case 3:for(;g<32;){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}n.head&&(n.head.time=v),512&n.flags&&(D[0]=255&v,D[1]=v>>>8&255,D[2]=v>>>16&255,D[3]=v>>>24&255,n.check=i(n.check,D,4,0)),g=v=0,n.mode=4;case 4:for(;g<16;){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}n.head&&(n.head.xflags=255&v,n.head.os=v>>8),512&n.flags&&(D[0]=255&v,D[1]=v>>>8&255,n.check=i(n.check,D,2,0)),g=v=0,n.mode=5;case 5:if(1024&n.flags){for(;g<16;){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}n.length=v,n.head&&(n.head.extra_len=v),512&n.flags&&(D[0]=255&v,D[1]=v>>>8&255,n.check=i(n.check,D,2,0)),g=v=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(p<(O=n.length)&&(O=p),O&&(n.head&&(A=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,l,d,O,A)),512&n.flags&&(n.check=i(n.check,l,O,d)),p-=O,d+=O,n.length-=O),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===p)break e;for(O=0;A=l[d+O++],n.head&&A&&n.length<65536&&(n.head.name+=String.fromCharCode(A)),A&&O<p;);if(512&n.flags&&(n.check=i(n.check,l,O,d)),p-=O,d+=O,A)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===p)break e;for(O=0;A=l[d+O++],n.head&&A&&n.length<65536&&(n.head.comment+=String.fromCharCode(A)),A&&O<p;);if(512&n.flags&&(n.check=i(n.check,l,O,d)),p-=O,d+=O,A)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;g<16;){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}if(v!==(65535&n.check)){e.msg="header crc mismatch",n.mode=30;break}g=v=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;g<32;){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}e.adler=n.check=c(v),g=v=0,n.mode=11;case 11:if(0===n.havedict)return e.next_out=f,e.avail_out=m,e.next_in=d,e.avail_in=p,n.hold=v,n.bits=g,2;e.adler=n.check=1,n.mode=12;case 12:if(5===t||6===t)break e;case 13:if(n.last){v>>>=7&g,g-=7&g,n.mode=27;break}for(;g<3;){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}switch(n.last=1&v,g-=1,3&(v>>>=1)){case 0:n.mode=14;break;case 1:if(b(n),n.mode=20,6!==t)break;v>>>=2,g-=2;break e;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}v>>>=2,g-=2;break;case 14:for(v>>>=7&g,g-=7&g;g<32;){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}if((65535&v)!=(v>>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&v,g=v=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(O=n.length){if(p<O&&(O=p),m<O&&(O=m),0===O)break e;r.arraySet(h,l,d,O,f),p-=O,d+=O,m-=O,f+=O,n.length-=O;break}n.mode=12;break;case 17:for(;g<14;){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}if(n.nlen=257+(31&v),v>>>=5,g-=5,n.ndist=1+(31&v),v>>>=5,g-=5,n.ncode=4+(15&v),v>>>=4,g-=4,286<n.nlen||30<n.ndist){e.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;g<3;){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}n.lens[P[n.have++]]=7&v,v>>>=3,g-=3}for(;n.have<19;)n.lens[P[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,R={bits:n.lenbits},N=s(0,n.lens,0,19,n.lencode,0,n.work,R),n.lenbits=R.bits,N){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;j=(L=n.lencode[v&(1<<n.lenbits)-1])>>>16&255,E=65535&L,!((_=L>>>24)<=g);){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}if(E<16)v>>>=_,g-=_,n.lens[n.have++]=E;else{if(16===E){for(I=_+2;g<I;){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}if(v>>>=_,g-=_,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}A=n.lens[n.have-1],O=3+(3&v),v>>>=2,g-=2}else if(17===E){for(I=_+3;g<I;){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}g-=_,A=0,O=3+(7&(v>>>=_)),v>>>=3,g-=3}else{for(I=_+7;g<I;){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}g-=_,A=0,O=11+(127&(v>>>=_)),v>>>=7,g-=7}if(n.have+O>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;O--;)n.lens[n.have++]=A}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,R={bits:n.lenbits},N=s(1,n.lens,0,n.nlen,n.lencode,0,n.work,R),n.lenbits=R.bits,N){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,R={bits:n.distbits},N=s(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,R),n.distbits=R.bits,N){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(6<=p&&258<=m){e.next_out=f,e.avail_out=m,e.next_in=d,e.avail_in=p,n.hold=v,n.bits=g,o(e,w),f=e.next_out,h=e.output,m=e.avail_out,d=e.next_in,l=e.input,p=e.avail_in,v=n.hold,g=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;j=(L=n.lencode[v&(1<<n.lenbits)-1])>>>16&255,E=65535&L,!((_=L>>>24)<=g);){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}if(j&&0==(240&j)){for(T=_,C=j,M=E;j=(L=n.lencode[M+((v&(1<<T+C)-1)>>T)])>>>16&255,E=65535&L,!(T+(_=L>>>24)<=g);){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}v>>>=T,g-=T,n.back+=T}if(v>>>=_,g-=_,n.back+=_,n.length=E,0===j){n.mode=26;break}if(32&j){n.back=-1,n.mode=12;break}if(64&j){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&j,n.mode=22;case 22:if(n.extra){for(I=n.extra;g<I;){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}n.length+=v&(1<<n.extra)-1,v>>>=n.extra,g-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;j=(L=n.distcode[v&(1<<n.distbits)-1])>>>16&255,E=65535&L,!((_=L>>>24)<=g);){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}if(0==(240&j)){for(T=_,C=j,M=E;j=(L=n.distcode[M+((v&(1<<T+C)-1)>>T)])>>>16&255,E=65535&L,!(T+(_=L>>>24)<=g);){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}v>>>=T,g-=T,n.back+=T}if(v>>>=_,g-=_,n.back+=_,64&j){e.msg="invalid distance code",n.mode=30;break}n.offset=E,n.extra=15&j,n.mode=24;case 24:if(n.extra){for(I=n.extra;g<I;){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}n.offset+=v&(1<<n.extra)-1,v>>>=n.extra,g-=n.extra,n.back+=n.extra}if(n.offset>
vendor: 4,606 bytes, line 2
2n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===m)break e;if(O=w-m,n.offset>O){if((O=n.offset-O)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}k=O>n.wnext?(O-=n.wnext,n.wsize-O):n.wnext-O,O>n.length&&(O=n.length),S=n.window}else S=h,k=f-n.offset,O=n.length;for(m<O&&(O=m),m-=O,n.length-=O;h[f++]=S[k++],--O;);0===n.length&&(n.mode=21);break;case 26:if(0===m)break e;h[f++]=n.length,m--,n.mode=21;break;case 27:if(n.wrap){for(;g<32;){if(0===p)break e;p--,v|=l[d++]<<g,g+=8}if(w-=m,e.total_out+=w,n.total+=w,w&&(e.adler=n.check=n.flags?i(n.check,h,w,f-w):a(n.check,h,w,f-w)),w=m,(n.flags?v:c(v))!==n.check){e.msg="incorrect data check",n.mode=30;break}g=v=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;g<32;){if(0===p)break e;p--,v+=l[d++]<<g,g+=8}if(v!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=30;break}g=v=0}n.mode=29;case 29:N=1;break e;case 30:N=-3;break e;case 31:return-4;case 32:default:return u}return e.next_out=f,e.avail_out=m,e.next_in=d,e.avail_in=p,n.hold=v,n.bits=g,(n.wsize||w!==e.avail_out&&n.mode<30&&(n.mode<27||4!==t))&&y(e,e.output,e.next_out,w-e.avail_out)?(n.mode=31,-4):(x-=e.avail_in,w-=e.avail_out,e.total_in+=x,e.total_out+=w,n.total+=w,n.wrap&&w&&(e.adler=n.check=n.flags?i(n.check,h,w,e.next_out-w):a(n.check,h,w,e.next_out-w)),e.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0==x&&0===w||4===t)&&0===N&&(N=-5),N)},n.inflateEnd=function(e){if(!e||!e.state)return u;var t=e.state;return t.window&&(t.window=null),e.state=null,0},n.inflateGetHeader=function(e,t){var n;return e&&e.state?0==(2&(n=e.state).wrap)?u:((n.head=t).done=!1,0):u},n.inflateSetDictionary=function(e,t){var n,r=t.length;return e&&e.state?0!==(n=e.state).wrap&&11!==n.mode?u:11===n.mode&&a(1,t,r,0)!==n.check?-3:y(e,t,r,r)?(n.mode=31,-4):(n.havedict=1,0):u},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,n){"use strict";var r=e("../utils/common"),a=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],i=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,n,u,c,l,h,d){var f,p,m,v,g,b,y,x,w,O=d.bits,k=0,S=0,_=0,j=0,E=0,T=0,C=0,M=0,A=0,N=0,R=null,I=0,L=new r.Buf16(16),D=new r.Buf16(16),P=null,z=0;for(k=0;k<=15;k++)L[k]=0;for(S=0;S<u;S++)L[t[n+S]]++;for(E=O,j=15;1<=j&&0===L[j];j--);if(j<E&&(E=j),0===j)return c[l++]=20971520,c[l++]=20971520,d.bits=1,0;for(_=1;_<j&&0===L[_];_++);for(E<_&&(E=_),k=M=1;k<=15;k++)if(M<<=1,(M-=L[k])<0)return-1;if(0<M&&(0===e||1!==j))return-1;for(D[1]=0,k=1;k<15;k++)D[k+1]=D[k]+L[k];for(S=0;S<u;S++)0!==t[n+S]&&(h[D[t[n+S]]++]=S);if(b=0===e?(R=P=h,19):1===e?(R=a,I-=257,P=i,z-=257,256):(R=o,P=s,-1),k=_,g=l,C=S=N=0,m=-1,v=(A=1<<(T=E))-1,1===e&&852<A||2===e&&592<A)return 1;for(;;){for(y=k-C,w=h[S]<b?(x=0,h[S]):h[S]>b?(x=P[z+h[S]],R[I+h[S]]):(x=96,0),f=1<<k-C,_=p=1<<T;c[g+(N>>C)+(p-=f)]=y<<24|x<<16|w|0,0!==p;);for(f=1<<k-1;N&f;)f>>=1;if(0!==f?(N&=f-1,N+=f):N=0,S++,0==--L[k]){if(k===j)break;k=t[n+h[S]]}if(E<k&&(N&v)!==m){for(0===C&&(C=E),g+=_,M=1<<(T=k-C);T+C<j&&!((M-=L[T+C])<=0);)T++,M<<=1;if(A+=1<<T,1===e&&852<A||2===e&&592<A)return 1;c[m=N&v]=E<<24|T<<16|g-l|0}}return 0!==N&&(c[g+N]=k-C<<24|64<<16|0),d.bits=E,0}},{"../utils/common":41}],51:[function(e,t,n){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,n){"use strict";var r=e("../utils/common");function a(e){for(var t=e.length;0<=--t;)e[t]=0}var i=256,o=286,s=30,u=15,c=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],l=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],d=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],f=new Array(576);a(f);var p=new Array(60);a(p);var m=new Array(512);a(m);var v=new Array(256);a(v);var g=new Array(29);a(g);var b,y,x,w=new Array(s);function O(e,t,n,r,a){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=a,this.has_stree=e&&e.length}function k(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function S(e){return e<256?m[e]:m[256+(e>>>7)]}
vendor: 5,746 bytes, line 2
2function _(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function j(e,t,n){e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,_(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function E(e,t,n){j(e,n[2*t],n[2*t+1])}function T(e,t){for(var n=0;n|=1&e,e>>>=1,n<<=1,0<--t;);return n>>>1}function C(e,t,n){var r,a,i=new Array(16),o=0;for(r=1;r<=u;r++)i[r]=o=o+n[r-1]<<1;for(a=0;a<=t;a++){var s=e[2*a+1];0!==s&&(e[2*a]=T(i[s]++,s))}}function M(e){var t;for(t=0;t<o;t++)e.dyn_ltree[2*t]=0;for(t=0;t<s;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function A(e){8<e.bi_valid?_(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function N(e,t,n,r){var a=2*t,i=2*n;return e[a]<e[i]||e[a]===e[i]&&r[t]<=r[n]}function R(e,t,n){for(var r=e.heap[n],a=n<<1;a<=e.heap_len&&(a<e.heap_len&&N(t,e.heap[a+1],e.heap[a],e.depth)&&a++,!N(t,r,e.heap[a],e.depth));)e.heap[n]=e.heap[a],n=a,a<<=1;e.heap[n]=r}function I(e,t,n){var r,a,o,s,u=0;if(0!==e.last_lit)for(;r=e.pending_buf[e.d_buf+2*u]<<8|e.pending_buf[e.d_buf+2*u+1],a=e.pending_buf[e.l_buf+u],u++,0===r?E(e,a,t):(E(e,(o=v[a])+i+1,t),0!==(s=c[o])&&j(e,a-=g[o],s),E(e,o=S(--r),n),0!==(s=l[o])&&j(e,r-=w[o],s)),u<e.last_lit;);E(e,256,t)}function L(e,t){var n,r,a,i=t.dyn_tree,o=t.stat_desc.static_tree,s=t.stat_desc.has_stree,c=t.stat_desc.elems,l=-1;for(e.heap_len=0,e.heap_max=573,n=0;n<c;n++)0!==i[2*n]?(e.heap[++e.heap_len]=l=n,e.depth[n]=0):i[2*n+1]=0;for(;e.heap_len<2;)i[2*(a=e.heap[++e.heap_len]=l<2?++l:0)]=1,e.depth[a]=0,e.opt_len--,s&&(e.static_len-=o[2*a+1]);for(t.max_code=l,n=e.heap_len>>1;1<=n;n--)R(e,i,n);for(a=c;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],R(e,i,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,i[2*a]=i[2*n]+i[2*r],e.depth[a]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,i[2*n+1]=i[2*r+1]=a,e.heap[1]=a++,R(e,i,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,a,i,o,s,c=t.dyn_tree,l=t.max_code,h=t.stat_desc.static_tree,d=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,p=t.stat_desc.extra_base,m=t.stat_desc.max_length,v=0;for(i=0;i<=u;i++)e.bl_count[i]=0;for(c[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<573;n++)m<(i=c[2*c[2*(r=e.heap[n])+1]+1]+1)&&(i=m,v++),c[2*r+1]=i,l<r||(e.bl_count[i]++,o=0,p<=r&&(o=f[r-p]),s=c[2*r],e.opt_len+=s*(i+o),d&&(e.static_len+=s*(h[2*r+1]+o)));if(0!==v){do{for(i=m-1;0===e.bl_count[i];)i--;e.bl_count[i]--,e.bl_count[i+1]+=2,e.bl_count[m]--,v-=2}while(0<v);for(i=m;0!==i;i--)for(r=e.bl_count[i];0!==r;)l<(a=e.heap[--n])||(c[2*a+1]!==i&&(e.opt_len+=(i-c[2*a+1])*c[2*a],c[2*a+1]=i),r--)}}(e,t),C(i,l,e.bl_count)}function D(e,t,n){var r,a,i=-1,o=t[1],s=0,u=7,c=4;for(0===o&&(u=138,c=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)a=o,o=t[2*(r+1)+1],++s<u&&a===o||(s<c?e.bl_tree[2*a]+=s:0!==a?(a!==i&&e.bl_tree[2*a]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,i=a,c=(s=0)===o?(u=138,3):a===o?(u=6,3):(u=7,4))}function P(e,t,n){var r,a,i=-1,o=t[1],s=0,u=7,c=4;for(0===o&&(u=138,c=3),r=0;r<=n;r++)if(a=o,o=t[2*(r+1)+1],!(++s<u&&a===o)){if(s<c)for(;E(e,a,e.bl_tree),0!=--s;);else 0!==a?(a!==i&&(E(e,a,e.bl_tree),s--),E(e,16,e.bl_tree),j(e,s-3,2)):s<=10?(E(e,17,e.bl_tree),j(e,s-3,3)):(E(e,18,e.bl_tree),j(e,s-11,7));i=a,c=(s=0)===o?(u=138,3):a===o?(u=6,3):(u=7,4)}}a(w);var z=!1;function F(e,t,n,a){j(e,0+(a?1:0),3),function(e,t,n,a){A(e),_(e,n),_(e,~n),r.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}(e,t,n)}n._tr_init=function(e){z||(function(){var e,t,n,r,a,i=new Array(16);for(r=n=0;r<28;r++)for(g[r]=n,e=0;e<1<<c[r];e++)v[n++]=r;for(v[n-1]=r,r=a=0;r<16;r++)for(w[r]=a,e=0;e<1<<l[r];e++)m[a++]=r;for(a>>=7;r<s;r++)for(w[r]=a<<7,e=0;e<1<<l[r]-7;e++)m[256+a++]=r;for(t=0;t<=u;t++)i[t]=0;for(e=0;e<=143;)f[2*e+1]=8,e++,i[8]++;for(;e<=255;)f[2*e+1]=9,e++,i[9]++;for(;e<=279;)f[2*e+1]=7,e++,i[7]++;for(;e<=287;)f[2*e+1]=8,e++,i[8]++;for(C(f,287,i),e=0;e<s;e++)p[2*e+1]=5,p[2*e]=T(e,5);b=new O(f,c,257,o,u),y=new O(p,l,0,s,u),x=new O(new Array(0),h,0,19,7)}(),z=!0),e.l_desc=new k(e.dyn_ltree,b),e.d_desc=new k(e.dyn_dtree,y),e.bl_desc=new k(e.bl_tree,x),e.bi_buf=0,e.bi_valid=0,M(e)},n._tr_stored_block=F,n._tr_flush_block=function(e,t,n,r){var a,o,s=0;0<e.level?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<i;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),L(e,e.l_desc),L(e,e.d_desc),s=function(e){var t;for(D(e,e.dyn_ltree,e.l_desc.max_code),D(e,e.dyn_dtree,e.d_desc.max_code),L(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*d[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),a=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=a&&(a=o)):a=o=n+5,n+4<=a&&-1!==t?F(e,t,n,r):4===e.strategy||o===a?(j(e,2+(r?1:0),3),I(e,f,p)):(j(e,4+(r?1:0),3),function(e,t,n,r){var a;for(j(e,t-257,5),j(e,n-1,5),j(e,r-4,4),a=0;a<r;a++)j(e,e.bl_tree[2*d[a]+1],3);P(e,e.dyn_ltree,t-1),P(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),I(e,e.dyn_ltree,e.dyn_dtree)),M(e),r&&A(e)},n._tr_tally=function(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(v[n]+i+1)]++,e.dyn_dtree[2*S(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){j(e,2,3),E(e,256,f),function(e){16===e.bi_valid?(_(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){"use strict";
2t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,n){"use strict";t.exports="function"==typeof r?r:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e)}},{}]},{},[10])(10)}).call(this,n(116).Buffer,n(112),n(235).setImmediate)},function(e,t,n){e.exports=n(366)},function(e,t,n){"use strict";var r=n(93);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(1)),i=(0,r(n(97)).default)(a.default.createElement("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 00-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),"Create");t.default=i},function(e,t,n){"use strict";n.d(t,"a",(function(){return a.browser}));var r,a=n(0),i=n(5),o=n(11),s=n(15),u=n(16);function c(){return null==r&&(r=Object(a.backend)().epsilon()),r}var l=n(19),h=n(8),d=n(18),f=n(57),p=n(22),m=n(162);var v=n(220);function g(e,t,n){return(g=Object(v.a)()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&Object(m.a)(a,n.prototype),a}).apply(null,arguments)}function b(e){var t="function"===typeof Map?new Map:void 0;return(b=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return g(e,arguments,Object(p.a)(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Object(m.a)(r,e)})(e)}var y=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),r=t.call(this,e),Object.setPrototypeOf(Object(f.a)(r),n.prototype),r}return n}(b(Error)),x=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),r=t.call(this,e),Object.setPrototypeOf(Object(f.a)(r),n.prototype),r}return n}(b(Error)),w=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),r=t.call(this,e),Object.setPrototypeOf(Object(f.a)(r),n.prototype),r}return n}(b(Error)),O=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),r=t.call(this,e),Object.setPrototypeOf(Object(f.a)(r),n.prototype),r}return n}(b(Error)),k=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),r=t.call(this,e),Object.setPrototypeOf(Object(f.a)(r),n.prototype),r}return n}(b(Error));Error;function S(e,t){if(Array.isArray(e)){for(var n=[],r=0;r<t;r++)n=n.concat(e);return n}var a=new Array(t);return a.fill(e),a}function _(e,t){if(!e)throw new k(t)}function j(e,t){var n,r=0,a=Object(d.a)(e);try{for(a.s();!(n=a.n()).done;){n.value===t&&r++}}catch(i){a.e(i)}finally{a.f()}return r}function E(e){return 1===e.length?e[0]:e}function T(e){return Array.isArray(e)?e:[e]}function C(e){var t=e.replace(/(.)([A-Z][a-z0-9]+)/g,"$1_$2").replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase();return"_"!==t[0]?t:"private"+t}function M(e){return e.length<=1||-1===e.indexOf("_")?e:e.replace(/[_]+(\w|$)/g,(function(e,t){return t.toUpperCase()}))}var A={};function N(e){if(null===e||void 0===e)return null;var t={};return t.className=e.getClassName(),t.config=e.getConfig(),t}function R(e){if(null!=e&&"object"===typeof e)if(Array.isArray(e))e.forEach((function(e){return R(e)}));else for(var t=0,n=Object.keys(e);t<n.length;t++){var r=n[t],a=e[r];null!=a&&"object"===typeof a&&(Array.isArray(a)||"ndarray"!==a.type||"number"!==typeof a.value?R(a):e[r]=a.value)}}function I(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"object",a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if("string"===typeof e){var i,o=e;if(o in n)i=n[o];else if(o in A)i=A[o];else if(null==(i=t[o]))throw new w("Unknown ".concat(r,": ").concat(e,". ")+"This may be due to one of the following reasons:\n"+"1. The ".concat(r," is defined in Python, in which ")+"case it needs to be ported to TensorFlow.js or your JavaScript code.\n"+"2. The custom ".concat(r," is defined in JavaScript, ")+"but is not registered properly with tf.serialization.registerClass().");return i}var s=e;if(null==s.className||null==s.config)throw new w("".concat(r,": Improper config format: ")+"".concat(JSON.stringify(s),".\n")+"'className' and 'config' must set.");var u,c,l=s.className;if(l in n){var d=Object(h.a)(n[l],2);u=d[0],c=d[1]}else if(l in A){var f=Object(h.a)(A.className,2);u=f[0],c=f[1]}else if(l in t){var p=Object(h.a)(t[l],2);u=p[0],c=p[1]}if(null==u)throw new w("Unknown ".concat(r,": ").concat(l,". ")+"This may be due to one of the following reasons:\n"+"1. The ".concat(r," is defined in Python, in which ")+"case it needs to be ported to TensorFlow.js or your JavaScript code.\n"+"2. The custom ".concat(r," is defined in JavaScript, ")+"but is not registered properly with tf.serialization.registerClass().");if(null!=c){for(var m={},v=0,g=Object.keys(A);v<g.length;v++){var b=g[v];m[b]=A[b]}for(var y=0,x=Object.keys(n);y<x.length;y++){var O=x[y];m[O]=n[O]}var k=s.config;k.customObjects=m;for(var S=Object.assign({},A),_=0,j=Object.keys(n);_<j.length;_++){var E=j[_];A[E]=n[E]}R(s.config);var T=c(u,s.config,n,a);return A=Object.assign({},S),T}for(var C=Object.assign({},A),M=0,N=Object.keys(n);M<N.length;M++){var I=N[M];A[I]=n[I]}var L=new u(s.config);return A=Object.assign({},C),L}function L(e,t){return-1*function(e,t){return e<t?-1:e>t?1:0}(e,t)}function D(e){if(null==e)return e;var t,n=[],r=Object(d.a)(e);try{for(r.s();!(t=r.n()).done;){var a=t.value;-1===n.indexOf(a)&&n.push(a)}}catch(i){r.e(i)}finally{r.f()}return n}function P(e){if(null==e)throw new w("Invalid value in obj: ".concat(JSON.stringify(e)));for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function z(e,t,n){if(null!=n&&e.indexOf(n)<0)throw new w("".concat(n," is not a valid ").concat(t,". Valid values are ").concat(e," or null/undefined."))}function F(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0;return _(n>=0),_(r>=n),Array.isArray(e)&&e.length>=n&&e.length<=r&&e.every((function(e){return typeof e===t}))}function B(e,t){Array.isArray(e)?(a.util.assert(e.length>0,(function(){return"".concat(t," is unexpectedly an empty array.")})),e.forEach((function(e,n){return B(e,"element ".concat(n+1," of ").concat(t))}))):a.util.assert(Number.isInteger(e)&&e>0,(function(){return"Expected ".concat(t," to be a positive integer, but got ")+"".concat(function e(t){return null===t?"null":Array.isArray(t)?"["+t.map((function(t){return e(t)})).join(",")+"]":"string"===typeof t?'"'.concat(t,'"'):"".concat(t)}(e),".")}))}function U(e){return"relu"===e?"relu":"linear"===e?"linear":"elu"===e?"elu":null}function W(e,t){return Object(a.tidy)((function(){return a.sqrt(a.sum(a.mul(e,e),t,!0))}))}var V=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"getConfig",value:function(){return{}}}]),n}(a.serialization.Serializable),G=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this)).defaultMaxValue=2,r.defaultAxis=0,r.maxValue=null!=e.maxValue?e.maxValue:r.defaultMaxValue,r.axis=null!=e.axis?e.axis:r.defaultAxis,r}return Object(o.a)(n,[{key:"apply",value:function(e){var t=this;return Object(a.tidy)((function(){var n=W(e,t.axis),r=a.clipByValue(n,0,t.maxValue);return a.mul(e,a.div(r,a.add(c(),n)))}))}},{key:"getConfig",value:function(){return{maxValue:this.maxValue,axis:this.axis}}}]),n}(V);G.className="MaxNorm",a.serialization.registerClass(G);var H=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this)).defaultAxis=0,r.axis=null!=e.axis?e.axis:r.defaultAxis,r}return Object(o.a)(n,[{key:"apply",value:function(e){var t=this;return Object(a.tidy)((function(){return a.div(e,a.add(c(),W(e,t.axis)))}))}},{key:"getConfig",value:function(){return{axis:this.axis}}}]),n}(V);H.className="UnitNorm",a.serialization.registerClass(H);var q=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"apply",value:function(e){return a.relu(e)}}]),n}(V);q.className="NonNeg",a.serialization.registerClass(q);var X=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this)).defaultMinValue=0,r.defaultMaxValue=1,r.defaultRate=1,r.defaultAxis=0,r.minValue=null!=e.minValue?e.minValue:r.defaultMinValue,r.maxValue=null!=e.maxValue?e.maxValue:r.defaultMaxValue,r.rate=null!=e.rate?e.rate:r.defaultRate,r.axis=null!=e.axis?e.axis:r.defaultAxis,r}return Object(o.a)(n,[{key:"apply",value:function(e){var t=this;return Object(a.tidy)((function(){var n=W(e,t.axis),r=a.add(a.mul(t.rate,a.clipByValue(n,t.minValue,t.maxValue)),a.mul(1-t.rate,n));return a.mul(e,a.div(r,a.add(c(),n)))}))}},{key:"getConfig",value:function(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}}]),n}(V);X.className="MinMaxNorm",a.serialization.registerClass(X);
2var Y={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function K(e){return N(e)}function Z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return I(e,a.serialization.SerializationMap.getMap().classNameMap,t,"constraint")}function J(e){return null==e?null:"string"===typeof e?Z({className:e in Y?Y[e]:e,config:{}}):e instanceof V?e:Z(e)}var Q=["channelsFirst","channelsLast"],$=["valid","same","causal"],ee=["max","avg"],te=["sum","mul","concat","ave"],ne=new Map;function re(e){z(Q,"DataFormat",e)}function ae(e){z($,"PaddingMode",e)}function ie(e){z(ee,"PoolMode",e)}var oe=[];function se(e,t){oe.push(e);try{var n=t();return oe.pop(),n}catch(r){throw oe.pop(),r}}function ue(e){if(!he(e))throw new Error("Not a valid tensor name: '"+e+"'");return(0===oe.length?"":oe.join("/")+"/")+e}function ce(e){if(!he(e))throw new Error("Not a valid tensor name: '"+e+"'");ne.has(e)||ne.set(e,0);var t=ne.get(e);if(ne.set(e,ne.get(e)+1),t>0){var n="".concat(e,"_").concat(t);return ne.set(n,1),n}return e}var le=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function he(e){return!!e.match(le)}function de(e,t,n){null==t&&(t=0),null==n&&(n=e.length);for(var r=1,a=t;a<n;++a)r*=e[a];return r}function fe(e){return e=Array.isArray(e)?new Float32Array(e):e,Object(a.tensor1d)(e)}function pe(e){return a.min(fe(e)).dataSync()[0]}function me(e){return a.max(fe(e)).dataSync()[0]}function ve(e,t){if(t<e)throw new w("end (".concat(t,") < begin (").concat(e,") is forbidden."));for(var n=[],r=e;r<t;++r)n.push(r);return n}function ge(e,t){return e.asType(t)}function be(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=e.shape.slice();return t<0&&(t=n.length+t+1),n.splice(t,0,1),e.reshape(n)}function ye(e){var t=[de(e.shape)];return e.reshape(t)}function xe(e,t,n){return Object(a.tidy)((function(){switch(e.rank){case 1:return a.slice1d(e,t,n);case 2:return a.slice2d(e,[t,0],[n,e.shape[1]]);case 3:return a.slice3d(e,[t,0,0],[n,e.shape[1],e.shape[2]]);case 4:return a.slice4d(e,[t,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3]]);case 5:return a.slice(e,[t,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4]]);case 6:return a.slice(e,[t,0,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4],e.shape[5]]);default:throw new w("sliceAlongFirstAxis() received an unsupported tensor rank: "+"".concat(e.rank))}}))}function we(e,t,n){return Object(a.tidy)((function(){switch(e.rank){case 1:return a.slice1d(e,t,n);case 2:return a.slice2d(e,[0,t],[e.shape[0],n]);case 3:return a.slice3d(e,[0,0,t],[e.shape[0],e.shape[1],n]);case 4:return a.slice4d(e,[0,0,0,t],[e.shape[0],e.shape[1],e.shape[2],n]);default:throw new w("sliceAlongLastAxis() received an unsupported tensor rank: "+"".concat(e.rank))}}))}function Oe(e,t,n,r){return Object(a.tidy)((function(){switch(e.rank){case 1:return a.slice1d(e,t,n);case 2:switch(r){case 1:return xe(e,t,n);case 2:return we(e,t,n);default:throw new w("The axis is not within the rank of the tensor "+"".concat(r))}case 3:switch(r){case 1:return xe(e,t,n);case 2:return a.slice3d(e,[0,t,0],[e.shape[0],n,e.shape[2]]);case 3:return we(e,t,n);default:throw new w("The axis is not within the rank of the tensor "+"".concat(r))}case 4:switch(r){case 1:return xe(e,t,n);case 2:return a.slice4d(e,[0,t,0,0],[e.shape[0],n,e.shape[2],e.shape[3]]);case 3:return a.slice4d(e,[0,0,t,0],[e.shape[0],e.shape[1],n,e.shape[3]]);case 4:return we(e,t,n);default:throw new w("The axis is not within the rank of the tensor "+"".concat(r))}default:throw new w("sliceAlongLastAxis() received an unsupported tensor rank: "+"".concat(e.rank))}}))}function ke(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return n<0&&(n=0!==(t=e[0].rank)?t:0),n===e[0].rank&&(n=-1),a.concat(e,n)}function Se(e,t){switch(e.rank){case 1:return a.concat1d([e,t]);case 2:return a.concat2d([e,t],0);case 3:return a.concat3d([e,t],0);case 4:return a.concat4d([e,t],0);default:throw new w("concatAlongFirstAxis() received an unsupported "+"tensor rank: ".concat(e.rank))}}function _e(e,t){if(Array.isArray(t)||(t=[t]),e.rank!==t.length)throw new w("The length of input n (".concat(t.length,") does not match ")+"the number of dimensions in input x (".concat(e.rank,")"));return a.tile(e,t)}function je(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;return a.randomNormal(e,t,n,r,i)}function Ee(e,t,n,r){if(e.rank<2||t.rank<2)throw new O("dot requires both inputs to be rank >= 2"+" but got x shape = ".concat(e.shape," and y shape = ").concat(t.shape));if(t.rank>=3&&e.shape.slice(-1)[0]!==t.shape.slice(-2)[0])throw new O("If rank y >= 3, then the second last dim"+" of y must equal the last dim of x but got x shape = ".concat(e.shape," and ")+" y shape = ".concat(t.shape));if(2===e.rank&&2===t.rank){return a.fused.matMul({a:e,b:t,transposeA:!1,transposeB:!1,bias:r?Me(e.rank,r,"channelsLast"):null,activation:n})}var i=e.shape.slice(),o=i.pop();e=e.reshape([-1,o]);var s=t.shape.slice(),u=s.pop(),c=s.pop(),h=[].concat(Object(l.a)(s),[u]),d=Array.from({length:t.rank},(function(e,n){return 0===n?t.rank-2:n<=t.rank-2?n-1:n}));t=t.transpose(d).reshape([c,-1]);
2var f=[].concat(Object(l.a)(i),Object(l.a)(h));return a.fused.matMul({a:e,b:t,transposeA:!1,transposeB:!1,bias:r?Me(e.rank,r,"channelsLast"):null,activation:n}).reshape(f)}function Te(e,t,n){return Object(a.tidy)((function(){return t=Array.isArray(t)?Object(a.tensor1d)(t,"int32"):t.toInt(),a.gather(e,t,n)}))}function Ce(e){return a.mul(e,e)}function Me(e,t,n){var r=t.shape;if(1!==t.rank&&t.rank!==e)throw new w("Unexpected bias dimensions: ".concat(t.rank)+"; expected it to be 1 or ".concat(e));if(5===e){if("channelsFirst"===n)return 1===r.length?t.reshape([1,r[0],1,1,1]):t.reshape([1,r[3],r[0],r[1],r[2]]);if("channelsLast"===n)return 1===r.length?t.reshape([1,1,1,1,r[0]]):t.reshape([1].concat(r))}else if(4===e){if("channelsFirst"===n)return 1===r.length?t.reshape([1,r[0],1,1]):t.reshape([1,r[2],r[0],r[1]]);if("channelsLast"===n)return 1===r.length?t.reshape([1,1,1,r[0]]):t.reshape([1].concat(r))}else if(3===e){if("channelsFirst"===n)return 1===r.length?t.reshape([1,r[0],1]):t.reshape([1,r[1],r[0]]);if("channelsLast"===n)return 1===r.length?t.reshape([1,1,r[0]]):t.reshape([1].concat(r))}else if(e<3)return t;throw new w("Unsupported input rank by biasAdd: ".concat(t.rank))}function Ae(e,t,n){return Object(a.tidy)((function(){return null==n&&(n="channelsLast"),re(n),e.add(Me(e.rank,t,n))}))}function Ne(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(1!==t)throw new O("Support for alpha values other than 1 (".concat(t,") is not implemented ")+"yet.");return a.elu(e)}function Re(e,t,n,r){return Object(a.tidy)((function(){return a.dropout(e,t,n,r)}))}function Ie(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return n?e():t()}var Le=["fanIn","fanOut","fanAvg"],De=["normal","uniform","truncatedNormal"];var Pe=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"fromConfigUsesCustomObjects",value:function(){return!1}},{key:"getConfig",value:function(){return{}}}]),n}(a.serialization.Serializable),ze=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"apply",value:function(e,t){return Object(a.zeros)(e,t)}}]),n}(Pe);ze.className="Zeros",a.serialization.registerClass(ze);var Fe=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"apply",value:function(e,t){return Object(a.ones)(e,t)}}]),n}(Pe);Fe.className="Ones",a.serialization.registerClass(Fe);var Be=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;if(Object(i.a)(this,n),r=t.call(this),"object"!==typeof e)throw new w("Expected argument of type ConstantConfig but got ".concat(e));if(void 0===e.value)throw new w("config must have value set but got ".concat(e));return r.value=e.value,r}return Object(o.a)(n,[{key:"apply",value:function(e,t){var n=this;return Object(a.tidy)((function(){return Object(a.mul)(Object(a.scalar)(n.value),Object(a.ones)(e,t))}))}},{key:"getConfig",value:function(){return{value:this.value}}}]),n}(Pe);Be.className="Constant",a.serialization.registerClass(Be);var Ue=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this)).DEFAULT_MINVAL=-.05,r.DEFAULT_MAXVAL=.05,r.minval=e.minval||r.DEFAULT_MINVAL,r.maxval=e.maxval||r.DEFAULT_MAXVAL,r.seed=e.seed,r}return Object(o.a)(n,[{key:"apply",value:function(e,t){return Object(a.randomUniform)(e,this.minval,this.maxval,t)}},{key:"getConfig",value:function(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}}]),n}(Pe);Ue.className="RandomUniform",a.serialization.registerClass(Ue);var We=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this)).DEFAULT_MEAN=0,r.DEFAULT_STDDEV=.05,r.mean=e.mean||r.DEFAULT_MEAN,r.stddev=e.stddev||r.DEFAULT_STDDEV,r.seed=e.seed,r}return Object(o.a)(n,[{key:"apply",value:function(e,t){if("float32"!==(t=t||"float32")&&"int32"!==t)throw new O("randomNormal does not support dType ".concat(t,"."));return je(e,this.mean,this.stddev,t,this.seed)}},{key:"getConfig",value:function(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}]),n}(Pe);We.className="RandomNormal",a.serialization.registerClass(We);var Ve=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this)).DEFAULT_MEAN=0,r.DEFAULT_STDDEV=.05,r.mean=e.mean||r.DEFAULT_MEAN,r.stddev=e.stddev||r.DEFAULT_STDDEV,r.seed=e.seed,r}return Object(o.a)(n,[{key:"apply",value:function(e,t){if("float32"!==(t=t||"float32")&&"int32"!==t)throw new O("truncatedNormal does not support dType ".concat(t,"."));return Object(a.truncatedNormal)(e,this.mean,this.stddev,t,this.seed)}},{key:"getConfig",value:function(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}]),n}(Pe);Ve.className="TruncatedNormal",a.serialization.registerClass(Ve);var Ge=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this)).gain=null!=e.gain?e.gain:1,r}return Object(o.a)(n,[{key:"apply",value:function(e,t){var n=this;return Object(a.tidy)((function(){if(2!==e.length||e[0]!==e[1])throw new w("Identity matrix initializer can only be used for 2D square matrices.");return Object(a.mul)(n.gain,Object(a.eye)(e[0]))}))}},{key:"getConfig",value:function(){return{gain:this.gain}}}]),n}(Pe);Ge.className="Identity",a.serialization.registerClass(Ge);var He=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r,a;if(Object(i.a)(this,n),r=t.call(this),e.scale<0)throw new w("scale must be a positive float. Got: ".concat(e.scale));return r.scale=null==e.scale?1:e.scale,r.mode=null==e.mode?"fanIn":e.mode,a=r.mode,z(Le,"FanMode",a),r.distribution=null==e.distribution?"normal":e.distribution,function(e){z(De,"Distribution",e)}(r.distribution),r.seed=e.seed,r}return Object(o.a)(n,[{key:"apply",value:function(e,t){var n=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"channelsLast";if(re(r),2===e.length)t=e[0],n=e[1];else if(-1!==[3,4,5].indexOf(e.length)){if("channelsFirst"===r){var a=de(e,2);t=e[1]*a,n=e[0]*a}else if("channelsLast"===r){var i=de(e,0,e.length-2);t=e[e.length-2]*i,n=e[e.length-1]*i}}else{var o=de(e);t=Math.sqrt(o),n=Math.sqrt(o)}return[t,n]}(e),r=n[0],i=n[1],o=this.scale;if("fanIn"===this.mode?o/=Math.max(1,r):"fanOut"===this.mode?o/=Math.max(1,i):o/=Math.max(1,(r+i)/2),"normal"===this.distribution){var s=Math.sqrt(o);if("float32"!==(t=t||"float32")&&"int32"!==t)throw new O("".concat(this.getClassName()," does not support dType ").concat(t,"."));return Object(a.truncatedNormal)(e,0,s,t,this.seed)}var u=Math.sqrt(3*o);return Object(a.randomUniform)(e,-u,u,t)}},{key:"getConfig",value:function(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}}}]),n}(Pe);He.className="VarianceScaling",a.serialization.registerClass(He);var qe=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,{scale:1,mode:"fanAvg",distribution:"uniform",seed:null==e?null:e.seed})}return Object(o.a)(n,[{key:"getClassName",value:function(){return He.className}}]),n}(He);qe.className="GlorotUniform",a.serialization.registerClass(qe);var Xe=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,{scale:1,mode:"fanAvg",distribution:"normal",seed:null==e?null:e.seed})}return Object(o.a)(n,[{key:"getClassName",value:function(){return He.className}}]),n}(He);Xe.className="GlorotNormal",a.serialization.registerClass(Xe);var Ye=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,{scale:2,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}return Object(o.a)(n,[{key:"getClassName",value:function(){return He.className}}]),n}(He);Ye.className="HeNormal",a.serialization.registerClass(Ye);var Ke=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,{scale:2,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}return Object(o.a)(n,[{key:"getClassName",value:function(){return He.className}}]),n}(He);Ke.className="HeUniform",a.serialization.registerClass(Ke);var Ze=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,{scale:1,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}return Object(o.a)(n,[{key:"getClassName",value:function(){return He.className}}]),n}(He);Ze.className="LeCunNormal",a.serialization.registerClass(Ze);var Je=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,{scale:1,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}return Object(o.a)(n,[{key:"getClassName",value:function(){return He.className}}]),n}(He);Je.className="LeCunNormal",a.serialization.registerClass(Je);var Qe=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;if(Object(i.a)(this,n),(r=t.call(this)).DEFAULT_GAIN=1,r.gain=null==e.gain?r.DEFAULT_GAIN:e.gain,r.seed=e.seed,null!=r.seed)throw new O("Random seed is not implemented for Orthogonal Initializer yet.");return r}return Object(o.a)(n,[{key:"apply",value:function(e,t){var n=this;return Object(a.tidy)((function(){if(e.length<2)throw new O("Shape must be at least 2D.");e[0]*e[1]>2e3&&console.warn("Orthogonal initializer is being called on a matrix with more "+"than 2000 (".concat(e[0]*e[1],") elements: ")+"Slowness may result.");var t=je(e[0]>e[1]?[e[1],e[0]]:e,0,1,"float32"),r=a.linalg.gramSchmidt(t);return e[0]>e[1]&&(r=r.transpose()),Object(a.mul)(n.gain,r)}))}},{key:"getConfig",value:function(){return{gain:this.gain,seed:this.seed}}}]),n}(Pe);Qe.className="Orthogonal",a.serialization.registerClass(Qe);var $e={constant:"Constant",glorotNormal:"GlorotNormal",glorotUniform:"GlorotUniform",heNormal:"HeNormal",heUniform:"HeUniform",identity:"Identity",leCunNormal:"LeCunNormal",le
2CunUniform:"LeCunUniform",ones:"Ones",orthogonal:"Orthogonal",randomNormal:"RandomNormal",randomUniform:"RandomUniform",truncatedNormal:"TruncatedNormal",varianceScaling:"VarianceScaling",zeros:"Zeros"};function et(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return I(e,a.serialization.SerializationMap.getMap().classNameMap,t,"initializer")}function tt(e){return N(e)}function nt(e){if("string"===typeof e){var t=e in $e?$e[e]:e;if("GlorotNormal"===t)return new Xe;if("GlorotUniform"===t)return new qe;if("HeNormal"===t)return new Ye;if("HeUniform"===t)return new Ke;if("LeCunNormal"===t)return new Ze;if("LeCunUniform"===t)return new Je;var n={};return n.className=t,n.config={},et(n)}return e instanceof Pe?e:et(e)}var rt=0;function at(){return rt++}var it={};function ot(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e in it||(it[e]=0),it[e]+=1,e+it[e].toString()}function st(e){return Array.isArray(e)&&Array.isArray(e[0])}function ut(e){return 0===e.length?[]:Array.isArray(e[0])?e:[e]}function ct(e){var t;if(Array.isArray(e)){if(1!==e.length)throw new w("Expected Tensor length to be 1; got ".concat(e.length));t=e[0]}else t=e;return t}function lt(e){if(Array.isArray(e)&&Array.isArray(e[0])){if(1===e.length)return(e=e)[0];throw new w("Expected exactly 1 Shape; got ".concat(e.length))}return e}function ht(e){var t,n=0,r=Object(d.a)(e);try{for(r.s();!(t=r.n()).done;){var a=t.value;0===a.shape.length?n+=1:n+=a.shape.reduce((function(e,t){return e*t}))}}catch(i){r.e(i)}finally{r.f()}return n}var dt=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"float32",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Variable",o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;Object(i.a)(this,e),this.dtype=null==n?"float32":n,this.shape=t.shape,this.id=at(),r=null==r?"Variable":r,this.originalName=ue(r),this.name=ce(this.originalName),this.trainable_=o,this.constraint=s,this.val=a.variable(t,this.trainable_,this.name,this.dtype)}return Object(o.a)(e,[{key:"read",value:function(){return this.assertNotDisposed(),this.val}},{key:"write",value:function(e){return this.assertNotDisposed(),function(e,t){if(e.shape.toString()!==t.shape.toString())throw new Error("Shape mismatch: "+JSON.stringify(e.shape)+" vs. "+JSON.stringify(t.shape))}(this.val,e),this.val.id!==e.id&&(this.val.assign(e),null!=this.constraint&&this.val.assign(this.constraint.apply(this.val))),this}},{key:"dispose",value:function(){this.assertNotDisposed(),this.val.dispose()}},{key:"assertNotDisposed",value:function(){if(this.val.isDisposed)throw new Error("LayersVariable ".concat(this.name," is already disposed."))}},{key:"trainable",get:function(){return this.trainable_},set:function(e){this.trainable_=e,this.val.trainable=e}}]),e}();function ft(e){return e.map((function(e){return e.read()}))}function pt(e){e.forEach((function(e){e[0].write(e[1])}))}var mt=function e(t){Object(i.a)(this,e),this.dtype=t.dtype,this.shape=t.shape,null!=t.shape?this.ndim=t.shape.length:this.ndim=t.ndim,this.maxNDim=t.maxNDim,this.minNDim=t.minNDim,this.axes=t.axes||{}},vt=function e(t,n,r,a,o,s,u){Object(i.a)(this,e),this.dtype=t,this.shape=n,this.sourceLayer=r,this.inputs=a,this.callArgs=o,this.outputTensorIndex=u,this.id=at(),null!=s&&(this.originalName=ue(s),this.name=ce(this.originalName)),this.rank=n.length},gt=0,bt=function(){function e(t,n){Object(i.a)(this,e),this.callArgs=n,this.id=gt++,this.outboundLayer=t.outboundLayer,this.inboundLayers=t.inboundLayers,this.nodeIndices=t.nodeIndices,this.tensorIndices=t.tensorIndices,this.inputTensors=t.inputTensors,this.outputTensors=t.outputTensors,this.inputMasks=t.inputMasks,this.outputMasks=t.outputMasks,this.inputShapes=t.inputShapes,this.outputShapes=t.outputShapes;var r,a=Object(d.a)(t.inboundLayers);try{for(a.s();!(r=a.n()).done;){var o=r.value;null!=o&&o.outboundNodes.push(this)}}catch(s){a.e(s)}finally{a.f()}t.outboundLayer.inboundNodes.push(this)}return Object(o.a)(e,[{key:"getConfig",value:function(){var e,t=[],n=Object(d.a)(this.inboundLayers);try{for(n.s();!(e=n.n()).done;){var r=e.value;null!=r?t.push(r.name):t.push(null)}}catch(a){n.e(a)}finally{n.f()}return{outboundLayer:this.outboundLayer?this.outboundLayer.name:null,inbou
vendor: 10,877 bytes, line 2
2ndLayers:t,nodeIndices:this.nodeIndices,tensorIndices:this.tensorIndices}}}]),e}(),yt=0,xt=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,n),(e=t.call(this))._callHook=null,e._addedWeightNames=[],e._stateful=!1,e.id=yt++,e.activityRegularizer=null,e.inputSpec=null,e.supportsMasking=!1,e._trainableWeights=[],e._nonTrainableWeights=[],e._losses=[],e._updates=[],e._built=!1,e.inboundNodes=[],e.outboundNodes=[];var a=r.name;if(!a){var o=e.getClassName();a=C(o)+"_"+ot(o)}if(e.name=a,e.trainable_=null==r.trainable||r.trainable,null!=r.inputShape||null!=r.batchInputShape){var s;if(null!=r.batchInputShape)s=r.batchInputShape;else if(null!=r.inputShape){var u=null;null!=r.batchSize&&(u=r.batchSize),s=[u].concat(r.inputShape)}e.batchInputShape=s;var c=r.dtype;null==c&&(c=r.inputDType),null==c&&(c="float32"),e.dtype=c}return null!=r.weights?e.initialWeights=r.weights:e.initialWeights=null,e._refCount=null,e.fastWeightInitDuringBuild=!1,e}return Object(o.a)(n,[{key:"getNodeAtIndex",value:function(e,t){if(0===this.inboundNodes.length)throw new x("The layer has never been called "+"and thus has no defined ".concat(t,"."));if(this.inboundNodes.length<=e)throw new w("Asked to get ".concat(t," at node ").concat(e,", ")+"but the layer has only ".concat(this.inboundNodes.length," inbound nodes."));return this.inboundNodes[e]}},{key:"getInputAt",value:function(e){return E(this.getNodeAtIndex(e,"input").inputTensors)}},{key:"getOutputAt",value:function(e){return E(this.getNodeAtIndex(e,"output").outputTensors)}},{key:"calculateLosses",value:function(){return this.losses.map((function(e){return e()}))}},{key:"resetStates",value:function(){if(!this.stateful)throw new Error("Cannot call the resetStates() method of a non-stateful Layer object.")}},{key:"assertInputCompatibility",value:function(e){if(e=T(e),null!=this.inputSpec&&0!==this.inputSpec.length){var t=T(this.inputSpec);if(e.length!==t.length)throw new w("Layer ".concat(this.name," expects ").concat(t.length," inputs, ")+"but it received ".concat(e.length," input tensors. ")+"Input received: ".concat(e));for(var n=0;n<e.length;n++){var r=e[n],a=t[n];if(null!=a){var i=r.rank;if(null!=a.ndim&&i!==a.ndim)throw new w("Input ".concat(n," is incompatible with layer ").concat(this.name,": ")+"expected ndim=".concat(a.ndim,", found ndim=").concat(i));if(null!=a.maxNDim&&i>a.maxNDim)throw new w("Input ".concat(n," is incompatible with layer ").concat(this.name)+": expected max_ndim=".concat(a.maxNDim,", found ndim=").concat(i));if(null!=a.minNDim&&i<a.minNDim)throw new w("Input ".concat(n," is incompatible with layer ").concat(this.name)+": expected min_ndim=".concat(a.minNDim,", found ndim=").concat(i,"."));if(null!=a.dtype&&r.dtype!==a.dtype)throw new w("Input ".concat(n," is incompatible with layer ").concat(this.name," ")+": expected dtype=".concat(a.dtype,", found dtype=").concat(r.dtype,"."));if(a.axes){var o=r.shape;for(var s in a.axes){var u=Number(s),c=a.axes[s],l=u>=0?o[u]:o[o.length+u];if(null!=c&&-1===[c,null].indexOf(l))throw new w("Input ".concat(n," is incompatible with layer ")+"".concat(this.name,": expected axis ").concat(u," of input shape to ")+"have value ".concat(c," but got shape ").concat(o,"."))}}if(null!=a.shape)for(var h=0;h<a.shape.length;++h){var d=a.shape[h],f=r.shape[h];if(null!=d&&null!=f&&d!==f)throw new w("Input ".concat(n," is incompatible with layer ")+"".concat(this.name,": expected shape=").concat(a.shape,", ")+"found shape=".concat(r.shape,"."))}}}}}},{key:"call",value:function(e,t){return e}},{key:"invokeCallHook",value:function(e,t){null!=this._callHook&&this._callHook(e,t)}},{key:"setCallHook",value:function(e){this._callHook=e}},{key:"clearCallHook",value:function(){this._callHook=null}},{key:"apply",value:function(e,t){var n=this;t=t||{},this.assertNotDisposed();var r,a=T(e),i=!0,o=Object(d.a)(a);try{for(o.s();!(r=o.n()).done;){if(!(r.value instanceof vt)){i=!1;break}}}catch(l){o.e(l)}finally{o.f()}var s,u=!0,c=Object(d.a)(a);try{for(c.s();!(s=c.n()).done;){if(s.value instanceof vt){u=!1;break}}}catch(l){c.e(l)}finally{c.f()}if(i===u)throw new w("Arguments to apply() must be all SymbolicTensors or all Tensors");return se(this.name,(function(){if(!n.built){n.assertInputCompatibility(e);var r,i=[],o=Object(d.a)(T(e));try{for(o.s();!(r=o.n()).done;){var s=r.value;i.push(s.shape)}}catch(l){o.e(l)}finally{o.f()}n.build(E(i)),n.built=!0,n.initialWeights&&n.setWeights(n.initialWeights),null===n._refCount&&u&&(n._refCount=1)}if(n.assertInputCompatibility(e),u){var c,h=n.call(e,t),f=T(h),p=[],m=Object(d.a)(f);try{for(m.s();!(c=m.n()).done;){var v=c.value;-1!==a.indexOf(v)&&(v=v.clone()),p.push(v)}}catch(l){m.e(l)}finally{m.f()}if(h=E(p),null!=n.activityRegularizer)throw new O("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return h}var g,b=function(e){e=T(e);var t,n=[],r=Object(d.a)(e);try{for(r.s();!(t=r.n()).done;){var a=t.value;n.push(a.shape)}}catch(l){r.e(l)}finally{r.f()}return E(n)}(e),y=n.computeOutputShape(b);if(n.warnOnIncompatibleInputShape(Array.isArray(e)?b[0]:b),g=null!=y&&y.length>0&&Array.isArray(y[0])?y.map((function(r,a){return new vt("float32",r,n,T(e),t,n.name,a)})):new vt("float32",y,n,T(e),t,n.name),n.addInboundNode(e,g,null,null,b,y,t),n._refCount++,null!=n.activityRegularizer)throw new O("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return g}))}},{key:"warnOnIncompatibleInputShape",value:function(e){if(null!=this.batchInputShape)if(e.length!==this.batchInputShape.length)console.warn("The rank of the input tensor provided (shape: "+"".concat(JSON.stringify(e),") does not match that of the ")+"batchInputShape (".concat(JSON.stringify(this.batchInputShape),") ")+"of the layer ".concat(this.name));else{var t=!1;this.batchInputShape.forEach((function(n,r){null!=n&&null!=e[r]&&e[r]!==n&&(t=!0)})),t&&console.warn("The shape of the input tensor "+"(".concat(JSON.stringify(e),") does not ")+"match the expectation of layer ".concat(this.name,": ")+"".concat(JSON.stringify(this.batchInputShape)))}}},{key:"countParams",value:function(){if(!this.built)throw new x("You tried to call countParams() on ".concat(this.name,", ")+"but the layer is not built yet. Build it first by calling build(batchInputShape).");return ht(this.weights)}},{key:"build",value:function(e){this.built=!0}},{key:"getWeights",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return ft(e?this.trainableWeights:this.weights)}},{key:"setWeights",value:function(e){var t=this;Object(a.tidy)((function(){var n=t.weights;if(n.length!==e.length)throw new w('You called setWeights(weights) on layer "'.concat(t.name,'" ')+"with a weight list of length ".concat(e.length,", ")+"but the layer was expecting ".concat(n.length," weights. ")+"Provided weights: ".concat(e,"..."));if(0!==n.length){for(var r=[],i=ft(n),o=0;o<i.length;++o){var s=i[o],u=n[o],c=e[o];if(!a.util.arraysEqual(s.shape,c.shape))throw new w("Layer weight shape ".concat(s.shape," ")+"not compatible with provided weight shape ".concat(c.shape));r.push([u,c])}pt(r)}}))}},{key:"addWeight",value:function(e,t,n,r,a,i,o){if(-1!==this._addedWeightNames.indexOf(e))throw new w("Duplicate weight name ".concat(e," for layer ").concat(this.name));this._addedWeightNames.push(e),null==n&&(n="float32"),this.fastWeightInitDuringBuild&&(r=nt("zeros"));var s=r.apply(t,n),u=new dt(s,n,e,i,o);return s.dispose(),null!=a&&this.addLoss((function(){return a.apply(u.read())})),null==i&&(i=!0),i?this._trainableWeights.push(u):this._nonTrainableWeights.push(u),u}},{key:"setFastWeightInitDuringBuild",value:function(e){this.fastWeightInitDuringBuild=e}},{key:"addLoss",value:function(e){var t;null==e||Array.isArray(e)&&0===e.length||(e=T(e),void 0!==this._losses&&null!==this._losses&&(t=this.losses).push.apply(t,Object(l.a)(e)))}},{key:"computeOutputShape",value:function(e){return e}},{key:"computeMask",value:function(e,t){var n=this;if(!this.supportsMasking){if(null!=t){if(!Array.isArray(t))throw new TypeError("Layer ".concat(this.name," does not support masking, ")+"but was passed an inputMask.");t.forEach((function(e){if(null!=e)throw new TypeError("Layer ".concat(n.name," does not support masking, ")+"but was passed an inputMask.")}))}return null}return t}},{key:"addInboundNode",value:function(e,t,n,r,a,i){var o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,s=T(e);t=T(t),n=T(n),r=T(r),a=ut(a),i=ut(i);var u,c=[],l=[],h=[],f=Object(d.a)(s);try{for(f.s();!(u=f.n()).done;){var p=u.value;c.push(p.sourceLayer),l.push(p.nodeIndex),h.push(p.tensorIndex)}}catch(v){f.e(v)}finally{f.f()}new bt({outboundLayer:this,inboundLayers:c,nodeIndices:l,tensorIndices:h,inputTensors:s,outputTensors:t,inputMasks:n,outputMasks:r,inputShapes:a,outputShapes:i},o);for(var m=0;m<t.length;m++)t[m].sourceLayer=this,t[m].nodeIndex=this.inboundNodes.length-1,t[m].tensorIndex=m}},{key:"getConfig",value:function(){var e={name:this.name,trainable:this.trainable};return null!=this.batchInputShape&&(e.batchInputShape=this.batchInputShape),null!=this.dtype&&(e.dtype=this.dtype),e}},{key:"disposeWeights",value:function(){return this.weights.forEach((function(e){return e.dispose()})),this.weights.length}},{key:"assertNotDisposed",value:function(){if(0===this._refCount)throw new Error("Layer '".concat(this.name,"' is already disposed."))}},{key:"dispose",value:function(){if(!this.built)throw new Error("Cannot dispose Layer ".concat(this.name," because it has not been ")+"built yet.");if(null===this._refCount)throw new Error("Cannot dispose Layer ".concat(this.name," because it has not been used ")+"yet.");this.assertNotDisposed();var e=0;return 0===--this._refCount&&(e=this.disposeWeights()),{refCountAfterDispose:this._refCount,numDisposedVariables:e}}},{key:"input",get:function(){if(this.inboundNodes.length>1)throw new y("Layer ".concat(this.name)+' has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use `getInputAt(nodeIndex)` instead.');if(0===this.inboundNodes.length)throw new y("Layer ".concat(this.name)+" is not connected, no input to return.");return E(this.getNodeAtIndex(0,"input").inputTensors)}},{key:"output",get:function(){if(0===this.inboundNodes.length)throw new y("Layer ".concat(this.name)+" has no inbound nodes.");if(this.inboundNodes.length>1)throw new y("Layer ".concat(this.name)+' has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use `getOutputAt(nodeIndex)` instead.');return E(this.getNodeAtIndex(0,"output").outputTensors)}},{key:"losses",get:function(){return this._losses}},{key:"updates",get:function(){return this._updates}},{key:"built",get:function(){return this._built},set:function(e){this._built=e}},{key:"trainable",get:function(){return this.trainable_}
2,set:function(e){this._trainableWeights.forEach((function(t){return t.trainable=e})),this.trainable_=e}},{key:"trainableWeights",get:function(){return this.trainable_?this._trainableWeights.filter((function(e){return e.trainable})):[]},set:function(e){this._trainableWeights=e}},{key:"nonTrainableWeights",get:function(){return this.trainable?this._trainableWeights.filter((function(e){return!e.trainable})).concat(this._nonTrainableWeights):this._trainableWeights.concat(this._nonTrainableWeights)},set:function(e){this._nonTrainableWeights=e}},{key:"weights",get:function(){return this.trainableWeights.concat(this.nonTrainableWeights)}},{key:"stateful",get:function(){return this._stateful}},{key:"outputShape",get:function(){if(null==this.inboundNodes||0===this.inboundNodes.length)throw new y("The layer ".concat(this.name," has never been called and thus has no ")+"defined output shape.");var e,t=[],n=Object(d.a)(this.inboundNodes);try{for(n.s();!(e=n.n()).done;){var r=e.value,a=JSON.stringify(r.outputShapes);-1===t.indexOf(a)&&t.push(a)}}catch(o){n.e(o)}finally{n.f()}if(1===t.length){var i=this.inboundNodes[0].outputShapes;return Array.isArray(i)&&Array.isArray(i[0])&&1===i.length?i[0]:i}throw new y("The layer ".concat(this.name," has multiple inbound nodes with different ")+'output shapes. Hence the notion of "output shape" is ill-defined for the layer.')}}],[{key:"nodeKey",value:function(e,t){return e.name+"_ib-"+t.toString()}}]),n}(a.serialization.Serializable);var wt=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;if(Object(i.a)(this,n),r=t.call(this,{dtype:e.dtype,name:null!=e.name?e.name:ot("input").toString()}),null==e.batchSize&&(e.batchSize=null),null==e.sparse&&(e.sparse=!1),r.trainable=!1,r.built=!0,r.sparse=e.sparse,null!=e.inputShape&&null!=e.batchInputShape)throw new w("Only provide the inputShape OR batchInputShape argument to inputLayer, not both at the same time.");var a=e.batchInputShape;if(null==a){if(null==e.inputShape)throw new w("An InputLayer should be passed either a `batchInputShape` or an `inputShape`.");a=[e.batchSize].concat(e.inputShape)}else if(null!=e.batchSize)throw new w("Cannot specify batchSize if batchInputShape is specified when creating an InputLayer.");var o=e.dtype||"float32";r.batchInputShape=a,r.dtype=o,r.inputSpec=[{shape:a}];var s=new vt(r.dtype,r.batchInputShape,Object(f.a)(r),[],{},r.name);return s.nodeIndex=0,s.tensorIndex=0,new bt({outboundLayer:Object(f.a)(r),inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:[s],outputTensors:[s],inputMasks:[null],outputMasks:[null],inputShapes:[a],outputShapes:[a]}),r}return Object(o.a)(n,[{key:"apply",value:function(e,t){throw new w("Cannot pass any input to an "+"InputLayer's apply() method. InputLayer name: ".concat(this.name))}},{key:"dispose",value:function(){return{refCountAfterDispose:this._refCount,numDisposedVariables:0}}},{key:"getConfig",value:function(){return{batchInputShape:this.batchInputShape,dtype:this.dtype,sparse:this.sparse,name:this.name}}}]),n}(xt);function Ot(e){if(null==e.batchShape&&null==e.shape)throw new Error("Please provide to Input either a `shape` or a `batchShape` argument. Note that `shape` does not include the batch dimension.");if(null!=e.batchShape&&null!=e.shape)throw new w("Please provide either a `shape` or `batchShape` argument to Input, but not both.");var t=e.batchShape;null!=e.shape&&null==t&&(t=[null].concat(e.shape));var n=e.dtype;return null==n&&(n="float32"),new wt({batchInputShape:t,name:e.name,dtype:n,sparse:e.sparse}).inboundNodes[0].outputTensors[0]}wt.className="InputLayer",a.serialization.registerClass(wt);var kt,St=n(3),_t=n.n(St),jt=n(13);function Et(e){return Tt.apply(this,arguments)}function Tt(){return(Tt=Object(jt.a)(_t.a.mark((function e(t){var n,r,i,o,s,u,c,l;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}return e.abrupt("return");case 2:for(o in n=[],r=[],i=[],t)"number"!==typeof(s=t[o])&&(u=s,n.push(u.data()),r.push(o),i.push(u));if(!(n.length>0)){e.next=12;break}return e.next=9,Promise.all(n);case 9:for(c=e.sent,l=0;l<c.length;++l)t[r[l]]=c[l][0];Object(a.dispose)(i);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ct(e){if(null!=e)for(var t in e){var n=e[t];"number"!==typeof n&&n.dispose()}}!function(e){e[e.SILENT=0]="SILENT",e[e.VERBOSE=1]="VERBOSE"}(kt||(kt={}));var Mt=function(){function e(){Object(i.a)(this,e),this.validationData=null}return Object(o.a)(e,[{key:"setParams",value:function(e){this.params=e}},{key:"onEpochBegin",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onEpochEnd",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onBatchBegin",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onBatchEnd",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onTrainBegin",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"onTrainEnd",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"setModel",value:function(e){}}]),e}(),At=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;Object(i.a)(this,e),null==t&&(t=[]),this.callbacks=t,this.queueLength=n}return Object(o.a)(e,[{key:"append",value:function(e){this.callbacks.push(e)}},{key:"setParams",value:function(e){var t,n=Object(d.a)(this.callbacks);try{for(n.s();!(t=n.n()).done;){t.value.setParams(e)}}catch(r){n.e(r)}finally{n.f()}}},{key:"setModel",value:function(e){var t,n=Object(d.a)(this.callbacks);try{for(n.s();!(t=n.n()).done;){t.value.setModel(e)}}catch(r){n.e(r)}finally{n.f()}}},{key:"onEpochBegin",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){var r,a,i;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null==n&&(n={}),r=Object(d.a)(this.callbacks),e.prev=2,r.s();case 4:if((a=r.n()).done){e.next=10;break}return i=a.value,e.next=8,i.onEpochBegin(t,n);case 8:e.next=4;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(2),r.e(e.t0);case 15:return e.prev=15,r.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[2,12,15,18]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onEpochEnd",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){var r,a,i;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null==n&&(n={}),r=Object(d.a)(this.callbacks),e.prev=2,r.s();case 4:if((a=r.n()).done){e.next=10;break}
2return i=a.value,e.next=8,i.onEpochEnd(t,n);case 8:e.next=4;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(2),r.e(e.t0);case 15:return e.prev=15,r.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[2,12,15,18]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onBatchBegin",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){var r,a,i;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null==n&&(n={}),r=Object(d.a)(this.callbacks),e.prev=2,r.s();case 4:if((a=r.n()).done){e.next=10;break}return i=a.value,e.next=8,i.onBatchBegin(t,n);case 8:e.next=4;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(2),r.e(e.t0);case 15:return e.prev=15,r.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[2,12,15,18]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onBatchEnd",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){var r,a,i;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null==n&&(n={}),r=Object(d.a)(this.callbacks),e.prev=2,r.s();case 4:if((a=r.n()).done){e.next=10;break}return i=a.value,e.next=8,i.onBatchEnd(t,n);case 8:e.next=4;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(2),r.e(e.t0);case 15:return e.prev=15,r.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[2,12,15,18]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onTrainBegin",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t){var n,r,a;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null==t&&(t={}),n=Object(d.a)(this.callbacks),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=10;break}return a=r.value,e.next=8,a.onTrainBegin(t);case 8:e.next=4;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(2),n.e(e.t0);case 15:return e.prev=15,n.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[2,12,15,18]])})));return function(t){return e.apply(this,arguments)}}()},{key:"onTrainEnd",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t){var n,r,a;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null==t&&(t={}),n=Object(d.a)(this.callbacks),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=10;break}return a=r.value,e.next=8,a.onTrainEnd(t);case 8:e.next=4;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(2),n.e(e.t0);case 15:return e.prev=15,n.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[2,12,15,18]])})));return function(t){return e.apply(this,arguments)}}()}]),e}(),Nt=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.call(this)}return Object(o.a)(n,[{key:"onEpochBegin",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.seen=0,this.totals={};case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onBatchEnd",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){var r,i,o,s=this;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(o in null==n&&(n={}),r=null==n.size?0:n.size,this.seen+=r,i=function(e){var t=n[e];if("number"===typeof t)s.totals.hasOwnProperty(e)||(s.totals[e]=0),s.totals[e]=s.totals[e]+t*r;else{var i;e in s.totals?i=s.totals[e]:s.totals[e]=0;var o=Object(a.tidy)((function(){return Object(a.add)(s.totals[e],Object(a.mul)(t,r))}));s.totals[e]=o,null!=i&&i.dispose()}},n)i(o);case 5:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onEpochEnd",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){var r,i,o,s=this;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==n){e.next=19;break}r=Object(d.a)(this.params.metrics),e.prev=2,o=function(){var e=i.value;if(null==s.totals[e])return"continue";"number"===typeof s.totals[e]?n[e]=s.totals[e]/s.seen:Object(a.tidy)((function(){var t=Object(a.mul)(Object(a.div)(1,s.seen),s.totals[e]);n[e]=t,s.totals[e].dispose(),Object(a.keep)(n[e])}))},r.s();case 5:if((i=r.n()).done){e.next=11;break}if("continue"!==o()){e.next=9;break}return e.abrupt("continue",9);case 9:e.next=5;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(2),r.e(e.t0);case 16:return e.prev=16,r.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,this,[[2,13,16,19]])})));return function(t,n){return e.apply(this,arguments)}}()}]),n}(Mt),Rt=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"onTrainBegin",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.epoch=[],this.history={};case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onEpochEnd",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){var r;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r in null==n&&(n={}),this.epoch.push(t),n)null==this.history[r]&&(this.history[r]=[]),this.history[r].push(n[r]);case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"syncData",value:function(){var e=Object(jt.a)(_t.a.mark((function e(){var t,n,r,a,i,o,s,u,c;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(a in t=[],n=[],r=[],this.history)for(i=this.history[a],o=0;o<i.length;++o)"number"!==typeof i[o]&&(s=i[o],t.push(s.data()),n.push(a),r.push(o));return e.next=6,Promise.all(t);case 6:for(u=e.sent,c=0;c<u.length;++c)this.history[n[c]][r[c]].dispose(),this.history[n[c]][r[c]]=u[c][0];case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(Mt),It=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e,r){var o;if(Object(i.a)(this,n),(o=t.call(this)).currentEpoch=0,o.yieldEvery=r||"auto","auto"===o.yieldEvery&&(o.yieldEvery=125),"never"===o.yieldEvery&&null!=e.onYield)throw new Error("yieldEvery is `never` but you provided an `onYield` callback. Either change `yieldEvery` or remove the callback");return a.util.isNumber(o.yieldEvery)&&(o.maybeWait=function(e,t){var n,r=a.util.now();return function(){var i=a.util.now();return i-r<t?n:(r=i,n=e.apply(void 0,arguments))}}(o.maybeWait.bind(Object(f.a)(o)),o.yieldEvery)),o.trainBegin=e.onTrainBegin,o.trainEnd=e.onTrainEnd,o.epochBegin=e.onEpochBegin,o.epochEnd=e.onEpochEnd,o.batchBegin=e.onBatchBegin,o.batchEnd=e.onBatchEnd,o.yield=e.onYield,o}return Object(o.a)(n,[{key:"maybeWait",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n,r){var i;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=[],null==this.yield){e.next=5;break}return e.next=4,Et(r);case 4:i.push(this.yield(t,n,r));case 5:return i.push(Object(a.nextFrame)()),e.next=8,Promise.all(i);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"onEpochBegin",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.currentEpoch=t,null==this.epochBegin){e.next=6;break}return e.next=4,Et(n);case 4:return e.next=6,this.epochBegin(t,n);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onEpochEnd",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){var r;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=[],null==this.epochEnd){e.next=5;break}return e.next=4,Et(n);
2case 4:r.push(this.epochEnd(t,n));case 5:return"epoch"===this.yieldEvery&&r.push(Object(a.nextFrame)()),e.next=8,Promise.all(r);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onBatchBegin",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==this.batchBegin){e.next=5;break}return e.next=3,Et(n);case 3:return e.next=5,this.batchBegin(t,n);case 5:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onBatchEnd",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){var r;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=[],null==this.batchEnd){e.next=5;break}return e.next=4,Et(n);case 4:r.push(this.batchEnd(t,n));case 5:return"batch"===this.yieldEvery?r.push(Object(a.nextFrame)()):a.util.isNumber(this.yieldEvery)&&r.push(this.maybeWait(this.currentEpoch,t,n)),e.next=8,Promise.all(r);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onTrainBegin",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==this.trainBegin){e.next=5;break}return e.next=3,Et(t);case 3:return e.next=5,this.trainBegin(t);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onTrainEnd",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==this.trainEnd){e.next=5;break}return e.next=3,Et(t);case 3:return e.next=5,this.trainEnd(t);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),n}(Mt);function Lt(e,t){return null==e&&(e={}),e instanceof Mt?[e]:Array.isArray(e)&&e[0]instanceof Mt?e:T(e).map((function(e){return new It(e,t)}))}var Dt=function(){function e(){Object(i.a)(this,e)}return Object(o.a)(e,null,[{key:"registerCallbackConstructor",value:function(t,n){a.util.assert(t>=0&&Number.isInteger(t),(function(){return"Verbosity level is expected to be an integer >= 0, "+"but got ".concat(t)})),e.checkForDuplicate(n),null==e.constructors[t]&&(e.constructors[t]=[]),e.constructors[t].push(n)}},{key:"checkForDuplicate",value:function(t){for(var n in e.constructors){e.constructors[+n].forEach((function(e){if(e===t)throw new w("Duplicate callback constructor.")}))}}},{key:"clear",value:function(){e.constructors={}}},{key:"createCallbacks",value:function(t){var n=[];for(var r in e.constructors){var a=+r;t>=a&&n.push.apply(n,Object(l.a)(e.constructors[a]))}return n.map((function(e){return new e}))}}]),e}();function Pt(e,t,n,r,a,i,o,s,u){var c=new Rt,h=[new Nt].concat(Object(l.a)(Dt.createCallbacks(t)));null!=e&&h.push.apply(h,Object(l.a)(e)),h.push(c);var d=new At(h);return d.setParams({epochs:n,initialEpoch:r,samples:a,steps:i,batchSize:o,verbose:t,doValidation:s,metrics:u}),{callbackList:d,history:c}}Dt.constructors={};var zt=n(23);function Ft(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return I(e,a.serialization.SerializationMap.getMap().classNameMap,t,"layer",n)}function Bt(e,t){return Object(a.tidy)((function(){"float32"!==e.dtype&&(e=e.asType("float32"));var n=a.sum(Ce(e),t,!0),r=a.fill(n.shape,c()),i=a.sqrt(a.maximum(n,r));return a.div(e,i)}))}function Ut(e,t){return Object(a.tidy)((function(){return a.mean(Ce(a.sub(t,e)),-1)}))}function Wt(e,t){return Object(a.tidy)((function(){return a.mean(a.abs(a.sub(t,e)),-1)}))}function Vt(e,t){return Object(a.tidy)((function(){var n=a.sub(e,t),r=a.clipByValue(a.abs(e),c(),Number.MAX_VALUE),i=a.abs(a.div(n,r));return a.mul(100,a.mean(i,-1))}))}function Gt(e,t){return Object(a.tidy)((function(){var n=a.clipByValue(t,c(),Number.MAX_VALUE),r=a.log(a.add(1,n)),i=a.clipByValue(e,c(),Number.MAX_VALUE),o=a.log(a.add(1,i));return a.mean(Ce(a.sub(r,o)),-1)}))}function Ht(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Object(a.tidy)((function(){if(n)t=a.softmax(t);else{var r=a.sum(t,t.shape.length-1,!0);t=a.div(t,r)}return t=a.clipByValue(t,c(),1-c()),a.neg(a.sum(a.mul(e.toFloat(),a.log(t)),t.shape.length-1))}))}function qt(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Object(a.tidy)((function(){var r=a.floor(ye(e)).toInt(),i=(t=a.clipByValue(t,c(),1-c())).shape;return Ht(a.oneHot(r,i[i.length-1]).reshape(i),t,n)}))}function Xt(e,t){return Object(a.tidy)((function(){var n;return n=a.clipByValue(t,c(),1-c()),n=a.log(a.div(n,a.sub(1,n))),a.mean(function(e,t){if(!a.util.arraysEqual(e.shape,t.shape))throw new w("logits and labels must have the same shape, but got shapes "+"".concat(JSON.stringify(e.shape)," and ").concat(JSON.stringify(t.shape)));return Object(a.tidy)((function(){var n=t.relu(),r=t.abs().neg();return n.sub(t.mul(e)).add(r.exp().log1p())}))}(e,n),-1)}))}function Yt(e,t){return Object(a.tidy)((function(){var n=a.clipByValue(e,c(),1),r=a.clipByValue(t,c(),1);
2return a.sum(a.mul(e,a.log(a.div(n,r))),-1)}))}function Kt(e,t){return Object(a.tidy)((function(){var n=Bt(e,-1),r=Bt(t,-1),i=a.mul(n,r);return a.neg(a.sum(i,-1))}))}var Zt={meanSquaredError:Ut,meanAbsoluteError:Wt,meanAbsolutePercentageError:Vt,meanSquaredLogarithmicError:Gt,squaredHinge:function(e,t){return Object(a.tidy)((function(){var n=a.maximum(0,a.sub(1,a.mul(e,t)));return a.mean(Ce(n),-1)}))},hinge:function(e,t){return Object(a.tidy)((function(){var n=a.maximum(0,a.sub(1,a.mul(e,t)));return a.mean(n,-1)}))},categoricalHinge:function(e,t){return Object(a.tidy)((function(){var n=a.sum(a.mul(e,t),-1),r=a.max(a.mul(a.sub(1,e),t),-1);return a.maximum(0,a.add(1,a.sub(r,n)))}))},logcosh:function(e,t){return Object(a.tidy)((function(){var n=Math.log(2),r=a.sub(t,e),i=a.sub(a.add(r,a.softplus(a.mul(-2,r))),n);return a.mean(i,-1)}))},categoricalCrossentropy:Ht,sparseCategoricalCrossentropy:qt,binaryCrossentropy:Xt,kullbackLeiblerDivergence:Yt,poisson:function(e,t){return Object(a.tidy)((function(){var n=a.log(a.add(c(),t));return a.mean(a.sub(t,a.mul(e,n)),-1)}))},cosineProximity:Kt};function Jt(e){if("string"===typeof e){if(e in Zt)return Zt[e];var t="Unknown loss ".concat(e);throw e.toLowerCase().includes("softmaxcrossentropy")&&(t="Unknown loss ".concat(e,". ")+'Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy'),new w(t)}return e}function Qt(e,t){return Object(a.tidy)((function(){var n=a.mul(.5,a.onesLike(t)),r=ge(a.greater(t,n),e.dtype);return a.mean(a.equal(e,r),-1)}))}function $t(e,t){return Object(a.tidy)((function(){return ge(a.equal(a.argMax(e,-1),a.argMax(t,-1)),"float32")}))}function en(e,t){return Object(a.tidy)((function(){return a.logicalAnd(e.equal(1),t.equal(1)).sum().cast("float32")}))}function tn(e,t){return Object(a.tidy)((function(){var n=en(e,t),r=function(e,t){return Object(a.tidy)((function(){return a.logicalAnd(e.equal(0),t.equal(1)).sum().cast("float32")}))}(e,t),i=n.add(r);return a.where(a.greater(i,0),n.div(i),0).cast("float32")}))}function nn(e,t){return Xt(e,t)}function rn(e,t){return e.rank===t.rank&&(e=e.squeeze([e.rank-1])),(t=t.argMax(-1)).dtype!==e.dtype&&(t=t.asType(e.dtype)),a.equal(e,t).asType("float32")}var an=Ht,on=qt,sn={binaryAccuracy:Qt,categoricalAccuracy:$t,precision:tn,categoricalCrossentropy:an,sparseCategoricalCrossentropy:on,mse:Ut,MSE:Ut,mae:Wt,MAE:Wt,mape:Vt,MAPE:Vt,cosine:Kt};function un(e){if("string"===typeof e&&e in sn)return sn[e];if("string"!==typeof e&&null!=e)return e;throw new w("Unknown metric ".concat(e))}function cn(e){if(_(null!==e,"Unknown LossOrMetricFn ".concat(e)),"string"===typeof e)return e;for(var t,n=0,r=Object.keys(Zt);n<r.length;n++){var a=r[n];if(Zt[a]===e){t=a;break}}if(void 0!==t)return t;for(var i=0,o=Object.keys(sn);i<o.length;i++){var s=o[i];if(sn[s]===e){t=s;break}}return void 0!==t?t:e.name}function ln(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e||"object"!==typeof e||Object.getPrototypeOf(e)!==Object.prototype||!hn(e))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(n){var r=JSON.stringify(e);r.length>1048576&&console.warn('User-defined metadata of model "'.concat(t,'" is too large in ')+"size (length=".concat(r.length," when serialized). It is not ")+"recommended to store such large objects in user-defined metadata. Please make sure its serialized length is <= "+"".concat(1048576,"."))}}function hn(e){if(null===e)return!0;if("object"===typeof e){if(Object.getPrototypeOf(e)===Object.prototype){for(var t=0,n=Object.keys(e);t<n.length;t++){var r=n[t];if("string"!==typeof r)return!1;if(!hn(e[r]))return!1}return!0}if(Array.isArray(e)){var a,i=Object(d.a)(e);try{for(i.s();!(a=i.n()).done;){if(!hn(a.value))return!1}}catch(s){i.e(s)}finally{i.f()}return!0}return!1}var o=typeof e;return"string"===o||"number"===o||"boolean"===o}function dn(e,t,n){var r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:console.log,i=pn(e),o=["Layer (type)","Output shape","Param #"];if(i?(t=t||65,n=n||[.45,.85,1]):(t=t||98,n=n||[.33,.55,.67,1]),n[n.length-1]<=1&&(n=n.map((function(e){return Math.floor(t*e)}))),!i)for(var s in o.push("Receives inputs"),r=[],e.nodesByDepth){var u;
vendor: 1,248 bytes, line 2
2(u=r).push.apply(u,Object(l.a)(e.nodesByDepth[s]))}a("_".repeat(t)),mn(o,n,a),a("=".repeat(t));for(var c=e.layers,h=0;h<c.length;++h)i?vn(c[h],n,a):gn(c[h],n,r,a),a((h===c.length-1?"=":"_").repeat(t));e.checkTrainableWeightsConsistency();var d=fn(e),f=ht(e.nonTrainableWeights);a("Total params: ".concat(d+f)),a("Trainable params: ".concat(d)),a("Non-trainable params: ".concat(f)),a("_".repeat(t))}function fn(e){return null!=e.collectedTrainableWeights?ht(e.collectedTrainableWeights):ht(e.trainableWeights)}function pn(e){var t=!0,n=[],r=[];for(var a in e.nodesByDepth)n.push(e.nodesByDepth[a]);for(var i=0,o=n;i<o.length;i++){var s=o[i];if(s.length>1||1===s.length&&s[0].inboundLayers.length>1){t=!1;break}r.push.apply(r,Object(l.a)(s))}if(t){var u,c=Object(d.a)(e.layers);try{for(c.s();!(u=c.n()).done;){var h,f=u.value,p=!1,m=Object(d.a)(f.inboundNodes);try{for(m.s();!(h=m.n()).done;){var v=h.value;if(-1!==r.indexOf(v)){if(p){t=!1;break}p=!0}}}catch(g){m.e(g)}finally{m.f()}if(!t)break}}catch(g){c.e(g)}finally{c.f()}}return t}function mn(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:console.log,r="",a=0;a<e.length;++a)a>0&&(r=r.slice(0,r.length-1)+" "),r=(r+=e[a]).slice(0,t[a]),r+=" ".repeat(t[a]-r.length);n(r)}
2function vn(e,t,n){var r;try{r=JSON.stringify(e.outputShape)}catch(o){r="multiple"}var a=e.name,i=e.getClassName();mn(["".concat(a," (").concat(i,")"),r,e.countParams().toString()],t,n)}function gn(e,t,n,r){var a;try{a=JSON.stringify(e.outputShape)}catch(b){a="multiple"}var i,o=[],s=Object(d.a)(e.inboundNodes);try{for(s.s();!(i=s.n()).done;){var u=i.value;if(!(null!=n&&n.length>0&&-1===n.indexOf(u)))for(var c=0;c<u.inboundLayers.length;++c){var l=u.inboundLayers[c].name,h=u.nodeIndices[c],f=u.tensorIndices[c];o.push("".concat(l,"[").concat(h,"][").concat(f,"]"))}}}catch(b){s.e(b)}finally{s.f()}var p=e.name,m=e.getClassName(),v=0===o.length?"":o[0];mn(["".concat(p," (").concat(m,")"),a,e.countParams().toString(),v],t,r);for(var g=1;g<o.length;++g)mn(["","","",o[g]],t,r)}function bn(e,t,n){return("inboundNodes"===e||"outputLayers"===e||"inputLayers"===e)&&0===t&&"string"===typeof n}function yn(e,t){if(null===e)return null;if("string"===typeof e)return M(e);if("number"===typeof e||"boolean"===typeof e)return e;if(e instanceof Array){for(var n=[],r=e.length,a=0;a<r;++a){var i=e[a];bn(t,a,i)?n.push(i):n.push(yn(i,t))}return n}for(var o={},s=0,u=Object.keys(e);s<u.length;s++){var c=u[s],l=e[c];if("name"===c&&"string"===typeof l)o[c]=l;else{var h=M(c);o[h]=yn(l,h)}}return o}function xn(e,t){if(null===e||void 0===e)return null;if("string"===typeof e)return C(e);if("number"===typeof e||"boolean"===typeof e)return e;if(e instanceof Array){for(var n=[],r=e.length,a=0;a<r;++a){var i=e[a];bn(t,a,i)?n.push(i):n.push(xn(i,t))}return n}for(var o={},s=0,u=Object.keys(e);s<u.length;s++){var c=u[s],l=e[c],h=C(c);o[h]="name"!==c&&"className"!==c||"string"!==typeof l?xn(l,c):l}return o}var wn=function(){function e(t){if(Object(i.a)(this,e),this.id2Value={},this.id2Mask={},this.name2Id={},t instanceof e)for(var n in t.id2Value)this.id2Value[n]=t.id2Value[n],n in t.id2Mask&&(this.id2Mask[n]=t.id2Mask[n]);else{if(null==t)return;var r,a=Object(d.a)(t);try{for(a.s();!(r=a.n()).done;){var o=r.value;this.add(o.key,o.value)}}catch(s){a.e(s)}finally{a.f()}}}return Object(o.a)(e,[{key:"add",value:function(e,t,n){if(null!=this.id2Value[e.id])throw new w("Duplicate key: name=".concat(e.name,", id=").concat(e.id));return this.id2Value[e.id]=function(e,t){if(null==e.dtype||e.dtype===t.dtype)return t;try{return Object(a.cast)(t,e.dtype)}catch(n){throw new w("The dtype of the feed (".concat(t.dtype,") can not be cast to the dtype ")+"of the key '".concat(e.name,"' (").concat(e.dtype,")."))}}(e,t),this.name2Id[e.name]=e.id,null!=n&&(this.id2Mask[e.id]=n),this}},{key:"addFeed",value:function(e){this.add(e.key,e.value)}},{key:"hasKey",value:function(e){return null!=this.id2Value[e.id]}},{key:"names",value:function(){return Object.keys(this.name2Id)}},{key:"getValue",value:function(e){if(e instanceof vt){if(null==this.id2Value[e.id])throw new w("Nonexistent key: ".concat(e.name));return this.id2Value[e.id]}var t=this.name2Id[e];if(null==t)throw new w("Feed dict has no SymbolicTensor name: ".concat(e));return this.id2Value[t]}},{key:"getMask",value:function(e){if(e instanceof vt){if(null==this.id2Value[e.id])throw new w("Nonexistent key: ".concat(e.name));return this.id2Mask[e.id]}var t=this.name2Id[e];if(null==t)throw new w("Feed dict has no SymbolicTensor name: ".concat(e));return this.id2Mask[t]}},{key:"disposeMasks",value:function(){null!=this.id2Mask&&Object(a.dispose)(this.id2Mask)}}]),e}(),On={},kn={};function Sn(e,t,n,r){var i,o=null!=n&&n.training,s=Array.isArray(e),u=s?e:[e],c=u.map((function(e){return e.name})),l=[],h=t.names(),f=Object(d.a)(c);try{for(f.s();!(i=f.n()).done;){var p=i.value;-1!==h.indexOf(p)?l.push(t.getValue(p)):l.push(null)}}catch(B){f.e(B)}finally{f.f()}null!=r&&(r.maxNumTensors=-1/0,r.minNumTensors=1/0);var m,v,g=c.join(",")+"|"+t.names().join(",");if(null==On[g]){var b=function(e,t){a.util.assert(null!=e&&e.length>0,(function(){return"Expected at least one fetch, got none"}));var n=[],r={};if(1===e.length){var i=jn(e[0],t);n=i.sorted,r=i.recipientMap}else{var o,s=new Set,u=Object(d.a)(e);try{for(u.s();!(o=u.n()).done;){var c,l=jn(o.value,t),h=l.sorted,f=l.recipientMap,p=Object(d.a)(h);try{for(p.s();!(c=p.n()).done;){var m=c.value;s.has(m.name)||(n.push(m),s.add(m.name))}}catch(B){p.e(B)}finally{p.f()}var v=function(e){null==r[e]&&(r[e]=new Set),f[e].forEach((function(t){return r[e].add(t)}))};for(var g in f)v(g)}}catch(B){u.e(B)}finally{u.f()}}return{sorted:n,recipientCounts:_n(r)}}(u,t);m=b.sorted,v=b.recipientCounts,On[g]=m,kn[g]=v}m=On[g],v={},o||Object.assign(v,kn[g]);for(var y=new wn(t),x=0;x<m.length;++x){if(null!=r){var w=Object(a.memory)().numTensors;w>r.maxNumTensors&&(r.maxNumTensors=w),w<r.minNumTensors&&(r.minNumTensors=w)}var O=m[x],k=O.sourceLayer;if(!(k instanceof wt)){var S,_=[],j=[],E=[],C=!1,M=Object(d.a)(O.inputs);try{for(M.s();!(S=M.n()).done;){var A=S.value,N=y.getValue(A),R=y.getMask(A);_.push(N),j.push(R),null!=R&&(C=!0),o||(v[A.name]--,0!==v[A.name]||t.hasKey(A)||-1!==c.indexOf(A.name)||N.isDisposed||!0===A.sourceLayer.stateful||E.push(N))}}catch(B){M.e(B)}finally{M.f()}C&&((n=n||{}).mask=j[0]);var I=T(k.apply(_,n)),L=null;k.supportsMasking&&(L=k.computeMask(_,j));for(var D=En(O),P=Array.isArray(D)?D:[D],z=0;z<P.length;++z){y.hasKey(P[z])||y.add(P[z],I[z],Array.isArray(L)?L[0]:L);var F=c.indexOf(P[z].name);-1!==F&&(l[F]=I[z])}o||Object(a.dispose)(E)}}return y.disposeMasks(),s?l:l[0]}function _n(e){var t={};for(var n in e)t[n]=e[n].size;return t}function jn(e,t){var n,r=new Set,a=[],i={},o=Object(d.a)(t.names());try{for(o.s();!(n=o.n()).done;){var s=n.value;r.add(s)}}catch(v){o.e(v)}finally{o.f()}var u=[],c=[];for(u.push(e);u.length>0;){var l=u[u.length-1];if(r.has(l.name))u.pop();else{var h=c[c.length-1]===u.length-1;if(0===l.inputs.length||h)u.pop(),a.push(l),r.add(l.name),h&&c.pop();else{c.push(u.length-1);var f,p=Object(d.a)(l.inputs);try{for(p.s();!(f=p.n()).done;){var m=f.value;null==i[m.name]&&(i[m.name]=new Set),i[m.name].add(l.name),r.has(m.name)||u.push(m)}}catch(v){p.e(v)}finally{p.f()}}}}return{sorted:a,recipientMap:i}}function En(e){var t;
2if(1===e.sourceLayer.inboundNodes.length)t=e.sourceLayer.output;else{for(var n=null,r=0;r<e.sourceLayer.inboundNodes.length;++r){var a,i=Object(d.a)(e.sourceLayer.inboundNodes[r].outputTensors);try{for(i.s();!(a=i.n()).done;){if(a.value.id===e.id){n=r;break}}}catch(o){i.e(o)}finally{i.f()}}t=e.sourceLayer.getOutputAt(n)}return t}function Tn(e,t,n){var r=t.length;if(null==e||Array.isArray(e)&&0===e.length)return t.map((function(e){return null}));if(1===r)return Array.isArray(e)&&1===e.length?e:"object"===typeof e&&t[0]in e?[e[t[0]]]:[e];if(Array.isArray(e)){if(e.length!==r)throw new Error("Provided ".concat(n," is an array of ").concat(e.length," ")+"element(s), but the model has ".concat(r," outputs. ")+"Make sure a set of weights is provided for each model output.");return e}if("object"===typeof e&&Object.keys(e).length>0&&"object"===typeof e[Object.keys(e)[0]]){var a=[];return t.forEach((function(t){t in e?a.push(e[t]):a.push(null)})),a}throw new Error("The model has multiple (".concat(r,") outputs, ")+"so ".concat(n," must be either an array with ")+"".concat(r," elements or an object with ").concat(t," keys. ")+"Provided ".concat(n," not understood: ").concat(JSON.stringify(e)))}function Cn(e,t){return Tn(e,t,"classWeight")}function Mn(e,t,n,r){return An.apply(this,arguments)}function An(){return(An=Object(jt.a)(_t.a.mark((function e(t,n,r,i){var o,s,u;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==n&&null==i){e.next=2;break}throw new Error("Support sampleWeight is not implemented yet");case 2:if(null==r){e.next=15;break}return o=Object(a.tidy)((function(){if(1===t.shape.length)return t.clone();if(2===t.shape.length){if(t.shape[1]>1){return t.argMax(1)}if(1===t.shape[1])return t.reshape([t.shape[0]]);throw new Error("Encountered unexpected last-dimension size (".concat(t.shape[1],") ")+"during handling of class weights. The size is expected to be >= 1.")}throw new Error("Unexpected rank of target (y) tensor (".concat(t.rank,") during ")+"handling of class weights. The rank is expected to be 1 or 2.")})),e.t0=Array,e.next=7,o.data();case 7:return e.t1=e.sent,s=e.t0.from.call(e.t0,e.t1),Object(a.dispose)(o),u=[],s.forEach((function(e){if(null==r[e])throw new Error("classWeight must contain all classes in the training data. "+"The class ".concat(e," exists in the data but not in ")+"classWeight");u.push(r[e])})),e.abrupt("return",Object(a.tensor1d)(u,"float32"));case 15:return e.abrupt("return",null);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nn(e,t){return Object(a.mul)(e,t)}function Rn(e,t){var n,r,i=t;n=i.xs,r=i.ys,a.util.assert(null!=n&&null!=r,(function(){return"A Dataset iterator for fitDataset() is expected to generate objects of the form `{xs: xVal, ys: yVal}`, where the two values may be `tf.Tensor`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates "+"".concat(t)}));var o=In("input",e.inputNames,n),s=In("output",e.outputNames,r),u=o[0].shape[0];a.util.assert(o.length===e.inputs.length,(function(){return"LayersModel has ".concat(e.inputs.length," inputs, but the dataset ")+"provides ".concat(o.length," inputs. (Expected input keys: ")+"".concat(JSON.stringify(e.inputNames),")")})),a.util.assert(s.length===e.outputs.length,(function(){return"LayersModel has ".concat(e.outputs.length," outputs, but the dataset ")+"provides ".concat(s.length," outputs. (Expected output keys: ")+"".concat(JSON.stringify(e.outputNames),")")}));for(var c=function(t){a.util.assert(o[t].shape[0]===u,(function(){return"Batch size mismatch: input "+"".concat(e.inputNames[t]," has ").concat(o[t].shape[0],"; ")+"expected ".concat(u," based on input ").concat(e.inputNames[0],".")}))},l=0;l<o.length;l++)c(l);for(var h=function(t){a.util.assert(s[t].shape[0]===u,(function(){return"Batch size mismatch: output "+"".concat(e.outputNames[t]," has ").concat(s[t].shape[0],"; ")+"expected ".concat(u," based on input ").concat(e.inputNames[0],".")}))},d=0;d<s.length;d++)h(d);return{xs:o,ys:s}}function In(e,t,n){if(n instanceof a.Tensor)return[n];if(Array.isArray(n))return a.util.assert(n.length===t.length,(function(){return"Received an array of ".concat(n.length," Tensors, but expected ").concat(t.length," to match the ").concat(e," keys ").concat(t,".")})),n;var r,i=[],o=Object(d.a)(t);try{for(o.s();!(r=o.n()).done;){var s=r.value;if(null==n[s])throw new w("The feature data generated by the dataset lacks the required "+"".concat(e," key '").concat(s,"'."));i.push(n[s])}}catch(u){o.e(u)}finally{o.f()}return i}function Ln(e){if(3===e.length)throw new O("Validation with sample weights is not implemented yet.");return{xs:e[0],ys:e[1]}}function Dn(e,t,n){return Pn.apply(this,arguments)}function Pn(){return(Pn=Object(jt.a)(_t.a.mark((function e(t,n,r){var i,o,s,u,c,l,h,d,f,p,m,v,g,b,y,x,w,O,k,S,_,j,E,C,M,A,N,R,I,L,D,P,z;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=null!=r.batchesPerEpoch,a.util.assert(null!=t.optimizer,(function(){return"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig)."})),a.util.assert(null!=r,(function(){return"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call."})),a.util.assert(null!=r.epochs&&r.epochs>0&&Number.isInteger(r.epochs),(function(){return"For fitDataset(), config.epochs is expected to be a positive "+"integer, but got ".concat(r.epochs)})),a.util.assert(!i||r.batchesPerEpoch>0&&Number.isInteger(r.batchesPerEpoch),(function(){return"For fitDataset(), config.batchesPerEpoch is expected to be a "+"positive integer if specified, but got ".concat(r.batchesPerEpoch)})),a.util.assert(null==r.validationSplit,(function(){return"`val
2idationSplit` is not supported by `fitDataset()`. Use validationData instead."})),!t.isTraining){e.next=8;break}throw new Error("Cannot start training because another fit() call is ongoing.");case 8:return t.isTraining=!0,e.prev=9,(o=null!=r.validationData)&&(Fn(r.validationData)?a.util.assert(null==r.validationBatches||r.validationBatches>0&&Number.isInteger(r.validationBatches),(function(){return"For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, "+"but got ".concat(r.validationBatches)})):(c=Ln(r.validationData),s=c.xs,u=c.ys)),l=t.makeTrainFunction(),h=t.getDedupedMetricsNames(),d=o?h.slice().concat(h.map((function(e){return"val_"+e}))):h.slice(),f=Lt(r.callbacks,r.yieldEvery),p=null==r.verbose?1:r.verbose,m=Pt(f,p,r.epochs,null,null,zn(n,r),null,o,d),v=m.callbackList,g=m.history,v.setModel(t),t.history=g,e.next=22,v.onTrainBegin();case 22:return t.stopTraining_=!1,b=null==r.initialEpoch?0:r.initialEpoch,e.next=26,n.iterator();case 26:y=e.sent;case 27:if(!(b<r.epochs)){e.next=98;break}return x={},e.next=31,v.onEpochBegin(b);case 31:if(w=0,O=0,i){e.next=37;break}return e.next=36,n.iterator();case 36:y=e.sent;case 37:if(i&&!(w<r.batchesPerEpoch)){e.next=91;break}return e.next=40,y.next();case 40:if(k=e.sent,!i||!k.done){e.next=44;break}return console.warn("You provided `batchesPerEpoch` as "+"".concat(r.batchesPerEpoch,", ")+"but your dataset iterator ran out of data after "+"".concat(w," batches; ")+"interrupting training. Make sure that your dataset can generate at least `batchesPerEpoch * epochs` batches (in this case, "+"".concat(r.batchesPerEpoch*r.epochs," batches). ")+"You may need to use the repeat() function when building your dataset."),e.abrupt("break",91);case 44:if(null==k.value){e.next=73;break}return S=Rn(t,k.value),_=S.xs,j=S.ys,(E={}).batch=O,E.size=_[0].shape[0],e.next=51,v.onBatchBegin(O,E);case 51:if(C=[],null==r.classWeight){e.next=64;break}M=Cn(r.classWeight,t.outputNames),A=0;case 55:if(!(A<M.length)){e.next=64;break}return e.t0=C,e.next=59,Mn(j[A],null,M[A]);case 59:e.t1=e.sent,e.t0.push.call(e.t0,e.t1);case 61:++A,e.next=55;break;case 64:for(N=_.concat(j).concat(C),R=l(N),a.dispose(N),I=0;I<h.length;++I)L=h[I],D=R[I],E[L]=D,a.keep(D);return e.next=70,v.onBatchEnd(O,E);case 70:Ct(E),O++,w++;case 73:if(!(i?w>=r.batchesPerEpoch:k.done)){e.next=87;break}if(!o){e.next=86;break}if(P=void 0,!Fn(r.validationData)){e.next=84;break}return e.t2=T,e.next=80,t.evaluateDataset(r.validationData,{batches:r.validationBatches});case 80:e.t3=e.sent,P=(0,e.t2)(e.t3),e.next=85;break;case 84:P=T(t.evaluate(s,u,{batchSize:null==r.validationBatchSize?32:r.validationBatchSize,verbose:0}));case 85:for(z=0;z<t.metricsNames.length;++z)x["val_".concat(t.metricsNames[z])]=P[z];case 86:return e.abrupt("break",91);case 87:if(!t.stopTraining_){e.next=89;break}return e.abrupt("break",91);case 89:e.next=37;break;case 91:return e.next=93,v.onEpochEnd(b,x);case 93:if(b++,!t.stopTraining_){e.next=96;break}return e.abrupt("break",98);case 96:e.next=27;break;case 98:return e.next=100,v.onTrainEnd();case 100:return e.next=102,t.history.syncData();case 102:return e.abrupt("return",t.history);case 103:return e.prev=103,t.isTraining=!1,e.finish(103);case 106:case"end":return e.stop()}}),e,null,[[9,,103,106]])})))).apply(this,arguments)}function zn(e,t){var n=null;return null!=t.batchesPerEpoch?n=t.batchesPerEpoch:Number.isFinite(e.size)&&(n=e.size),n}function Fn(e){return"function"===typeof e.iterator}function Bn(e){return"function"===typeof e.next}function Un(e,t,n){return Wn.apply(this,arguments)}function Wn(){return(Wn=Object(jt.a)(_t.a.mark((function e(t,n,r){var i,o,s,u,c,l,h,d,f;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=null!=(r=r||{}).batches,o=t.testFunction,s=[],!(r.verbose>0)){e.next=6;break}throw new O("Verbose mode is not implemented yet.");case 6:if(a.util.assert(!i||r.batches>0&&Number.isInteger(r.batches),(function(){return"Test loop expects `batches` to be a positive integer, but "+"received ".concat(JSON.stringify(r.batches))})),!Bn(n)){e.next=11;break}e.t0=n,e.next=14;break;case 11:return e.next=13,n.iterator();case 13:e.t0=e.sent;case 14:u=e.t0,c=0,l=0,h=_t.a.mark((function e(){var n;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.next();case 2:if(n=e.sent,s=a.tidy((function(){return n.value&&function(){var e=Rn(t,n.value),r=e.xs,i=e.ys,u=r.concat(i),h=a.tidy((function(){return o(u)}));if(a.dispose(u),0===l)for(var d=0;d<h.length;++d)s.push(Object(a.scalar)(0));for(var f=u[0].shape[0],p=function(e){var t=h[e],n=s[e];s[e]=a.tidy((function(){return a.add(s[e],a.mul(f,t))})),l>0&&a.dispose(n)},m=0;m<h.length;++m)p(m);a.dispose(h),c+=f,++l}(),s})),!n.done){e.next=7;break}return i&&console.warn("Your dataset iterator ran out of data during evaluateDataset(). Interrupting evalution. Make sure that your dataset can generate at least `batches` "+"batches (in this case, ".concat(r.batches," batches). ")+"You may need to use the repeat() function when building your dataset."),e.abrupt("return","break");case 7:case"end":return e.stop()}}),e)}));case 18:if(i&&!(l<r.batches)){e.next=25;break}return e.delegateYield(h(),"t1",20);case 20:if("break"!==e.t1){e.next=23;break}return e.abrupt("break",25);case 23:e.next=18;break;case 25:for(d=0;d<s.length;++d)f=s[d],s[d]=a.div(s[d],c),a.dispose(f);return e.abrupt("return",E(s));case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Vn(e){a.util.assert(e>0&&Number.isInteger(e),(function(){return"batchSize is required to be a positive integer, but got ".concat(e)}))}function Gn(e,t,n){return null==e?[null]:Array.isArray(e)?e.map((function(e){return xe(e,t,n-t)})):xe(e,t,n-t)}function Hn(e,t){return a.tidy((function(){return null==e?null:Array.isArray(e)?e.map((function(e){return Hn(e,t)})):Te(e,"int32"===t.dtype?t:t.toInt())}))}function qn(e,t){for(var n=[],r=0,a=null;r<e;)(a=r+t)>=e&&(a=e),n.push([r,a]),r=a;return n}function Xn(e,t,n,r,a,i,o,s,u,c,l,h,d,f,p){return Yn.apply(this,arguments)}function Yn(){return(Yn=Object(jt.a)(_t.a.mark((function e(t,n,r,i,o,s,u,c,l,h,d,f,p,m,v){var g,b,y,x,k,S,_,j;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==o&&(o=32),null==s&&(s=1),null==d&&(d=!0),null==p&&(p=0),g=!1,null!=l&&null!=h&&(g=!0),null==v){e.next=10;break}if(g=!0,null!=m){e.next=10;break}throw new w("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");case 10:return null!=(b=t.checkNumSamples(r,o,m,"steps_per_epoch"))&&(y=ve(0,b)),null==u&&(u=1),x=Pt(c,u,s,p,b,m,o,g,f),k=x.callbackList,S=x.history,k.setModel(t),t.history=S,e.next=18,k.onTrainBegin();case 18:t.stopTraining_=!1,_=_t.a.mark((function e(s){var u;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k.onEpochBegin(s);case 2:if(u={},null==m){e.next=7;break}throw new O("stepsPerEpoch mode is not implemented yet.");case 7:return e.delegateYield(_t.a.mark((function e(){var s,c,f,p;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("batch"!==d){e.next=4;break}throw new O("batch shuffling is not implemneted yet");case 4:d&&a.util.shuffle(y);case 5:s=Object(a.tensor1d)(y),c=qn(b,o),f=_t.a.mark((function e(d){var f;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f={},e.next=3,k.onBatchBegin(d,f);case 3:return a.tidy((function(){var e=c[d][0],p=c[d][1],m=xe(s,e,p-e);f.batch=d,f.size=p-e;for(var v=Hn(r,m),b=n(v),y=0;y<i.length;++y){var x=i[y],w=b[y];f[x]=w,a.keep(w)}if(d===c.length-1&&g)for(var O=t.testLoop(l,h,o),k=0;k<i.length;++k){var S=i[k],_=O[k];a.keep(_),u["val_"+S]=_}})),e.next=6,k.onBatchEnd(d,f);case 6:if(Ct(f),!t.stopTraining_){e.next=9;break}return e.abrupt("return","break");case 9:case"end":return e.stop()}}),e)})),p=0;case 9:if(!(p<c.length)){e.next=17;break}return e.delegateYield(f(p),"t0",11);case 11:if("break"!==e.t0){e.next=14;break}return e.abrupt("break",17);case 14:++p,e.next=9;break;case 17:s.dispose();case 18:case"end":return e.stop()}}),e)}))(),"t0",8);case 8:return e.next=10,k.onEpochEnd(s,u);case 10:if(!t.stopTraining_){e.next=12;break}return e.abrupt("return","break");case 12:case"end":return e.stop()}}),e)})),j=p;case 21:if(!(j<s)){e.next=29;break}return e.delegateYield(_(j),"t0",23);case 23:if("break"!==e.t0){e.next=26;break}return e.abrupt("break",29);case 26:++j,e.next=21;break;case 29:return e.next=31,k.onTrainEnd();case 31:return e.next=33,t.history.syncData();case 33:return e.abrupt("return",t.history);case 34:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Kn(e,t,n){return Zn.apply(this,arguments)}function Zn(){return(Zn=Object(jt.a)(_t.a.mark((function e(t,n,r){var i,o,s,u,c,l,h,d,f,p,m,v,g,b,y,x,k,S,_,j,E,T,C,M,A=arguments;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=A.length>3&&void 0!==A[3]?A[3]:{},!t.isTraining){e.next=3;break}throw new Error("Cannot start training because another fit() call is ongoing.");case 3:return t.isTraining=!0,e.prev=4,Vn(f=null==i.batchSize?32:i.batchSize),p=!1,e.next=10,t.standardizeUserData(n,r,i.sampleWeight,i.classWeight,p,f);case 10:if(m=e.sent,o=m[0],s=m[1],d=m[2],v=!1,!(null!=i.validationData&&i.validationData.length>0)){e.next=36;break}if(v=!0,2!==i.validationData.length){e.next=22;break}u=i.validationData[0],c=i.validationData[1],e.next=27;break;case 22:if(3!==i.validationData.length){e.next=26;break}throw new O("validationData including sample weights is not supported yet.");case 26:throw new w("When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items;
2 "+"".concat(i.validationData," is invalid."));case 27:return b=!0,e.next=30,t.standardizeUserData(u,c,null,null,b,f);case 30:y=e.sent,l=y[0],h=y[1],g=l.concat(h),e.next=37;break;case 36:null!=i.validationSplit&&i.validationSplit>0&&i.validationSplit<1?(v=!0,x=Math.floor(o[0].shape[0]*(1-i.validationSplit)),k=o[0].shape[0],l=Gn(o,x,k),o=Gn(o,0,x),h=Gn(s,x,k),s=Gn(s,0,x),g=l.concat(h)):null!=i.validationSteps&&(v=!0);case 37:return S=o.concat(s).concat(d),t.checkTrainableWeightsConsistency(),_=t.makeTrainFunction(),j=t.getDedupedMetricsNames(),v?(t.makeTestFunction(),E=t.testFunction,T=j.slice().concat(j.map((function(e){return"val_"+e})))):(E=null,g=[],T=j.slice()),C=Lt(i.callbacks,i.yieldEvery),e.next=45,Xn(t,_,S,j,f,i.epochs,i.verbose,C,E,g,i.shuffle,T,i.initialEpoch,null,null);case 45:return M=e.sent,e.abrupt("return",M);case 47:return e.prev=47,t.isTraining=!1,Qn(o,n),Qn(s,r),Qn(l,u),Qn(h,c),null!=d&&a.dispose(d),e.finish(47);case 55:case"end":return e.stop()}}),e,null,[[4,,47,55]])})))).apply(this,arguments)}function Jn(e){var t=[];e instanceof a.Tensor&&(e=[e]);for(var n=0;n<e.length;++n){var r=e[n];if(1===r.rank)t.push(be(r,1));else{if(0===r.rank)throw new Error("Expected tensor to be at least 1D, but received a 0D tensor (scalar).");t.push(r)}}return t}function Qn(e,t){if(null!=e){var n=[];if(t instanceof a.Tensor)n.push(t.id);else if(Array.isArray(t))t.forEach((function(e){return n.push(e.id)}));else if(null!=t)for(var r in t){var i=t[r];n.push(i.id)}var o=[];if(e instanceof a.Tensor)-1===n.indexOf(e.id)&&o.push(e);else if(Array.isArray(e))e.forEach((function(e){-1===n.indexOf(e.id)&&o.push(e)}));else if(null!=e)for(var s in e){var u=e[s];-1===n.indexOf(u.id)&&o.push(u)}o.forEach((function(e){e.isDisposed||e.dispose()}))}}function $n(e){return Array.isArray(e)}function er(e){return!function(e){return e instanceof a.Tensor}(e)&&!$n(e)}function tr(e,t,n){var r,a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";if(null==t||0===t.length){if(null!=e){var o=!1;if($n(e)&&e.length>0)o=!0;else if(er(e)){for(var s in e)if(e.hasOwnProperty(s)){o=!0;break}}else o=!0;if(o)throw new w("Error when checking model ".concat(i," expected no data, ")+"but got ".concat(e))}return[]}if(null==e)return t.map((function(e){return null}));if(er(e)){e=e,r=[];var u,c=Object(d.a)(t);try{for(c.s();!(u=c.n()).done;){var l=u.value;if(null==e[l])throw new w('No data provided for "'.concat(l,'". Need data for each key in: ')+"".concat(t));r.push(e[l])}}catch(g){c.e(g)}finally{c.f()}}else if($n(e)){if((e=e).length!==t.length)throw new w("Error when checking model ".concat(i,": the Array of ")+"Tensors that you are passing to your model is not the size the "+"model expected. Expected to see ".concat(t.length," Tensor(s), but ")+"instead got the following list of Tensor(s): ".concat(e));r=e}else{if(e=e,t.length>1)throw new w("The model ".concat(i," expects ").concat(t.length," Tensor(s), ")+"but only received one Tensor. Found: Tensor with shape ".concat(e.shape));r=[e]}if(r=Jn(r),null!=n)for(var h=0;h<t.length;++h)if(null!=n[h]){var f=r[h];if(f.shape.length!==n[h].length)throw new w("Error when checking ".concat(i,": expected ").concat(t[h]," ")+"to have ".concat(n[h].length," dimension(s). but got array with ")+"shape ".concat(f.shape));for(var p=0;p<n[h].length;++p)if(0!==p||a){var m=f.shape[p],v=n[h][p];if(null!=v&&v>=0&&m!==v)throw new w("Error when checking ".concat(i,": expected ").concat(t[h]," ")+"to have shape [".concat(n[h],"], but got array with shape ")+"[".concat(f.shape,"]."))}}return r}function nr(e,t,n){var r=D(e.map((function(e){return e.shape[0]})));r.sort();var i=D(t.map((function(e){return e.shape[0]})));if(i.sort(),r.length>1)throw new w("All input Tensors (x) should have the same number of samples. Got array shapes: "+"".concat(JSON.stringify(e.map((function(e){return e.shape})))));if(i.length>1)throw new w("All target Tensors (y) should have the same number of samples. Got array shapes: "+"".concat(JSON.stringify(t.map((function(e){return e.shape})))));if(r.length>0&&i.length>0&&!a.util.arraysEqual(r,i))throw new w("Input Tensors should have the same number of samples as target "+"Tensors. Found ".concat(r[0]," input sample(s) and ").concat(i[0]," target ")+"sample(s).")}function rr(e,t,n){for(var r=[Ut,Xt,Ht],a=0;a<e.length;++a){var i=e[a],o=t[a],s=n[a];
2if(null!=o){if(o===Ht&&1===i.shape[i.shape.length-1])throw new w("You are passing a target array of shape ".concat(i.shape," while using ")+"a loss 'categorical_crossentropy'. 'categorical_crossentropy'expects targets to be binary matrices (1s and 0s) of shape [samples, classes].");if(-1!==r.indexOf(o))for(var u=i.shape.slice(1),c=s.slice(1),l=0;l<u.length;++l){var h=u[l],d=c[l];if(null!=d&&h!==d)throw new w("A target Tensor with shape ".concat(i.shape," was passed for an ")+"output of shape ".concat(s,", while using a loss function that ")+"expects targets to have the same shape as the output.")}}}}function ar(e,t,n){var r,a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";if(Array.isArray(e)){if(e.length!==t.length)throw new w("Error when checking model ".concat(i,": the Array of ")+"Tensors that you are passing to your model is not the size the "+"the model expected. Expected to see ".concat(t.length," Tensor(s),")+" but instead got ".concat(e.length," Tensors(s)."));r=e}else{if(t.length>1)throw new w("The model expects ".concat(t.length," ").concat(i," Tensors, ")+"but only received one Tensor. Found: array with shape "+"".concat(JSON.stringify(e.shape),"."));r=[e]}if(null!=n)for(var o=0;o<t.length;++o)if(null!=n[o]){var s=r[o];if(s.shape.length!==n[o].length)throw new w("Error when checking ".concat(i,": expected ").concat(t[o]," ")+"to have ".concat(n[o].length," dimension(s), but got array with ")+"shape ".concat(JSON.stringify(s.shape)));for(var u=0;u<n[o].length;++u)if(0!==u||a){var c=s.shape[u],l=n[o][u];if(null!=l&&l!==c)throw new w("Error when checking ".concat(i,": expected ")+"".concat(t[o]," to have shape ").concat(JSON.stringify(n[o])," but ")+"got array with shape ".concat(JSON.stringify(s.shape),"."))}}}var ir=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,e)).isTraining=!1,r}return Object(o.a)(n,[{key:"summary",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:console.log;if(!this.built)throw new w("This model has never been called, thus its weights have not been created yet. So no summary can be displayed. Build the model first (e.g., by calling it on some test data).");dn(this,e,t,n)}},{key:"compile",value:function(e){var t=this;if(null==e.loss&&(e.loss=[]),this.loss=e.loss,"string"===typeof e.optimizer)this.optimizer_=function(e){var t={Adagrad:function(){return a.train.adagrad(.01)},Adadelta:function(){return a.train.adadelta(1,.95,c())},Adam:function(){return a.train.adam(.001,.9,.999,c())},Adamax:function(){return a.train.adamax(.002,.9,.999,c(),0)},RMSProp:function(){return a.train.rmsprop(.001,.9,0,c())},SGD:function(){return a.train.sgd(.01)}};if(t.adagrad=t.Adagrad,t.adadelta=t.Adadelta,t.adam=t.Adam,t.adamax=t.Adamax,t.rmsprop=t.RMSProp,t.sgd=t.SGD,e in t)return t[e]();throw new w("Unknown Optimizer ".concat(e))}(e.optimizer),this.isOptimizerOwned=!0;else{if(!(e.optimizer instanceof a.Optimizer))throw new w("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer_=e.optimizer,this.isOptimizerOwned=!1}var n=[];if(Array.isArray(e.loss)||"string"===typeof e.loss||"function"===typeof e.loss)if(Array.isArray(e.loss)){if(e.loss.length!==this.outputs.length)throw new w("When passing an Array as loss, it should have one entry per "+"model output. The model has ".concat(this.outputs.length," output(s), ")+"but you passed loss=".concat(e.loss,"."));var r=e.loss;n=r.map((function(e){return Jt(e)}))}else{var i=Jt(e.loss);this.outputs.forEach((function(e){n.push(i)}))}else{for(var o in e.loss=e.loss,e.loss)if(-1===this.outputNames.indexOf(o))throw new w('Unknown entry in loss dictionary: "'.concat(o,'". ')+"Only expected the following keys: ".concat(this.outputNames));var s,u=Object(d.a)(this.outputNames);try{for(u.s();!(s=u.n()).done;){var l=s.value;null==e.loss[l]&&console.warn('Output "'.concat(l,'" is missing from loss dictionary. We assume ')+"this was done on purpose, and we will not be expecting data "+"to be passed to ".concat(l," during training")),n.push(Jt(e.loss[l]))}}catch(b){u.e(b)}finally{u.f()}}this.lossFunctions=n,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(var h=0;h<this.outputs.length;++h){var f=this.internalOutputShapes[h],p=this.outputNames[h];this.feedOutputNames.push(p),this.feedOutputShapes.push(f),this.feedLossFns.push(this.lossFunctions[h])}var m=[];this.metrics=e.metrics,this.metricsNames=["loss"],this.metricsTensors=[],se("loss",(function(){for(var e=0;e<t.outputs.length;++e)if(-1===m.indexOf(e)){var n=t.lossFunctions[e];t.outputs.length>
21&&(t.metricsTensors.push([n,e]),t.metricsNames.push(t.outputNames[e]+"_loss"))}}));var v=function(e,t){if(null==e||Array.isArray(e)&&0===e.length)return t.map((function(e){return[]}));var n;if("string"===typeof e||"function"===typeof e)n=[e];else{if(!Array.isArray(e)&&"object"!==typeof e)throw new TypeError("Type of metrics argument not understood. Expected an string,"+"function, Array, or Object, found: ".concat(e));n=e}if(Array.isArray(n))return t.map((function(e){return n}));var r,a=[],i=Object(d.a)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value,s=n.hasOwnProperty(o)?n[o]:[];Array.isArray(s)||(s=[s]),a.push(s)}}catch(b){i.e(b)}finally{i.f()}return a}(e.metrics,this.outputNames),g=function(e,n,r){t.outputNames.length>1&&(n=t.outputNames[e]+"_"+n),t.metricsNames.push(n),t.metricsTensors.push([r,e])};se("metric",(function(){for(var e=function(e){if(-1!==m.indexOf(e))return"continue";!function(n){var r,a,i,o,s=Object(d.a)(n);try{for(s.s();!(o=s.n()).done;){var u=o.value;if("string"===typeof u&&-1!==["accuracy","acc","crossentropy","ce"].indexOf(u)){var c=t.internalOutputShapes[e];1===c[c.length-1]||t.lossFunctions[e]===Xt?-1!==["accuracy","acc"].indexOf(u)?a=Qt:-1!==["crossentropy","ce"].indexOf(u)&&(a=nn):t.lossFunctions[e]===qt?-1!==["accuracy","acc"].indexOf(u)?a=rn:-1!==["crossentropy","ce"].indexOf(u)&&(a=on):-1!==["accuracy","acc"].indexOf(u)?a=$t:-1!==["crossentropy","ce"].indexOf(u)&&(a=an);var l=void 0;-1!==["accuracy","acc"].indexOf(u)?l="acc":-1!==["crossentropy","ce"].indexOf(u)&&(l="ce"),i=a,r=""+l}else{var h=un(u);i=h,r=""+cn(u)}var f=void 0;se(r,(function(){f=i})),g(e,r,f)}}catch(b){s.e(b)}finally{s.f()}}(v[e])},n=0;n<t.outputs.length;++n)e(n)})),this.collectedTrainableWeights=this.trainableWeights}},{key:"checkTrainableWeightsConsistency",value:function(){null!=this.collectedTrainableWeights&&this.trainableWeights.length!==this.collectedTrainableWeights.length&&console.warn("Discrepancy between trainableweights and collected trainable weights. Did you set `model.trainable` without calling `model.compile()` afterwards?")}},{key:"evaluate",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null==n.batchSize?32:n.batchSize;Vn(r);var a=!0,i=this.standardizeUserDataXY(e,t,a,r);try{var o=i[0].concat(i[1]);this.makeTestFunction();var s=this.testFunction,u=this.testLoop(s,o,r,n.verbose,n.steps);return E(u)}finally{Qn(i[0],e),Qn(i[1],t)}}},{key:"evaluateDataset",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.makeTestFunction(),e.abrupt("return",Un(this,t,n));case 2:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"checkNumSamples",value:function(e,t,n){var r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"steps";if(null!=n){if(r=null,null!=t)throw new w("If ".concat(a," is set, batchSize must be null or undefined.")+"Got batchSize = ".concat(t))}else{if(null==e)throw new w("Either the input data should have a defined shape, or "+"".concat(a," shoud be specified."));r=Array.isArray(e)?e[0].shape[0]:e.shape[0]}return r}},{key:"execute",value:function(e,t){if(Array.isArray(t)&&0===t.length)throw new w("`outputs` is an empty Array, which is not allowed.");var n=Array.isArray(t),r=n?t:[t],i=this.retrieveSymbolicTensors(r),o=new wn;if(e instanceof a.Tensor&&(e=[e]),Array.isArray(e)){if(e.length!==this.inputs.length)throw new w("The number of inputs provided (".concat(e.length,") ")+"does not match the number of inputs of this model "+"(".concat(this.inputs.length,")."));for(var s=0;s<this.inputs.length;++s)o.add(this.inputs[s],e[s])}else{var u,c=Object(d.a)(this.inputs);try{for(c.s();!(u=c.n()).done;){var l=u.value,h=e[l.name];if(null==h)throw new w("No value is provided for the model's input ".concat(l.name));o.add(l,h)}}catch(p){c.e(p)}finally{c.f()}}var f=Sn(i,o);return n?f:f[0]}},{key:"retrieveSymbolicTensors",value:function(e){var t,n=S(null,e.length),r=e.length,a=Object(d.a)(this.layers);try{for(a.s();!(t=a.n()).done;){for(var i=t.value,o=Array.isArray(i.output)?i.output:[i.output],s=o.map((function(e){return e.name})),u=0;u<e.length;++u){var c=s.indexOf(e[u]);if(-1!==c&&(n[u]=o[c],r--),0===r)break}if(0===r)break}}catch(h){a.e(h)}finally{a.f()}if(r>0){var l=[];
vendor: 4,104 bytes, line 2
2throw n.forEach((function(t,n){null==t&&l.push(e[n])})),new w("Cannot find SymbolicTensors for output name(s): "+"".concat(JSON.stringify(l)))}return n}},{key:"predictLoop",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return a.tidy((function(){var i=t.checkNumSamples(e);if(r)throw new O("Verbose predictLoop() is not implemented yet.");for(var o=qn(i,n),s=t.outputs.map((function(e){return[]})),u=function(n){a.tidy((function(){var r=o[n][0],a=o[n][1],i=Gn(e,r,a),s=[];if(Array.isArray(i))for(var u=0;u<i.length;++u)s.push({key:t.inputs[u],value:i[u]});else s.push({key:t.inputs[0],value:i});var c=new wn(s);return Sn(t.outputs,c)})).forEach((function(e,t){return s[t].push(e)}))},c=0;c<o.length;++c)u(c);return E(s.map((function(e){return a.concat(e,0)})))}))}},{key:"predict",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Jn(e);ar(n,this.inputNames,this.feedInputShapes,!1);try{var r=null==t.batchSize?32:t.batchSize;return Vn(r),this.predictLoop(n,r)}finally{Qn(n,e)}}},{key:"predictOnBatch",value:function(e){ar(e,this.inputNames,this.feedInputShapes,!0);var t=(Array.isArray(e)?e[0]:e).shape[0];return this.predictLoop(e,t)}},{key:"standardizeUserDataXY",value:function(e,t){var n=arguments.length>3?arguments[3]:void 0;if(null==this.optimizer_)throw new x("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");for(var r=[],a=0;a<this.feedOutputShapes.length;++a){var i=this.feedOutputShapes[a],o=this.feedLossFns[a];o===qt?r.push(i.slice(0,i.length-1).concat([1])):r.push(i)}if(nr(e=tr(e,this.feedInputNames,this.feedInputShapes,!1,"input"),t=tr(t,this.feedOutputNames,r,!1,"target")),rr(t,this.feedLossFns,this.feedOutputShapes),this.stateful&&null!=n&&n>0&&e[0].shape[0]%n!==0)throw new w("In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size "+"".concat(n,". Found: ").concat(e[0].shape[0]," sample(s)."));return[e,t]}},{key:"standardizeUserData",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n,r,a){var i,o,s,u,c,l,d,f,p,m=arguments;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=!(m.length>4&&void 0!==m[4])||m[4],o=m.length>5?m[5]:void 0,s=this.standardizeUserDataXY(t,n,i,o),u=Object(h.a)(s,2),c=u[0],l=u[1],null==r){e.next=5;break}throw new Error("sample weight is not supported yet.");case 5:if(d=null,null==a){e.next=19;break}f=Cn(a,this.outputNames),d=[],p=0;case 10:if(!(p<f.length)){e.next=19;break}return e.t0=d,e.next=14,Mn(l[p],null,f[p]);case 14:e.t1=e.sent,e.t0.push.call(e.t0,e.t1);case 16:++p,e.next=10;break;case 19:return e.abrupt("return",[c,l,d]);case 20:case"end":return e.stop()}}),e,this)})));return function(t,n,r,a){return e.apply(this,arguments)}}()},{key:"testLoop",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4?arguments[4]:void 0;return a.tidy((function(){var s=r.checkNumSamples(t,n,o,"steps"),u=[];if(i>0)throw new O("Verbose mode is not implemented yet.");if(null!=o)throw new O("steps mode in testLoop() is not implemented yet");for(var c=qn(s,n),l=Object(a.tensor1d)(ve(0,s)),h=0;h<c.length;++h){var d=c[h][0],f=c[h][1],p=xe(l,d,f-d),m=Hn(t,p),v=e(m);if(0===h)for(var g=0;g<v.length;++g)u.push(Object(a.scalar)(0));for(var b=0;b<v.length;++b){var y=v[b];u[b]=a.add(u[b],a.mul(f-d,y))}}for(var x=0;x<u.length;++x)u[x]=a.div(u[x],s);return u}))}},{key:"getDedupedMetricsNames",value:function(){for(var e=this.metricsNames,t=[],n=0;n<e.length;++n){var r=e[n],a=r;if(j(e,r)>1){var i=j(e.slice(0,n),r);a+="_".concat(i)}t.push(a)}return t}},{key:"makeTrainFunction",value:function(){var e=this;return function(t){var n=[],r=t.slice(0,e.inputs.length),i=t.slice(e.inputs.length,e.inputs.length+e.outputs.length),o=t.slice(e.inputs.length+e.outputs.length,e.inputs.length+2*e.outputs.length),s=[],u=e.collectedTrainableWeights.map((function(e){return e.read()}));return[e.optimizer_.minimize((function(){for(var t=[],u=0;
2u<e.inputs.length;++u)t.push({key:e.inputs[u],value:r[u]});for(var c,l=new wn(t),h=Sn(e.outputs,l,{training:!0}),d=0;d<e.lossFunctions.length;++d){var f=(0,e.lossFunctions[d])(i[d],h[d]);null!=o[d]&&(f=Nn(f,o[d]));var p=a.mean(f);n.push(p),c=0===d?f:a.add(c,f)}for(var m=0;m<e.metricsTensors.length;++m){var v=void 0;if(e.outputs.length>1&&m<e.outputs.length)v=n[m];else{var g=e.metricsTensors[m][0],b=e.metricsTensors[m][1];v=a.mean(g(i[b],h[b]))}a.keep(v),s.push(v)}return c=a.mean(c),e.calculateLosses().forEach((function(e){c=a.add(c,e)})),c}),!0,u)].concat(s)}}},{key:"makeTestFunction",value:function(){var e=this;this.testFunction=function(t){return a.tidy((function(){for(var n,r=[],i=t.slice(0,e.inputs.length),o=t.slice(e.inputs.length,e.inputs.length+e.outputs.length),s=[],u=0;u<e.inputs.length;++u)s.push({key:e.inputs[u],value:i[u]});for(var c=new wn(s),l=Sn(e.outputs,c),h=0;h<e.lossFunctions.length;++h){var d=e.lossFunctions[h],f=a.mean(d(o[h],l[h]));n=0===h?f:a.add(n,f),r.push(n)}for(var p=0;p<e.metricsTensors.length;++p){var m=e.metricsTensors[p][0],v=e.metricsTensors[p][1],g=a.mean(m(o[v],l[v]));r.push(g)}return r}))}}},{key:"fit",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){var r,a=arguments;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",Kn(this,t,n,r));case 2:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"fitDataset",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Dn(this,t,n));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"trainOnBatch",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){var r,i,o,s,u,c,l,h,f,p;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.standardizeUserData(t,n);case 2:r=e.sent,i=r[0],o=r[1],s=this.makeTrainFunction(),u=s(i.concat(o)),c=[],l=Object(d.a)(u),e.prev=9,l.s();case 11:if((h=l.n()).done){e.next=19;break}return f=h.value,e.next=15,f.data();case 15:p=e.sent,c.push(p[0]);case 17:e.next=11;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(9),l.e(e.t0);case 24:return e.prev=24,l.f(),e.finish(24);case 27:return a.dispose(u),e.abrupt("return",E(c));case 29:case"end":return e.stop()}}),e,this,[[9,21,24,27]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getNamedWeights",value:function(e){for(var t=[],n=null!=e&&e.trainableOnly,r=n?this.trainableWeights:this.weights,a=this.getWeights(n),i=0;i<r.length;++i)n&&!r[i].trainable||t.push({name:r[i].originalName,tensor:a[i]});return t}},{key:"dispose",value:function(){var e=Object(zt.a)(Object(p.a)(n.prototype),"dispose",this).call(this);if(0===e.refCountAfterDispose&&null!=this.optimizer&&this.isOptimizerOwned){var t=a.memory().numTensors;this.optimizer_.dispose(),e.numDisposedVariables+=t-a.memory().numTensors}return e}},{key:"getLossIdentifiers",value:function(){var e;if("string"===typeof this.loss)e=C(this.loss);else if(Array.isArray(this.loss)){var t,n=Object(d.a)(this.loss);try{for(n.s();!(t=n.n()).done;){if("string"!==typeof t.value)throw new Error("Serialization of non-string loss is not supported.")}}catch(u){n.e(u)}finally{n.f()}e=this.loss.map((function(e){return C(e)}))}else{var r=Object.keys(this.loss);e={};for(var a=this.loss,i=0,o=r;i<o.length;i++){var s=o[i];if("string"!==typeof a[s])throw new Error("Serialization of non-string loss is not supported.");e[s]=C(a[s])}}return e}},{key:"getMetricIdentifiers",value:function(){if("string"===typeof this.metrics||"function"===typeof this.metrics)return[C(cn(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map((function(e){return C(cn(e))}));var e={};for(var t in this.metrics)e[t]=C(cn(this.metrics[t]));return e}},{key:"getTrainingConfig",value:function(){return{loss:this.getLossIdentifiers(),metrics:this.getMetricIdentifiers(),optimizer_config:{class_name:this.optimizer.getClassName(),config:this.optimizer.getConfig()}}}},{key:"loadTrainingConfig",value:function(e){if(null!=e.weighted_metrics)throw new Error("Loading weight_metrics is not supported yet.");if(null!=e.loss_weights)throw new Error("Loading loss_weights is not supported yet.");if(null!=e.sample_weight_mode)throw new Error("Loading sample_weight_mode is not supported yet.");var t,n,r=Ft(yn(e.optimizer_config));if("string"===typeof e.loss)t=M(e.loss);else if(Array.isArray(e.loss))t=e.loss.map((function(e){return M(e)}));else if(null!=e.loss)for(var a in t={},e.loss)t[a]=M(e.loss[a]);if(Array.isArray(e.metrics))n=e.metrics.map((function(e){return M(e)}));else if(null!=e.metrics)for(var i in n={},e.metrics)n[i]=M(e.metrics[i]);this.compile({loss:t,metrics:n,optimizer:r})}},{key:"save",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){var r,i,o,s,u,c,h,d,f;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!==typeof t){e.next=9;break}if(0!==(r=a.io.getSaveHandlers(t)).length){e.next=6;break}throw new w("Cannot find any save handlers for URL '".concat(t,"'"));case 6:if(!(r.length>1)){e.next=8;break}throw new w("Found more than one (".concat(r.length,") save handlers for ")+"URL '".concat(t,"'"));case 8:t=r[0];case 9:if(null!=t.save){e.next=11;break}throw new w("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");case 11:return e.next=13,a.io.encodeWeights(this.getNamedWeights(n));case 13:if(i=e.sent,!1,null,o=this.toJSON(null,!1),s={modelTopology:o,format:"layers-model",generatedBy:"TensorFlow.js tfjs-layers v".concat("2.4.0"),convertedBy:null},!(null!=n&&n.includeOptimizer)||null==this.optimizer){e.next=34;break}return s.trainingConfig=this.getTrainingConfig(),c="optimizer",e.t0=a.io,e.next=25,this.optimizer.getWeights();case 25:return e.t1=e.sent,e.t2=c,e.next=29,e.t0.encodeWeights.call(e.t0,e.t1,e.t2);case 29:h=e.sent,d=h.data,f=h.specs,(u=i.specs).push.apply(u,Object(l.a)(f)),i.data=a.io.concatenateArrayBuffers([i.data,d]);case 34:return null!=this.userDefinedMetadata&&(!0,ln(this.userDefinedMetadata,this.name,!0),s.userDefinedMetadata=this.userDefinedMetadata),s.weightData=i.data,s.weightSpecs=i.specs,e.abrupt("return",t.save(s));case 38:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setUserDefinedMetadata",value:function(e){ln(e,this.name),this.userDefinedMetadata=e}},{key:"getUserDefinedMetadata",value:function(){return this.userDefinedMetadata}},{key:"stopTraining",set:function(e){this.stopTraining_=e},get:function(){return this.stopTraining_}},{key:"optimizer",get:function(){return this.optimizer_},set:function(e){this.optimizer_!==e&&(this.optimizer_=e,this.isOptimizerOwned=!1)}}]),n}(function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;if(Object(i.a)(this,n),(r=t.call(this,{})).containerNodes=new Set,r.name=e.name,null==r.name){var a=r.getClassName().toLowerCase();r.name=ot(a)}if(r.supportsMasking=!1,r.trainable_=!0,Array.isArray(e.inputs)?r.input
vendor: 4,819 bytes, line 2
2s=e.inputs.slice():r.inputs=[e.inputs],Array.isArray(e.outputs)?r.outputs=e.outputs.slice():r.outputs=[e.outputs],D(r.inputs).length!==r.inputs.length)throw new w("The list of inputs passed to the model is redundant. All inputs should only appear once. Found: "+"".concat(r.inputs.map((function(e){return e.name}))));D(r.outputs).length!==r.outputs.length&&console.warn("The list of outputs passed to the model is redundant. All outputs should only appear once. Found: "+"".concat(r.outputs.map((function(e){return e.name})))),r.inputLayers=[],r.inputLayersNodeIndices=[],r.inputLayersTensorIndices=[],r.outputLayers=[],r.outputLayersNodeIndices=[],r.outputLayersTensorIndices=[],r.layers=[],r.internalContainerRefs=[];var o,s=Object(d.a)(r.outputs);try{for(s.s();!(o=s.n()).done;){var u=o.value,c=u.sourceLayer,l=u.nodeIndex,h=u.tensorIndex;r.outputLayers.push(c),r.outputLayersNodeIndices.push(l),r.outputLayersTensorIndices.push(h)}}catch(Me){s.e(Me)}finally{s.f()}var p,m=Object(d.a)(r.inputs);try{for(m.s();!(p=m.n()).done;){var v=p.value,g=v.sourceLayer,b=v.nodeIndex,y=v.tensorIndex;_(0===b,"input layer has >1 nodes"),_(0===y,"input layer has >1 tensors"),r.inputLayers.push(g),r.inputLayersNodeIndices.push(b),r.inputLayersTensorIndices.push(y)}}catch(Me){m.e(Me)}finally{m.f()}r.inputNames=[],r.outputNames=[],r.feedInputShapes=[],r.feedInputNames=[],r.feedOutputNames=[];for(var O=0;O<r.inputLayers.length;O++){var k=r.inputLayers[O];if(!(k instanceof wt))throw new TypeError("Input layers to a LayersModel must be InputLayer objects. "+"Received inputs: ".concat(e.inputs,". ")+"Input ".concat(O," (0-based) originates ")+"from layer type ".concat(k.getClassName(),"."));r.inputNames.push(k.name),r.feedInputShapes.push(k.batchInputShape),r.feedInputNames.push(k.name)}var S,j=Object(d.a)(r.outputLayers);try{for(j.s();!(S=j.n()).done;){var E=S.value;r.outputNames.push(E.name)}}catch(Me){j.e(Me)}finally{j.f()}r.internalInputShapes=r.inputs.map((function(e){return e.shape})),r.internalOutputShapes=r.outputs.map((function(e){return e.shape}));var T,C={},M={},A={},N={},R={},I=[],P=function e(t,a,i,o,s,u){null!=o&&null!=s&&null!=u||(o=t.sourceLayer,s=t.nodeIndex,u=t.tensorIndex);var c=o.inboundNodes[s];if(-1!==i.indexOf(c))throw new x("The tensor ".concat(t.name,' at layer "').concat(o.name,'" ')+"is part of a cycle.");if(-1===a.indexOf(c)){r.containerNodes.add(n.nodeKey(o,s)),o.id in R||(R[o.id]=Object.keys(R).length),-1===i.indexOf(c)&&i.push(c);for(var l=c.inboundLayers.length,h=0;h<l;h++){e(c.inputTensors[h],a,i,c.inboundLayers[h],c.nodeIndices[h],c.tensorIndices[h])}for(a.push(c);i.indexOf(c)>=0;)i.splice(i.indexOf(c),1);I.push(c)}},z=[],F=[],B=Object(d.a)(r.outputs);try{for(B.s();!(T=B.n()).done;){P(T.value,z,F)}}catch(Me){B.e(Me)}finally{B.f()}var U,W=I.slice().reverse(),V=Object(d.a)(W);try{for(V.s();!(U=V.n()).done;){var G=U.value;M[G.id]=G,G.id in C||(C[G.id]=0);var H=C[G.id],q=null==A[G.outboundLayer.id]?0:A[G.outboundLayer.id];H=Math.max(H,q),A[G.outboundLayer.id]=H,N[G.outboundLayer.id]=G.outboundLayer,C[G.id]=H;for(var X=0;X<G.inboundLayers.length;X++){var Y=G.inboundLayers[X],K=G.nodeIndices[X],Z=Y.inboundNodes[K],J=null==C[Z.id]?0:C[Z.id];C[Z.id]=Math.max(H+1,J),M[Z.id]=Z}}}catch(Me){V.e(Me)}finally{V.f()}var Q={};for(var $ in C){var ee=C[$];ee in Q||(Q[ee]=[]),Q[ee].push(M[$])}var te={};for(var ne in A){var re=A[ne];re in te||(te[re]=[]),te[re].push(N[ne])}var ae=Object.keys(te).map((function(e){return parseInt(e,10)})).sort(L);r.layers=[];var ie,oe=Object(d.a)(ae);try{for(oe.s();!(ie=oe.n()).done;){var se=te[ie.value];se.sort((function(e,t){var n=R[e.id],r=R[t.id];return n<r?-1:n>r?1:0}));var ue,ce=Object(d.a)(se);try{for(ce.s();!(ue=ce.n()).done;){var le=ue.value;le instanceof n&&r.internalContainerRefs.push(le),r.layers.push(le)}}catch(Me){ce.e(Me)}finally{ce.f()}}}catch(Me){oe.e(Me)}finally{oe.f()}r.layersByDepth=te,ae=Object.keys(Q).map((function(e){return parseInt(e,10)})).sort(L);var he,de=r.inputs.slice(),fe=[],pe=Object(d.a)(ae);try{for(pe.s();!(he=pe.n()).done;){var me,ve=he.value,ge=Object(d.a)(Q[ve]);try{for(ge.s();!(me=ge.n()).done;){var be=me.value,ye=be.outboundLayer;if(null!=ye){var xe,we=Object(d.a)(be.inputTensors);try{for(we.s();!(xe=we.n()).done;){var Oe=xe.value;if(-1===de.indexOf(Oe))throw new x("Graph disconnected: cannot obtain value for tensor ".concat(Oe)+' at layer "'.concat(ye.name,'". ')+"The following previous layers were accessed without "+"issue: ".concat(fe))}}catch(Me){we.e(Me)}finally{we.f()}var ke,Se=Object(d.a)(be.outputTensors);try{for(Se.s();!(ke=Se.n()).done;){var _e=ke.value;de.push(_e)}}catch(Me){Se.e(Me)}finally{Se.f()}fe.push(ye.name)}}}catch(Me){ge.e(Me)}finally{ge.f()}}}catch(Me){pe.e(Me)}finally{pe.f()}r.nodesByDepth=Q;var je,Ee=r.layers.map((function(e){return e.name})),Te=Object(d.a)(Ee);
2try{var Ce=function(){var e=je.value,t=Ee.filter((function(t){return t===e})).length;if(1!==t)throw new x('The name "'.concat(e,'" is used ').concat(t," times ")+"in the model. All layer names should be unique. Layer names: "+JSON.stringify(Ee))};for(Te.s();!(je=Te.n()).done;)Ce()}catch(Me){Te.e(Me)}finally{Te.f()}return r.outboundNodes=[],r.inboundNodes=[],new bt({outboundLayer:Object(f.a)(r),inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:r.inputs,outputTensors:r.outputs,inputMasks:r.inputs.map((function(e){return null})),outputMasks:r.outputs.map((function(e){return null})),inputShapes:r.inputs.map((function(e){return e.shape})),outputShapes:r.outputs.map((function(e){return e.shape}))}),r.built=!0,r._refCount=1,r}return Object(o.a)(n,[{key:"assertNotDisposed",value:function(){if(0===this._refCount)throw new Error("Container '".concat(this.name,"' is already disposed."))}},{key:"dispose",value:function(){this.assertNotDisposed();var e={refCountAfterDispose:null,numDisposedVariables:0};if(0===--this._refCount){var t,n=Object(d.a)(this.layers);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.numDisposedVariables+=r.dispose().numDisposedVariables}}catch(s){n.e(s)}finally{n.f()}var a,i=Object(d.a)(this.internalContainerRefs);try{for(i.s();!(a=i.n()).done;){var o=a.value;e.numDisposedVariables+=o.dispose().numDisposedVariables}}catch(s){i.e(s)}finally{i.f()}}return e.refCountAfterDispose=this._refCount,e}},{key:"loadWeights",value:function(e){var t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r={},a=0,i=Object(d.a)(this.layers);try{for(i.s();!(t=i.n()).done;){var o,s=t.value,u=Object(d.a)(s.weights);try{for(u.s();!(o=u.n()).done;){var c=o.value;if(null!=r[c.originalName])throw new w("Duplicate weight name: ".concat(c.originalName));r[c.originalName]=c,a++}}catch(b){u.e(b)}finally{u.f()}}}catch(b){i.e(b)}finally{i.f()}var l=[];for(var h in e){var f=h;if(null==r[h]){var p=h.split("/"),m=p.slice(0,-2).concat([p[p.length-1]]);f=m.join("/")}
vendor: 8,777 bytes, line 2
2if(null!=r[f])l.push([r[f],e[h]]);else if(n)throw new w("Provided weight data has no target variable: ".concat(h));delete r[f]}if(n){var v=[];for(var g in r)v.push(g);if(v.length>0)throw new w("".concat(v.length," of ").concat(a," weights are not set: ")+"".concat(v))}pt(l)}},{key:"updatedConfig",value:function(){var e=this.getConfig(),t={};return t.className=this.getClassName(),t.config=e,t.kerasVersion="tfjs-layers ".concat("2.4.0"),t.backend="TensorFlow.js",t}},{key:"toJSON",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=xn(this.updatedConfig());return t?JSON.stringify(n):n}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){e=T(e);for(var r=new wn,a=0;a<n.inputs.length;++a)r.add(n.inputs[a],e[a]);return Sn(n.outputs,r,t)}))}},{key:"computeMask",value:function(e,t){var n=this;return Object(a.tidy)((function(){var r;return e=T(e),r=null==t?S(null,e.length):T(t),n.runInternalGraph(e,r)[1]}))}},{key:"computeOutputShape",value:function(e){var t=ut(e);if(t.length!==this.inputLayers.length)throw new w("Invalid inputShape argument ".concat(e,": ")+"model has ".concat(this.inputLayers.length," tensor inputs."));for(var n={},r=0;r<t.length;r++){var a=this.inputLayers[r],i=t[r];n[a.name+"_0_0"]=i}var o=Object.keys(this.nodesByDepth).map((function(e){return parseInt(e,10)})).sort(L);if(o.length>1){var s,u=Object(d.a)(o);try{for(u.s();!(s=u.n()).done;){var c,l=s.value,h=this.nodesByDepth[l],f=Object(d.a)(h);try{for(f.s();!(c=f.n()).done;){var p=c.value,m=p.outboundLayer;if(-1===this.inputLayers.map((function(e){return e.id})).indexOf(m.id)){for(var v=[],g=0;g<p.inboundLayers.length;g++){var b=p.inboundLayers[g],y=p.nodeIndices[g],x=p.tensorIndices[g],O=n["".concat(b.name,"_").concat(y,"_").concat(x)];v.push(O)}for(var k=ut(m.computeOutputShape(E(v))),S=m.inboundNodes.indexOf(p),j=0;j<k.length;j++){n["".concat(m.name,"_").concat(S,"_").concat(j)]=k[j]}}}}catch(z){f.e(z)}finally{f.f()}}}catch(z){u.e(z)}finally{u.f()}}for(var T=[],C=[],M=0;M<this.outputLayers.length;M++){var A=this.outputLayers[M],N=this.outputLayersNodeIndices[M],R=this.outputLayersTensorIndices[M],I="".concat(A.name,"_").concat(N,"_").concat(R);C.push(I)}for(var D=0;D<C.length;D++){var P=C[D];_(P in n),T.push(n[P])}return E(T)}},{key:"runInternalGraph",value:function(e,t){null==t&&(t=S(null,e.length));for(var n={},r=0;r<this.inputs.length;++r){var a=this.inputs[r],i=e[r],o=t[r];n[a.id]=[i,o]}var s,u=Object.keys(this.nodesByDepth).map((function(e){return parseInt(e,10)})).sort(L),c=Object(d.a)(u);try{for(c.s();!(s=c.n()).done;){var l,f=s.value,p=this.nodesByDepth[f],m=Object(d.a)(p);try{for(m.s();!(l=m.n()).done;){var v,g=l.value,b=g.outboundLayer,y=g.inputTensors,x=g.outputTensors,w=new Array,k=Object(d.a)(y);try{for(k.s();!(v=k.n()).done;){var j=v.value;j.id in n&&w.push(n[j.id])}}catch(Z){k.e(Z)}finally{k.f()}if(w.length===y.length){var E={},C=void 0,M=void 0,A=void 0,N=void 0;if(null!=g.callArgs&&(E=g.callArgs),1===w.length){var R=Object(h.a)(w[0],2),I=R[0],D=R[1];null==E.mask&&(E.mask=D),A=T(b.call(I,E)),N=T(b.computeMask(I,D)),C=[I],M=[D]}else C=w.map((function(e){return e[0]})),M=w.map((function(e){return e[1]})),null==E.mask&&(E.mask=M),A=T(b.call(C,E)),N=T(b.computeMask(C,M));if(b.activityRegularizer)throw new O("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(var P=0;P<x.length;++P){var z=x[P],F=A[P],B=N[P];n[z.id]=[F,B]}}}}catch(Z){m.e(Z)}finally{m.f()}}}catch(Z){c.e(Z)}finally{c.f()}var U,W=[],V=[],G=[],H=Object(d.a)(this.outputs);try{for(H.s();!(U=H.n()).done;){var q=U.value;_(q.id in n,"Could not compute output ".concat(q.name," : ").concat(q.id));var X=Object(h.a)(n[q.id],2),Y=X[0],K=X[1];G.push(Y.shape),W.push(Y),V.push(K)}}catch(Z){H.e(Z)}finally{H.f()}return[W,V,G]}},{key:"buildNodeConversionMap",value:function(e){var t,r,a={},i=Object(d.a)(this.layers);try{for(i.s();!(r=i.n()).done;){var o=r.value;t=o instanceof n?1:0;for(var s=0;s<o.inboundNodes.length;s++){var u=n.nodeKey(o,s);this.containerNodes.has(u)&&(a[u]=t,t+=1)}}}catch(c){i.e(c)}finally{i.f()}return a}},{key:"getLayer",value:function(e,t){if(null!=t){if(this.layers.length<=t)throw new w("Was asked to retrieve layer at index ".concat(t,", but model only ")+"has ".concat(this.layers.length," layer(s)."));return this.layers[t]}if(null==e)throw new w("Provide either a layer name or layer index");var n,r=Object(d.a)(this.layers);try{for(r.s();!(n=r.n()).done;){var a=n.value;if(a.name===e)return a}}catch(i){r.e(i)}finally{r.f()}throw new w("No such layer: ".concat(e))}},{key:"calculateLosses",value:function(){var e=this;return Object(a.tidy)((function(){var t,r=[],a=Object(d.a)(e.layers);try{for(a.s();!(t=a.n()).done;)for(var i=t.value,o=0;o<i.inboundNodes.length;++o){var s=n.nodeKey(i,o);e.containerNodes.has(s)&&r.push.apply(r,Object(l.a)(i.calculateLosses()))}}catch(u){a.e(u)}finally{a.f()}return r}))}},{key:"getConfig",value:function(){var e,t={name:this.name},r=this.buildNodeConversionMap(this.layers),a=[],i=Object(d.a)(this.layers);try{for(i.s();!(e=i.n()).done;){for(var o=e.value,s=o.getClassName(),u=o.getConfig(),c=[],l=0;l<o.inboundNodes.length;l++){var h=o.inboundNodes[l],f=n.nodeKey(o,l),p={};if(this.containerNodes.has(f)){if(h.callArgs)try{JSON.stringify(h.callArgs),p=h.callArgs}catch(D){console.warn("Layer ".concat(o.name," was passed ")+"non-serializable keyword arguments: "+"".concat(h.callArgs,". They will not be included ")+"in the serialized model (and thus will be missing at deserialization time)."),p={}}if(h.inboundLayers.length>0){for(var m=[],v=0;v<h.inboundLayers.length;v++){var g=h.inboundLayers[v],b=h.nodeIndices[v],y=h.tensorIndices[v],x=r[n.nodeKey(g,b)];null==x&&(x=0),m.push([g.name,x,y,p])}c.push(m)}}}var w={};w.name=o.name,w.className=s,w.config=u,w.inboundNodes=c,a.push(w)}}catch(D){i.e(D)}finally{i.f()}t.layers=a;for(var O=[],k=0;k<this.inputLayers.length;k++){var S=this.inputLayers[k],_=this.inputLayersNodeIndices[k],j=n.nodeKey(S,_);if(this.containerNodes.has(j)){var E=r[j];null!==E&&void 0!==E||(E=0);var T=this.inputLayersTensorIndices[k];O.push([S.name,E,T])}}t.inputLayers=O;for(var C=[],M=0;M<this.outputLayers.length;M++){var A=this.outputLayers[M],N=this.outputLayersNodeIndices[M],R=n.nodeKey(A,N);if(this.containerNodes.has(R)){var I=r[R];null!==I&&void 0!==I||(I=0);var L=this.outputLayersTensorIndices[M];C.push([A.name,I,L])}}return t.outputLayers=C,t}},{key:"resetStates",value:function(){var e=this;Object(a.tidy)((function(){e.layers.forEach((function(e){e.stateful&&e.resetStates()}))}))}},{key:"trainable",get:function(){return this.trainable_},set:function(e){this.layers.forEach((function(t){t._trainableWeights.forEach((function(t){return t.trainable=e}))})),this.trainable_=e}},{key:"trainableWeights",get:function(){if(this._trainableWeights.length>0)throw new w("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];var e,t=[],n=Object(d.a)(this.layers);try{for(n.s();!(e=n.n()).done;){var r=e.value;t=t.concat(r.trainableWeights)}}catch(a){n.e(a)}finally{n.f()}return t}},{key:"nonTrainableWeights",get:function(){var e,t=[],n=Object(d.a)(this.layers);try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push.apply(t,Object(l.a)(r.nonTrainableWeights))}}catch(u){n.e(u)}finally{n.f()}if(!this.trainable){var a,i=[],o=Object(d.a)(this.layers);try{for(o.s();!(a=o.n()).done;){var s=a.value;i.push.apply(i,Object(l.a)(s.trainableWeights))}}catch(u){o.e(u)}finally{o.f()}return i.concat(t)}return t}},{key:"weights",get:function(){return this.trainableWeights.concat(this.nonTrainableWeights)}},{key:"stateful",get:function(){if(this._stateful)throw new w("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false.");var e,t=Object(d.a)(this.layers);try{for(t.s();!(e=t.n()).done;){if(e.value.stateful)return!0}}catch(n){t.e(n)}finally{t.f()}return!1}}],[{key:"fromConfig",value:function(e,t){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r={},a={};function i(e,t){e.name in a?a[e.name].push(t):a[e.name]=[t]}function o(e,t){var n,a,o=[],s=Object(d.a)(t);try{for(s.s();!(a=s.n()).done;){var u=a.value,c=u[0],l=u[1],h=u[2];if(n=null==u[3]?{}:u[3],!(c in r))return void i(e,t);var f=r[c];if(f.inboundNodes.length<=l)return void i(e,t);var p=f.inboundNodes[l];o.push(p.outputTensors[h])}}catch(m){s.e(m)}finally{s.f()}o.length>0&&e.apply(E(o),n)}function s(e){var a=e.name,o=Ft(e,null!=t.customObjects?t.customObjects:{});
2o.setFastWeightInitDuringBuild(n),r[a]=o,e.inboundNodes.forEach((function(e){if(!(e instanceof Array))throw new w("Corrupted configuration, expected array for nodeData: ".concat(e));i(o,e)}))}var u,c=t.name,l=t.layers,h=Object(d.a)(l);try{for(h.s();!(u=h.n()).done;){var f=u.value;s(f)}}catch(q){h.e(q)}finally{h.f()}for(;!P(a);){var p,m=Object(d.a)(l);try{for(m.s();!(p=m.n()).done;){var v=p.value,g=r[v.name];if(g.name in a){var b=a[g.name];delete a[g.name];var y,x=Object(d.a)(b);try{for(x.s();!(y=x.n()).done;){var O=y.value;o(g,O)}}catch(q){x.e(q)}finally{x.f()}}}}catch(q){m.e(q)}finally{m.f()}}var k,S=[],j=[],T=t.inputLayers,C=Object(d.a)(T);try{for(C.s();!(k=C.n()).done;){var M=k.value,A=M[0],N=M[1],R=M[2];_(A in r);var I=r[A],L=I.inboundNodes[N].outputTensors;S.push(L[R])}}catch(q){C.e(q)}finally{C.f()}var D,z=t.outputLayers,F=Object(d.a)(z);try{for(F.s();!(D=F.n()).done;){var B=D.value,U=B[0],W=B[1],V=B[2];_(U in r);var G=r[U],H=G.inboundNodes[W].outputTensors;j.push(H[V])}}catch(q){F.e(q)}finally{F.f()}return new e({inputs:S,outputs:j,name:c})}}]),n}(xt));ir.className="Model",a.serialization.registerClass(ir);var or=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return n}(ir);or.className="Functional",a.serialization.registerClass(or);var sr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;if(Object(i.a)(this,n),e=e||{},(r=t.call(this,{inputs:[],outputs:[]})).trainable=!0,r.built=!1,r.name=null!=e.name?e.name:ot("sequential_"),null!=e.layers){var a,o=Object(d.a)(e.layers);try{for(o.s();!(a=o.n()).done;){var s=a.value;r.add(s)}}catch(u){o.e(u)}finally{o.f()}}return r}return Object(o.a)(n,[{key:"checkShape",value:function(e){if(e.inboundNodes[0].outputTensors[0].shape.some((function(e){return e<0})))throw new w("Negative dimension size caused by adding layer "+"".concat(e.name," with input shape [")+"".concat(e.inboundNodes[0].inputTensors[0].shape,"]"))}},{key:"add",value:function(e){var t,r=e instanceof n||e instanceof ir;if(r){if(1!==(t=e).outputs.length)throw new w("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");if(1!==t.inputs.length)throw new w("All layers in a Sequential model should have a single input tensor. For multi-input layers, use the functional API.")}if(0===this.outputs.length){if(0===e.inboundNodes.length){if(null==e.batchInputShape)throw new w("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");var a=Ot({batchShape:e.batchInputShape,dtype:e.dtype,name:e.name+"_input"});e.apply(a)}if(r)this.outputs=t.outputs,this.inputs=t.inputs;else{if(1!==e.inboundNodes.length)throw new w("A layer added to a Sequential model must not already be "+"connected somewhere else. LayersModel received layer ".concat(e.name," ")+"which has ".concat(e.inboundNodes.length," pre-existing inbound ")+"connections.");if(1!==e.inboundNodes[0].outputTensors.length)throw new w("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[e.inboundNodes[0].outputTensors[0]],this.inputs=function e(t,n,r){if((null==n||null!=r&&r>0)&&(n=t.sourceLayer,r=t.nodeIndex),0===n.inboundNodes.length)return[t];var a=n.inboundNodes[r];if(0===a.inboundLayers.length)return a.inputTensors;for(var i=[],o=0;o<a.inboundLayers.length;o++){var s,u=e(a.inputTensors[o],a.inboundLayers[o],a.nodeIndices[o]),c=Object(d.a)(u);try{for(c.s();!(s=c.n()).done;){var l=s.value;-1===i.indexOf(l)&&i.push(l)}}catch(h){c.e(h)}finally{c.f()}}return i}(this.outputs[0])}this.inboundNodes=[],new bt({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:S(null,this.inputs.length),outputMasks:[null],inputShapes:this.inputs.map((function(e){return e.shape})),outputShapes:this.outputs[0].shape})}else{var i=e.apply(this.outputs[0]);if(Array.isArray(i))throw new TypeError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[i],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}this.layers.push(e),this.built=!1}},{key:"pop",value:function(){if(0===this.layers.length)throw new TypeError("There are no layers in the model.");if(this.layers.pop(),0===this.layers.length)this.outputs=[],this.inboundNodes=[],this.outboundNodes=[];else{var e=this.layers.length-1;this.layers[e].outboundNodes=[],this.outputs=[this.layers[e].output],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}}},{key:"call",value:function(e,t){return null==this.model&&this.build(),this.model.call(e,t)}},{key:"build",value:function(e){if(lt(e),0===this.inputs.length||0===this.outputs.length)throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first.");this.model=new ir({inputs:this.inputs,outputs:this.outputs[0],name:this.name+"_model"}),this.model.trainable=this.trainable,this.supportsMasking=this.model.supp
2ortsMasking,this.inputLayers=this.model.inputLayers,this.inputLayersNodeIndices=this.model.inputLayersNodeIndices,this.inputLayersTensorIndices=this.model.inputLayersTensorIndices,this.outputLayers=this.model.outputLayers,this.outputLayersNodeIndices=this.model.outputLayersNodeIndices,this.outputLayersTensorIndices=this.model.outputLayersTensorIndices,this.nodesByDepth=this.model.nodesByDepth,this.containerNodes=this.model.containerNodes,this.outputNames=this.model.outputNames,this.inputNames=this.model.inputNames,this.built=!0}},{key:"countParams",value:function(){return this.built||this.build(),Object(zt.a)(Object(p.a)(n.prototype),"countParams",this).call(this)}},{key:"summary",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:console.log;this.built||this.build(),Object(zt.a)(Object(p.a)(n.prototype),"summary",this).call(this,e,t,r)}},{key:"setWeights",value:function(e){null==this.model&&this.build(),this.model.setWeights(e)}},{key:"evaluate",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!this.built)throw new x("The model needs to be compiled before being used.");return this.model.evaluate(e,t,n)}},{key:"evaluateDataset",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.built){e.next=2;break}throw new x("The model needs to be compiled before being used.");case 2:return e.abrupt("return",this.model.evaluateDataset(t,n));case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"predict",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null==this.model&&this.build(),this.model.predict(e,t)}},{key:"predictOnBatch",value:function(e){return null==this.model&&this.build(),this.model.predictOnBatch(e)}},{key:"compile",value:function(e){this.build(),this.model.compile(e),this.optimizer_=this.model.optimizer,this.isOptimizerOwned=this.model.isOptimizerOwned,this.loss=this.model.loss,this.metrics=this.model.metrics,this.metricsTensors=this.model.metricsTensors,this.metricsNames=this.model.metricsNames}},{key:"fit",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){var r,a=arguments;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=a.length>2&&void 0!==a[2]?a[2]:{},this.built){e.next=3;break}throw new x("The model needs to be compiled before being used.");case 3:return e.abrupt("return",this.model.fit(t,n,r));case 4:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"fitDataset",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.built){e.next=2;break}throw new x("The model needs to be compiled before being used.");case 2:return e.abrupt("return",this.model.fitDataset(t,n));case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"trainOnBatch",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t,n){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.model.trainOnBatch(t,n));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getConfig",value:function(){var e,t=[],n=Object(d.a)(this.layers);try{for(n.s();!(e=n.n()).done;){var r=e.value,a={};a.className=r.getClassName(),a.config=r.getConfig(),t.push(a)}}catch(i){n.e(i)}finally{n.f()}return{name:this.name,layers:t}}},{key:"optimizer",get:function(){return null==this.model?void 0:this.model.optimizer},set:function(e){this.model.optimizer=e}},{key:"stopTraining",set:function(e){if(null==this.model)throw new w("Cannot set the stopTraining property of a sequential model before it is compiled.");this.model.stopTraining=e},get:function(){if(null==this.model)throw new w("Cannot get the stopTraining property of a sequential model before it is compiled.");return this.model.stopTraining}}],[{key:"fromConfig",value:function(e,t){var r,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o={};if(t instanceof Array){if(null==t[0].className||"Merge"===t[0].className)throw new w("Legacy serialization format not supported yet.");r=t}else a.util.assert(null!=t.layers,(function(){return"When the config data for a Sequential model is not an Array, it must be an Object that contains the 'layers' field."})),r=t.layers,delete t.layers,o=t;var s=new e(o);if(!(s instanceof n))throw new O("Sequential.fromConfig called on non-Sequential input: ".concat(s));var u,c=Object(d.a)(r);try{for(c.s();!(u=c.n()).done;){var l=u.value,h=void 0,f=Ft(l,h,i);i&&f.setFastWeightInitDuringBuild(!0),s.add(f)}}catch(p){c.e(p)}finally{c.f()}return s}}]),n}(ir);sr.className="Sequential",a.serialization.registerClass(sr);var ur=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"getConfig",value:function(){return{}}}]),n}(a.serialization.Serializable),cr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Ne(e,t)}}]),n}(ur);cr.className="elu",a.serialization.registerClass(cr);var lr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"apply",value:function(e){return a.selu(e)}}]),n}(ur);lr.className="selu",a.serialization.registerClass(lr);var hr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"apply",value:function(e){return a.relu(e)}}]),n}(ur);hr.className="relu",a.serialization.registerClass(hr);var dr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"apply",value:function(e){return Object(a.tidy)((function(){return a.minimum(6,a.relu(e))}))}}]),n}(ur);dr.className="relu6",a.serialization.registerClass(dr);var fr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"apply",value:function(e){return e}}]),n}(ur);fr.className="linear",a.serialization.registerClass(fr);var pr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"apply",value:function(e){return a.sigmoid(e)}}]),n}(ur);pr.className="sigmoid",a.serialization.registerClass(pr);var mr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"apply",value:function(e){return function(e){return Object(a.tidy)((function(){var t=a.add(.5,a.mul(.2,e));return a.clipByValue(t,0,1)}))}(e)}}]),n}(ur);mr.className="hardSigmoid",a.serialization.registerClass(mr);var vr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"apply",value:function(e){return a.softplus(e)}}]),n}(ur);vr.className="softplus",a.serialization.registerClass(vr);var gr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"apply",value:function(e){return function(e){return Object(a.tidy)((function(){return a.div(e,a.abs(e).add(1))}))}(e)}}]),n}(ur);gr.className="softsign",a.serialization.registerClass(gr);var br=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"apply",value:function(e){return a.tanh(e)}}]),n}(ur);br.className="tanh",a.serialization.registerClass(br);var yr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return a.softmax(e,t)}}]),n}(ur);yr.className="softmax",a.serialization.registerClass(yr);var xr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return a.logSoftmax(e,t)}}]),n}(ur);function wr(e){return e.getClassName()}function Or(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return I(e,a.serialization.SerializationMap.getMap().classNameMap,t,"activation")}function kr(e){if(null==e){var t={className:"linear",config:{}};return Or(t)}if("string"===typeof e){var n={};return n.className=e,n.config={},Or(n)}return e instanceof ur?e:Or(e)}function Sr(e){if(null!=e&&"object"!==typeof e)throw new Error("Argument to L1L2 regularizer's constructor is expected to be an "+"object, but received: ".concat(e))}xr.className="logSoftmax",a.serialization.registerClass(xr);var _r=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return n}(a.serialization.Serializable),jr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),r=t.call(this),Sr(e),r.l1=null==e||null==e.l1?.01:e.l1,r.l2=null==e||null==e.l2?.01:e.l2,r.hasL1=0!==r.l1,r.hasL2=0!==r.l2,r}return Object(o.a)(n,[{key:"apply",value:function(e){var t=this;return Object(a.tidy)((function(){var n=Object(a.zeros)([1]);return t.hasL1&&(n=Object(a.add)(n,Object(a.sum)(a.mul(t.l1,Object(a.abs)(e))))),t.hasL2&&(n=Object(a.add)(n,Object(a.sum)(a.mul(t.l2,Ce(e))))),n.asScalar()}))}},{key:"getConfig",value:function(){return{l1:this.l1,l2:this.l2}}}],[{key:"fromConfig",value:function(e,t){return new e({l1:t.l1,l2:t.l2})}}]),n}(_r);jr.className="L1L2",a.serialization.registerClass(jr);var Er={l1l2:"L1L2"};function Tr(e){return N(e)}function Cr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return I(e,a.serialization.SerializationMap.getMap().classNameMap,t,"regularizer")}function Mr(e){return null==e?null:"string"===typeof e?Cr({className:e in Er?Er[e]:e,config:{}}):e instanceof _r?e:Cr(e)}var Ar=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,null==e?{}:e)).supportsMasking=!0,null!=e&&(r.maxValue=e.maxValue),r}return Object(o.a)(n,[{key:"call",value:function(e,t){e=ct(e);var n=Object(a.relu)(e);return null!=this.maxValue&&(n=Object(a.clipByValue)(n,0,this.maxValue)),n}},{key:"computeOutputShape",value:function(e){return e}},{key:"getConfig",value:function(){var e={maxValue:this.maxValue},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt);Ar.className="ReLU",a.serialization.registerClass(Ar);var Nr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,null==e?{}:e)).DEFAULT_ALPHA=.3,null==e&&(e={}),r.alpha=null==e.alpha?r.DEFAULT_ALPHA:e.alpha,r}return Object(o.a)(n,[{key:"call",value:function(e,t){var n=ct(e);return Object(a.leakyRelu)(n,this.alpha)}},{key:"computeOutputShape",value:function(e){return e}},{key:"getConfig",value:function(){var e={alpha:this.alpha},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt);Nr.className="LeakyReLU",a.serialization.registerClass(Nr);var Rr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;if(Object(i.a)(this,n),(r=t.call(this,null==e?{}:e)).DEFAULT_ALPHA_INITIALIZER="zeros",null==e&&(e={}),r.supportsMasking=!0,r.alphaInitializer=nt(e.alphaInitializer||r.DEFAULT_ALPHA_INITIALIZER),r.alphaRegularizer=Mr(e.alphaRegularizer),r.alphaConstraint=J(e.alphaConstraint),null==e.sharedAxes)r.sharedAxes=null;else if(Array.isArray(e.sharedAxes))r.sharedAxes=e.sharedAxes;else{if("number"!==typeof e.sharedAxes)throw new w("Expected sharedAxes to be a number or an array of numbers, "+"but got ".concat(e.sharedAxes));r.sharedAxes=[e.sharedAxes]}return r}return Object(o.a)(n,[{key:"build",value:function(e){var t=(e=lt(e)).slice(1);if(null!=this.sharedAxes){var n,r=Object(d.a)(this.sharedAxes);try{for(r.s();!(n=r.n()).done;){t[n.value-1]=1}}catch(o){r.e(o)}finally{r.f()}}this.alpha=this.addWeight("alpha",t,"float32",this.alphaInitializer,this.alphaRegularizer,!0,this.alphaConstraint);var a={};if(null!=this.sharedAxes)for(var i=1;i<e.length;++i)a[i]=e[i];this.inputSpec=[new mt({ndim:e.length,axes:a})],this.built=!0}},{key:"call",value:function(e,t){return e=ct(e),Object(a.prelu)(e,this.alpha.read())}},{key:"getConfig",value:function(){var e={alphaInitializer:tt(this.alphaInitializer),alphaRegularizer:Tr(this.alphaRegularizer),alphaConstraint:K(this.alphaConstraint),sharedAxes:this.sharedAxes},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt);Rr.className="PReLU",a.serialization.registerClass(Rr);var Ir=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;if(Object(i.a)(this,n),(r=t.call(this,null==e?{}:e)).DEFAULT_ALPHA=1,null==e&&(e={}),null!=e.alpha&&e.alpha!==r.DEFAULT_ALPHA)throw new O("Non-default alpha value (".concat(e.alpha,") is not supported by the ")+"ELU layer yet.");return r.alpha=null==e.alpha?r.DEFAULT_ALPHA:e.alpha,r}return Object(o.a)(n,[{key:"call",value:function(e,t){var n=ct(e);return Object(a.elu)(n)}},{key:"computeOutputShape",value:function(e){return e}},{key:"getConfig",value:function(){var e={alpha:this.alpha},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt);Ir.className="ELU",a.serialization.registerClass(Ir);var Lr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,null==e?{}:e)).DEFAULT_THETA=1,null==e&&(e={}),r.theta=null==e.theta?r.DEFAULT_THETA:e.theta,r}return Object(o.a)(n,[{key:"call",value:function(e,t){var n=ct(e);return n.mul(ge(n.greater(this.theta),"float32"))}},{key:"computeOutputShape",value:function(e){return e}},{key:"getConfig",value:function(){var e={theta:this.theta},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt);Lr.className="ThresholdedReLU",a.serialization.registerClass(Lr);var Dr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,null==e?{}:e)).DEFAULT_AXIS=1,null==e&&(e={}),r.softmax=(new yr).apply,r.axis=null==e.axis?r.DEFAULT_AXIS:e.axis,r}return Object(o.a)(n,[{key:"call",value:function(e,t){var n=ct(e);return this.softmax(n,this.axis)}},{key:"computeOutputShape",value:function(e){return e}},{key:"getConfig",value:function(){var e={axis:this.axis},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt);Dr.className="Softmax",a.serialization.registerClass(Dr);var Pr=n(42);function zr(e,t,n){if("number"===typeof e)return S(e,t);if(e.length!==t)throw new w("The ".concat(n," argument must be an integer or tuple of ").concat(t," integers.")+" Received: ".concat(e.length," elements."));for(var r=0;r<t;++r){var a=e[r];if((i=a)!==parseInt(i.toString(),10))throw new w("The ".concat(n," argument must be an integer or tuple of ").concat(t)+" integers. Received: ".concat(JSON.stringify(e)," including a")+" non-integer number ".concat(a))}return e;var i}function Fr(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(null==e)return e;var i,o=t+(t-1)*(a-1);return i="same"===n?e:e-o+1,Math.floor((i+r-1)/r)}function Br(e,t,n,r){if(null==e)return null;if("valid"===r)e=e*t+me([n-t,0]);else{if("same"!==r)throw new w("Unsupport padding mode: ".concat(r,"."));e*=t}return e}function Ur(e,t){return Object(a.tidy)((function(){return re(t),"channelsFirst"===t?a.transpose(e,[0,2,3,1]):e}))}function Wr(e,t){return Object(a.tidy)((function(){return re(t),"channelsFirst"===t?a.transpose(e,[0,2,3,4,1]):e}))}function Vr(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"valid",o=arguments.length>5?arguments[5]:void 0,s=argum
2ents.length>6&&void 0!==arguments[6]?arguments[6]:1;return Object(a.tidy)((function(){if(null==o&&(o="channelsLast"),re(o),3!==e.shape.length)throw new w("The input of a conv1dWithBias operation should be 3, but is "+"".concat(e.shape.length," instead."));if(3!==t.shape.length)throw new w("The kernel for a conv1dWithBias operation should be 3, but is "+"".concat(t.shape.length," instead"));if(null!=n&&1!==n.shape.length)throw new w("The bias for a conv1dWithBias operation should be 1, but is "+"".concat(t.shape.length," instead"));if("channelsFirst"===o&&(e=a.transpose(e,[0,2,1])),"causal"===i)throw new O("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");var u=a.conv1d(e,t,r,"same"===i?"same":"valid","NWC",s);return null!=n&&(u=Ae(u,n)),u}))}function Gr(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[1,1],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"valid",o=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;return Object(a.tidy)((function(){if(null==o&&(o="channelsLast"),re(o),3!==e.rank&&4!==e.rank)throw new w("conv2dWithBiasActivation expects input to be of rank 3 or 4, "+"but received ".concat(e.rank,"."));if(3!==t.rank&&4!==t.rank)throw new w("conv2dWithBiasActivation expects kernel to be of rank 3 or 4, "+"but received ".concat(e.rank,"."));var c=Ur(e,o);if("causal"===i)throw new O("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return c=a.fused.conv2d({x:c,filter:t,strides:r,pad:"same"===i?"same":"valid",dilations:s,dataFormat:"NHWC",bias:n,activation:u}),"channelsFirst"===o&&(c=a.transpose(c,[0,3,1,2])),c}))}function Hr(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[1,1,1],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"valid",o=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0;return Object(a.tidy)((function(){if(null==o&&(o="channelsLast"),re(o),4!==e.rank&&5!==e.rank)throw new w("conv3dWithBias expects input to be of rank 4 or 5, but received "+"".concat(e.rank,"."));if(4!==t.rank&&5!==t.rank)throw new w("conv3dWithBias expects kernel to be of rank 4 or 5, but received "+"".concat(e.rank,"."));var u=Wr(e,o);if("causal"===i)throw new O("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return u=a.conv3d(u,t,r,"same"===i?"same":"valid","NDHWC",s),null!=n&&(u=Ae(u,n)),"channelsFirst"===o&&(u=a.transpose(u,[0,4,1,2,3])),u}))}var qr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e,r){var a;if(Object(i.a)(this,n),(a=t.call(this,r)).bias=null,a.DEFAULT_KERNEL_INITIALIZER="glorotNormal",a.DEFAULT_BIAS_INITIALIZER="zeros",n.verifyArgs(r),a.rank=e,B(a.rank,"rank"),1!==a.rank&&2!==a.rank&&3!==a.rank)throw new O("Convolution layer for rank other than 1, 2, or 3 (".concat(a.rank,") is ")+"not implemented yet.");if(a.kernelSize=zr(r.kernelSize,e,"kernelSize"),a.strides=zr(null==r.strides?1:r.strides,e,"strides"),a.padding=null==r.padding?"valid":r.padding,ae(a.padding),a.dataFormat=null==r.dataFormat?"channelsLast":r.dataFormat,re(a.dataFormat),a.activation=kr(r.activation),a.useBias=null==r.useBias||r.useBias,a.biasInitializer=nt(r.biasInitializer||a.DEFAULT_BIAS_INITIALIZER),a.biasConstraint=J(r.biasConstraint),a.biasRegularizer=Mr(r.biasRegularizer),a.activityRegularizer=Mr(r.activityRegularizer),a.dilationRate=zr(null==r.dilationRate?1:r.dilationRate,e,"dilationRate"),1===a.rank&&Array.isArray(a.dilationRate)&&1!==a.dilationRate.length)throw new w("dilationRate must be a number or an array of a single number for 1D convolution, but received "+"".concat(JSON.stringify(a.dilationRate)));if(2===a.rank){if("number"===typeof a.dilationRate)a.dilationRate=[a.dilationRate,a.dilationRate];else if(2!==a.dilationRate.length)throw new w("dilationRate must be a number or array of two numbers for 2D "+"convolution, but received ".concat(JSON.stringify(a.dilationRate)))}else if(3===a.rank)if("number"===typeof a.dilationRate)a.dilationRate=[a.dilationRate,a.dilationRate,a.dilationRate];else if(3!==a.dilationRate.length)throw new w("dilationRate must be a number or array of three numbers for 3D "+"convolution, but received ".concat(JSON.stringify(a.dilationRate)));return a}return Object(o.a)(n,[{key:"getConfig",value:function(){var e={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:wr(this.activation),useBias:this.useBias,biasInitializer:tt(this.biasInitializer),biasRegularizer:Tr(this.biasRegularizer),activityRegularizer:Tr(this.activityRegularizer),biasConstraint:K(this.biasConstraint)},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}],[{key:"verifyArgs",value:function(e){if(_("kernelSize"in e,"required key 'kernelSize' not in config"),"number"!==typeof e.kernelSize&&!F(e.kernelSize,"number",1,3))throw new w("BaseConv expects config.kernelSize to be number or number[] with "+"length 1, 2, or 3, but received ".concat(JSON.stringify(e.kernelSize),"."))}}]),n}(xt),Xr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e,r){var a;return Object(i.a)(this,n),(a=t.call(this,e,r)).kernel=null,n.verifyArgs(r),a.filters=r.filters,B(a.filters,"filters"),a.kernelInitializer=nt(r.kernelInitializer||a.DEFAULT_KERNEL_INITIALIZER),a.kernelConstraint=J(r.kernelConstraint),a.kernelRegularizer=Mr(r.kernelRegularizer),a}return Object(o.a)(n,[{key:"build",value:function(e){e=lt(e);var t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new w("The channel dimension of the input should be defined. "+"Found ".concat(e[t]));var n=e[t],r=this.kernelSize.concat([n,this.filters]);this.kernel=this.addWeight("kernel",r,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[{ndim:this.rank+2,axes:Object(Pr.a)({},t,n)}],this.built=!0}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){var t;e=ct(e);var r=null==n.bias?null:n.bias.read(),a=U(n.activation.getClassName());if(null!=a&&2===n.rank)t=Gr(e,n.kernel.read(),r,n.strides,n.padding,n.dataFormat,n.dilationRate,a);else{if(1===n.rank)t=Vr(e,n.kernel.read(),r,n.strides[0],n.padding,n.dataFormat,n.dilationRate[0]);else if(2===n.rank)t=Gr(e,n.kernel.read(),r,n.strides,n.padding,n.dataFormat,n.dilationRate);
vendor: 9,590 bytes, line 2
2else{if(3!==n.rank)throw new O("convolutions greater than 3D are not implemented yet.");t=Hr(e,n.kernel.read(),r,n.strides,n.padding,n.dataFormat,n.dilationRate)}null!=n.activation&&(t=n.activation.apply(t))}return t}))}},{key:"computeOutputShape",value:function(e){e=lt(e);for(var t=[],n="channelsLast"===this.dataFormat?e.slice(1,e.length-1):e.slice(2),r=0;r<n.length;++r){var a=Fr(n[r],this.kernelSize[r],this.padding,this.strides[r],"number"===typeof this.dilationRate?this.dilationRate:this.dilationRate[r]);t.push(a)}var i=[e[0]];return"channelsLast"===this.dataFormat?(i=i.concat(t)).push(this.filters):(i.push(this.filters),i=i.concat(t)),i}},{key:"getConfig",value:function(){var e={filters:this.filters,kernelInitializer:tt(this.kernelInitializer),kernelRegularizer:Tr(this.kernelRegularizer),kernelConstraint:K(this.kernelConstraint)},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}],[{key:"verifyArgs",value:function(e){if(!("filters"in e)||"number"!==typeof e.filters||e.filters<1)throw new w("Convolution layer expected config.filters to be a 'number' > 0 "+"but got ".concat(JSON.stringify(e.filters)))}}]),n}(qr),Yr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),r=t.call(this,2,e),n.verifyArgs(e),r}return Object(o.a)(n,[{key:"getConfig",value:function(){var e=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return delete e.rank,e}}],[{key:"verifyArgs",value:function(e){if("number"!==typeof e.kernelSize&&!F(e.kernelSize,"number",1,2))throw new w("Conv2D expects config.kernelSize to be number or number[] with "+"length 1 or 2, but received ".concat(JSON.stringify(e.kernelSize),"."))}}]),n}(Xr);Yr.className="Conv2D",a.serialization.registerClass(Yr);var Kr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),r=t.call(this,3,e),n.verifyArgs(e),r}return Object(o.a)(n,[{key:"getConfig",value:function(){var e=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return delete e.rank,e}}],[{key:"verifyArgs",value:function(e){if("number"!==typeof e.kernelSize&&(!Array.isArray(e.kernelSize)||1!==e.kernelSize.length&&3!==e.kernelSize.length))throw new w("Conv3D expects config.kernelSize to be number or"+" [number, number, number], but received ".concat(JSON.stringify(e.kernelSize),"."))}}]),n}(Xr);Kr.className="Conv3D",a.serialization.registerClass(Kr);var Zr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;if(Object(i.a)(this,n),(r=t.call(this,e)).inputSpec=[new mt({ndim:4})],"same"!==r.padding&&"valid"!==r.padding)throw new w("Conv2DTranspose currently supports only padding modes 'same' "+"and 'valid', but received padding mode ".concat(r.padding));return r}return Object(o.a)(n,[{key:"build",value:function(e){if(4!==(e=lt(e)).length)throw new w("Input should have rank 4; Received input shape: "+JSON.stringify(e));var t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new w("The channel dimension of the inputs should be defined. Found `None`.");var n=e[t],r=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",r,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new mt({ndim:4,axes:Object(Pr.a)({},t,n)})],this.built=!0}},{key:"call",value:function(e,t){var n=this;return a.tidy((function(){var t=ct(e);if(4!==t.shape.length)throw new w("Conv2DTranspose.call() expects input tensor to be rank-4, but "+"received a tensor of rank-".concat(t.shape.length));var r,i,o=t.shape,s=o[0];"channelsFirst"===n.dataFormat?(r=2,i=3):(r=1,i=2);var u=o[r],c=o[i],l=n.kernelSize[0],h=n.kernelSize[1],d=n.strides[0],f=n.strides[1],p=[s,Br(u,d,l,n.padding),Br(c,f,h,n.padding),n.filters];"channelsLast"!==n.dataFormat&&(t=a.transpose(t,[0,2,3,1]));var m=a.conv2dTranspose(t,n.kernel.read(),p,n.strides,n.padding);return"channelsLast"!==n.dataFormat&&(m=a.transpose(m,[0,3,1,2])),null!=n.bias&&(m=Ae(m,n.bias.read(),n.dataFormat)),null!=n.activation&&(m=n.activation.apply(m)),m}))}},{key:"computeOutputShape",value:function(e){var t,n,r,a=(e=lt(e)).slice();"channelsFirst"===this.dataFormat?(t=1,n=2,r=3):(t=3,n=1,r=2);var i=this.kernelSize[0],o=this.kernelSize[1],s=this.strides[0],u=this.strides[1];return a[t]=this.filters,a[n]=Br(a[n],s,i,this.padding),a[r]=Br(a[r],u,o,this.padding),a}},{key:"getConfig",value:function(){var e=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return delete e.dilationRate,e}}]),n}(Yr);Zr.className="Conv2DTranspose",a.serialization.registerClass(Zr);var Jr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e,r){var a;if(Object(i.a)(this,n),(a=t.call(this,e,r)).DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",a.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",a.depthwiseKernel=null,a.pointwiseKernel=null,null==r.filters)throw new w("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=r.kernelInitializer||null!=r.kernelRegularizer||null!=r.kernelConstraint)throw new w("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(null!=r.padding&&"same"!==r.padding&&"valid"!==r.padding)throw new w("SeparableConv".concat(a.rank,"D supports only padding modes: ")+"'same' and 'valid', but received ".concat(JSON.stringify(r.padding)));return a.depthMultiplier=null==r.depthMultiplier?1:r.depthMultiplier,a.depthwiseInitializer=nt(r.depthwiseInitializer||a.DEFAULT_DEPTHWISE_INITIALIZER),a.depthwiseRegularizer=Mr(r.depthwiseRegularizer),a.depthwiseConstraint=J(r.depthwiseConstraint),a.pointwiseInitializer=nt(r.depthwiseInitializer||a.DEFAULT_POINTWISE_INITIALIZER),a.pointwiseRegularizer=Mr(r.pointwiseRegularizer),a.pointwiseConstraint=J(r.pointwiseConstraint),a}return Object(o.a)(n,[{key:"build",value:function(e){if((e=lt(e)).length<this.rank+2)throw new w("Inputs to SeparableConv".concat(this.rank,"D should have rank ")+"".concat(this.rank+2,", but received input shape: ")+"".concat(JSON.stringify(e)));var t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t]||e[t]<0)throw new w("The channel dimension of the inputs should be defined, "+"but found ".concat(JSON.stringify(e[t])));for(var n=e[t],r=this.kernelSize.concat([n,this.depthMultiplier]),a=[],i=0;i<this.rank;++i)a.push(1);a.push(n*this.depthMultiplier,this.filters);this.depthwiseKernel=this.addWeight("depthwise_kernel",r,"float32",this.depthwiseInitializer,this.depthwiseRegularizer,!0,this.depthwiseConstraint),this.pointwiseKernel=this.addWeight("pointwise_kernel",a,"float32",this.pointwiseInitializer,this.pointwiseRegularizer,!0,this.pointwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.inputSpec=[new mt({ndim:this.rank+2,axes:Object(Pr.a)({},t,n)})],this.built=!0}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){var t;if(e=ct(e),1===n.rank)throw new O("1D separable convolution is not implemented yet.");return 2===n.rank&&("channelsFirst"===n.dataFormat&&(e=a.transpose(e,[0,2,3,1])),t=a.separableConv2d(e,n.depthwiseKernel.read(),n.pointwiseKernel.read(),n.strides,n.padding,n.dilationRate,"NHWC")),n.useBias&&(t=Ae(t,n.bias.read(),n.dataFormat)),null!=n.activation&&(t=n.activation.apply(t)),"channelsFirst"===n.dataFormat&&(t=a.transpose(t,[0,3,1,2])),t}))}},{key:"getConfig",value:function(){var e=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return delete e.rank,delete e.kernelInitializer,delete e.kernelRegularizer,delete e.kernelConstraint,e.depthwiseInitializer=tt(this.depthwiseInitializer),e.pointwiseInitializer=tt(this.pointwiseInitializer),e.depthwiseRegularizer=Tr(this.depthwiseRegularizer),e.pointwiseRegularizer=Tr(this.pointwiseRegularizer),e.depthwiseConstraint=K(this.depthwiseConstraint),e.pointwiseConstraint=K(this.pointwiseConstraint),e}}]),n}(Xr);Jr.className="SeparableConv";var Qr=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,2,e)}return n}(Jr);Qr.className="SeparableConv2D",a.serialization.registerClass(Qr);var $r=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),r=t.call(this,1,e),n.verifyArgs(e),r.inputSpec=[{ndim:3}],r}return Object(o.a)(n,[{key:"getConfig",value:function(){var e=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return delete e.rank,delete e.dataFormat,e}}],[{key:"verifyArgs",value:function(e){if("number"!==typeof e.kernelSize&&!F(e.kernelSize,"number",1,1))throw new w("Conv1D expects config.kernelSize to be number or number[] with "+"length 1, but received ".concat(JSON.stringify(e.kernelSize),"."))}}]),n}(Xr);$r.className="Conv1D",a.serialization.registerClass($r);var ea=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),r=t.call(this,e),"number"===typeof e.cropping?r.cropping=[[e.cropping,e.cropping],[e.cropping,e.cropping]]:"number"===typeof e.cropping[0]?r.cropping=[[e.cropping[0],e.cropping[0]],[e.cropping[1],e.cropping[1]]]:r.cropping=e.cropping,r.dataFormat=void 0===e.dataFormat?"channelsLast":e.dataFormat,r.inputSpec=[{ndim:4}],r}
2return Object(o.a)(n,[{key:"computeOutputShape",value:function(e){return"channelsFirst"===this.dataFormat?[e[0],e[1],e[2]-this.cropping[0][0]-this.cropping[0][1],e[3]-this.cropping[1][0]-this.cropping[1][1]]:[e[0],e[1]-this.cropping[0][0]-this.cropping[0][1],e[2]-this.cropping[1][0]-this.cropping[1][1],e[3]]}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){if(e=ct(e),"channelsLast"===n.dataFormat){var t=Oe(e,n.cropping[0][0],e.shape[1]-n.cropping[0][0]-n.cropping[0][1],2);return Oe(t,n.cropping[1][0],e.shape[2]-n.cropping[1][1]-n.cropping[1][0],3)}var r=Oe(e,n.cropping[0][0],e.shape[2]-n.cropping[0][0]-n.cropping[0][1],3);return Oe(r,n.cropping[1][0],e.shape[3]-n.cropping[1][1]-n.cropping[1][0],4)}))}},{key:"getConfig",value:function(){var e={cropping:this.cropping,dataFormat:this.dataFormat},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt);ea.className="Cropping2D",a.serialization.registerClass(ea);var ta=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,e)).DEFAULT_SIZE=[2,2],r.inputSpec=[{ndim:4}],r.size=null==e.size?r.DEFAULT_SIZE:e.size,r.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,r}return Object(o.a)(n,[{key:"computeOutputShape",value:function(e){if("channelsFirst"===this.dataFormat){var t=null==e[2]?null:this.size[0]*e[2],n=null==e[3]?null:this.size[1]*e[3];return[e[0],e[1],t,n]}var r=null==e[1]?null:this.size[0]*e[1],a=null==e[2]?null:this.size[1]*e[2];return[e[0],r,a,e[3]]}},{key:"call",value:function(e,t){var n=this;return a.tidy((function(){var t=ct(e),r=t.shape;if("channelsFirst"===n.dataFormat){t=a.transpose(t,[0,2,3,1]);var i=n.size[0]*r[2],o=n.size[1]*r[3],s=t.resizeNearestNeighbor([i,o]);return a.transpose(s,[0,3,1,2])}var u=n.size[0]*r[1],c=n.size[1]*r[2];return t.resizeNearestNeighbor([u,c])}))}},{key:"getConfig",value:function(){var e={size:this.size,dataFormat:this.dataFormat},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt);ta.className="UpSampling2D",a.serialization.registerClass(ta);var na=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,2,e)).depthwiseKernel=null,r.depthMultiplier=null==e.depthMultiplier?1:e.depthMultiplier,r.depthwiseInitializer=nt(e.depthwiseInitializer||r.DEFAULT_KERNEL_INITIALIZER),r.depthwiseConstraint=J(e.depthwiseConstraint),r.depthwiseRegularizer=Mr(e.depthwiseRegularizer),r}return Object(o.a)(n,[{key:"build",value:function(e){if((e=lt(e)).length<4)throw new w("Inputs to DepthwiseConv2D should have rank 4. "+"Received input shape: ".concat(JSON.stringify(e),"."));var t="channelsFirst"===this.dataFormat?1:3;if(null==e[t]||e[t]<0)throw new w("The channel dimension of the inputs to DepthwiseConv2D should "+"be defined, but is not (".concat(e[t],")."));var n=e[t],r=[this.kernelSize[0],this.kernelSize[1],n,this.depthMultiplier];this.depthwiseKernel=this.addWeight("depthwise_kernel",r,null,this.depthwiseInitializer,this.depthwiseRegularizer,!0,this.depthwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[n*this.depthMultiplier],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){var t=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[1,1],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"valid",i=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0;return Object(a.tidy)((function(){null==i&&(i="channelsLast"),re(i);var s=Ur(e,i);if(4!==e.rank)throw new w("Input for depthwiseConv2d is required to be 4-D, but is instead "+"".concat(e.rank,"-D"));if(4!==t.rank)throw new w("depthwiseKernel is required to be 4-D, but is instead "+"".concat(t.rank,"-D"));return s=a.depthwiseConv2d(s,t,n,"same"===r?"same":"valid","NHWC",o),"channelsFirst"===i&&(s=a.transpose(s,[0,3,1,2])),s}))}(e=ct(e),n.depthwiseKernel.read(),n.strides,n.padding,n.dataFormat,null);return n.useBias&&(t=Ae(t,n.bias.read(),n.dataFormat)),null!=n.activation&&(t=n.activation.apply(t)),t}))}},{key:"computeOutputShape",value:function(e){e=lt(e);var t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2],r="channelsFirst"===this.dataFormat?e[1]*this.depthMultiplier:e[3]*this.depthMultiplier,a=Fr(t,this.kernelSize[0],this.padding,this.strides[0]),i=Fr(n,this.kernelSize[1],this.padding,this.strides[1]);return"channelsFirst"===this.dataFormat?[e[0],r,a,i]:[e[0],a,i,r]}},{key:"getConfig",value:function(){var e=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return e.depthMultiplier=this.depthMultiplier,e.depthwiseInitializer=tt(this.depthwiseInitializer),e.depthwiseRegularizer=Tr(this.depthwiseRegularizer),e.depthwiseConstraint=K(this.depthwiseRegularizer),e}}]),n}(qr);function ra(e,t,n,r){if(Array.isArray(e)){if(null!=t||null!=n)throw new w("When input
2s is an array, neither initialState or constants should be provided");null!=r&&(n=e.slice(e.length-r,e.length),e=e.slice(0,e.length-r)),e.length>1&&(t=e.slice(1,e.length)),e=e[0]}function a(e){return null==e||Array.isArray(e)?e:[e]}return{inputs:e,initialState:t=a(t),constants:n=a(n)}}function aa(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],u=arguments.length>7&&void 0!==arguments[7]&&arguments[7];return a.tidy((function(){var c=t.shape.length;if(c<3)throw new w("Input should be at least 3D, but is ".concat(c,"D."));var l=[1,0].concat(ve(2,c));if(t=a.transpose(t,l),null!=o)throw new O("The rnn() functoin of the deeplearn.js backend does not support constants yet.");s&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),null!=i&&((i=i.asType("bool").asType("float32")).rank===c-1&&(i=a.expandDims(i,-1)),i=a.transpose(i,l)),r&&(t=a.reverse(t,0),null!=i&&(i=a.reverse(i,0)));var h,d,f=[],p=n,m=t.shape[0],v=a.unstack(t);null!=i&&(d=a.unstack(i));for(var g,b=function(t){var n=v[t],r=a.tidy((function(){return e(n,p)}));if(null==i)h=r[0],p=r[1];else{var o=a.tidy((function(){var e=d[t],n=a.onesLike(e).sub(e);return{output:r[0].mul(e).add(p[0].mul(n)),newStates:p.map((function(t,a){return r[1][a].mul(e).add(t.mul(n))}))}}));h=o.output,p=o.newStates}u&&f.push(h)},y=0;y<m;++y)b(y);if(u){g=a.stack(f,1)}return[h,g,p]}))}na.className="DepthwiseConv2D",a.serialization.registerClass(na);var ia=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r,a;if(Object(i.a)(this,n),r=t.call(this,e),null==e.cell)throw new w("cell property is missing for the constructor of RNN.");if(null==(a=Array.isArray(e.cell)?new fa({cells:e.cell}):e.cell).stateSize)throw new w("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");return r.cell=a,r.returnSequences=null!=e.returnSequences&&e.returnSequences,r.returnState=null!=e.returnState&&e.returnState,r.goBackwards=null!=e.goBackwards&&e.goBackwards,r._stateful=null!=e.stateful&&e.stateful,r.unroll=null!=e.unroll&&e.unroll,r.supportsMasking=!0,r.inputSpec=[new mt({ndim:3})],r.stateSpec=null,r.states_=null,r.numConstants=null,r.keptStates=[],r}return Object(o.a)(n,[{key:"getStates",value:function(){return null==this.states_?ve(0,Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1).map((function(e){return null})):this.states_}},{key:"setStates",value:function(e){this.states_=e}},{key:"computeOutputShape",value:function(e){st(e)&&(e=e[0]),e=e;var t=this.cell.stateSize;Array.isArray(t)||(t=[t]);var n,r=t[0];if(n=this.returnSequences?[e[0],e[1],r]:[e[0],r],this.returnState){var a,i=[],o=Object(d.a)(t);try{for(o.s();!(a=o.n()).done;){var s=a.value;i.push([e[0],s])}}catch(u){o.e(u)}finally{o.f()}return[n].concat(i)}return n}},{key:"computeMask",value:function(e,t){var n=this;return a.tidy((function(){Array.isArray(t)&&(t=t[0]);var e=n.returnSequences?t:null;if(n.returnState){var r=n.states.map((function(e){return null}));return[e].concat(r)}return e}))}},{key:"build",value:function(e){if(null!=this.numConstants)throw new O("Constants support is not implemented in RNN yet.");st(e)&&(e=e[0]),e=e;var t=this.stateful?e[0]:null,n=e.slice(2);this.inputSpec[0]=new mt({shape:[t,null].concat(Object(l.a)(n))});var r,i=[e[0]].concat(e.slice(2));if(this.cell.build(i),r=Array.isArray(this.cell.stateSize)?this.cell.stateSize:[this.cell.stateSize],null!=this.stateSpec){if(!a.util.arraysEqual(this.stateSpec.map((function(e){return e.shape[e.shape.length-1]})),r))throw new w("An initialState was passed that is not compatible with "+"cell.stateSize. Received stateSpec=".concat(this.stateSpec,"; ")+"However cell.stateSize is ".concat(this.cell.stateSize))}else this.stateSpec=r.map((function(e){return new mt({shape:[null,e]})}));this.stateful&&this.resetStates()}},{key:"resetStates",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Object(a.tidy)((function(){if(!t.stateful)throw new y("Cannot call resetStates() on an RNN Layer that is not stateful.");var r=t.inputSpec[0].shape[0];if(null==r)throw new w("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(null==t.states_)Array.isArray(t.cell.stateSize)?t.states_=t.cell.stateSize.map((function(e){return a.zeros([r,e])})):t.states_=[a.zeros([r,t.cell.stateSize])];else if(null==e)a.dispose(t.states_),null!=t.keptStates&&(a.dispose(t.keptStates),t.keptStates=[]),Array.isArray(t.cell.stateSize)?t.states_=t.cell.stateSize.map((function(e){return a.zeros([r,e])})):t.states_[0]=a.zeros([r,t.cell.stateSize]);else{if(Array.isArray(e)||(e=[e]),e.length!==t.states_.length)throw new w("Layer ".concat(t.name," expects ").concat(t.states_.length," state(s), ")+"but it received ".concat(e.length," state value(s). Input ")+"received: ".concat(e));!0===n?t.keptStates.push(t.states_.slice()):a.dispose(t.states_);for(var i=0;i<t.states_.length;++i){var o=e[i],s=Array.isArray(t.cell.stateSize)?t.cell.stateSize[i]:t.cell.stateSize,u=[r,s];if(!a.util.arraysEqual(o.shape,u))throw new w("State ".concat(i," is incompatible with layer ").concat(t.name,": ")+"expected shape=".concat(u,", received shape=").concat(o.shape));t.states_[i]=o}}t.states_=t.states_.map((function(e){return a.keep(e.clone())}))}))}},{key:"apply",value:function(e,t){var r=null==t?null:t.initialState,a=null==t?null:t.constants;null==t&&(t={});var i=ra(e,r,a,this.numConstants);e=i.inputs,r=i.initialState,a=i.constants;var o=[],s=[];if(null!=r){t.initialState=r,o=o.concat(r),this.stateSpec=[];var u,c=Object(d.a)(r);try{for(c.s();!(u=c.n()).done;){var l=u.value;this.stateSpec.push(new mt({shape:l.shape}))}}catch(g){c.e(g)}finally{c.f()}s=s.concat(this.stateSpec)}if(null!=a&&(t.constants=a,o=o.concat(a),this.numConstants=a.length),o[0]instanceof vt){var h=[e].concat(o),f=this.inputSpec.concat(s),m=this.inputSpec;this.inputSpec=f;var v=Object(zt.a)(Object(p.a)(n.prototype),"apply",this).call(this,h,t);return this.inputSpec=m,v}return Object(zt.a)(Object(p.a)(n.prototype),"apply",this).call(this,e,t)}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){var r=null==t?null:t.mask,a=null==t?null:t.training,i=null==t?null:t.initialState;e=ct(e),null==i&&(i=n.stateful?n.states_:n.getInitialState(e));var o=Array.isArray(n.cell.stateSize)?n.cell.stateSize.length:1;if(i.length!==o)throw new w("RNN Layer has ".concat(o," state(s) but was passed ")+"".concat(i.length," initial state(s)."));n.unroll&&console.warn("Ignoring unroll = true for RNN layer, due to imperative backend.");var s={training:a},u=aa((function(e,t){var r=n.cell.call([e].concat(t),s);return[r[0],r.slice(1)]}),e,i,n.goBackwards,r,null,n.unroll,n.returnSequences),c=u[0],l=u[1],h=u[2];n.stateful&&n.resetStates(h,a);var d=n.returnSequences?l:c;return n.returnState?[d].concat(h):d}))}},{key:"getInitialState",value:function(e){var t=this;return Object(a.tidy)((function(){var n=a.zeros(e.shape);return n=be(n=a.sum(n,[1,2])),Array.isArray(t.cell.stateSize)?t.cell.stateSize.map((function(e){return e>1?_e(n,[1,e]):n})):t.cell.stateSize>1?[_e(n,[1,t.cell.stateSize])]:[n]}))}},{key:"setFastWeightInitDuringBuild",value:function(e){Object(zt.a)(Object(p.a)(n.prototype),"setFastWeightInitDuringBuild",this).call(this,e),null!=this.cell&&this.cell.setFastWeightInitDuringBuild(e)}},{key:"getConfig",value:function(){var e={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};null!=this.numConstants&&(e.numConstants=this.numConstants);var t=this.cell.getConfig();e.cell={className:this.cell.getClassName(),config:t};var r=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,r),e}},{key:"states",get:function(){if(null==this.states_){for(var e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1,t=[],n=0;n<e;++n)t.push(null);return t}return this.states_},set:function(e){this.states_=e}}
2,{key:"trainableWeights",get:function(){return this.trainable?this.cell.trainableWeights:[]}},{key:"nonTrainableWeights",get:function(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights}}],[{key:"fromConfig",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.cell,a=Ft(r,n);return new e(Object.assign(t,{cell:a}))}}]),n}(xt);ia.className="RNN",a.serialization.registerClass(ia);var oa=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return n}(xt),sa=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,e)).DEFAULT_ACTIVATION="tanh",r.DEFAULT_KERNEL_INITIALIZER="glorotNormal",r.DEFAULT_RECURRENT_INITIALIZER="orthogonal",r.DEFAULT_BIAS_INITIALIZER="zeros",r.units=e.units,B(r.units,"units"),r.activation=kr(null==e.activation?r.DEFAULT_ACTIVATION:e.activation),r.useBias=null==e.useBias||e.useBias,r.kernelInitializer=nt(e.kernelInitializer||r.DEFAULT_KERNEL_INITIALIZER),r.recurrentInitializer=nt(e.recurrentInitializer||r.DEFAULT_RECURRENT_INITIALIZER),r.biasInitializer=nt(e.biasInitializer||r.DEFAULT_BIAS_INITIALIZER),r.kernelRegularizer=Mr(e.kernelRegularizer),r.recurrentRegularizer=Mr(e.recurrentRegularizer),r.biasRegularizer=Mr(e.biasRegularizer),r.kernelConstraint=J(e.kernelConstraint),r.recurrentConstraint=J(e.recurrentConstraint),r.biasConstraint=J(e.biasConstraint),r.dropout=pe([1,me([0,null==e.dropout?0:e.dropout])]),r.recurrentDropout=pe([1,me([0,null==e.recurrentDropout?0:e.recurrentDropout])]),r.stateSize=r.units,r.dropoutMask=null,r.recurrentDropoutMask=null,r}return Object(o.a)(n,[{key:"build",value:function(e){e=lt(e),this.kernel=this.addWeight("kernel",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){if(2!==(e=e).length)throw new w("SimpleRNNCell expects 2 input Tensors, got ".concat(e.length,"."));var r=e[1];e=e[0];var i,o=null!=t.training&&t.training;0<n.dropout&&n.dropout<1&&null==n.dropoutMask&&(n.dropoutMask=pa({ones:function(){return a.onesLike(e)},rate:n.dropout,training:o})),0<n.recurrentDropout&&n.recurrentDropout<1&&null==n.recurrentDropoutMask&&(n.recurrentDropoutMask=pa({ones:function(){return a.onesLike(r)},rate:n.recurrentDropout,training:o}));var s=n.dropoutMask,u=n.recurrentDropoutMask;i=Ee(null!=s?a.mul(e,s):e,n.kernel.read()),null!=n.bias&&(i=Ae(i,n.bias.read())),null!=u&&(r=a.mul(r,u));var c=a.add(i,Ee(r,n.recurrentKernel.read()));return null!=n.activation&&(c=n.activation.apply(c)),[c,c]}))}},{key:"getConfig",value:function(){var e={units:this.units,activation:wr(this.activation),useBias:this.useBias,kernelInitializer:tt(this.kernelInitializer),recurrentInitializer:tt(this.recurrentInitializer),biasInitializer:tt(this.biasInitializer),kernelRegularizer:Tr(this.kernelRegularizer),recurrentRegularizer:Tr(this.recurrentRegularizer),biasRegularizer:Tr(this.biasRegularizer),activityRegularizer:Tr(this.activityRegularizer),kernelConstraint:K(this.kernelConstraint),recurrentConstraint:K(this.recurrentConstraint),biasConstraint:K(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(oa);sa.className="SimpleRNNCell",a.serialization.registerClass(sa);var ua=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),e.cell=new sa(e),t.call(this,e)}return Object(o.a)(n,[{key:"call",value:function(e,t){var r=this;return Object(a.tidy)((function(){null!=r.cell.dropoutMask&&(a.dispose(r.cell.dropoutMask),r.cell.dropoutMask=null),null!=r.cell.recurrentDropoutMask&&(a.dispose(r.cell.recurrentDropoutMask),r.cell.recurrentDropoutMask=null);var i=null==t?null:t.mask,o=null==t?null:t.training,s=null==t?null:t.initialState;
2return Object(zt.a)(Object(p.a)(n.prototype),"call",r).call(r,e,{mask:i,training:o,initialState:s})}))}},{key:"getConfig",value:function(){var e={units:this.units,activation:wr(this.activation),useBias:this.useBias,kernelInitializer:tt(this.kernelInitializer),recurrentInitializer:tt(this.recurrentInitializer),biasInitializer:tt(this.biasInitializer),kernelRegularizer:Tr(this.kernelRegularizer),recurrentRegularizer:Tr(this.recurrentRegularizer),biasRegularizer:Tr(this.biasRegularizer),activityRegularizer:Tr(this.activityRegularizer),kernelConstraint:K(this.kernelConstraint),recurrentConstraint:K(this.recurrentConstraint),biasConstraint:K(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return delete t.cell,Object.assign(e,t),e}},{key:"units",get:function(){return this.cell.units}},{key:"activation",get:function(){return this.cell.activation}},{key:"useBias",get:function(){return this.cell.useBias}},{key:"kernelInitializer",get:function(){return this.cell.kernelInitializer}},{key:"recurrentInitializer",get:function(){return this.cell.recurrentInitializer}},{key:"biasInitializer",get:function(){return this.cell.biasInitializer}},{key:"kernelRegularizer",get:function(){return this.cell.kernelRegularizer}},{key:"recurrentRegularizer",get:function(){return this.cell.recurrentRegularizer}},{key:"biasRegularizer",get:function(){return this.cell.biasRegularizer}},{key:"kernelConstraint",get:function(){return this.cell.kernelConstraint}},{key:"recurrentConstraint",get:function(){return this.cell.recurrentConstraint}},{key:"biasConstraint",get:function(){return this.cell.biasConstraint}},{key:"dropout",get:function(){return this.cell.dropout}},{key:"recurrentDropout",get:function(){return this.cell.recurrentDropout}}],[{key:"fromConfig",value:function(e,t){return new e(t)}}]),n}(ia);ua.className="SimpleRNN",a.serialization.registerClass(ua);var ca=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;if(Object(i.a)(this,n),(r=t.call(this,e)).DEFAULT_ACTIVATION="tanh",r.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",r.DEFAULT_KERNEL_INITIALIZER="glorotNormal",r.DEFAULT_RECURRENT_INITIALIZER="orthogonal",r.DEFAULT_BIAS_INITIALIZER="zeros",e.resetAfter)throw new w("GRUCell does not support reset_after parameter set to true.");return r.units=e.units,B(r.units,"units"),r.activation=kr(void 0===e.activation?r.DEFAULT_ACTIVATION:e.activation),r.recurrentActivation=kr(void 0===e.recurrentActivation?r.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),r.useBias=null==e.useBias||e.useBias,r.kernelInitializer=nt(e.kernelInitializer||r.DEFAULT_KERNEL_INITIALIZER),r.recurrentInitializer=nt(e.recurrentInitializer||r.DEFAULT_RECURRENT_INITIALIZER),r.biasInitializer=nt(e.biasInitializer||r.DEFAULT_BIAS_INITIALIZER),r.kernelRegularizer=Mr(e.kernelRegularizer),r.recurrentRegularizer=Mr(e.recurrentRegularizer),r.biasRegularizer=Mr(e.biasRegularizer),r.kernelConstraint=J(e.kernelConstraint),r.recurrentConstraint=J(e.recurrentConstraint),r.biasConstraint=J(e.biasConstraint),r.dropout=pe([1,me([0,null==e.dropout?0:e.dropout])]),r.recurrentDropout=pe([1,me([0,null==e.recurrentDropout?0:e.recurrentDropout])]),r.implementation=e.implementation,r.stateSize=r.units,r.dropoutMask=null,r.recurrentDropoutMask=null,r}return Object(o.a)(n,[{key:"build",value:function(e){var t=(e=lt(e))[e.length-1];this.kernel=this.addWeight("kernel",[t,3*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,3*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[3*this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){if(2!==(e=e).length)throw new w("GRUCell expects 2 input Tensors (inputs, h, c), got "+"".concat(e.length,"."));var r=null!=t.training&&t.training,i=e[1];e=e[0],0<n.dropout&&n.dropout<1&&null==n.dropoutMask&&(n.dropoutMask=pa({ones:function(){return a.onesLike(e)},rate:n.dropout,training:r,count:3})),0<n.recurrentDropout&&n.recurrentDropout<1&&null==n.recurrentDropoutMask&&(n.recurrentDropoutMask=pa({ones:function(){return a.onesLike(i)},rate:n.recurrentDropout,training:r,count:3}));var o,s,u,c=n.dropoutMask,l=n.recurrentDropoutMask;0<n.dropout&&n.dropout<1&&(e=a.mul(e,c[0]));
2var d=Ee(e,n.kernel.read());n.useBias&&(d=Ae(d,n.bias.read())),0<n.recurrentDropout&&n.recurrentDropout<1&&(i=a.mul(i,l[0]));var f=n.recurrentKernel.read(),p=a.split(f,[2*n.units,n.units],f.rank-1),m=Object(h.a)(p,2),v=m[0],g=m[1],b=Ee(i,v),y=a.split(d,3,d.rank-1),x=Object(h.a)(y,3),O=x[0],k=x[1],S=x[2],_=a.split(b,2,b.rank-1),j=Object(h.a)(_,2),E=j[0],T=j[1];o=n.recurrentActivation.apply(a.add(O,E)),s=n.recurrentActivation.apply(a.add(k,T));var C=Ee(a.mul(s,i),g);u=n.activation.apply(a.add(S,C));var M=a.add(a.mul(o,i),a.mul(a.add(1,a.neg(o)),u));return[M,M]}))}},{key:"getConfig",value:function(){var e={units:this.units,activation:wr(this.activation),recurrentActivation:wr(this.recurrentActivation),useBias:this.useBias,kernelInitializer:tt(this.kernelInitializer),recurrentInitializer:tt(this.recurrentInitializer),biasInitializer:tt(this.biasInitializer),kernelRegularizer:Tr(this.kernelRegularizer),recurrentRegularizer:Tr(this.recurrentRegularizer),biasRegularizer:Tr(this.biasRegularizer),activityRegularizer:Tr(this.activityRegularizer),kernelConstraint:K(this.kernelConstraint),recurrentConstraint:K(this.recurrentConstraint),biasConstraint:K(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout,implementation:this.implementation,resetAfter:!1},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(oa);ca.className="GRUCell",a.serialization.registerClass(ca);var la=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),0===e.implementation&&console.warn("`implementation=0` has been deprecated, and now defaults to `implementation=1`. Please update your layer call."),e.cell=new ca(e),t.call(this,e)}return Object(o.a)(n,[{key:"call",value:function(e,t){var r=this;return Object(a.tidy)((function(){null!=r.cell.dropoutMask&&(a.dispose(r.cell.dropoutMask),r.cell.dropoutMask=null),null!=r.cell.recurrentDropoutMask&&(a.dispose(r.cell.recurrentDropoutMask),r.cell.recurrentDropoutMask=null);var i=null==t?null:t.mask,o=null==t?null:t.training,s=null==t?null:t.initialState;return Object(zt.a)(Object(p.a)(n.prototype),"call",r).call(r,e,{mask:i,training:o,initialState:s})}))}},{key:"getConfig",value:function(){var e={units:this.units,activation:wr(this.activation),recurrentActivation:wr(this.recurrentActivation),useBias:this.useBias,kernelInitializer:tt(this.kernelInitializer),recurrentInitializer:tt(this.recurrentInitializer),biasInitializer:tt(this.biasInitializer),kernelRegularizer:Tr(this.kernelRegularizer),recurrentRegularizer:Tr(this.recurrentRegularizer),biasRegularizer:Tr(this.biasRegularizer),activityRegularizer:Tr(this.activityRegularizer),kernelConstraint:K(this.kernelConstraint),recurrentConstraint:K(this.recurrentConstraint),biasConstraint:K(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout,implementation:this.implementation,resetAfter:!1},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return delete t.cell,Object.assign(e,t),e}},{key:"units",get:function(){return this.cell.units}},{key:"activation",get:function(){return this.cell.activation}},{key:"recurrentActivation",get:function(){return this.cell.recurrentActivation}},{key:"useBias",get:function(){return this.cell.useBias}},{key:"kernelInitializer",get:function(){return this.cell.kernelInitializer}},{key:"recurrentInitializer",get:function(){return this.cell.recurrentInitializer}},{key:"biasInitializer",get:function(){return this.cell.biasInitializer}},{key:"kernelRegularizer",get:function(){return this.cell.kernelRegularizer}},{key:"recurrentRegularizer",get:function(){return this.cell.recurrentRegularizer}},{key:"biasRegularizer",get:function(){return this.cell.biasRegularizer}},{key:"kernelConstraint",get:function(){return this.cell.kernelConstraint}},{key:"recurrentConstraint",get:function(){return this.cell.recurrentConstraint}},{key:"biasConstraint",get:function(){return this.cell.biasConstraint}},{key:"dropout",get:function(){return this.cell.dropout}},{key:"recurrentDropout",get:function(){return this.cell.recurrentDropout}},{key:"implementation",get:function(){return this.cell.implementation}}],[{key:"fromConfig",value:function(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}]),n}(ia);la.className="GRU",a.serialization.registerClass(la);var ha=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,e)).DEFAULT_ACTIVATION="tanh",r.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",r.DEFAULT_KERNEL_INITIALIZER="glorotNormal",r.DEFAULT_RECURRENT_INITIALIZER="orthogonal",r.DEFAULT_BIAS_INITIALIZER="zeros",r.units=e.units,B(r.units,"units"),r.activation=kr(void 0===e.activation?r.DEFAULT_ACTIVATION:e.activation),r.recurrentActivation=kr(void 0===e.recurrentActivation?r.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),r.useBias=null==e.useBias||e.useBias,r.kernelInitializer=nt(e.kernelInitializer||r.DEFAULT_KERNEL_INITIALIZER),r.recurrentInitializer=nt(e.recurrentInitializer||r.DEFAULT_RECURRENT_INITIALIZER),r.biasInitializer=nt(e.biasInitializer||r.DEFAULT_BIAS_INITIALIZER),r.unitForgetBias=e.unitForgetBias,r.kernelRegularizer=Mr(e.kernelRegularizer),r.recurrentRegularizer=Mr(e.recurrentRegularizer),r.biasRegularizer=Mr(e.biasRegularizer),r.kernelConstraint=J(e.kernelConstraint),r.recurrentConstraint=J(e.recurrentConstraint),r.biasConstraint=J(e.biasConstraint),r.dropout=pe([1,me([0,null==e.dropout?0:e.dropout])]),r.recurrentDropout=pe([1,me([0,null==e.recurrentDropout?0:e.recurrentDropout])]),r.implementation=e.implementation,r.stateSize=[r.units,r.units],r.dropoutMask=null,r.recurrentDropoutMask=null,r}return Object(o.a)(n,[{key:"build",value:function(e){var t,n,r=(e
2=lt(e))[e.length-1];if(this.kernel=this.addWeight("kernel",[r,4*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,4*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){if(this.unitForgetBias){var a=this.biasInitializer,c=this.units;n=new((t=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"apply",value:function(e,t){var n=a.apply([c]),r=(new Fe).apply([c]),i=a.apply([2*c]);return Se(Se(n,r),i)}}]),n}(Pe)).className="CustomInit",t)}else n=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.units],null,n,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){var r=null!=t.training&&t.training;if(3!==(e=e).length)throw new w("LSTMCell expects 3 input Tensors (inputs, h, c), got "+"".concat(e.length,"."));var i=e[1],o=e[2];e=e[0],0<n.dropout&&n.dropout<1&&null==n.dropoutMask&&(n.dropoutMask=pa({ones:function(){return a.onesLike(e)},rate:n.dropout,training:r,count:4})),0<n.recurrentDropout&&n.recurrentDropout<1&&null==n.recurrentDropoutMask&&(n.recurrentDropoutMask=pa({ones:function(){return a.onesLike(i)},rate:n.recurrentDropout,training:r,count:4}));var s,u,c,l,d=n.dropoutMask,f=n.recurrentDropoutMask;0<n.dropout&&n.dropout<1&&(e=a.mul(e,d[0]));var p=Ee(e,n.kernel.read());0<n.recurrentDropout&&n.recurrentDropout<1&&(i=a.mul(i,f[0])),p=a.add(p,Ee(i,n.recurrentKernel.read())),n.useBias&&(p=Ae(p,n.bias.read()));var m=a.split(p,4,p.rank-1),v=Object(h.a)(m,4),g=v[0],b=v[1],y=v[2],x=v[3];s=n.recurrentActivation.apply(g),u=n.recurrentActivation.apply(b),c=a.add(a.mul(u,o),a.mul(s,n.activation.apply(y))),l=n.recurrentActivation.apply(x);var O=a.mul(l,n.activation.apply(c));return[O,O,c]}))}},{key:"getConfig",value:function(){var e={units:this.units,activation:wr(this.activation),recurrentActivation:wr(this.recurrentActivation),useBias:this.useBias,kernelInitializer:tt(this.kernelInitializer),recurrentInitializer:tt(this.recurrentInitializer),biasInitializer:tt(this.biasInitializer),unitForgetBias:this.unitForgetBias,kernelRegularizer:Tr(this.kernelRegularizer),recurrentRegularizer:Tr(this.recurrentRegularizer),biasRegularizer:Tr(this.biasRegularizer),activityRegularizer:Tr(this.activityRegularizer),kernelConstraint:K(this.kernelConstraint),recurrentConstraint:K(this.recurrentConstraint),biasConstraint:K(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout,implementation:this.implementation},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(oa);ha.className="LSTMCell",a.serialization.registerClass(ha);var da=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),0===e.implementation&&console.warn("`implementation=0` has been deprecated, and now defaults to `implementation=1`. Please update your layer call."),e.cell=new ha(e),t.call(this,e)}return Object(o.a)(n,[{key:"call",value:function(e,t){var r=this;return Object(a.tidy)((function(){null!=r.cell.dropoutMask&&(a.dispose(r.cell.dropoutMask),r.cell.dropoutMask=null),null!=r.cell.recurrentDropoutMask&&(a.dispose(r.cell.recurrentDropoutMask),r.cell.recurrentDropoutMask=null);var i=null==t?null:t.mask,o=null==t?null:t.training,s=null==t?null:t.initialState;return Object(zt.a)(Object(p.a)(n.prototype),"call",r).call(r,e,{mask:i,training:o,initialState:s})}))}},{key:"getConfig",value:function(){var e={units:this.units,activation:wr(this.activation),recurrentActivation:wr(this.recurrentActivation),useBias:this.useBias,kernelInitializer:tt(this.kernelInitializer),recurrentInitializer:tt(this.recurrentInitializer),biasInitializer:tt(this.biasInitializer),unitForgetBias:this.unitForgetBias,kernelRegularizer:Tr(this.kernelRegularizer),recurrentRegularizer:Tr(this.recurrentRegularizer),biasRegularizer:Tr(this.biasRegularizer),activityRegularizer:Tr(this.activityRegularizer),kernelConstraint:K(this.kernelConstraint),recurrentConstraint:K(this.recurrentConstraint),biasConstraint:K(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout,implementation:this.implementation},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return delete t.cell,Object.assign(e,t),e}},{key:"units",get:function(){return this.cell.units}},{key:"activation",get:function(){return this.cell.activation}},{key:"recurrentActivation",get:function(){return this.cell.recurrentActivation}},{key:"useBias",get:function(){return this.cell.useBias}},{key:"kernelInitializer",get:function(){return this.cell.kernelInitializer}},{key:"recurrentInitializer",get:function(){return this.cell.recurrentInitializer}},{key:"biasInitializer",get:function(){return this.cell.biasInitializer}},{key:"unitForgetBias",get:function(){return this.cell.unitForgetBias}},{key:"kernelRegularizer",get:function(){return this.cell.kernelRegularizer}},{key:"recurrentRegularizer",get:function(){return this.cell.recurrentRegularizer}},{key:"biasRegularizer",get:function(){return this.cell.biasRegularizer}},{key:"kernelConstraint",get:function(){return this.cell.kernelConstraint}},{key:"recurrentConstraint",get:function(){return this.cell.recurrentConstraint}},{key:"biasConstraint",get:function(){return this.cell.biasConstraint}},{key:"dropout",get:function(){return this.cell.dropout}},{key:"recurrentDropout",get:function(){return this.cell.recurrentDropout}},{key:"implementation",get:function(){return this.cell.implementation}}],[{key:"fromConfig",value:function(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}]),n}(ia);da.className="LSTM",a.serialization.registerClass(da);var fa=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,e)).cells=e.cells,r}return Object(o.a)(n,[{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){var r,a=(e=e).slice(1),i=[],o=Object(d.a)(n.cells.slice().reverse());try{for(o.s();!(r=o.n()).done;){var s=r.value;Array.isArray(s.stateSize)?i.push(a.splice(0,s.stateSize.length)):i.push(a.splice(0,1))}}catch(b){o.e(b)}finally{o.f()}i.reverse();for(var u,c=[],h=0;h<n.cells.length;++h){var f=n.cells[h];a=i[h],u=0===h?[e[0]].concat(a):[u[0]].concat(a),u=f.call(u,t),c.push(u.slice(1))}a=[];var p,m=Object(d.a)(c.slice().reverse());try{for(m.s();!(p=m.n()).done;){var v,g=p.value;(v=a).push.apply(v,Object(l.a)(g))}}
2catch(b){m.e(b)}finally{m.f()}return[u[0]].concat(a)}))}},{key:"build",value:function(e){var t;st(e)&&(e=e[0]),e=e,this.cells.forEach((function(n,r){se("RNNCell_".concat(r),(function(){n.build(e),t=Array.isArray(n.stateSize)?n.stateSize[0]:n.stateSize,e=[e[0],t]}))})),this.built=!0}},{key:"getConfig",value:function(){var e,t=[],r=Object(d.a)(this.cells);try{for(r.s();!(e=r.n()).done;){var a=e.value;t.push({className:a.getClassName(),config:a.getConfig()})}}catch(s){r.e(s)}finally{r.f()}var i={cells:t},o=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(i,o),i}},{key:"getWeights",value:function(){var e,t=[],n=Object(d.a)(this.cells);try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push.apply(t,Object(l.a)(r.weights))}}catch(a){n.e(a)}finally{n.f()}return ft(t)}},{key:"setWeights",value:function(e){var t,n=[],r=Object(d.a)(this.cells);try{for(r.s();!(t=r.n()).done;)for(var a=t.value,i=a.weights.length,o=e.splice(i),s=0;s<a.weights.length;++s)n.push([a.weights[s],o[s]])}catch(u){r.e(u)}finally{r.f()}pt(n)}},{key:"stateSize",get:function(){var e,t=[],n=Object(d.a)(this.cells.slice().reverse());try{for(n.s();!(e=n.n()).done;){var r=e.value;Array.isArray(r.stateSize)?t.push.apply(t,Object(l.a)(r.stateSize)):t.push(r.stateSize)}}catch(a){n.e(a)}finally{n.f()}return t}},{key:"trainableWeights",get:function(){if(!this.trainable)return[];var e,t=[],n=Object(d.a)(this.cells);try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push.apply(t,Object(l.a)(r.trainableWeights))}}catch(a){n.e(a)}finally{n.f()}return t}},{key:"nonTrainableWeights",get:function(){var e,t=[],n=Object(d.a)(this.cells);try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push.apply(t,Object(l.a)(r.nonTrainableWeights))}}catch(u){n.e(u)}finally{n.f()}if(!this.trainable){var a,i=[],o=Object(d.a)(this.cells);try{for(o.s();!(a=o.n()).done;){var s=a.value;i.push.apply(i,Object(l.a)(s.trainableWeights))}}catch(u){o.e(u)}finally{o.f()}return i.concat(t)}return t}}],[{key:"fromConfig",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=[],i=Object(d.a)(t.cells);try{for(i.s();!(n=i.n()).done;){var o=n.value;a.push(Ft(o,r))}}catch(s){i.e(s)}finally{i.f()}return new e({cells:a})}}]),n}(oa);function pa(e){var t=e.ones,n=e.rate,r=e.training,i=void 0!==r&&r,o=e.count,s=void 0===o?1:o,u=function(){return Re(t(),n)},c=function(){return Ie(u,t,i)};return!s||s<=1?a.keep(c().clone()):Array(s).fill(void 0).map(c).map((function(e){return a.keep(e.clone())}))}fa.className="StackedRNNCells",a.serialization.registerClass(fa);var ma=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n},va=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;if(Object(i.a)(this,n),e.unroll)throw new O("Unrolling is not possible with convolutional RNNs.");if(Array.isArray(e.cell))throw new O("It is not possible at the moment to stack convolutional cells.");return(r=t.call(this,e)).inputSpec=[new mt({ndim:5})],r}return Object(o.a)(n,[{key:"call",value:function(e,t){var r=this;return a.tidy((function(){if(null!=r.cell.dropoutMask&&(a.dispose(r.cell.dropoutMask),r.cell.dropoutMask=null),null!=r.cell.recurrentDropoutMask&&(a.dispose(r.cell.recurrentDropoutMask),r.cell.recurrentDropoutMask=null),t&&t.constants)throw new w("ConvRNN2D cell does not support constants");var i=null==t?null:t.mask,o=null==t?null:t.training,s=null==t?null:t.initialState;return Object(zt.a)(Object(p.a)(n.prototype),"call",r).call(r,e,{mask:i,training:o,initialState:s})}))}},{key:"computeOutputShape",value:function(e){var t=this.computeSingleOutputShape(e);return this.returnSequences||(t=[t[0]].concat(Object(l.a)(t.slice(2)))),this.returnState&&(t=[t].concat(Object(l.a)(Array(2).fill([e[0]].concat(Object(l.a)(t.slice(-3))))))),t}},{key:"getInitialState",value:function(e){var t=this;return a.tidy((function(){var n=t.cell.stateSize,r=e.shape,i=t.computeSingleOutputShape(r),o=[i[0]].concat(Object(l.a)(i.slice(2))),s=a.zeros(o);return Array.isArray(n)?Array(n.length).fill(s):[s]}))}},{key:"resetStates",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a.tidy((function(){if(!t.stateful)throw new y("Cannot call resetStates() on an RNN Layer that is not stateful.");var r=t.inputSpec[0].shape,i=t.computeSingleOutputShape(r),o=[i[0]].concat(Object(l.a)(i.slice(2)));if(null==r[0])throw new w("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(null==t.getStates())Array.isArray(t.cell.stateSize)?t.states_=t.cell.stateSize.map((function(){return a.zeros(o)})):t.states_=[a.zeros(o)];else if(null==e)a.dispose(t.states_),null!=t.keptStates&&(a.dispose(t.keptStates),t.keptStates=[]),Array.isArray(t.cell.stateSize)?t.states_=t.cell.stateSize.map((function(){return a.zeros(o)})):t.states_[0]=a.zeros(o);else{if(Array.isArray(e)||(e=[e]),e.length!==t.states_.length)throw new w("Layer ".concat(t.name," expects ").concat(t.states_.length," state(s), ")+"but it received ".concat(e.length," state value(s). Input ")+"received: ".concat(e));n?t.keptStates.push(t.states_.slice()):a.dispose(t.states_);for(var s=0;s<t.states_.length;++s){var u=e[s],c=o;if(!a.util.arraysEqual(u.shape,c))throw new w("State ".concat(s," is incompatible with layer ").concat(t.name,": ")+"expected shape=".concat(c,", received shape=").concat(u.shape));t.states_[s]=u}}t.states_=t.states_.map((function(e){return a.keep(e.clone())}))}))}},{key:"getConfig",value:function(){var e=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this),t=(e.cell,ma(e,["cell"])),r=this.cell.getConfig();return Object.assign({},r,t)}},{key:"computeSingleOutputShape",value:function(e){var t=this.cell,n=t.dataFormat,r=t.filters,a=t.kernelSize,i=t.padding,o=t.strides,s=t.dilationRate,u="channelsFirst"===n,c=e[u?3:2],h=e[u?4:3],d=Fr(c,a[0],i,o[0],s[0]),f=Fr(h,a[1],i,o[1],s[1]);return[].concat(Object(l.a)(e.slice(0,2)),Object(l.a)(u?[r,d,f]:[d,f,r]))}}]),n}(ia);va.className="ConvRNN2D";var ga=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;Object(i.a)(this,n);var a=e.filters,o=e.kernelSize,s=e.strides,u=e.padding,c=e.dataFormat,l=e.dilationRate;return(r=t.call(this,Object.assign({},e,{units:a}))).filters=a,B(r.filters,"filters"),r.kernelSize=zr(o,2,"kernelSize"),r.kernelSize.map((function(e){return B(e,"kernelSize")})),r.strides=zr(s||1,2,"strides"),r.strides.map((function(e){return B(e,"strides")})),r.padding=u||"valid",ae(r.padding),r.dataFormat=c||"channelsLast",re(r.dataFormat),r.dilationRate=zr(l||1,2,"dilationRate"),r.dilationRate.map((function(e){return B(e,"dilationRate")})),r}return Object(o.a)(n,[{key:"build",value:function(e){var t;e=lt(e);var n="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[n])throw new w("The channel dimension of the input should be defined. "+"Found ".concat(e[n]));var r=e[n],c=this.kernelSize.concat([r,4*this.filters]);this.kernel=this.addWeight("kernel",c,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);var l=this.kernelSize.concat([this.filters,4*this.filters]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",l,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){var h;if(this.unitForgetBias){var d=this.biasInitializer,f=this.filters;h=new((t=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"apply",value:function(e,t){return ke([d.apply([f]),a.ones([f]),d.apply([2*f])])}}]),n}(Pe)).className="CustomInit",t)}else h=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.filters],null,h,this.biasRegularizer,!0,this.biasConstraint)}this.built=!0}},{key:"call",value:function(e,t){var n=this;return a.tidy((function(){if(3!==e.length)throw new w("ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got "+"".concat(e.length,"."));var r=t.training||!1,i=e[0],o=e[1],s=e[2];0<n.dropout&&n.dropout<1&&null==n.dropoutMask&&(n.dropoutMask=pa({ones:function(){return a.onesLike(i)},rate:n.dropout,training:r,count:4}));var u=n.dropoutMask,c=function(e,t,n){return t&&t[n]?a.mul(t[n],e):e},l=c(i,u,0),d=c(i,u,1),f=c(i,u,2),p=c(i,u,3);0<n.recurrentDropout&&n.recurrentDropout<1&&null==n.recurrentDropoutMask&&(n.recurrentDropoutMask=pa({ones:function(){return a.onesLike(o)},rate:n.recurrentDropout,training:r,count:4}));var m=n.recurrentDropoutMask,v=c(o,m,0),g=c(o,m,1),b=c(o,m,2),y=c(o,m,3),x=a.split(n.kernel.read(),4,3),O=Object(h.a)(x,4),k=O[0],S=O[1],_=O[2],j=O[3],E=n.useBias?a.split(n.bias.read(),4):[null,null,null,null],T=Object(h.a)(E,4),C=T[0],M=T[1],A=T[2],N=T[3];l=n.inputConv(l,k,C,n.padding),d=n.inputConv(d,S,M,n.padding),f=n.inputConv(f,_,A,n.padding),p=n.inputConv(p,j,N,n.padding);var R=a.split(n.recurrentKernel.read(),4,3),I=Object(h.a)(R,4),L=I[0],D=I[1],P=I[2],z=I[3];v=n.recurrentConv(v,L),g=n.recurrentConv(g,D),b=n.recurrentConv(b,P),y=n.recurrentConv(y,z);var F=n.recurrentActivation.apply(a.add(l,v)),B=n.recurrentActivation.apply(a.add(d,g)),U=a.add(a.mul(B,s),a.mul(F,n.activation.apply(a.add(f,b)))),W=a.mul(n.recurrentActivation.apply(a.add(p,y)),n.activation.apply(U));return[W,W,U]}))}},{key:"getConfig",value:function(){var e=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this),t=(e.units,ma(e,["units"])),r={filters:this.filters,kernelSize:this.kernelSize,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate};return Object.assign({},t,r)}},{key:"inputConv",value:function(e,t,n,r){var i=a.conv2d(e,t,this.strides,r||"valid","channelsFirst"===this.dataFormat?"NCHW":"NHWC",this.dilationRate);return n?Ae(i,n,this.dataFormat):i}},{key:"recurrentConv",value:function(e,t){return a.conv2d(e,t,1,"same","channelsFirst"===this.dataFormat?"NCHW":"NHWC")}}]),n}(ha);ga.className="ConvLSTM2DCell",a.serialization.registerClass(ga);var ba=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){Object(i.a)(this,n);var r=new ga(e);return t.call(this,Object.assign({},e,{cell:r}))}return Object(o.a)(n,null,[{key:"fromConfig",value:function(e,t){return new e(t)}}]),n}(va);ba.className="ConvLSTM2D",a.serialization.registerClass(ba);var ya=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,e)).rate=Math.max(Math.min(e.rate,1),0),r.noiseShape=e.noiseShape,r.seed=e.seed,r.supportsMasking=!0,r}return Object(o.a)(n,[{key:"getNoiseShape",value:function(e){if(null==this.noiseShape)return this.noiseShape;for(var t=e.shape,n=[],r=0;r<this.noiseShape.length;++r)n.push(null==this.noiseShape[r]?t[r]:this.noiseShape[r]);return n}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){n.invokeCallHook(e,t);var r=ct(e);if(0<n.rate&&n.rate<1){var a=null!=t.training&&t.training,i=n.getNoiseShape(r);return Ie((function(){return Re(r,n.rate,i,n.seed)}),(function(){return r}),a)}return e}))}},{key:"getConfig",value:function(){var e={rate:this.rate,noiseShape:this.noiseShape,seed:this.seed},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}},{key:"dispose",value:function(){return Object(zt.a)(Object(p.a)(n.prototype),"dis
2pose",this).call(this)}}]),n}(xt);ya.className="Dropout",a.serialization.registerClass(ya);var xa=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,e)).inputSpec=[{ndim:3}],r}return Object(o.a)(n,[{key:"getNoiseShape",value:function(e){var t=e.shape;return[t[0],1,t[2]]}}]),n}(ya);xa.className="SpatialDropout1D",a.serialization.registerClass(xa);var wa=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;if(Object(i.a)(this,n),(r=t.call(this,e)).activation=null,r.useBias=!0,r.kernel=null,r.bias=null,r.DEFAULT_KERNEL_INITIALIZER="glorotNormal",r.DEFAULT_BIAS_INITIALIZER="zeros",null==e.batchInputShape&&null==e.inputShape&&null!=e.inputDim){var a=null;null!=e.batchSize&&(a=e.batchSize),r.batchInputShape=[a,e.inputDim]}return r.units=e.units,B(r.units,"units"),r.activation=kr(e.activation),null!=e.useBias&&(r.useBias=e.useBias),r.kernelInitializer=nt(e.kernelInitializer||r.DEFAULT_KERNEL_INITIALIZER),r.biasInitializer=nt(e.biasInitializer||r.DEFAULT_BIAS_INITIALIZER),r.kernelConstraint=J(e.kernelConstraint),r.biasConstraint=J(e.biasConstraint),r.kernelRegularizer=Mr(e.kernelRegularizer),r.biasRegularizer=Mr(e.biasRegularizer),r.activityRegularizer=Mr(e.activityRegularizer),r.supportsMasking=!0,r.inputSpec=[{minNDim:2}],r}return Object(o.a)(n,[{key:"build",value:function(e){var t=(e=lt(e))[e.length-1];null==this.kernel&&(this.kernel=this.addWeight("kernel",[t,this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint))),this.inputSpec=[{minNDim:2,axes:Object(Pr.a)({},-1,t)}],this.built=!0}},{key:"computeOutputShape",value:function(e){var t=(e=lt(e)).slice();return t[t.length-1]=this.units,t}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){n.invokeCallHook(e,t);var r,a=ct(e),i=U(n.activation.getClassName());return null!=i?r=Ee(a,n.kernel.read(),i,n.bias?n.bias.read():null):(r=Ee(a,n.kernel.read()),null!=n.bias&&(r=Ae(r,n.bias.read())),null!=n.activation&&(r=n.activation.apply(r))),r}))}},{key:"getConfig",value:function(){var e={units:this.units,activation:wr(this.activation),useBias:this.useBias,kernelInitializer:tt(this.kernelInitializer),biasInitializer:tt(this.biasInitializer),kernelRegularizer:Tr(this.kernelRegularizer),biasRegularizer:Tr(this.biasRegularizer),activityRegularizer:Tr(this.activityRegularizer),kernelConstraint:K(this.kernelConstraint),biasConstraint:K(this.biasConstraint)},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt);wa.className="Dense",a.serialization.registerClass(wa);var Oa=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),e=e||{},(r=t.call(this,e)).inputSpec=[{minNDim:3}],r.dataFormat=e.dataFormat,r}return Object(o.a)(n,[{key:"computeOutputShape",value:function(e){e=lt(e);var t,n=Object(d.a)(e.slice(1));try{for(n.s();!(t=n.n()).done;){if(null==t.value)throw new w('The shape of the input to "Flatten" is not fully defined '+"(got ".concat(e.slice(1),"). Make sure to pass a complete ")+'"input_shape" or "batch_input_shape" argument to the first layer in your model.')}}catch(r){n.e(r)}finally{n.f()}return[e[0],de(e,1)]}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){n.invokeCallHook(e,t);var r=ct(e);if("channelsFirst"===n.dataFormat&&r.rank>1){for(var a=[0],i=2;i<r.rank;++i)a.push(i);a.push(1),r=r.transpose(a)}return function(e){if(e.rank<=1)throw new w("batchFlatten requires a minimum rank of 2. Got rank: ".concat(e.rank,"."));var t=[e.shape[0],de(e.shape,1)];return e.reshape(t)}(r)}))}},{key:"getConfig",value:function(){var e={};null!=this.dataFormat&&(e.dataFormat=this.dataFormat);var t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt);Oa.className="Flatten",a.serialization.registerClass(Oa);var ka=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,e)).supportsMasking=!0,r.activation=kr(e.activation),r}return Object(o.a)(n,[{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){n.invokeCallHook(e,t);var r=ct(e);return n.activation.apply(r)}))}},{key:"getConfig",value:function(){var e={activation:wr(this.activation)},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt);ka.className="Activation",a.serialization.registerClass(ka);var Sa=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,e)).n=e.n,r.inputSpec=[{ndim:2}],r}
2return Object(o.a)(n,[{key:"computeOutputShape",value:function(e){return[e[0],this.n,e[1]]}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){return e=ct(e),t=e,r=n.n,Object(a.tidy)((function(){if(2!==t.shape.length)throw new w("repeat() expects a rank-2 tensor, but received a "+"rank-".concat(t.shape.length," tensor."));return _e(be(t,1),[1,r,1])}));var t,r}))}},{key:"getConfig",value:function(){var e={n:this.n},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt);Sa.className="RepeatVector",a.serialization.registerClass(Sa);var _a=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;Object(i.a)(this,n),(r=t.call(this,e)).targetShape=e.targetShape;for(var a=0;a<r.targetShape.length;++a)r.isUnknown(r.targetShape[a])&&(r.targetShape[a]=null);return r}return Object(o.a)(n,[{key:"isUnknown",value:function(e){return e<0||null==e}},{key:"fixUnknownDimension",value:function(e,t){for(var n="Total size of new array must be unchanged.",r=t.slice(),a=1,i=null,o=0;o<r.length;++o){var s=r[o];if(this.isUnknown(s)){if(null!==i)throw new w("Can only specifiy one unknown dimension.");i=o}else a*=s}var u=de(e);if(null!==i){if(0===a||u%a!==0)throw new w(n);r[i]=u/a}else if(u!==a)throw new w(n);return r}},{key:"computeOutputShape",value:function(e){for(var t=!1,n=0;n<e.length;++n)if(this.isUnknown(e[n])){t=!0;break}return t?e.slice(0,1).concat(this.targetShape):e.slice(0,1).concat(this.fixUnknownDimension(e.slice(1),this.targetShape))}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){n.invokeCallHook(e,t);var r=ct(e),a=r.shape,i=a.slice(0,1).concat(n.fixUnknownDimension(a.slice(1),n.targetShape));return r.reshape(i)}))}},{key:"getConfig",value:function(){var e={targetShape:this.targetShape},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt);_a.className="Reshape",a.serialization.registerClass(_a);var ja=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;if(Object(i.a)(this,n),r=t.call(this,e),null==e.dims)throw new Error("Required configuration field `dims` is missing during Permute constructor call.");if(!Array.isArray(e.dims))throw new Error("Permute constructor requires `dims` to be an Array, but received "+"".concat(e.dims," instead."));var o=ve(1,e.dims.length+1);if(!a.util.arraysEqual(e.dims.slice().sort(),o))throw new Error("Invalid permutation `dims`: "+JSON.stringify(e.dims)+" `dims` must contain consecutive integers starting from 1.");return r.dims=e.dims,r.dimsIncludingBatch=[0].concat(r.dims),r.inputSpec=[new mt({ndim:r.dims.length+1})],r}return Object(o.a)(n,[{key:"computeOutputShape",value:function(e){var t=(e=lt(e)).slice();return this.dims.forEach((function(n,r){t[r+1]=e[n]})),t}},{key:"call",value:function(e,t){return Object(a.transpose)(ct(e),this.dimsIncludingBatch)}},{key:"getConfig",value:function(){var e={dims:this.dims},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt);ja.className="Permute",a.serialization.registerClass(ja);var Ea=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,null==e?{}:e)).supportsMasking=!0,r.maskValue=null!=e?null==e.maskValue?0:e.maskValue:0,r}return Object(o.a)(n,[{key:"computeOutputShape",value:function(e){return e}},{key:"getConfig",value:function(){var e=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this),t={maskValue:this.maskValue};return Object.assign(t,e),t}},{key:"computeMask",value:function(e,t){var n=ct(e);return Object(a.any)(Object(a.notEqual)(n,this.maskValue),-1)}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){n.invokeCallHook(e,t);var r=ct(e),i=Object(a.any)(Object(a.notEqual)(r,n.maskValue),-1,!0);return r.mul(i.asType(r.dtype))}))}}]),n}(xt);Ea.className="Masking",a.serialization.registerClass(Ea);var Ta=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;if(Object(i.a)(this,n),(r=t.call(this,e)).embeddings=null,r.DEFAULT_EMBEDDINGS_INITIALIZER="randomUniform",null==e.batchInputShape&&null==e.inputShape){var a=null;null!=e.batchSize&&(a=e.batchSize),null==e.inputLength?r.batchInputShape=[a,null]:r.batchInputShape=[a].concat(T(e.inputLength))}return r.inputDim=e.inputDim,B(r.inputDim,"inputDim"),r.outputDim=e.outputDim,B(r.outputDim,"outputDim"),r.embeddingsInitializer=nt(e.embeddingsInitializer||r.DEFAULT_EMBEDDINGS_INITIALIZER),r.embeddingsRegularizer=Mr(e.embeddingsRegularizer),r.activityRegularizer=Mr(e.activityRegularizer),r.embeddingsConstraint=J(e.embeddingsConstraint),r.maskZero=e.maskZero,r.supportsMasking=e.maskZero,r.inputLength=e.inputLength,r}return Object(o.a)(n,[{key:"build",value:function(e){this.embeddings=this.addWeight("embeddings",[this.inputDim,this.outputDim],this.dtype,this.embeddingsInitializer,this.embeddingsRegularizer,!0,this.embeddingsConstraint),this.built=!0}},{key:"warnOnIncompatibleInputShape",value:function(e){}},{key:"computeMask",value:function(e,t){var n=this;return Object(a.tidy)((function(){return n.maskZero?(e=ct(e),Object(a.notEqual)(e,Object(a.zerosLike)(e))):null}))}},{key:"computeOutputShape",value:function(e){if(e=lt(e),null==this.inputLength)return[].concat(Object(l.a)(e),[this.outputDim]);var t=T(this.inputLength);if(t.length!==e.length-1)throw new w('"inputLength" is '.concat(this.inputLength,", but received ")+"input shape has shape ".concat(e));for(var n=0,r=0;r<t.length;++r){var a=t[r],i=e[r+1];if(null!=a&&null!=i&&a!==i)throw new w('"inputLength" is '.concat(this.inputLength,", but received ")+"input shape has shape ".concat(e));null==a&&(t[n]=i),n++}return[e[0]].concat(Object(l.a)(t),[this.outputDim])}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){n.invokeCallHook(e,t);var r=ct(e);return"int32"!==r.dtype&&(r=ge(r,"int32")),Te(n.embeddings.read(),r.as1D()).reshape(lt(n.computeOutputShape(r.shape)))}))}},{key:"getConfig",value:function(){var e={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:tt(this.embeddingsInitializer),embeddingsRegularizer:Tr(this.embeddingsRegularizer),activityRegularizer:Tr(this.activityRegularizer),embeddingsConstraint:K(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt);Ta.className="Embedding",a.serialization.registerClass(Ta);
2var Ca=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,e||{})).supportsMasking=!0,r}return Object(o.a)(n,[{key:"mergeFunction",value:function(e){throw new O}},{key:"computeElementwiseOpOutputShape",value:function(e,t){if(null==e||null==t)return null;if(e.length<t.length)return this.computeElementwiseOpOutputShape(t,e);if(0===t.length)return e;for(var n=e.slice(0,e.length-t.length),r=0;r<t.length;++r){var a=e[e.length-t.length+r],i=t[r];if(null==a||null==i||a<0||i<0)n.push(null);else if(1===a)n.push(i);else if(1===i)n.push(a);else{if(a!==i)throw new w("Operands could not be broadcast together with shapes "+JSON.stringify(e)+" "+JSON.stringify(t));n.push(a)}}return n}},{key:"build",value:function(e){if(Array.isArray(e)&&!Array.isArray(e[0])&&(e=[lt(e)]),(e=e).length<2)throw new w("A merge layer should be called on an Array of at least 2 inputs."+" Got ".concat(e.length," input(s)."));var t,n=[],r=Object(d.a)(e);try{for(r.s();!(t=r.n()).done;){var a=t.value;null!=a&&null!==a[0]&&n.push(a[0])}}catch(c){r.e(c)}finally{r.f()}if((n=D(n)).length>1)throw new w("Can not merge tensors with different batch sizes. "+"Got tensors with shapes: ".concat(JSON.stringify(e),"."));for(var i=null==e[0]?null:e[0].slice(1),o=1;o<e.length;++o){var s=null==e[o]?null:e[o].slice(1);i=this.computeElementwiseOpOutputShape(i,s)}var u=e.map((function(e){return e.length}));-1===e.indexOf(null)&&1===D(u).length?this.reshapeRequired=!1:this.reshapeRequired=!0}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){if(e=e,n.reshapeRequired){var t=[],r=e.map((function(e){return e.rank}));if(-1===r.indexOf(null)){var i,o=me(r),s=Object(d.a)(e);try{for(s.s();!(i=s.n()).done;){for(var u=i.value,c=u.rank,l=0;l<o-c;++l)u=be(u,1);t.push(u)}}catch(T){s.e(T)}finally{s.f()}return n.mergeFunction(t)}var h,f=!1,p=Object(d.a)(e);try{for(p.s();!(h=p.n()).done;){var m=h.value,v=m.rank;if(null==v){var g=m.shape,b=g[0],y=g.slice(1).concat([b]),x=m.reshape([b].concat(de(g.slice(1))));x=(x=a.transpose(x,[1,0])).reshape(y),t.push(x),f=!0}else if(v>1){var w=ve(1,v).concat([0]);t.push(a.transpose(m,w)),f=!0}else t.push(m)}}catch(T){p.e(T)}finally{p.f()}var O=n.mergeFunction(t),k=O.rank;if(f)if(null==k){var S=O.shape,_=S[S.length-1],j=[_].concat(S.slice(0,S.length-1));O=a.transpose(O.reshape([-1,_]),[1,0]).reshape(j)}else if(k>1){var E=[k-1].concat(ve(0,k-1));O=a.transpose(O,E)}return O}return n.mergeFunction(e)}))}},{key:"computeOutputShape",value:function(e){var t;t=null==(e=e)[0]?null:e[0].slice(1);for(var n=1;n<e.length;++n){var r=null==e[n]?null:e[n].slice(1);t=this.computeElementwiseOpOutputShape(t,r)}var a,i=[],o=Object(d.a)(e);try{for(o.s();!(a=o.n()).done;){var s=a.value;null!=s&&null!==s[0]&&i.push(s[0])}}catch(u){o.e(u)}finally{o.f()}return t=1===(i=D(i)).length?i.concat(t):[null].concat(t)}},{key:"computeMask",value:function(e,t){return a.tidy((function(){if(null==t)return null;if(!Array.isArray(t))throw new w("`mask` should be an Array");if(!Array.isArray(e))throw new w("`inputs` should be an Array");if(t.length!==e.length)throw new w("The Array 'inputs' and 'mask' are expected to have the same length, but have different lengths "+"(".concat(e.length," vs ").concat(t.length,")"));if(t.every((function(e){return null==e})))return null;for(var n=(t=t.map((function(e){return null==e?e:a.expandDims(e,0)})))[0],r=1;r<t.length-1;++r)n=a.logicalAnd(n,t[r]);return n}))}}]),n}(xt),Ma=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,e)}return Object(o.a)(n,[{key:"mergeFunction",value:function(e){return Object(a.tidy)((function(){for(var t=e[0].clone(),n=1;n<e.length;++n)t=a.add(t,e[n]);return t}))}}]),n}(Ca);Ma.className="Add",a.serialization.registerClass(Ma);var Aa=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,e)}return Object(o.a)(n,[{key:"mergeFunction",value:function(e){return Object(a.tidy)((function(){for(var t=e[0].clone(),n=1;n<e.length;++n)t=a.mul(t,e[n]);return t}))}}]),n}(Ca);Aa.className="Multiply",a.serialization.registerClass(Aa);var Na=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,e)}return Object(o.a)(n,[{key:"mergeFunction",value:function(e){return Object(a.tidy)((function(){for(var t=e[0].clone(),n=1;n<e.length;++n)t=a.add(t,e[n]);return a.mul(1/e.length,t)}))}}]),n}(Ca);Na.className="Average",a.serialization.registerClass(Na);var Ra=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,e)}return Object(o.a)(n,[{key:"mergeFunction",value:function(e){return Object(a.tidy)((function(){for(var t=e[0],n=1;n<e.length;++n)t=a.maximum(t,e[n]);return t}))}}]),n}(Ca);Ra.className="Maximum",a.serialization.registerClass(Ra);var Ia=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,e)}return Object(o.a)(n,[{key:"mergeFunction",value:function(e){return Object(a.tidy)((function(){for(var t=e[0],n=1;n<e.length;++n)t=a.minimum(t,e[n]);return t}))}}]),n}(Ca);Ia.className="Minimum",a.serialization.registerClass(Ia);var La=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,e)).DEFAULT_AXIS=-1,null==e&&(e={}),r.axis=null==e.axis?r.DEFAULT_AXIS:e.axis,r.supportsMasking=!0,r.reshapeRequired=!1,r}return Object(o.a)(n,[{key:"build",value:function(e){if(!Array.isArray(e)||!Array.isArray(e[0])||1===e.length)throw new w("A `Concatenate` layer should be called on a list of at least 2 inputs");e=e;var t,n=!0,r=Object(d.a)(e);try{for(r.s();!(t=r.n()).done;){if(null!=t.value){n=!1;break}}}catch(f){r.e(f)}finally{r.f()}if(!n){for(var i=[],o=0;o<e.length;++o){var s=e[o].slice();s.splice(this.axis,1);var u,c=!1,l=Object(d.a)(i);try{for(l.s();!(u=l.n()).done;){var h=u.value;if(a.util.arraysEqual(h,s)){c=!0;break}}}catch(f){l.e(f)}finally{l.f()}c||i.push(s)}if(i.length>1)throw new w("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}}},{key:"mergeFunction",value:function(e){var t=this;return Object(a.tidy)((function(){return ke(e,t.axis)}))}},{key:"computeOutputShape",value:function(e){if(!Array.isArray(e)||!Array.isArray(e[0]))throw new w("A `Concatenate` layer should be called on a list of inputs.");var t,n=e,r=n[0].slice(),a=this.axis<0?r.length+this.axis:this.axis,i=Object(d.a)(n.slice(1));try{for(i.s();!(t=i.n()).done;){var o=t.value;if(null==r[a]||null==o[a]){r[a]=null;break}r[a]+=o[a]}}catch(s){i.e(s)}finally{i.f()}return r}},{key:"computeMask",value:function(e,t){var n=this;if(null==t)return null;if(!Array.isArray(t))throw new w("`mask` should be an array for Concatenate");if(!Array.isArray(e))throw new w("`inputs` should be an array for Concatenate");if(t.length!==e.length)throw new w("Mismatch in the length of mask (".concat(t.length,") ")+"and the legnth of inputs (".concat(e.length,")"));return a.tidy((function(){var r=!0;if(t.forEach((function(e){null==e||(r=!1)})),r)return null;for(var i=[],o=0;o<e.length;++o)null==t[o]?i.push(a.onesLike(e[o]).asType("bool")):t[o].rank<e[o].rank?i.push(a.expandDims(t[o],-1)):i.push(t[o]);var s=a.concat(i,n.axis);return a.all(s,-1,!1)}))}},{key:"getConfig",value:function(){var e={axis:this.axis},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(Ca);function Da(e,t){for(;e<0;)e+=t;return e}La.className="Concatenate",a.serialization.registerClass(La);var Pa=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,e)).axes=e.axes,r.normalize=null!=e.normalize&&e.normalize,r.supportsMasking=!0,r.reshapeRequired=!1,r}return Object(o.a)(n,[{key:"build",value:function(e){a.util.assert(Array.isArray(e)&&2===e.length&&Array.isArray(e[0])&&Array.isArray(e[1]),(function(){return"A `Dot` layer should be called on a list of exactly 2 inputs."}));var t=e[0],n=e[1];if(t.length>3||n.length>3)throw new O("Dot layer does not support tensors of 4D or higher rank yet.");var r=this.interpretAxes(t,n);if(t[r[0]]!==n[r[1]])throw new w("Dimension incompatibility: "+"".concat(t[r[0]]," !== ").concat(n[r[1]]))}},{key:"mergeFunction",value:function(e){if(2!==e.length)throw new w("A `Dot` layer must be called on exactly 2 inputs, "+"but received ".concat(e.length," input(s)."));var t,n=e[0],r=e[1];return t=Array.isArray(this.axes)?this.axes.map((function(t,n){return Da(t,e[n].shape.length)})):[Da(this.axes,n.shape.length),Da(this.axes,r.shape.length)],this.normalize&&(n=Bt(n,t[0]),r=Bt(r,t[1])),function(e,t,n){if(e.shape.length>3||t.shape.length>3)throw new O("batchDot is not implemented for tensors of 4D or higher rank yet");if(a.util.assert(e.shape.length>=2,(function(){return"batchDot requires the rank of x to be >= 2, "+"but got ".concat(e.shape.length)})),a.util.assert(e.shape.length>=2,(function(){return"batchDot requires the rank of y to be >= 2, "+"but got ".concat(t.shape.length)})),"number"===typeof n&&(n=[n,n]),"complex64"===e.dtype||"complex64"===t.dtype)throw new O("batchDot is not implemented for complex64-type Tensors yet.");var r=e.shape.length,i=t.shape.length;null==n&&(n=[r-1,i-2]);var o=n;return a.tidy((function(){var n,a;if(r>i){n=r-i;for(var s=[],u=0;u<n;++u)s.push(1);
2t=t.reshape(t.shape.concat(s))}else if(i>r){n=i-r;for(var c=[],l=0;l<n;++l)c.push(1);e=e.reshape(e.shape.concat(c))}else n=0;if(2===e.shape.length&&2===t.shape.length)a=o[0]===o[1]?e.mul(t).sum(o[0]):e.transpose([1,0]).mul(t).sum(o[1]);else{var h=o[0]!==e.shape.length-1,d=o[1]===t.shape.length-1;a=e.matMul(t,h,d)}if(n>0){for(var f,p=[],m=f=r>i?r+i-3:r-1;m<f+n;++m)p.push(m);a=a.squeeze(p)}return 1===a.shape.length&&(a=a.expandDims(1)),a}))}(n,r,t)}},{key:"interpretAxes",value:function(e,t){return Array.isArray(this.axes)?this.axes:[Da(this.axes,e.length),Da(this.axes,t.length)]}},{key:"computeOutputShape",value:function(e){a.util.assert(Array.isArray(e)&&2===e.length&&Array.isArray(e[0])&&Array.isArray(e[1]),(function(){return"A `Dot` layer should be called on a list of exactly 2 inputs."}));var t=e[0].slice(),n=e[1].slice();if(t.length>3||n.length>3)throw new O("Dot layer does not support tensors of 4D or higher rank yet.");var r=this.interpretAxes(t,n);t.splice(r[0],1),n.splice(r[1],1),n.splice(0,1);var i=t.concat(n);return 1===i.length&&i.push(1),i}},{key:"computeMask",value:function(e,t){return null}},{key:"getConfig",value:function(){var e={axes:this.axes,normalize:this.normalize},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(Ca);Pa.className="Dot",a.serialization.registerClass(Pa);var za=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,e)).supportsMasking=!0,r.stddev=e.stddev,r}return Object(o.a)(n,[{key:"computeOutputShape",value:function(e){return e}},{key:"getConfig",value:function(){var e=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this),t={stddev:this.stddev};return Object.assign(t,e),t}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){n.invokeCallHook(e,t);var r=ct(e);return Ie((function(){return je(r.shape,0,n.stddev).add(r)}),(function(){return r}),t.training||!1)}))}}]),n}(xt);za.className="GaussianNoise",a.serialization.registerClass(za);var Fa=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,e)).supportsMasking=!0,r.rate=e.rate,r}return Object(o.a)(n,[{key:"computeOutputShape",value:function(e){return e}},{key:"getConfig",value:function(){var e=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this),t={rate:this.rate};return Object.assign(t,e),t}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){n.invokeCallHook(e,t);var r=ct(e);if(n.rate>0&&n.rate<1){return Ie((function(){var e=Math.sqrt(n.rate/(1-n.rate));return r.mul(je(r.shape,1,e))}),(function(){return r}),t.training||!1)}return r}))}}]),n}(xt);Fa.className="GaussianDropout",a.serialization.registerClass(Fa);var Ba=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,e)).supportsMasking=!0,r.rate=e.rate,r.noiseShape=e.noiseShape,r}return Object(o.a)(n,[{key:"_getNoiseShape",value:function(e){return this.noiseShape||ct(e).shape}},{key:"computeOutputShape",value:function(e){return e}},{key:"getConfig",value:function(){var e=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this),t={rate:this.rate};return Object.assign(t,e),t}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){if(n.rate<1&&n.rate>0){var r=n._getNoiseShape(e);return Ie((function(){var t=ct(e),i=-1.7580993408473766,o=Object(a.greaterEqual)(Object(a.randomUniform)(r),n.rate);o=ge(o,"float32");var s=Math.pow((1-n.rate)*(1+n.rate*Math.pow(i,2)),-.5),u=-s*i*n.rate;return t.mul(o).add(o.add(-1).mul(i)).mul(s).add(u)}),(function(){return ct(e)}),t.training||!1)}return e}))}}]),n}(xt);function Ua(e,t,n,r,i){var o,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:.001;if(2===e.rank)o=a.batchNorm2d(e,t,n,r,i,s);else if(3===e.rank)o=a.batchNorm3d(e,t,n,r,i,s);else{if(4!==e.rank)throw new O("batchNormalization is not implemented for array of rank ".concat(e.rank," ")+"yet");o=a.batchNorm4d(e,t,n,r,i,s)}return o}function Wa(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.001;return Object(a.tidy)((function(){var o=a.moments(e,r),s=o.mean,u=o.variance;
2return[Ua(e,s,u,n,t,i),s,u]}))}function Va(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.001;return Object(a.tidy)((function(){var o,s=a.moments(e,r),u=s.mean,c=s.variance,l=[],h=Object(d.a)(ve(0,e.rank));try{for(h.s();!(o=h.n()).done;){var f=o.value;-1!==r.indexOf(f)?l.push(1):l.push(e.shape[f])}}catch(b){h.e(b)}finally{h.f()}var p=u.reshape(l),m=c.reshape(l),v=null==t?null:t.reshape(l),g=null==n?null:n.reshape(l);return[Ua(e,p,m,g,v,i),u,c]}))}Ba.className="AlphaDropout",a.serialization.registerClass(Ba);var Ga=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),null==e&&(e={}),(r=t.call(this,e)).supportsMasking=!0,r.axis=null==e.axis?-1:e.axis,r.momentum=null==e.momentum?.99:e.momentum,r.epsilon=null==e.epsilon?.001:e.epsilon,r.center=null==e.center||e.center,r.scale=null==e.scale||e.scale,r.betaInitializer=nt(e.betaInitializer||"zeros"),r.gammaInitializer=nt(e.gammaInitializer||"ones"),r.movingMeanInitializer=nt(e.movingMeanInitializer||"zeros"),r.movingVarianceInitializer=nt(e.movingVarianceInitializer||"ones"),r.betaConstraint=J(e.betaConstraint),r.gammaConstraint=J(e.gammaConstraint),r.betaRegularizer=Mr(e.betaRegularizer),r.gammaRegularizer=Mr(e.gammaRegularizer),r}return Object(o.a)(n,[{key:"build",value:function(e){e=lt(e);var t=this.axis>=0?this.axis:this.axis+e.length,n=e[t];if(null==n)throw new w("Axis ".concat(t," of input tensor should have a defined dimension but ")+"the layer received an input with shape "+"".concat(JSON.stringify(e),"."));this.inputSpec=[new mt({ndim:e.length,axes:Object(Pr.a)({},t,n)})];var r=[n];this.scale&&(this.gamma=this.addWeight("gamma",r,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",r,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",r,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",r,null,this.movingVarianceInitializer,null,!1),this.built=!0}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){var r=null!=t.training&&t.training,i=ct(e),o=i.shape,s=o.length,u=ve(0,s),c=n.axis>=0?n.axis:n.axis+s;u.splice(c,1);var l=S(1,s);l[c]=o[c];var d=u.slice();d.sort();var f=!a.util.arraysEqual(d,ve(0,s).slice(0,s-1));if(!r)return function(){if(f){var e=n.movingMean.read().reshape(l),t=n.movingVariance.read().reshape(l),r=n.center?n.beta.read().reshape(l):null,a=n.scale?n.gamma.read().reshape(l):null;return Ua(i,e,t,r,a,n.epsilon)}return Ua(i,n.movingMean.read(),n.movingVariance.read(),null==n.beta?null:n.beta.read(),null==n.gamma?null:n.gamma.read(),n.epsilon)}();var p=function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.001;return a.util.arraysEqual(r.slice().sort(),ve(0,e.rank-1))?Wa(e,t,n,r,i):Va(e,t,n,r,i)}(i,n.gamma.read(),n.beta.read(),u,n.epsilon),m=Object(h.a)(p,3),v=m[0],g=m[1],b=m[2],y=function(e,t,n){a.tidy((function(){var r=1-n,a=e.read(),i=a.sub(t).mul(r);e.write(a.sub(i))}))};return y(n.movingMean,g,n.momentum),y(n.movingVariance,b,n.momentum),v}))}},{key:"getConfig",value:function(){var e={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:tt(this.betaInitializer),gammaInitializer:tt(this.gammaInitializer),movingMeanInitializer:tt(this.movingMeanInitializer),movingVarianceInitializer:tt(this.movingVarianceInitializer),betaRegularizer:Tr(this.betaRegularizer),gammaRegularizer:Tr(this.gammaRegularizer),betaConstraint:K(this.betaConstraint),gammaConstraint:K(this.gammaConstraint)},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt);Ga.className="BatchNormalization",a.serialization.registerClass(Ga);var Ha=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;if(Object(i.a)(this,n),null==e&&(e={}),(r=t.call(this,e)).axis=null==e.axis?-1:e.axis,"number"===typeof r.axis){if(!Number.isInteger(r.axis))throw new Error("Expected axis to be an integer, but received ".concat(r.axis))}else{if(!Array.isArray(r.axis))throw new Error("Expected axis to be an integer or an array of integers, "+"but received ".concat(JSON.stringify(r.axis)));var a,o=Object(d.a)(r.axis);try{for(o.s();!(a=o.n()).done;){var s=a.value;if(!Number.isInteger(s))throw new Error("Expected axis to be an array of integers, "+"but received ".concat(JSON.stringify(r.axis)))}}catch(u){o.e(u)}finally{o.f()}}return r.epsilon=null==e.epsilon?.001:e.epsilon,r.center=null==e.center||e.center,r.scale=null==e.scale||e.scale,r.betaInitializer=nt(e.betaInitializer||"zeros"),r.gammaInitializer=nt(e.gammaInitializer||"ones"),r.betaRegularizer=Mr(e.betaRegularizer),r.gammaRegularizer=Mr(e.gammaRegularizer),r.supportsMasking=!0,r}return Object(o.a)(n,[{key:"build",value:function(e){var t=(e=lt(e)).length;"number"===typeof this.axis&&(this.axis=[this.axis]);for(var n=0;n<this.axis.length;++n)this.axis[n]<0&&(this.axis[n]+=t);var r,a=Object(d.a)(this.axis);try{for(a.s();!(r=a.n()).done;){var i=r.value;if(i<0||i>=t)throw new Error("Invalid axis: ".concat(i))}}catch(s){a.e(s)}finally{a.f()}if(this.axis.length!==D(this.axis).length)throw new Error("Found duplicate axes in: ".concat(this.axis));var o=this.axis.map((function(t){return e[t]}));this.scale?this.gamma=this.addWeight("gamma",o,"float32",this.gammaInitializer,this.gammaRegularizer,!0):this.gamma=null,this.center?this.beta=this.addWeight("beta",o,"float32",this.betaInitializer,this.betaRegularizer,!0):this.beta=null,this.built=!0}},{key:"call",value:function(e,t){var n=this,r=ct(e),i=r.shape,o=i.length;return Object(a.tidy)((function(){var e,t=Object(a.moments)(r,n.axis,!0),s=t.mean,u=t.variance,c=S(1,o),l=Object(d.a)(n.axis);try{for(l.s();!(e=l.n()).done;){var h=e.value;c[h]=i[h]}}catch(y){l.e(y)}finally{l.f()}for(var f=function(e){return null!=e&&e.shape.length!==o&&n.axis!==[o-1]?e.reshape(c):e},p=f(n.gamma.read()),m=f(n.beta.read()),v=[],g=[],b=0;b<o;++b)-1!==n.axis.indexOf(b)?(v.push(i[b]),g.push(1)):(v.push(1),g.push(i[b]));return s=s.tile(v),u=u.tile(v),p=p.tile(g),m=m.tile(g),Ua(r,s,u,m,p,n.epsilon)}))}},{key:"getConfig",value:function(){var e={axis:this.axis,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:tt(this.betaInitializer),gammaInitializer:tt(this.gammaInitializer),betaRegularizer:Tr(this.betaRegularizer),gammaRegularizer:Tr(this.gammaRegularizer)},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt);Ha.className="LayerNormalization",a.serialization.registerClass(Ha);var qa=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;if(Object(i.a)(this,n),null==e&&(e={}),(r=t.call(this,e)).dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,null==e.padding)r.padding=[[1,1],[1,1]];else if("number"===typeof e.padding)r.padding=[[e.padding,e.padding],[e.padding,e.padding]];else{if(e.padding=e.padding,2!==e.padding.length)throw new w("ZeroPadding2D expects padding to be a length-2 array, but "+"received a length-".concat(e.padding.length," array."));var a,o;if("number"===typeof e.padding[0])a=[e.padding[0],e.padding[0]],o=[e.padding[1],e.padding[1]];else{if(e.padding=e.padding,2!==e.padding[0].length)throw new w("ZeroPadding2D expects height padding to be a length-2 array, "+"but received a length-".concat(e.padding[0].length," array."));if(a=e.padding[0],2!==e.padding[1].length)throw new w("ZeroPadding2D expects width padding to be a length-2 array, "+"but received a length-".concat(e.padding[1].length," array."));o=e.padding[1]}r.padding=[a,o]}return r.inputSpec=[new mt({ndim:4})],r}
2return Object(o.a)(n,[{key:"computeOutputShape",value:function(e){var t,n;return e=lt(e),"channelsFirst"===this.dataFormat?(t=null!=e[2]&&e[2]>=0?e[2]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[3]&&e[3]>=0?e[3]+this.padding[1][0]+this.padding[1][1]:null,[e[0],e[1],t,n]):(t=null!=e[1]&&e[1]>=0?e[1]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[2]&&e[2]>=0?e[2]+this.padding[1][0]+this.padding[1][1]:null,[e[0],t,n,e[3]])}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){return t=ct(e),r=n.padding,i=n.dataFormat,Object(a.tidy)((function(){if(4!==t.rank)throw new w("temporalPadding expects input tensor to be 4-D, but received a "+"".concat(t.rank,"-D tensor."));if(null==r&&(r=[[1,1],[1,1]]),2!==r.length||2!==r[0].length||2!==r[1].length)throw new w("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(null==i&&(i="channelsLast"),"channelsLast"!==i&&"channelsFirst"!==i)throw new w("Unknown data format: ".concat(i,". ")+"Supported data formats are 'channelsLast' and 'channelsFirst.");var e;return e="channelsFirst"===i?[[0,0],[0,0],r[0],r[1]]:[[0,0],r[0],r[1],[0,0]],a.pad(t,e)}));var t,r,i}))}},{key:"getConfig",value:function(){var e={padding:this.padding,dataFormat:this.dataFormat},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt);function Xa(e,t,n,r,i,o){return Object(a.tidy)((function(){var s;re(i),ie(o),ae(r),null==n&&(n=[1,1]),null==r&&(r="valid"),null==i&&(i="channelsLast"),null==o&&(o="max"),e=Ur(e,i);var u="same"===r?"same":"valid";return s="max"===o?a.maxPool(e,t,n,u):a.avgPool(e,t,n,u),"channelsFirst"===i&&(s=a.transpose(s,[0,3,1,2])),s}))}function Ya(e,t,n,r,i,o){return Object(a.tidy)((function(){var s;re(i),ie(o),ae(r),null==n&&(n=[1,1,1]),null==r&&(r="valid"),null==i&&(i="channelsLast"),null==o&&(o="max"),e=Wr(e,i);var u="same"===r?"same":"valid";return s="max"===o?a.maxPool3d(e,t,n,u):a.avgPool3d(e,t,n,u),"channelsFirst"===i&&(s=a.transpose(s,[0,4,1,2,3])),s}))}qa.className="ZeroPadding2D",a.serialization.registerClass(qa);var Ka=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;if(Object(i.a)(this,n),null==e.poolSize&&(e.poolSize=2),r=t.call(this,e),"number"===typeof e.poolSize)r.poolSize=[e.poolSize];else{if(!Array.isArray(e.poolSize)||1!==e.poolSize.length||"number"!==typeof e.poolSize[0])throw new w("poolSize for 1D convolutional layer must be a number or an Array of a single number, but received "+"".concat(JSON.stringify(e.poolSize)));r.poolSize=e.poolSize}if(B(r.poolSize,"poolSize"),null==e.strides)r.strides=r.poolSize;else if("number"===typeof e.strides)r.strides=[e.strides];else{if(!Array.isArray(e.strides)||1!==e.strides.length||"number"!==typeof e.strides[0])throw new w("strides for 1D convolutional layer must be a number or an Array of a single number, but received "+"".concat(JSON.stringify(e.strides)));r.strides=e.strides}return B(r.strides,"strides"),r.padding=null==e.padding?"valid":e.padding,ae(r.padding),r.inputSpec=[new mt({ndim:3})],r}return Object(o.a)(n,[{key:"computeOutputShape",value:function(e){var t=Fr((e=lt(e))[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){n.invokeCallHook(e,t),e=be(ct(e),2);var r=n.poolingFunction(ct(e),[n.poolSize[0],1],[n.strides[0],1],n.padding,"channelsLast");return a.squeeze(r,[2])}))}},{key:"getConfig",value:function(){var e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt),Za=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,e)}return Object(o.a)(n,[{key:"poolingFunction",value:function(e,t,n,r,a){return re(a),ae(r),Xa(e,t,n,r,a,"max")}}]),n}(Ka);Za.className="MaxPooling1D",a.serialization.registerClass(Za);var Ja=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,e)}return Object(o.a)(n,[{key:"poolingFunction",value:function(e,t,n,r,a){return re(a),ae(r),Xa(e,t,n,r,a,"avg")}}]),n}(Ka);Ja.className="AveragePooling1D",a.serialization.registerClass(Ja);var Qa=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;if(Object(i.a)(this,n),null==e.poolSize&&(e.poolSize=[2,2]),(r=t.call(this,e)).poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize],null==e.strides)r.strides=r.poolSize;else if(Array.isArray(e.strides)){if(2!==e.strides.length)throw new w("If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length "+"".concat(e.strides.length,"."));r.strides=e.strides}else r.strides=[e.strides,e.strides];return B(r.poolSize,"poolSize"),B(r.strides,"strides"),r.padding=null==e.padding?"valid":e.padding,r.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,re(r.dataFormat),ae(r.padding),r.inputSpec=[new mt({ndim:4})],r}
2return Object(o.a)(n,[{key:"computeOutputShape",value:function(e){e=lt(e);var t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2];return t=Fr(t,this.poolSize[0],this.padding,this.strides[0]),n=Fr(n,this.poolSize[1],this.padding,this.strides[1]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n]:[e[0],t,n,e[3]]}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){return n.invokeCallHook(e,t),n.poolingFunction(ct(e),n.poolSize,n.strides,n.padding,n.dataFormat)}))}},{key:"getConfig",value:function(){var e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt),$a=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,e)}return Object(o.a)(n,[{key:"poolingFunction",value:function(e,t,n,r,a){return re(a),ae(r),Xa(e,t,n,r,a,"max")}}]),n}(Qa);$a.className="MaxPooling2D",a.serialization.registerClass($a);var ei=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,e)}return Object(o.a)(n,[{key:"poolingFunction",value:function(e,t,n,r,a){return re(a),ae(r),Xa(e,t,n,r,a,"avg")}}]),n}(Qa);ei.className="AveragePooling2D",a.serialization.registerClass(ei);var ti=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;if(Object(i.a)(this,n),null==e.poolSize&&(e.poolSize=[2,2,2]),(r=t.call(this,e)).poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize,e.poolSize],null==e.strides)r.strides=r.poolSize;else if(Array.isArray(e.strides)){if(3!==e.strides.length)throw new w("If the strides property of a 3D pooling layer is an Array, it is expected to have a length of 3, but received length "+"".concat(e.strides.length,"."));r.strides=e.strides}else r.strides=[e.strides,e.strides,e.strides];return B(r.poolSize,"poolSize"),B(r.strides,"strides"),r.padding=null==e.padding?"valid":e.padding,r.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,re(r.dataFormat),ae(r.padding),r.inputSpec=[new mt({ndim:5})],r}return Object(o.a)(n,[{key:"computeOutputShape",value:function(e){e=lt(e);var t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2],r="channelsFirst"===this.dataFormat?e[4]:e[3];return t=Fr(t,this.poolSize[0],this.padding,this.strides[0]),n=Fr(n,this.poolSize[1],this.padding,this.strides[1]),r
2=Fr(r,this.poolSize[2],this.padding,this.strides[2]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n,r]:[e[0],t,n,r,e[4]]}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){return n.invokeCallHook(e,t),n.poolingFunction(ct(e),n.poolSize,n.strides,n.padding,n.dataFormat)}))}},{key:"getConfig",value:function(){var e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt),ni=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,e)}return Object(o.a)(n,[{key:"poolingFunction",value:function(e,t,n,r,a){return re(a),ae(r),Ya(e,t,n,r,a,"max")}}]),n}(ti);ni.className="MaxPooling3D",a.serialization.registerClass(ni);var ri=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,e)}return Object(o.a)(n,[{key:"poolingFunction",value:function(e,t,n,r,a){return re(a),ae(r),Ya(e,t,n,r,a,"avg")}}]),n}(ti);ri.className="AveragePooling3D",a.serialization.registerClass(ri);var ai=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,e)).inputSpec=[new mt({ndim:3})],r}return Object(o.a)(n,[{key:"computeOutputShape",value:function(e){return[e[0],e[2]]}},{key:"call",value:function(e,t){throw new O}}]),n}(xt),ii=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,e||{})}return Object(o.a)(n,[{key:"call",value:function(e,t){return Object(a.tidy)((function(){var t=ct(e);return a.mean(t,1)}))}}]),n}(ai);ii.className="GlobalAveragePooling1D",a.serialization.registerClass(ii);var oi=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,e||{})}return Object(o.a)(n,[{key:"call",value:function(e,t){return Object(a.tidy)((function(){var t=ct(e);return a.max(t,1)}))}}]),n}(ai);oi.className="GlobalMaxPooling1D",a.serialization.registerClass(oi);var si=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,e)).dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,re(r.dataFormat),r.inputSpec=[new mt({ndim:4})],r}return Object(o.a)(n,[{key:"computeOutputShape",value:function(e){return e=e,"channelsLast"===this.dataFormat?[e[0],e[3]]:[e[0],e[1]]}},{key:"call",value:function(e,t){throw new O}},{key:"getConfig",value:function(){var e={dataFormat:this.dataFormat},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(xt),ui=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){var t=ct(e);return"channelsLast"===n.dataFormat?a.mean(t,[1,2]):a.mean(t,[2,3])}))}}]),n}(si);ui.className="GlobalAveragePooling2D",a.serialization.registerClass(ui);var ci=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){var t=ct(e);return"channelsLast"===n.dataFormat?a.max(t,[1,2]):a.max(t,[2,3])}))}}]),n}(si);ci.className="GlobalMaxPooling2D",a.serialization.registerClass(ci);var li=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,e)).layer=e.layer,r}return Object(o.a)(n,[{key:"build",value:function(e){this.built=!0}},{key:"getWeights",value:function(){return this.layer.getWeights()}},{key:"setWeights",value:function(e){this.layer.setWeights(e)}},{key:"getConfig",value:function(){var e={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}},{key:"setFastWeightInitDuringBuild",value:function(e){Object(zt.a)(Object(p.a)(n.prototype),"setFastWeightInitDuringBuild",this).call(this,e),null!=this.layer&&this.layer.setFastWeightInitDuringBuild(e)}},{key:"trainable",get:function(){return null!=this.layer&&this.layer.trainable},set:function(e){null!=this.layer&&(this.layer.trainable=e)}},{key:"trainableWeights",get:function(){return this.layer.trainableWeights}},{key:"nonTrainableWeights",get:function(){return this.layer.nonTrainableWeights}},{key:"updates",get:function(){return this.layer._updates}},{key:"losses",get:function(){return this.layer.losses}}],[{key:"fromConfig",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.layer,a=Ft(r,n);delete t.layer;var i={layer:a};return Object.assign(i,t),new e(i)}}]),n}(xt),hi=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,e)).supportsMasking=!0,r}return Object(o.a)(n,[{key:"build",value:function(e){if((e=lt(e)).length<3)throw new w("TimeDistributed layer expects an input shape >= 3D, but received "+"input shape ".concat(JSON.stringify(e)));this.inputSpec=[{shape:e}];var t=[e[0]].concat(e.slice(2));this.layer.built||(this.layer.build(t),this.layer.built=!0),Object(zt.a)(Object(p.a)(n.prototype),"build",this).call(this,e)}},{key:"computeOutputShape",value:function(e){var t=[(e=lt(e))[0]].concat(e.slice(2)),n=this.layer.computeOutputShape(t),r=e[1];return[n[0],r].concat(n.slice(1))}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){return aa((function(e,r){return[ct(n.layer.call(e,t)),[]]}),e=ct(e),[],!1,null,null,!1,!0)[1]}))}}]),n}(li);hi.className="TimeDistributed",a.serialization.registerClass(hi);var di=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r;Object(i.a)(this,n),r=t.call(this,e);var a=e.layer.getConfig(),o={};o.className=e.layer.getClassName(),o.config=a,r.forwardLayer=Ft(o),a.goBackwards=!0!==a.goBackwards;var s,u={};if(u.className=e.layer.getClassName(),u.config=a,r.backwardLayer=Ft(u),r.forwardLayer.name="forward_"+r.forwardLayer.name,r.backwardLayer.name="backward_"+r.backwardLayer.name,r.mergeMode=void 0===e.mergeMode?"concat":e.mergeMode,s=r.mergeMode,z(te,"BidirectionalMergeMode",s),e.weights)throw new O("weights support is not implemented for Bidirectional layer yet.");return r._stateful=e.layer.stateful,r.returnSequences=e.layer.returnSequences,r.returnState=e.layer.returnState,r.supportsMasking=!0,r._trainable=!0,r.inputSpec=e.layer.inputSpec,r.numConstants=null,r}return Object(o.a)(n,[{key:"getWeights",value:function(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())}},{key:"setWeights",value:function(e){var t=e.length,n=Math.floor(t/2);this.forwardLayer.setWeights(e.slice(0,n)),this.backwardLayer.setWeights(e.slice(n))}},{key:"computeOutputShape",value:function(e){var t,n,r,a=this.forwardLayer.computeOutputShape(e);
2return Array.isArray(a)&&Array.isArray(a[0])||(a=[a]),a=a,this.returnState?(r=a.slice(1),t=a[0]):t=a[0],t=t,"concat"===this.mergeMode?(t[t.length-1]*=2,n=[t]):n=null==this.mergeMode?[t,t.slice()]:[t],this.returnState?null==this.mergeMode?n.concat(r).concat(r.slice()):[t].concat(r).concat(r.slice()):E(n)}},{key:"apply",value:function(e,t){var r=null==t?null:t.initialState,a=null==t?null:t.constants;null==t&&(t={});var i=ra(e,r,a,this.numConstants);if(e=i.inputs,r=i.initialState,a=i.constants,Array.isArray(e)&&(r=e.slice(1),e=e[0]),(null==r||0===r.length)&&null==a)return Object(zt.a)(Object(p.a)(n.prototype),"apply",this).call(this,e,t);var o=[],s=[];if(null!=r){var u=r.length;if(u%2>0)throw new w("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");t.initialState=r,o.push.apply(o,Object(l.a)(r));var c=r.map((function(e){return new mt({shape:e.shape})}));this.forwardLayer.stateSpec=c.slice(0,u/2),this.backwardLayer.stateSpec=c.slice(u/2),s.push.apply(s,Object(l.a)(c))}if(null!=a)throw new O("Support for constants in Bidirectional layers is not implemented yet.");for(var h=o[0]instanceof vt,d=0,f=o;d<f.length;d++){if(f[d]instanceof vt!==h)throw new w("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors")}if(h){var m=[e].concat(o),v=this.inputSpec.concat(s),g=this.inputSpec;this.inputSpec=v;var b=Object(zt.a)(Object(p.a)(n.prototype),"apply",this).call(this,m,t);return this.inputSpec=g,b}return Object(zt.a)(Object(p.a)(n.prototype),"apply",this).call(this,e,t)}},{key:"call",value:function(e,t){var n=this;return Object(a.tidy)((function(){var r,i,o,s,u=t.initialState;if(null==u)r=n.forwardLayer.call(e,t),i=n.backwardLayer.call(e,t);else{var c=u.slice(0,u.length/2),l=u.slice(u.length/2);r=n.forwardLayer.call(e,Object.assign(t,{initialState:c})),i=n.backwardLayer.call(e,Object.assign(t,{initialState:l}))}return n.returnState&&(Array.isArray(r)&&(o=r.slice(1).concat(i.slice(1))),r=r[0],i=i[0]),n.returnSequences&&(i=a.reverse(i,1)),"concat"===n.mergeMode?s=ke([r,i]):"sum"===n.mergeMode?s=a.add(r,i):"ave"===n.mergeMode?s=a.mul(.5,a.add(r,i)):"mul"===n.mergeMode?s=a.mul(r,i):null==n.mergeMode&&(s=[r,i]),n.returnState?null==n.mergeMode?s.concat(o):[s].concat(o):s}))}},{key:"resetStates",value:function(e){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}},{key:"build",value:function(e){var t=this;se(this.forwardLayer.name,(function(){t.forwardLayer.build(e)})),se(this.backwardLayer.name,(function(){t.backwardLayer.build(e)})),this.built=!0}},{key:"computeMask",value:function(e,t){var n;if(Array.isArray(t)&&(t=t[0]),n=this.returnSequences?null==this.mergeMode?[t,t]:t:null==this.mergeMode?[null,null]:null,this.returnState){var r=this.forwardLayer.states.map((function(e){return null}));return Array.isArray(n)?n.concat(r).concat(r):[n].concat(r).concat(r)}return n}},{key:"setFastWeightInitDuringBuild",value:function(e){Object(zt.a)(Object(p.a)(n.prototype),"setFastWeightInitDuringBuild",this).call(this,e),null!=this.forwardLayer&&this.forwardLayer.setFastWeightInitDuringBuild(e),null!=this.backwardLayer&&this.backwardLayer.setFastWeightInitDuringBuild(e)}},{key:"getConfig",value:function(){var e={mergeMode:this.mergeMode},t=Object(zt.a)(Object(p.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}},{key:"trainable",get:function(){return this._trainable},set:function(e){this._trainable=e,null!=this.forwardLayer&&(this.forwardLayer.trainable=e),null!=this.backwardLayer&&(this.backwardLayer.trainable=e)}},{key:"trainableWeights",get:function(){return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights)}},{key:"nonTrainableWeights",get:function(){return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights)}}],[{key:"fromConfig",value:function(e,t){var n=Ft(t.layer);if(delete t.layer,null!=t.numConstants)throw new O("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");var r=t;return r.layer=n,new e(r)}}]),n}(li);di.className="Bidirectional",a.serialization.registerClass(di);var fi=n(107),pi=n(109),mi=n(65),vi=n(92),gi=function(){function e(){Object(i.a)(this,e),this.size=null}return Object(o.a)(e,[{key:"batch",value:function(e){var t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this;return a.util.assert(e>0,(function(){return"batchSize needs to be positive, but it is\n ".concat(e)})),t=this.size===1/0||null==this.size?this.size:n?Math.ceil(this.size/e):Math.floor(this.size/e),bi(Object(jt.a)(_t.a.mark((function t(){return _t.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.iterator();case 2:return t.abrupt("return",t.sent.columnMajorBatch(e,n,yi));case 3:case"end":return t.stop()}}),t)}))),t)}},{key:"concatenate",value:function(e){var t,n=this;return t=this.size===1/0||e.size===1/0?1/0:null!=this.size&&null!=e.size?this.size+e.size:null,bi(Object(jt.a)(_t.a.mark((function t(){return _t.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.iterator();case 2:return t.t0=t.sent,t.next=5,e.iterator();case 5:return t.t1=t.sent,t.abrupt("return",t.t0.concatenate.call(t.t0,t.t1));case 7:case"end":return t.stop()}}),t)}))),t)}},{key:"filter",value:function(e){var t,n=this;return t=this.size===1/0?1/0:null,bi(Object(jt.a)(_t.a.mark((function t(){return _t.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.iterator();case 2:return t.abrupt("return",t.sent.filter((function(t){return a.tidy((function(){return e(t)}))}
2)));case 3:case"end":return t.stop()}}),t)}))),t)}},{key:"forEachAsync",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.iterator();case 2:return e.abrupt("return",e.sent.forEachAsync(t));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"map",value:function(e){var t=this;return bi(Object(jt.a)(_t.a.mark((function n(){return _t.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.iterator();case 2:return n.abrupt("return",n.sent.map((function(t){return a.tidy((function(){return e(t)}))})));case 3:case"end":return n.stop()}}),n)}))),this.size)}},{key:"mapAsync",value:function(e){var t=this;return bi(Object(jt.a)(_t.a.mark((function n(){return _t.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.iterator();case 2:return n.abrupt("return",n.sent.mapAsync(e));case 3:case"end":return n.stop()}}),n)}))),this.size)}},{key:"prefetch",value:function(e){if(null==e)throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified.");var t=this;return bi(Object(jt.a)(_t.a.mark((function n(){return _t.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.iterator();case 2:return n.abrupt("return",n.sent.prefetch(e));case 3:case"end":return n.stop()}}),n)}))),this.size)}},{key:"repeat",value:function(e){var t,n=this;return t=null!=this.size&&e>0?this.size*e:0===e?0:null!=this.size&&(void 0===e||e<0)?1/0:null,bi(Object(jt.a)(_t.a.mark((function t(){var r;return _t.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Object(mi.e)(Object(jt.a)(_t.a.mark((function e(){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.iterator();case 2:return e.t0=e.sent,e.abrupt("return",{value:e.t0,done:!1});case 4:case"end":return e.stop()}}),e)})))),t.abrupt("return",Object(mi.d)(r.take(e)));case 2:case"end":return t.stop()}}),t)}))),t)}},{key:"skip",value:function(e){var t,n=this;return t=null!=this.size&&e>=0&&this.size>=e?this.size-e:null!=this.size&&(this.size<e||void 0===e||e<0)?0:null,bi(Object(jt.a)(_t.a.mark((function t(){return _t.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.iterator();case 2:return t.abrupt("return",t.sent.skip(e));case 3:case"end":return t.stop()}}),t)}))),t)}},{key:"shuffle",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(null==e||e<0)throw null==this.size?new RangeError("`Dataset.shuffle()` requires bufferSize to be specified."):new RangeError("`Dataset.shuffle()` requires bufferSize to be specified. If your data fits in main memory (for regular JS objects), and/or GPU memory (for `tf.Tensor`s), consider setting "+"bufferSize to the dataset size (".concat(this.size," elements)"));var r=this,i=pi.alea(t||a.util.now().toString());return bi(Object(jt.a)(_t.a.mark((function t(){var a;return _t.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=i.int32(),n&&(a+=i.int32()),t.next=4,r.iterator();case 4:return t.abrupt("return",t.sent.shuffle(e,a.toString()));case 5:case"end":return t.stop()}}),t)}))),this.size)}},{key:"take",value:function(e){var t,n=this;return t=null!=this.size&&this.size>e?e:null!=this.size&&this.size<=e?this.size:null,bi(Object(jt.a)(_t.a.mark((function t(){return _t.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.iterator();case 2:return t.abrupt("return",t.sent.take(e));case 3:case"end":return t.stop()}}),t)}))),t)}},{key:"toArray",value:function(){var e=Object(jt.a)(_t.a.mark((function e(){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.size!==1/0){e.next=2;break}throw new Error("Can not convert infinite data stream to array.");case 2:return e.next=4,this.iterator();case 4:return e.abrupt("return",e.sent.toArray());case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"toArrayForTest",value:function(){var e=Object(jt.a)(_t.a.mark((function e(){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.size!==1/0){e.next=2;break}throw new Error("Can not convert infinite data stream to array.");case 2:return e.next=4,this.iterator();case 4:return e.abrupt("return",e.sent.toArrayForTest());case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}();function bi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new(function(n){Object(s.a)(a,n);var r=Object(u.a)(a);function a(){var e;return Object(i.a)(this,a),(e=r.apply(this,arguments)).size=t,e}return Object(o.a)(a,[{key:"iterator",value:function(){var t=Object(jt.a)(_t.a.mark((function t(){return _t.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e());case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()}]),a}(gi))}function yi(e){if(null===e)return null;var t=e[0];return Object(vi.a)(t)?{value:function(e){if(0===e.length)throw new Error("Can't make a batch of zero elements.");return e[0]instanceof a.Tensor?a.stack(e):a.tensor(e)}(e),recurse:!1}:{value:null,recurse:!0}}gi.MAX_BUFFER_SIZE=1e4;Symbol("out"),Symbol("field"),Symbol("quote"),Symbol("quoteafterquote"),Symbol("quoteinquote"),mi.a,mi.a,n(315).a;function xi(e,t){Array.isArray(e)||(e=[e]),e.forEach((function(e){null!=e&&a.util.assert("complex64"!==e.dtype,(function(){return"".concat(t," does not support complex64 tensors in the CPU backend.")}))}))}function wi(e,t,n,r,i,o){for(var s=i.strideHeight,u=i.strideWidth,c=i.dilationHeight,l=i.dilationWidth,h=i.effectiveFilterHeight,d=i.effectiveFilterWidth,f=i.padInfo.top,p=i.padInfo.left,m="max"===o?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,v=Object(a.buffer)(i.outShape,n),g=v.values,b=i.outShape[1]*i.outShape[2]*i.outShape[3],y=i.outShape[2]*i.outShape[3],x=i.outShape[3],w=0;w<i.batchSize;++w)for(var O=w*b,k=w*r[0],S=0;S<i.inChannels;++S)for(var _=0;_<i.outHeight;++_)for(var j=_*s-f,E=Math.max(0,j),T=Math.min(i.inHeight,h+j),C=O+_*y,M=0;M<i.outWidth;++M){for(var A=M*u-p,N=Math.max(0,A),R=Math.min(i.inWidth,d+A),I=m,L=0,D=0,P=E;P<T;P+=c){for(var z=k+P*r[1],F=N;F<R;F+=l){var B=e[z+F*r[2]+S];"max"===o&&B>I?I=B:"avg"===o&&(L+=B,D++)}if(isNaN(I))break}g[C+M*x+S]="avg"===o?L/D:I}return v}function Oi(e,t,n,r){for(var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=Object(a.buffer)(r.outShape,"int32"),u=r.strideHeight,c=r.strideWidth,l=r.dilationHeight,h=r.dilationWidth,d=r.effectiveFilterHeight,f=r.effectiveFilterWidth,p=r.padInfo.top,m=r.padInfo.left,v=Object(a.buffer)(t,n,e),g=0;g<r.batchSize;++g)for(var b=0;
2b<r.inChannels;++b)for(var y=0;y<r.outHeight;++y){for(var x=y*u-p,w=x;w<0;)w+=l;for(var O=Math.min(r.inHeight,d+x),k=0;k<r.outWidth;++k){for(var S=k*c-m,_=S;_<0;)_+=h;for(var j=Math.min(r.inWidth,f+S),E=Number.NEGATIVE_INFINITY,T=-1,C=w;C<O;C+=l)for(var M=C-x,A=_;A<j;A+=h){var N=A-S,R=v.get(g,C,A,b);R>E&&(E=R,T=i?o?((g*r.inHeight+C)*r.inWidth+A)*r.inChannels+b:(C*r.inWidth+A)*r.inChannels+b:M*f+N)}s.set(T,g,y,k,b)}}return s}var ki=a.kernel_impls.nonMaxSuppressionV3Impl,Si=a.kernel_impls.split,_i=a.kernel_impls.tile,ji=a.kernel_impls.topkImpl,Ei=a.kernel_impls.whereImpl;function Ti(e,t,n,r){if("linear"===n)return e.linear(t);if("relu"===n)return e.relu(t);if("elu"===n)return e.elu(t);if("relu6"===n)return e.relu6(t);if("prelu"===n)return e.prelu(t,r);throw new Error("Activation ".concat(n," has not been implemented for the CPU backend."))}var Ci=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(){var e;return Object(i.a)(this,n),(e=t.call(this)).blockSize=48,e.firstUse=!0,e.data=new a.DataStorage(Object(f.a)(e),Object(a.engine)()),e}return Object(o.a)(n,[{key:"write",value:function(e,t,n){this.firstUse&&(this.firstUse=!1,Object(a.env)().get("IS_NODE")&&a.backend_util.warn("\n============================\nHi there \ud83d\udc4b. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details.\n============================"));var r={};return this.data.set(r,{values:e,dtype:n,refCount:1}),r}},{key:"incRef",value:function(e){this.data.get(e).refCount++}},{key:"decRef",value:function(e){this.data.has(e)&&this.data.get(e).refCount--}},{key:"move",value:function(e,t,n,r){this.data.set(e,{values:t,dtype:r,refCount:1})}},{key:"numDataIds",value:function(){return this.data.numDataIds()}},{key:"read",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t){return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.readSync(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"readSync",value:function(e){var t=this.data.get(e),n=t.dtype,r=t.complexTensors;if("complex64"===n){var i=this.readSync(r.real.dataId),o=this.readSync(r.imag.dataId);return a.backend_util.mergeRealAndImagArrays(i,o)}return this.data.get(e).values}},{key:"bufferSync",value:function(e){var t=this.readSync(e.dataId),n=t;if("string"===e.dtype)try{n=t.map((function(e){return a.util.decodeString(e)}))}catch(r){throw new Error("Failed to decode encoded string bytes into utf-8")}return a.buffer(e.shape,e.dtype,n)}},{key:"makeOutput",value:function(e,t,n){var r=this.write(e,t,n);return Object(a.engine)().makeTensorFromDataId(r,t,n,this)}},{key:"disposeData",value:function(e){if(this.data.has(e)){var t=this.data.get(e).complexTensors;null!=t&&(t.real.dispose(),t.imag.dispose()),this.data.delete(e)}}},{key:"disposeIntermediateTensorInfo",value:function(e){var t=e.dataId;if(this.data.has(t)){var n=this.data.get(t);n.refCount--,n.refCount<1&&this.disposeData(t)}}},{key:"time",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t){var n,r;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.util.now(),t(),r=a.util.now()-n,e.abrupt("return",{kernelMs:r});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"memory",value:function(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}}},{key:"complex",value:function(e,t){var n=this.makeOutput(null,e.shape,"complex64");return this.data.get(n.dataId).complexTensors={real:Object(a.engine)().keep(e.clone()),imag:Object(a.engine)().keep(t.clone())},n}},{key:"real",value:function(e){return this.data.get(e.dataId).complexTensors.real.clone()}},{key:"imag",value:function(e){return this.data.get(e.dataId).complexTensors.imag.clone()}},{key:"slice",value:function(e,t,n){if(xi(e,"slice"),a.slice_util.isSliceContinous(e.shape,t,n)){var r=a.slice_util.computeFlatOffset(t,e.strides),i=a.util.sizeFromShape(n),o=this.readSync(e.dataId);return a.tensor(o.subarray(r,r+i),n,e.dtype)}for(var s=a.buffer(n,e.dtype),u=this.bufferSync(e),c=0;c<s.size;++c){var h=s.indexToLoc(c).map((function(e,n){return e+t[n]}));s.values[c]=u.get.apply(u,Object(l.a)(h))}return s.toTensor()}},{key:"stridedSlice",value:function(e,t,n,r){xi(e,"stridedSlice");var i=a.slice_util.computeOutShape(t,n,r);if(i.some((function(e){return 0===e})))return a.tensor([],i);for(var o=a.buffer(i,e.dtype),s=this.bufferSync(e),u=0;u<o.size;u++){for(var c=o.indexToLoc(u),h=new Array(c.length),d=0;d<h.length;d++)h[d]=c[d]*r[d]+t[d];o.set.apply(o,[s.get.apply(s,h)].concat(Object(l.a)(c)))}return o.toTensor()}},{key:"diag",value:function(e){for(var t=this.readSync(e.dataId),n=a.buffer([e.size,e.size],e.dtype),r=n.values,i=0;i<t.length;i++)r[i*e.size+i]=t[i];return n.toTensor()}},{key:"unstack",value:function(e,t){for(var n=e.shape[t],r=new Array(e.rank-1),a=0,i=0;i<e.rank;i++)i!==t&&(r[a++]=e.shape[i]);var o=new Array(e.rank).fill(0),s=e.shape.slice();s[t]=1;for(var u=new Array(n),c=0;c<u.length;c++)o[t]=c,u[c]=this.slice(e,o,s).reshape(r);return u}},{key:"reverse",value:function(e,t){xi(e,"reverse");for(var n=a.buffer(e.shape,e.dtype),r=this.bufferSync(e),i=function(a){var i=n.indexToLoc(a),o=i.slice();t.forEach((function(t){return o[t]=e.shape[t]-1-o[t]})),n.set.apply(n,[r.get.apply(r,Object(l.a)(o))].concat(Object(l.a)(i)))},o=0;o<n.size;o++)i(o);return n.toTensor()}},{key:"concat",value:function(e,t){var n=this;if("complex64"===e[0].dtype){var r=e.map((function(e){return a.real(e)})),i=e.map((function(e){return a.imag(e)}
2));return a.complex(this.concat(r,t),this.concat(i,t))}var o=e.map((function(e){var n=a.util.sizeFromShape(e.shape.slice(t));return e.as2D(-1,n)})),s=a.backend_util.computeOutShape(o.map((function(e){return e.shape})),1),u=a.buffer(s,e[0].dtype).values;if(1===o[0].shape[0]){var c=0;o.forEach((function(e){u.set(n.readSync(e.dataId),c),c+=e.size}))}else{var l=0;o.forEach((function(e){for(var t=n.readSync(e.dataId),r=0,a=0;a<e.shape[0];++a)for(var i=a*s[1]+l,o=0;o<e.shape[1];++o)u[i+o]=t[r++];l+=e.shape[1]}))}var h=a.backend_util.computeOutShape(e.map((function(e){return e.shape})),t);return a.tensor(u,h,e[0].dtype)}},{key:"neg",value:function(e){return xi(e,"neg"),this.multiply(a.scalar(-1),e)}},{key:"add",value:function(e,t){return"complex64"===e.dtype||"complex64"===t.dtype?this.broadcastedBinaryComplexOp(e.cast("complex64"),t.cast("complex64"),(function(e,t,n,r){return{real:e+n,imag:t+r}})):this.broadcastedBinaryOp(e,t,Object(a.upcastType)(e.dtype,t.dtype),(function(e,t){return e+t}))}},{key:"addN",value:function(e){var t=this;xi(e,"addN");for(var n=e.map((function(e){return t.readSync(e.dataId)})),r=a.buffer(e[0].shape,e[0].dtype),i=r.values,o=0;o<e.length;o++)for(var s=n[o],u=0;u<i.length;u++)i[u]+=s[u];return r.toTensor()}},{key:"softmax",value:function(e,t){var n=a.util.parseAxisParam([t],e.shape),r=Object(a.max)(e,n),i=a.backend_util.expandShapeToKeepDim(r.shape,n),o=this.subtract(e,r.reshape(i)),s=this.exp(o),u=this.sum(s,n).reshape(i);return a.div(s,u)}},{key:"subtract",value:function(e,t){return"complex64"===e.dtype||"complex64"===t.dtype?this.broadcastedBinaryComplexOp(e.cast("complex64"),t.cast("complex64"),(function(e,t,n,r){return{real:e-n,imag:t-r}})):this.broadcastedBinaryOp(e,t,Object(a.upcastType)(e.dtype,t.dtype),(function(e,t){return e-t}))}},{key:"pow",value:function(e,t){return xi([e,t],"pow"),this.broadcastedBinaryOp(e,t,e.dtype,(function(e,t){return Math.pow(e,t)}))}},{key:"batchMatMul",value:function(e,t,n,r){xi([e,t],"matMul");for(var i=n?e.shape[1]:e.shape[2],o=n?e.shape[2]:e.shape[1],s=r?t.shape[1]:t.shape[2],u=e.shape[0],c=this.readSync(e.dataId),l=this.readSync(t.dataId),d=n?[e.strides[0],1,e.strides[1]]:[e.strides[0],e.strides[1],1],f=Object(h.a)(d,3),p=f[0],m=f[1],v=f[2],g=r?[1,t.strides[1],t.strides[0]]:[t.strides[1],1,t.strides[0]],b=Object(h.a)(g,3),y=b[0],x=b[1],w=b[2],O=o*s,k=a.buffer([u,o,s],e.dtype),S=k.values,_=this.blockSize,j=0;j<u;j++)for(var E=0;E<o;E+=_)for(var T=0;T<s;T+=_)for(var C=0;C<i;C+=_)for(var M=Math.min(E+_,o),A=Math.min(T+_,s),N=Math.min(C+_,i),R=E;R<M;R++)for(var I=T;I<A;I++){for(var L=0,D=C;D<N;D++)L+=c[j*p+R*m+D*v]*l[D*y+I*x+j*w];S[j*O+(R*s+I)]+=L}return k.toTensor()}},{key:"fusedBatchMatMul",value:function(e){var t=e.a,n=e.b,r=e.transposeA,a=e.transposeB,i=e.bias,o=e.activation,s=e.preluActivationWeights,u=this.batchMatMul(t,n,r,a);return i&&(u=this.add(u,i)),o&&(u=Ti(this,u,o,s)),u}},{key:"multiply",value:function(e,t){return"complex64"===e.dtype||"complex64"===t.dtype?this.broadcastedBinaryComplexOp(e.cast("complex64"),t.cast("complex64"),(function(e,t,n,r){return{real:e*n-t*r,imag:e*r+t*n}})):this.broadcastedBinaryOp(e,t,Object(a.upcastType)(e.dtype,t.dtype),(function(e,t){return e*t}))}},{key:"floorDiv",value:function(e,t){xi([e,t],"floorDiv");return this.broadcastedBinaryOp(e,t,"int32",(function(e,t){return Math.floor(e/t)}))}},{key:"sum",value:function(e,t){xi(e,"sum"),a.backend_util.assertAxesAreInnerMostDims("sum",t,e.rank);for(var n=a.backend_util.computeOutAndReduceShapes(e.shape,t),r=Object(h.a)(n,2),i=r[0],o=r[1],s=Object(a.upcastType)(e.dtype,"int32"),u=a.zeros(i,s),c=a.util.sizeFromShape(o),l=this.readSync(u.dataId),d=this.readSync(e.dataId),f=0;f<l.length;++f){for(var p=f*c,m=0,v=0;v<c;++v)m+=d[p+v];l[f]=m}return u}},{key:"prod",value:function(e,t){xi(e,"sum");for(var n=a.backend_util.computeOutAndReduceShapes(e.shape,t),r=Object(h.a)(n,2),i=r[0],o=r[1],s=Object(a.upcastType)(e.dtype,"int32"),u=a.zeros(i,s),c=a.util.sizeFromShape(o),l=this.readSync(u.dataId),d=this.readSync(e.dataId),f=0;f<l.length;++f){for(var p=f*c,m=1,v=0;v<c;++v)m*=d[p+v];l[f]=m}return u}},{key:"unsortedSegmentSum",value:function(e,t,n){xi(e,"unsortedSegmentSum");for(var r=[],i=e.rank-t.rank,o=0;o<i;++o)t=t.expandDims(o+1);for(var s=0;s<n;++s){var u=a.scalar(s,"int32"),c=a.equal(u,t).asType("float32").mul(e).sum
2(0);r.push(c)}return a.stack(r)}},{key:"argMin",value:function(e,t){xi(e,"argMin");var n=[t];a.backend_util.assertAxesAreInnerMostDims("argMin",n,e.rank);for(var r=a.backend_util.computeOutAndReduceShapes(e.shape,n),i=Object(h.a)(r,2),o=i[0],s=i[1],u=a.zeros(o,"int32"),c=a.util.sizeFromShape(s),l=this.readSync(u.dataId),d=this.readSync(e.dataId),f=0;f<l.length;++f){for(var p=f*c,m=d[p],v=0,g=0;g<c;++g){var b=d[p+g];b<m&&(m=b,v=g)}l[f]=v}return u}},{key:"argMax",value:function(e,t){xi(e,"argMax");var n=[t];a.backend_util.assertAxesAreInnerMostDims("argMax",n,e.rank);for(var r=a.backend_util.computeOutAndReduceShapes(e.shape,n),i=Object(h.a)(r,2),o=i[0],s=i[1],u=a.zeros(o,"int32"),c=a.util.sizeFromShape(s),l=this.readSync(u.dataId),d=this.readSync(e.dataId),f=0;f<l.length;++f){for(var p=f*c,m=d[p],v=0,g=0;g<c;++g){var b=d[p+g];b>m&&(m=b,v=g)}l[f]=v}return u}},{key:"cumsum",value:function(e,t,n,r){if(xi(e,"cumsum"),t!==e.rank-1)throw new Error("backend.cumsum in CPU expects an inner-most axis=".concat(e.rank-1," ")+"but got axis=".concat(t));for(var i=Object(a.upcastType)(e.dtype,"int32"),o=a.zeros(e.shape,i),s=this.readSync(o.dataId),u=this.readSync(e.dataId),c=e.shape[e.rank-1],l=r?function(e,t){return e+c-t-1}:function(e,t){return e+t},h=0;h<u.length;h+=c)for(var d=0;d<c;d++){var f=l(h,d);if(0===d)s[f]=n?0:u[f];else{var p=l(h,d-1);s[f]=n?u[p]+s[p]:u[f]+s[p]}}return o}},{key:"equal",value:function(e,t){return xi([e,t],"equal"),this.broadcastedBinaryOp(e,t,"bool",(function(e,t){return e===t?1:0}))}},{key:"notEqual",value:function(e,t){return xi([e,t],"notEqual"),this.broadcastedBinaryOp(e,t,"bool",(function(e,t){return e!==t?1:0}))}},{key:"less",value:function(e,t){return xi([e,t],"less"),this.broadcastedBinaryOp(e,t,"bool",(function(e,t){return e<t?1:0}))}},{key:"lessEqual",value:function(e,t){return xi([e,t],"lessEqual"),this.broadcastedBinaryOp(e,t,"bool",(function(e,t){return e<=t?1:0}))}},{key:"greater",value:function(e,t){return xi([e,t],"greater"),this.broadcastedBinaryOp(e,t,"bool",(function(e,t){return e>t?1:0}))}},{key:"greaterEqual",value:function(e,t){return xi([e,t],"greaterEqual"),this.broadcastedBinaryOp(e,t,"bool",(function(e,t){return e>=t?1:0}))}},{key:"logicalNot",value:function(e){xi(e,"logicalNot");for(var t=this.readSync(e.dataId),n=new Uint8Array(t.length),r=0;r<t.length;++r)n[r]=t[r]?0:1;return this.makeOutput(n,e.shape,"bool")}},{key:"logicalAnd",value:function(e,t){return xi([e,t],"logicalAnd"),this.broadcastedBinaryOp(e,t,"bool",(function(e,t){return e&&t}))}},{key:"logicalOr",value:function(e,t){return xi([e,t],"logicalOr"),this.broadcastedBinaryOp(e,t,"bool",(function(e,t){return e||t}))}},{key:"select",value:function(e,t,n){xi([e,t,n],"select");for(var r=this.readSync(e.dataId),i=this.readSync(t.dataId),o=this.readSync(n.dataId),s=a.zeros(t.shape,Object(a.upcastType)(t.dtype,n.dtype)),u=this.readSync(s.dataId),c=0,l=0===e.rank||e.rank>1||1===t.rank?1:a.util.sizeFromShape(t.shape.slice(1)),h=0;h<r.length;h++)for(var d=0;d<l;d++)1===r[h]?u[c++]=i[h]:u[c++]=o[h];return s}},{key:"where",value:function(e){xi([e],"where");var t=this.readSync(e.dataId);return Ei(e.shape,t)}},{key:"topk",value:function(e,t,n){xi(e,"topk");var r=this.readSync(e.dataId);return ji(r,e.shape,e.dtype,t,n)}},{key:"min",value:function(e,t){xi(e,"min"),a.backend_util.assertAxesAreInnerMostDims("min",t,e.rank);for(var n=a.backend_util.computeOutAndReduceShapes(e.shape,t),r=Object(h.a)(n,2),i=r[0],o=r[1],s=a.zeros(i,e.dtype),u=a.util.sizeFromShape(o),c=this.readSync(s.dataId),l=this.readSync(e.dataId),d=0;d<c.length;++d){for(var f=d*u,p=l[f],m=0;m<u;++m){var v=l[f+m];v<p&&(p=v)}c[d]=p}return s}},{key:"minimum",value:function(e,t){return xi([e,t],"minimum"),this.broadcastedBinaryOp(e,t,e.dtype,(function(e,t){return Math.min(e,t)}))}},{key:"mod",value:function(e,t){return xi([e,t],"mod"),this.broadcastedBinaryOp(e,t,e.dtype,(function(e,t){var n=e%t;return e<0&&t<0||e>=0&&t>=0?n:(n+t)%t}))}},{key:"maximum",value:function(e,t){return xi([e,t],"maximum"),this.broadcastedBinaryOp(e,t,e.dtype,(function(e,t){return Math.max(e,t)}))}},{key:"all",value:function(e,t){xi(e,"all"),a.backend_util.assertAxesAreInnerMostDims("all",t,e.rank);for(var n=a.backend_util.computeOutAndReduceShapes(e.shape,t),r=Object(h.a)(n,2),i=r[0],o=r[1],s=a.zeros(i,e.dtype),u=a.util.sizeFromShape(o),c=this.readSync(s.dataId),l=this.readSync(e.dataId),d=0;d<c.length;++d){for(var f=d*u,p=l[f],m=0;m<u;++m){var v=l[f+m];p=p&&v}c[d]=p}return s}},{key:"any",value:function(e,t){xi(e,"any"),a.backend_util.assertAxesAreInnerMostDims("any",t,e.rank);for(var n=a.backend_util.computeOutAndReduceShapes(e.shape,t),r=Object(h.a)(n,2),i=r[0],o=r[1],s=a.zeros(i,e.dtype),u=a.util.sizeFromShape(o),c=this.readSync(s.dataId),l=this.readSync(e.dataId),d=0;d<c.length;++d){for(var f=d*u,p=l[f],m=0;m<u;++m){var v=l[f+m];p=p||v}c[d]=p}return s}},{key:"squaredDifference",value:function(e,t){return xi([e,t],"squaredDifference"),this.broadcastedBinaryOp(e,t,e.dtype,(function(e,t){var n=e-t;return n*n}))}},{key:"ceil",value:function(e){xi(e,"ceil");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r)n[r]=Math.ceil(t[r]);return this.makeOutput(n,e.shape,"float32")}},{key:"floor",value:function(e){xi(e,"floor");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r)n[r]=Math.floor(t[r]);return this.makeOutput(n,e.shape,"float32")}},{key:"sign",value:function(e){xi(e,"x");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r)t[r]<0?n[r]=-1:t[r]>0?n[r]=1:n[r]=0;return this.makeOutput(n,e.shape,"float32")}},{key:"isNaN",value:function(e){xi(e,"x");for(var t=this.readSync(e.dataId),n=new Uint8Array(t.length),r=0;r<t.length;++r)Number.isNaN(t[r])&&(n[r]=1);return this.makeOutput(n,e.shape,"bool")}},{key:"isInf",value:function(e){xi(e,"x");for(var t=this.readSync(e.dataId),n=new Uint8Array(t.length),r=0;r<t.length;++r)Math.abs(t[r])===1/0&&(n[r]=1);return this.makeOutput(n,e.shape,"bool")}},{key:"isFinite",value:function(e){xi(e,"x");for(var t=this.readSync(e.dataId),n=new Uint8Array(t.length),r=0;r<t.length;++r)Number.isFinite(t[r])&&(n[r]=1);return this.makeOutput(n,e.shape,"bool")}}
2,{key:"round",value:function(e){xi(e,"round");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r){var a=Math.floor(t[r]);t[r]-a<.5?n[r]=Math.floor(t[r]):t[r]-a>.5?n[r]=Math.ceil(t[r]):n[r]=a%2===0?a:a+1}return this.makeOutput(n,e.shape,"float32")}},{key:"exp",value:function(e){xi(e,"exp");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r)n[r]=Math.exp(t[r]);return this.makeOutput(n,e.shape,"float32")}},{key:"expm1",value:function(e){xi(e,"expm1");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r)n[r]=Math.expm1(t[r]);return this.makeOutput(n,e.shape,"float32")}},{key:"log",value:function(e){xi(e,"log");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r){var a=t[r];n[r]=Math.log(a)}return this.makeOutput(n,e.shape,"float32")}},{key:"log1p",value:function(e){xi(e,"log1p");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r){var a=t[r];n[r]=Math.log1p(a)}return this.makeOutput(n,e.shape,"float32")}},{key:"sqrt",value:function(e){xi(e,"sqrt");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r){var a=t[r];n[r]=Math.sqrt(a)}return this.makeOutput(n,e.shape,"float32")}},{key:"rsqrt",value:function(e){xi(e,"rsqrt");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r){var a=t[r];n[r]=1/Math.sqrt(a)}return this.makeOutput(n,e.shape,"float32")}},{key:"reciprocal",value:function(e){xi(e,"reciprocal");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r)n[r]=1/t[r];return this.makeOutput(n,e.shape,"float32")}},{key:"linear",value:function(e){return e}},{key:"relu",value:function(e){xi(e,"relu");for(var t=a.zeros(e.shape,e.dtype),n=this.readSync(t.dataId),r=this.readSync(e.dataId),i=0;i<r.length;++i)n[i]=Math.max(0,r[i]);return t}},{key:"relu6",value:function(e){xi(e,"relu");for(var t=a.zeros(e.shape,e.dtype),n=this.readSync(t.dataId),r=this.readSync(e.dataId),i=0;i<r.length;++i)n[i]=Math.min(Math.max(0,r[i]),6);return t}},{key:"prelu",value:function(e,t){return xi([e,t],"prelu"),this.broadcastedBinaryOp(e,t,e.dtype,(function(e,t){return e<0?t*e:e}))}},{key:"elu",value:function(e){xi(e,"elu");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r){var a=n[r];t[r]=a>=0?a:Math.exp(a)-1}return this.makeOutput(t,e.shape,"float32")}},{key:"eluDer",value:function(e,t){xi([e,t],"eluDer");for(var n=new Float32Array(t.size),r=this.readSync(t.dataId),a=this.readSync(e.dataId),i=0;i<r.length;++i){var o=r[i];n[i]=o>=1?a[i]:a[i]*(o+1)}return this.makeOutput(n,t.shape,"float32")}},{key:"selu",value:function(e){xi(e,"selu");for(var t=a.backend_util.SELU_SCALEALPHA,n=a.backend_util.SELU_SCALE,r=new Float32Array(e.size),i=this.readSync(e.dataId),o=0;o<i.length;++o){var s=i[o];r[o]=s>=0?n*s:t*(Math.exp(s)-1)}return this.makeOutput(r,e.shape,"float32")}},{key:"clip",value:function(e,t,n){xi(e,"clip");for(var r=new Float32Array(e.size),a=this.readSync(e.dataId),i=0;i<a.length;++i){var o=a[i];r[i]=o>n?n:o<t?t:o}return this.makeOutput(r,e.shape,e.dtype)}},{key:"abs",value:function(e){for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.abs(n[r]);return this.makeOutput(t,e.shape,"float32")}},{key:"complexAbs",value:function(e){for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<e.size;++r){var a=n[2*r],i=n[2*r+1];t[r]=Math.hypot(a,i)}return this.makeOutput(t,e.shape,"float32")}},{key:"int",value:function(e){xi(e,"int");for(var t=new Int32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=n[r];return this.makeOutput(t,e.shape,"int32")}},{key:"sigmoid",value:function(e){xi(e,"sigmoid");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=1/(1+Math.exp(-n[r]));return this.makeOutput(t,e.shape,"float32")}},{key:"softplus",value:function(e){xi(e,"softplus");for(var t=Math.log(1.1920928955078125e-7)+2,n=new Float32Array(e.size),r=this.readSync(e.dataId),a=0;a<r.length;++a){var i=r[a]>-t,o=r[a]<t,s=Math.exp(r[a]),u=void 0;u=o?s:i?r[a]:Math.log(1+s),n[a]=u}return this.makeOutput(n,e.shape,"float32")}},{key:"sin",value:function(e){xi(e,"sin");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.sin(n[r]);return this.makeOutput(t,e.shape,"float32")}},{key:"tan",value:function(e){xi(e,"tan");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.tan(n[r]);return this.makeOutput(t,e.shape,"float32")}},{key:"asin",value:function(e){xi(e,"asin");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.asin(n[r]);return this.makeOutput(t,e.shape,"float32")}},{key:"acos",value:function(e){xi(e,"acos");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.acos(n[r]);return this.makeOutput(t,e.shape,"float32")}},{key:"atan",value:function(e){xi(e,"atan");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.atan(n[r]);return this.makeOutput(t,e.shape,"float32")}},{key:"atan2",value:function(e,t){return xi([e,t],"atan2"),this.broadcastedBinaryOp(e,t,e.dtype,(function(e,t){return Math.atan2(e,t)}))}},{key:"sinh",value:function(e){xi(e,"sinh");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.sinh(n[r]);return this.makeOutput(t,e.shape,"float32")}},{key:"cosh",value:function(e){xi(e,"cosh");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.cosh(n[r]);return this.makeOutput(t,e.shape,"float32")}},{key:"tanh",value:function(e){xi(e,"tanh");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;
2++r)t[r]=a.util.tanh(n[r]);return this.makeOutput(t,e.shape,"float32")}},{key:"asinh",value:function(e){xi(e,"asinh");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.asinh(n[r]);return this.makeOutput(t,e.shape,"float32")}},{key:"acosh",value:function(e){xi(e,"acosh");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.acosh(n[r]);return this.makeOutput(t,e.shape,"float32")}},{key:"atanh",value:function(e){xi(e,"atanh");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.atanh(n[r]);return this.makeOutput(t,e.shape,"float32")}},{key:"erf",value:function(e){xi(e,"erf");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=a.backend_util.ERF_P,i=a.backend_util.ERF_A1,o=a.backend_util.ERF_A2,s=a.backend_util.ERF_A3,u=a.backend_util.ERF_A4,c=a.backend_util.ERF_A5,l=0;l<n.length;++l){var h=Math.sign(n[l]),d=Math.abs(n[l]),f=1/(1+r*d);t[l]=h*(1-((((c*f+u)*f+s)*f+o)*f+i)*f*Math.exp(-d*d))}return this.makeOutput(t,e.shape,"float32")}},{key:"step",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;xi(e,"step");for(var n=new Float32Array(e.size),r=this.readSync(e.dataId),a=0;a<r.length;++a){var i=r[a];isNaN(i)?n[a]=NaN:n[a]=i>0?1:t}return this.makeOutput(n,e.shape,"float32")}},{key:"fusedConv2d",value:function(e){var t=e.input,n=e.filter,r=e.convInfo,a=e.bias,i=e.activation,o=e.preluActivationWeights,s=this.conv2d(t,n,r);return a&&(s=this.add(s,a)),i&&(s=Ti(this,s,i,o)),s}},{key:"conv2d",value:function(e,t,n){xi([e,t],"conv2d");for(var r=n.filterHeight,i=n.filterWidth,o=n.dilationHeight,s=n.dilationWidth,u=n.padInfo.left,c=n.padInfo.top,l="channelsLast"===n.dataFormat,h=a.buffer(n.outShape,e.dtype),d=e.strides[0],f=l?e.strides[1]:e.strides[2],p=l?e.strides[2]:1,m=l?1:e.strides[1],v=h.strides[0],g=l?h.strides[1]:h.strides[2],b=l?h.strides[2]:1,y=l?1:h.strides[1],x=this.readSync(e.dataId),w=this.readSync(t.dataId),O=h.values,k=0;k<n.batchSize;++k)for(var S=k*d,_=k*v,j=0;j<n.outHeight;++j)for(var E=_+j*g,T=j*n.strideHeight-c,C=0;C<r;C++){var M=T+C*o;if(!(M<0||M>=n.inHeight))for(var A=C*t.strides[0],N=S+M*f,R=0;R<n.outWidth;++R)for(var I=E+R*b,L=R*n.strideWidth-u,D=0;D<i;D++){var P=L+D*s;if(!(P<0||P>=n.inWidth))for(var z=N+P*p,F=A+D*t.strides[1],B=0;B<n.inChannels;++B){for(var U=x[z+B*m],W=0;W<n.outChannels;++W)O[I+W*y]+=U*w[F+W];F+=n.outChannels}}}return h.toTensor()}},{key:"conv3d",value:function(e,t,n){for(var r=n.filterDepth,i=n.filterHeight,o=n.filterWidth,s=n.dilationDepth,u=n.dilationHeight,c=n.dilationWidth,l=n.padInfo.front,h=n.padInfo.left,d=n.padInfo.top,f=a.buffer(n.outShape,e.dtype),p=this.readSync(e.dataId),m=this.readSync(t.dataId),v=f.values,g=0;g<n.batchSize;++g)for(var b=g*e.strides[0],y=g*f.strides[0],x=0;x<n.outDepth;++x)for(var w=y+x*f.strides[1],O=x*n.strideDepth-l,k=0;k<r;k++){var S=O+k*s;if(!(S<0||S>=n.inDepth))for(var _=k*t.strides[0],j=b+S*e.strides[1],E=0;E<n.outHeight;++E)for(var T=w+E*f.strides[2],C=E*n.strideHeight-d,M=0;M<i;M++){var A=C+M*u;if(!(A<0||A>=n.inHeight))for(var N=_+M*t.strides[1],R=j+A*e.strides[2],I=0;I<n.outWidth;++I)for(var L=T+I*n.outChannels,D=I*n.strideWidth-h,P=0;P<o;P++){var z=D+P*c;if(!(z<0||z>=n.inWidth))for(var F=N+P*t.strides[2],B=R+z*n.inChannels,U=F,W=0;W<n.inChannels;++W){for(var V=p[B+W],G=0;G<n.outChannels;++G)v[L+G]+=V*m[U+G];U+=n.outChannels}}}}return f.toTensor()}},{key:"conv2dDerInput",value:function(e,t,n){xi([e,t],"conv2dDerInput");for(var r=a.buffer(n.inShape,"float32"),i=r.values,o=this.readSync(e.dataId),s=this.readSync(t.dataId),u=Object(h.a)(t.strides,3),c=u[0],l=u[1],d=u[2],f=n.batchSize,p=n.filterHeight,m=n.filterWidth,v=n.inChannels,g=n.inHeight,b=n.inWidth,y=n.outChannels,x=n.outHeight,w=n.outWidth,O=n.strideHeight,k=n.strideWidth,S=n.dataFormat,_=p-1-n.padInfo.top,j=m-1-n.padInfo.left,E="channelsLast"===S,T=r.strides[0],C=E?r.strides[1]:r.strides[2],M=E?r.strides[2]:1,A=E?1:r.strides[1],N=e.strides[0],R=E?e.strides[1]:e.strides[2],I=E?e.strides[2]:1,L=E?1:e.strides[1],D=0;D<f;++D)for(var P=0;P<v;++P)for(var z=0;z<g;++z)for(var F=z-_,B=Math.max(0,Math.ceil(F/O)),U=Math.min(x,(p+F)/O),W=0;W<b;++W){for(var V=W-j,G=Math.max(0,Math.ceil(V/k)),H=Math.min(w,(m+V)/k),q=0,X=B;X<U;++X)for(var Y=X*O-F,K=G;K<H;++K)for(var Z=N*D+R*X+I*K,J=c*(p-1-Y)+l*(m-1-(K*k-V))+d*P,Q=0;Q<y;++Q){q+=o[Z+L*Q]*s[J+Q]}i[T*D+C*z+M*W+A*P]=q}return r.toTensor()}},{key:"conv3dDerInput",value:function(e,t,n){for(var r=a.buffer(n.inShape,"float32"),i=r.values,o=Object(h.a)(r.strides,4),s=o[0],u=o[1],c=o[2],l=o[3],d=this.readSync(e.dataId),f=Object(h.a)(e.strides,4),p=f[0],m=f[1],v=f[2],g=f[3],b=this.readSync(t.dataId),y=Object(h.a)(t.strides,4),x=y[0],w=y[1],O=y[2],k=y[3],S=n.batchSize,_=n.filterDepth,j=n.filterHeight,E=n.filterWidth,T=n.inChannels,C=n.inDepth,M=n.inHeight,A=n.inWidth,N=n.outChannels,R=n.outDepth,I=n.outHeight,L=n.outWidth,D=n.strideDepth,P=n.strideHeight,z=n.strideWidth,F=_-1-n.padInfo.front,B=j-1-n.padInfo.top,U=E-1-n.padInfo.left,W=0;W<S;++W)for(var V=0;V<T;++V)for(var G=0;G<C;++G)for(var H=G-F,q=Math.max(0,Math.ceil(H/D)),X=Math.min(R,(_+H)/D),Y=0;Y<M;++Y)for(var K=Y-B,Z=Math.max(0,Math.ceil(K/P)),J=Math.min(I,(j+K)/P),Q=0;Q<A;++Q){for(var $=Q-U,ee=Math.max(0,Math.ceil($/z)),te=Math.min(L,(E+$)/z),ne=0,re=q;re<X;++re)for(var ae=re*D-H,ie=Z;ie<J;++ie)for(var oe=ie*P-K,se=ee;se<te;++se)for(var ue=p*W+m*re+v*ie+g*se,ce=x*(_-1-ae)+w*(j-1-oe)+O*(E-1-(se*z-$))+k*V,le=0;le<N;
2++le){ne+=d[ue+le]*b[ce+le]}i[s*W+u*G+c*Y+l*Q+V]=ne}return r.toTensor()}},{key:"conv2dDerFilter",value:function(e,t,n){xi([e,t],"conv2dDerFilter");for(var r=n.strideHeight,i=n.strideWidth,o=n.filterHeight,s=n.filterWidth,u="channelsLast"===n.dataFormat,c=a.buffer(n.filterShape,"float32"),l=n.padInfo.left,h=n.padInfo.top,d=this.bufferSync(e),f=this.bufferSync(t),p=0;p<o;++p)for(var m=Math.max(0,Math.ceil((h-p)/r)),v=Math.min(n.outHeight,(n.inHeight+h-p)/r),g=0;g<s;++g)for(var b=Math.max(0,Math.ceil((l-g)/i)),y=Math.min(n.outWidth,(n.inWidth+l-g)/i),x=0;x<n.inChannels;++x)for(var w=0;w<n.outChannels;++w){for(var O=0,k=0;k<n.batchSize;++k)for(var S=m;S<v;++S)for(var _=p+S*r-h,j=b;j<y;++j){var E=g+j*i-l;O+=u?d.get(k,_,E,x)*f.get(k,S,j,w):d.get(k,x,_,E)*f.get(k,w,S,j)}c.set(O,p,g,x,w)}return c.toTensor()}},{key:"conv3dDerFilter",value:function(e,t,n){for(var r=n.strideDepth,i=n.strideHeight,o=n.strideWidth,s=n.filterDepth,u=n.filterHeight,c=n.filterWidth,l=a.buffer(n.filterShape,"float32"),d=l.values,f=Object(h.a)(l.strides,4),p=f[0],m=f[1],v=f[2],g=f[3],b=this.readSync(t.dataId),y=Object(h.a)(t.strides,4),x=y[0],w=y[1],O=y[2],k=y[3],S=this.readSync(e.dataId),_=Object(h.a)(e.strides,4),j=_[0],E=_[1],T=_[2],C=_[3],M=n.padInfo.front,A=n.padInfo.left,N=n.padInfo.top,R=0;R<s;++R)for(var I=Math.max(0,Math.ceil((M-R)/r)),L=Math.min(n.outDepth,(n.inDepth+M-R)/r),D=R*p,P=0;P<u;++P)for(var z=Math.max(0,Math.ceil((N-P)/i)),F=Math.min(n.outHeight,(n.inHeight+N-P)/i),B=P*m+D,U=0;U<c;++U)for(var W=Math.max(0,Math.ceil((A-U)/o)),V=Math.min(n.outWidth,(n.inWidth+A-U)/o),G=U*v+B,H=0;H<n.inChannels;++H)for(var q=H*g+G,X=0;X<n.outChannels;++X){for(var Y=0,K=0;K<n.batchSize;++K)for(var Z=K*j,J=K*x,Q=I;Q<L;++Q)for(var $=(R+Q*r-M)*E+Z,ee=Q*w+J,te=z;te<F;++te)for(var ne=(P+te*i-N)*T+$,re=te*O+ee,ae=W;ae<V;++ae){var ie=ae*k+re;Y+=S[(U+ae*o-A)*C+ne+H]*b[ie+X]}d[q+X]=Y}return l.toTensor()}},{key:"fusedDepthwiseConv2D",value:function(e){var t=e.input,n=e.filter,r=e.convInfo,a=e.bias,i=e.activation,o=e.preluActivationWeights,s=this.depthwiseConv2D(t,n,r);return a&&(s=this.add(s,a)),i&&(s=Ti(this,s,i,o)),s}},{key:"depthwiseConv2D",value:function(e,t,n){xi([e,t],"depthwiseConv2D");for(var r=n.filterHeight,i=n.filterWidth,o=n.dilationHeight,s=n.dilationWidth,u=n.padInfo.left,c=n.padInfo.top,l=n.outChannels/n.inChannels,h=a.buffer(n.outShape,e.dtype),d=this.readSync(e.dataId),f=this.readSync(t.dataId),p=h.values,m=0;m<n.batchSize;++m)for(var v=m*e.strides[0],g=m*h.strides[0],b=0;b<n.outHeight;++b)for(var y=g+b*h.strides[1],x=b*n.strideHeight-u,w=0;w<r;++w){var O=x+w*o;if(!(O<0||O>=n.inHeight))for(var k=w*t.strides[0],S=v+O*e.strides[1],_=0;_<n.outWidth;++_)for(var j=y+_*h.strides[2],E=_*n.strideWidth-c,T=0;T<i;++T){var C=E+T*s;if(!(C<0||C>=n.inWidth))for(var M=k+T*t.strides[1],A=S+C*n.inChannels,N=j,R=M,I=0;I<n.inChannels;++I){for(var L=d[A+I],D=0;D<l;++D)p[N+D]+=L*f[R+D];N+=l,R+=l}}}return h.toTensor()}},{key:"depthwiseConv2DDerInput",value:function(e,t,n){xi([e,t],"depthwiseConv2DDerInput");for(var r=a.buffer(n.inShape,"float32"),i=r.values,o=Object(h.a)(r.strides,3),s=o[0],u=o[1],c=o[2],l=this.readSync(e.dataId),d=Object(h.a)(e.strides,3),f=d[0],p=d[1],m=d[2],v=this.readSync(t.dataId),g=Object(h.a)(t.strides,3),b=g[0],y=g[1],x=g[2],w=n.batchSize,O=n.filterHeight,k=n.filterWidth,S=n.inChannels,_=n.inHeight,j=n.inWidth,E=n.outChannels,T=n.outHeight,C=n.outWidth,M=n.strideHeight,A=n.strideWidth,N=O-1-n.padInfo.top,R=k-1-n.padInfo.left,I=E/S,L=0;L<w;++L)for(var D=0;D<S;++D)for(var P=0;P<_;++P)for(var z=P-N,F=Math.max(0,Math.ceil(z/M)),B=Math.min(T,(O+z)/M),U=0;U<j;++U){for(var W=U-R,V=Math.max(0,Math.ceil(W/A)),G=Math.min(C,(k+W)/A),H=0,q=F;q<B;++q)for(var X=q*M-z,Y=V;Y<G;++Y)for(var K=f*L+p*q+m*Y,Z=b*(O-1-X)+y*(k-1-(Y*A-W))+x*D,J=0;J<I;++J){H+=l[K+(D*I+J)]*v[Z+J]}i[s*L+u*P+c*U+D]=H}return r.toTensor()}},{key:"depthwiseConv2DDerFilter",value:function(e,t,n){xi([e,t],"depthwiseConv2DDerFilter");for(var r=n.strideHeight,i=n.strideWidth,o=n.filterHeight,s=n.filterWidth,u=a.buffer(n.filterShape,"float32"),c=n.padInfo.left,l=n.padInfo.top,h=n.outChannels/n.inChannels,d=this.bufferSync(e),f=this.bufferSync(t),p=0;p<o;++p)for(var m=Math.max(0,Math.ceil((l-p)/r)),v=Math.min(n.outHeight,(n.inHeight+l-p)/r),g=0;g<s;++g)for(var b=Math.max(0,Math.ceil((c-g)/i)),y=Math.min(n.outWidth,(n.inWidth+c-g)/i),x=0;x<n.outChannels;++x){for(var w=Math.trunc(x/h),O=x%h,k=0,S=0;S<n.batchSize;++S)for(var _=m;_<v;++_)for(var j=p+_*r-l,E=b;E<y;++E){var T=g+E*i-c;k+=d.get(S,j,T,w)*f.get(S,_,E,x)}u.set(k,p,g,w,O)}return u.toTensor()}},{key:"tile",value:function(e,t){return xi(e,"tile"),_i(this.bufferSync(e),t)}},{key:"gather",value:function(e,t,n){xi([e,t],"gather");var r=e.shape.slice(),i=this.readSync(t.dataId);r[n]=i.length;for(var o=a.buffer(r,e.dtype),s=this.bufferSync(e),u=0;u<o.size;++u){var c=o.indexToLoc(u),l=c.slice();l[n]=i[c[n]];var h=s.locToIndex(l);o.values[u]=s.values[h]}return o.toTensor()}},{key:"batchToSpaceND",value:function(e,t,n){xi([e],"batchToSpaceND");var r=t.reduce((function(e,t){return e*t})),i=a.backend_util.getReshaped(e.shape,t,r),o=a.backend_util.getPermuted(i.length,t.length),s=a.backend_util.getReshapedPermuted(e.shape,t,r),u=a.backend_util.getSliceBeginCoords(n,t.length),c=a.backend_util.getSliceSize(s,n,t.length);return a.transpose(e.reshape(i),o).reshape(s).slice(u,c)}},{key:"maxPool",value:function(e,t){return xi(e,"maxPool"),wi(this.readSync(e.dataId),e.shape,e.dtype,e.strides,t,"max").toTensor()}},{key:"maxPoolBackprop",value:function(e,t,n,r){xi([t,n],"maxPoolBackprop");for(var i=this.readSync(t.dataId),o=Object(a.buffer)(r.outShape,t.dtype,Oi(i,t.shape,t.dtype,r).values),s=r.strideHeight,u=r.strideWidth,c=r.dilationHeight,l=r.dilationWidth,h=r.effectiveFilterHeight,d=r.effectiveFilterWidth,f=d-1-r.padInfo.left,p=h-1-r.padInfo.top,m=a.buffer(t.shape,"float32"),v=this.bufferSync(e),g=0;g<r.batchSize;++g)for(var b=0;
2b<r.inChannels;++b)for(var y=0;y<r.inHeight;++y)for(var x=0;x<r.inWidth;++x){for(var w=y-p,O=x-f,k=0,S=0;S<h;S+=c){var _=(w+S)/s;if(!(_<0||_>=r.outHeight||Math.floor(_)!==_))for(var j=0;j<d;j+=l){var E=(O+j)/u;if(!(E<0||E>=r.outWidth||Math.floor(E)!==E)){var T=h*d-1-o.get(g,_,E,b)===S*d+j?1:0;if(0!==T)k+=v.get(g,_,E,b)*T}}}m.set(k,g,y,x,b)}return m.toTensor()}},{key:"avgPoolBackprop",value:function(e,t,n){xi([e,t],"avgPoolBackprop");for(var r=n.strideHeight,i=n.strideWidth,o=n.filterHeight,s=n.filterWidth,u=n.dilationHeight,c=n.dilationWidth,l=n.effectiveFilterHeight,h=n.effectiveFilterWidth,d=h-1-n.padInfo.left,f=l-1-n.padInfo.top,p=a.buffer(t.shape,"float32"),m=1/(o*s),v=this.bufferSync(e),g=0;g<n.batchSize;++g)for(var b=0;b<n.inChannels;++b)for(var y=0;y<n.inHeight;++y)for(var x=0;x<n.inWidth;++x){for(var w=y-f,O=x-d,k=0,S=0;S<l;S+=u){var _=(w+S)/r;if(!(_<0||_>=n.outHeight||Math.floor(_)!==_))for(var j=0;j<h;j+=c){var E=(O+j)/i;if(!(E<0||E>=n.outWidth||Math.floor(E)!==E))k+=v.get(g,_,E,b)}}p.set(k*m,g,y,x,b)}return p.toTensor()}},{key:"pool3d",value:function(e,t,n){xi(e,"pool3d");for(var r=t.strideDepth,i=t.strideHeight,o=t.strideWidth,s=t.dilationDepth,u=t.dilationHeight,c=t.dilationWidth,l=t.effectiveFilterDepth,h=t.effectiveFilterHeight,d=t.effectiveFilterWidth,f=t.padInfo.front,p=t.padInfo.top,m=t.padInfo.left,v="max"===n?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,g=this.readSync(e.dataId),b=a.buffer(t.outShape,e.dtype),y=b.values,x=t.outShape[1]*t.outShape[2]*t.outShape[3]*t.outShape[4],w=t.outShape[2]*t.outShape[3]*t.outShape[4],O=t.outShape[3]*t.outShape[4],k=t.outShape[4],S=0;S<t.batchSize;++S)for(var _=S*x,j=S*e.strides[0],E=0;E<t.inChannels;++E)for(var T=0;T<t.outDepth;++T){for(var C=T*r-f,M=C;M<0;)M+=s;for(var A=Math.min(t.inDepth,l+C),N=_+T*w,R=0;R<t.outHeight;++R){for(var I=R*i-p,L=I;L<0;)L+=u;for(var D=Math.min(t.inHeight,h+I),P=N+R*O,z=0;z<t.outWidth;++z){for(var F=z*o-m,B=F;B<0;)B+=c;for(var U=Math.min(t.inWidth,d+F),W=P+z*k,V=v,G=0,H=0,q=M;q<A;q+=s){for(var X=j+q*e.strides[1],Y=L;Y<D;Y+=u){for(var K=X+Y*e.strides[2],Z=B;Z<U;Z+=c){var J=g[K+Z*e.strides[3]+E];if("max"===n&&J>V?V=J:"avg"===n&&(G+=J,H++),isNaN(V))break}if(isNaN(V))break}if(isNaN(V))break}y[W+E]="avg"===n?G/H:V}}}return b.toTensor()}},{key:"avgPool3d",value:function(e,t){return xi(e,"avgPool3d"),this.pool3d(e,t,"avg").toFloat()}},{key:"avgPool3dBackprop",value:function(e,t,n){xi([e,t],"avgPool3dBackprop");for(var r=n.strideDepth,i=n.strideHeight,o=n.strideWidth,s=n.filterDepth,u=n.filterHeight,c=n.filterWidth,l=n.dilationDepth,h=n.dilationHeight,d=n.dilationWidth,f=n.effectiveFilterDepth,p=n.effectiveFilterHeight,m=n.effectiveFilterWidth,v=f-1-n.padInfo.front,g=m-1-n.padInfo.left,b=p-1-n.padInfo.top,y=a.buffer(t.shape,"float32"),x=1/(s*u*c),w=this.bufferSync(e),O=0;O<n.batchSize;++O)for(var k=0;k<n.inChannels;++k)for(var S=0;S<n.inDepth;++S)for(var _=0;_<n.inHeight;++_)for(var j=0;j<n.inWidth;++j){for(var E=S-v,T=_-b,C=j-g,M=0,A=0;A<f;A+=l){var N=(E+A)/r;if(!(N<0||N>=n.outDepth||Math.floor(N)!==N))for(var R=0;R<p;R+=h){var I=(T+R)/i;if(!(I<0||I>=n.outHeight||Math.floor(I)!==I))for(var L=0;L<m;L+=d){var D=(C+L)/o;if(!(D<0||D>=n.outWidth||Math.floor(D)!==D))M+=w.get(O,N,I,D,k)}}}y.set(M*x,O,S,_,j,k)}return y.toTensor()}},{key:"maxPool3d",value:function(e,t){return xi(e,"maxPool3d"),this.pool3d(e,t,"max").toFloat()}},{key:"maxPool3dPositions",value:function(e,t){for(var n=a.buffer(t.outShape,"int32"),r=t.strideDepth,i=t.strideHeight,o=t.strideWidth,s=t.dilationDepth,u=t.dilationHeight,c=t.dilationWidth,l=t.effectiveFilterDepth,h=t.effectiveFilterHeight,d=t.effectiveFilterWidth,f=t.padInfo.front,p=t.padInfo.top,m=t.padInfo.left,v=this.bufferSync(e),g=0;g<t.batchSize;++g)for(var b=0;b<t.inChannels;++b)for(var y=0;y<t.outDepth;++y){for(var x=y*r-f,w=x;w<0;)w+=s;for(var O=Math.min(t.inDepth,l+x),k=0;k<t.outHeight;++k){for(var S=k*i-p,_=S;_<0;)_+=u;for(var j=Math.min(t.inHeight,h+S),E=0;E<t.outWidth;++E){for(var T=E*o-m,C=T;C<0;)C+=c;for(var M=Math.min(t.inWidth,d+T),A=Number.NEGATIVE_INFINITY,N=-1,R=w;R<O;R+=s)for(var I=R-x,L=_;L<j;L+=u)for(var D=L-S,P=C;P<M;P+=c){var z=P-T,F=v.get(g,R,L,P,b);F>=A&&(A=F,N=I*h*d+D*h+z)}n.set(N,g,y,k,E,b)}}}return n.toTensor()}},{key:"maxPool3dBackprop",value:function(e,t,n,r){xi([t,n],"maxPool3dBackprop");for(var i=this.maxPool3dPositions(t,r),o=r.strideDepth,s=r.strideHeight,u=r.strideWidth,c=r.dilationDepth,l=r.dilationHeight,h=r.dilationWidth,d=r.effectiveFilterDepth,f=r.effectiveFilterHeight,p=r.effectiveFilterWidth,m=d-1-r.padInfo.front,v=p-1-r.padInfo.left,g=f-1-r.padInfo.top,b=a.buffer(t.shape,"float32"),y=this.bufferSync(i),x=this.bufferSync(e),w=0;w<r.batchSize;++w)for(var O=0;O<r.inChannels;++O)for(var k=0;k<r.inDepth;++k)for(var S=0;S<r.inHeight;++S)for(var _=0;_<r.inWidth;++_){for(var j=k-m,E=S-g,T=_-v,C=0,M=0;M<d;M+=c){var A=(j+M)/o;if(!(A<0||A>=r.outDepth||Math.floor(A)!==A))for(var N=0;N<f;N+=l){var R=(E+N)/s;if(!(R<0||R>
2=r.outHeight||Math.floor(R)!==R))for(var I=0;I<p;I+=h){var L=(T+I)/u;if(!(L<0||L>=r.outWidth||Math.floor(L)!==L)){var D=d*f*p-1-y.get(w,A,R,L,O)===M*f*p+N*p+I?1:0;if(0!==D)C+=x.get(w,A,R,L,O)*D}}}}b.set(C,w,k,S,_,O)}return b.toTensor()}},{key:"cast",value:function(e,t){return a.backend_util.castTensor(e,t,this)}},{key:"avgPool",value:function(e,t){return xi(e,"avgPool"),xi(e,"maxPool"),wi(this.readSync(e.dataId),e.shape,e.dtype,e.strides,t,"avg").toTensor().toFloat()}},{key:"resizeBilinear",value:function(e,t,n,r){xi(e,"resizeBilinear");for(var i=Object(h.a)(e.shape,4),o=i[0],s=i[1],u=i[2],c=i[3],l=this.readSync(e.dataId),d=new Float32Array(a.util.sizeFromShape([o,t,n,c])),f=[r&&t>1?s-1:s,r&&n>1?u-1:u],p=[r&&t>1?t-1:t,r&&n>1?n-1:n],m=0,v=f[0]/p[0],g=f[1]/p[1],b=0;b<o;b++)for(var y=0;y<t;y++)for(var x=v*y,w=Math.floor(x),O=x-w,k=Math.min(s-1,Math.ceil(x)),S=b*e.strides[0]+w*e.strides[1],_=b*e.strides[0]+k*e.strides[1],j=0;j<n;j++)for(var E=g*j,T=Math.floor(E),C=E-T,M=Math.min(u-1,Math.ceil(E)),A=S+T*e.strides[2],N=_+T*e.strides[2],R=S+M*e.strides[2],I=_+M*e.strides[2],L=0;L<c;L++){var D=l[A+L],P=l[N+L],z=D+(l[R+L]-D)*C,F=z+(P+(l[I+L]-P)*C-z)*O;d[m++]=F}return a.tensor(d,[o,t,n,c])}},{key:"resizeBilinearBackprop",value:function(e,t,n){xi([e,t],"resizeBilinearBackprop");for(var r=Object(h.a)(t.shape,4),i=r[0],o=r[1],s=r[2],u=r[3],c=Object(h.a)(e.shape,3),l=c[1],d=c[2],f=new Float32Array(i*o*s*u),p=[n&&l>1?o-1:o,n&&d>1?s-1:s],m=[n&&l>1?l-1:l,n&&d>1?d-1:d],v=p[0]/m[0],g=p[1]/m[1],b=this.readSync(e.dataId),y=0,x=0;x<i;x++)for(var w=x*t.strides[0],O=0;O<l;O++)for(var k=O*v,S=Math.floor(k),_=Math.min(Math.ceil(k),o-1),j=w+S*t.strides[1],E=w+_*t.strides[1],T=k-S,C=1-T,M=0;M<d;M++)for(var A=M*g,N=Math.floor(A),R=Math.min(Math.ceil(A),s-1),I=A-N,L=1-I,D=j+N*t.strides[2],P=j+R*t.strides[2],z=E+N*t.strides[2],F=E+R*t.strides[2],B=C*L,U=C*I,W=T*L,V=T*I,G=0;G<u;G++){var H=b[y++];f[D+G]+=H*B,f[P+G]+=H*U,f[z+G]+=H*W,f[F+G]+=H*V}return a.tensor4d(f,[i,s,o,u],t.dtype)}},{key:"resizeNearestNeighbor",value:function(e,t,n,r){xi(e,"resizeNearestNeighbor");for(var i=Object(h.a)(e.shape,4),o=i[0],s=i[1],u=i[2],c=i[3],l=this.readSync(e.dataId),d=new Float32Array(o*t*n*c),f=[r&&t>1?s-1:s,r&&n>1?u-1:u],p=[r&&t>1?t-1:t,r&&n>1?n-1:n],m=f[0]/p[0],v=f[1]/p[1],g=0,b=0;b<o;b++)for(var y=b*e.strides[0],x=0;x<t;x++)for(var w=m*x,O=y+Math.min(s-1,r?Math.round(w):Math.floor(w))*e.strides[1],k=0;k<n;k++)for(var S=v*k,_=O+Math.min(u-1,r?Math.round(S):Math.floor(S))*e.strides[2],j=0;j<c;j++){var E=l[_+j];d[g++]=E}return a.tensor(d,[o,t,n,c],e.dtype)}},{key:"resizeNearestNeighborBackprop",value:function(e,t,n){xi([e,t],"resizeNearestNeighborBackprop");for(var r=Object(h.a)(t.shape,4),i=r[0],o=r[1],s=r[2],u=r[3],c=Object(h.a)(e.shape,3),l=c[1],d=c[2],f=new Float32Array(i*o*s*u),p=this.readSync(e.dataId),m=[n&&l>1?o-1:o,n&&d>1?s-1:s],v=[n&&l>1?l-1:l,n&&d>1?d-1:d],g=m[0]/v[0],b=m[1]/v[1],y=1/g,x=1/b,w=2*Math.ceil(y)+2,O=2*Math.ceil(x)+2,k=0;k<i;k++)for(var S=k*t.strides[0],_=0;_<o;_++)for(var j=S+_*t.strides[1],E=Math.floor(_*y),T=Math.floor(E-w/2),C=0;C<s;C++)for(var M=j+C*t.strides[2],A=Math.floor(C*x),N=Math.floor(A-O/2),R=0;R<u;R++){for(var I=0,L=0;L<w;L++){var D=L+T;if(!(D<0||D>=l)){var P=S+D*e.strides[1],z=D*g;if(_===Math.min(o-1,n?Math.round(z):Math.floor(z)))for(var F=0;F<O;F++){var B=F+N;if(!(B<0||B>=d)){var U=P+B*e.strides[2],W=B*b;C===Math.min(s-1,n?Math.round(W):Math.floor(W))&&(I+=p[U+R])}}}}f[M+R]=I}return a.tensor4d(f,t.shape,t.dtype)}},{key:"batchNorm",value:function(e,t,n,r,i,o){xi([e,t,n,i,r],"batchNorm");for(var s=this.readSync(e.dataId),u=this.readSync(t.dataId),c=this.readSync(n.dataId),l=i?this.readSync(i.dataId):new Float32Array([1]),h=r?this.readSync(r.dataId):new Float32Array([0]),d=new Float32Array(s.length),f=h.length,p=l.length,m=c.length,v=u.length,g=0,b=0,y=0,x=0,w=0;w<s.length;++w)d[w]=h[g++]+(s[w]-u[b++])*l[y++]/Math.sqrt(c[x++]+o),g>=f&&(g=0),b>=v&&(b=0),y>=p&&(y=0),x>=m&&(x=0);return a.tensor4d(d,e.shape)}},{key:"localResponseNormalization4D",value:function(e,t,n,r,i){xi(e,"localResponseNormalization4D");var o=e.shape[3],s=o-1,u=this.readSync(e.dataId),c=e.size,l=new Float32Array(c);function h(e){for(var n=e%o,r=e-n+Math.max(0,n-t),a=e-n+Math.min(n+t,s),i=0;r<=a;r++){var c=u[r];i+=c*c}return i}for(var d=0;d<c;d++){var f=h(d),p=u[d]*Math.pow(n+r*f,-i);l[d]=p}return a.tensor4d(l,e.shape)}},{key:"LRNGrad",value:function(e,t,n,r,i,o,s){xi(e,"LRNGrad");for(var u=e.shape[3],c=this.readSync(e.dataId),l=this.readSync(t.dataId),h=this.readSync(n.dataId),d=new Float32Array(e.size),f=e.size,p=0;p<f;p++){for(var m=p%u,v=p-m+Math.max(0,m-r),g=p-m+Math.min(u,m+r+1),b=0,y=v;y<g;y++)b+=Math.pow(l[y],2);b=o*b+i;for(var x=v;x<g;x++){var w=-2*o*s*l[x]*h[p]/b;p===x&&(w+=Math.pow(b,-s)),w*=c[p],d[x]+=w}}return a.tensor4d(d,e.shape)}},{key:"multinomial",value:function(e,t,n,r){xi(e,"multinomial");for(var i=t?e:a.softmax(e),o=i.shape[0],s=i.shape[1],u=a.zeros([o,n],"int32"),c=this.readSync(u.dataId),l=this.readSync(i.dataId),h=0;h<o;++h){var d=h*s,f=new Float32Array(s-1);f[0]=l[d];for(var p=1;p<f.length;++p)f[p]=f[p-1]+l[d+p];for(var m=pi.alea(r.toString()),v=h*n,g=0;g<n;++g){var b=m();c[v+g]=f.length;for(var y=0;y<f.length;y++)if(b<f[y]){c[v+g]=y;break}}}return u}},{key:"oneHot",value:function(e,t,n,r){xi(e,"oneHot");var i=new Float32Array(e.size*t);i.fill(r);for(var o=this.readSync(e.dataId),s=0;s<e.size;++s)o[s]>=0&&o[s]<t&&(i[s*t+o[s]]=n);return a.tensor2d(i,[e.size,t],"int32")}},{key:"nonMaxSuppression",value:function(e,t,n,r,a){xi(e,"nonMaxSuppression");var i=this.readSync(e.dataId),o=this.readSync(t.dataId);return ki(i,o,n,r,a)}},{key:"fft",value:function(e){return this.fftBatch(e,!1)}},{key:"ifft",value:function(e){return this.fftBatch(e,!0)}},{key:"fftBatch",value:function(e,t){for(var n=e.shape[0],r=e.shape[1],i=a.buffer(e.shape,"float32"),o=a.buffer(e.shape,"float32"),s=a.real(e).as2D(n,r),u=a.imag(e).as2D(n,r),c=0;c<n;c++)for(var l=s.slice([c,0],[1,r]),h=u.slice([c,0],[1,r]),d=a.complex(l,h),f=this.readSync(this.fftImpl(d,t).dataId),p=0;p<r;p++){var m=a.backend_util.getComplexWithIndex(f,p);i.values[c*r+p]=m.real,o.values[c*r+p]=m.imag}return a.complex(i.toTensor(),o.toTensor()).as2D(n,r)}},{key:"fftImpl",value:function(e,t){var n=e.as1D(),r=n.size;if(this.isExponentOf2(r)){var i=this.fftRadix2(n,r,t).as2D(e.shape[0],e.shape[1]);return t&&(i=a.complex(a.real(i).div(a.scalar(r)),a.imag(i).div(a.scalar(r)))),i}var o=this.readSync(e.dataId),s=this.fourierTransformByMatmul(o,r,t),u=a.backend_util.splitRealAndImagArrays(s);return a.complex(u.real,u.imag).as2D(e.shape[0],e.shape[1])}},{key:"isExponentOf2",value:function(e){return 0===(e&e-1)}},{key:"fftRadix2",value:function(e,t,n){if(1===t)return e;var r=this.readSync(e.dataId),i=t/2,o=a.backend_util.complexWithEvenIndex(r),s=a.complex(o.real,o.imag).as1D(),u=a.backend_util.complexWithOddIndex(r),c=a.complex(u.real,u.imag).as1D();s=this.fftRadix2(s,i,n),c=this.fftRadix2(c,i,n);var l=a.backend_util.exponents(t,n),h=a.complex(l.real,l.imag).mul(c),d=s.add(h),f=s.sub(h),p=a.real(d).concat(a.real(f)),m=a.imag(d).concat(a.imag(f));return a.complex(p,m).as1D()}},{key:"fourierTransformByMatmul",value:function(e,t,n){for(var r=new Float32Array(2*t),i=0;i<t;i++){for(var o=0,s=0,u=0;u<t;u++){var c=a.backend_util.exponent(i*u,t,n),l=a.backend_util.getComplexWithIndex(e,u);o+=l.real*c.real-l.imag*c.imag,s+=l.real*c.imag+l.imag*c.real}n&&(o/=t,s/=t),a.backend_util.assignToTypedArray(r,o,s,i)}return r}},{key:"depthToSpace",value:function(e,t,n){a.util.assert("NHWC"===n,(function(){return"Only NHWC dataFormat supported on CPU for depthToSpace. Got ".concat(n)})),a.util.assert(t>1,(function(){return"blockSize should be > 1 for depthToSpace, but was: ".concat(t)}));for(var r=e.shape[0],i=e.shape[1],o=e.shape[2],s=e.shape[3],u=i*t,c=o*t,l=s/(t*t),h=this.readSync(e.dataId),d=new Float32Array(r*u*c*l),f=0,p=0;p<r;++p)for(var m=0;m<u;++m)for(var v=Math.floor(m/t),g=m%t,b=0;b<c;++b)for(var y=Math.floor(b/t),x=(g*t+b%t)*l,w=0;w<l;++w){var O=w+x+s*(y+o*(v+i*p));d[f++]=h[O]}return a.tensor4d(d,[r,u,c,l])}},{key:"broadcastedBinaryOp",value:function(e,t,n,r){var i=a.backend_util.assertAndGetBroadcastShape(e.shape,t.shape),o=a.buffer(i,n),s=this.readSync(e.dataId),u=this.readSync(t.dataId),c=a.backend_util.getBroadcastDims(e.shape,i),l=a.backend_util.getBroadcastDims(t.shape,i),h=o.values;if(c.length+l.length===0)for(var d=0;d<h.length;++d)h[d]=r(s[d%s.length],u[d%u.length]);else for(var f=this.bufferSync(e),p=this.bufferSync(t),m=function(n){var a=o.indexToLoc(n),i=a.slice(-e.rank);
2c.forEach((function(e){return i[e]=0}));var d=f.locToIndex(i),m=a.slice(-t.rank);l.forEach((function(e){return m[e]=0}));var v=p.locToIndex(m);h[n]=r(s[d],u[v])},v=0;v<h.length;++v)m(v);return o.toTensor()}},{key:"broadcastedBinaryComplexOp",value:function(e,t,n){var r=a.backend_util.assertAndGetBroadcastShape(e.shape,t.shape),i=a.buffer(r,"float32"),o=a.buffer(r,"float32"),s=this.readSync(e.dataId),u=this.readSync(t.dataId),c=a.backend_util.getBroadcastDims(e.shape,r),l=a.backend_util.getBroadcastDims(t.shape,r),h=i.values,d=o.values;if(c.length+l.length===0)for(var f=0;f<h.length;f++){var p=f%s.length,m=f%u.length,v=n(s[2*p],s[2*p+1],u[2*m],u[2*m+1]);h[f]=v.real,d[f]=v.imag}else for(var g=this.bufferSync(this.data.get(e.dataId).complexTensors.real),b=this.bufferSync(this.data.get(t.dataId).complexTensors.real),y=function(r){var a=i.indexToLoc(r),o=a.slice(-e.rank);c.forEach((function(e){return o[e]=0}));var f=g.locToIndex(o),p=a.slice(-t.rank);l.forEach((function(e){return p[e]=0}));var m=b.locToIndex(p),v=n(s[2*f],s[2*f+1],u[2*m],u[2*m+1]);h[r]=v.real,d[r]=v.imag},x=0;x<h.length;x++)y(x);return this.complex(i.toTensor(),o.toTensor())}},{key:"split",value:function(e,t,n){return Si(e,t,n)}},{key:"dispose",value:function(){}},{key:"floatPrecision",value:function(){return 32}},{key:"epsilon",value:function(){return Object(zt.a)(Object(p.a)(n.prototype),"epsilon",this).call(this)}},{key:"cropAndResize",value:function(e,t,n,r,i,o){for(var s=Object(h.a)(e.shape,4),u=s[0],c=s[1],l=s[2],d=s[3],f=t.shape[0],p=Object(h.a)(r,2),m=p[0],v=p[1],g=a.buffer([f,m,v,d],"float32"),b=this.readSync(t.dataId),y=this.readSync(n.dataId),x=this.readSync(e.dataId),w=e.strides,O=g.strides,k=0;k<f;k++){var S=4*k,_=b[S],j=b[S+1],E=b[S+2],T=b[S+3],C=y[k];if(!(C>=u))for(var M=m>1?(E-_)*(c-1)/(m-1):0,A=v>1?(T-j)*(l-1)/(v-1):0,N=0;N<m;N++){var R=m>1?_*(c-1)+N*M:.5*(_+E)*(c-1);if(R<0||R>c-1)for(var I=0;I<v;I++)for(var L=0;L<d;L++){var D=L+I*O[2]+N*O[1]+k*O[0];g.values[D]=o}else if("bilinear"===i)for(var P=Math.floor(R),z=Math.ceil(R),F=R-P,B=0;B<v;B++){var U=v>1?j*(l-1)+B*A:.5*(j+T)*(l-1);if(U<0||U>l-1)for(var W=0;W<d;W++){var V=W+B*O[2]+N*O[1]+k*O[0];g.values[V]=o}else for(var G=Math.floor(U),H=Math.ceil(U),q=U-G,X=0;X<d;X++){var Y=X+G*w[2]+P*w[1]+C*w[0],K=x[Y],Z=x[Y=X+H*w[2]+P*w[1]+C*w[0]],J=x[Y=X+G*w[2]+z*w[1]+C*w[0]],Q=K+(Z-K)*q,$=J+(x[Y=X+H*w[2]+z*w[1]+C*w[0]]-J)*q;Y=X+B*O[2]+N*O[1]+k*O[0],g.values[Y]=Q+($-Q)*F}}else for(var ee=0;ee<v;++ee){var te=v>1?j*(l-1)+ee*A:.5*(j+T)*(l-1);if(te<0||te>l-1)for(var ne=0;ne<d;ne++){var re=ne+ee*O[2]+N*O[1]+k*O[0];g.values[re]=o}else for(var ae=Math.round(te),ie=Math.round(R),oe=0;oe<d;oe++){var se=oe+ae*w[2]+ie*w[1]+C*w[0],ue=oe+ee*O[2]+N*O[1]+k*O[0];g.values[ue]=x[se]}}}}return g.toTensor()}},{key:"sparseToDense",value:function(e,t,n,r){var i=a.backend_util.calculateShapes(t,e,n),o=i.sliceRank,s=i.numUpdates,u=i.sliceSize,c=i.strides,l=i.outputSize;return this.scatter(e,t,n,l,u,s,o,c,r,!1)}},{key:"gatherND",value:function(e,t){var n=t.shape,r=n[n.length-1],i=a.backend_util.prepareAndValidate(e,t),o=Object(h.a)(i,4),s=o[0],u=o[1],c=o[2],l=o[3];if(0===u)return a.tensor([],s,e.dtype);for(var d=new a.TensorBuffer([u,c],e.dtype),f=this.readSync(t.dataId),p=this.readSync(e.dataId),m=0;m<u;m++){for(var v=[],g=0,b=0;b<r;b++){var y=f[m*r+b];g+=y*l[b],v.push(y)}if(g<0||g>=e.size/c)throw new Error("Invalid indices: ".concat(v," does not index into ").concat(e.shape));for(var x=0;x<c;x++)d.values[m*c+x]=p[g*c+x]}return d.toTensor().reshape(s)}},{key:"scatterND",value:function(e,t,n){var r=a.backend_util.calculateShapes(t,e,n),i=r.sliceRank,o=r.numUpdates,s=r.sliceSize,u=r.strides,c=r.outputSize,l=a.scalar(0);return this.scatter(e,t,n,c,s,o,i,u,l,!0)}},{key:"fill",value:function(e,t,n){n=n||a.util.inferDtype(t);var r=a.util.getArrayFromDType(n,a.util.sizeFromShape(e));return r.fill(t),Object(a.engine)().makeTensor(r,e,n,this)}},{key:"onesLike",value:function(e){if("string"===e.dtype)throw new Error("onesLike is not supported for string tensors");return this.fill(e.shape,1,e.dtype)}},{key:"zerosLike",value:function(e){var t=a.util.getArrayFromDType(e.dtype,a.util.sizeFromShape(e.shape));return this.makeOutput(t,e.shape,e.dtype)}},{key:"linspace",value:function(e,t,n){return a.backend_util.linspaceImpl(e,t,n)}},{key:"scatter",value:function(e,t,n,r,i,o,s,u,c,l){var h=[r/i,i],d=this.readSync(e.dataId),f=this.readSync(t.dataId);if(0===r)return a.tensor([],n,t.dtype);var p=new a.TensorBuffer(h,t.dtype);p.values.fill(this.readSync(c.dataId)[0]);for(var m=0;m<o;m++){for(var v=[],g=0,b=0;b<s;b++){var y=d[m*s+b];v.push(y),g+=y*u[b]}if(g<0||g>=r/i)throw new Error("Invalid indices: ".concat(v," does not index into ").concat(n));for(var x=0;x<i;x++)l?p.values[g*i+x]+=f[m*i+x]:p.values[g*i+x]=0===t.rank?f[0]:f[m*i+x]}return p.toTensor().reshape(n)}}]),n}(a.KernelBackend);Object(a.registerBackend)("cpu",(function(){return new Ci}),1);var Mi={kernelName:a.Cos,backendName:"cpu",kernelFunc:function(e){var t=e.input
2s,n=e.backend,r=t.x,i=n;xi(r,"cos");for(var o=i.data.get(r.dataId).values,s=a.util.sizeFromShape(r.shape),u=new Float32Array(s),c=0;c<s;++c)u[c]=Math.cos(o[c]);return{dataId:i.write(u,r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},Ai={kernelName:a.Dilation2D,backendName:"cpu",kernelFunc:function(e){for(var t=e.inputs,n=e.backend,r=e.attrs,i=t.x,o=t.filter,s=r.strides,u=r.pad,c=r.dilations,l=n,h=l.data.get(i.dataId).values,d=i.shape.length,f=l.data.get(o.dataId).values,p=o.shape.length,m=a.backend_util.computeDilation2DInfo(i.shape,o.shape,s,u,"NHWC",c),v=m.batchSize,g=m.inHeight,b=m.inWidth,y=m.inChannels,x=m.outHeight,w=m.outWidth,O=m.padInfo,k=m.strideHeight,S=m.strideWidth,_=m.filterHeight,j=m.filterWidth,E=m.dilationHeight,T=m.dilationWidth,C=m.outShape,M=a.util.sizeFromShape(C),A=C.length,N=a.util.getArrayFromDType(i.dtype,M),R=0;R<v;++R)for(var I=0;I<x;++I)for(var L=I*k-O.top,D=0;D<w;++D)for(var P=D*S-O.left,z=0;z<y;++z){for(var F=Number.MIN_SAFE_INTEGER,B=0;B<_;++B){var U=L+B*E;if(U>=0&&U<g)for(var W=0;W<j;++W){var V=P+W*T;if(V>=0&&V<b){var G=a.util.locToIndex([R,U,V,z],d,a.util.computeStrides(i.shape)),H=a.util.locToIndex([B,W,z],p,a.util.computeStrides(o.shape)),q=h[G]+f[H];q>F&&(F=q)}}}N[a.util.locToIndex([R,I,D,z],A,a.util.computeStrides(C))]=F}return{dataId:l.write(a.util.toTypedArray(N,i.dtype),C,i.dtype),shape:C,dtype:i.dtype}}},Ni={kernelName:a.Dilation2DBackpropFilter,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,i=t.x,o=t.filter,s=t.dy,u=r.strides,c=r.pad,l=r.dilations,h=n,d=a.util.toNestedArray(i.shape,h.data.get(i.dataId).values),f=a.util.toNestedArray(o.shape,h.data.get(o.dataId).values),p=a.backend_util.computeDilation2DInfo(i.shape,o.shape,u,c,"NHWC",l),m=p.batchSize,v=p.inHeight,g=p.inWidth,b=p.inChannels,y=p.outHeight,x=p.outWidth,w=p.padInfo,O=p.strideHeight,k=p.strideWidth,S=p.filterHeight,_=p.filterWidth,j=p.dilationHeight,E=p.dilationWidth,T=p.outShape;a.util.assert(s.rank===T.length,(function(){return"Error in ".concat(a.Dilation2DBackpropFilter,", dy ")+"must have the same rank as output ".concat(T.length,", but got ")+"".concat(s.rank)}));for(var C=a.util.toNestedArray(T,h.data.get(s.dataId).values),M=a.util.makeZerosNestedTypedArray(o.shape,o.dtype),A=0;A<m;++A)for(var N=0;N<y;++N)for(var R=N*O-w.top,I=0;I<x;++I)for(var L=I*k-w.left,D=0;D<b;++D){for(var P=Number.MIN_SAFE_INTEGER,z=0,F=0,B=0;B<S;++B){var U=R+B*j;if(U>=0&&U<v)for(var W=0;W<_;++W){var V=L+W*E;if(V>=0&&V<g){var G=d[A][U][V][D]+f[B][W][D];G>P&&(P=G,z=B,F=W)}}}M[z][F][D]+=C[A][N][I][D]}return{dataId:h.write(a.util.toTypedArray(M,i.dtype),o.shape,o.dtype),shape:o.shape,dtype:o.dtype}}},Ri={kernelName:a.Dilation2DBackpropInput,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,i=t.x,o=t.filter,s=t.dy,u=r.strides,c=r.pad,l=r.dilations,h=n,d=a.util.toNestedArray(i.shape,h.data.get(i.dataId).values),f=a.util.toNestedArray(o.shape,h.data.get(o.dataId).values),p=a.backend_util.computeDilation2DInfo(i.shape,o.shape,u,c,"NHWC",l),m=p.batchSize,v=p.inHeight,g=p.inWidth,b=p.inChannels,y=p.outHeight,x=p.outWidth,w=p.padInfo,O=p.strideHeight,k=p.strideWidth,S=p.filterHeight,_=p.filterWidth,j=p.dilationHeight,E=p.dilationWidth,T=p.outShape;a.util.assert(s.rank===T.length,(function(){return"Error in ".concat(a.Dilation2DBackpropInput,", dy ")+"must have the same rank as output ".concat(T.length,", but got ")+"".concat(s.rank)}));for(var C=a.util.toNestedArray(T,h.data.get(s.dataId).values),M=a.util.makeZerosNestedTypedArray(i.shape,i.dtype),A=0;A<m;++A)for(var N=0;N<y;++N)for(var R=N*O-w.top,I=0;I<x;++I)for(var L=I*k-w.left,D=0;D<b;++D){for(var P=Number.MIN_SAFE_INTEGER,z=R<0?0:R,F=L<0?0:L,B=0;B<S;++B){var U=R+B*j;if(U>=0&&U<v)for(var W=0;W<_;++W){var V=L+W*E;if(V>=0&&V<g){var G=d[A][U][V][D]+f[B][W][D];G>P&&(P=G,z=U,F=V)}}}M[A][z][F][D]+=C[A][N][I][D]}return{dataId:h.write(a.util.toTypedArray(M,i.dtype),i.shape,i.dtype),shape:i.shape,dtype:i.dtype}}};function Ii(e,t){return{kernelName:e,backendName:"cpu",kernelFunc:function(n){var r=n.inputs,a=n.backend,i=r.a,o=r.b,s=a;xi([i,o],e);var u=s.data.get(i.dataId).values,c=s.data.get(o.dataId).values,l=t(i.shape,o.shape,u,c,i.dtype),d=Object(h.a)(l,2),f=d[0],p=d[1];return{dataId:s.write(f,p,i.dtype),shape:p,dtype:i.dtype}}}}function Li(e){return function(t,n,r,i,o){var s=a.backend_util.assertAndGetBroadcastShape(t,n),u=s.length,c=a.util.computeStrides(s),l=a.util.sizeFromShape(s),h=a.util.getTypedArrayFromDType(o,l),d=t.length,f=n.length,p=a.util.computeStrides(t),m=a.util.computeStrides(n),v=a.backend_util.getBroadcastDims(t,
2s),g=a.backend_util.getBroadcastDims(n,s);if(v.length+g.length===0)for(var b=0;b<h.length;++b)h[b]=e(r[b%r.length],i[b%i.length]);else for(var y=function(t){var n=a.util.indexToLoc(t,u,c),o=n.slice(-d);v.forEach((function(e){return o[e]=0}));var s=a.util.locToIndex(o,d,p),l=n.slice(-f);g.forEach((function(e){return l[e]=0}));var b=a.util.locToIndex(l,f,m);h[t]=e(r[s],i[b])},x=0;x<h.length;++x)y(x);return[h,s]}}var Di=Li((function(e,t){return e/t})),Pi=Ii(a.Div,Di),zi={kernelName:a.FlipLeftRight,backendName:"cpu",kernelFunc:function(e){for(var t=e.inputs,n=(e.attrs,e.backend),r=t.image,i=n,o=a.util.getTypedArrayFromDType(r.dtype,a.util.sizeFromShape(r.shape)),s=Object(h.a)(r.shape,4),u=s[0],c=s[1],l=s[2],d=s[3],f=i.data.get(r.dataId).values,p=0;p<u;p++)for(var m=p*l*c*d,v=0;v<c;v++)for(var g=v*(l*d),b=0;b<l;b++)for(var y=b*d,x=0;x<d;x++){var w=[u,v,b,x][2],O=Math.round(l-w),k=m+g+y+x,S=f[k];if(O>=0&&O<l)S=f[m+g+O*d+x];o[k]=S}return{dataId:i.write(o,r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}};var Fi={kernelName:a.Identity,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.x;return n.incRef(r.dataId),{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}};function Bi(e,t,n,r){for(var i=a.util.getTypedArrayFromDType(r,a.util.sizeFromShape(n)),o=0;o<i.length;++o){for(var s=o*t,u=e[s],c=0;c<t;++c){var l=e[s+c];l>u&&(u=l)}i[o]=u}return i}function Ui(e,t,n,r,i){for(var o=t.length,s=a.util.sizeFromShape(t),u=a.util.computeStrides(t),c=a.util.computeStrides(i),l=a.util.getTypedArrayFromDType(n,a.util.sizeFromShape(i)),h=0;h<s;++h){for(var d=a.util.indexToLoc(h,o,u),f=new Array(d.length),p=0;p<f.length;p++)f[p]=d[r[p]];l[a.util.locToIndex(f,o,c)]=e[h]}return l}var Wi={kernelName:a.Max,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.attrs,r=e.backend,i=t.x,o=n.reductionIndices,s=n.keepDims,u=r,c=i.shape,l=c.length,d=a.util.parseAxisParam(o,c),f=d,p=a.backend_util.getAxesPermutation(f,l),m=u.data.get(i.dataId).values;if(null!=p){for(var v=new Array(l),g=0;g<v.length;g++)v[g]=c[p[g]];m=Ui(m,c,i.dtype,p,v),f=a.backend_util.getInnerMostAxes(f.length,l),c=v}xi(i,"max"),a.backend_util.assertAxesAreInnerMostDims("max",f,l);var b=a.backend_util.computeOutAndReduceShapes(c,f),y=Object(h.a)(b,2),x=y[0],w=y[1],O=Bi(m,a.util.sizeFromShape(w),x,i.dtype),k=u.write(O,x,i.dtype),S=x;s&&(S=a.backend_util.expandShapeToKeepDim(x,d));return{dataId:k,shape:S,dtype:i.dtype}}};var Vi={kernelName:a.MaxPoolWithArgmax,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.attrs,r=e.backend,i=t.x,o=n.filterSize,s=n.strides,u=n.pad,c=n.includeBatchInIndex,l=r;xi(i,"MaxPoolWithArgmax");var d=l.data.get(i.dataId).values,f=a.backend_util.computePool2DInfo(i.shape,o,s,[1,1],u),p=function(e,t,n,r,i){var o=wi(e,0,n,a.util.computeStrides(t),i,"max"),s=Oi(e,t,n,i,!0,r);return[o.values,s.values]}(d,i.shape,i.dtype,c,f),m=Object(h.a)(p,2),v=m[0],g=m[1],b=l.write(v,f.outShape,i.dtype),y=l.write(g,f.outShape,i.dtype);return[{dataId:b,shape:f.outShape,dtype:i.dtype},{dataId:y,shape:f.outShape,dtype:"int32"}]}},Gi=a.kernel_impls.nonMaxSuppressionV4Impl,Hi={kernelName:a.NonMaxSuppressionV4,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.boxes,i=t.scores,o=r.maxOutputSize,s=r.iouThreshold,u=r.scoreThreshold,c=r.padToMaxOutputSize,l=n;xi(a,"NonMaxSuppressionPadded");var h=l.data.get(a.dataId).values,d=l.data.get(i.dataId).values,f=Gi(h,d,o,s,u,c);return[f.selectedIndices,f.validOutputs]}},qi=a.kernel_impls.nonMaxSuppressionV5Impl,Xi={kernelName:a.NonMaxSuppressionV5,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.boxes,i=t.scores,o=r.maxOutputSize,s=r.iouThreshold,u=r.scoreThreshold,c=r.softNmsSigma,l=n;xi(a,"NonMaxSuppressionWithScore");var h=l.data.get(a.dataId).values,d=l.data.get(i.dataId).values,f=qi(h,d,o,s,u,c);return[f.selectedIndices,f.selectedScores]}};var Yi={kernelName:a.PadV2,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,i=t.x,o=r.paddings,s=r.constantValue;xi(i,"pad");var u=o.map((function(e,t){return e[0]+i.shape[t]+e[1]})),c=o.map((function(e){return e[0]})),l=n.data.get(i.dataId).values,h=a.util.sizeFromShape(i.shape),d=i.shape.length,f=a.util.computeStrides(i.shape),p=a.util.sizeFromShape(u),m=u.length,v=a.util.computeStrides(u),g=a.util.getTypedArrayFromDType(i.dtype,p);0!==s&&g.fill(s);for(var b=0;b<h;b++){var y=a.util.indexToLoc(b,d,f).map((function(e,t){return e+c[t]}));g[a.util.locToIndex(y,m,v)]=l[b]}return{dataId:n.write(g,u,i.dtype),shape:u,dtype:i.dtype}}};
2function Ki(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,i=r.shape;return n.incRef(a.dataId),{dataId:a.dataId,shape:i,dtype:a.dtype}}var Zi={kernelName:a.Reshape,backendName:"cpu",kernelFunc:Ki},Ji={kernelName:a.RotateWithOffset,backendName:"cpu",kernelFunc:function(e){for(var t=e.inputs,n=e.attrs,r=e.backend,i=t.image,o=n.radians,s=n.fillValue,u=n.center,c=r,l=a.util.getTypedArrayFromDType(i.dtype,a.util.sizeFromShape(i.shape)),d=Object(h.a)(i.shape,4),f=d[0],p=d[1],m=d[2],v=d[3],g=a.backend_util.getImageCenter(u,p,m),b=Object(h.a)(g,2),y=b[0],x=b[1],w=Math.sin(o),O=Math.cos(o),k=c.data.get(i.dataId).values,S=0;S<f;S++)for(var _=S*m*p*v,j=0;j<p;j++)for(var E=j*(m*v),T=0;T<m;T++)for(var C=T*v,M=0;M<v;M++){var A=[f,j,T,M],N=A[2],R=A[1],I=(N-y)*O-(R-x)*w,L=(N-y)*w+(R-x)*O;I=Math.round(I+y),L=Math.round(L+x);var D=s;if("number"!==typeof s&&(D=3===M?255:s[M]),I>=0&&I<m&&L>=0&&L<p)D=k[_+L*(m*v)+I*v+M];l[_+E+C+M]=D}return{dataId:c.write(l,i.shape,i.dtype),shape:i.shape,dtype:i.dtype}}};function Qi(e){var t=e.inputs,n=e.attrs,r=e.backend,a=t.x,i=n.perm;xi(a,"transpose");for(var o=a.shape.length,s=new Array(o),u=0;u<s.length;u++)s[u]=a.shape[i[u]];var c=Ui(r.data.get(a.dataId).values,a.shape,a.dtype,i,s);return{dataId:r.write(c,s,a.dtype),shape:s,dtype:a.dtype}}var $i={kernelName:a.Transpose,backendName:"cpu",kernelFunc:Qi};for(var eo={kernelName:a.SpaceToBatchND,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,i=t.x,o=r.blockShape,s=r.paddings;xi([i],"spaceToBatchND");var u=a.util.sizeFromShape(o),c=[[0,0]];c.push.apply(c,Object(l.a)(s));for(var h=1+o.length;h<i.shape.length;++h)c.push([0,0]);var d=Yi.kernelFunc({inputs:{x:i},backend:n,attrs:{paddings:c,constantValue:0}}),f=a.backend_util.getReshaped(d.shape,o,u,!1),p=a.backend_util.getPermuted(f.length,o.length,!1),m=a.backend_util.getReshapedPermuted(d.shape,o,u,!1),v=Ki({inputs:{x:d},backend:n,attrs:{shape:f}}),g=Qi({inputs:{x:v},backend:n,attrs:{perm:p}}),b=Ki({inputs:{x:g},backend:n,attrs:{shape:m}});return n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(v),n.disposeIntermediateTensorInfo(g),b}},to={kernelName:a.Square,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.x,a=n;xi(r,"square");for(var i=a.data.get(r.dataId).values,o=new Float32Array(i.length),s=0;s<i.length;++s){var u=i[s];o[s]=u*u}return{dataId:a.write(o,r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},no=Li((function(e,t){var n=e-t;return n*n})),ro=Ii(a.SquaredDifference,no),ao=0,io=[Mi,Ai,Ri,Ni,Pi,zi,Fi,Vi,Wi,Hi,Xi,Yi,Zi,Ji,eo,to,ro,$i];ao<io.length;ao++){var oo=io[ao];Object(a.registerKernel)(oo)}var so,uo,co,lo={},ho={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function fo(e){e in lo||(lo[e]=function(e){if(1!==e&&2!==e)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");var t=function(e){if("undefined"!==typeof OffscreenCanvas&&2===e)return new OffscreenCanvas(300,150);if("undefined"!==typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}(e);if(t.addEventListener("webglcontextlost",(function(t){t.preventDefault(),delete lo[e]}),!1),1===e)return t.getContext("webgl",ho)||t.getContext("experimental-webgl",ho);return t.getContext("webgl2",ho)}(e));var t=lo[e];return t.isContextLost()?(delete lo[e],fo(e)):(t.disable(t.DEPTH_TEST),t.disable(t.STENCIL_TEST),t.disable(t.BLEND),t.disable(t.DITHER),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SAMPLE_COVERAGE),t.enable(t.SCISSOR_TEST),t.enable(t.CULL_FACE),t.cullFace(t.BACK),lo[e])}function po(e,t){return[t,e]}function mo(e){var t=a.util.sizeFromShape(e),n=Math.ceil(t/4);return a.util.sizeToSquarishShape(n)}function vo(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function go(e,t){var n,r,i,o,s,u,c,l,h,d=e;return 2===Object(a.env)().getNumber("WEBGL_VERSION")?(n=d.R32F,r=d.R16F,i=d.RGBA16F,o=d.RGBA32F,s=d.RED,u=4,c=1,l=d.HALF_FLOAT,h=d.FLOAT):(n=e.RGBA,r=e.RGBA,i=e.RGBA,o=d.RGBA,s=e.RGBA,u=4,c=4,l=null!=t?t.HALF_FLOAT_OES:null,h=e.FLOAT),{internalFormatFloat:n,internalFormatHalfFloat:r,internalFormatPackedHalfFloat:i,internalFormatPackedFloat:o,textureFormatFloat:s,downloadTextureFormat:e.RGBA,downloadUnpackNumChannels:u,defaultNumChannels:c,textureTypeHalfFloat:l,textureTypeFloat:h}}function bo(e,t){var n=t();return Object(a.env)().getBool("DEBUG")&&function(e){var t=e.getError();if(t!==e.NO_ERROR)throw new Error("WebGL Error: "+function(e,t){switch(t){case e.NO_ERROR:return"NO_ERROR";case e.INVALID_ENUM:return"INVALID_ENUM";case e.INVALID_VALUE:return"INVALID_VALUE";case e.INVALID_OPERATION:return"INVALID_OPERATION";case e.INVALID_FRAMEBUFFER_OPERATION:return"INVALID_FRAMEBUFFER_OPERATION";case e.OUT_OF_MEMORY:return"OUT_OF_MEMORY";case e.CONTEXT_LOST_WEBGL:return"CONTEXT_LOST_WEBGL";default:return"Unknown error code ".concat(t)}}(e,t))}(e),n}!function(e){e[e.DENSE=0]="DENSE",e[e.SHARED_BATCH=1]="SHARED_BATCH"}(so||(so={})),function(e){e[e.RENDER=0]="RENDER",e[e.UPLOAD=1]="UPLOAD",e[e.PIXELS=2]="PIXELS",e[e.DOWNLOAD=3]="DOWNLOAD"}(uo||(uo={})),function(e){e[e.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",e[e.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",e[e.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",e[e.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",e[e.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"}(co||(co={}));function yo(e){return!!(Object(a.env)().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||0===e||5.96e-8<Math.abs(e)&&Math.abs(e)<65504)}function xo(e,t){return Ro(e,(function(){return e.getExtension(t)}),'Extension "'+t+'" not supported on this browser.')}function wo(e,t){var n=Ro(e,(function(){return e.createShader(e.FRAGMENT_SHADER)}),"Unable to create fragment WebGLShader.");if(bo(e,(function(){return e.shaderSource(n,t)})),bo(e,(function(){return e.compileShader(n)})),!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw function(e,t){var n=So.exec(t);if(null==n)return console.log("Couldn't parse line number in error: ".concat(t)),void console.log(e);for(var r=+n[1],i=e.split("\n"),o=i.length.toString().length+2,s=i.map((function(e,t){return a.util.rightPad((t+1).toString(),o)+e})),u=0,c=0;c<s.length;c++)u=Math.max(s[c].length,u);var l=s.slice(0,r-1),h=s.slice(r-1,r),d=s.slice(r);console.log(l.join("\n")),console.log(t.split("\n")[0]),console.log("%c ".concat(a.util.rightPad(h[0],u)),"border:1px solid red; background-color:#e3d2d2; color:#a61717"),console.log(d.join("\n"))}(t,e.getShaderInfoLog(n)),new Error("Failed to compile fragment shader.");return n}var Oo,ko,So=/ERROR: [0-9]+:([0-9]+):/g;function _o(e,t){if(bo(e,(function(){return e.validateProgram(t)})),!1===e.getProgramParameter(t,e.VALIDATE_STATUS))throw console.log(e.getProgramInfoLog(t)),new Error("Shader program validation failed.")}function jo(e,t,n,r,a,i,o){var s=e.getAttribLocation(t,n);return-1!==s&&(bo(e,(function(){return e.bindBuffer(e.ARRAY_BUFFER,r)})),bo(e,(function(){return e.vertexAttribPointer(s,a,e.FLOAT,!1,i,o)})),bo(e,(function(){return e.enableVertexAttribArray(s)})),!0)}function Eo(e,t,n){return Ro(e,(function(){return e.getUniformLocation(t,n)}),'uniform "'+n+'" not present in program.')}function To(e,t,n){return e.getUniformLocation(t,n)}function Co(e,t,n,r){bo(e,(function(){return function(e,t,n){Io(e,n),bo(e,(function(){return e.activeTexture(e.TEXTURE0+n)})),bo(e,(function(){return e.bindTexture(e.TEXTURE_2D,t)}))}(e,t,r)})),bo(e,(function(){return e.uniform1i(n,r)}))}
2function Mo(e,t,n){bo(e,(function(){return e.bindFramebuffer(e.FRAMEBUFFER,n)})),bo(e,(function(){return e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}))}function Ao(e,t){bo(e,(function(){return e.bindFramebuffer(e.FRAMEBUFFER,t)})),bo(e,(function(){return e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0)}))}function No(e){var t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+function(e,t){switch(t){case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case e.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return"unknown error ".concat(t)}}(e,t))}function Ro(e,t,n){var r=bo(e,(function(){return t()}));if(null==r)throw new Error(n);return r}function Io(e,t){var n=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,r=t+e.TEXTURE0;if(r<e.TEXTURE0||r>n){var a="[gl.TEXTURE0, gl.TEXTURE".concat(n,"]");throw new Error("textureUnit must be in ".concat(a,"."))}}function Lo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return a.util.sizeFromShape(e.slice(0,e.length-t))}function Do(e){if(0===e.length)throw Error("Cannot get rows and columns of an empty shape array.");return[e.length>1?e[e.length-2]:1,e[e.length-1]]}function Po(e){var t=[1,1,1];return 0===e.length||1===e.length&&1===e[0]||(t=[Lo(e)].concat(Object(l.a)(Do(e)))),t}function zo(e){return e%2===0}function Fo(e,t){if(e=e.slice(-2),t=t.slice(-2),a.util.arraysEqual(e,t))return!0;if(!e.length||!t.length)return!0;if(0===e[0]||0===e[1]||0===t[0]||0===t[1])return!0;if(e.length!==t.length){var n=e.slice(-1)[0],r=t.slice(-1)[0];if(n===r)return!0;if(zo(n)&&zo(r)&&(1===e[0]||1===t[0]))return!0}return e[1]===t[1]&&zo(e[0])&&zo(t[0])}function Bo(e,t){return null!=e.getExtension(t)}function Uo(e){try{if(null!=fo(e))return!0}catch(t){return!1}return!1}function Wo(e){if(0===e)return!1;var t=fo(e);if(1!==e){if(Bo(t,"EXT_color_buffer_float"))return Vo(t);if(Bo(t,"EXT_color_buffer_half_float")){var n=t.getExtension("EXT_color_buffer_half_float");return function(e,t){var n=go(e,t),r=e.createTexture();e.bindTexture(e.TEXTURE_2D,r);e.texImage2D(e.TEXTURE_2D,0,n.internalFormatHalfFloat,1,1,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);var a=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,a),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);var i=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(r),e.deleteFramebuffer(a),i}(t,n)}return!1}return!!Bo(t,"OES_texture_float")&&(!!Bo(t,"WEBGL_color_buffer_float")&&Vo(t))}function Vo(e){var t=go(e),n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);e.texImage2D(e.TEXTURE_2D,0,t.internalFormatFloat,1,1,0,t.textureFormatFloat,t.textureTypeFloat,null);var r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0);var a=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(n),e.deleteFramebuffer(r),a}var Go=Object(a.env)();Go.registerFlag("HAS_WEBGL",(function(){return Go.getNumber("WEBGL_VERSION")>0})),Go.registerFlag("WEBGL_VERSION",(function(){return Uo(2)?2:Uo(1)?1:0})),Go.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",(function(){return!1})),Go.registerFlag("WEBGL_BUFFER_SUPPORTED",(function(){return 2===Go.get("WEBGL_VERSION")})),Go.registerFlag("WEBGL_CPU_FORWARD",(function(){return!0})),Go.registerFlag("WEBGL_FORCE_F16_TEXTURES",(function(){return!1})),Go.registerFlag("WEBGL_PACK",(function(){return Go.getBool("HAS_WEBGL")})),Go.registerFlag("WEBGL_PACK_NORMALIZATION",(function(){return Go.getBool("WEBGL_PACK")})),Go.registerFlag("WEBGL_PACK_CLIP",(function(){return Go.getBool("WEBGL_PACK")})),Go.registerFlag("WEBGL_PACK_DEPTHWISECONV",(function(){return!1})),Go.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",(function(){return Go.getBool("WEBGL_PACK")})),Go.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",(function(){return Go.getBool("WEBGL_PACK")})),Go.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",(function(){return Go.getBool("WEBGL_PACK")})),Go.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",(function(){return Go.getBool("WEBGL_PACK")})),Go.registerFlag("WEBGL_PACK_REDUCE",(function(){return Go.getBool("WEBGL_PACK")})),Go.registerFlag("WEBGL_LAZILY_UNPACK",(function(){return Go.getBool("WEBGL_PACK")})),Go.registerFlag("WEBGL_CONV_IM2COL",(function(){return Go.getBool("WEBGL_PACK")})),Go.registerFlag("WEBGL_MAX_TEXTURE_SIZE",(function(){return function(e){if(null==Oo){var t=fo(e);Oo=t.getParameter(t.MAX_TEXTURE_SIZE)}return Oo}(Go.getNumber("WEBGL_VERSION"))})),Go.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",(function(){return function(e){if(null==ko){var t=fo(e);ko=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,ko)}(Go.getNumber("WEBGL_VERSION"))})),Go.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",(function(){var e=Go.getNumber("WEBGL_VERSION");return 0===e?0:function(e){if(0===e)return 0;var t=fo(e);return Bo(t,"EXT_disjoint_timer_query_webgl2")&&2===e?2:Bo(t,"EXT_disjoint_timer_query")?1:0}(e)})),Go.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",(function(){return Go.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!a.device_util.isMobile()}
2)),Go.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",(function(){return function(e){if(0===e)return!1;var t=fo(e);if(1===e){if(!Bo(t,"OES_texture_float"))return!1}else if(!Bo(t,"EXT_color_buffer_float"))return!1;return Vo(t)}(Go.getNumber("WEBGL_VERSION"))})),Go.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",(function(){return!Go.getBool("WEBGL_FORCE_F16_TEXTURES")&&Go.getBool("WEBGL_RENDER_FLOAT32_CAPABLE")})),Go.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",(function(){return Wo(Go.getNumber("WEBGL_VERSION"))})),Go.registerFlag("WEBGL_FENCE_API_ENABLED",(function(){return 2===(e=Go.getNumber("WEBGL_VERSION"))&&null!=fo(e).fenceSync;var e})),Go.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",(function(){return Go.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0})),Go.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",(function(){return-1}),(function(e){if(e<0&&-1!==e)throw new Error("WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never "+"delete) or at least 0, but got ".concat(e,"."))}));var Ho=function e(t,n){Object(i.a)(this,e),this.outputShape=[],this.outputShape=t,this.variableNames=n.map((function(e,t){return"T".concat(t)}));var r=[];this.variableNames.forEach((function(e){r.push("float v".concat(e," = get").concat(e,"AtOutCoords();"))}));var a=this.variableNames.map((function(e){return"v".concat(e)})).join(" + ");this.userCode="\n void main() {\n ".concat(r.join("\n "),"\n\n float result = ").concat(a,";\n setOutput(result);\n }\n ")},qo=function e(t,n){Object(i.a)(this,e),this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t,this.variableNames=n.map((function(e,t){return"T".concat(t)}));var r=[];this.variableNames.forEach((function(e){r.push("vec4 v".concat(e," = get").concat(e,"AtOutCoords();"))}));var a=this.variableNames.map((function(e){return"v".concat(e)})).join(" + ");this.userCode="\n void main() {\n ".concat(r.join("\n "),"\n\n vec4 result = ").concat(a,";\n setOutput(result);\n }\n ")},Xo=function e(t,n,r){Object(i.a)(this,e),this.variableNames=["A"];var a=t.windowSize,o=t.batchSize,s=t.outSize;r||this.variableNames.push("bestIndicesA"),this.outputShape=[o,s];var u="max"===n?">":"<",c=r?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ".concat(a,";\n\n int bestIndex = inOffset;\n float bestValue = getA(batch, bestIndex);\n\n for (int i = 0; i < ").concat(a,"; i++) {\n int inIdx = ").concat(c,";\n float candidate = getA(batch, inIdx);\n if (candidate ").concat(u," bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n ")};function Yo(e,t){return["x","y","z","w","u","v"].slice(0,t).map((function(t){return"".concat(e,".").concat(t)}))}function Ko(e,t){return 1===t?[e]:Yo(e,t)}function Zo(){var e,t,n,r,i,o,s,u,c,l;return 2===Object(a.env)().getNumber("WEBGL_VERSION")?(e="#version 300 es",t="in",n="out",r="in",i="texture",o="outputColor",s="out vec4 outputColor;",u="\n bool isnan_custom(float val) {\n return (val > 0.0 || val < 0.0) ? false : val != 0.0;\n }\n\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan_custom(val.x),\n isnan_custom(val.y), isnan_custom(val.z), isnan_custom(val.w));\n }\n\n #define isnan(value) isnan_custom(value)\n ",c="",l="\n #define round(value) newRound(value)\n int newRound(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 newRound(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "):(e="",t="attribute",n="varying",r="varying",i="texture2D",o="gl_FragColor",s="",u="\n #define isnan(value) isnan_custom(value)\n bool isnan_custom(float val) {\n return (val > 0. || val < 1. || val == 0.) ? false : true;\n }\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w));\n }\n ",c="\n uniform float INFINITY;\n\n bool isinf(float val) {\n return abs(val) == INFINITY;\n }\n bvec4 isinf(vec4 val) {\n return equal(abs(val), vec4(INFINITY));\n }\n ",l="\n int round(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 round(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "),{version:e,attribute:t,varyingVs:n,varyingFs:r,texture2D:i,output:o,defineOutput:s,defineSpecialNaN:u,defineSpecialInf:c,defineRound:l}}function Jo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"index",r=a.util.computeStrides(t);return r.map((function(t,a){var i="int ".concat(e[a]," = ").concat(n," / ").concat(t),o=a===r.length-1?"int ".concat(e[a+1]," = ").concat(n," - ").concat(e[a]," * ").concat(t):"index -= ".concat(e[a]," * ").concat(t);return"".concat(i,";
2 ").concat(o,";")})).join("")}function Qo(e){var t=a.util.computeStrides(e).map((function(e){return e.toString()}));return"\n int getFlatIndex(ivec3 coords) {\n return coords.x * ".concat(t[0]," + coords.y * ").concat(t[1]," + coords.z;\n }\n")}var $o="\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isnan(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n",es=a.backend_util.getBroadcastDims;function ts(e,t,n,r){var i=[];e.forEach((function(e){var t=a.util.sizeFromShape(e.shapeInfo.logicalShape);e.shapeInfo.isUniform?i.push("uniform float ".concat(e.name).concat(t>1?"[".concat(t,"]"):"",";")):(i.push("uniform sampler2D ".concat(e.name,";")),i.push("uniform int offset".concat(e.name,";")))}));var o,s,u=i.join("\n"),c=e.map((function(e){return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r="";r+=n?rs(e):ns(e);var a=e.shapeInfo.logicalShape,i=t.logicalShape;a.length<=i.length&&(r+=n?ls(e,t):hs(e,t));return r}(e,t,r)})).join("\n"),l=t.texShape,h=Zo(),d=function(e){return"\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ".concat(e.texture2D,"(textureSampler, uv).r;\n }\n ")}(h),f=function(e){return"".concat(e.version,"\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ").concat(e.varyingFs," vec2 resultUV;\n ").concat(e.defineOutput,"\n const vec2 halfCR = vec2(0.5, 0.5);\n\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n uniform float NAN;\n ").concat(e.defineSpecialNaN,"\n ").concat(e.defineSpecialInf,"\n ").concat(e.defineRound,"\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n int idiv(int a, int b, float sign) {\n int res = a / b;\n int mod = imod(a, b);\n if (sign < 0. && mod != 0) {\n res -= 1;\n }\n return res;\n }\n\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n #define HASHSCALE1 443.8975\n float random(float seed){\n vec2 p = resultUV * seed;\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n ").concat(as,"\n ").concat(is,"\n ").concat(os,"\n ")}(h);return t.isPacked?(o=function(e,t){switch(e.length){case 0:return"\n int getOutputCoords() {\n return 0;\n }\n ";case 1:return function(e,t){var n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(1===n[0])return"\n int getOutputCoords() {\n return 2 * int(resultUV.x * ".concat(n[1],".0);\n }\n ");if(1===n[1])return"\n int getOutputCoords() {\n return 2 * int(resultUV.y * ".concat(n[0],".0);\n }\n ");return"\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(".concat(n[0],", ").concat(n[1],"));\n return 2 * (resTexRC.x * ").concat(n[1]," + resTexRC.y);\n }\n ")}(0,t);case 2:return function(e,t){var n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(a.util.arraysEqual(e,t))return"\n ivec2 getOutputCoords() {\n return 2 * ivec2(resultUV.yx * vec2(".concat(n[0],", ").concat(n[1],"));\n }\n ");var r=Math.ceil(e[1]/2);return"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ive
2c2(resultUV.yx *\n vec2(".concat(n[0],", ").concat(n[1],"));\n\n int index = resTexRC.x * ").concat(n[1]," + resTexRC.y;\n int r = 2 * (index / ").concat(r,");\n int c = imod(index, ").concat(r,") * 2;\n\n return ivec2(r, c);\n }\n ")}(e,t);case 3:return function(e,t){var n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[2]/2),a=r*Math.ceil(e[1]/2);return"\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(".concat(n[0],", ").concat(n[1],"));\n int index = resTexRC.x * ").concat(n[1]," + resTexRC.y;\n\n int b = index / ").concat(a,";\n index -= b * ").concat(a,";\n\n int r = 2 * (index / ").concat(r,");\n int c = imod(index, ").concat(r,") * 2;\n\n return ivec3(b, r, c);\n }\n ")}(e,t);default:return function(e,t){for(var n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[e.length-1]/2),a=r*Math.ceil(e[e.length-2]/2),i=a,o="",s="b, r, c",u=2;u<e.length-1;u++)i*=e[e.length-u-1],o="\n int b".concat(u," = index / ").concat(i,";\n index -= b").concat(u," * ").concat(i,";\n ")+o,s="b".concat(u,", ")+s;return"\n ivec".concat(e.length," getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(").concat(n[0],", ").concat(n[1],"));\n int index = resTexRC.x * ").concat(n[1]," + resTexRC.y;\n\n ").concat(o,"\n\n int b = index / ").concat(a,";\n index -= b * ").concat(a,";\n\n int r = 2 * (index / ").concat(r,");\n int c = imod(index, ").concat(r,") * 2;\n\n return ivec").concat(e.length,"(").concat(s,");\n }\n ")}(e,t)}}(t.logicalShape,l),s=function(e){return"\n void setOutput(vec4 val) {\n ".concat(e.output," = val;\n }\n ")}(h)):(o=function(e,t){switch(e.length){case 0:return"\n int getOutputCoords() {\n return 0;\n }\n ";case 1:return function(e,t){if(1===t[0])return"\n int getOutputCoords() {\n return int(resultUV.x * ".concat(t[1],".0);\n }\n ");if(1===t[1])return"\n int getOutputCoords() {\n return int(resultUV.y * ".concat(t[0],".0);\n }\n ");return"\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(".concat(t[0],", ").concat(t[1],"));\n return resTexRC.x * ").concat(t[1]," + resTexRC.y;\n }\n ")}(0,t);case 2:return function(e,t){if(a.util.arraysEqual(e,t))return"\n ivec2 getOutputCoords() {\n return ivec2(resultUV.yx * vec2(".concat(t[0],", ").concat(t[1],"));\n }\n ");if(1===e[1])return"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(".concat(t[0],", ").concat(t[1],"));\n int index = resTexRC.x * ").concat(t[1]," + resTexRC.y;\n return ivec2(index, 0);\n }\n ");if(1===e[0])return"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(".concat(t[0],", ").concat(t[1],"));\n int index = resTexRC.x * ").concat(t[1]," + resTexRC.y;\n return ivec2(0, index);\n }\n ");return"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(".concat(t[0],", ").concat(t[1],"));\n int index = resTexRC.x * ").concat(t[1]," + resTexRC.y;\n int r = index / ").concat(e[1],";\n int c = index - r * ").concat(e[1],";\n return ivec2(r, c);\n }\n ")}(e,t);case 3:return function(e,t){var n=Jo(["r","c","d"],e);return"\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(".concat(t[0],", ").concat(t[1],"));\n int index = resTexRC.x * ").concat(t[1]," + resTexRC.y;\n ").concat(n,"\n return ivec3(r, c, d);\n }\n ")}(e,t);case 4:return function(e,t){var n=Jo(["r","c","d","d2"],e);return"\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(".concat(t[0],", ").concat(t[1],"));\n int index = resTexRC.x * ").concat(t[1]," + resTexRC.y;\n ").concat(n,"\n return ivec4(r, c, d, d2);\n }\n ")}(e,t);case 5:return function(e,t){var n=Jo(["r","c","d","d2","d3"],e);return"\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ive
2c2(resultUV.yx * vec2(".concat(t[0],",\n ").concat(t[1],"));\n\n int index = resTexRC.x * ").concat(t[1]," + resTexRC.y;\n\n ").concat(n,"\n\n ivec5 outShape = ivec5(r, c, d, d2, d3);\n return outShape;\n }\n ")}(e,t);case 6:return function(e,t){var n=Jo(["r","c","d","d2","d3","d4"],e);return"\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(".concat(t[0],", ").concat(t[1],"));\n int index = resTexRC.x * ").concat(t[1]," + resTexRC.y;\n\n ").concat(n,"\n\n ivec6 result = ivec6(r, c, d, d2, d3, d4);\n return result;\n }\n ")}(e,t);default:throw new Error("".concat(e.length,"-D output sampling is not yet supported"))}}(t.logicalShape,l),s=function(e){return"\n void setOutput(float val) {\n ".concat(e.output," = vec4(val, 0, 0, 0);\n }\n ")}(h)),r&&(f+=ss),[f,d,s,u,o,c,n].join("\n")}function ns(e){var t=e.shapeInfo.logicalShape;switch(t.length){case 0:return function(e){var t=e.name,n="get"+t.charAt(0).toUpperCase()+t.slice(1);if(e.shapeInfo.isUniform)return"float ".concat(n,"() {return ").concat(t,";}");var r=Object(h.a)(e.shapeInfo.texShape,2),a=r[0],i=r[1];if(1===a&&1===i)return"\n float ".concat(n,"() {\n return sampleTexture(").concat(t,", halfCR);\n }\n ");var o=Object(h.a)(e.shapeInfo.texShape,2),s=o[0],u=o[1],c=us(t);return"\n float ".concat(n,"() {\n vec2 uv = uvFromFlat(").concat(s,", ").concat(u,", ").concat(c,");\n return sampleTexture(").concat(t,", uv);\n }\n ")}(e);case 1:return function(e){var t=e.name,n="get"+t.charAt(0).toUpperCase()+t.slice(1);if(e.shapeInfo.isUniform)return"\n float ".concat(n,"(int index) {\n ").concat(cs(e),"\n }\n ");var r=e.shapeInfo.texShape,a=r[0],i=r[1];if(1===i&&1===a)return"\n float ".concat(n,"(int index) {\n return sampleTexture(").concat(t,", halfCR);\n }\n ");var o=us(t);if(1===i)return"\n float ".concat(n,"(int index) {\n vec2 uv = vec2(0.5, (float(index + ").concat(o,") + 0.5) / ").concat(a,".0);\n return sampleTexture(").concat(t,", uv);\n }\n ");if(1===a)return"\n float ".concat(n,"(int index) {\n vec2 uv = vec2((float(index + ").concat(o,") + 0.5) / ").concat(i,".0, 0.5);\n return sampleTexture(").concat(t,", uv);\n }\n ");return"\n float ".concat(n,"(int index) {\n vec2 uv = uvFromFlat(").concat(a,", ").concat(i,", index + ").concat(o,");\n return sampleTexture(").concat(t,", uv);\n }\n ")}(e);case 2:return function(e){var t=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),i=e.shapeInfo.texShape;if(null!=i&&a.util.arraysEqual(t,i)){var o=i[0],s=i[1];return"\n float ".concat(r,"(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(").concat(s,".0, ").concat(o,".0);\n return sampleTexture(").concat(n,", uv);\n }\n ")}var u=a.util.squeezeShape(t),c=u.newShape,l=u.keptDims,h=c;if(h.length<t.length){var d=fs(e,h);return"\n ".concat(ns(d),"\n float ").concat(r,"(int row, int col) {\n return ").concat(r,"(").concat(ps(["row","col"],l),");\n }\n ")}if(e.shapeInfo.isUniform)return"\n float ".concat(r,"(int row, int col) {\n int index = round(dot(vec2(row, col), vec2(").concat(t[1],", 1)));\n ").concat(cs(e),"\n }\n ");var f=i[0],p=i[1],m=us(n);if(1===p)return"\n float ".concat(r,"(int row, int col) {\n float index = dot(vec3(row, col, ").concat(m,"), vec3(").concat(t[1],", 1, 1));\n vec2 uv = vec2(0.5, (index + 0.5) / ").concat(f,".0);\n return sampleTexture(").concat(n,", uv);\n }\n ");if(1===f)return"\n float ".concat(r,"(int row, int col) {\n float index = dot(vec3(row, col, ").concat(m,"), vec3(").concat(t[1],", 1, 1));\n vec2 uv = vec2((index + 0.5) / ").concat(p,".0, 0.5);\n return sampleTexture(").concat(n,", uv);\n }\n ");return"\n float ".concat(r,"(int row, int col) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * ").concat(t[1]," + col + ").concat(m,";\n vec2 uv = uvFromFlat(").concat(f,", ").concat(p,", index);\n return sampleTexture(").concat(n,", uv);\n }\n")}(e);case 3:return function(e){var t=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),i=t[1]*t[2],o=t[2],s=a.util.squeezeShape(t),u=s.newShape,c=s.keptDims,l=u;if(l.length<t.length){var h=fs(e,l);return"\n ".concat(ns(h),"\n float ").concat(r,"(int row, int col, int depth) {\n return ").concat(r,"(").concat(ps(["row","col","depth"],c),");\n }\n ")}if(e.shapeInfo.isUniform)return"\n float ".concat(r,"(int row, int col, int depth) {\n int index = round(dot(vec3(row, col, depth),\n vec3(").concat(i,", ").concat(o,", 1)));\n ").concat(cs(e),"\n }\n ");var d=e.shapeInfo.texShape,f=d[0],p=d[1],m=e.shapeInfo.flatOffset;if(p===i&&null==m)return"\n float ".concat(r,"(int row, int col, int depth) {\n float texR = float(row);\n float texC = dot(vec2(col, depth), vec2(").concat(o,", 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(").concat(p,".0, ").concat(f,".0);\n return sampleTexture(").concat(n,", uv);\n }\n ");if(p===o&&null==m)return"\n float ".concat(r,"(int row, int col, int depth) {\n float texR = dot
2(vec2(row, col), vec2(").concat(t[1],", 1));\n float texC = float(depth);\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(").concat(p,".0, ").concat(f,".0);\n return sampleTexture(").concat(n,", uv);\n }\n ");var v=us(n);return"\n float ".concat(r,"(int row, int col, int depth) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * ").concat(i," + col * ").concat(o," + depth + ").concat(v,";\n vec2 uv = uvFromFlat(").concat(f,", ").concat(p,", index);\n return sampleTexture(").concat(n,", uv);\n }\n ")}(e);case 4:return function(e){var t=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),i=t[3],o=t[2]*i,s=t[1]*o,u=a.util.squeezeShape(t),c=u.newShape,l=u.keptDims;if(c.length<t.length){var h=fs(e,c);return"\n ".concat(ns(h),"\n float ").concat(r,"(int row, int col, int depth, int depth2) {\n return ").concat(r,"(").concat(ps(["row","col","depth","depth2"],l),");\n }\n ")}if(e.shapeInfo.isUniform)return"\n float ".concat(r,"(int row, int col, int depth, int depth2) {\n int index = round(dot(vec4(row, col, depth, depth2),\n vec4(").concat(s,", ").concat(o,", ").concat(i,", 1)));\n ").concat(cs(e),"\n }\n ");var d=e.shapeInfo.flatOffset,f=e.shapeInfo.texShape,p=f[0],m=f[1];if(m===s&&null==d)return"\n float ".concat(r,"(int row, int col, int depth, int depth2) {\n float texR = float(row);\n float texC =\n dot(vec3(col, depth, depth2),\n vec3(").concat(o,", ").concat(i,", 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(").concat(m,".0, ").concat(p,".0);\n return sampleTexture(").concat(n,", uv);\n }\n ");if(m===i&&null==d)return"\n float ".concat(r,"(int row, int col, int depth, int depth2) {\n float texR = dot(vec3(row, col, depth),\n vec3(").concat(t[1]*t[2],", ").concat(t[2],", 1));\n float texC = float(depth2);\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(").concat(m,".0, ").concat(p,".0);\n return sampleTexture(").concat(n,", uv);\n }\n ");var v=us(n);return"\n float ".concat(r,"(int row, int col, int depth, int depth2) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * ").concat(s," + col * ").concat(o," +\n depth * ").concat(i," + depth2;\n vec2 uv = uvFromFlat(").concat(p,", ").concat(m,", index + ").concat(v,");\n return sampleTexture(").concat(n,", uv);\n }\n ")}(e);case 5:return function(e){var t=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),i=t[4],o=t[3]*i,s=t[2]*o,u=t[1]*s,c=a.util.squeezeShape(t),l=c.newShape,h=c.keptDims;if(l.length<t.length){var d=fs(e,l);return"\n ".concat(ns(d),"\n float ").concat(r,"(int row, int col, int depth, int depth2, int depth3) {\n return ").concat(r,"(").concat(ps(["row","col","depth","depth2","depth3"],h),");\n }\n ")}if(e.shapeInfo.isUniform)return"\n float ".concat(r,"(int row, int col, int depth, int depth2, int depth3) {\n float index = dot(\n vec4(row, col, depth, depth2),\n vec4(").concat(u,", ").concat(s,", ").concat(o,", ").concat(i,")) +\n depth3;\n ").concat(cs(e),"\n }\n ");var f=e.shapeInfo.flatOffset,p=e.shapeInfo.texShape,m=p[0],v=p[1];if(v===u&&null==f)return"\n float ".concat(r,"(int row, int col, int depth, int depth2, int depth3) {\n int texR = row;\n float texC = dot(vec4(col, depth, depth2, depth3),\n vec4(").concat(s,", ").concat(o,", ").concat(i,", 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(").concat(v,".0, ").concat(m,".0);\n return sampleTexture(").concat(n,", uv);\n }\n ");if(v===i&&null==f)return"\n float ".concat(r,"(int row, int col, int depth, int depth2, int depth3) {\n float texR = dot(\n vec4(row, col, depth, depth2),\n vec4(").concat(t[1]*t[2]*t[3],",\n ").concat(t[2]*t[3],", ").concat(t[3],", 1));\n int texC = depth3;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(").concat(v,".0, ").concat(m,".0);\n return sampleTexture(").concat(n,", uv);\n }\n ");var g=us(n);return"\n float ".concat(r,"(int row, int col, int depth, int depth2, int depth3) {\n // Explicitly use integer operations as dot() only w
2orks on floats.\n int index = row * ").concat(u," + col * ").concat(s," + depth * ").concat(o," +\n depth2 * ").concat(i," + depth3 + ").concat(g,";\n vec2 uv = uvFromFlat(").concat(m,", ").concat(v,", index);\n return sampleTexture(").concat(n,", uv);\n }\n ")}(e);case 6:return function(e){var t=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),i=a.util.squeezeShape(t),o=i.newShape,s=i.keptDims;if(o.length<t.length){var u=fs(e,o);return"\n ".concat(ns(u),"\n float ").concat(r,"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n return ").concat(r,"(").concat(ps(["row","col","depth","depth2","depth3","depth4"],s),");\n }\n ")}var c=t[5],l=t[4]*c,h=t[3]*l,d=t[2]*h,f=t[1]*d;if(e.shapeInfo.isUniform)return"\n float ".concat(r,"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int index = round(dot(\n vec4(row, col, depth, depth2),\n vec4(").concat(f,", ").concat(d,", ").concat(h,", ").concat(l,")) +\n dot(\n vec2(depth3, depth4),\n vec2(").concat(c,", 1)));\n ").concat(cs(e),"\n }\n ");var p=e.shapeInfo.flatOffset,m=e.shapeInfo.texShape,v=m[0],g=m[1];if(g===f&&null==p)return"\n float ".concat(r,"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int texR = row;\n float texC = dot(vec4(col, depth, depth2, depth3),\n vec4(").concat(d,", ").concat(h,", ").concat(l,", ").concat(c,")) +\n float(depth4);\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(").concat(g,".0, ").concat(v,".0);\n return sampleTexture(").concat(n,", uv);\n }\n ");if(g===c&&null==p)return"\n float ".concat(r,"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n float texR = dot(vec4(row, col, depth, depth2),\n vec4(").concat(t[1]*t[2]*t[3]*t[4],",\n ").concat(t[2]*t[3]*t[4],",\n ").concat(t[3]*t[4],",\n ").concat(t[4],")) + float(depth3);\n int texC = depth4;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(").concat(g,".0, ").concat(v,".0);\n return sampleTexture(").concat(n,", uv);\n }\n ");var b=us(n);return"\n float ".concat(r,"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * ").concat(f," + col * ").concat(d," + depth * ").concat(h," +\n depth2 * ").concat(l," + depth3 * ").concat(c," + depth4 + ").concat(b,";\n vec2 uv = uvFromFlat(").concat(v,", ").concat(g,", index);\n return sampleTexture(").concat(n,", uv);\n }\n ")}(e);default:throw new Error("".concat(t.length,"-D input sampling")+" is not yet supported")}}function rs(e){switch(e.shapeInfo.logicalShape.length){case 0:return function(e){var t=e.name,n="get"+t.charAt(0).toUpperCase()+t.slice(1),r=Zo();return"\n vec4 ".concat(n,"() {\n return ").concat(r.texture2D,"(").concat(t,", halfCR);\n }\n ")}(e);case 1:return function(e){var t=e.name,n="get"+t.charAt(0).toUpperCase()+t.slice(1),r=e.shapeInfo.texShape,a=[Math.ceil(r[0]/2),Math.ceil(r[1]/2)],i=Zo();return"\n vec4 ".concat(n,"(int index) {\n vec2 uv = packedUVfrom1D(\n ").concat(a[0],", ").concat(a[1],", index);\n return ").concat(i.texture2D,"(").concat(t,", uv);\n }\n ")}(e);case 2:return function(e){var t=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),i=e.shapeInfo.texShape,o=i[0],s=i[1],u=Zo();if(null!=i&&a.util.arraysEqual(t,i))return"\n vec4 ".concat(r,"(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(").concat(s,".0, ").concat(o,".0);\n\n return ").concat(u.texture2D,"(").concat(n,", uv);\n }\n ");var c=[Math.ceil(i[0]/2),Math.ceil(i[1]/2)],l=Math.ceil(t[1]/2);return"\n vec4 ".concat(r,"(int row, int col) {\n vec2 uv = packedUVfrom2D(").concat(l,", ").concat(c[0],", ").concat(c[1],", row, col);\n return ").concat(u.texture2D,"(").concat(n,", uv);\n }\n ")}(e);case 3:return function(e){var t=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),a=e.shapeInfo.texShape,i=[Math.ceil(a[0]/2),Math.ceil(a[1]/2)];if(1===t[0]){var o=t.slice(1),s=fs(e,o);return"\n ".concat(rs(s),"\n vec4 ").concat(r,"(int b, int row, int col) {\n return ").concat(r,"(").concat(ps(["b","row","col"],[1,2]),");\n }\n ")}var u=i[0],c=i[1],l=Math.ceil(t[2]/2),h=l*Math.ceil(t[1]/2),d=Zo();return"\n vec4 ".concat(r,"(int b, int row, int col) {\n vec2 uv = packedUVfrom3D(\n ").concat(u,", ").concat(c,", ").concat(h,", ").concat(l,", b, row, col);\n return ").concat(d.texture2D,"(").concat(n,", uv);\n }\n ")}(e);default:return function(e){for(var t=e.shapeInfo.logicalShape,n=t.length,r=e.name,a="get"+r.charAt(0).toUpperCase()+r.slice(1),i=e.shapeInfo.texShape,o=[Math.ceil(i[0]/2),Math.ceil(i[1]/2)],s=o[0],u=o[1],c=Math.ceil(t[n-1]/2),l=c*Math.ceil(t[n-2]/2),h="int b, int row, int col",d="b * ".concat(l," + (row / 2) * ").concat(c," + (col / 2)"),f=2;f<n-1;f++)h="int b".concat(f,", ")+h,l*=t[n-f-1],d="b".concat(f," * ").concat(l," + ")+d;var p=Zo();return"\n vec4 ".concat(a,"(").concat(h,") {\n int index = ").concat(d,";\n int texR = index / ").concat(u,";\n int texC = index - texR * ").concat(u,";\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(").concat(u,", ").concat(s,");\n return ").concat(p.texture2D,"(").concat(r,", uv);\n }\n ")}(e)}}var as="\nvec2 uvFromFlat(int texNumR, int texNumC, int index) {\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\nvec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\n int texelIndex = index / 2;\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",is="\nvec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR,\n int texNumC, int row, int col) {\n int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",os="\nvec2 packedUVfrom3D(int texNumR, int texNumC,\n int texelsInBatch, int texelsInLogicalRow, int b,\n int row, int col) {\n int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",ss="\n float getChannel(vec4 frag, vec2 innerDims) {\n vec2 modCoord = mod(innerDims, 2.);\n return modCoord.x == 0. ?\n (modCoord.y == 0. ? frag.r : frag.g) :\n (modCoord.y == 0. ? frag.b : frag.a);\n }\n float getChannel(vec4 frag, int dim) {\n float modCoord = mod(float(dim), 2.);\n return modCoord == 0. ? frag.r : frag.g;\n }\n";function us(e){return"offset".concat(e)}function cs(e){var t=e.name,n=a.util.sizeFromShape(e.shapeInfo.logicalShape);return n<2?"return ".concat(t,";"):"\n for (int i = 0; i < ".concat(n,";
2 i++) {\n if (i == index) {\n return ").concat(t,"[i];\n }\n }\n ")}function ls(e,t){var n,r=e.name,i=r.charAt(0).toUpperCase()+r.slice(1),o="get"+i+"AtOutCoords",s=e.shapeInfo.logicalShape.length,u=t.logicalShape.length,c=es(e.shapeInfo.logicalShape,t.logicalShape),l=ds(u),h=u-s,d=["x","y","z","w","u","v"];n=0===s?"":u<2&&c.length>=1?"coords = 0;":c.map((function(e){return"coords.".concat(d[e+h]," = 0;")})).join("\n");var f="";f=u<2&&s>0?"coords":e.shapeInfo.logicalShape.map((function(e,t){return"coords.".concat(d[t+h])})).join(", ");var p="return outputValue;",m=1===a.util.sizeFromShape(e.shapeInfo.logicalShape),v=1===a.util.sizeFromShape(t.logicalShape);if(1!==s||m||v){if(m&&!v)p=1===u?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(c.length){var g=s-2,b=s-1;c.indexOf(g)>-1&&c.indexOf(b)>-1?p="return vec4(outputValue.x);":c.indexOf(g)>-1?p="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":c.indexOf(b)>-1&&(p="return vec4(outputValue.xx, outputValue.zz);")}}else p="\n return vec4(outputValue.xy, outputValue.xy);\n ";return"\n vec4 ".concat(o,"() {\n ").concat(l," coords = getOutputCoords();\n ").concat(n,"\n vec4 outputValue = get").concat(i,"(").concat(f,");\n ").concat(p,"\n }\n ")}function hs(e,t){var n=e.name,r=n.charAt(0).toUpperCase()+n.slice(1),i="get"+r+"AtOutCoords",o=t.texShape,s=e.shapeInfo.texShape,u=e.shapeInfo.logicalShape.length,c=t.logicalShape.length;if(!e.shapeInfo.isUniform&&u===c&&null==e.shapeInfo.flatOffset&&a.util.arraysEqual(s,o))return"\n float ".concat(i,"() {\n return sampleTexture(").concat(n,", resultUV);\n }\n ");var l,h=ds(c),d=es(e.shapeInfo.logicalShape,t.logicalShape),f=c-u,p=["x","y","z","w","u","v"];l=0===u?"":c<2&&d.length>=1?"coords = 0;":d.map((function(e){return"coords.".concat(p[e+f]," = 0;")})).join("\n");var m="";return m=c<2&&u>0?"coords":e.shapeInfo.logicalShape.map((function(e,t){return"coords.".concat(p[t+f])})).join(", "),"\n float ".concat(i,"() {\n ").concat(h," coords = getOutputCoords();\n ").concat(l,"\n return get").concat(r,"(").concat(m,");\n }\n ")}function ds(e){if(e<=1)return"int";if(2===e)return"ivec2";if(3===e)return"ivec3";if(4===e)return"ivec4";if(5===e)return"ivec5";if(6===e)return"ivec6";throw Error("GPU for rank ".concat(e," is not yet supported"))}function fs(e,t){var n=JSON.parse(JSON.stringify(e));return n.shapeInfo.logicalShape=t,n}function ps(e,t){return t.map((function(t){return e[t]})).join(", ")}var ms=function e(t,n,r,o){Object(i.a)(this,e),this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,a.util.assert(t.length>2,(function(){return"Packed arg".concat(r.charAt(0).toUpperCase()+r.slice(1)," supports only inputs with rank above 2.")}));var s=t[t.length-1],u=Math.ceil(s/n);this.outputShape=t.slice(0,-1),u>1&&this.outputShape.push(u),o||this.variableNames.push("bestIndicesA");var c,l,h=this.outputShape,d=h.length,f=ds(d),p=Ko("coords",d);if(1===u){var m=ds(l=d+1);c="\n ".concat(m," sourceLocR = ").concat(m,"(").concat(p.join(),", 0);\n ++").concat(p[d-1],";\n ").concat(m," sourceLocG = ").concat(m,"(").concat(p.join(),", 0);\n ++").concat(p[d-2],";\n ").concat(m," sourceLocA = ").concat(m,"(").concat(p.join(),", 0);\n --").concat(p[d-1],";\n ").concat(m," sourceLocB = ").concat(m,"(").concat(p.join(),", 0);\n --").concat(p[d-2],";")}else l=d,c="\n ".concat(f," sourceLocR = coords;\n ++").concat(p[d-1],";\n ").concat(f," sourceLocG = coords;\n ++").concat(p[d-2],";\n ").concat(f," sourceLocA = coords;\n --").concat(p[d-1],";\n ").concat(f," sourceLocB = coords;\n --").concat(p[d-2],";");var v=["x","y","z","w","u","v"].slice(0,l),g="."+v[l-1],b=v.map((function(e){return"int "+e})),y=Ko("sourceLocR",l-1).concat("inIdx.r"),x=Ko("sourceLocG",l-1).concat("inIdx.g"),w=Ko("sourceLocB",l-1).concat("inIdx.b"),O=Ko("sourceLocA",l-1).concat("inIdx.a"),k="max"===r?"greaterThan":"lessThan",S=o?"":"\n inIdx = round(vec4(getBestIndicesAChannel(".concat(y.join(),"),\n getBestIndicesAChannel(").concat(x.join(),"),\n getBestIndicesAChannel(").concat(w.join(),"),\n getBestIndicesAChannel(").concat(O.join(),")));"),_="vec4(\n getAChannel(".concat(y.join(),"),\n hasNextCol ? getAChannel(").concat(x.join(),") : 0.,\n hasNextRow ? getAChannel(").concat(w.join(),") : 0.,\n hasNextRow && hasNextCol ? getAChannel(").concat(O.join(),") : 0.)"),j=o?"":"\n float getBestIndicesAChannel(".concat(b.join(),") {\n return getChannel(getBestIndicesA(").concat(v.join(),"),\n vec2(").concat(v.slice(-2).join(),"));\n }");this.userCode="\n float getAChannel(".concat(b.join(),") {\n return getChannel(getA(").concat(v.join(),"),\n vec2(").concat(v.slice(-2).join(),"));\n }\n ").concat(j,"\n void main() {\n ").concat(f," coords = getOutputCoords();\n bool hasNextCol = ").concat(p[d-1]," < ").concat(h[d-1]-1,";
2\n bool hasNextRow = ").concat(p[d-2]," < ").concat(h[d-2]-1,";\n ").concat(c,"\n ivec4 srcIdx = ivec4(sourceLocR").concat(g,", sourceLocG").concat(g,",\n sourceLocB").concat(g,", sourceLocA").concat(g,") * ").concat(n,";\n ivec4 inIdx = srcIdx;\n vec4 bestIndex = vec4(inIdx);\n vec4 bestValue = ").concat(_,";\n\n for (int i = 0; i < ").concat(n,"; i++) {\n inIdx = srcIdx;\n ").concat(S,"\n vec4 candidate = ").concat(_,";\n bvec4 nan = isnan(candidate);\n bvec4 replace = bvec4(\n vec4(").concat(k,"(candidate, bestValue)) * (vec4(1.0) - vec4(nan)));\n\n bestValue = vec4(replace.x ? candidate.x : bestValue.x,\n replace.y ? candidate.y : bestValue.y,\n replace.z ? candidate.z : bestValue.z,\n replace.w ? candidate.w : bestValue.w);\n bestIndex = mix(bestIndex, vec4(inIdx), vec4(replace));\n srcIdx++;\n }\n setOutput(bestIndex);\n }\n ")},vs=function e(t){Object(i.a)(this,e),this.variableNames=["dy"],this.outputShape=t.inShape;var n=t.filterHeight,r=t.filterWidth,a=t.strideHeight,o=t.strideWidth,s=t.dilationHeight,u=t.dilationWidth,c=t.effectiveFilterHeight,l=t.effectiveFilterWidth,h=c-1-t.padInfo.top,d=l-1-t.padInfo.left,f=1/(n*r);this.userCode="\n const ivec2 pads = ivec2(".concat(h,", ").concat(d,");\n const float avgMultiplier = float(").concat(f,");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ").concat(c,";\n wR += ").concat(s,") {\n float dyR = float(dyRCorner + wR) / ").concat(a,".0;\n\n if (dyR < 0.0 || dyR >= ").concat(t.outHeight,".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ").concat(l,";\n wC+= ").concat(u,") {\n float dyC = float(dyCCorner + wC) / ").concat(o,".0;\n\n if (dyC < 0.0 || dyC >= ").concat(t.outWidth,".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n ")},gs=function e(t){Object(i.a)(this,e),this.variableNames=["dy"],this.outputShape=t.inShape;var n=t.filterDepth,r=t.filterHeight,a=t.filterWidth,o=t.strideDepth,s=t.strideHeight,u=t.strideWidth,c=t.dilationDepth,l=t.dilationHeight,h=t.dilationWidth,d=t.effectiveFilterDepth,f=t.effectiveFilterHeight,p=t.effectiveFilterWidth,m=d-1-t.padInfo.front,v=f-1-t.padInfo.top,g=p-1-t.padInfo.left,b=1/(n*r*a);this.userCode="\n const ivec3 pads = ivec3(".concat(m,", ").concat(v,", ").concat(g,");\n const float avgMultiplier = float(").concat(b,");\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ").concat(d,";\n wD += ").concat(c,") {\n float dyD = float(dyDCorner + wD) / ").concat(o,".0;\n\n if (dyD < 0.0 || dyD >= ").concat(t.outDepth,".0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ").concat(f,";\n wR += ").concat(l,") {\n float dyR = float(dyRCorner + wR) / ").concat(s,".0;\n\n if (dyR < 0.0 || dyR >= ").concat(t.outHeight,".0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ").concat(p,";\n wC += ").concat(h,") {\n float dyC = float(dyCCorner + wC) / ").concat(u,".0;\n\n if (dyC < 0.0 || dyC >= ").concat(t.outWidth,".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n }\n setOutput(dotProd);\n }\n ")},bs=function e(t,n,r,o,s,u){Object(i.a)(this,e),this.outputShape=[],this.variableNames=["x","mean","variance"],a.backend_util.assertAndGetBroadcastShape(t,n),a.backend_util.assertAndGetBroadcastShape(t,r);var c="0.0";null!=o&&(a.backend_util.assertAndGetBroadcastShape(t,o),this.variableNames.push("offset"),c="getOffsetAtOutCoords()");var l="1.0";null!=s&&(a.backend_util.assertAndGetBroadcastShape(t,s),this.variableNames.push("scale"),l="getScaleAtOutCoords()"),this.outputShape=t,this.userCode="\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = ".concat(c,";\n float scale = ").concat(l,";\n float inv = scale * inversesqrt(variance + float(").concat(u,"));\n setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1)));\n }\n ")},ys=function e(t,n,r,o,s,u){Object(i.a)(this,e),this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],a.backend_util.assertAndGetBroadcastShape(t,n),a.backend_util.assertAndGetBroadcastShape(t,r);var c="vec4(0.0)";null!=o&&(a.backend_util.assertAndGetBroadcastShape(t,o),this.variableNames.push("offset"),c="getOffsetAtOutCoords()");var l="vec4(1.0)";null!=s&&(a.backend_util.assertAndGetBroadcastShape(t,s),this.variableNames.push("scale"),l="getScaleAtOutCoords()"),this.outputShape=t,this.userCode="\n void main() {\n vec4 offset = ".concat(c,";\n vec4 scale = ").concat(l,";\n\n vec4 x = getXAtOutCoords();\n vec4 mean = getMeanAtOutCoords();\n vec4 variance = getVarianceAtOutCoords();\n\n vec4 inv = scale * inversesqrt(variance + vec4(").concat(u,"));\n\n setOutput((x - mean) * inv + offset);\n }\n ")},xs="return areal * breal - aimag * bimag;",ws="return areal * bimag + aimag * breal;",Os=function e(t,n,r){Object(i.a)(this,e),this.variableNames=["AReal","AImag","BReal","BImag"],this.outputShape=a.backend_util.assertAndGetBroadcastShape(n,r),this.userCode="\n float binaryOpComplex(\n float areal, float aimag, float breal, float bimag) {\n ".concat(t,"\n }\n\n void main() {\n float areal = getARealAtOutCoords();\n float aimag = getAImagAtOutCoords();\n float breal = getBRealAtOutCoords();\n float bimag = getBImagAtOutCoords();\n setOutput(binaryOpComplex(areal, aimag, breal, bimag));\n }\n ")},ks="return a + b;",Ss="return a - b;",_s="return a * b;",js="return (a < 0.) ? b * a : a;",Es=function e(t,n,r){Object(i.a)(this,e),this.variableNames=["A","B"],this.outputShape=a.backend_util.assertAndGetBroadcastShape(n,r),this.userCode="\n float binaryOperation(float a, float b) {\n ".concat(t,"\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n ")},Ts="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));
2\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n",Cs=function e(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Object(i.a)(this,e),this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=a.backend_util.assertAndGetBroadcastShape(n,r);var s=this.outputShape.length,u="";if(o)if(0===s||1===a.util.sizeFromShape(this.outputShape))u="\n result.y = 0.;\n result.z = 0.;\n result.w = 0.;\n ";else{var c=ds(s);if(u="\n ".concat(c," coords = getOutputCoords();\n "),1===s)u+="\n result.y = (coords + 1) >= ".concat(this.outputShape[0]," ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n ");else{var l=Ko("coords",s);u+="\n bool nextRowOutOfBounds =\n (".concat(l[s-2]," + 1) >= ").concat(this.outputShape[s-2],";\n bool nextColOutOfBounds =\n (").concat(l[s-1]," + 1) >= ").concat(this.outputShape[s-1],";\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n ")}}this.userCode="\n vec4 binaryOperation(vec4 a, vec4 b) {\n ".concat(t,"\n }\n\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n\n vec4 result = binaryOperation(a, b);\n ").concat(u,"\n\n setOutput(result);\n }\n ")},Ms=function(){function e(t){Object(i.a)(this,e),this.variableNames=["A"],this.outputShape=t,this.userCode="\n uniform float minVal;\n uniform float maxVal;\n\n void main() {\n float value = getAAtOutCoords();\n if (isnan(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, minVal, maxVal));\n }\n "}return Object(o.a)(e,[{key:"getCustomSetupFunc",value:function(e,t){var n=this;return function(r,a){null==n.minLoc&&(n.minLoc=r.getUniformLocationNoThrow(a,"minVal"),n.maxLoc=r.getUniformLocationNoThrow(a,"maxVal")),r.gl.uniform1f(n.minLoc,e),r.gl.uniform1f(n.maxLoc,t)}}}]),e}(),As=function(){function e(t){Object(i.a)(this,e),this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t,this.userCode="\n uniform float minVal;\n uniform float maxVal;\n\n void main() {\n vec4 value = getAAtOutCoords();\n\n if (any(isnan(value))) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, vec4(minVal), vec4(maxVal)));\n }\n "}return Object(o.a)(e,[{key:"getCustomSetupFunc",value:function(e,t){var n=this;return function(r,a){null==n.minLoc&&(n.minLoc=r.getUniformLocationNoThrow(a,"minVal"),n.maxLoc=r.getUniformLocationNoThrow(a,"maxVal")),r.gl.uniform1f(n.minLoc,e),r.gl.uniform1f(n.maxLoc,t)}}}]),e}(),Ns=function e(t){Object(i.a)(this,e),this.variableNames=["real","imag"],this.outputShape=t,this.userCode="\n void main() {\n float re = abs(getRealAtOutCoords());\n float im = abs(getImagAtOutCoords());\n float mx = max(re, im);\n\n // sadly the length function in glsl is not underflow-safe\n // (at least not on Intel GPUs). So the safe solution is\n // to ensure underflow-safety in all cases.\n setOutput(\n mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx))\n );\n }\n "},Rs=function e(t){Object(i.a)(this,e),this.outputShape=[],this.outputShape=a.backend_util.computeOutShape(t,1),this.variableNames=t.map((function(e,t){return"T".concat(t)}));var n=new Array(t.length-1);n[0]=t[0][1];for(var r=1;r<n.length;r++)n[r]=n[r-1]+t[r][1];for(var o=["if (yC < ".concat(n[0],") setOutput(getT0(yR, yC));")],s=1;s<n.length;s++){var u=n[s-1];o.push("else if (yC < ".concat(n[s],") ")+"setOutput(getT".concat(s,"(yR, yC-").concat(u,"));"))}var c=n.length,l=n[n.length-1];o.push("else setOutput(getT".concat(c,"(yR, yC-").concat(l,"));")),this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int yR = coords.x;\n int yC = coords.y;\n\n ".concat(o.join("\n "),"\n }\n ")},Is=function e(t,n){Object(i.a)(this,e),this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[],this.outputShape=a.backend_util.computeOutShape(t,n);var r=this.outputShape,o=r.length,s=ds(o),u=Ko("coords",o),c=["x","y","z","w","u","v"].slice(0,o);this.variableNames=t.map((function(e,t){return"T".concat(t)}));var l=new Array(t.length-1);l[0]=t[0][n];for(var h=1;h<l.length;h++)l[h]=l[h-1]+t[h][n];for(var d=c[n],f=c.slice(-2),p=c.join(),m="if (".concat(d," < ").concat(l[0],") {\n return getChannel(\n getT0(").concat(p,"), vec2(").concat(f.join(),"));\n }"),v=1;v<l.length;v++){var g=l[v-1];m+="\n if (".concat(d," < ").concat(l[v]," && ").concat(d," >= ").concat(l[v-1],") {\n return getChannel(\n getT").concat(v,"(").concat(Ls(c,d,g),"),\n vec2(").concat(Ls(f,d,g),"));\n }")}var b=l.length,y=l[l.length-1];m+="\n return getChannel(\n getT".concat(b,"(").concat(Ls(c,d,y),"),\n vec2(").concat(Ls(f,d,y),"));"),this.userCode="\n float getValue(".concat(c.map((function(e){return"int "+e})),") {\n ").concat(m,"\n }\n\n void main() {\n ").concat(s," coords = getOutputCoords();\n vec4 result = vec4(getValue(").concat(u,"), 0., 0., 0.);\n\n ").concat(u[o-1]," = ").concat(u[o-1]," + 1;\n if (").concat(u[o-1]," < ").concat(r[o-1],") {\n result.g = getValue(").concat(u,");\n }\n\n ").concat(u[o-2]," = ").concat(u[o-2]," + 1;\n if (").concat(u[o-2]," < ").concat(r[o-2],") {\n result.a = getValue(").concat(u,");\n }\n\n ").concat(u[o-1]," = ").concat(u[o-1]," - 1;\n if (").concat(u[o-2]," < ").concat(r[o-2]," &&\n ").concat(u[o-1]," < ").concat(r[o-1],") {\n result.b = getValue(").concat(u,");\n }\n setOutput(result);\n }\n ")};function Ls(e,t,n){var r=e.indexOf(t);return e.map((function(e,t){return t===r?"".concat(e," - ").concat(n):e})).join()}var Ds=function e(t){Object(i.a)(this,e),this.variableNames=["x","dy"],this.outputShape=t.filterShape;var n=t.strideHeight,r=t.strideWidth,a=t.padInfo.top,o=t.padInfo.left,s="channelsLast"===t.dataFormat;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int d2 = coords.w;\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int b = 0; b < ".concat(t.batchSize,"; b++) {\n for (int yR = 0; yR < ").concat(t.outHeight,"; yR++) {\n int xR = wR + yR * ").concat(n," - ").concat(a,";\n\n if (xR < 0 || xR >= ").concat(t.inHeight,") {\n continue;\n }\n\n for (int yC = 0; yC < ").concat(t.outWidth,"; yC++) {\n int xC = wC + yC * ").concat(r," - ").concat(o,";\n\n if (xC < 0 || xC >= ").concat(t.inWidth,") {\n continue;\n }\n\n if (").concat(s,") {\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n } else {\n float dyValue = getDy(b, d2, yR, yC);\n float xValue = getX(b, d1, xR, xC);\n dotProd += (xValue * dyValue);\n }\n\n }\n }\n }\n setOutput(dotProd);\n }\n ")},Ps=function e(t){Object(i.a)(this,e),this.variableNames=["dy","W"],this.outputShape=t.inShape;var n=t.filterHeight,r=t.filterWidth,a=t.strideHeight,o=t.strideWidth,s="channelsLast"===t.dataFormat,u=n-1-t.padInfo.top,c=r-1-t.padInfo.left,l=s?1:2,h=s?2:3,d=s?3:1;this.userCode="\n const ivec2 pads = ivec2(".concat(u,", ").concat(c,");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[").concat(d,"];\n\n ivec2 dyCorner = ivec2(coords[").concat(l,"], coords[").concat(h,"]) - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ").concat(n,"; wR++) {\n float dyR = float(dyRCorner + wR) / ").concat(a,".0;\n\n if (dyR < 0.0 || dyR >= ").concat(t.outHeight,".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ").concat(n," - 1 - wR;\n\n for (int wC = 0; wC < ").concat(r,"; wC++) {\n float dyC = float(dyCCorner + wC) / ").concat(o,".0;\n\n if (dyC < 0.0 || dyC >= ").concat(t.outWidth,".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ").concat(r," - 1 - wC;\n\n for (int d2 = 0; d2 < ").concat(t.outChannels,"; d2++) {\n\n if (").concat(s,") {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n } else {\n float xValue = getDy(batch, d2, idyR, idyC);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n\n }\n }\n }\n setOutput(dotProd);\n }\n ")},zs=function e(t){Object(i.a)(this,e),this.variableNames=["x","dy"],this.outputShape=t.filterShape;var n=t.strideDepth,r=t.strideHeight,a=t.strideWidth,o=t.padInfo.front,s=t.padInfo.top,u=t.padInfo.left;this.userCode="\n void main() {\n ivec5 coords = getOutputCoords();\n int wF = coords.x;\n int wR = coords.y;\n int wC = coords.z;\n int d1 = coords.w;\n int d2 = coords.u;\n\n float dotProd = 0.0;\n\n for (int b = 0; b < ".concat(t.batchSize,"; b++) {\n for (int yF = 0; yF < ").concat(t.outDepth,";
2 yF++) {\n int xF = wF + yF * ").concat(n," - ").concat(o,";\n\n if (xF < 0 || xF >= ").concat(t.inDepth,") {\n continue;\n }\n\n for (int yR = 0; yR < ").concat(t.outHeight,"; yR++) {\n int xR = wR + yR * ").concat(r," - ").concat(s,";\n\n if (xR < 0 || xR >= ").concat(t.inHeight,") {\n continue;\n }\n\n for (int yC = 0; yC < ").concat(t.outWidth,"; yC++) {\n int xC = wC + yC * ").concat(a," - ").concat(u,";\n\n if (xC < 0 || xC >= ").concat(t.inWidth,") {\n continue;\n }\n\n float dyValue = getDy(b, yF, yR, yC, d2);\n float xValue = getX(b, xF, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n ")},Fs=function e(t){Object(i.a)(this,e),this.variableNames=["dy","W"],this.outputShape=t.inShape;var n=t.filterDepth,r=t.filterHeight,a=t.filterWidth,o=t.strideDepth,s=t.strideHeight,u=t.strideWidth,c=n-1-t.padInfo.front,l=r-1-t.padInfo.top,h=a-1-t.padInfo.left;this.userCode="\n const ivec3 pads = ivec3(".concat(c,", ").concat(l,", ").concat(h,");\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.u;\n\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyFCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n float dotProd = 0.0;\n for (int wF = 0; wF < ").concat(n,"; wF++) {\n float dyF = float(dyFCorner + wF) / ").concat(o,".0;\n\n if (dyF < 0.0 || dyF >= ").concat(t.outDepth,".0 || fract(dyF) > 0.0) {\n continue;\n }\n int idyF = int(dyF);\n\n int wFPerm = ").concat(n," - 1 - wF;\n\n for (int wR = 0; wR < ").concat(r,"; wR++) {\n float dyR = float(dyRCorner + wR) / ").concat(s,".0;\n\n if (dyR < 0.0 || dyR >= ").concat(t.outHeight,".0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ").concat(r," - 1 - wR;\n\n for (int wC = 0; wC < ").concat(a,"; wC++) {\n float dyC = float(dyCCorner + wC) / ").concat(u,".0;\n\n if (dyC < 0.0 || dyC >= ").concat(t.outWidth,".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ").concat(a," - 1 - wC;\n\n for (int d2 = 0; d2 < ").concat(t.outChannels,"; d2++) {\n float xValue = getDy(batch, idyF, idyR, idyC, d2);\n float wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n }\n setOutput(dotProd);\n }\n ")},Bs=function e(t){Object(i.a)(this,e),this.variableNames=["x","dy"],this.outputShape=t.filterShape;var n=t.strideHeight,r=t.strideWidth,a=t.padInfo.top,o=t.padInfo.left,s=t.outChannels/t.inChannels;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * ".concat(s," + dm;\n\n float dotProd = 0.0;\n\n // TO DO: Vec4 over the batch size\n for (int b = 0; b < ").concat(t.batchSize,"; b++) {\n for (int yR = 0; yR < ").concat(t.outHeight,"; yR++) {\n int xR = wR + yR * ").concat(n," - ").concat(a,";\n\n if (xR < 0 || xR >= ").concat(t.inHeight,") {\n continue;\n }\n\n for (int yC = 0; yC < ").concat(t.outWidth,"; yC++) {\n int xC = wC + yC * ").concat(r," - ").concat(o,";\n\n if (xC < 0 || xC >= ").concat(t.inWidth,") {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n ")},Us=function e(t){Object(i.a)(this,e),this.variableNames=["dy","W"],this.outputShape=t.inShape;var n=t.filterHeight,r=t.filterWidth,a=t.strideHeight,o=t.strideWidth,s=n-1-t.padInfo.top,u=r-1-t.padInfo.left,c=t.outChannels/t.inChannels;this.userCode="\n const ivec2 pads = ivec2(".concat(s,", ").concat(u,");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < ").concat(n,"; wR++) {\n float dyR = float(dyRCorner + wR) / ").concat(a,".0;\n\n if (dyR < 0.0 || dyR >= ").concat(t.outHeight,".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ").concat(n," - 1 - wR;\n\n for (int wC = 0; wC < ").concat(r,"; wC++) {\n float dyC = float(dyCCorner + wC) / ").concat(o,".0;\n\n if (dyC < 0.0 || dyC >= ").concat(t.outWidth,".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ").concat(r," - 1 - wC;\n\n // TO DO: Vec4 over the channelMul\n for (int dm = 0; dm < ").concat(c,"; dm++) {\n int d2 = d1 * ").concat(c," + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n ")},Ws=function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Object(i.a)(this,e),this.variableNames=["x","W"],this.outputShape=t.outShape;var o=t.padInfo.top,s=t.padInfo.left,u=t.strideHeight,c=t.strideWidth,l=t.dilationHeight,h=t.dilationWidth,d=t.filterHeight,f=t.filterWidth,p=4*Math.floor(t.inChannels/4),m=t.inChannels%4,v="channelsLast"===t.dataFormat,g=v?1:2,b=v?2:3,y=v?3:1,x="",w="";r&&(x=a?"float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ".concat(r,"\n }"):"\n float activation(float x) {\n ".concat(r,"\n }\n "),w="result = activation(result);");var O=n?"result += getBiasAtOutCoords();":"";n&&this.variableNames.push("bias"),a&&this.variableNames.push("preluActivationWeights"),this.userCode="\n ".concat(x,"\n\n const ivec2 strides = ivec2(").concat(u,", ").concat(c,");\n const ivec2 pads = ivec2(").concat(o,", ").concat(s,");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[").concat(y,"];\n\n ivec2 xRCCorner =\n ivec2(coords[").concat(g,"], coords[").concat(b,"]) *
2strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ").concat(d,"; wR++) {\n int xR = xRCorner + wR * ").concat(l,";\n\n if (xR < 0 || xR >= ").concat(t.inHeight,") {\n continue;\n }\n\n for (int wC = 0; wC < ").concat(f,"; wC++) {\n int xC = xCCorner + wC * ").concat(h,";\n\n if (xC < 0 || xC >= ").concat(t.inWidth,") {\n continue;\n }\n\n for (int d1 = 0; d1 < ").concat(p,"; d1 += 4) {\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n if (").concat(v,") {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec4 xValues = vec4(\n getX(batch, d1, xR, xC),\n getX(batch, d1 + 1, xR, xC),\n getX(batch, d1 + 2, xR, xC),\n getX(batch, d1 + 3, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n\n if (").concat(1===m,") {\n\n if (").concat(v,") {\n dotProd +=\n getX(batch, xR, xC, ").concat(p,") *\n getW(wR, wC, ").concat(p,", d2);\n } else {\n dotProd +=\n getX(batch, ").concat(p,", xR, xC) *\n getW(wR, wC, ").concat(p,", d2);\n }\n\n } else if (").concat(2===m,") {\n vec2 wValues = vec2(\n getW(wR, wC, ").concat(p,", d2),\n getW(wR, wC, ").concat(p," + 1, d2)\n );\n\n if (").concat(v,") {\n vec2 xValues = vec2(\n getX(batch, xR, xC, ").concat(p,"),\n getX(batch, xR, xC, ").concat(p," + 1)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec2 xValues = vec2(\n getX(batch, ").concat(p,", xR, xC),\n getX(batch, ").concat(p," + 1, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n } else if (").concat(3===m,") {\n vec3 wValues = vec3(\n getW(wR, wC, ").concat(p,", d2),\n getW(wR, wC, ").concat(p," + 1, d2),\n getW(wR, wC, ").concat(p," + 2, d2)\n );\n\n if (").concat(v,") {\n vec3 xValues = vec3(\n getX(batch, xR, xC, ").concat(p,"),\n getX(batch, xR, xC, ").concat(p," + 1),\n getX(batch, xR, xC, ").concat(p," + 2)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec3 xValues = vec3(\n getX(batch, ").concat(p,", xR, xC),\n getX(batch, ").concat(p," + 1, xR, xC),\n getX(batch, ").concat(p," + 2, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n }\n }\n }\n\n float result = dotProd;\n ").concat(O,"\n ").concat(w,"\n setOutput(result);\n }\n ")},Vs=function e(t){Object(i.a)(this,e),this.variableNames=["x","W"],this.outputShape=t.outShape;var n=t.padInfo.front,r=t.padInfo.top,a=t.padInfo.left,o=t.strideDepth,s=t.strideHeight,u=t.strideWidth,c=t.dilationDepth,l=t.dilationHeight,h=t.dilationWidth,d=t.filterDepth,f=t.filterHeight,p=t.filterWidth,m=4*Math.floor(t.inChannels/4),v=t.inChannels%4;this.userCode="\n const ivec3 strides = ivec3(".concat(o,", ").concat(s,", ").concat(u,");\n const ivec3 pads = ivec3(").concat(n,", ").concat(r,", ").concat(a,");\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d2 = coords.u;\n\n ivec3 xFRCCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xFCorner = xFRCCorner.x;\n int xRCorner = xFRCCorner.y;\n int xCCorner = xFRCCorner.z;\n\n // Convolve x(?, ?, ?, d1) with w(:, :, :, d1, d2) to get\n // y(yF, yR, yC, d2). ? = to be determined. : = across all\n // values in that axis.\n float dotProd = 0.0;\n for (int wF = 0; wF < ").concat(d,";
2 wF++) {\n int xF = xFCorner + wF * ").concat(c,";\n\n if (xF < 0 || xF >= ").concat(t.inDepth,") {\n continue;\n }\n\n for (int wR = 0; wR < ").concat(f,"; wR++) {\n int xR = xRCorner + wR * ").concat(l,";\n\n if (xR < 0 || xR >= ").concat(t.inHeight,") {\n continue;\n }\n\n for (int wC = 0; wC < ").concat(p,"; wC++) {\n int xC = xCCorner + wC * ").concat(h,";\n\n if (xC < 0 || xC >= ").concat(t.inWidth,") {\n continue;\n }\n\n for (int d1 = 0; d1 < ").concat(m,"; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xF, xR, xC, d1),\n getX(batch, xF, xR, xC, d1 + 1),\n getX(batch, xF, xR, xC, d1 + 2),\n getX(batch, xF, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wF, wR, wC, d1, d2),\n getW(wF, wR, wC, d1 + 1, d2),\n getW(wF, wR, wC, d1 + 2, d2),\n getW(wF, wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if (").concat(1===v,") {\n dotProd +=\n getX(batch, xF, xR, xC, ").concat(m,") *\n getW(wF, wR, wC, ").concat(m,", d2);\n } else if (").concat(2===v,") {\n vec2 xValues = vec2(\n getX(batch, xF, xR, xC, ").concat(m,"),\n getX(batch, xF, xR, xC, ").concat(m," + 1)\n );\n vec2 wValues = vec2(\n getW(wF, wR, wC, ").concat(m,", d2),\n getW(wF, wR, wC, ").concat(m," + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if (").concat(3===v,") {\n vec3 xValues = vec3(\n getX(batch, xF, xR, xC, ").concat(m,"),\n getX(batch, xF, xR, xC, ").concat(m," + 1),\n getX(batch, xF, xR, xC, ").concat(m," + 2)\n );\n vec3 wValues = vec3(\n getW(wF, wR, wC, ").concat(m,", d2),\n getW(wF, wR, wC, ").concat(m," + 1, d2),\n getW(wF, wR, wC, ").concat(m," + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n ")},Gs=function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Object(i.a)(this,e),this.variableNames=["x","W"],this.outputShape=t.outShape;var o=t.inHeight,s=t.inWidth,u=t.padInfo.top,c=t.padInfo.left,l=t.strideHeight,h=t.strideWidth,d=t.dilationHeight,f=t.dilationWidth,p=t.filterHeight,m=t.filterWidth,v=t.outChannels/t.inChannels,g="",b="";r&&(g=a?"float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ".concat(r,"\n }"):"\n float activation(float x) {\n ".concat(r,"\n }\n "),b="result = activation(result);");var y=n?"result += getBiasAtOutCoords();":"";n&&this.variableNames.push("bias"),a&&this.variableNames.push("preluActivationWeights"),this.userCode="\n ".concat(g,"\n\n const ivec2 strides = ivec2(").concat(l,", ").concat(h,");\n const ivec2 pads = ivec2(").concat(u,", ").concat(c,");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / ").concat(v,";\n int q = d2 - d1 * ").concat(v,";\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < ").concat(p,"; wR++) {\n int xR = xRCorner + wR * ").concat(d,";\n\n if (xR < 0 || xR >= ").concat(o,") {\n continue;\n }\n\n for (int wC = 0; wC < ").concat(m,"; wC++) {\n int xC = xCCorner + wC * ").concat(f,";\n\n if (xC < 0 || xC >= ").concat(s,") {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n\n float result = dotProd;\n ").concat(y,"\n ").concat(b,"\n setOutput(result);\n }\n ")},Hs=function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Object(i.a)(this,e),this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.outShape;for(var s=t.inHeight,u=t.inWidth,c=t.padInfo.top,l=t.padInfo.left,h=t.strideHeight,d=t.strideWidth,f=t.dilationHeight,p=t.dilationWidth,m=t.filterHeight,v=t.filterWidth,g=v,b="int xR; int xC; int xCOffset;",y=0;y<m;y++)for(var x=0;x<v;x++)b+="\n vec4 xTexelR".concat(y,"C").concat(2*x," = vec4(0.);\n vec4 wR").concat(y,"C").concat(x," = vec4(0.);\n vec4 xR").concat(y,"C").concat(x," = vec4(0.);");for(var w=0;w<m;w++)for(var O=0;O<g;O++){var k=2*O;if(b+="\n xR = xRCorner + ".concat(w*f,";\n xC = xCCorner + ").concat(k*p,";\n "),1===d){if(k<v&&(b+=l%2===1?"\n xCOffset = xC + 1;\n if(xR >= 0 && xR < ".concat(s," && xCOffset >= 0 && xCOffset < ").concat(u,") {\n xTexelR").concat(w,"C").concat(k," = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if(xCOffset + 1 >= ").concat(u,") {\n xTexelR").concat(w,"C").concat(k,".zw = vec2(0.);\n }\n } else {\n xTexelR").concat(w,"C").concat(k," = vec4(0.);\n }\n\n xCOffset = xC + 1 - 2;\n if(xR >= 0 && xR < ").concat(s," && xCOffset >= 0 && xCOffset < ").concat(u,") {\n vec4 previous = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if(xCOffset + 1 >= ").concat(u,") {\n previous.zw = vec2(0.);\n }\n\n xR").concat(w,"C").concat(k," = vec4(previous.zw, xTexelR").concat(w,"C").concat(k,".xy);\n } else {\n xR").concat(w,"C").concat(k," = vec4(0, 0, xTexelR").concat(w,"C").concat(k,".xy);\n }\n "):"\n if(xR >= 0 && xR < ".concat(s," && xC >= 0 && xC < ").concat(u,") {\n xTexelR").concat(w,"C").concat(k," = getX(batch, xR, xC, d1);\n } else {\n xTexelR").concat(w,"C").concat(k," = vec4(0.);\n }\n\n xR").concat(w,"C").concat(k," = xTexelR").concat(w,"C").concat(k,";\n "),k+1<v)){var S=l%2===0?a.util.nearestLargerEven(p):p;p%2===0&&l%2===1||p%2!==0&&l%2!==1?(b+="\n xCOffset = xC + ".concat(l%2," + ").concat(S,";\n\n if(xR >= 0 && xR < ").concat(s," &&\n xCOffset >= 0 && xCOffset < ").concat(u,") {\n xTexelR").concat(w,"C").concat(k+2," = getX(batch, xR, xCOffset, d1);\n }\n "),p>1&&(b+="\n xCOffset -= 2;\n if(xR >= 0 && xR < ".concat(s," &&\n xCOffset >= 0 && xCOffset < ").concat(u,") {\n xTexelR").concat(w,"C").concat(k," = getX(batch, xR, xCOffset, d1);\n } else {\n xTexelR").concat(w,"C").concat(k," = vec4(0.);\n }\n ")),b+="\n xR".concat(w,"C").concat(k+1," = vec4(\n xTexelR").concat(w,"C").concat(k,".zw, xTexelR").concat(w,"C").concat(k+2,".xy);\n ")):b+="\n xCOffset = xC + ".concat(S,";\n\n if(xR >= 0 && xR < ").concat(s," &&\n xCOffset >= 0 && xCOffset < ").concat(u,") {\n xTexelR").concat(w,"C").concat(k+2," = getX(batch, xR, xCOffset, d1);\n }\n\n xR").concat(w,"C").concat(k+1," = xTexelR").concat(w,"C").concat(k+2,";\n ")}}else k<v&&(b+="\n if(xR >= 0 && xR < ".concat(s,") {\n "),l%2===1?(b+="\n xCOffset = xC + 1 - ".concat(d,";\n if(xCOffset >= 0 && xCOffset < ").concat(u,") {\n xTexelR").concat(w,"C").concat(k," = getX(batch, xR, xCOffset, d1);\n } else {\n xTexelR").concat(w,"C").concat(k," = vec4(0.);\n }\n\n if(xC + 1 >= 0 && xC + 1 < ").concat(u,") {\n xTexelR").concat(w,"C").concat(k+2," = getX(batch, xR, xC + 1, d1);\n } else {\n xTexelR").concat(w,"C").concat(k+2," = vec4(0.);\n }\n\n xR").concat(w,"C").concat(k," = vec4(\n xTexelR").concat(w,"C").concat(k,".zw, xTexelR").concat(w,"C").concat(k+2,".zw);\n "),k+1<v&&(b+="\n vec4 final = vec4(0.);\n xCOffset = xC + 1 + ".concat(d,";\n if(xCOffset >= 0 && xCOffset < ").concat(u,") {\n final = getX(batch, xR, xCOffset, d1);\n }\n xR").concat(w,"C").concat(k+1," = vec4(xTexelR").concat(w,"C").concat(k+2,".xy, final.xy);\n "))):(b+="\n if(xC >= 0 && xC < ".concat(u,") {\n xTexelR").concat(w,"C").concat(k," = getX(batch, xR, xC, d1);\n } else {\n xTexelR").concat(w,"C").concat(k," = vec4(0.);\n }\n\n xCOffset = xC + ").concat(d,";\n if(xCOffset >= 0 && xCOffset < ").concat(u,") {\n xTexelR").concat(w,"C").concat(k+2," = getX(batch, xR, xCOffset, d1);\n } else {\n xTexelR").concat(w,"C").concat(k+2," = vec4(0.);\n }\n\n xR").concat(w,"C").concat(k," = vec4(\n xTexelR").concat(w,"C").concat(k,".xy, xTexelR").concat(w,"C").concat(k+2,".xy);\n "),k+1<v&&(b+="\n xR".concat(w,"C").concat(k+1," = vec4(\n xTexelR").concat(w,"C").concat(k,".zw, xTexelR").concat(w,"C").concat(k+2,".zw);\n "))),b+="}");k<v&&(b+="\n vec4 wTexelR".concat(w,"C").concat(k," = getW(").concat(w,", ").concat(k,", d1, q);\n wR").concat(w,"C").concat(k," = vec4(wTexelR").concat(w,"C").concat(k,".xz, wTexelR").concat(w,"C").concat(k,".xz);\n "),k+1<v&&(b+="\n vec4 wTexelR".concat(w,"C").concat(k+1," = getW(").concat(w,", ").concat(k+1,", d1, q);\n wR").concat(w,"C").concat(k+1," =\n vec4(wTexelR").concat(w,"C").concat(k+1,".xz, wTexelR").concat(w,"C").concat(k+1,".xz);")))}for(var _=0;_<m;_++)for(var j=0;j<v;j++)b+="dotProd += xR".concat(_,"C").concat(j," * wR").concat(_,"C").concat(j,";");var E="",T="";r&&(E=o?"vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n ".concat(r,"\n }
2"):"vec4 activation(vec4 x) {\n ".concat(r,"\n }"),T="result = activation(result);");var C=n?"result += getBiasAtOutCoords();":"";n&&this.variableNames.push("bias"),o&&this.variableNames.push("preluActivationWeights"),this.userCode="\n ".concat(E,"\n\n const ivec2 strides = ivec2(").concat(h,", ").concat(d,");\n const ivec2 pads = ivec2(").concat(c,", ").concat(l,");\n\n void main() {\n\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2;\n int q = 0;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n vec4 dotProd = vec4(0.);\n\n ").concat(b,"\n\n vec4 result = dotProd;\n ").concat(C,"\n ").concat(T,"\n setOutput(result);\n }\n ")},qs=function e(t,n,r,a,o){Object(i.a)(this,e),this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];var s=Object(h.a)(t,4),u=s[0],c=s[1],l=s[2],d=s[3],f=Object(h.a)(n,1)[0],p=Object(h.a)(r,2),m=p[0],v=p[1];this.outputShape=[f,m,v,d];var g="bilinear"===a?1:0,b="".concat(c-1,".0"),y="".concat(l-1,".0"),x=m>1?["".concat((c-1)/(m-1)),"(y2-y1) * height_ratio","y1*".concat(b," + float(y)*(height_scale)")]:["0.0","0.0","0.5 * (y1+y2) * ".concat(b)],w=Object(h.a)(x,3),O=w[0],k=w[1],S=w[2],_=v>1?["".concat((l-1)/(v-1)),"(x2-x1) * width_ratio","x1*".concat(y," + float(x)*(width_scale)")]:["0.0","0.0","0.5 * (x1+x2) * ".concat(y)],j=Object(h.a)(_,3),E=j[0],T=j[1],C=j[2];this.userCode="\n const float height_ratio = float(".concat(O,");\n const float width_ratio = float(").concat(E,");\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int y = coords[1];\n int x = coords[2];\n int d = coords[3];\n\n // get box vals\n float y1 = getBoxes(b,0);\n float x1 = getBoxes(b,1);\n float y2 = getBoxes(b,2);\n float x2 = getBoxes(b,3);\n\n // get image in batch index\n int bInd = round(getBoxInd(b));\n if(bInd < 0 || bInd >= ").concat(u,") {\n return;\n }\n\n float height_scale = ").concat(k,";\n float width_scale = ").concat(T,";\n\n float in_y = ").concat(S,";\n if( in_y < 0.0 || in_y > ").concat(b," ) {\n setOutput(float(").concat(o,"));\n return;\n }\n float in_x = ").concat(C,";\n if( in_x < 0.0 || in_x > ").concat(y," ) {\n setOutput(float(").concat(o,"));\n return;\n }\n\n vec2 sourceFracIndexCR = vec2(in_x,in_y);\n if(").concat(g," == 1) {\n // Compute the four integer indices.\n ivec2 sourceFloorCR = ivec2(sourceFracIndexCR);\n ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR));\n\n float topLeft = getImage(b, sourceFloorCR.y, sourceFloorCR.x, d);\n float bottomLeft = getImage(b, sourceCeilCR.y, sourceFloorCR.x, d);\n float topRight = getImage(b, sourceFloorCR.y, sourceCeilCR.x, d);\n float bottomRight = getImage(b, sourceCeilCR.y, sourceCeilCR.x, d);\n\n vec2 fracCR = sourceFracIndexCR - vec2(sourceFloorCR);\n\n float top = topLeft + (topRight - topLeft) * fracCR.x;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x;\n float newValue = top + (bottom - top) * fracCR.y;\n setOutput(newValue);\n } else {\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestCR = ivec2(floor(\n sourceFracIndexCR + vec2(0.5,0.5)));\n float newValue = getImage(b, sourceNearestCR.y, sourceNearestCR.x, d);\n setOutput(newValue);\n }\n }\n ")},Xs=function(){function e(t,n,r){Object(i.a)(this,e),this.variableNames=["x"],this.outputShape=t;var a=t.length,o=n?"0.0":"getX(".concat(Ys(a,"coords"),")"),s=t[t.length-1],u="",c="";n?(u=r?"end != ".concat(s-1):"end != 0",c=r?"end + 1":"end - 1"):(u=r?"end + pow2 < ".concat(s):"end >= pow2",c=r?"end + pow2":"end - pow2"),this.userCode="\n uniform float index;\n void main() {\n ".concat(ds(a)," coords = getOutputCoords();\n int end = ").concat(Ks(a,"coords"),";\n float val = ").concat(o,";\n int pow2 = int(pow(2.0, index));\n if (").concat(u,") {\n int idx = ").concat(c,";\n ").concat(Ks(a,"coords")," = idx;\n val += getX(").concat(Ys(a,"coords"),");\n }\n setOutput(val);\n }\n ")}return Object(o.a)(e,[{key:"getCustomSetupFunc",value:function(e){var t=this;return function(n,r){null==t.index&&(t.index=n.getUniformLocation(r,"index")),n.gl.uniform1f(t.index,e)}}}]),e}();function Ys(e,t){if(1===e)return"".concat(t);if(2===e)return"".concat(t,".x, ").concat(t,".y");if(3===e)return"".concat(t,".x, ").concat(t,".y, ").concat(t,".z");if(4===e)return"".concat(t,".x, ").concat(t,".y, ").concat(t,".z, ").concat(t,".w");throw Error("Cumulative sum for rank ".concat(e," is not yet supported"))}function Ks(e,t){if(1===e)return"".concat(t);if(2===e)return"".concat(t,".y");if(3===e)return"".concat(t,".z");if(4===e)return"".concat(t,".w");throw Error("Cumulative sum for rank ".concat(e," is not yet supported"))}var Zs=function e(t){Object(i.a)(this,e),this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=so.DENSE;var n=mo(t),r=Zo();this.outputShape=t,this.userCode="\n ivec3 outCoordsFromFlatIndex(int index) {\n ".concat(Jo(["r","c","d"],t),"\n return ivec3(r, c, d);\n }
2\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(").concat(n[0],", ").concat(n[1],"));\n int index = 4 * (resTexRC.x * ").concat(n[1]," + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getA(rc.x, rc.y, rc.z);\n }\n\n ").concat(r.output," = result;\n }\n ")},Js=function e(t){Object(i.a)(this,e),this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=so.DENSE;var n=mo(t),r=Zo();this.outputShape=t,this.userCode="\n ivec3 outCoordsFromFlatIndex(int index) {\n ".concat(Jo(["r","c","d"],t),"\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(").concat(n[0],", ").concat(n[1],"));\n int index = 4 * (resTexRC.x * ").concat(n[1]," + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z));\n }\n\n ").concat(r.output," = result;\n }\n ")},Qs=function(){function e(t,n,r){Object(i.a)(this,e),this.variableNames=["x"],this.outputShape=[],this.outputShape=t,this.blockSize=n,this.dataFormat=r,this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int h = ".concat(this.getHeightCoordString(),";\n int w = ").concat(this.getWidthCoordString(),";\n int d = ").concat(this.getDepthCoordString(),";\n\n int in_h = h / ").concat(n,";\n int offset_h = imod(h, ").concat(n,");\n int in_w = w / ").concat(n,";\n int offset_w = imod(w, ").concat(n,");\n int offset_d = (offset_h * ").concat(n," + offset_w) *\n ").concat(this.getOutputDepthSize(),";\n int in_d = d + offset_d;\n\n float result = ").concat(this.getInputSamplingString(),";\n setOutput(result);\n }\n ")}return Object(o.a)(e,[{key:"getHeightCoordString",value:function(){return"NHWC"===this.dataFormat?"coords[1]":"coords[2]"}},{key:"getWidthCoordString",value:function(){return"NHWC"===this.dataFormat?"coords[2]":"coords[3]"}},{key:"getDepthCoordString",value:function(){return"NHWC"===this.dataFormat?"coords[3]":"coords[1]"}},{key:"getOutputDepthSize",value:function(){return"NHWC"===this.dataFormat?this.outputShape[3]:this.outputShape[1]}},{key:"getInputSamplingString",value:function(){return"NHWC"===this.dataFormat?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}}]),e}(),$s=function e(t){Object(i.a)(this,e),this.variableNames=["X"],this.outputShape=[t,t],this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0;\n setOutput(val);\n }\n "},eu=function e(t){Object(i.a)(this,e),this.variableNames=["A"],this.outTexUsage=uo.DOWNLOAD;var n=Zo();this.outputShape=t,this.userCode="\n ".concat($o,"\n\n void main() {\n float x = getAAtOutCoords();\n ").concat(n.output," = encode_float(x);\n }\n ")},tu=function e(t){Object(i.a)(this,e),this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=uo.DOWNLOAD;var n=Zo();this.outputShape=t,this.userCode="\n ".concat($o,"\n\n void main() {\n ivec3 coords = getOutputCoords();\n float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z));\n ").concat(n.output," = encode_float(x);\n }\n ")},nu=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Object(i.a)(this,e),this.variableNames=["A"];var a=Zo(),o=Object(h.a)(n,2),s=o[0],u=o[1];this.outputShape=t;var c="result";r&&(c="floor(result * 255. + 0.5)"),this.userCode="\n ".concat(Qo(t),"\n\n void main() {\n ivec3 coords = getOutputCoords();\n\n int flatIndex = getFlatIndex(coords);\n int offset = imod(flatIndex, 4);\n\n flatIndex = idiv(flatIndex, 4, 1.);\n\n int r = flatIndex / ").concat(u,";\n int c = imod(flatIndex, ").concat(u,");\n vec2 uv = (vec2(c, r) + halfCR) / vec2(").concat(u,".0, ").concat(s,".0);\n vec4 values = ").concat(a.texture2D,"(A, uv);\n\n float result;\n\n if(offset == 0) {\n result = values[0];\n } else if(offset == 1) {\n result = values[1];\n } else if(offset == 2) {\n result = values[2];\n } else {\n result = values[3];\n }\n\n ").concat(a.output," = vec4(").concat(c,", 0., 0., 0.);\n }\n ")},ru=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Object(i.a)(this,e),this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;var a=Zo(),o=Object(h.a)(n,2),s=o[0],u=o[1];this.outputShape=t;var c="",l="result";r&&(l="floor(result * 255. + 0.5)");for(var d=0;d<=1;d++)for(var f=0;f<=1;f++){var p=2*d+f;c+="\n localCoords = coords;\n if(localCoords[2] + ".concat(f," < ").concat(t[2],") {\n localCoords[2] += ").concat(f,";\n if(localCoords[1] + ").concat(d," < ").concat(t[1],") {\n localCoords[1] += ").concat(d,";\n\n flatIndex = getFlatIndex(localCoords);\n offset = imod(flatIndex, 4);\n\n flatIndex = idiv(flatIndex, 4, 1.);\n\n r = flatIndex / ").concat(u,";\n c = imod(flatIndex, ").concat(u,");\n uv = (vec2(c, r) + halfCR) / vec2(").concat(u,".0, ").concat(s,".0);\n values = ").concat(a.texture2D,"(A, uv);\n\n if(offset == 0) {\n result[").concat(p,"] = values[0];\n } else if(offset == 1) {\n result[").concat(p,"] = values[1];\n } else if(offset == 2) {\n result[").concat(p,"] = values[2];\n } else {\n result[").concat(p,"] = values[3];\n }\n }\n }\n ")}this.userCode="\n ".concat(Qo(t),"\n\n void main() {\n ivec3 coords = getOutputCoords();\n\n vec4 result = vec4(0.);\n int flatIndex, r, c, offset;\n ivec3 localCoords;\n vec2 uv;\n vec4 values;\n\n ").concat(c,"\n\n ").concat(a.output," = ").concat(l,";\n }\n ")},au="return real * expR - imag * expI;",iu="return real * expI + imag * expR;",ou=function e(t,n,r){Object(i.a)(this,e),this.variableNames=["real","imag"];var a=n[1];this.outputShape=n;var o=r?"2.0 * ".concat(Math.PI):"-2.0 * ".concat(Math.PI),s=r?"".concat(a,".0"):"1.0";this.userCode="\n const float exponentMultiplier = ".concat(o,";\n\n float unaryOpComplex(float real, float expR, float imag, float expI) {\n ").concat(t,"\n }\n\n float mulMatDFT(int batch, int index) {\n float indexRatio = float(index) / float(").concat(a,");\n float exponentMultiplierTimesIndexRatio =\n exponentMultiplier * indexRatio;\n\n float result = 0.0;\n\n for (int i = 0; i < ").concat(a,";
2 i++) {\n // x = (-2|2 * PI / N) * index * i;\n float x = exponentMultiplierTimesIndexRatio * float(i);\n float expR = cos(x);\n float expI = sin(x);\n float real = getReal(batch, i);\n float imag = getImag(batch, i);\n\n result +=\n unaryOpComplex(real, expR, imag, expI) / ").concat(s,";\n }\n\n return result;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n setOutput(mulMatDFT(coords[0], coords[1]));\n }\n ")},su=function(){function e(t,n){Object(i.a)(this,e),this.outputShape=[],this.variableNames=["x"],this.outputShape=t,this.userCode="\n uniform float value;\n void main() {\n // Input can be obtained from uniform value.\n setOutput(value);\n }\n "}return Object(o.a)(e,[{key:"getCustomSetupFunc",value:function(e){var t=this;return function(n,r){null==t.valueLoc&&(t.valueLoc=n.getUniformLocationNoThrow(r,"value")),n.gl.uniform1f(t.valueLoc,e)}}}]),e}(),uu=function e(t,n,r){Object(i.a)(this,e),this.variableNames=["A","indices"];var a=t.slice();a[r]=n,this.outputShape=a,this.rank=a.length;var o=ds(this.rank),s=function(e,t){var n=e.length;if(n>4)throw Error("Gather for rank ".concat(n," is not yet supported"));if(1===n)return"int(getIndices(resRC))";for(var r=["resRC.x","resRC.y","resRC.z","resRC.w"],a=[],i=0;i<e.length;i++)i===t?a.push("int(getIndices(".concat(r[i],"))")):a.push("".concat(r[i]));return a.join()}(t,r);this.userCode="\n void main() {\n ".concat(o," resRC = getOutputCoords();\n setOutput(getA(").concat(s,"));\n }\n ")};var cu=function e(t,n,r){Object(i.a)(this,e),this.sliceDim=t,this.strides=n,this.variableNames=["x","indices"],this.outputShape=r;var a=ds(n.length),o=ds(r.length),s=this.sliceDim>1?"strides[j]":"strides";this.userCode="\n ".concat(a," strides = ").concat(a,"(").concat(this.strides,");\n void main() {\n ").concat(o," coords = getOutputCoords();\n int flattenIndex = 0;\n for (int j = 0; j < ").concat(this.sliceDim,"; j++) {\n int index = round(getIndices(coords[0], j));\n flattenIndex += index * ").concat(s,";\n }\n setOutput(getX(flattenIndex, coords[1]));\n }\n ")};function lu(e){var t=Zo();return function(e,t){var n=Ro(e,(function(){return e.createShader(e.VERTEX_SHADER)}),"Unable to create vertex WebGLShader.");if(bo(e,(function(){return e.shaderSource(n,t)})),bo(e,(function(){return e.compileShader(n)})),!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw console.log(e.getShaderInfoLog(n)),new Error("Failed to compile vertex shader.");return n}(e,"".concat(t.version,"\n precision highp float;\n ").concat(t.attribute," vec3 clipSpacePos;\n ").concat(t.attribute," vec2 uv;\n ").concat(t.varyingVs," vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }"))}function hu(e){return function(e,t){var n=Ro(e,(function(){return e.createBuffer()}),"Unable to create WebGLBuffer");return bo(e,(function(){return e.bindBuffer(e.ARRAY_BUFFER,n)})),bo(e,(function(){return e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW)})),n}(e,new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]))}function du(e){return function(e,t){var n=Ro(e,(function(){return e.createBuffer()}),"Unable to create WebGLBuffer");return bo(e,(function(){return e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n)})),bo(e,(function(){return e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW)})),n}(e,new Uint16Array([0,1,2,2,1,3]))}function fu(e,t,n,r,i,o){!function(e,t){var n=Object(a.env)().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e<=0||t<=0){var r="[".concat(e,"x").concat(t,"]");throw new Error("Requested texture size "+r+" is invalid.")}if(e>n||t>n){var i="[".concat(e,"x").concat(t,"]"),o="[".concat(n,"x").concat(n,"]");throw new Error("Requested texture size "+i+" greater than WebGL maximum on this browser / GPU "+o+".")}}
2(t,n);var s=function(e){return Ro(e,(function(){return e.createTexture()}),"Unable to create WebGLTexture.")}(e),u=e.TEXTURE_2D;return bo(e,(function(){return e.bindTexture(u,s)})),bo(e,(function(){return e.texParameteri(u,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE)})),bo(e,(function(){return e.texParameteri(u,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)})),bo(e,(function(){return e.texParameteri(u,e.TEXTURE_MIN_FILTER,e.NEAREST)})),bo(e,(function(){return e.texParameteri(u,e.TEXTURE_MAG_FILTER,e.NEAREST)})),bo(e,(function(){return e.texImage2D(u,0,r,t,n,0,i,o,null)})),bo(e,(function(){return e.bindTexture(e.TEXTURE_2D,null)})),s}function pu(e){return e.internalFormatFloat}function mu(e){return e.internalFormatHalfFloat}function vu(e){return e.downloadTextureFormat}function gu(e){return e.internalFormatPackedFloat}function bu(e){return e.internalFormatPackedHalfFloat}function yu(e,t,n,r,a,i,o,s){var u=e,c=new Float32Array(function(e,t){var n=vo(e,t),r=Object(h.a)(n,2);return r[0]*r[1]*4}(i,o));return u.bindBuffer(u.PIXEL_PACK_BUFFER,t),u.getBufferSubData(u.PIXEL_PACK_BUFFER,0,c),u.bindBuffer(u.PIXEL_PACK_BUFFER,null),c}var xu=function(){function e(t){Object(i.a)(this,e),this.outputTexture=null,this.program=null,this.disposed=!1,this.vertexAttrsAreBound=!1,this.itemsToPoll=[];var n=Object(a.env)().getNumber("WEBGL_VERSION");null!=t?(this.gl=t,function(e,t){lo[e]=t}(n,t)):this.gl=fo(n);var r="WEBGL_color_buffer_float";if(1===Object(a.env)().getNumber("WEBGL_VERSION")){if(this.textureFloatExtension=xo(this.gl,"OES_texture_float"),Bo(this.gl,"OES_texture_half_float"))this.textureHalfFloatExtension=xo(this.gl,"OES_texture_half_float");else if(Object(a.env)().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support half float textures, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.");if(this.colorBufferFloatExtension=this.gl.getExtension(r),Bo(this.gl,"EXT_color_buffer_half_float"))this.colorBufferHalfFloatExtension=xo(this.gl,"EXT_color_buffer_half_float");else if(Object(a.env)().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support color renderable half floats, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.")}else if(r="EXT_color_buffer_float",Bo(this.gl,r))this.colorBufferFloatExtension=this.gl.getExtension(r);else{if(!Bo(this.gl,"EXT_color_buffer_half_float"))throw new Error("GL context does not support color renderable floats");this.colorBufferHalfFloatExtension=this.gl.getExtension("EXT_color_buffer_half_float")}this.vertexBuffer=hu(this.gl),this.indexBuffer=du(this.gl),this.framebuffer=function(e){return Ro(e,(function(){return e.createFramebuffer()}),"Unable to create WebGLFramebuffer.")}(this.gl),this.textureConfig=go(this.gl,this.textureHalfFloatExtension)}return Object(o.a)(e,[{key:"dispose",value:function(){var e=this;if(!this.disposed){null!=this.program&&console.warn("Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing."),null!=this.outputTexture&&console.warn("Disposing a GPGPUContext that still has a bound output matrix texture. This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.");var t=this.gl;bo(t,(function(){return t.finish()})),bo(t,(function(){return t.bindFramebuffer(t.FRAMEBUFFER,null)})),bo(t,(function(){return t.deleteFramebuffer(e.framebuffer)})),bo(t,(function(){return t.bindBuffer(t.ARRAY_BUFFER,null)})),bo(t,(function(){return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)})),bo(t,(function(){return t.deleteBuffer(e.indexBuffer)})),this.disposed=!0}}},{key:"createFloat32MatrixTexture",value:function(e,t){return this.throwIfDisposed(),function(e,t,n,r){var a=po(t,n),i=Object(h.a)(a,2);return fu(e,i[0],i[1],pu(r),r.textureFormatFloat,e.FLOAT)}(this.gl,e,t,this.textureConfig)}},{key:"createFloat16MatrixTexture",value:function(e,t){return this.throwIfDisposed(),function(e,t,n,r){var a=po(t,n),i=Object(h.a)(a,2);return fu(e,i[0],i[1],mu(r),r.textureFormatFloat,r.textureTypeHalfFloat)}(this.gl,e,t,this.textureConfig)}},{key:"createUnsignedBytesMatrixTexture",value:function(e,t){return this.throwIfDisposed(),function(e,t,n,r){var a=po(t,n),i=Object(h.a)(a,2);return fu(e,i[0],i[1],vu(r),e.RGBA,e.UNSIGNED_BYTE)}(this.gl,e,t,this.textureConfig)}},{key:"uploadPixelDataToTexture",value:function(e,t){this.throwIfDisposed(),function(e,t,n){bo(e,(function(){return e.bindTexture(e.TEXTURE_2D,t)})),n.data instanceof Uint8Array?bo(e,(function(){return e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)})):bo(e,(function(){return e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)})),bo(e,(function(){return e.bindTexture(e.TEXTURE_2D,null)}))}(this.gl,e,t)}},{key:"uploadDenseMatrixToTexture",value:function(e,t,n,r){this.throwIfDisposed(),function(e,t,n,r,a,i){var o,s,u;bo(e,(function(){return e.bindTexture(e.TEXTURE_2D,t)})),a instanceof Uint8Array?(o=new Uint8Array(n*r*4),s=e.UNSIGNED_BYTE,u=e.RGBA):(o=new Float32Array(n*r*4),s=e.FLOAT,u=i.internalFormatPackedFloat),o.set(a),bo(e,(function(){return e.texImage2D(e.TEXTURE_2D,0,u,n,r,0,e.RGBA,s,o)})),bo(e,(function(){return e.bindTexture(e.TEXTURE_2D,null)}))}(this.gl,e,t,n,r,this.textureConfig)}},{key:"createFloat16PackedMatrixTexture",value:function(e,t){return this.throwIfDisposed(),function(e,t,n,r){var a=vo(t,n),i=Object(h.a)(a,2);return fu(e,i[0],i[1],bu(r),e.RGBA,r.textureTypeHalfFloat)}(this.gl,e,t,this.textureConfig)}},{key:"createPackedMatrixTexture",value:function(e,t){return this.throwIfDisposed(),function(e,t,n,r){var a=vo(t,n),i=Object(h.a)(a,2);return fu(e,i[0],i[1],gu(r),e.RGBA,e.FLOAT)}(this.gl,e,t,this.textureConfig)}},{key:"deleteMatrixTexture",value:function(e){var t=this;this.throwIfDisposed(),this.outputTexture===e&&(Ao(this.gl,this.framebuffer),this.outputTexture=null),bo(this.gl,(function(){return t.gl.deleteTexture(e)}))}},{key:"downloadByteEncodedFloatMatrixFromOutputTexture",value:function(e,t,n){var r=this;return this.downloadMatrixDriver(e,(function(){return function(e,t,n,r){var a=po(t,n),i=Object(h.a)(a,2),o=i[0],s=i[1],u=new Uint8Array(t*n*4);return bo(e,(function(){return e.readPixels(0,0,o,s,r.downloadTextureFormat,e.UNSIGNED_BYTE,u)})),new Float32Array(u.buffer)}(r.gl,t,n,r.textureConfig)}))}},{key:"downloadPackedMatrixFromBuffer",value:function(e,t,n,r,a,i){return yu(this.gl,e,0,0,0,a,i,this.textureConfig)}},{key:"downloadFloat32MatrixFromBuffer",value:function(e,t){return function(e,t,n){var r=e,a=new Float32Array(n);return r.bindBuffer(r.PIXEL_PACK_BUFFER,t),r.getBufferSubData(r.PIXEL_PACK_BUFFER,0,a),r.bindBuffer(r.PIXEL_PACK_BUFFER,null),a}(this.gl,e,t)}},{key:"createBufferFromTexture",value:function(e,t,n){this.bindTextureToFrameBuffer(e);var r=function(e,t,n,r){var a=e.createBuffer();bo(e,(function(){return e.bindBuffer(e.PIXEL_PACK_BUFFER,a)}));var i=16*t*n;return bo(e,(function(){return e.bufferData(e.PIXEL_PACK_BUFFER,i,e.STREAM_READ)})),bo(e,(function(){return e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,0)})),bo(e,(function(){return e.bindBuffer(e.PIXEL_PACK_BUFFER,null)})),a}(this.gl,t,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),r}},{key:"createAndWaitForFence",value:function(){var e=this.createFence(this.gl);
2return this.pollFence(e)}},{key:"createFence",value:function(e){var t,n,r=this;if(Object(a.env)().getBool("WEBGL_FENCE_API_ENABLED")){var i=e,o=i.fenceSync(i.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),n=function(){var e=i.clientWaitSync(o,0,0);return e===i.ALREADY_SIGNALED||e===i.CONDITION_SATISFIED},t=o}else Object(a.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),n=function(){return r.isQueryAvailable(t,Object(a.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}):n=function(){return!0};return{query:t,isFencePassed:n}}},{key:"downloadMatrixFromPackedTexture",value:function(e,t,n){var r=this;return this.downloadMatrixDriver(e,(function(){return function(e,t,n){var r=new Float32Array(t*n*4);return bo(e,(function(){return e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,r)})),r}(r.gl,t,n)}))}},{key:"createProgram",value:function(e){this.throwIfDisposed();var t=this.gl,n=wo(t,e),r=lu(t),a=function(e){return Ro(e,(function(){return e.createProgram()}),"Unable to create WebGLProgram.")}(t);return bo(t,(function(){return t.attachShader(a,r)})),bo(t,(function(){return t.attachShader(a,n)})),function(e,t){if(bo(e,(function(){return e.linkProgram(t)})),!1===e.getProgramParameter(t,e.LINK_STATUS))throw console.log(e.getProgramInfoLog(t)),new Error("Failed to link vertex and fragment shaders.")}(t,a),this.debug&&_o(t,a),this.vertexAttrsAreBound||(this.setProgram(a),this.vertexAttrsAreBound=function(e,t,n){return bo(e,(function(){return e.bindBuffer(e.ARRAY_BUFFER,n)})),jo(e,t,"clipSpacePos",n,3,20,0)&&jo(e,t,"uv",n,2,20,12)}(t,this.program,this.vertexBuffer)),a}},{key:"deleteProgram",value:function(e){var t=this;this.throwIfDisposed(),e===this.program&&(this.program=null),null!=e&&bo(this.gl,(function(){return t.gl.deleteProgram(e)}))}},{key:"setProgram",value:function(e){var t=this;this.throwIfDisposed(),this.program=e,null!=this.program&&this.debug&&_o(this.gl,this.program),bo(this.gl,(function(){return t.gl.useProgram(e)}))}},{key:"getUniformLocation",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return this.throwIfDisposed(),n?Eo(this.gl,e,t):To(this.gl,e,t)}},{key:"getAttributeLocation",value:function(e,t){var n=this;return this.throwIfDisposed(),bo(this.gl,(function(){return n.gl.getAttribLocation(e,t)}))}},{key:"getUniformLocationNoThrow",value:function(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)}},{key:"setInputMatrixTexture",value:function(e,t,n){this.throwIfDisposed(),this.throwIfNoProgram(),Co(this.gl,e,t,n)}},{key:"setOutputMatrixTexture",value:function(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)}},{key:"setOutputPackedMatrixTexture",value:function(e,t,n){this.throwIfDisposed();var r=vo(t,n),a=Object(h.a)(r,2),i=a[0],o=a[1];this.setOutputMatrixTextureDriver(e,i,o)}},{key:"setOutputMatrixWriteRegion",value:function(e,t,n,r){this.setOutputMatrixWriteRegionDriver(n,e,r,t)}},{key:"setOutputPackedMatrixWriteRegion",value:function(e,t,n,r){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}},{key:"debugValidate",value:function(){null!=this.program&&_o(this.gl,this.program),No(this.gl)}},{key:"executeProgram",value:function(){this.throwIfDisposed(),this.throwIfNoProgram();var e=this.gl;this.debug&&this.debugValidate(),bo(e,(function(){return e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0)}))}},{key:"blockUntilAllProgramsCompleted",value:function(){var e=this;this.throwIfDisposed(),bo(this.gl,(function(){return e.gl.finish()}))}},{key:"getQueryTimerExtension",value:function(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=xo(this.gl,2===Object(a.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension}},{key:"getQueryTimerExtensionWebGL2",value:function(){return this.getQueryTimerExtension()}},{key:"getQueryTimerExtensionWebGL1",value:function(){return this.getQueryTimerExtension()}},{key:"beginQuery",value:function(){if(2===Object(a.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){var e=this.gl,t=this.getQueryTimerExtensionWebGL2(),n=e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT,n),n}
2var r=this.getQueryTimerExtensionWebGL1(),i=r.createQueryEXT();return r.beginQueryEXT(r.TIME_ELAPSED_EXT,i),i}},{key:"endQuery",value:function(){if(2!==Object(a.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){var e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}else{var t=this.gl,n=this.getQueryTimerExtensionWebGL2();t.endQuery(n.TIME_ELAPSED_EXT)}}},{key:"waitForQueryAndGetTime",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t){var n=this;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.util.repeatedTry((function(){return n.disposed||n.isQueryAvailable(t,Object(a.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}));case 2:return e.abrupt("return",this.getQueryTime(t,Object(a.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getQueryTime",value:function(e,t){if(0===t)return null;if(2===t){var n=this.gl;return n.getQueryParameter(e,n.QUERY_RESULT)/1e6}var r=this.getQueryTimerExtensionWebGL1();return r.getQueryObjectEXT(e,r.QUERY_RESULT_EXT)/1e6}},{key:"isQueryAvailable",value:function(e,t){if(0===t)return!0;if(2===t){var n=this.gl,r=this.getQueryTimerExtensionWebGL2(),a=n.getQueryParameter(e,n.QUERY_RESULT_AVAILABLE);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(r.GPU_DISJOINT_EXT)),a&&!this.disjoint}var i=this.getQueryTimerExtensionWebGL1(),o=i.getQueryObjectEXT(e,i.QUERY_RESULT_AVAILABLE_EXT);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(i.GPU_DISJOINT_EXT)),o&&!this.disjoint}},{key:"pollFence",value:function(e){var t=this;return new Promise((function(n){t.addItemToPoll((function(){return e.isFencePassed()}),(function(){return n()}))}))}},{key:"pollItems",value:function(){for(var e=function(e){for(var t=0;t<e.length;++t){if(!e[t]())break}return t-1}(this.itemsToPoll.map((function(e){return e.isDoneFn}))),t=0;t<=e;++t){(0,this.itemsToPoll[t].resolveFn)()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}},{key:"addItemToPoll",value:function(e,t){var n=this;this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1||a.util.repeatedTry((function(){return n.pollItems(),0===n.itemsToPoll.length}))}},{key:"bindTextureToFrameBuffer",value:function(e){this.throwIfDisposed(),Mo(this.gl,e,this.framebuffer),this.debug&&No(this.gl)}},{key:"unbindTextureToFrameBuffer",value:function(){null!=this.outputTexture?(Mo(this.gl,this.outputTexture,this.framebuffer),this.debug&&No(this.gl)):Ao(this.gl,this.framebuffer)}},{key:"downloadMatrixDriver",value:function(e,t){this.bindTextureToFrameBuffer(e);var n=t();return this.unbindTextureToFrameBuffer(),n}},{key:"setOutputMatrixTextureDriver",value:function(e,t,n){this.throwIfDisposed();var r=this.gl;Mo(r,e,this.framebuffer),this.debug&&No(r),this.outputTexture=e,bo(r,(function(){return r.viewport(0,0,t,n)})),bo(r,(function(){return r.scissor(0,0,t,n)}))}},{key:"setOutputMatrixWriteRegionDriver",value:function(e,t,n,r){var a=this;this.throwIfDisposed(),bo(this.gl,(function(){return a.gl.scissor(e,t,n,r)}))}},{key:"throwIfDisposed",value:function(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")}},{key:"throwIfNoProgram",value:function(){if(null==this.program)throw new Error("No GPU program is currently set.")}},{key:"debug",get:function(){return Object(a.env)().getBool("DEBUG")}}]),e}();function wu(e,t,n,r){var i=t.userCode,o=n.map((function(e,n){var r={logicalShape:e.shape,texShape:e.isUniform?null:e.texData.texShape,isUniform:e.isUniform,isPacked:!e.isUniform&&e.texData.isPacked,flatOffset:null};return null!=e.texData&&null!=e.texData.slice&&e.texData.slice.flatOffset>0&&(r.flatOffset=e.texData.slice.flatOffset),{name:t.variableNames[n],shapeInfo:r}})),s=o.map((function(e){return e.shapeInfo})),u={logicalShape:r.shape,texShape:r.texData.texShape,isUniform:!1,isPacked:r.texData.isPacked,flatOffset:null},c=ts(o,u,i,t.packedInputs),l=e.createProgram(c),h=null,d=e.getUniformLocation(l,"NAN",!1);1===Object(a.env)().getNumber("WEBGL_VERSION")&&(h=e.getUniformLocation(l,"INFINITY",!1));for(var f={},p=0;p<t.variableNames.length;p++){var m=t.variableNames[p];f[m]=e.getUniformLocation(l,m,!1),f["offset".concat(m)]=e.getUniformLocation(l,"offset".concat(m),!1)}return{program:t,source:c,webGLProgram:l,uniformLocations:f,inShapeInfos:s,outShapeInfo:u,infLoc:h,nanLoc:d}}function Ou(e,t){if(e.length!==t.length)throw Error("Binary was compiled with ".concat(e.length," inputs, but ")+"was executed with ".concat(t.length," inputs"));e.forEach((function(e,n){var r=e.logicalShape,i=t[n],o=i.shape;if(!a.util.arraysEqual(r,o))throw Error("Binary was compiled with different shapes than "+"the current args. Shapes ".concat(r," and ").concat(o," must match"));if(!e.isUniform||!i.isUniform){var s=e.texShape,u=i.isUniform?null:i.texData.texShape;if(!a.util.arraysEqual(s,u))throw Error("Binary was compiled with different texture shapes than the"+" current args. Shape ".concat(s," and ").concat(u," must match"))}}))}function ku(e,t,n,r,i){Ou(t.inShapeInfos,n),Ou([t.outShapeInfo],[r]);var o=r.texData.texture,s=r.texData.texShape;r.texData.isPacked?e.setOutputPackedMatrixTexture(o,s[0],s[1]):e.setOutputMatrixTexture(o,s[0],s[1]),e.setProgram(t.webGLProgram),1===Object(a.env)().getNumber("WEBGL_VERSION")&&null!==t.infLoc&&e.gl.uniform1f(t.infLoc,1/0),null!==t.nanLoc&&e.gl.uniform1f(t.nanLoc,NaN),n.forEac
2h((function(n,r){var i=t.program.variableNames[r],o=t.uniformLocations[i],s=t.uniformLocations["offset".concat(i)];if(null!=o)if(n.isUniform)if(a.util.sizeFromShape(n.shape)<2)e.gl.uniform1f(o,n.uniformValues[0]);else{var u=n.uniformValues;u instanceof Float32Array||(u=new Float32Array(u)),e.gl.uniform1fv(o,u)}else null!=n.texData.slice&&null!=s&&e.gl.uniform1i(s,n.texData.slice.flatOffset),e.setInputMatrixTexture(n.texData.texture,o,r)})),null!=i&&i(e,t.webGLProgram),e.executeProgram()}function Su(e,t,n){var r="";t.concat(n).forEach((function(e){var t=null!=e.texData&&null!=e.texData.slice&&e.texData.slice.flatOffset>0,n=e.isUniform?"uniform":e.texData.texShape;r+="".concat(e.shape,"_").concat(n,"_").concat(t)}));var a=e.userCode,i=e.constructor.name;return i+="_"+r+"_"+a}var _u=function e(t,n,r){Object(i.a)(this,e),this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t;for(var a=r.filterWidth,o=r.inChannels,s=r.strideWidth,u=r.strideHeight,c=r.padInfo,l=r.outWidth,h=r.dilationWidth,d=r.dilationHeight,f=r.dataFormat,p=c.left,m=c.top,v=o*a,g=Zo(),b="channelsLast"===f,y=b?0:1,x=b?1:2,w="",O=0;O<=1;O++)for(var k=0;k<=1;k++)w+="\n blockIndex = rc.y + ".concat(k,";\n pos = rc.x + ").concat(O,";\n\n if(blockIndex < ").concat(t[1]," && pos < ").concat(t[0],") {\n offsetY = int(blockIndex / (").concat(l,")) * ").concat(u," - ").concat(m,";\n d0 = offsetY + ").concat(d," * (pos / ").concat(v,");\n\n if(d0 < ").concat(n[y]," && d0 >= 0) {\n\n offsetX = int(mod(float(blockIndex), ").concat(l,".) * ").concat(s,". - ").concat(p,".);\n d1 = offsetX + ").concat(h," * (int(mod(float(pos), ").concat(v,".) / ").concat(o,".));\n\n if(d1 < ").concat(n[x]," && d1 >= 0) {\n\n ch = int(mod(float(pos), ").concat(o,".));\n\n if (").concat(b,") {\n innerDims = vec2(d1, ch);\n result[").concat(2*O+k,"] = getChannel(\n getA(d0, int(innerDims.x),\n int(innerDims.y)), innerDims);\n } else {\n innerDims = vec2(d0, d1);\n result[").concat(2*O+k,"] = getChannel(\n getA(ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n }\n ");this.userCode="\n void main() {\n ivec2 rc = getOutputCoords();\n\n vec4 result = vec4(0);\n\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n\n ".concat(w,"\n\n ").concat(g.output," = result;\n }\n ")},ju=function e(t,n,r,a,o){Object(i.a)(this,e),this.variableNames=["x"],this.outputShape=[];var s,u=n,c=t[3]-1;this.outputShape=t;var l="float(".concat(r,") + float(").concat(a,") * sum");s=.5===o?"inversesqrt(".concat(l,")"):1===o?"1.0/(".concat(l,")"):"exp(log(".concat(l,") * float(-").concat(o,"));"),this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n int d = coords[3];\n float x = getX(b, r, c, d);\n float sum = 0.0;\n for (int j = -".concat(u,"; j <= ").concat(u,"; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= ").concat(c,") {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * ").concat(s,";\n setOutput(val);\n }\n ")},Eu=function e(t,n,r,a,o){Object(i.a)(this,e),this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=t,this.depth=t[3],this.depthRadius=n,this.bias=r,this.alpha=a,this.beta=o,this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < ".concat(this.depth,"; ++d) {\n int depthBegin = int(max(0.0, float(d - ").concat(n,")));\n int depthEnd = int(min(float(").concat(this.depth,"),\n float(d + ").concat(n," + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = ").concat(this.depth,";\n\n float norm = 0.0;
2\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float(").concat(a,") * norm + float(").concat(r,");\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float(").concat(a,")\n * float(").concat(o,")\n * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * ").concat(o,");\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n ")},Tu=function e(t,n,r,a,o){Object(i.a)(this,e),this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;var s,u=n,c=t[3]-1;this.outputShape=t;var l="float(".concat(r,") + float(").concat(a,") * sum");s=.5===o?"inversesqrt(".concat(l,")"):1===o?"1.0/(".concat(l,")"):"exp(log(".concat(l,") * float(-").concat(o,"));"),this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords.x;\n int r = coords.y;\n int c = coords.z;\n int d = coords.w;\n\n bool hasNextCol = d < ".concat(this.outputShape[3],";\n bool hasNextRow = c < ").concat(this.outputShape[2],";\n\n vec4 sum = vec4(0.);\n vec4 xFragAtOutputCoords = getX(b, r, c, d);\n\n vec4 xAtOutputCoords = vec4(\n getChannel(xFragAtOutputCoords, vec2(c, d)),\n hasNextCol ?\n getChannel(xFragAtOutputCoords, vec2(c, d + 1)) : 0.0,\n hasNextRow ?\n getChannel(xFragAtOutputCoords , vec2(c + 1, d)) : 0.0,\n (hasNextRow && hasNextCol) ?\n getChannel(xFragAtOutputCoords, vec2(c + 1, d + 1)) : 0.0\n );\n\n int firstChannel = d - ").concat(u,";\n vec2 cache = vec2(0.);\n if(firstChannel >= 0){\n vec4 firstChannelFrag = getX(b, r, c, firstChannel);\n cache.x = getChannel(firstChannelFrag, vec2(c, firstChannel));\n if(hasNextRow){\n cache.y = getChannel(firstChannelFrag, vec2(c + 1, firstChannel));\n }\n }\n\n ivec2 depth = ivec2(d, d + 1);\n for (int j = - ").concat(u,"; j <= ").concat(u,"; j++) {\n ivec2 idx = depth + j;\n bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0));\n bvec2 belowUpperBound = lessThanEqual(idx, ivec2(").concat(c,"));\n\n bool depthInRange = aboveLowerBound.x && belowUpperBound.x;\n bool depthPlusOneInRange = aboveLowerBound.y && belowUpperBound.y;\n\n if(depthInRange || depthPlusOneInRange){\n vec4 z = vec4(0.);\n vec4 xFragAtCurrentDepth;\n z.xz = cache.xy;\n if(depthPlusOneInRange && hasNextCol){\n xFragAtCurrentDepth = idx.y != d ?\n getX(b, r, c, idx.y) : xFragAtOutputCoords;\n z.y = getChannel(xFragAtCurrentDepth, vec2(c, idx.y));\n if(hasNextRow){\n z.w = getChannel(xFragAtCurrentDepth, vec2(c + 1, idx.y));\n }\n }\n cache.xy = z.yw;\n sum += z * z;\n }\n }\n vec4 result = xAtOutputCoords * ").concat(s,";\n setOutput(result);\n }\n ")},Cu=function e(t){Object(i.a)(this,e),this.variableNames=["dy","maxPos"],this.outputShape=t.inShape;var n=t.strideHeight,r=t.strideWidth,a=t.dilationHeight,o=t.effectiveFilterHeight,s=t.effectiveFilterWidth,u=o-1-t.padInfo.top,c=s-1-t.padInfo.left,l=o*s-1;this.userCode="\n const ivec2 pads = ivec2(".concat(u,", ").concat(c,");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ").concat(o,";\n wR += ").concat(a,") {\n float dyR = float(dyRCorner + wR) / ").concat(n,".0;\n\n if (dyR < 0.0 || dyR >= ").concat(t.outHeight,".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ").concat(s,"; wC++) {\n float dyC = float(dyCCorner + wC) / ").concat(r,".0;\n\n if (dyC < 0.0 || dyC >= ").concat(t.outWidth,".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = ").concat(l," - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * ").concat(s," + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n ")},Mu=function e(t){Object(i.a)(this,e),this.variableNames=["dy","maxPos"],this.outputShape=t.inShape;var n=t.strideDepth,r=t.strideHeight,a=t.strideWidth,o=t.dilationDepth,s=t.dilationHeight,u=t.dilationWidth,c=t.effectiveFilterDepth,l=t.effectiveFilterHeight,h=t.effectiveFilterWidth,d=c-1-t.padInfo.front,f=l-1-t.padInfo.top,p=h-1-t.padInfo.left,m=c*l*h-1;this.userCode="\n const ivec3 pads = ivec3(".concat(d,", ").concat(f,", ").concat(p,");\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get\n // dx(x
2D, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ").concat(c,";\n wD += ").concat(o,") {\n float dyD = float(dyDCorner + wD) / ").concat(n,".0;\n\n if (dyD < 0.0 || dyD >= ").concat(t.outDepth,".0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ").concat(l,";\n wR += ").concat(s,") {\n float dyR = float(dyRCorner + wR) / ").concat(r,".0;\n\n if (dyR < 0.0 || dyR >= ").concat(t.outHeight,".0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ").concat(h,";\n wC += ").concat(u,") {\n float dyC = float(dyCCorner + wC) / ").concat(a,".0;\n\n if (dyC < 0.0 || dyC >= ").concat(t.outWidth,".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n int maxPosValue = ").concat(m," -\n int(getMaxPos(batch, idyD, idyR, idyC, ch));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue =\n wD * ").concat(l," * ").concat(h," +\n wR * ").concat(h," + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n }\n setOutput(dotProd);\n }\n ")},Au=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=arguments.length>6&&void 0!==arguments[6]&&arguments[6];Object(i.a)(this,e),this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n;var c=r?t[1]:t[2],l=Math.ceil(c/2),h=r?"i * 2, rc.y":"rc.y, i * 2",d=a?"rc.z, i * 2":"i * 2, rc.z",f=r?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],p=a?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"],m="",v="";s&&(m=u?"vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n ".concat(s,"\n }"):"vec4 activation(vec4 x) {\n ".concat(s,"\n }"),v="result = activation(result);");var g=o?"result += getBiasAtOutCoords();":"";o&&this.variableNames.push("bias"),u&&this.variableNames.push("preluActivationWeights"),this.userCode="\n ".concat(m,"\n\n const float sharedDimension = ").concat(l,".0;\n\n vec4 dot2x2ARowBCol(ivec3 rc) {\n vec4 result = vec4(0);\n for (int i = 0; i < ").concat(l,"; i++) {\n vec4 a = getMatrixA(rc.x, ").concat(h,");\n vec4 b = getMatrixB(rc.x, ").concat(d,");\n\n // These swizzled products need to be separately added.\n // See: https://github.com/tensorflow/tfjs/issues/1735\n result += (").concat(f[0]," * ").concat(p[0],");\n result += (").concat(f[1]," * ").concat(p[1],");\n }\n return result;\n }\n\n void main() {\n ivec3 rc = getOutputCoords();\n vec4 result = dot2x2ARowBCol(rc);\n\n ").concat(g,"\n\n ").concat(v,"\n\n setOutput(result);\n }\n ")},Nu=function(){function e(t,n,r){Object(i.a)(this,e),this.variableNames=["probs"],this.outputShape=[t,r],this.userCode="\n uniform float seed;\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < ".concat(n-1,"; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float(").concat(n-1,"));\n }\n ")}return Object(o.a)(e,[{key:"getCustomSetupFunc",value:function(e){var t=this;return function(n,r){null==t.seedLoc&&(t.seedLoc=n.getUniformLocation(r,"seed")),n.gl.uniform1f(t.seedLoc,e)}}}]),e}(),Ru=function e(t,n,r,a){Object(i.a)(this,e),this.variableNames=["indices"],this.outputShape=[t,n],this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float(".concat(a,"), float(").concat(r,"),\n float(index == coords.y)));\n }\n ")},Iu=function e(t){Object(i.a)(this,e),this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outputShape=t;var n=t.length;if(0===n)this.userCode="\n void main() {\n setOutput(vec4(getA(), 0., 0., 0.));\n }\n ";else{var r=Ko("rc",n),a=ds(n),o=function(e,t,n){if(1===e)return"rc > ".concat(t[0]);for(var r="",a=e-2;a<e;a++)r+="".concat(n[a]," >= ").concat(t[a]),a<e-1&&(r+="||");return r}(n,t,r),s=function(e,t,n,r){if(1===e)return"";var a=r.slice(-2);return"\n int r = ".concat(a[0],";\n int c = ").concat(a[1],";\n int rp1 = r + 1;\n int cp1 = c + 1;\n\n bool cEdge = cp1 >= ").concat(t,";\n bool rEdge = rp1 >= ").concat(n,";\n ")}(n,t[t.length-1],t[t.length-2],r),u=function(e,t){var n=e.length,r=function(e,t){for(var n=[],r=0;r<=1;r++)for(var a=0;a<=1;a++){for(var i="".concat(0===r?"r":"rp1",", ").concat(0===a?"c":"cp1"),o=2;o<e;o++)i="".concat(t[t.length-1-o],",")+i;n.push(i)}return n}(n,t);if(1===n)return"getA(rc),\n rc + 1 >= ".concat(e[0]," ? 0. : getA(rc + 1),\n 0, 0");return"getA(".concat(r[0],"),\n cEdge ? 0. : getA(").concat(r[1],"),\n rE
2dge ? 0. : getA(").concat(r[2],"),\n rEdge || cEdge ? 0. : getA(").concat(r[3],")")}(t,r);this.userCode="\n void main() {\n ".concat(a," rc = getOutputCoords();\n\n if(").concat(o,") {\n setOutput(vec4(0));\n } else {\n ").concat(s,"\n\n setOutput(vec4(").concat(u,"));\n }\n }\n ")}};var Lu=function e(t,n,r){Object(i.a)(this,e),this.variableNames=["x"],this.outputShape=n.map((function(e,n){return e[0]+t[n]+e[1]}));var a=t.length,o=ds(a),s=n.map((function(e){return e[0]})).join(","),u=n.map((function(e,n){return e[0]+t[n]})).join(","),c=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,a);this.userCode=1!==a?"\n ".concat(o," start = ").concat(o,"(").concat(s,");\n ").concat(o," end = ").concat(o,"(").concat(u,");\n\n void main() {\n ").concat(o," outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(float(").concat(r,"));\n } else {\n ").concat(o," coords = outC - start;\n setOutput(getX(").concat(c,"));\n }\n }\n "):"\n int start = ".concat(s,";\n int end = ").concat(u,";\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(float(").concat(r,"));\n } else {\n setOutput(getX(outC - start));\n }\n }\n ")},Du=function e(t,n,r){Object(i.a)(this,e),this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n.map((function(e,n){return e[0]+t[n]+e[1]}));for(var a=t.length,o=ds(a),s=n.map((function(e){return e[0]})).join(","),u=n.map((function(e,n){return e[0]+t[n]})).join(","),c=Ko("rc",a),l=Ko("source",a),h="".concat(c[a-1]," < ").concat(this.outputShape[a-1]),d=1===a?"source":"vec2(".concat(l.slice(-2).join(),")"),f=["".concat(o," rc = outputLoc;"),"".concat(c[a-1]," += 1;\n if(").concat(h,") {\n "),1===a?"":"}\n rc = outputLoc;\n ".concat(c[a-2]," += 1;\n if(").concat(c[a-2]," < ").concat(this.outputShape[a-2],") {"),1===a?"":" ".concat(c[a-1]," += 1;\n if(").concat(h,") {")],p=1===a?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))",m="",v=0,g=1===a?2:4;v<g;v++)m+="\n ".concat(f[v],"\n if (").concat(p,") {\n result[").concat(v,"] = float(").concat(r,");\n } else {\n ").concat(o," source = rc - start;\n result[").concat(v,"] = getChannel(getX(").concat(l.join(),"), ").concat(d,");\n }\n ");m+=1===a?"} ":"}}",this.userCode="\n const ".concat(o," start = ").concat(o,"(").concat(s,");\n const ").concat(o," end = ").concat(o,"(").concat(u,");\n\n void main() {\n ").concat(o," outputLoc = getOutputCoords();\n vec4 result = vec4(0.);\n ").concat(m,"\n setOutput(result);\n }\n ")},Pu=function e(t,n,r){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Object(i.a)(this,e),this.variableNames=["x"],"avg"===n&&r)throw new Error("Cannot compute positions for average pool.");var s=t.filterWidth,u=t.strideHeight,c=t.strideWidth,l=t.dilationHeight,h=t.dilationWidth,d=t.effectiveFilterHeight,f=t.effectiveFilterWidth,p=t.padInfo.top,m=t.padInfo.left;this.outputShape=t.outShape;var v="avg"===n,g="((batch * ".concat(t.inHeight," + xR) * ").concat(t.inWidth," + xC) * ").concat(t.inChannels," + d"),b="(xR * ".concat(t.inWidth," + xC) * ").concat(t.inChannels," + d"),y="0.0";if(v||(y="-1.0 / 1e-20"),r){var x=">=";this.userCode="\n const ivec2 strides = ivec2(".concat(u,", ").concat(c,");\n const ivec2 pads = ivec2(").concat(p,", ").concat(m,");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < ").concat(d,";\n wR += ").concat(l,") {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ").concat(t.inHeight,") {\n continue;\n }\n\n for (int wC = 0; wC < ").concat(f,";\n wC += ").concat(h,") {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ").concat(t.inWidth,") {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ").concat(x," currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ").concat(a?o?g:b:"wR * ".concat(f," + wC"),";\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n ")}else{var w="max",O="".concat(n,"(").concat(n,"(").concat(n,"(")+"minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"avg"===n&&(O="avgValue / count");var k=4*Math.floor(s/4),S=s%4,_="\n if (".concat(v,") {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = ").concat(w,"(values, minMaxValue);\n }\n ");this.userCode="\n const ivec2 strides = ivec2(".concat(u,", ").concat(c,");\n const ivec2 pads = ivec2(").concat(p,", ").concat(m,");\n const float initializationValue = ").concat(y,";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= ").concat(t.inWidth,") {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4(").concat(y,");\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < ").concat(d,";\n wR += ").concat(l,") {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ").concat(t.inHeight,") {\n continue;\n }\n\n for (int wC = 0; wC < ").concat(k,"; wC += 4) {\n int xC = xCCorner + wC * ").concat(h,";\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ").concat(h,", d),\n getValue(batch, xR, xC + 2 * ").concat(h,", d),\n getValue(batch, xR, xC + 3 * ").concat(h,", d)\n );\n\n ").concat(_,"\n }\n\n int xC = xCCorner + ").concat(k,";\n if (").concat(1===S,") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ").concat(_,"\n } else if (").concat(2===S,") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ").concat(h,", d),\n initializationValue,\n initializationValue\n );\n\n ").concat(_,"\n } else if (").concat(3===S,") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ").concat(h,", d),\n getValue(batch, xR, xC + 2 * ").concat(h,", d),\n initializationValue\n );\n\n ").concat(_,"\n }\n }\n setOutput(").concat(O,");\n }\n ")}},zu=function e(t,n,r){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Object(i.a)(this,e),this.variableNames=["x"],"avg"===n&&r)throw new Error("Cannot compute positions for average pool.");var s=t.filterWidth,u=t.strideDepth,c=t.strideHeight,l=t.strideWidth,h=t.dilationDepth,d=t.dilationHeight,f=t.dilationWidth,p=t.effectiveFilterDepth,m=t.effectiveFilterHeight,v=t.effectiveFilterWidth,g=t.padInfo.front,b=t.padInfo.top,y=t.padInfo.left;this.outputShape=t.outShape;var x="avg"===n,w="0.0";if(x||(w="-1.0 / 1e-20"),r){var O=">=";this.userCode="\n const ivec3 strides =\n ivec3(".concat(u,", ").concat(c,", ").concat(l,");\n const ivec3 pads = ivec3(").concat(g,", ").concat(b,", ").concat(y,");\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, ch) to get y(yD, yR, yC, ch).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n\n for (int wD = 0; wD < ").concat(p,";\n wD += ").concat(h,") {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ").concat(t.inDepth,") {\n continue;\n }\n\n for (int wR = 0; wR < ").concat(m,";\n wR += ").concat(d,") {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ").concat(t.inHeight,") {\n continue;\n }\n\n for (int wC = 0; wC < ").concat(v,";\n wC += ").concat(f,") {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ").concat(t.inWidth,") {\n continue;\n }\n\n float value = getX(batch, xD, xR, xC, ch);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ").concat(O," currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ").concat(a?o?"(((batch * ".concat(t.inDepth," + xD) * ").concat(t.inHeight," + xR) * ").concat(t.inWidth," + xC) * ").concat(t.inChannels," + ch"):"((xD * ".concat(t.inHeight," + xR) * ").concat(t.inWidth," + xC) * ").concat(t.inChannels," + ch"):"wD * ".concat(m," * ").concat(v," +\n wR * ").concat(v," + wC"),";\n }\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n ")}else{var k="max",S="".concat(n,"(").concat(n,"(").concat(n,"(")+"minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"avg"===n&&(S="avgValue / count");var _=4*Math.floor(s/4),j=s%4,E="\n if (".concat(x,") {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = ").concat(k,"(values, minMaxValue);\n }\n ");this.userCode="\n const ivec3 strides =\n ivec3(".concat(u,", ").concat(c,", ").concat(l,");\n const ivec3 pads = ivec3(").concat(g,", ").concat(b,", ").concat(y,");\n const float initializationValue = ").concat(w,";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xD, int xR, int xC, int ch) {\n if (xC < 0 || xC >= ").concat(t.inWidth,") {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xD, xR, xC, ch);\n }\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, d) to get y(yD, yR, yC, ch).\n // ? = to be determined\n vec4 minMaxValue = vec4(").concat(w,");\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wD = 0; wD < ").concat(p,";\n wD += ").concat(h,") {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ").concat(t.inDepth,") {\n continue;\n }\n\n for (int wR = 0; wR < ").concat(m,";\n wR += ").concat(d,") {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ").concat(t.inHeight,") {\n continue;\n }\n\n for (int wC = 0; wC < ").concat(_,"; wC += 4) {\n int xC = xCCorner + wC * ").concat(f,";\n\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ").concat(f,", ch),\n getValue(batch, xD, xR, xC + 2 * ").concat(f,", ch),\n getValue(batch, xD, xR, xC + 3 * ").concat(f,", ch)\n );\n\n ").concat(E,"\n }\n\n int xC = xCCorner + ").concat(_,";\n if (").concat(1===j,") {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ").concat(E,"\n } else if (").concat(2===j,") {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ").concat(f,", ch),\n initializationValue,\n initializationValue\n );\n\n ").concat(E,"\n } else if (").concat(3===j,") {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ").concat(f,", ch),\n getValue(batch, xD, xR, xC + 2 * ").concat(f,", ch),\n initializationValue\n );\n\n ").concat(E,"\n }\n }\n setOutput(").concat(S,");\n }\n }\n ")}},Fu=function e(t,n){Object(i.a)(this,e),this.variableNames=["x"];var r=t.windowSize,a=t.batchSize,o=t.inSize,s=t.outSize;this.outputShape=[a,s];var u="0.0",c="";"prod"===n?u="1.0":"min"===n?(u="1.0 / 1e-20",c="min"):"max"===n&&(u="-1.0 / 1e-20",c="max");var l="".concat(n,"(").concat(n,"(").concat(n,"(")+"minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"sum"===n?l="sumValue":"prod"===n?l="prodValue":"all"===n?l="allValue":"any"===n&&(l="anyValue");var h=4*Math.floor(r/4),d=r%4,f="\n if (".concat("sum"===n,") {\n sumValue += dot(values, ones);\n } else if (").concat("prod"===n,") {\n vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]);\n prodValue *= tmp[0] * tmp[1];\n } else {\n minMaxValue = ").concat(c,"(values, minMaxValue);\n }\n "),p="vec4";"all"===n?(u="1.0",f="\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n ",p="bvec4"):"any"===n&&(u="0.0",f="\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n ",p="bvec4");var m="";o%r>0&&(m="\n if (inIdx < 0 || inIdx >= ".concat(o,") {\n return initializationValue;\n }\n ")),this.userCode="\n const float initializationValue = ".concat(u,";\n const vec4 ones = vec4(1.0, 1.0, 1.0,
21.0);\n\n float getValue(int batch, int inIdx) {\n ").concat(m,"\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ").concat(r,";\n\n vec4 minMaxValue = vec4(").concat(u,");\n float prodValue = 1.0;\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < ").concat(h,"; i += 4) {\n int inIdx = inOffset + i;\n ").concat(p," values = ").concat(p,"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ").concat(f,"\n }\n\n int inIdx = inOffset + ").concat(h,";\n if (").concat(1===d,") {\n ").concat(p," values = ").concat(p,"(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ").concat(f,"\n } else if (").concat(2===d,") {\n ").concat(p," values = ").concat(p,"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n ").concat(f,"\n } else if (").concat(3===d,") {\n ").concat(p," values = ").concat(p,"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n ").concat(f,"\n }\n setOutput(").concat(l,");\n }\n ")},Bu=function e(t,n){Object(i.a)(this,e),this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t;for(var r="",a=0;a<4;a++){var o="thisRC = rc;";a%2===1&&(o+="thisRC.z += 1;"),a>1&&(o+="thisRC.y += 1;"),r+="\n ".concat(o,"\n ").concat(a>0?"if(thisRC.y < rows && thisRC.z < cols){":"","\n int flatIndex = getFlatIndex(thisRC);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex);\n vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result[").concat(a,"] =\n getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims);\n ").concat(a>0?"}":"","\n ")}this.userCode="\n ".concat(function(e){var t=Jo(["r","c","d"],e);return"\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ".concat(t,"\n return ivec3(r, c, d);\n }\n ")}(n),"\n ").concat(Qo(t),"\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.);\n\n ivec3 thisRC;\n int rows = ").concat(t[1],";\n int cols = ").concat(t[2],";\n\n ").concat(r,"\n\n setOutput(result);\n }\n ")};var Uu=function e(t,n,r){Object(i.a)(this,e),this.variableNames=["dy"],this.outputShape=[],this.outputShape=n.shape;var a=Object(h.a)(n.shape,3),o=a[1],s=a[2],u=Object(h.a)(t.shape,3),c=u[1],l=u[2],d=[r&&c>1?o-1:o,r&&l>1?s-1:s],f=[r&&c>1?c-1:c,r&&l>1?l-1:l],p=d[0]/f[0],m=d[1]/f[1],v=1/p,g=1/m,b=2*Math.ceil(v)+2,y=2*Math.ceil(g)+2;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(".concat(p,");\n const float widthScale = float(").concat(m,");\n\n const float invHeightScale = float(").concat(v,");\n const float invWidthScale = float(").concat(g,");\n\n const int winHeight = int(").concat(b,");\n const int winWidth = int(").concat(y,");\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ").concat(c,") {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ").concat(l,") {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), ").concat(o-1,".0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), ").concat(s-1,".0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n ")},Wu=function e(t,n,r,a){Object(i.a)(this,e),this.variableNames=["A"],this.outputShape=[];var o=Object(h.a)(t,4),s=o[0],u=o[1],c=o[2],l=o[3];this.outputShape=[s,n,r,l];var d=[a&&n>1?u-1:u,a&&r>1?c-1:c],f=[a&&n>1?n-1:n,a&&r>1?r-1:r];this.userCode="\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ".concat(d[0]/f[0],",\n ").concat(d[1]/f[1],");\n const vec2 inputShapeRC = vec2(").concat(u,".0, ").concat(c,".0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(sourceFracIndexRC);\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n ")},Vu=function e(t,n,r,a){Object(i.a)(this,e),this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];var o=Object(h.a)(t,4),s=o[0],u=o[1],c=o[2],l=o[3];this.outputShape=[s,n,r,l];var d=[a&&n>1?u-1:u,a&&r>1?c-1:c],f=[a&&n>1?n-1:n,a&&r>1?r-1:r];this.userCode="\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n ".concat(d[0]/f[0],",\n ").concat(d[1]/f[1],",\n ").concat(d[1]/f[1],");\n const vec3 inputShapeRC = vec3(").concat(u,".0, ").concat(c,".0,\n ").concat(c,".0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = vec3(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the four integer indices.\n ivec3 sourceFloorRC = ivec3(sourceFracIndexRC);\n ivec3 sourceCeilRC = ivec3(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < ").concat(l-1,";\n bool hasNextRow = coords.z < ").concat(r
vendor: 2,071 bytes, line 2
2-1,";\n\n // In parallel, construct four corners for all four components in\n // packed 2x2 cell.\n vec4 topLeft = vec4(\n getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 bottomLeft = vec4(\n getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 topRight = vec4(\n getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec4 bottomRight = vec4(\n getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec3 fracRC = sourceFracIndexRC - vec3(sourceFloorRC);\n\n vec4 top = mix(topLeft, topRight, fracRC.yyzz);\n vec4 bottom = mix(bottomLeft, bottomRight, fracRC.yyzz);\n vec4 newValue = mix(top, bottom, fracRC.x);\n\n setOutput(newValue);\n }\n ")}
2,Gu=function e(t,n,r){Object(i.a)(this,e),this.variableNames=["dy"],this.outputShape=[],this.outputShape=n.shape;var a=Object(h.a)(n.shape,3),o=a[1],s=a[2],u=Object(h.a)(t.shape,3),c=u[1],l=u[2],d=[r&&c>1?o-1:o,r&&l>1?s-1:s],f=[r&&c>1?c-1:c,r&&l>1?l-1:l],p=d[0]/f[0],m=d[1]/f[1],v=1/p,g=1/m,b=2*Math.ceil(v)+2,y=2*Math.ceil(g)+2;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(".concat(p,");\n const float widthScale = float(").concat(m,");\n\n const float invHeightScale = float(").concat(v,");\n const float invWidthScale = float(").concat(g,");\n\n const int winHeight = int(").concat(b,");\n const int winWidth = int(").concat(y,");\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ").concat(c,") {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ").concat(l,") {\n continue;\n }\n\n float sourceFracRow =\n float(").concat(d[0],") *\n (float(dyR) / float(").concat(f[0],"));\n\n float sourceFracCol =\n float(").concat(d[1],") *\n (float(dyC) / float(").concat(f[1],"));\n\n int sourceNearestRow = int(min(\n float(int(").concat(o,") - 1),\n ").concat(r," ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int(").concat(s,") - 1),\n ").concat(r," ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n ")},Hu=function e(t,n,r,a){Object(i.a)(this,e),this.variableNames=["A"],this.outputShape=[];var o=Object(h.a)(t,4),s=o[0],u=o[1],c=o[2],l=o[3];this.outputShape=[s,n,r,l];var d=[a&&n>1?u-1:u,a&&r>1?c-1:c],f=[a&&n>1?n-1:n,a&&r>1?r-1:r],p=a?"0.5":"0.0";this.userCode="\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ".concat(d[0]/f[0],",\n ").concat(d[1]/f[1],");\n const vec2 inputShapeRC = vec2(").concat(u,".0, ").concat(c,".0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ").concat(p,")));\n\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n ")},qu=function e(t,n){Object(i.a)(this,e),this.variableNames=["x"];var r=t.length;if(r>4)throw new Error("WebGL backend: Reverse of rank-".concat(r," tensor is not yet supported"));if(this.outputShape=t,1!==r){var a=t.map((function(e,r){return function(e){return-1!==n.indexOf(e)&&1!==t[e]?"".concat(t[e]," - coords[").concat(e,"] - 1"):"coords[".concat(e,"]")}(r)})).join(","),o=ds(r);this.userCode="\n void main() {\n ".concat(o," coords = getOutputCoords();\n setOutput(getX(").concat(a,"));\n }\n ")}else this.userCode="\n void main() {\n int coord = getOutputCoords();\n setOutput(getX(".concat(t[0]," - coord - 1));\n }\n ")},Xu=function e(t,n){Object(i.a)(this,e),this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;var r=t.length;if(r>4)throw new Error("WebGL backend: Reverse of rank-".concat(r," tensor is not yet supported"));this.outputShape=t;var a=Ko("rc",r),o="".concat(a[r-1]," + 1 < ").concat(this.outputShape[r-1]),s="".concat(a[r-2]," + 1 < ").concat(this.outputShape[r-2]),u=ds(r);function c(e){var r=t.map((function(r,a){return function(e,r){return-1!==n.indexOf(e)&&1!==t[e]?"".concat(t[e]," - ").concat(r[e]," - 1"):"".concat(r[e])}(a,e)}
vendor: 1,829 bytes, line 2
2)),a=r.join(","),i=r.slice(-2).join(",");return"getChannel(getX(".concat(a,"), vec2(").concat(i,"))")}this.userCode=1===r?"\n void main(){\n int rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = getChannel(getX(".concat(t[0]," - rc - 1),\n ").concat(t[0]," - rc - 1);\n if(").concat(o,"){\n result.g = getChannel(getX(").concat(t[0]," - (rc + 1) - 1),\n ").concat(t[0]," - (rc + 1) - 1);\n }\n setOutput(result);\n }\n "):"\n void main() {\n ".concat(u," rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = ").concat(function(e){return c(e)}(a.slice()),";\n if(").concat(o,"){\n result.g = ").concat(function(e){return e[r-1]="("+e[r-1]+" + 1)",c(e)}(a.slice()),";\n }\n if(").concat(s,") {\n result.b = ").concat(function(e){return e[r-2]="("+e[r-2]+" + 1)",c(e)}(a.slice()),";\n if(").concat(o,") {\n result.a = ").concat(function(e){return e[r-1]="("+e[r-1]+" + 1)",e[r-2]="("+e[r-2]+" + 1)",c(e)}(a.slice()),";\n }\n }\n setOutput(result);\n }\n ")},Yu=function e(t,n,r,a,o,s){Object(i.a)(this,e),this.variableNames=["updates","indices","defaultValue"],this.outputShape=s;var u=ds(o.length),c=ds(s.length),l="";1===r?l="i":2===r&&(l="i, j");var h="getIndices(".concat(l,")"),d="";1===a?d="i":2===a&&(d="i, coords[1]");var f="getUpdates(".concat(d,")"),p=n>1?"strides[j]":"strides";this.userCode="\n ".concat(u," strides = ").concat(u,"(").concat(o,");\n\n void main() {\n ").concat(c," coords = getOutputCoords();\n float sum = 0.0;\n bool found = false;\n for (int i = 0; i < ").concat(t,";
2 i++) {\n int flattenedIndex = 0;\n for (int j = 0; j < ").concat(n,"; j++) {\n int index = round(").concat(h,");\n flattenedIndex += index * ").concat(p,";\n }\n if (flattenedIndex == coords[0]) {\n sum += ").concat(f,";\n found = true;\n }\n }\n setOutput(mix(getDefaultValue(), sum, float(found)));\n }\n ")},Ku=function e(t,n){Object(i.a)(this,e),this.variableNames=["x","segmentIds"];var r=t.windowSize,a=t.batchSize,o=t.inSize,s=t.numSegments,u=s*Math.ceil(o/r);this.outputShape=[a,u];var c=4*Math.floor(r/4),l=r%4,h="\n sumValue += dot(values, segFilter);\n ",d="";o%r>0&&(d="\n if (inIdx < 0 || inIdx >= ".concat(o,") {\n return initializationValue;\n }\n "));var f="";o%r>0&&(f="\n if (inIdx < 0 || inIdx >= ".concat(o,") {\n return -1.0;\n }\n ")),this.userCode="\n const float initializationValue = ".concat("0.0",";\n\n float getValue(int batch, int inIdx) {\n ").concat(d,"\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n ").concat(f,"\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n ").concat(s,")) * float(").concat(r,"));\n int currentSeg = int(mod(float(outIdx), float(").concat(s,")));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ").concat(c,"; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n ").concat(h,"\n }\n\n int inIdx = inOffset + ").concat(c,";\n if (").concat(1===l,") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n ").concat(h,"\n } else if (").concat(2===l,") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n ").concat(h,"\n } else if (").concat(3===l,") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n ").concat(h,"\n }\n setOutput(").concat("sumValue",");\n }\n ")},Zu=function e(t,n,r){var a,o;if(Object(i.a)(this,e),this.variableNames=["c","a","b"],this.outputShape=n,r>4)throw Error("Where for rank ".concat(r," is not yet supported"));if(1===r)o="resRC",a="resRC";else{for(var s=["resRC.x","resRC.y","resRC.z","resRC.w"],u=[],c=[],l=0;l<n.length;l++)c.push("".concat(s[l])),l<t&&u.push("".concat(s[l]));a=u.join(),o=c.join()}var h=ds(r);this.userCode="\n void main() {\n ".concat(h," resRC = getOutputCoords();\n float cVal = getC(").concat(a,");\n if (cVal >= 1.0) {\n setOutput(getA(").concat(o,"));\n } else {\n setOutput(getB(").concat(o,"));\n }\n }\n ")},Ju=function(){function e(t){Object(i.a)(this,e),this.variableNames=["source"],this.outputShape=t,this.rank=t.length;var n,r=ds(this.rank),a="uniform int start[".concat(this.rank,"];"),o=function(e){if(1===e)return"sourceLoc";if(e<=6)return Qu.slice(0,e).map((function(e){return"sourceLoc."+e})).join(",");throw Error("Slicing for rank ".concat(e," is not yet supported"))}(this.rank),s=t.map((function(e,t){return"sourceLoc.".concat(Qu[t]," = start[").concat(t,"] + coords.").concat(Qu[t],";")}));n="\n ".concat(r," sourceLoc;\n ").concat(r," coords = getOutputCoords();\n ").concat(s.join("\n"),"\n "),this.userCode="\n ".concat(a,"\n void main() {\n ").concat(n,"\n setOutput(getSource(").concat(o,"));\n }\n ")}return Object(o.a)(e,[{key:"getCustomSetupFunc",value:function(e){var t=this;if(e.length!==this.rank)throw Error("The rank (".concat(this.rank,") of the program must match the ")+"length of start (".concat(e.length,")"));return function(n,r){null==t.startLoc&&(t.startLoc=n.getUniformLocationNoThrow(r,"start"),null==t.startLoc)||n.gl.uniform1iv(t.startLoc,e)}}}]),e}(),Qu=["x","y","z","w","u","v"];var $u=function(){function e(t){Object(i.a)(this,e),this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t,this.rank=t.length;var n=ds(this.rank),r=Ko("coords",this.rank),a=Ko("sourceLoc",this.rank),o=1===this.rank?"sourceLoc":"vec2(".concat(a.slice(-2).join(),")"),s="getChannel(getSource(".concat(a.join(),"), ").concat(o,")"),u="\n result.x = ".concat(s,";\n if (++").concat(r[this.rank-1]," < ").concat(t[this.rank-1],") {\n ++").concat(a[this.rank-1],";\n result.y = ").concat(s,";\n --").concat(a[this.rank-1],";\n }\n "),c=1===this.rank?"":"\n --".concat(r[this.rank-1],";
2\n if (++").concat(r[this.rank-2]," < ").concat(t[this.rank-2],") {\n ++").concat(a[this.rank-2],";\n result.z = ").concat(s,";\n if (++").concat(r[this.rank-1]," < ").concat(t[this.rank-1],") {\n ++").concat(a[this.rank-1],";\n result.w = ").concat(s,";\n }\n }\n "),l=this.rank<=4?"sourceLoc = coords +\n ".concat(n,"(").concat(t.map((function(e,t){return"start[".concat(t,"]")})).join(),");"):t.map((function(e,t){return"".concat(a[t]," = ").concat(r[t]," + start[").concat(t,"];")})).join("\n");this.userCode="\n uniform int start[".concat(this.rank,"];\n void main() {\n ").concat(n," coords = getOutputCoords();\n ").concat(n," sourceLoc;\n ").concat(l,"\n vec4 result = vec4(0.);\n ").concat(u,"\n ").concat(c,"\n setOutput(result);\n }\n ")}return Object(o.a)(e,[{key:"getCustomSetupFunc",value:function(e){var t=this;if(e.length!==this.rank)throw Error("The rank (".concat(this.rank,") of the program must match the ")+"length of start (".concat(e.length,")"));return function(n,r){null==t.startLoc&&(t.startLoc=n.getUniformLocationNoThrow(r,"start"),null==t.startLoc)||n.gl.uniform1iv(t.startLoc,e)}}}]),e}(),ec=function e(t,n,r){Object(i.a)(this,e),this.variableNames=["x"],this.outputShape=r;var a=r.length,o=ds(r.length),s=ds(r.length),u="";if(1===a)u="coords * strides + begin";else{var c=0;u=r.map((function(e,t){return c++,1===r.length?"coords * strides[".concat(t,"] + begin[").concat(t,"]"):"coords[".concat(c-1,"] * strides[").concat(t,"] + begin[").concat(t,"]")})).join(",")}this.userCode="\n ".concat(o," begin = ").concat(o,"(").concat(t,");\n ").concat(o," strides = ").concat(o,"(").concat(n,");\n\n void main() {\n ").concat(s," coords = getOutputCoords();\n setOutput(getX(").concat(u,"));\n }\n ")},tc=function(){function e(t){Object(i.a)(this,e),this.gpgpu=t,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.logEnabled=!1,this.usedTextures={}}return Object(o.a)(e,[{key:"acquireTexture",value:function(e,t,n){var r=rc(t,n),a=ac(e,r,n);a in this.freeTextures||(this.freeTextures[a]=[]),a in this.usedTextures||(this.usedTextures[a]=[]);var i,o=nc(e,r,this.gpgpu.gl,this.gpgpu.textureConfig,n);if(this.freeTextures[a].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=o,this.log();var s=this.freeTextures[a].shift();return this.usedTextures[a].push(s),s}return r===co.PACKED_2X2_FLOAT32?i=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):r===co.PACKED_2X2_FLOAT16?i=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):r===co.UNPACKED_FLOAT32?i=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):r===co.UNPACKED_FLOAT16?i=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):r===co.PACKED_4X1_UNSIGNED_BYTE&&(i=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[a].push(i),this.numUsedTextures++,this._numBytesAllocated+=o,this.log(),i}},{key:"releaseTexture",value:function(e,t,n,r){if(null!=this.freeTextures){var i=rc(n,r),o=ac(t,i,r);o in this.freeTextures||(this.freeTextures[o]=[]);var s=nc(t,i,this.gpgpu.gl,this.gpgpu.textureConfig,r),u=Object(a.env)().get("WEBGL_DELETE_TEXTURE_THRESHOLD");-1!==u&&this._numBytesAllocated>u?(this.gpgpu.deleteMatrixTexture(e),this._numBytesAllocated-=s):(this.freeTextures[o].push(e),this.numFreeTextures++,this._numBytesFree+=s),this.numUsedTextures--;var c=this.usedTextures[o],l=c.indexOf(e);if(l<0)throw new Error("Cannot release a texture that was never provided by this texture manager");c.splice(l,1),this.log()}}},{key:"log",value:function(){if(this.logEnabled){var e=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used","".concat(this.numFreeTextures," / ").concat(this.numUsedTextures),"(".concat(e,")"));var t=this._numBytesFree/this._numBytesAllocated;console.log("Bytes allocated: ".concat(this._numBytesAllocated)),console.log("Bytes unused: ".concat(this._numBytesFree," (").concat(Math.round(100*t),"%)"))}}},{key:"getNumUsedTextures",value:function(){return this.numUsedTextures}},{key:"getNumFreeTextures",value:function(){return this.numFreeTextures}},{key:"dispose",value:function(){var e=this;if(null!=this.freeTextures){for(var t in this.freeTextures)this.freeTextures[t].forEach((function(t){e.gpgpu.deleteMatrixTexture(t)}));
2for(var n in this.usedTextures)this.usedTextures[n].forEach((function(t){e.gpgpu.deleteMatrixTexture(t)}));this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}},{key:"numBytesAllocated",get:function(){return this._numBytesAllocated}},{key:"numBytesFree",get:function(){return this._numBytesFree}}]),e}();function nc(e,t,n,r,a){var i,o=function(e,t){switch(e){case co.PACKED_2X2_FLOAT32:return gu(t);case co.PACKED_2X2_FLOAT16:return bu(t);case co.UNPACKED_FLOAT32:return pu(t);case co.UNPACKED_FLOAT16:return mu(t);case co.PACKED_4X1_UNSIGNED_BYTE:return vu(t);default:throw new Error("Unknown physical texture type ".concat(e))}}(t,r);if(a){var s=vo(e[0],e[1]),u=Object(h.a)(s,2);i=u[0]*u[1]}else{var c=po(e[0],e[1]),l=Object(h.a)(c,2);i=l[0]*l[1]}return i*function(e,t){var n=e;if(t===n.R32F)return 4;if(t===n.R16F)return 2;if(t===n.RGBA32F)return 16;if(t===e.RGBA)return 16;if(t===n.RGBA16F)return 8;throw new Error("Unknown internal format ".concat(t))}(n,o)}function rc(e,t){if(e===uo.UPLOAD)return co.PACKED_2X2_FLOAT32;if(e===uo.RENDER||null==e)return function(e){return Object(a.env)().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?co.PACKED_2X2_FLOAT32:co.UNPACKED_FLOAT32:e?co.PACKED_2X2_FLOAT16:co.UNPACKED_FLOAT16}(t);if(e===uo.DOWNLOAD||e===uo.PIXELS)return co.PACKED_4X1_UNSIGNED_BYTE;throw new Error("Unknown logical texture type ".concat(e))}function ac(e,t,n){return"".concat(e[0],"_").concat(e[1],"_").concat(t,"_").concat(n)}var ic=function e(t,n){Object(i.a)(this,e),this.variableNames=["A"];for(var r=new Array(t.length),a=0;a<r.length;a++)r[a]=t[a]*n[a];this.outputShape=r,this.rank=r.length;var o=ds(this.rank),s=function(e){var t=e.length;if(t>5)throw Error("Tile for rank ".concat(t," is not yet supported"));if(1===t)return"imod(resRC, ".concat(e[0],")");for(var n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],r=[],a=0;a<e.length;a++)r.push("imod(".concat(n[a],", ").concat(e[a],")"));return r.join()}(t);this.userCode="\n void main() {\n ".concat(o," resRC = getOutputCoords();\n setOutput(getA(").concat(s,"));\n }\n ")};var oc=function e(t,n){Object(i.a)(this,e),this.variableNames=["A"],this.outputShape=t,this.userCode="\n float unaryOperation(float x) {\n ".concat(n,"\n }\n\n void main() {\n float x = getAAtOutCoords();\n float y = unaryOperation(x);\n\n setOutput(y);\n }\n ")},sc="return abs(x);",uc="if (isnan(x)) return x;\n return (x < 0.0) ? 0.0 : x;\n",cc="if (isnan(x)) return x;\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",lc="return (x >= 0.0) ? x : (exp(x) - 1.0);",hc="\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\
2n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = ".concat(a.backend_util.SELU_SCALEALPHA,";\n float scale = ").concat(a.backend_util.SELU_SCALE,";\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n");var dc="return -x;",fc="return ceil(x);",pc="return floor(x);",mc="return exp(x);",vc="return exp(x) - 1.0;",gc='\n // Error function is calculated approximately with elementary function.\n // See "Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables", Abramowitz and Stegun.\n float p = '.concat(a.backend_util.ERF_P,";\n float a1 = ").concat(a.backend_util.ERF_A1,";\n float a2 = ").concat(a.backend_util.ERF_A2,";\n float a3 = ").concat(a.backend_util.ERF_A3,";\n float a4 = ").concat(a.backend_util.ERF_A4,";\n float a5 = ").concat(a.backend_util.ERF_A5,";\n\n float sign = sign(x);\n x = abs(x);\n float t = 1.0 / (1.0 + p * x);\n return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x));\n"),bc="return x;",yc="\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",xc="\n vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",wc="\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n",Oc=function e(t,n){Object(i.a)(this,e),this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t,this.userCode="\n vec4 unaryOperation(vec4 x) {\n ".concat(n,"\n }\n\n void main() {\n vec4 x = getAAtOutCoords();\n vec4 y = unaryOperation(x);\n\n setOutput(y);\n }\n ")},kc=function e(t){Object(i.a)(this,e),this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=t;var n=t.length,r=Ko("rc",n),a=ds(n),o=function(e,t){if(1===e)return"rc";for(var n="",r=0;r<e;r++)n+=t[r],r<e-1&&(n+=",");return n}(n,r),s=r.slice(-2),u=n<=1?"rc":"vec2(".concat(s.join(","),")");this.userCode="\n void main() {\n ".concat(a," rc = getOutputCoords();\n vec4 packedInput = getA(").concat(o,");\n\n setOutput(getChannel(packedInput, ").concat(u,"));\n }\n ")},Sc=a.backend_util.segment_util,_c=a.kernel_impls.split,jc=a.kernel_impls.tile,Ec=a.kernel_impls.topkImpl,Tc=a.kernel_impls.whereImpl,Cc={};function Mc(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("linear"===e)return"return x;";if("relu"===e)return t?yc:uc;if("elu"===e)return t?wc:lc;if("relu6"===e)return t?xc:cc;if("prelu"===e)return t?Ts:js;throw new Error("Activation ".concat(e," has not been implemented for the WebGL backend."))}var Ac=function(e){Object(s.a)(n,e);var t=Object(u.a)(n);function n(e){var r,o;if(Object(i.a)(this,n),(r=t.call(this)).pendingRead=new WeakMap,r.pendingDisposal=new WeakSet,r.dataRefCount=new WeakMap,r.numBytesInGPU=0,r.uploadWaitMs=0,r.downloadWaitMs=0,r.warnedAboutMemory=!1,r.warnedAboutCPUBackend=!1,r.pendingDeletes=0,r.disposed=!1,!Object(a.env)().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");if(null==e){var s=fo(Object(a.env)().getNumber("WEBGL_VERSION"));r.binaryCache=((o=Object(a.env)().getNumber("WEBGL_VERSION"))in Cc||(Cc[o]={}),Cc[o]),r.gpgpu=new xu(s),r.canvas=s.canvas,r.gpgpuCreatedLocally=!0}else r.gpgpu=e,r.binaryCache={},r.gpgpuCreatedLocally=!1,r.canvas=e.gl.canvas;return r.textureManager=new tc(r.gpgpu),r.numMBBeforeWarning=null==Object(a.env)().global.screen?1024:Object(a.env)().global.screen.height*Object(a.env)().global.screen.width*window.devicePixelRatio*600/1024/1024,r.texData=new a.DataStorage(Object(f.a)(r),Object(a.engine)()),r}return Object(o.a)(n,[{key:"numDataIds",value:function(){return this.texData.numDataIds()+(this.cpuBackend?this.cpuBackend.numDataIds():0)-this.pendingDeletes}},{key:"write",value:function(e,t,n){if((Object(a.env)().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||Object(a.env)().getBool("DEBUG"))&&this.checkNumericalProblems(e),"complex64"===n&&null!=e)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");var r={};return this.texData.set(r,{shape:t,dtype:n,values:e,usage:uo.UPLOAD}),r}},{key:"move",value:function(e,t,n,r){if(Object(a.env)().getBool("DEBUG")&&this.checkNumericalProblems(t),"complex64"===r)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(e,{shape:n,dtype:r,values:t,usage:uo.UPLOAD})}},{key:"readSync",value:function(e){var t=this.texData.get(e),n=t.values,r=t.dtype,i=t.complexTensors,o=t.slice,s=t.shape,u=t.isPacked;if(null!=o){var c;c=u?new Oc(s,bc):new oc(s,bc);var l=this.runWebGLProgram(c,[{dataId:e,shape:s,dtype:r}],r),h=this.readSync(l.dataId);return this.disposeData(l.dataId),h}if(null!=n)return this.convertAndCacheOnCPU(e);if("string"===r)return n;var d,f,p=null!=this.activeTimers;if(p&&(d=a.util.now()),"complex64"===r){var m=i.real.dataSync(),v=i.imag.dataSync();f=a.backend_util.mergeRealAndImagArrays(m,v)}else f=this.getValuesFromTexture(e);return p&&(this.downloadWaitMs+=a.util.now()-d),this.convertAndCacheOnCPU(e,f)}},{key:"read",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t){var n,r,i,o,s,u,c,h,d,f,p,m,v,g,b,y,x,w,O,k,S,_;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.pendingRead.has(t)){e.next=3;break}return n=this.pendingRead.get(t),e.abrupt("return",new Promise((function(e){return n.push(e)})));case 3:if(r=this.texData.get(t),i=r.values,o=r.shape,s=r.slice,u=r.dtype,c=r.complexTensors,h=r.isPacked,null==s){e.next=11;break}return d=h?new Oc(o,bc):new oc(o,bc),f=this.runWebGLProgram(d,[{dataId:t,shape:o,dtype:u}],u),p=this.read(f.dataId),this.disposeData(f.dataId),e.abrupt("return",p);case 11:if(null==i){e.next=13;break}return e.abrupt("return",this.convertAndCacheOnCPU(t));case 13:if(Object(a.env)().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")||2!==Object(a.env)().getNumber("WEBGL_VERSION")){e.next=15;break}throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");case 15:if(m=null,"complex64"!==u&&Object(a.env)().get("WEBGL_BUFFER_SUPPORTED")&&(v=this.decode(t),b=this.texData.get(v.dataId),m=(g=this.gpgpu).createBufferFromTexture.apply(g,[b.texture].concat(Object(l.a)(mo(o))))),this.pendingRead.set(t,[]),"complex64"===u){e.next=21;break}return e.next=21,this.gpgpu.createAndWaitForFence();case 21:if("complex64"!==u){e.next=30;break}return e.next=24,Promise.all([c.real.data(),c.imag.data()]);case 24:x=e.sent,w=x[0],O=x[1],y=a.backend_util.mergeRealAndImagArrays(w,O),e.next=31;break;case 30:null==m?y=this.getValuesFromTexture(t):(k=a.util.sizeFromShape(o),y=this.gpgpu.downloadFloat32MatrixFromBuffer(m,k));case 31:return null!=v&&this.disposeData(v.dataId),S=this.convertAndCacheOnCPU(t,y),_=this.pendingRead.get(t),this.pendingRead.delete(t),_.forEach((function(e){return e(S)})),this.pendingDisposal.has(t)&&(this.pendingDisposal.delete(t),this.disposeData(t),this.pendingDeletes--),e.abrupt("return",S);case 38:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"checkNumericalProblems",value:function(e){if(null!=e)for(var t=0;t<e.length;t++){var n=e[t];if(!yo(n)){if(Object(a.env)().getBool("WEBGL_RENDER_FLOAT32_CAPABLE"))throw Error("The value ".concat(n," cannot be represented with your ")+"current settings. Consider enabling float32 rendering: 'tf.env().set('WEBGL_RENDER_FLOAT32_ENABLED', true);'");throw Error("The value ".concat(n," cannot be represented on this device."))}}}},{key:"getValuesFromTexture",value:function(e){var t=this.texData.get(e),n=t.shape,r=t.dtype,i=t.isPacked,o=a.util.sizeFromShape(n);if(Object(a.env)().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")){var s,u=this.decode(e),c=this.texData.get(u.dataId),h=(s=this.gpgpu).downloadMatrixFromPackedTexture.apply(s,[c.texture].concat(Object(l.a)(mo(n)))).subarray(0,o);return this.disposeData(u.dataId),h}var d=Object(a.env)().getBool("WEBGL_PACK")&&!0===i,f=d?Po(n):n,p=d?new tu(f):new eu(f),m=this.runWebGLProgram(p,[{shape:f,dtype:r,dataId:e}],"float32"),v=this.texData.get(m.dataId),g=this.gpgpu.downloadByteEncodedFloatMatrixFromOutputTexture(v.texture,v.texShape[0],v.texShape[1]).subarray(0,o);return this.disposeData(m.dataId),g}},{key:"time",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t){var n,r,i,o,s,u,c;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.activeTimers,r=[],i=!1,null==this.programTimersStack?(this.programTimersStack=r,i=!0):this.activeTimers.push(r),this.activeTimers=r,t(),o=a.util.flatten(this.activeTimers.map((function(e){return e.query}))).filter((function(e){return null!=e})),s=a.util.flatten(this.activeTimers.map((function(e){return e.name}))).filter((function(e){return null!=e})),this.activeTimers=n,i&&(this.programTimersStack=null),u={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null},!(Object(a.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)){e.next=19;break}return e.next=14,Promise.all(o);case 14:c=e.sent,u.kernelMs=a.util.sum(c),u.getExtraProfileInfo=function(){return c.map((function(e,t){return{name:s[t],ms:e}})).map((function(e){return"".concat(e.name,": ").concat(e.ms)})).join(", ")},e.next=20;break;case 19:u.kernelMs={error:"WebGL query timers are not supported in this environment."};case 20:return this.uploadWaitMs=0,this.downloadWaitMs=0,e.abrupt("return",u);case 23:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"memory",value:function(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}},{key:"startTimer",value:function(){return Object(a.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:a.util.now(),endMs:null}}},{key:"endTimer",value:function(e){return Object(a.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=a.util.now(),e)}},{key:"getQueryTime",value:function(){var e=Object(jt.a)(_t.a.mark((function e(t){var n;return _t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(Object(a.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)){e.next=2;break}return e.abrupt("return",this.gpgpu.waitForQueryAndGetTime(t));case 2:return n=t,e.abrupt("return",n.endMs-n.startMs);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"disposeData",value:function(e){if(!this.pendingDisposal.has(e)){
2if(this.pendingRead.has(e))return this.pendingDisposal.add(e),void this.pendingDeletes++;if(this.texData.has(e)){this.releaseGPUData(e);var t=this.texData.get(e).complexTensors;null!=t&&(t.real.dispose(),t.imag.dispose()),this.texData.delete(e)}}}},{key:"releaseGPUData",value:function(e){var t=this.texData.get(e),n=t.texture,r=t.dtype,a=t.texShape,i=t.usage,o=t.isPacked,s=t.slice,u=s&&s.origDataId||e,c=this.dataRefCount.get(u);c>1?this.dataRefCount.set(u,c-1):(this.dataRefCount.delete(u),null!=n&&(this.numBytesInGPU-=this.computeBytes(a,r),this.textureManager.releaseTexture(n,a,i,o)));var l=this.texData.get(e);l.texture=null,l.texShape=null,l.isPacked=!1,l.slice=null}},{key:"getTexture",value:function(e){return this.uploadToGPU(e),this.texData.get(e).texture}},{key:"getDataInfo",value:function(e){return this.texData.get(e)}},{key:"getCPUBackend",value:function(){return Object(a.env)().getBool("WEBGL_CPU_FORWARD")?(null==this.cpuBackend&&(this.cpuBackend=Object(a.engine)().findBackend("cpu")),this.cpuBackend):null}},{key:"shouldExecuteOnCPU",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:128,r=this.getCPUBackend();return this.warnedAboutCPUBackend||null!=r||Object(a.env)().getBool("IS_TEST")||(console.warn("Your application contains ops that are small enough to be executed on the CPU backend, however the CPU backend cannot be found. Consider importing the CPU backend (@tensorflow/tfjs-backend-cpu) for better performance."),this.warnedAboutCPUBackend=!0),null!=r&&e.every((function(e){return null==t.texData.get(e.dataId).texture&&a.util.sizeFromShape(e.shape)<n}))}},{key:"getGPGPUContext",value:function(){return this.gpgpu}},{key:"complex",value:function(e,t){var n=this.makeOutput(e.shape,"complex64");return this.texData.get(n.dataId).complexTensors={real:Object(a.engine)().keep(e.clone()),imag:Object(a.engine)().keep(t.clone())},n}},{key:"real",value:function(e){return this.texData.get(e.dataId).complexTensors.real.clone()}},{key:"imag",value:function(e){return this.texData.get(e.dataId).complexTensors.imag.clone()}},{key:"slice",value:function(e,t,n){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.slice(e,t,n);if(0===a.util.sizeFromShape(n))return Object(a.tensor)([],n,e.dtype);var r=this.texData.get(e.dataId).isPacked,i=a.slice_util.isSliceContinous(e.shape,t,n);if(r||!i){var o=Object(a.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new $u(n):new Ju(n),s=o.getCustomSetupFunc(t);return this.compileAndRun(o,[e],null,s)}return this.uploadToGPU(e.dataId),this.shallowSlice(e,t,n)}},{key:"shallowSlice",value:function(e,t,n){var r=this.texData.get(e.dataId),i=this.makeOutput(n,e.dtype),o=this.texData.get(i.dataId);Object.assign(o,r),o.shape=n,o.dtype=e.dtype;var s=a.slice_util.computeFlatOffset(t,e.strides);r.slice&&(s+=r.slice.flatOffset),o.slice={flatOffset:s,origDataId:r.slice&&r.slice.origDataId||e.dataId};var u=this.dataRefCount.get(o.slice.origDataId)||1;return this.dataRefCount.set(o.slice.origDataId,u+1),i}},{key:"stridedSlice",value:function(e,t,n,r){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.stridedSlice(e,t,n,r);var i=a.slice_util.computeOutShape(t,n,r);if(i.some((function(e){return 0===e})))return Object(a.tensor)([],i);var o=new ec(t,r,i);return this.compileAndRun(o,[e])}},{key:"reverse",value:function(e,t){var n=Object(a.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Xu(e.shape,t):new qu(e.shape,t);return this.compileAndRun(n,[e])}},{key:"concat",value:function(e,t){if("complex64"===e[0].dtype){var n=e.map((function(e){return Object(a.real)(e)})),r=e.map((function(e){return Object(a.imag)(e)}));return Object(a.complex)(this.concat(n,t),this.concat(r,t))}if(this.shouldExecuteOnCPU(e))return this.cpuBackend.concat(e,t);if(1===e.length)return e[0];if(e.length>Object(a.env)().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){var i=Math.floor(e.length/2),o=this.concat(e.slice(0,i),t),s=this.concat(e.slice(i),t);return this.concat([o,s],t)}if(Object(a.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&e[0].rank>1){var u=new Is(e.map((function(e){return e.shape})),t);return this.compileAndRun(u,e)}var c=a.backend_util.computeOutShape(e.map((function(e){return e.shape})),t),l=e.map((function(e){return e.as2D(-1,a.util.sizeFromShape(e.shape.slice(t)))})),h=new Rs(l.map((function(e){return e.shape})));return this.compileAndRun(h,l).reshape(c)}},{key:"neg",value:function(e){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.neg(e);if(Object(a.env)().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(e,dc,e.dtype);var t=new oc(e.shape,dc);return this.compileAndRun(t,[e])}},{key:"batchMatMul",value:function(e,t,n,r){var i=n?e.shape[2]:e.shape[1],o=r?t.shape[1]:t.shape[2],s=n?e.shape[1]:e.shape[2],u=Object(h.a)(e.shape,2)[0];if((1===i||1===o)&&s>
21e3){n&&(e=Object(a.transpose)(e,[0,2,1])),r&&(t=Object(a.transpose)(t,[0,2,1]));var c=1===o?e:e.as3D(u,s,1),l=1===o?2:1,d=1===o?t.as3D(u,1,s):t;return this.multiply(c,d).sum(l,!0)}var f=Object(a.upcastType)(e.dtype,t.dtype),p=new Au(e.shape,[u,i,o],n,r);return this.compileAndRun(p,[e,t],f)}},{key:"fusedBatchMatMul",value:function(e){var t=e.a,n=e.b,r=e.transposeA,i=e.transposeB,o=e.bias,s=e.activation,u=e.preluActivationWeights,c=r?t.shape[2]:t.shape[1],l=i?n.shape[1]:n.shape[2],d=Object(h.a)(t.shape,2)[0],f=Object(a.upcastType)(t.dtype,n.dtype),p=null!=o,m=null!=u,v=s?Mc(s,!0):null,g=new Au(t.shape,[d,c,l],r,i,p,v,m),b=[t,n];return o&&b.push(o),u&&b.push(u),this.compileAndRun(g,b,f)}},{key:"multiply",value:function(e,t){if("complex64"===e.dtype){var n=this.texData.get(e.dataId),r=this.texData.get(t.dataId),i=new Os(xs,e.shape,t.shape),o=new Os(ws,e.shape,t.shape),s=[this.makeComplexComponentTensorInfo(e,n.complexTensors.real),this.makeComplexComponentTensorInfo(e,n.complexTensors.imag),this.makeComplexComponentTensorInfo(t,r.complexTensors.real),this.makeComplexComponentTensorInfo(t,r.complexTensors.imag)],u=this.compileAndRun(i,s),c=this.compileAndRun(o,s),l=this.complex(u,c);return u.dispose(),c.dispose(),l}if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.multiply(e,t);if(Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,_s,e.dtype);var h=new Es(_s,e.shape,t.shape);return this.compileAndRun(h,[e,t],e.dtype)}},{key:"batchNorm",value:function(e,t,n,r,i,o){var s=[e,t,n],u=null;null!=r&&(u=r.shape,s.push(r));var c=null;if(null!=i&&(c=i.shape,s.push(i)),Object(a.env)().getBool("WEBGL_PACK_NORMALIZATION")){var l=new ys(e.shape,t.shape,n.shape,u,c,o);return this.compileAndRun(l,s)}var h=new bs(e.shape,t.shape,n.shape,u,c,o);return this.compileAndRun(h,s)}},{key:"localResponseNormalization4D",value:function(e,t,n,r,i){var o=Object(a.env)().getBool("WEBGL_PACK_NORMALIZATION")?new Tu(e.shape,t,n,r,i):new ju(e.shape,t,n,r,i);return this.compileAndRun(o,[e])}},{key:"LRNGrad",value:function(e,t,n,r,a,i,o){var s=new Eu(t.shape,r,a,i,o);return this.compileAndRun(s,[t,n,e])}},{key:"tile",value:function(e,t){if("string"===e.dtype){var n=this.readSync(e.dataId).map((function(e){return a.util.decodeString(e)})),r=Object(a.buffer)(e.shape,e.dtype,n);return jc(r,t)}var i=new ic(e.shape,t);return this.compileAndRun(i,[e])}},{key:"pad",value:function(e,t,n){var r=Object(a.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Du(e.shape,t,n):new Lu(e.shape,t,n);return this.compileAndRun(r,[e])}},{key:"gather",value:function(e,t,n){if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.gather(e,t,n);var r=new uu(e.shape,t.size,n);return this.compileAndRun(r,[e,t])}},{key:"batchToSpaceND",value:function(e,t,n){a.util.assert(e.rank<=4,(function(){return"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet"}));var r=t.reduce((function(e,t){return e*t})),i=a.backend_util.getReshaped(e.shape,t,r),o=a.backend_util.getPermuted(i.length,t.length),s=a.backend_util.getReshapedPermuted(e.shape,t,r),u=a.backend_util.getSliceBeginCoords(n,t.length),c=a.backend_util.getSliceSize(s,n,t.length);return Object(a.transpose)(e.reshape(i),o).reshape(s).slice(u,c)}},{key:"spaceToBatchND",value:function(e,t,n){a.util.assert(e.rank<=4,(function(){return"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet"}));var r=t.reduce((function(e,t){return e*t})),i=[[0,0]];i.push.apply(i,Object(l.a)(n));for(var o=1+t.length;o<e.shape.length;++o)i.push([0,0]);var s=e.pad(i),u=a.backend_util.getReshaped(s.shape,t,r,!1),c=a.backend_util.getPermuted(u.length,t.length,!1),h=a.backend_util.getReshapedPermuted(s.shape,t,r,!1),d=Object(a.transpose)(s.reshape(u),c);return Object(a.reshape)(d,h)}},{key:"reduce",value:function(e,t,n){var r=e.shape[0],i=e.shape[1],o=a.backend_util.computeOptimalWindowSize(i),s=Math.ceil(i/o),u=new Fu({windowSize:o,inSize:i,batchSize:r,outSize:s},t),c=this.compileAndRun(u,[e],n);return 1===c.shape[1]?c:this.reduce(c,t,n)}},{key:"argReduce",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=e.shape[0],i=e.shape[1];null!=n&&(r=n.shape[0],i=n.shape[1]);var o=a.backend_util.computeOptimalWindowSize(i),s={windowSize:o,inSize:i,batchSize:r,outSize:Math.ceil(i/o)},u=new Xo(s,t,null==n),c=[e];null!=n&&c.push(n);var l=this.compileAndRun(u,c,"int32");return 1===l.shape[1]?l:this.argReduce(e,t,l)}},{key:"argReducePacked",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=null!=n?n.shape:e.shape,i=r[r.length-1],o=a.backend_util.computeOptimalWindowSize(i),s=new ms(r,o,t,null==n),u=null==n?[e]:[e,n],c=this.compileAndRun(s,u,"int32");return c.rank===e.rank?this.argReducePacked(e,t,c):c}},{key:"sum",value:function(e,t){a.backend_util.assertAxesAreInnerMostDims("sum",t,e.rank);var n=a.backend_util.computeOutAndReduceShapes(e.shape,t),r=Object(h.a)(n,2),i=r[0],o=r[1],s=a.util.sizeFromShape(o),u=e.as2D(-1,s),c=a.sumOutType(e.dtype);return this.reduce(u,"sum",c).reshape(i)}},{key:"prod",value:function(e,t){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.prod(e,t);var n=a.backend_util.computeOutAndReduceShapes(e.shape,t),r=Object(h.a)(n,2),i=r[0],o=r[1],s=a.util.sizeFromShape(o),u=e.as2D(-1,s),c=a.sumOutType(e.dtype);return this.reduce(u,"prod",c).reshape(i)}},{key:"unsortedSegmentSum",value:function(e,t,n){var r=0,i=a.backend_util.getAxesPermutation([r],e.rank),o=e;null!=i&&(o=Object(a.transpose)(e,i),r=a.backend_util.getInnerMostAxes(1,e.rank)[0]);var s=Sc.computeOutShape(o.shape,r,n),u=a.util.sizeFromShape([o.shape[r]]),c=o.as2D(-1,u),l=a.sumOutType(e.dtype),h=this.segOpCompute(c,"unsortedSegmentSum",t,l,n).reshape(s);return null!=i&&(h=Object(a.transpose)(h,a.backend_util.getUndoAxesPermutation(i))
2),h}},{key:"segOpCompute",value:function(e,t,n,r,i){var o=e.shape[0],s=e.shape[1],u=Sc.segOpComputeOptimalWindowSize(s,i),c=new Ku({windowSize:u,inSize:s,batchSize:o,numSegments:i},t),l=this.compileAndRun(c,[e,n],r);return l.shape[1]===i?l:(n=Object(a.range)(0,i).tile([s/u]),this.segOpCompute(l,t,n,r,i))}},{key:"argMinMaxReduce",value:function(e,t,n){var r=[t];if(a.backend_util.assertAxesAreInnerMostDims("arg"+n.charAt(0).toUpperCase()+n.slice(1),r,e.rank),!Object(a.env)().getBool("WEBGL_PACK_REDUCE")||e.rank<=2){var i=a.backend_util.computeOutAndReduceShapes(e.shape,r),o=Object(h.a)(i,2),s=o[0],u=o[1],c=a.util.sizeFromShape(u),l=e.as2D(-1,c);return this.argReduce(l,n).reshape(s)}return this.argReducePacked(e,n)}},{key:"argMin",value:function(e,t){return this.argMinMaxReduce(e,t,"min")}},{key:"argMax",value:function(e,t){return this.argMinMaxReduce(e,t,"max")}},{key:"cumsum",value:function(e,t,n,r){if(t!==e.rank-1)throw new Error("WebGL cumsum shader expects an inner-most axis=".concat(e.rank-1," ")+"but got axis=".concat(t));for(var a=e.shape[t],i=e,o=0;o<=Math.ceil(Math.log2(a))-1;o++){var s=new Xs(e.shape,!1,r),u=s.getCustomSetupFunc(o),c=i;i=this.compileAndRun(s,[i],i.dtype,u),c.dispose()}if(n){var l=new Xs(e.shape,n,r),h=i;i=this.compileAndRun(l,[i]),h.dispose()}return i}},{key:"equal",value:function(e,t){if(Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return vec4(equal(a, b));\n","bool");var n=new Es("return float(a == b);",e.shape,t.shape);return this.compileAndRun(n,[e,t],"bool")}},{key:"notEqual",value:function(e,t){if(Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return vec4(notEqual(a, b));\n","bool");var n=new Es("return float(a != b);",e.shape,t.shape);return this.compileAndRun(n,[e,t],"bool")}},{key:"less",value:function(e,t){if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.less(e,t);if(Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return vec4(lessThan(a, b));\n","bool");var n=new Es("return float(a < b);",e.shape,t.shape);return this.compileAndRun(n,[e,t],"bool")}},{key:"lessEqual",value:function(e,t){if(Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return vec4(lessThanEqual(a, b));\n","bool");var n=new Es("return float(a <= b);",e.shape,t.shape);return this.compileAndRun(n,[e,t],"bool")}},{key:"greater",value:function(e,t){if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.greater(e,t);if(Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return vec4(greaterThan(a, b));\n","bool");var n=new Es("return float(a > b);",e.shape,t.shape);return this.compileAndRun(n,[e,t],"bool")}},{key:"greaterEqual",value:function(e,t){if(Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return vec4(greaterThanEqual(a, b));\n","bool");var n=new Es("return float(a >= b);",e.shape,t.shape);return this.compileAndRun(n,[e,t],"bool")}},{key:"logicalNot",value:function(e){var t=new oc(e.shape,"return float(!(x >= 1.0));");return this.compileAndRun(t,[e])}},{key:"logicalAnd",value:function(e,t){if(Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return vec4(\n vec4(greaterThanEqual(a, vec4(1.0))) *\n vec4(greaterThanEqual(b, vec4(1.0))));\n","bool");var n=new Es("return float(a >= 1.0 && b >= 1.0);",e.shape,t.shape);return this.compileAndRun(n,[e,t],"bool")}},{key:"logicalOr",value:function(e,t){if(Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return min(\n vec4(greaterThanEqual(a, vec4(1.0))) +\n vec4(greaterThanEqual(b, vec4(1.0))),\n vec4(1.0));\n","bool");var n=new Es("return float(a >= 1.0 || b >= 1.0);",e.shape,t.shape);return this.compileAndRun(n,[e,t],"bool")}},{key:"select",value:function(e,t,n){var r=new Zu(e.rank,t.shape,t.rank);return this.compileAndRun(r,[e,t,n],Object(a.upcastType)(t.dtype,n.dtype))}},{key:"where",value:function(e){a.backend_util.warn("tf.where() in webgl locks the UI thread. Call tf.whereAsync() instead");var t=e.dataSync();return Tc(e.shape,t)}},{key:"topk",value:function(e,t,n){var r=e.dataSync();return Ec(r,e.shape,e.dtype,t,n)}},{key:"min",value:function(e,t){a.backend_util.assertAxesAreInnerMostDims("min",t,e.rank);var n=a.backend_util.computeOutAndReduceShapes(e.shape,t),r=Object(h.a)(n,2),i=r[0],o=r[1],s=a.util.sizeFromShape(o),u=e.as2D(-1,s);return this.reduce(u,"min",u.dtype).reshape(i)}},{key:"minimum",value:function(e,t){if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.minimum(e,t);var n=Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Cs("\n vec4 result = vec4(min(a, b));\n vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",e.shape,t.shape):new Es("\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n\n return min(a, b);\n",e.shape,t.shape);return this.compileAndRun(n,[e,t])}},{key:"mod",value:function(e,t){var n=Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Cs("\n vec4 result = mod(a, b);\n vec4 isNaN = vec4(equal(b, vec4(0.0)));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",e.shape,t.shape):new Es("if (b == 0.0) return NAN;\n return mod(a, b);",e.shape,t.shape);return this.compileAndRun(n,[e,t])}},{key:"maximum",value:function(e,t){if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.maximum(e,t);var n=Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Cs("\n vec4 result = vec4(max(a, b));\n vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",e.shape,t.shape):new Es("\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n\n return max(a, b);\n",e.shape,t.shape);return this.compileAndRun(n,[e,t])}},{key:"all",value:function(e,t){a.backend_util.assertAxesAreInnerMostDims("all",t,e.rank);var n=a.backend_util.computeOutAndReduceShapes(e.shape,t),r=Object(h.a)(n,2),i=r[0],o=r[1],s=a.util.sizeFromShape(o),u=e.as2D(-1,s);return this.reduce(u,"all",u.dtype).reshape(i)}},{key:"any",value:function(e,t){a.backend_util.assertAxesAreInnerMostDims("any",t,e.rank);var n=a.backend_util.computeOutAndReduceShapes(e.shape,t),r=Object(h.a)(n,2),i=r[0],o=r[1],s=a.util.sizeFromShape(o),u=e.as2D(-1,s);return this.reduce(u,"any",u.dtype).reshape(i)}},{key:"floorDiv",value:function(e,t){if(Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n ivec4 ia = round(a);\n ivec4 ib = round(b);\n bvec4 cond = notEqual(ib, ivec4(0));\n ivec4 result = ivec4(0);\n vec4 s = sign(a) * sign(b);\n\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n if (cond[0]) {\n result[0] = idiv(ia[0], ib[0], s[0]);\n }\n if (cond[1]) {\n result[1] = idiv(ia[1], ib[1], s[1]);\n }\n if (cond[2]) {\n result[2] = idiv(ia[2], ib[2], s[2]);\n }\n if (cond[3]) {\n result[3] = idiv(ia[3], ib[3], s[3]);\n }\n return vec4(result);\n","int32");var n=new Es("\n float s = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n if (ib != 0) {\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n return float(idiv(ia, ib, s));\n } else {\n return NAN;\n }\n",e.shape,t.shape);return this.compileAndRun(n,[e,t],"int32")}},{key:"add",value:function(e,t){if("complex64"===e.dtype&&"complex64"===t.dtype)return this.complexSeparableBinaryOp(e,t,ks);if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.add(e,t);var n=Object(a.upcastType)(e.dtype,t.dtype);if(Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,ks,n);var r=new Es(ks,e.shape,t.shape);return this.compileAndRun(r,[e,t],n)}},{key:"packedUnaryOp",value:function(e,t,n){var r=new Oc(e.shape,t);return this.compileAndRun(r,[e],n)}},{key:"packedBinaryOp",value:function(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=new Cs(n,e.shape,t.shape,a);return this.compileAndRun(i,[e,t],r)}},{key:"complexSeparableBinaryOp",value:function(e,t,n){var r=this,i=this.texData.get(e.dataId),o=this.texData.get(t.dataId),s=[[i.complexTensors.real,o.complexTensors.real],[i.complexTensors.imag,o.complexTensors.imag]].map((function(i){var o=Object(h.a)(i,2),s=o[0],u=o[1],c=r.makeComplexComponentTensorInfo(e,s),l=r.makeComplexComponentTensorInfo(t,u),d=new Es(n,e.shape,t.shape);return r.compileAndRun(d,[c,l],Object(a.upcastType)(s.dtype,u.dtype))})),u=Object(h.a)(s,2),c=u[0],l=u[1],d=this.complex(c,l);return c.dispose(),l.dispose(),d}},{key:"makeComplexComponentTensorInfo",value:function(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}}},{key:"addN",value:function(e){if(1===e.length)return e[0];if(e.length>Object(a.env)().get("WEBGL_MAX_TEXTURES_IN_SHADER")){var t=Math.floor(e.length/2),n=this.addN(e.slice(0,t)),r=this.addN(e.slice(t));return this.addN([n,r])}var i=e.map((function(e){return e.dtype})).reduce((function(e,t){return Object(a.upcastType)(e,t)})),o=e.map((function(e){return e.shape})),s=Object(a.env)().getBool("WEBGL_PACK")?new qo(e[0].shape,o):new Ho(e[0].shape,o);return this.compileAndRun(s,e,i)}},{key:"subtract",value:function(e,t){if("complex64"===e.dtype&&"complex64"===t.dtype)return this.complexSeparableBinaryOp(e,t,Ss);if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.subtract(e,t);var n=Object(a.upcastType)(e.dtype,t.dtype);if(Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,Ss,e.dtype);var r=new Es(Ss,e.shape,t.shape);return this.compileAndRun(r,[e,t],n)}},{key:"pow",value:function(e,t){var n=Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Cs("\n // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise.\n vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1)));\n vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1);\n vec4 result = multiplier * pow(abs(a), b);\n\n // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS\n bvec4 isExpZero = equal(b, vec4(0.0));\n result.r = isExpZero.r ? 1.0 : result.r;\n result.g = isExpZero.g ? 1.0 : result.g;\n result.b = isExpZero.b ? 1.0 : result.b;\n result.a = isExpZero.a ? 1.0 : result.a;\n\n vec4 isNaN = vec4(lessThan(a, vec4(0.0))) * vec4(lessThan(floor(b), b));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",e.shape,t.shape):new Es("\nif(a < 0.0 && floor(b) < b){\n return NAN;\n}\nif (b == 0.0) {\n return 1.0;\n}\nreturn (round(mod(b, 2.0)) != 1) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n",e.shape,t.shape),r=Object(a.upcastType)(e.dtype,t.dtype);return this.compileAndRun(n,[e,t],r)}},{key:"ceil",value:function(e){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.ceil(e);if(Object(a.env)().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(e,fc,e.dtype);var t=new oc(e.shape,fc);return this.compileAndRun(t,[e])}},{key:"floor",value:function(e){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.floor(e);if(Object(a.env)().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(e,pc,e.dtype);var t=new oc(e.shape,pc);return this.compileAndRun(t,[e])}},{key:"sign",value:function(e){var t=new oc(e.shape,"\n if (isnan(x)) { return 0.0; }\n return sign(x);\n");return this.compileAndRun(t,[e])}},{key:"isNaN",value:function(e){var t=new oc(e.shape,"return float(isnan(x));");return this.compileAndRun(t,[e],"bool")}},{key:"isInf",value:function(e){var t=new oc(e.shape,"return float(isinf(x));");return this.compileAndRun(t,[e],"bool")}},{key:"isFinite",value:function(e){var t=new oc(e.shape,"return float(!isnan(x) && !isinf(x));");return this.compileAndRun(t,[e],"bool")}}
2,{key:"round",value:function(e){var t=new oc(e.shape,"\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n");return this.compileAndRun(t,[e])}},{key:"exp",value:function(e){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.exp(e);if(Object(a.env)().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(e,mc,e.dtype);var t=new oc(e.shape,mc);return this.compileAndRun(t,[e])}},{key:"expm1",value:function(e){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.expm1(e);if(Object(a.env)().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(e,vc,e.dtype);var t=new oc(e.shape,vc);return this.compileAndRun(t,[e])}},{key:"softmax",value:function(e,t){var n=a.util.parseAxisParam([t],e.shape),r=Object(a.max)(e,n),i=a.backend_util.expandShapeToKeepDim(r.shape,n),o=this.subtract(e,r.reshape(i)),s=this.exp(o),u=this.sum(s,n).reshape(i);return Object(a.div)(s,u)}},{key:"log",value:function(e){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.log(e);if(Object(a.env)().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(e,"\n vec4 result = log(x);\n vec4 isNaN = vec4(lessThan(x, vec4(0.0)));\n result.r = isNaN.r == 1.0 ? NAN : result.r;\n result.g = isNaN.g == 1.0 ? NAN : result.g;\n result.b = isNaN.b == 1.0 ? NAN : result.b;\n result.a = isNaN.a == 1.0 ? NAN : result.a;\n\n return result;\n",e.dtype);var t=new oc(e.shape,"if (x < 0.0) return NAN;\n return log(x);");return this.compileAndRun(t,[e])}},{key:"log1p",value:function(e){var t=new oc(e.shape,"return log(1.0 + x);");return this.compileAndRun(t,[e])}},{key:"sqrt",value:function(e){var t=new oc(e.shape,"return sqrt(x);");return this.compileAndRun(t,[e])}},{key:"rsqrt",value:function(e){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.rsqrt(e);var t=new oc(e.shape,"return inversesqrt(x);");return this.compileAndRun(t,[e])}},{key:"reciprocal",value:function(e){var t=new oc(e.shape,"return 1.0 / x;");return this.compileAndRun(t,[e])}},{key:"relu",value:function(e){var t;return t=Object(a.env)().getBool("WEBGL_PACK")?new Oc(e.shape,yc):new oc(e.shape,uc),this.compileAndRun(t,[e])}},{key:"relu6",value:function(e){var t;return t=Object(a.env)().getBool("WEBGL_PACK")?new Oc(e.shape,xc):new oc(e.shape,cc),this.compileAndRun(t,[e])}},{key:"prelu",value:function(e,t){var n=Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Cs(Ts,e.shape,t.shape):new Es(js,e.shape,t.shape);return this.compileAndRun(n,[e,t])}},{key:"elu",value:function(e){if(Object(a.env)().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(e,wc,e.dtype);var t=new oc(e.shape,lc);return this.compileAndRun(t,[e])}},{key:"eluDer",value:function(e,t){var n=Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Cs("\n vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.)));
2\n return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0))));\n",e.shape,t.shape):new Es("return (b >= 1.0) ? a : a * (b + 1.0);",e.shape,t.shape);return this.compileAndRun(n,[e,t])}},{key:"selu",value:function(e){var t=new oc(e.shape,hc);return this.compileAndRun(t,[e])}},{key:"int",value:function(e){var t=new oc(e.shape,"return float(int(x));");return this.compileAndRun(t,[e],"int32")}},{key:"clip",value:function(e,t,n){var r,i=(r=Object(a.env)().getBool("WEBGL_PACK_CLIP")?new As(e.shape):new Ms(e.shape)).getCustomSetupFunc(t,n);return this.compileAndRun(r,[e],null,i)}},{key:"abs",value:function(e){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.abs(e);if(Object(a.env)().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(e,sc,e.dtype);var t=new oc(e.shape,sc);return this.compileAndRun(t,[e])}},{key:"complexAbs",value:function(e){var t=this.texData.get(e.dataId),n=new Ns(e.shape),r=[this.makeComplexComponentTensorInfo(e,t.complexTensors.real),this.makeComplexComponentTensorInfo(e,t.complexTensors.imag)];return this.compileAndRun(n,r)}},{key:"sigmoid",value:function(e){var t=new oc(e.shape,"return 1.0 / (1.0 + exp(-1.0 * x));");return this.compileAndRun(t,[e])}},{key:"softplus",value:function(e){var t=new oc(e.shape,"\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n");return this.compileAndRun(t,[e])}},{key:"sin",value:function(e){var t=new oc(e.shape,"if (isnan(x)) return x;\n return sin(x);\n");return this.compileAndRun(t,[e])}},{key:"cos",value:function(e){var t=new oc(e.shape,"if (isnan(x)) return x;\n return cos(x);\n");return this.compileAndRun(t,[e])}},{key:"tan",value:function(e){var t=new oc(e.shape,"return tan(x);");return this.compileAndRun(t,[e])}},{key:"asin",value:function(e){var t=new oc(e.shape,"if (isnan(x)) return x;\n if (abs(x) > 1.) {\n return NAN;\n }\n return asin(x);\n");return this.compileAndRun(t,[e])}},{key:"acos",value:function(e){var t=new oc(e.shape,"if (isnan(x)) return x;\n if (abs(x) > 1.) {\n return NAN;\n }\n return acos(x);\n");return this.compileAndRun(t,[e])}},{key:"atan",value:function(e){var t=new oc(e.shape,"if (isnan(x)) return x;\n return atan(x);\n");return this.compileAndRun(t,[e])}},{key:"atan2",value:function(e,t){var n=Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Cs("\n vec4 result = atan(a, b);\n vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",e.shape,t.shape):new Es("\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n\n return atan(a, b);\n",e.shape,t.shape);return this.compileAndRun(n,[e,t])}},{key:"sinh",value:function(e){var t=new oc(e.shape,"\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n");return this.compileAndRun(t,[e])}},{key:"cosh",value:function(e){var t=new oc(e.shape,"\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n");return this.compileAndRun(t,[e])}},{key:"tanh",value:function(e){var t=new oc(e.shape,"\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n");return this.compileAndRun(t,[e])}},{key:"asinh",value:function(e){var t=new oc(e.shape,"if (isnan(x)) return x;return log(x + sqrt(x * x + 1.0));");return this.compileAndRun(t,[e])}},{key:"acosh",value:function(e){var t=new oc(e.shape,"if (isnan(x)) return x;\n if (x < 1.0) return NAN;\n return log(x + sqrt(x * x - 1.0));");return this.compileAndRun(t,[e])}},{key:"atanh",value:function(e){var t=new oc(e.shape,"if (isnan(x)) return x;\n if ((x < -1.0) || (x > 1.0)) return NAN;\n return (log(1.0 + x) - log(1.0 - x)) / 2.0;");return this.compileAndRun(t,[e])}},{key:"erf",value:function(e){var t=new oc(e.shape,gc);return this.compileAndRun(t,[e])}},{key:"step",value:function(e,t){var n=new oc(e.shape,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return"if (isnan(x)) return x;"+"\n return x > 0.0 ? 1.0 : float(".concat(e,");\n ")}(t));return this.compileAndRun(n,[e])}},{key:"conv2dByMatMul",value:function(e,t,n,r,i,o){var s=e.shape,u=this.texData.get(e.dataId),c=n.inChannels,l=s[0]*s[1]*s[2],h=n.outChannels,d="channelsLast"===n.dataFormat,f=(1===l||1===h)&&c>1e3,p=s[2]%2!==0&&!!u.isPacked;if(f||!Object(a.env)().getBool("WEBGL_LAZILY_UNPACK")||!Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")||!p){var m=d?s[0]*s[1]*s[2]:s[0]*s[2]*s[3],v=this.reshape(e,[1,m,
2n.inChannels]),g=this.reshape(t,[1,n.inChannels,n.outChannels]);return this.reshape(this.fusedBatchMatMul({a:v,b:g,transposeA:!1,transposeB:!1,bias:r,activation:i,preluActivationWeights:o}),n.outShape)}var b=d?s[0]*s[1]*(s[2]+1):s[0]*s[2]*(s[3]+1),y={dataId:e.dataId,shape:[1,b,n.inChannels],dtype:e.dtype},x=u.shape;u.shape=u.shape.slice(),u.shape[u.shape.length-2]++,a.util.assert(Fo(u.shape,y.shape),(function(){return"packed reshape ".concat(u.shape," to ").concat(y.shape," isn't free")}));var w=this.reshape(t,[1,n.inChannels,n.outChannels]),O=this.fusedBatchMatMul({a:y,b:w,transposeA:!1,transposeB:!1,bias:r,activation:i,preluActivationWeights:o}),k=this.texData.get(O.dataId);return a.util.assert(k.isPacked,(function(){return"batchMatMul result is expected to be packed"})),u.shape=x,k.shape=n.outShape,Object(a.engine)().makeTensorFromDataId(O.dataId,n.outShape,O.dtype)}},{key:"conv2dWithIm2Row",value:function(e,t,n,r,a,i){var o=n.filterWidth,s=n.filterHeight,u=n.inChannels,c=n.outWidth,l=n.outHeight,h="channelsLast"===n.dataFormat,d=o*s*u,f=l*c,p=[d,f],m=e.squeeze([0]),v=t.reshape([1,d,-1]),g=new _u(p,m.shape,n),b=this.compileAndRun(g,[m]).reshape([1,p[0],p[1]]),y=null!=r,x=null!=i,w=a?Mc(a,!0):null,O=new Au(b.shape,[1,f,n.outChannels],!0,!1,y,w,x),k=[b,v];r&&k.push(r),x&&k.push(i);var S=this.compileAndRun(O,k);return h?S.reshape([1,l,c,n.outChannels]):S.reshape([1,n.outChannels,l,c])}},{key:"fusedConv2d",value:function(e){var t=e.input,n=e.filter,r=e.convInfo,i=e.bias,o=e.activation,s=e.preluActivationWeights;if(1===r.filterHeight&&1===r.filterWidth&&1===r.dilationHeight&&1===r.dilationWidth&&1===r.strideHeight&&1===r.strideWidth&&("SAME"===r.padInfo.type||"VALID"===r.padInfo.type))return this.conv2dByMatMul(t,n,r,i,o,s);if(Object(a.env)().getBool("WEBGL_CONV_IM2COL")&&1===t.shape[0])return this.conv2dWithIm2Row(t,n,r,i,o,s);var u=null!=i,c=null!=s,l=o?Mc(o,!1):null,h=new Ws(r,u,l,c),d=[t,n];return i&&d.push(i),s&&d.push(s),this.compileAndRun(h,d)}},{key:"conv2d",value:function(e,t,n){if(1===n.filterHeight&&1===n.filterWidth&&1===n.dilationHeight&&1===n.dilationWidth&&1===n.strideHeight&&1===n.strideWidth&&("SAME"===n.padInfo.type||"VALID"===n.padInfo.type))return this.conv2dByMatMul(e,t,n);if(Object(a.env)().getBool("WEBGL_CONV_IM2COL")&&1===e.shape[0])return this.conv2dWithIm2Row(e,t,n);var r=new Ws(n);return this.compileAndRun(r,[e,t])}},{key:"conv2dDerInput",value:function(e,t,n){var r=new Ps(n);return this.compileAndRun(r,[e,t])}},{key:"conv2dDerFilter",value:function(e,t,n){var r=new Ds(n);return this.compileAndRun(r,[e,t])}},{key:"fusedDepthwiseConv2D",value:function(e){var t,n=e.input,r=e.filter,i=e.convInfo,o=e.bias,s=e.activation,u=e.preluActivationWeights,c=Object(a.env)().getBool("WEBGL_PACK_DEPTHWISECONV")&&i.strideWidth<=2&&i.outChannels/i.inChannels===1,l=s?Mc(s,c):null,h=[n,r],d=null!=o,f=null!=u;return d&&h.push(o),f&&h.push(u),c?(t=new Hs(i,d,l,f),this.compileAndRun(t,h)):(t=new Gs(i,d,l,f),this.compileAndRun(t,h))}},{key:"depthwiseConv2D",value:function(e,t,n){var r;return Object(a.env)().getBool("WEBGL_PACK_DEPTHWISECONV")&&n.strideWidth<=2&&n.outChannels/n.inChannels===1?(r=new Hs(n),this.compileAndRun(r,[e,t])):(r=new Gs(n),this.compileAndRun(r,[e,t]))}},{key:"depthwiseConv2DDerInput",value:function(e,t,n){var r=new Us(n);return this.compileAndRun(r,[e,t])}},{key:"depthwiseConv2DDerFilter",value:function(e,t,n){var r=new Bs(n);return this.compileAndRun(r,[e,t])}},{key:"conv3d",value:function(e,t,n){var r=new Vs(n);return this.compileAndRun(r,[e,t])}},{key:"conv3dDerInput",value:function(e,t,n){var r=new Fs(n);return this.compileAndRun(r,[e,t])}},{key:"conv3dDerFilter",value:function(e,t,n){var r=new zs(n);return this.compileAndRun(r,[e,t])}},{key:"maxPool",value:function(e,t){var n=new Pu(t,"max",!1);return this.compileAndRun(n,[e])}},{key:"avgPool",value:function(e,t){var n=new Pu(t,"avg",!1);return this.compileAndRun(n,[e],"float32")}},{key:"maxPoolBackprop",value:function(e,t,n,r){var a=new Pu(r,"max",!0),i=this.compileAndRun(a,[t]),o=new Cu(r),s=this.compileAndRun(o,[e,i],t.dtype);return i.dispose(),s}},{key:"avgPoolBackprop",value:function(e,t,n){var r=new vs(n);return this.compileAndRun(r,[e],t.dtype)}},{key:"cast",value:function(e,t){return a.backend_util.castTensor(e,t,this)}},{key:"unstack",value:function(e,t){for(var n=e.shape[t],r=new Array(e.rank-1),a=0,i=0;i<e.rank;i++)i!==t&&(r[a++]=e.shape[i]);var o=new Array(e.rank).fill(0),s=e.shape.slice();s[t]=1;for(var u=new Array(n),c=0;c<u.length;c++)o[t]=c,u[c]=this.slice(e,o,s).reshape(r);return u}},{key:"avgPool3d",value:function(e,t){var n=new zu(t,"avg",!1);return this.compileAndRun(n,[e],"float32")}},{key:"avgPool3dBackprop",value:function(e,t,n){var r=new gs(n);return this.compileAndRun(r,[e],t.dtype)}},{key:"maxPool3d",value:function(e,t){var n=new zu(t,"max",!1);return this.compileAndRun(n,[e],"float32")}},{key:"maxPool3dBackprop",value:function(e,t,n,r){var a=new zu(r,"max",!0),i=this.compileAndRun(a,[t]),o=new Mu(r),s=this.compileAndRun(o,[e,i],t.dtype);return i.dispose(),s}},{key:"reshape",value:function(e,t){var n=this.texData.get(e.dataId);if(n.isPacked&&!Fo(e.shape,t)&&(null===n.texture||!Fo(n.shape,t))){var r=this.packedReshape(e,t);return Object(a.engine)().makeTensorFromDataId(r.dataId,r.shape,r.dtype)}return a.backend_util.reshapeTensor(e,t)}},{key:"resizeBilinear",value:function(e,t,n,r){var i=Object(a.env)().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new Vu(e.shape,t,n,r):new Wu(e.shape,t,n,r);return this.compileAndRun(i,[e],"float32")}}
2,{key:"resizeBilinearBackprop",value:function(e,t,n){var r=new Uu(e,t,n);return this.compileAndRun(r,[e])}},{key:"resizeNearestNeighbor",value:function(e,t,n,r){var a=new Hu(e.shape,t,n,r);return this.compileAndRun(a,[e])}},{key:"resizeNearestNeighborBackprop",value:function(e,t,n){var r=new Gu(e,t,n);return this.compileAndRun(r,[e])}},{key:"multinomial",value:function(e,t,n,r){var i=t?e:Object(a.softmax)(e),o=i.shape[0],s=i.shape[1],u=new Nu(o,s,n),c=u.getCustomSetupFunc(r);return this.compileAndRun(u,[i],"int32",c)}},{key:"oneHot",value:function(e,t,n,r){var a=new Ru(e.size,t,n,r);return this.compileAndRun(a,[e])}},{key:"diag",value:function(e){var t=new $s(e.size);return this.compileAndRun(t,[e])}},{key:"cropAndResize",value:function(e,t,n,r,a,i){var o=new qs(e.shape,t.shape,r,a,i);return this.compileAndRun(o,[e,t,n],"float32")}},{key:"depthToSpace",value:function(e,t,n){a.util.assert(t>1,(function(){return"blockSize should be > 1 for depthToSpace, but was: ".concat(t)}));var r=e.shape[0],i="NHWC"===n?e.shape[1]:e.shape[2],o="NHWC"===n?e.shape[2]:e.shape[3],s="NHWC"===n?e.shape[3]:e.shape[1],u=i*t,c=o*t,l=s/(t*t),h=new Qs("NHWC"===n?[r,u,c,l]:[r,l,u,c],t,n);return this.compileAndRun(h,[e])}},{key:"split",value:function(e,t,n){return _c(e,t,n)}},{key:"scatterND",value:function(e,t,n){var r=a.backend_util.calculateShapes(t,e,n),i=r.sliceRank,o=r.numUpdates,s=r.sliceSize,u=r.strides,c=r.outputSize,l=[c/s,s],h=e.reshape([o,i]),d=t.reshape([o,s]);if(0===c)return a.backend_util.reshapeTensor(Object(a.tensor)([]),n);var f=Object(a.scalar)(0),p=new Yu(o,i,h.rank,d.rank,u,l);return this.compileAndRun(p,[d,h,f]).reshape(n)}},{key:"sparseToDense",value:function(e,t,n,r){var i=a.backend_util.calculateShapes(t,e,n),o=i.sliceRank,s=i.numUpdates,u=i.strides,c=i.outputSize,l=new Yu(s,o,e.rank,t.rank,u,[c,1],!1);return this.compileAndRun(l,[t,e,r]).reshape(n)}},{key:"fft",value:function(e){return this.fftImpl(e,!1)}},{key:"ifft",value:function(e){return this.fftImpl(e,!0)}},{key:"fftImpl",value:function(e,t){var n=this.texData.get(e.dataId),r=new ou(au,e.shape,t),a=new ou(iu,e.shape,t),i=[this.makeComplexComponentTensorInfo(e,n.complexTensors.real),this.makeComplexComponentTensorInfo(e,n.complexTensors.imag)],o=this.compileAndRun(r,i),s=this.compileAndRun(a,i),u=this.complex(o,s).as2D(e.shape[0],e.shape[1]);return o.dispose(),s.dispose(),u}},{key:"gatherND",value:function(e,t){var n=t.shape,r=n[n.length-1],i=a.backend_util.prepareAndValidate(e,t),o=Object(h.a)(i,4),s=o[0],u=o[1],c=o[2],l=o[3],d=t.reshape([u,r]),f=e.reshape([e.size/c,c]),p=new cu(r,l,[u,c]);return this.compileAndRun(p,[f,d]).reshape(s)}},{key:"fill",value:function(e,t,n){if("string"===(n=n||a.util.inferDtype(t))){var r=a.util.getArrayFromDType(n,a.util.sizeFromShape(e));return r.fill(t),Object(a.engine)().makeTensor(r,e,n,this)}var i=new su(e,t),o=i.getCustomSetupFunc(t);return this.compileAndRun(i,[],n,o)}},{key:"onesLike",value:function(e){if("string"===e.dtype)throw new Error("onesLike is not supported under string dtype");return this.fill(e.shape,1,e.dtype)}},{key:"zerosLike",value:function(e){return this.fill(e.shape,"string"===e.dtype?"":0,e.dtype)}},{key:"linspace",value:function(e,t,n){return a.backend_util.linspaceImpl(e,t,n)}},{key:"makeTensorInfo",value:function(e,t){var n=this.write(null,e,t);return this.texData.get(n).usage=null,{dataId:n,shape:e,dtype:t}}},{key:"makeOutput",value:function(e,t){var n=this.makeTensorInfo(e,t).dataId;return Object(a.engine)().makeTensorFromDataId(n,e,t,this)}},{key:"unpackTensor",value:function(e){var t=new kc(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}},{key:"packTensor",value:function(e){var t=new Iu(e.shape);return this.runWebGLProgram(t,[e],e.dtype,null,!0)}},{key:"packedReshape",value:function(e,t){var n=[Lo(e.shape)].concat(Object(l.a)(Do(e.shape))),r={dtype:e.dtype,shape:n,dataId:e.dataId},a=[Lo(t)].concat(Object(l.a)(Do(t))),i=new Bu(a,n),o=this.runWebGLProgram(i,[r],e.dtype,null,!0);return{dataId:o.dataId,shape:t,dtype:o.dtype}}},{key:"decode",value:function(e){var t,n=this.texData.get(e),r=n.isPacked,a=n.shape,i=n.dtype,o=Po(a);t=r?new Js(o):new Zs(o);return{dtype:i,shape:a,dataId:this.runWebGLProgram(t,[{shape:o,dtype:i,dataId:e}],i,null,!0).dataId}}},{key:"runWebGLProgram",value:function(e,t,n,r){var i=this,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=this.makeTensorInfo(e.outputShape,n),u=this.texData.get(s.dataId);if(e.packedOutput&&(u.isPacked=!0),e.outPackingScheme===so.DENSE){var c=mo(e.outputShape);u.texShape=c.map((function(e){return 2*e}))}if(null!=e.outTexUsage&&(u.usage=e.outTexUsage),0===a.util.sizeFromShape(s.shape))return u.values=a.util.getTypedArrayFromDType(s.dtype,0),s;var l=[],h=t.map((function(t){if("complex64"===t.dtype)throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");var n=i.texData.get(t.dataId);
2if(null==n.texture){if(!e.packedInputs&&a.util.sizeFromShape(t.shape)<=Object(a.env)().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:t.shape,texData:null,isUniform:!0,uniformValues:n.values};e.packedInputs&&(n.isPacked=!0,n.shape=t.shape)}else if(!!n.isPacked!==!!e.packedInputs)t=n.isPacked?i.unpackTensor(t):i.packTensor(t),l.push(t),n=i.texData.get(t.dataId);else if(n.isPacked&&!Fo(n.shape,t.shape)){var r=t,o=t.shape;t.shape=n.shape,t=i.packedReshape(t,o),l.push(t),n=i.texData.get(t.dataId),r.shape=o}return i.uploadToGPU(t.dataId),{shape:t.shape,texData:n,isUniform:!1}}));this.uploadToGPU(s.dataId);var d,f={shape:s.shape,texData:u,isUniform:!1},p=Su(e,h,f),m=this.getAndSaveBinary(p,(function(){return wu(i.gpgpu,e,h,f)})),v=null!=this.activeTimers;if(v&&(d=this.startTimer()),ku(this.gpgpu,m,h,f,r),l.forEach((function(e){return i.disposeData(e.dataId)})),v&&(d=this.endTimer(d),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(d)})),!Object(a.env)().getBool("WEBGL_LAZILY_UNPACK")&&u.isPacked&&!1===o){var g=this.unpackTensor(s);return this.disposeData(s.dataId),g}return s}},{key:"compileAndRun",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];n=n||t[0].dtype;var o=this.runWebGLProgram(e,t,n,r,i);return Object(a.engine)().makeTensorFromDataId(o.dataId,o.shape,o.dtype)}},{key:"getAndSaveBinary",value:function(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]}},{key:"getTextureManager",value:function(){return this.textureManager}},{key:"dispose",value:function(){var e=this;if(!this.disposed){if(!Object(a.env)().getBool("IS_TEST"))Object.keys(this.binaryCache).forEach((function(t){e.gpgpu.deleteProgram(e.binaryCache[t].webGLProgram),delete e.binaryCache[t]}));this.textureManager.dispose(),null!=this.canvas&&"undefined"!==typeof HTMLCanvasElement&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0}}},{key:"floatPrecision",value:function(){var e=this;return null==this.floatPrecisionValue&&(this.floatPrecisionValue=Object(a.tidy)((function(){if(!Object(a.env)().get("WEBGL_RENDER_FLOAT32_ENABLED")){var t=Object(a.env)().getBool("DEBUG");Object(a.env)().set("DEBUG",!1);var n=e.abs(Object(a.scalar)(1e-8)).dataSync()[0];if(Object(a.env)().set("DEBUG",t),n>0)return 32}return 16}))),this.floatPrecisionValue}},{key:"epsilon",value:function(){return 32===this.floatPrecision()?1e-7:1e-4}},{key:"uploadToGPU",value:function(e){var t=this.texData.get(e),n=t.shape,r=t.dtype,i=t.values,o=t.texture,s=t.usage,u=t.isPacked;if(null==o){var c,l=null!=this.activeTimers;l&&(c=a.util.now());var d=t.texShape;if(null==d&&(d=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Object(a.env)().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(t&&(n*=2,1===(e=e.map((function(t,n){return n>=e.length-2?a.util.nearestLargerEven(e[n]):e[n]}))).length&&(e=[2,e[0]])),2!==e.length){var r=a.util.squeezeShape(e);e=r.newShape}var i=a.util.sizeFromShape(e);if(e.length<=1&&i<=n)return[1,i];if(2===e.length&&e[0]<=n&&e[1]<=n)return e;if(3===e.length&&e[0]*e[1]<=n&&e[2]<=n)return[e[0]*e[1],e[2]];if(3===e.length&&e[0]<=n&&e[1]*e[2]<=n)return[e[0],e[1]*e[2]];if(4===e.length&&e[0]*e[1]*e[2]<=n&&e[3]<=n)return[e[0]*e[1]*e[2],e[3]];if(4===e.length&&e[0]<=n&&e[1]*e[2]*e[3]<=n)return[e[0],e[1]*e[2]*e[3]];if(t){var o=Lo(e),s=2,u=2;if(e.length){var c=Do(e),l=Object(h.a)(c,2);s=l[0],u=l[1]}return i=o*(s/2)*(u/2),a.util.sizeToSquarishShape(i).map((function(e){return 2*e}))}return a.util.sizeToSquarishShape(i)}(n,u),t.texShape=d),null!=i){var f,p=Po(n),m=d[1],v=d[0],g=i instanceof Uint8Array;
2if(u){var b=vo(d[0],d[1]),y=Object(h.a)(b,2);m=y[0],v=y[1],f=new ru(p,[v,m],g)}else f=new nu(p,[v,m],g);var x=this.makeTensorInfo([v,m],r);this.texData.get(x.dataId).usage=g?uo.PIXELS:uo.UPLOAD,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(x.dataId),m,v,i);var w=this.runWebGLProgram(f,[x],r,null,!0),O=this.texData.get(w.dataId);t.texture=O.texture,t.texShape=O.texShape,t.isPacked=O.isPacked,t.usage=O.usage,this.disposeData(x.dataId),this.texData.delete(w.dataId),t.values=null,l&&(this.uploadWaitMs+=a.util.now()-c)}else{var k=this.acquireTexture(d,s,r,u);t.texture=k}}}},{key:"convertAndCacheOnCPU",value:function(e,t){var n=this.texData.get(e),r=n.dtype;return this.releaseGPUData(e),null!=t&&(n.values=function(e,t){if("float32"===t||"complex64"===t)return e;if("int32"===t||"bool"===t){for(var n="int32"===t?new Int32Array(e.length):new Uint8Array(e.length),r=0;r<n.length;++r)n[r]=Math.round(e[r]);return n}throw new Error("Unknown dtype ".concat(t))}(t,r)),n.values}},{key:"acquireTexture",value:function(e,t,n,r){if(this.numBytesInGPU+=this.computeBytes(e,n),!this.warnedAboutMemory&&this.numBytesInGPU>1024*this.numMBBeforeWarning*1024){var a=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn("High memory usage in GPU: ".concat(a," MB, ")+"most likely due to a memory leak")}return this.textureManager.acquireTexture(e,t,r)}},{key:"computeBytes",value:function(e,t){return e[0]*e[1]*a.util.bytesPerElement(t)}}]),n}(a.KernelBackend);a.device_util.isBrowser()&&Object(a.registerBackend)("webgl",(function(){return new Ac}),2);var Nc,Rc={kernelName:a.Div,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend;return function(e,t,n){var r=new Es("\nif (a == b) {\n return 1.0;\n};\nreturn a / b;",e.shape,t.shape);return Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&(r=new Cs("\n // vec4 one = vec4(equal(a, b));\n // return one + (vec4(1.0) - one) * a / b;\n vec4 result = a / b;\n if(a.x == b.x) {\n result.x = 1.;\n }\n if(a.y == b.y) {\n result.y = 1.;\n }\n if(a.z == b.z) {\n result.z = 1.;\n }\n if(a.w == b.w) {\n result.w = 1.;\n }\n\n return result;\n",e.shape,t.shape,!0)),n.runWebGLProgram(r,[e,t],"float32")}(t.a,t.b,n)}},Ic=function e(t){Object(i.a)(this,e),this.variableNames=["Image"],this.outputShape=[];var n=t[2];this.outputShape=t,this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n\n int coordX = ".concat(n," - x;\n float outputValue;\n if(coordX >= 0 && coordX < ").concat(n,") {\n outputValue = getImage(coords[0], coords[1], coordX, coords[3]);\n } else {\n outputValue = getImage(coords[0], coords[1], coords[2], coords[3]);\n }\n setOutput(outputValue);\n }\n ")},Lc={kernelName:a.FlipLeftRight,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.image,a=n,i=new Ic(r.shape);return a.runWebGLProgram(i,[r],r.dtype)}},Dc=function e(t){Object(i.a)(this,e),this.variableNames=["A"];var n=Zo(),r=Object(h.a)(t,2),a=r[0],o=r[1];this.outputShape=t,this.userCode="\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(".concat(o,".0, ").concat(a,".0);\n\n vec4 values = ").concat(n.texture2D,"(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n ")},Pc=function e(t){Object(i.a)(this,e),this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;var n=Zo(),r=Object(h.a)(t,2),a=r[0],o=r[1];this.outputShape=t,this.userCode="\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n\n vec4 result = vec4(0.);\n\n for(int row=0; row<=1; row++) {\n for(int col=0; col<=1; col++) {\n texC = coords[1] + row;\n depth = coords[2] + col;\n\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(".concat(o,".0, ").concat(a,".0);\n vec4 values = ").concat(n.texture2D,"(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n result[row * 2 + col] = floor(value * 255.0 + 0.5);\n }\n }\n\n ").concat(n.output," = result;\n }\n ")},zc={kernelName:a.FromPixels,backendName:"webgl",kernelFunc:function(e){var t=e.input
2s,n=e.backend,r=e.attrs,i=t.pixels,o=r.numChannels,s="undefined"!==typeof HTMLVideoElement&&i instanceof HTMLVideoElement,u="undefined"!==typeof HTMLImageElement&&i instanceof HTMLImageElement,c=s?[i.videoWidth,i.videoHeight]:[i.width,i.height],l=Object(h.a)(c,2),d=l[0],f=l[1],p=[f,d],m=[f,d,o];(u||s)&&(null==Nc&&(Nc=document.createElement("canvas").getContext("2d")),Nc.canvas.width=d,Nc.canvas.height=f,Nc.drawImage(i,0,0,d,f),i=Nc.canvas);var v=n.makeTensorInfo(p,"int32");n.texData.get(v.dataId).usage=uo.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(v.dataId),i);var g=Object(a.env)().getBool("WEBGL_PACK")?new Pc(m):new Dc(m),b=n.runWebGLProgram(g,[v],"int32");return n.disposeData(v.dataId),b}};var Fc=Bi,Bc=Ui;function Uc(e,t,n,r){for(var i=function(e){for(var t=[];0===t.length||1!==t[t.length-1].outSize;){var n=t.length?t[t.length-1].outSize:e[1],r=a.backend_util.computeOptimalWindowSize(n);t.push({inSize:n,windowSize:r,outSize:Math.ceil(n/r)})}return t}(e.shape),o=e,s=0;s<i.length;s++){var u=i[s],c=u.inSize,l=u.windowSize,h=u.outSize,d=new Fu({windowSize:l,inSize:c,batchSize:e.shape[0],outSize:h},n),f=o;o=r.runWebGLProgram(d,[o],t),f.dataId!==e.dataId&&r.disposeData(f.dataId)}return o}function Wc(e,t,n){var r=n.texData.get(e.dataId);return!r.isPacked||Fo(e.shape,t)||null!==r.texture&&Fo(r.shape,t)?{dataId:e.dataId,shape:t,dtype:e.dtype}:function(e,t,n){var r=[Lo(e.shape)].concat(Object(l.a)(Do(e.shape))),a={dtype:e.dtype,shape:r,dataId:e.dataId},i=[Lo(t)].concat(Object(l.a)(Do(t))),o=new Bu(i,r),s=n.runWebGLProgram(o,[a],e.dtype,null,!0);return{dataId:s.dataId,shape:t,dtype:s.dtype}}(e,t,n)}var Vc=function e(t,n){Object(i.a)(this,e),this.variableNames=["A"];for(var r=new Array(t.length),a=0;a<r.length;a++)r[a]=t[n[a]];this.outputShape=r,this.rank=r.length;var o=ds(this.rank),s=function(e){var t=e.length;if(t>6)throw Error("Transpose for rank ".concat(t," is not yet supported"));for(var n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],r=new Array(t),a=0;a<e.length;a++)r[e[a]]=n[a];return r.join()}(n);this.userCode="\n void main() {\n ".concat(o," resRC = getOutputCoords();\n setOutput(getA(").concat(s,"));\n }\n ")};var Gc=function e(t,n){Object(i.a)(this,e),this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0;for(var r=new Array(t.length),a=0;a<r.length;a++)r[a]=t[n[a]];if(this.outputShape=r,this.rank=r.length,this.rank>6)throw Error("Packed transpose for rank ".concat(this.rank," is not yet supported."));for(var o=ds(this.rank),s=Yo("rc",this.rank),u=new Array(this.rank),c=0;c<n.length;c++)u[n[c]]=s[c];var l="vec2(".concat(u.slice(-2).join(),")"),h="++".concat(s[this.rank-1]," < ").concat(r[this.rank-1]),d="getChannel(getA(".concat(u.join(),"), ").concat(l,")");this.userCode="\n void main() {\n ".concat(o," rc = getOutputCoords();\n vec4 result = vec4(0.);\n result[0] = ").concat(d,";\n if(").concat(h,") {\n result[1] = ").concat(d,";\n }\n --").concat(s[this.rank-1],";\n if(++").concat(s[this.rank-2]," < ").concat(r[this.rank-2],") {\n result[2] = ").concat(d,";\n if(").concat(h,") {\n result[3] = ").concat(d,";\n }\n }\n setOutput(result);\n }\n ")};function Hc(e,t,n){var r=Object(a.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Gc(e.shape,t):new Vc(e.shape,t);return n.runWebGLProgram(r,[e],e.dtype)}var qc={kernelName:a.Max,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.attrs,r=e.backend,i=t.x,o=n.reductionIndices,s=n.keepDims,u=r,c=i.shape.length,l=a.util.parseAxisParam(o,i.shape),d=l,f=a.backend_util.getAxesPermutation(d,c),p=null!=f,m=u.shouldExecuteOnCPU([i]),v=i;if(p){if(m){for(var g=u.texData.get(v.dataId).values,b=new Array(c),y=0;y<b.length;y++)b[y]=i.shape[f[y]];var x=Bc(g,i.shape,i.dtype,f,b);v=u.makeTensorInfo(b,i.dtype),u.texData.get(v.dataId).values=x}else v=Hc(i,f,u);d=a.backend_util.getInnerMostAxes(d.length,c)}a.backend_util.assertAxesAreInnerMostDims("max",d,c);var w,O=a.backend_util.computeOutAndReduceShapes(v.shape,d),k=Object(h.a)(O,2),S=k[0],_=k[1],j=S;if(s&&(j=a.backend_util.expandShapeToKeepDim(S,l)),m){var E=u.texData.get(v.dataId).values,T=Fc(E,a.util.sizeFromShape(_),j,i.dtype);w=u.makeTensorInfo(j,i.dtype),u.texData.get(w.dataId).values=T}else w=function(e,t,n,r){var i=a.util.sizeFromShape(t),o=Wc(e,[a.util.sizeFromShape(e.shape)/i,i],r),s=Uc(o,e.dtype,"max",r);return o.dataId!==e.dataId&&r.disposeData(o.dataId),Wc(s,n,r)}(v,_,j,u);return p&&u.disposeData(v.dataId),w}};for(var Xc={kernelName:a.MaxPoolWithArgmax,backendName:"webgl",kernelFunc:function(e){var t=e.input
2s,n=e.attrs,r=e.backend,i=t.x,o=n.filterSize,s=n.strides,u=n.pad,c=n.includeBatchInIndex,l=r;a.util.assert(4===i.shape.length,(function(){return"Error in maxPool: input must be rank 4 but got rank ".concat(i.shape.length,".")}));var d=[1,1];a.util.assert(a.backend_util.eitherStridesOrDilationsAreOne(s,d),(function(){return"Error in maxPool: Either strides or dilations must be 1. "+"Got strides ".concat(s," and dilations '").concat(d,"'")}));var f=a.backend_util.computePool2DInfo(i.shape,o,s,d,u),p=function(e,t,n,r){var a=new Pu(n,"max",!1),i=r.runWebGLProgram(a,[e],"float32");return a=new Pu(n,"max",!0,!0,t),[i,r.runWebGLProgram(a,[e],"float32")]}(i,c,f,l),m=Object(h.a)(p,2);return[m[0],m[1]]}},Yc={kernelName:a.NonMaxSuppressionV3,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs;a.backend_util.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");var i=t.boxes,o=t.scores,s=r.maxOutputSize,u=r.iouThreshold,c=r.scoreThreshold,l=n,h=l.readSync(i.dataId),d=l.readSync(o.dataId),f=s,p=u,m=c;return a.kernel_impls.nonMaxSuppressionV3Impl(h,d,f,p,m)}},Kc=a.kernel_impls.nonMaxSuppressionV4Impl,Zc={kernelName:a.NonMaxSuppressionV4,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs;a.backend_util.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");var i=t.boxes,o=t.scores,s=r.maxOutputSize,u=r.iouThreshold,c=r.scoreThreshold,l=r.padToMaxOutputSize,h=n,d=h.readSync(i.dataId),f=h.readSync(o.dataId),p=Kc(d,f,s,u,c,l);return[p.selectedIndices,p.validOutputs]}},Jc=a.kernel_impls.nonMaxSuppressionV5Impl,Qc={kernelName:a.NonMaxSuppressionV5,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs;a.backend_util.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");var i=t.boxes,o=t.scores,s=r.maxOutputSize,u=r.iouThreshold,c=r.scoreThreshold,l=r.softNmsSigma,h=n,d=h.readSync(i.dataId),f=h.readSync(o.dataId),p=Jc(d,f,s,u,c,l);return[p.selectedIndices,p.selectedScores]}},$c=function e(t,n,r,o){Object(i.a)(this,e),this.variableNames=["Image"],this.outputShape=[];var s=t[1],u=t[2],c=Math.sin(n).toFixed(3),l=Math.cos(n).toFixed(3);this.outputShape=t;var d=a.backend_util.getImageCenter(o,s,u),f=Object(h.a)(d,2),p=f[0],m=f[1],v=p.toFixed(3),g=m.toFixed(3),b="";b="number"===typeof r?"float outputValue = ".concat(r.toFixed(2),";"):"\n vec3 fill = vec3(".concat(r.join(","),");\n float outputValue = fill[coords[3]];"),this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n int y = coords[1];\n float coordXFloat = (float(x) - ".concat(v,") * ").concat(l," - (float(y) - ").concat(g,") * ").concat(c,";\n float coordYFloat = (float(x) - ").concat(v,") * ").concat(c," + (float(y) - ").concat(g,") * ").concat(l,";
2\n int coordX = int(round(coordXFloat + ").concat(v,"));\n int coordY = int(round(coordYFloat + ").concat(g,"));\n ").concat(b,"\n if(coordX >= 0 && coordX < ").concat(u," && coordY >= 0 && coordY < ").concat(s,") {\n outputValue = getImage(coords[0], coordY, coordX, coords[3]);\n }\n setOutput(outputValue);\n }\n ")},el=0,tl=[qc,Lc,zc,Rc,Xc,Yc,Zc,Qc,{kernelName:a.RotateWithOffset,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.attrs,r=e.backend,a=t.image,i=n.radians,o=n.fillValue,s=n.center,u=r,c=new $c(a.shape,i,o,s);return u.runWebGLProgram(c,[a],a.dtype)}},{kernelName:a.Square,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.x,a=n,i=new oc(r.shape,"return x * x;");return a.runWebGLProgram(i,[r],r.dtype)}},{kernelName:a.SquaredDifference,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.a,i=t.b,o=n,s=Object(a.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Cs("return (a - b) * (a - b);",r.shape,i.shape):new Es("return (a - b) * (a - b);",r.shape,i.shape);return o.compileAndRun(s,[r,i])}},{kernelName:a.Transpose,backendName:"webgl",kernelFunc:function(e){for(var t,n=e.inputs,r=e.attrs,a=e.backend,i=n.x,o=r.perm,s=a,u=i.shape.length,c=new Array(u),l=0;l<c.length;l++)c[l]=i.shape[o[l]];if(s.shouldExecuteOnCPU([i])){var h=s.texData.get(i.dataId).values,d=Bc(h,i.shape,i.dtype,o,c);t=s.makeTensorInfo(c,i.dtype),s.texData.get(t.dataId).values=d}else t=Hc(i,o,s);return t}}];el<tl.length;el++){var nl=tl[el];Object(a.registerKernel)(nl)}a.version_core,fi.b},function(e,t,n){"use strict";function r(e){for(var t="https://material-ui.com/production-error/?code="+e,n=1;n<arguments.length;n+=1)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified Material-UI error #"+e+"; visit "+t+" for the full message."}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(21),a=n(46),i=n(1),o=n.n(i),s=(n(54),n(118)),u=n(44),c=n(138),l=n(70),h=n(53),d=n(226),f=n(108),p=n(83),m=n(180),v=n(181),g=o.a.createContext(null);function b(e,t){var n=Object.create(null);return e&&i.Children.map(e,(function(e){return e})).forEach((function(e){n[e.key]=function(e){return t&&Object(i.isValidElement)(e)?t(e):e}(e)})),n}function y(e,t,n){return null!=n[t]?n[t]:e.props[t]}function x(e,t,n){var r=b(e.children),a=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,a=Object.create(null),i=[];for(var o in e)o in t?i.length&&(a[o]=i,i=[]):i.push(o);var s={};for(var u in t){if(a[u])for(r=0;r<a[u].length;r++){var c=a[u][r];s[a[u][r]]=n(c)}s[u]=n(u)}for(r=0;r<i.length;r++)s[i[r]]=n(i[r]);return s}(t,r);return Object.keys(a).forEach((function(o){var s=a[o];if(Object(i.isValidElement)(s)){var u=o in t,c=o in r,l=t[o],h=Object(i.isValidElement)(l)&&!l.props.in;!c||u&&!h?c||!u||h?c&&u&&Object(i.isValidElement)(l)&&(a[o]=Object(i.cloneElement)(s,{onExited:n.bind(null,s),in:l.props.in,exit:y(s,"exit",e),enter:y(s,"enter",e)})):a[o]=Object(i.cloneElement)(s,{in:!1}):a[o]=Object(i.cloneElement)(s,{onExited:n.bind(null,s),in:!0,exit:y(s,"exit",e),enter:y(s,"enter",e)})}})),a}var w=Object.values||function(e){return Object.keys(e).map((function(t){return e[t]}))},O=function(e){function t(t,n){var r,a=(r=e.call(this,t,n)||this).handleExited.bind(Object(m.a)(r));return r.state={contextValue:{isMounting:!0},handleExited:a,firstRender:!0},r}Object(v.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,r,a=t.children,o=t.handleExited;
2return{children:t.firstRender?(n=e,r=o,b(n.children,(function(e){return Object(i.cloneElement)(e,{onExited:r.bind(null,e),in:!0,appear:y(e,"appear",n),enter:y(e,"enter",n),exit:y(e,"exit",n)})}))):x(e,a,o),firstRender:!1}},n.handleExited=function(e,t){var n=b(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState((function(t){var n=Object(r.a)({},t.children);return delete n[e.key],{children:n}})))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=Object(p.a)(e,["component","childFactory"]),a=this.state.contextValue,i=w(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,null===t?o.a.createElement(g.Provider,{value:a},i):o.a.createElement(g.Provider,{value:a},o.a.createElement(t,r,i))},t}(o.a.Component);O.propTypes={},O.defaultProps={component:"div",childFactory:function(e){return e}};var k=O,S="undefined"===typeof window?i.useEffect:i.useLayoutEffect;var _=function(e){var t=e.classes,n=e.pulsate,r=void 0!==n&&n,a=e.rippleX,o=e.rippleY,s=e.rippleSize,c=e.in,h=e.onExited,d=void 0===h?function(){}:h,f=e.timeout,p=i.useState(!1),m=p[0],v=p[1],g=Object(u.a)(t.ripple,t.rippleVisible,r&&t.ripplePulsate),b={width:s,height:s,top:-s/2+o,left:-s/2+a},y=Object(u.a)(t.child,m&&t.childLeaving,r&&t.childPulsate),x=Object(l.a)(d);return S((function(){if(!c){v(!0);var e=setTimeout(x,f);return function(){clearTimeout(e)}}}),[x,c,f]),i.createElement("span",{className:g,style:b},i.createElement("span",{className:y}))},j=i.forwardRef((function(e,t){var n=e.center,o=void 0!==n&&n,s=e.classes,c=e.className,l=Object(a.a)(e,["center","classes","className"]),h=i.useState([]),d=h[0],p=h[1],m=i.useRef(0),v=i.useRef(null);i.useEffect((function(){v.current&&(v.current(),v.current=null)}),[d]);var g=i.useRef(!1),b=i.useRef(null),y=i.useRef(null),x=i.useRef(null);i.useEffect((function(){return function(){clearTimeout(b.current)}}),[]);var w=i.useCallback((function(e){var t=e.pulsate,n=e.rippleX,r=e.rippleY,a=e.rippleSize,o=e.cb;p((function(e){return[].concat(Object(f.a)(e),[i.createElement(_,{key:m.current,classes:s,timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:a})])})),m.current+=1,v.current=o}),[s]),O=i.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=t.pulsate,a=void 0!==r&&r,i=t.center,s=void 0===i?o||t.pulsate:i,u=t.fakeElement,c=void 0!==u&&u;if("mousedown"===e.type&&g.current)g.current=!1;else{"touchstart"===e.type&&(g.current=!0);var l,h,d,f=c?null:x.current,p=f?f.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(s||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)l=Math.round(p.width/2),h=Math.round(p.height/2);else{var m=e.touches?e.touches[0]:e,v=m.clientX,O=m.clientY;l=Math.round(v-p.left),h=Math.round(O-p.top)}if(s)(d=Math.sqrt((2*Math.pow(p.width,2)+Math.pow(p.height,2))/3))%2===0&&(d+=1);else{var k=2*Math.max(Math.abs((f?f.clientWidth:0)-l),l)+2,S=2*Math.max(Math.abs((f?f.clientHeight:0)-h),h)+2;d=Math.sqrt(Math.pow(k,2)+Math.pow(S,2))}e.touches?null===y.current&&(y.current=function(){w({pulsate:a,rippleX:l,rippleY:h,rippleSize:d,cb:n})},b.current=setTimeout((function(){y.current&&(y.current(),y.current=null)}),80)):w({pulsate:a,rippleX:l,rippleY:h,rippleSize:d,cb:n})}}),[o,w]),S=i.useCallback((function(){O({},{pulsate:!0})}),[O]),j=i.useCallback((function(e,t){if(clearTimeout(b.current),"touchend"===e.type&&y.current)return e.persist(),y.current(),y.current=null,void(b.current=setTimeout((function(){j(e,t)})));y.current=null,p((function(e){return e.length>0?e.slice(1):e})),v.current=t}),[]);return i.useImperativeHandle(t,(function(){return{pulsate:S,start:O,stop:j}}),[S,O,j]),i.createElement("span",Object(r.a)({className:Object(u.a)(s.root,c),ref:x},l),i.createElement(k,{component:null,exit:!0},d))})),E=Object(h.a)((function(e){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(e.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500m
2s ".concat(e.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}}),{flip:!1,name:"MuiTouchRipple"})(i.memo(j)),T=i.forwardRef((function(e,t){var n=e.action,o=e.buttonRef,h=e.centerRipple,f=void 0!==h&&h,p=e.children,m=e.classes,v=e.className,g=e.component,b=void 0===g?"button":g,y=e.disabled,x=void 0!==y&&y,w=e.disableRipple,O=void 0!==w&&w,k=e.disableTouchRipple,S=void 0!==k&&k,_=e.focusRipple,j=void 0!==_&&_,T=e.focusVisibleClassName,C=e.onBlur,M=e.onClick,A=e.onFocus,N=e.onFocusVisible,R=e.onKeyDown,I=e.onKeyUp,L=e.onMouseDown,D=e.onMouseLeave,P=e.onMouseUp,z=e.onTouchEnd,F=e.onTouchMove,B=e.onTouchStart,U=e.onDragLeave,W=e.tabIndex,V=void 0===W?0:W,G=e.TouchRippleProps,H=e.type,q=void 0===H?"button":H,X=Object(a.a)(e,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),Y=i.useRef(null);var K=i.useRef(null),Z=i.useState(!1),J=Z[0],Q=Z[1];x&&J&&Q(!1);var $=Object(d.a)(),ee=$.isFocusVisible,te=$.onBlurVisible,ne=$.ref;function re(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:S;return Object(l.a)((function(r){return t&&t(r),!n&&K.current&&K.current[e](r),!0}))}i.useImperativeHandle(n,(function(){return{focusVisible:function(){Q(!0),Y.current.focus()}}}),[]),i.useEffect((function(){J&&j&&!O&&K.current.pulsate()}),[O,j,J]);var ae=re("start",L),ie=re("stop",U),oe=re("stop",P),se=re("stop",(function(e){J&&e.preventDefault(),D&&D(e)})),ue=re("start",B),ce=re("stop",z),le=re("stop",F),he=re("stop",(function(e){J&&(te(e),Q(!1)),C&&C(e)}),!1),de=Object(l.a)((function(e){Y.current||(Y.current=e.currentTarget),ee(e)&&(Q(!0),N&&N(e)),A&&A(e)})),fe=function(){var e=s.findDOMNode(Y.current);return b&&"button"!==b&&!("A"===e.tagName&&e.href)},pe=i.useRef(!1),me=Object(l.a)((function(e){j&&!pe.current&&J&&K.current&&" "===e.key&&(pe.current=!0,e.persist(),K.current.stop(e,(function(){K.current.start(e)}))),e.target===e.currentTarget&&fe()&&" "===e.key&&e.preventDefault(),R&&R(e),e.target===e.currentTarget&&fe()&&"Enter"===e.key&&!x&&(e.preventDefault(),M&&M(e))})),ve=Object(l.a)((function(e){j&&" "===e.key&&K.current&&J&&!e.defaultPrevented&&(pe.current=!1,e.persist(),K.current.stop(e,(function(){K.current.pulsate(e)}))),I&&I(e),M&&e.target===e.currentTarget&&fe()&&" "===e.key&&!e.defaultPrevented&&M(e)})),ge=b;"button"===ge&&X.href&&(ge="a");var be={};"button"===ge?(be.type=q,be.disabled=x):("a"===ge&&X.href||(be.role="button"),be["aria-disabled"]=x);var ye=Object(c.a)(o,t),xe=Object(c.a)(ne,Y),we=Object(c.a)(ye,xe),Oe=i.useState(!1),ke=Oe[0],Se=Oe[1];i.useEffect((function(){Se(!0)}),[]);var _e=ke&&!O&&!x;return i.createElement(ge,Object(r.a)({className:Object(u.a)(m.root,v,J&&[m.focusVisible,T],x&&m.disabled),onBlur:he,onClick:M,onFocus:de,onKeyDown:me,onKeyUp:ve,onMouseDown:ae,onMouseLeave:se,onMouseUp:oe,onDragLeave:ie,onTouchEnd:ce,onTouchMove:le,onTouchStart:ue,ref:we,tabIndex:x?-1:V},be,X),p,_e?i.createElement(E,Object(r.a)({ref:K,center:f},G)):null)}));t.a=Object(h.a)({root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}},disabled:{},focusVisible:{}},{name:"MuiButtonBase"})(T)},,,,,,,function(e,t,n){"use strict";var r=n(248),a="function"===typeof Symbol&&Symbol.for,i=a?Symbol.for("react.element"):60103,o=a?Symbol.for("react.portal"):60106,s=a?Symbol.for("react.fragment"):60107,u=a?Symbol.for("react.strict_mode"):60108,c=a?Symbol.for("react.profiler"):60114,l=a?Symbol.for("react.provider"):60109,h=a?Symbol.for("react.context"):60110,d=a?Symbol.for("react.forward_ref"):60112,f=a?Symbol.for("react.suspense"):60113,p=a?Symbol.for("react.memo"):60115,m=a?Symbol.for("react.lazy"):60116,v="function"===typeof Symbol&&Symbol.iterator;function g(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y={};function x(e,t,n){this.props=e,this.context=t,this.refs=y,this.updater=n||b}function w(){}function O(e,t,n){this.props=e,this.context=t,this.refs=y,this.updater=n||b}x.prototype.isReactComponent={},x.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error(g(85));this.updater.enqueueSetState(this,e,t,"setState")},x.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},w.prototype=x.prototype;var k=O.prototype=new w;k.constructor=O,r(k,x.prototype),k.isPureReactComponent=!0;var S={current:null},_=Object.prototype.hasOwnProperty,j={key:!0,ref:!0,__self:!0,__source:!0};function E(e,t,n){var r,a={},o=null,s=null;if(null!=t)for(r in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(o=""+t.key),t)_.call(t,r)&&!j.hasOwnProperty(r)&&(a[r]=t[r]);var u=arguments.length-2;if(1===u)a.children=n;else if(1<u){for(var c=Array(u),l=0;l<u;l++)c[l]=arguments[l+2];a.children=c}if(e&&e.defaultProps)for(r in u=e.defaultProps)void 0===a[r]&&(a[r]=u[r]);return{$$typeof:i,type:e,key:o,ref:s,props:a,_owner:S.current}}function T(e){return"object"===typeof e&&null!==e&&e.$$typeof===i}var C=/\/+/g,M=[];function A(e,t,n,r){if(M.length){var a=M.pop();return a.result=e,a.keyPrefix=t,a.func=n,a.context=r,a.count=0,a}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function N(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>M.length&&M.push(e)}function R(e,t,n){return null==e?0:function e(t,n,r,a){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var u=!1;if(null===t)u=!0;else switch(s){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case i:case o:u=!0}}if(u)return r(a,t,""===n?"."+I(t,0):n),1;if(u=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;c<t.length;c++){var l=n+I(s=t[c],c);u+=e(s,l,r,a)}else if(null===t||"object"!==typeof t?l=null:l="function"===typeof(l=v&&t[v]||t["@@iterator"])?l:null,"function"===typeof l)for(t=l.call(t),c=0;!(s=t.next()).done;)u+=e(s=s.value,l=n+I(s,c++),r,a);else if("object"===s)throw r=""+t,Error(g(31,"[object Object]"===r?"object with keys {"+Object.keys(t).join(", ")+"}":r,""));return u}
2(e,"",t,n)}function I(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function L(e,t){e.func.call(e.context,t,e.count++)}function D(e,t,n){var r=e.result,a=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?P(e,r,n,(function(e){return e})):null!=e&&(T(e)&&(e=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,a+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(C,"$&/")+"/")+n)),r.push(e))}function P(e,t,n,r,a){var i="";null!=n&&(i=(""+n).replace(C,"$&/")+"/"),R(e,D,t=A(t,i,r,a)),N(t)}var z={current:null};function F(){var e=z.current;if(null===e)throw Error(g(321));return e}var B={ReactCurrentDispatcher:z,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:S,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:function(e,t,n){if(null==e)return e;var r=[];return P(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;R(e,L,t=A(null,null,t,n)),N(t)},count:function(e){return R(e,(function(){return null}),null)},toArray:function(e){var t=[];return P(e,t,null,(function(e){return e})),t},only:function(e){if(!T(e))throw Error(g(143));return e}},t.Component=x,t.Fragment=s,t.Profiler=c,t.PureComponent=O,t.StrictMode=u,t.Suspense=f,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=B,t.cloneElement=function(e,t,n){if(null===e||void 0===e)throw Error(g(267,e));var a=r({},e.props),o=e.key,s=e.ref,u=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,u=S.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in t)_.call(t,l)&&!j.hasOwnProperty(l)&&(a[l]=void 0===t[l]&&void 0!==c?c[l]:t[l])}var l=arguments.length-2;if(1===l)a.children=n;else if(1<l){c=Array(l);for(var h=0;h<l;h++)c[h]=arguments[h+2];a.children=c}return{$$typeof:i,type:e.type,key:o,ref:s,props:a,_owner:u}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:h,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:l,_context:e},e.Consumer=e},t.createElement=E,t.createFactory=function(e){var t=E.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:d,render:e}},t.isValidElement=T,t.lazy=function(e){return{$$typeof:m,_ctor:e,_status:-1,_result:null}},t.memo=function(e,t){return{$$typeof:p,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return F().useCallback(e,t)},t.useContext=function(e,t){return F().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return F().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return F().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return F().useLayoutEffect(e,t)},t.useMemo=function(e,t){return F().useMemo(e,t)},t.useReducer=function(e,t,n){return F().useReducer(e,t,n)},t.useRef=function(e){return F().useRef(e)}
vendor: 5,105 bytes, line 2
2,t.useState=function(e){return F().useState(e)},t.version="16.13.1"},function(e,t,n){"use strict";var r=n(1),a=n(248),i=n(339);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(o(227));function s(e,t,n,r,a,i,o,s,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(l){this.onError(l)}}var u=!1,c=null,l=!1,h=null,d={onError:function(e){u=!0,c=e}};function f(e,t,n,r,a,i,o,l,h){u=!1,c=null,s.apply(d,arguments)}var p=null,m=null,v=null;function g(e,t,n){var r=e.type||"unknown-event";e.currentTarget=v(n),function(e,t,n,r,a,i,s,d,p){if(f.apply(this,arguments),u){if(!u)throw Error(o(198));var m=c;u=!1,c=null,l||(l=!0,h=m)}}(r,t,void 0,e),e.currentTarget=null}var b=null,y={};function x(){if(b)for(var e in y){var t=y[e],n=b.indexOf(e);if(!(-1<n))throw Error(o(96,e));if(!O[n]){if(!t.extractEvents)throw Error(o(97,e));for(var r in O[n]=t,n=t.eventTypes){var a=void 0,i=n[r],s=t,u=r;if(k.hasOwnProperty(u))throw Error(o(99,u));k[u]=i;var c=i.phasedRegistrationNames;if(c){for(a in c)c.hasOwnProperty(a)&&w(c[a],s,u);a=!0}else i.registrationName?(w(i.registrationName,s,u),a=!0):a=!1;if(!a)throw Error(o(98,r,e))}}}}function w(e,t,n){if(S[e])throw Error(o(100,e));S[e]=t,_[e]=t.eventTypes[n].dependencies}var O=[],k={},S={},_={};function j(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var r=e[t];if(!y.hasOwnProperty(t)||y[t]!==r){if(y[t])throw Error(o(102,t));y[t]=r,n=!0}}n&&x()}var E=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),T=null,C=null,M=null;function A(e){if(e=m(e)){if("function"!==typeof T)throw Error(o(280));var t=e.stateNode;t&&(t=p(t),T(e.stateNode,e.type,t))}}function N(e){C?M?M.push(e):M=[e]:C=e}function R(){if(C){var e=C,t=M;if(M=C=null,A(e),t)for(e=0;e<t.length;e++)A(t[e])}}function I(e,t){return e(t)}function L(e,t,n,r,a){return e(t,n,r,a)}function D(){}var P=I,z=!1,F=!1;function B(){null===C&&null===M||(D(),R())}function U(e,t,n){if(F)return e(t,n);F=!0;try{return P(e,t,n)}finally{F=!1,B()}}var W=/^[: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]*$/,V=Object.prototype.hasOwnProperty,G={},H={};function q(e,t,n,r,a,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i}var X={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){X[e]=new q(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];X[t]=new q(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){X[e]=new q(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){X[e]=new q(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){X[e]=new q(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){X[e]=new q(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){X[e]=new q(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){X[e]=new q(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){X[e]=new q(e,5,!1,e.toLowerCase(),null,!1)}));var Y=/[\-:]([a-z])/g;function K(e){return e[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
2-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(e){var t=e.replace(Y,K);X[t]=new q(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(Y,K);X[t]=new q(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(Y,K);X[t]=new q(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){X[e]=new q(e,1,!1,e.toLowerCase(),null,!1)})),X.xlinkHref=new q("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){X[e]=new q(e,1,!1,e.toLowerCase(),null,!0)}));var Z=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function J(e,t,n,r){var a=X.hasOwnProperty(t)?X[t]:null;(null!==a?0===a.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null===t||"undefined"===typeof t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,a,r)&&(n=null),r||null===a?function(e){return!!V.call(H,e)||!V.call(G,e)&&(W.test(e)?H[e]=!0:(G[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=null===n?3!==a.type&&"":n:(t=a.attributeName,r=a.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(a=a.type)||4===a&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}Z.hasOwnProperty("ReactCurrentDispatcher")||(Z.ReactCurrentDispatcher={current:null}),Z.hasOwnProperty("ReactCurrentBatchConfig")||(Z.ReactCurrentBatchConfig={suspense:null});var Q=/^(.*)[\\\/]/,$="function"===typeof Symbol&&Symbol.for,ee=$?Symbol.for("react.element"):60103,te=$?Symbol.for("react.portal"):60106,ne=$?Symbol.for("react.fragment"):60107,re=$?Symbol.for("react.strict_mode"):60108,ae=$?Symbol.for("react.profiler"):60114,ie=$?Symbol.for("react.provider"):60109,oe=$?Symbol.for("react.context"):60110,se=$?Symbol.for("react.concurrent_mode"):60111,ue=$?Symbol.for("react.forward_ref"):60112,ce=$?Symbol.for("react.suspense"):60113,le=$?Symbol.for("react.suspense_list"):60120,he=$?Symbol.for("react.memo"):60115,de=$?Symbol.for("react.lazy"):60116,fe=$?Symbol.for("react.block"):60121,pe="function"===typeof Symbol&&Symbol.iterator;function me(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=pe&&e[pe]||e["@@iterator"])?e:null}function ve(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case ne:return"Fragment";case te:return"Portal";case ae:return"Profiler";case re:return"StrictMode";case ce:return"Suspense";case le:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case oe:return"Context.Consumer";case ie:return"Context.Provider";case ue:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case he:return ve(e.type);case fe:return ve(e.render);case de:if(e=1===e._status?e._result:null)return ve(e)}return null}function ge(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var n="";break e;default:var r=e._debugOwner,a=e._debugSource,i=ve(e.type);n=null,r&&(n=ve(r.type)),r=i,i="",a?i=" (at "+a.fileName.replace(Q,"")+":"+a.lineNumber+")":n&&(i=" (created by "+n+")"),n="\n in "+(r||"Unknown")+i}t+=n,e=e.return}while(e);return t}function be(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function ye(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function xe(e){e._valueTracker||(e._valueTracker=function(e){var t=ye(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var a=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function we(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ye(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Oe(e,t){var n=t.checked;return a({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ke(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=be(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Se(e,t){null!=(t=t.checked)&&J(e,"checked",t,!1)}function _e(e,t){Se(e,t);var n=be(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?Ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ee(e,t.type,be(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function je(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function Ee(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function Te(e,t){return e=a({children:void 0},t),(t=function(e){var t="";
vendor: 13,407 bytes, line 2
2return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function Ce(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+be(n),t=null,a=0;a<e.length;a++){if(e[a].value===n)return e[a].selected=!0,void(r&&(e[a].defaultSelected=!0));null!==t||e[a].disabled||(t=e[a])}null!==t&&(t.selected=!0)}}function Me(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(o(91));return a({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ae(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(o(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(o(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:be(n)}}function Ne(e,t){var n=be(t.value),r=be(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function Re(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var Ie="http://www.w3.org/1999/xhtml",Le="http://www.w3.org/2000/svg";function De(e){switch(e){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 Pe(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?De(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ze,Fe=function(e){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,a){MSApp.execUnsafeLocalFunction((function(){return e(t,n)}))}:e}((function(e,t){if(e.namespaceURI!==Le||"innerHTML"in e)e.innerHTML=t;else{for((ze=ze||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ze.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}));function Be(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function Ue(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var We={animationend:Ue("Animation","AnimationEnd"),animationiteration:Ue("Animation","AnimationIteration"),animationstart:Ue("Animation","AnimationStart"),transitionend:Ue("Transition","TransitionEnd")},Ve={},Ge={};function He(e){if(Ve[e])return Ve[e];if(!We[e])return e;var t,n=We[e];for(t in n)if(n.hasOwnProperty(t)&&t in Ge)return Ve[e]=n[t];return e}E&&(Ge=document.createElement("div").style,"AnimationEvent"in window||(delete We.animationend.animation,delete We.animationiteration.animation,delete We.animationstart.animation),"TransitionEvent"in window||delete We.transitionend.transition);var qe=He("animationend"),Xe=He("animationiteration"),Ye=He("animationstart"),Ke=He("transitionend"),Ze="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Je=new("function"===typeof WeakMap?WeakMap:Map);function Qe(e){var t=Je.get(e);return void 0===t&&(t=new Map,Je.set(e,t)),t}function $e(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(1026&(t=e).effectTag)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function et(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function tt(e){if($e(e)!==e)throw Error(o(188))}function nt(e){if(!(e=function(e){var t=e.alternate;if(!t){if(null===(t=$e(e)))throw Error(o(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(null===a)break;var i=a.alternate;if(null===i){if(null!==(r=a.return)){n=r;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return tt(a),e;if(i===r)return tt(a),t;i=i.sibling}throw Error(o(188))}if(n.return!==r.return)n=a,r=i;else{for(var s=!1,u=a.child;u;){if(u===n){s=!0,n=a,r=i;break}if(u===r){s=!0,r=a,n=i;break}u=u.sibling}if(!s){for(u=i.child;u;){if(u===n){s=!0,n=i,r=a;break}if(u===r){s=!0,r=i,n=a;break}u=u.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(3!==n.tag)throw Error(o(188));return n.stateNode.current===n?e:t}(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function rt(e,t){if(null==t)throw Error(o(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function at(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var it=null;function ot(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;r<t.length&&!e.isPropagationStopped();r++)g(e,t[r],n[r]);else t&&g(e,t,n);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function st(e){if(null!==e&&(it=rt(it,e)),e=it,it=null,e){if(at(e,ot),it)throw Error(o(95));if(l)throw e=h,l=!1,h=null,e}}function ut(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function ct(e){if(!E)return!1;var t=(e="on"+e)in document;return t||((t=document.createElement("div")).setAttribute(e,"return;"),t="function"===typeof t[e]),t}var lt=[];function ht(e){e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>lt.length&<.push(e)}function dt(e,t,n,r){if(lt.length){var a=lt.pop();return a.topLevelType=e,a.eventSystemFlags=r,a.nativeEvent=t,a.targetInst=n,a}return{topLevelType:e,eventSystemFlags:r,nativeEvent:t,targetInst:n,ancestors:[]}}function ft(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var r=n;if(3===r.tag)r=r.stateNode.containerInfo;else{for(;r.return;)r=r.return;r=3!==r.tag?null:r.stateNode.containerInfo}if(!r)break;5!==(t=n.tag)&&6!==t||e.ancestors.push(n),n=En(r)}while(n);for(n=0;n<e.ancestors.length;n++){t=e.ancestors[n];var a=ut(e.nativeEvent);r=e.topLevelType;var i=e.nativeEvent,o=e.eventSystemFlags;0===n&&(o|=64);for(var s=null,u=0;u<O.length;u++){var c=O[u];c&&(c=c.extractEvents(r,t,i,a,o))&&(s=rt(s,c))}st(s)}}function pt(e,t,n){if(!n.has(e)){switch(e){case"scroll":Yt(t,"scroll",!0);break;case"focus":case"blur":Yt(t,"focus",!0),Yt(t,"blur",!0),n.set("blur",null),n.set("focus",null);break;case"cancel":case"close":ct(e)&&Yt(t,e,!0);break;case"invalid":case"submit":case"reset":break;default:-1===Ze.indexOf(e)&&Xt(e,t)}n.set(e,null)}}var mt,vt,gt,bt=!1,yt=[],xt=null,wt=null,Ot=null,kt=new Map,St=new Map,_t=[],jt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "),Et="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function Tt(e,t,n,r,a){return{blockedOn:e,topLevelType:t,eventSystemFlags:32|n,nativeEvent:a,container:r}}function Ct(e,t){switch(e){case"focus":case"blur":xt=null;break;case"dragenter":case"dragleave":wt=null;break;case"mouseover":case"mouseout":Ot=null;break;case"pointerover":case"pointerout":kt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":St.delete(t.pointerId)}}function Mt(e,t,n,r,a,i){return null===e||e.nativeEvent!==i?(e=Tt(t,n,r,a,i),null!==t&&(null!==(t=Tn(t))&&vt(t)),e):(e.eventSystemFlags|=r,e)}function At(e){var t=En(e.target);if(null!==t){var n=$e(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=et(n)))return e.blockedOn=t,void i.unstable_runWithPriority(e.priority,(function(){gt(n)}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Nt(e){if(null!==e.blockedOn)return!1;var t=Qt(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);if(null!==t){var n=Tn(t);return null!==n&&vt(n),e.blockedOn=t,!1}return!0}function Rt(e,t,n){Nt(e)&&n.delete(t)}function It(){for(bt=!1;0<yt.length;){var e=yt[0];if(null!==e.blockedOn){null!==(e=Tn(e.blockedOn))&&mt(e);break}var t=Qt(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);null!==t?e.blockedOn=t:yt.shift()}null!==xt&&Nt(xt)&&(xt=null),null!==wt&&Nt(wt)&&(wt=null),null!==Ot&&Nt(Ot)&&(Ot=null),kt.forEach(Rt),St.forEach(Rt)}function Lt(e,t){e.blockedOn===t&&(e.blockedOn=null,bt||(bt=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,It)))}function Dt(e){function t(t){return Lt(t,e)}if(0<yt.length){Lt(yt[0],e);for(var n=1;n<yt.length;n++){var r=yt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==xt&&Lt(xt,e),null!==wt&&Lt(wt,e),null!==Ot&&Lt(Ot,e),kt.forEach(t),St.forEach(t),n=0;n<_t.length;n++)(r=_t[n]).blockedOn===e&&(r.blockedOn=null);for(;0<_t.length&&null===(n=_t[0]).blockedOn;)At(n),null===n.blockedOn&&_t.shift()}var Pt={},zt=new Map,Ft=new Map,Bt=["abort","abort",qe,"animationEnd",Xe,"animationIteration",Ye,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Ke,"transitionEnd","waiting","waiting"];function Ut(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],a=e[n+1],i="on"+(a[0].toUpperCase()+a.slice(1));i={phasedRegistrationNames:{bubbled:i,captured:i+"Capture"},dependencies:[r],eventPriority:t},Ft.set(r,t),zt.set(r,i),Pt[a]=i}}Ut("blur blur cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focus focus input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Ut("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Ut(Bt,2);for(var Wt="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Vt=0;Vt<Wt.length;Vt++)Ft.set(Wt[Vt],0);var Gt=i.unstable_UserBlockingPriority,Ht=i.unstable_runWithPriority,qt=!0;function Xt(e,t){Yt(t,e,!1)}function Yt(e,t,n){var r=Ft.get(t);switch(void 0===r?2:r){case 0:r=Kt.bind(null,t,1,e);break;case 1:r=Zt.bind(null,t,1,e);break;default:r=Jt.bind(null,t,1,e)}n?e.addEventListener(t,r,!0):e.addEventListener(t,r,!1)}function Kt(e,t,n,r){z||D();var a=Jt,i=z;z=!0;try{L(a,e,t,n,r)}finally{(z=i)||B()}}function Zt(e,t,n,r){Ht(Gt,Jt.bind(null,e,t,n,r))}function Jt(e,t,n,r){if(qt)if(0<yt.length&&-1<jt.indexOf(e))e=Tt(null,e,t,n,r),yt.push(e);else{var a=Qt(e,t,n,r);if(null===a)Ct(e,r);else if(-1<jt.indexOf(e))e=Tt(a,e,t,n,r),yt.push(e);else if(!function(e,t,n,r,a){switch(t){case"focus":return xt=Mt(xt,e,t,n,r,a),!0;case"dragenter":return wt=Mt(wt,e,t,n,r,a),!0;case"mouseover":return Ot=Mt(Ot,e,t,n,r,a),!0;case"pointerover":var i=a.pointerId;return kt.set(i,Mt(kt.get(i)||null,e,t,n,r,a)),!0;case"gotpointercapture":return i=a.pointerId,St.set(i,Mt(St.get(i)||null,e,t,n,r,a)),!0}return!1}(a,e,t,n,r)){Ct(e,r),e=dt(e,r,null,t);try{U(ft,e)}finally{ht(e)}}}}function Qt(e,t,n,r){if(null!==(n=En(n=ut(r)))){var a=$e(n);if(null===a)n=null;else{var i=a.tag;if(13===i){if(null!==(n=et(a)))return n;n=null}else if(3===i){if(a.stateNode.hydrate)return 3===a.tag?a.stateNode.containerInfo:null;n=null}else a!==n&&(n=null)}}e=dt(e,r,n,t);try{U(ft,e)}finally{ht(e)}return null}var $t={animationIterationCount:!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},en=["Webkit","ms","Moz","O"];function tn(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||$t.hasOwnProperty(e)&&$t[e]?(""+t).trim():t+"px"}function nn(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),a=tn(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}
2Object.keys($t).forEach((function(e){en.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),$t[t]=$t[e]}))}));var rn=a({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 an(e,t){if(t){if(rn[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(o(137,e,""));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(o(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(o(62,""))}}function on(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){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 sn=Ie;function un(e,t){var n=Qe(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);t=_[t];for(var r=0;r<t.length;r++)pt(t[r],e,n)}function cn(){}function ln(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function hn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function dn(e,t){var n,r=hn(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=hn(r)}}function fn(){for(var e=window,t=ln();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=ln((e=t.contentWindow).document)}return t}function pn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var mn=null,vn=null;function gn(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function bn(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var yn="function"===typeof setTimeout?setTimeout:void 0,xn="function"===typeof clearTimeout?clearTimeout:void 0;function wn(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function On(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var kn=Math.random().toString(36).slice(2),Sn="__reactInternalInstance$"+kn,_n="__reactEventHandlers$"+kn,jn="__reactContainere$"+kn;function En(e){var t=e[Sn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[jn]||n[Sn]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=On(e);null!==e;){if(n=e[Sn])return n;e=On(e)}return t}n=(e=n).parentNode}return null}function Tn(e){return!(e=e[Sn]||e[jn])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function Cn(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(o(33))}function Mn(e){return e[_n]||null}function An(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function Nn(e,t){var n=e.stateNode;if(!n)return null;var r=p(n);if(!r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(o(231,t,typeof n));return n}
vendor: 7,336 bytes, line 2
2function Rn(e,t,n){(t=Nn(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=rt(n._dispatchListeners,t),n._dispatchInstances=rt(n._dispatchInstances,e))}function In(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=An(t);for(t=n.length;0<t--;)Rn(n[t],"captured",e);for(t=0;t<n.length;t++)Rn(n[t],"bubbled",e)}}function Ln(e,t,n){e&&n&&n.dispatchConfig.registrationName&&(t=Nn(e,n.dispatchConfig.registrationName))&&(n._dispatchListeners=rt(n._dispatchListeners,t),n._dispatchInstances=rt(n._dispatchInstances,e))}function Dn(e){e&&e.dispatchConfig.registrationName&&Ln(e._targetInst,null,e)}function Pn(e){at(e,In)}var zn=null,Fn=null,Bn=null;function Un(){if(Bn)return Bn;var e,t,n=Fn,r=n.length,a="value"in zn?zn.value:zn.textContent,i=a.length;for(e=0;e<r&&n[e]===a[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===a[i-t];t++);return Bn=a.slice(e,1<t?1-t:void 0)}function Wn(){return!0}function Vn(){return!1}function Gn(e,t,n,r){for(var a in this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n,e=this.constructor.Interface)e.hasOwnProperty(a)&&((t=e[a])?this[a]=t(n):"target"===a?this.target=r:this[a]=n[a]);return this.isDefaultPrevented=(null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue)?Wn:Vn,this.isPropagationStopped=Vn,this}function Hn(e,t,n,r){if(this.eventPool.length){var a=this.eventPool.pop();return this.call(a,e,t,n,r),a}return new this(e,t,n,r)}function qn(e){if(!(e instanceof this))throw Error(o(279));e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function Xn(e){e.eventPool=[],e.getPooled=Hn,e.release=qn}a(Gn.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Wn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Wn)},persist:function(){this.isPersistent=Wn},isPersistent:Vn,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=Vn,this._dispatchInstances=this._dispatchListeners=null}}),Gn.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},Gn.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var i=new t;return a(i,n.prototype),n.prototype=i,n.prototype.constructor=n,n.Interface=a({},r.Interface,e),n.extend=r.extend,Xn(n),n},Xn(Gn);var Yn=Gn.extend({data:null}),Kn=Gn.extend({data:null}),Zn=[9,13,27,32],Jn=E&&"CompositionEvent"in window,Qn=null;E&&"documentMode"in document&&(Qn=document.documentMode);var $n=E&&"TextEvent"in window&&!Qn,er=E&&(!Jn||Qn&&8<Qn&&11>=Qn),tr=String.fromCharCode(32),nr={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},rr=!1;function ar(e,t){switch(e){case"keyup":return-1!==Zn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function ir(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var or=!1;var sr={eventTypes:nr,extractEvents:function(e,t,n,r){var a;if(Jn)e:{switch(e){case"compositionstart":var i=nr.compositionStart;break e;case"compositionend":i=nr.compositionEnd;break e;case"compositionupdate":i=nr.compositionUpdate;break e}i=void 0}else or?ar(e,n)&&(i=nr.compositionEnd):"keydown"===e&&229===n.keyCode&&(i=nr.compositionStart);return i?(er&&"ko"!==n.locale&&(or||i!==nr.compositionStart?i===nr.compositionEnd&&or&&(a=Un()):(Fn="value"in(zn=r)?zn.value:zn.textContent,or=!0)),i=Yn.getPooled(i,t,n,r),a?i.data=a:null!==(a=ir(n))&&(i.data=a),Pn(i),a=i):a=null,(e=$n?function(e,t){switch(e){case"compositionend":return ir(t);case"keypress":return 32!==t.which?null:(rr=!0,tr);case"textInput":return(e=t.data)===tr&&rr?null:e;default:return null}}(e,n):function(e,t){if(or)return"compositionend"===e||!Jn&&ar(e,t)?(e=Un(),Bn=Fn=zn=null,or=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return er&&"ko"!==t.locale?null:t.data;default:return null}}(e,n))?((t=Kn.getPooled(nr.beforeInput,t,n,r)).data=e,Pn(t)):t=null,null===a?t:null===t?a:[a,t]}},ur={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 cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!ur[e.type]:"textarea"===t}var lr={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function hr(e,t,n){return(e=Gn.getPooled(lr.change,e,t,n)).type="change",N(n),Pn(e),e}var dr=null,fr=null;function pr(e){st(e)}function mr(e){if(we(Cn(e)))return e}function vr(e,t){if("change"===e)return t}var gr=!1;function br(){dr&&(dr.detachEvent("onpropertychange",yr),fr=dr=null)}function yr(e){if("value"===e.propertyName&&mr(fr))if(e=hr(fr,e,ut(e)),z)st(e);else{z=!0;try{I(pr,e)}finally{z=!1,B()}}}function xr(e,t,n){"focus"===e?(br(),fr=n,(dr=t).attachEvent("onpropertychange",yr)):"blur"===e&&br()}function wr(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return mr(fr)}function Or(e,t){if("click"===e)return mr(t)}function kr(e,t){if("input"===e||"change"===e)return mr(t)}E&&(gr=ct("input")&&(!document.documentMode||9<document.documentMode));var Sr={eventTypes:lr,_isInputEventSupported:gr,extractEvents:function(e,t,n,r){var a=t?Cn(t):window,i=a.nodeName&&a.nodeName.toLowerCase();if("select"===i||"input"===i&&"file"===a.type)var o=vr;else if(cr(a))if(gr)o=kr;else{o=wr;var s=xr}else(i=a.nodeName)&&"input"===i.toLowerCase()&&("checkbox"===a.type||"radio"===a.type)&&(o=Or);if(o&&(o=o(e,t)))return hr(o,n,r);s&&s(e,a,t),"blur"===e&&(e=a._wrapperState)&&e.controlled&&"number"===a.type&&Ee(a,"number",a.value)}},_r=Gn.extend({view:null,detail:null}),jr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Er(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=jr[e])&&!!t[e]}function Tr(){return Er}var Cr=0,Mr=0,Ar=!1,Nr=!1,Rr=_r.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,
2shiftKey:null,altKey:null,metaKey:null,getModifierState:Tr,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if("movementX"in e)return e.movementX;var t=Cr;return Cr=e.screenX,Ar?"mousemove"===e.type?e.screenX-t:0:(Ar=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var t=Mr;return Mr=e.screenY,Nr?"mousemove"===e.type?e.screenY-t:0:(Nr=!0,0)}}),Ir=Rr.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),Lr={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},Dr={eventTypes:Lr,extractEvents:function(e,t,n,r,a){var i="mouseover"===e||"pointerover"===e,o="mouseout"===e||"pointerout"===e;if(i&&0===(32&a)&&(n.relatedTarget||n.fromElement)||!o&&!i)return null;(i=r.window===r?r:(i=r.ownerDocument)?i.defaultView||i.parentWindow:window,o)?(o=t,null!==(t=(t=n.relatedTarget||n.toElement)?En(t):null)&&(t!==$e(t)||5!==t.tag&&6!==t.tag)&&(t=null)):o=null;if(o===t)return null;if("mouseout"===e||"mouseover"===e)var s=Rr,u=Lr.mouseLeave,c=Lr.mouseEnter,l="mouse";else"pointerout"!==e&&"pointerover"!==e||(s=Ir,u=Lr.pointerLeave,c=Lr.pointerEnter,l="pointer");if(e=null==o?i:Cn(o),i=null==t?i:Cn(t),(u=s.getPooled(u,o,n,r)).type=l+"leave",u.target=e,u.relatedTarget=i,(n=s.getPooled(c,t,n,r)).type=l+"enter",n.target=i,n.relatedTarget=e,l=t,(r=o)&&l)e:{for(c=l,o=0,e=s=r;e;e=An(e))o++;for(e=0,t=c;t;t=An(t))e++;for(;0<o-e;)s=An(s),o--;for(;0<e-o;)c=An(c),e--;for(;o--;){if(s===c||s===c.alternate)break e;s=An(s),c=An(c)}s=null}else s=null;for(c=s,s=[];r&&r!==c&&(null===(o=r.alternate)||o!==c);)s.push(r),r=An(r);for(r=[];l&&l!==c&&(null===(o=l.alternate)||o!==c);)r.push(l),l=An(l);for(l=0;l<s.length;l++)Ln(s[l],"bubbled",u);for(l=r.length;0<l--;)Ln(r[l],"captured",n);return 0===(64&a)?[u]:[u,n]}};var Pr="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},zr=Object.prototype.hasOwnProperty;function Fr(e,t){if(Pr(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!zr.call(t,n[r])||!Pr(e[n[r]],t[n[r]]))return!1;return!0}var Br=E&&"documentMode"in document&&11>=document.documentMode,Ur={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Wr=null,Vr=null,Gr=null,Hr=!1;function qr(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return Hr||null==Wr||Wr!==ln(n)?null:("selectionStart"in(n=Wr)&&pn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},Gr&&Fr(Gr,n)?null:(Gr=n,(e=Gn.getPooled(Ur.select,Vr,e,t)).type="select",e.target=Wr,Pn(e),e))}var Xr={eventTypes:Ur,extractEvents:function(e,t,n,r,a,i){if(!(i=!(a=i||(r.window===r?r.document:9===r.nodeType?r:r.ownerDocument)))){e:{a=Qe(a),i=_.onSelect;for(var o=0;o<i.length;o++)if(!a.has(i[o])){a=!1;break e}a=!0}i=!a}if(i)return null;switch(a=t?Cn(t):window,e){case"focus":(cr(a)||"true"===a.contentEditable)&&(Wr=a,Vr=t,Gr=null);break;case"blur":Gr=Vr=Wr=null;break;case"mousedown":Hr=!0;break;case"contextmenu":case"mouseup":case"dragend":return Hr=!1,qr(n,r);case"selectionchange":if(Br)break;case"keydown":case"keyup":return qr(n,r)}return null}},Yr=Gn.extend({animationName:null,elapsedTime:null,pseudoElement:null}),Kr=Gn.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Zr=_r.extend({relatedTarget:null});function Jr(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}var Qr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$r={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"},ea=_r.extend({key:function(e){if(e.key){var t=Qr[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Jr(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"ke
2yup"===e.type?$r[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Tr,charCode:function(e){return"keypress"===e.type?Jr(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Jr(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),ta=Rr.extend({dataTransfer:null}),na=_r.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Tr}),ra=Gn.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),aa=Rr.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),ia={eventTypes:Pt,extractEvents:function(e,t,n,r){var a=zt.get(e);if(!a)return null;switch(e){case"keypress":if(0===Jr(n))return null;case"keydown":case"keyup":e=ea;break;case"blur":case"focus":e=Zr;break;case"click":if(2===n.button)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=Rr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=ta;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=na;break;case qe:case Xe:case Ye:e=Yr;break;case Ke:e=ra;break;case"scroll":e=_r;break;case"wheel":e=aa;break;case"copy":case"cut":case"paste":e=Kr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=Ir;break;default:e=Gn}return Pn(t=e.getPooled(a,t,n,r)),t}};if(b)throw Error(o(101));b=Array.prototype.slice.call("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),x(),p=Mn,m=Tn,v=Cn,j({SimpleEventPlugin:ia,EnterLeaveEventPlugin:Dr,ChangeEventPlugin:Sr,SelectEventPlugin:Xr,BeforeInputEventPlugin:sr});var oa=[],sa=-1;function ua(e){0>sa||(e.current=oa[sa],oa[sa]=null,sa--)}function ca(e,t){sa++,oa[sa]=e.current,e.current=t}var la={},ha={current:la},da={current:!1},fa=la;function pa(e,t){var n=e.type.contextTypes;if(!n)return la;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a,i={};for(a in n)i[a]=t[a];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ma(e){return null!==(e=e.childContextTypes)&&void 0!==e}function va(){ua(da),ua(ha)}function ga(e,t,n){if(ha.current!==la)throw Error(o(168));ca(ha,t),ca(da,n)}function ba(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in e))throw Error(o(108,ve(t)||"Unknown",i));return a({},n,{},r)}function ya(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||la,fa=ha.current,ca(ha,e),ca(da,da.current),!0}function xa(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=ba(e,t,fa),r.__reactInternalMemoizedMergedChildContext=e,ua(da),ua(ha),ca(ha,e)):ua(da),ca(da,n)}var wa=i.unstable_runWithPriority,Oa=i.unstable_scheduleCallback,ka=i.unstable_cancelCallback,Sa=i.unstable_requestPaint,_a=i.unstable_now,ja=i.unstable_getCurrentPriorityLevel,Ea=i.unstable_ImmediatePriority,Ta=i.unstable_UserBlockingPriority,Ca=i.unstable_NormalPriority,Ma=i.unstable_LowPriority,Aa=i.unstable_IdlePriority,Na={},Ra=i.unstable_shouldYield,Ia=void 0!==Sa?Sa:function(){},La=null,Da=null,Pa=!1,za=_a(),Fa=1e4>za?_a:function(){return _a()-za};function Ba(){switch(ja()){case Ea:return 99;case Ta:return 98;case Ca:return 97;case Ma:return 96;case Aa:return 95;default:throw Error(o(332))}}function Ua(e){switch(e){case 99:return Ea;case 98:return Ta;case 97:return Ca;case 96:return Ma;case 95:return Aa;default:throw Error(o(332))}}function Wa(e,t){return e=Ua(e),wa(e,t)}function Va(e,t,n){return e=Ua(e),Oa(e,t,n)}function Ga(e){return null===La?(La=[e],Da=Oa(Ea,qa)):La.push(e),Na}function Ha(){if(null!==Da){var e=Da;Da=null,ka(e)}qa()}function qa(){if(!Pa&&null!==La){Pa=!0;var e=0;try{var t=La;Wa(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),La=null}catch(n){throw null!==La&&(La=La.slice(e+1)),Oa(Ea,Ha),n}finally{Pa=!1}}}function Xa(e,t,n){return 1073741821-(1+((1073741821-e+t/10)/(n/=10)|0))*n}function Ya(e,t){if(e&&e.defaultProps)for(var n in t=a({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}var Ka={current:null},Za=null,Ja=null,Qa=null;function $a(){Qa=Ja=Za=null}function ei(e){var t=Ka.current;ua(Ka),e.type._context._currentValue=t}function ti(e,t){for(;null!==e;){var n=e.alternate;if(e.childExpirationTime<t)e.childExpirationTime=t,null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t);else{if(!(null!==n&&n.childExpirationTime<t))break;n.childExpirationTime=t}e=e.return}}
2function ni(e,t){Za=e,Qa=Ja=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(e.expirationTime>=t&&(Mo=!0),e.firstContext=null)}function ri(e,t){if(Qa!==e&&!1!==t&&0!==t)if("number"===typeof t&&1073741823!==t||(Qa=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Ja){if(null===Za)throw Error(o(308));Ja=t,Za.dependencies={expirationTime:0,firstContext:t,responders:null}}else Ja=Ja.next=t;return e._currentValue}var ai=!1;function ii(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function oi(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function si(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function ui(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function ci(e,t){var n=e.alternate;null!==n&&oi(n,e),null===(n=(e=e.updateQueue).baseQueue)?(e.baseQueue=t.next=t,t.next=t):(t.next=n.next,n.next=t)}function li(e,t,n,r){var i=e.updateQueue;ai=!1;var o=i.baseQueue,s=i.shared.pending;if(null!==s){if(null!==o){var u=o.next;o.next=s.next,s.next=u}o=s,i.shared.pending=null,null!==(u=e.alternate)&&(null!==(u=u.updateQueue)&&(u.baseQueue=s))}if(null!==o){u=o.next;var c=i.baseState,l=0,h=null,d=null,f=null;if(null!==u)for(var p=u;;){if((s=p.expirationTime)<r){var m={expirationTime:p.expirationTime,suspenseConfig:p.suspenseConfig,tag:p.tag,payload:p.payload,callback:p.callback,next:null};null===f?(d=f=m,h=c):f=f.next=m,s>l&&(l=s)}else{null!==f&&(f=f.next={expirationTime:1073741823,suspenseConfig:p.suspenseConfig,tag:p.tag,payload:p.payload,callback:p.callback,next:null}),iu(s,p.suspenseConfig);e:{var v=e,g=p;switch(s=t,m=n,g.tag){case 1:if("function"===typeof(v=g.payload)){c=v.call(m,c,s);break e}c=v;break e;case 3:v.effectTag=-4097&v.effectTag|64;case 0:if(null===(s="function"===typeof(v=g.payload)?v.call(m,c,s):v)||void 0===s)break e;c=a({},c,s);break e;case 2:ai=!0}}null!==p.callback&&(e.effectTag|=32,null===(s=i.effects)?i.effects=[p]:s.push(p))}if(null===(p=p.next)||p===u){if(null===(s=i.shared.pending))break;p=o.next=s.next,s.next=u,i.baseQueue=o=s,i.shared.pending=null}}null===f?h=c:f.next=d,i.baseState=h,i.baseQueue=f,ou(l),e.expirationTime=l,e.memoizedState=c}}function hi(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(null!==a){if(r.callback=null,r=a,a=n,"function"!==typeof r)throw Error(o(191,r));r.call(a)}}}var di=Z.ReactCurrentBatchConfig,fi=(new r.Component).refs;function pi(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:a({},t,n),e.memoizedState=n,0===e.expirationTime&&(e.updateQueue.baseState=n)}var mi={isMounted:function(e){return!!(e=e._reactInternalFiber)&&$e(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternalFiber;var r=qs(),a=di.suspense;(a=si(r=Xs(r,e,a),a)).payload=t,void 0!==n&&null!==n&&(a.callback=n),ui(e,a),Ys(e,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternalFiber;var r=qs(),a=di.suspense;(a=si(r=Xs(r,e,a),a)).tag=1,a.payload=t,void 0!==n&&null!==n&&(a.callback=n),ui(e,a),Ys(e,r)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var n=qs(),r=di.suspense;(r=si(n=Xs(n,e,r),r)).tag=2,void 0!==t&&null!==t&&(r.callback=t),ui(e,r),Ys(e,n)}};function vi(e,t,n,r,a,i,o){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,o):!t.prototype||!t.prototype.isPureReactComponent||(!Fr(n,r)||!Fr(a,i))}function gi(e,t,n){var r=!1,a=la,i=t.contextType;return"object"===typeof i&&null!==i?i=ri(i):(a=ma(t)?fa:ha.current,i=(r=null!==(r=t.contextTypes)&&void 0!==r)?pa(e,a):la),t=new t(n,i),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=mi,e.stateNode=t,t._reactInternalFiber=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function bi(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&mi.enqueueReplaceState(t,t.state,null)}function yi(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs=fi,ii(e);var i=t.contextType;"object"===typeof i&&null!==i?a.context=ri(i):(i=ma(t)?fa:ha.current,a.context=pa(e,i)),li(e,n,a,r),a.state=e.memoizedState,"function"===typeof(i=t.getDerivedStateFromProps)&&(pi(e,t,i,n),a.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof a.getSnapshotBeforeUpdate||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||(t=a.state,"function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),t!==a.state&&mi.enqueueReplaceState(a,a.state,null),li(e,n,a,r),a.state=e.memoizedState),"function"===typeof a.componentDidMount&&(e.effectTag|=4)}var xi=Array.isArray;function wi(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(o(309));var r=n.stateNode}if(!r)throw Error(o(147,e));var a=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===a?t.ref:((t=function(e){var t=r.refs;t===fi&&(t=r.refs={}),null===e?delete t[a]:t[a]=e})._stringRef=a,t)}if("string"!==typeof e)throw Error(o(284));if(!n._owner)throw Error(o(290,e))}return e}function Oi(e,t){if("textarea"!==e.type)throw Error(o(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,""))}function ki(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.effectTag=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function a(e,t){return(e=ju(e,t)).index=0,e.sibling=null,e}function i(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.effectTag=2,n):r:(t.effectTag=2,n):n}function s(t){return e&&null===t.alternate&&(t.effectTag=2),t}function u(e,t,n,r){return null===t||6!==t.tag?((t=Cu(n,e.mode,r)).return=e,t):((t=a(t,n)).return=e,t)}function c(e,t,n,r){return null!==t&&t.elementType===n.type?((r=a(t,n.props)).ref=wi(e,t,n),r.return=e,r):((r=Eu(n.type,n.key,n.props,null,e.mode,r)).ref=wi(e,t,n),r.return=e,r)}function l(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Mu(n,e.mode,r)).return=e,t):((t=a(t,n.children||[])).return=e,t)}function h(e,t,n,r,i){return null===t||7!==t.tag?((t=Tu(n,e.mode,r,i)).return=e,t):((t=a(t,n)).return=e,t)}function d(e,t,n){if("string"===typeof t||"number"===typeof t)return(t=Cu(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case ee:return(n=Eu(t.type,t.key,t.props,null,e.mode,n)).ref=wi(e,null,t),n.return=e,n;case te:return(t=Mu(t,e.mode,n)).return=e,t}if(xi(t)||me(t))return(t=Tu(t,e.mode,n,null)).return=e,t;Oi(e,t)}return null}function f(e,t,n,r){var a=null!==t?t.key:null;if("string"===typeof n||"number"===typeof n)return null!==a?null:u(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case ee:return n.key===a?n.type===ne?h(e,t,n.props.children,r,a):c(e,t,n,r):null;case te:return n.key===a?l(e,t,n,r):null}if(xi(n)||me(n))return null!==a?null:h(e,t,n,r,null);Oi(e,n)}return null}function p(e,t,n,r,a){if("string"===typeof r||"number"===typeof r)return u(t,e=e.get(n)||null,""+r,a);if("object"===typeof r&&null!==r){switch(r.$$typeof){case ee:return e=e.get(null===r.key?n:r.key)||null,r.type===ne?h(t,e,r.props.children,a,r.key):c(t,e,r,a);case te:return l(t,e=e.get(null===r.key?n:r.key)||null,r,a)}if(xi(r)||me(r))return h(t,e=e.get(n)||null,r,a,null);Oi(t,r)}return null}function m(a,o,s,u){for(var c=null,l=null,h=o,m=o=0,v=null;null!==h&&m<s.length;m++){h.index>m?(v=h,h=null):v=h.sibling;var g=f(a,h,s[m],u);
vendor: 12,063 bytes, line 2
2if(null===g){null===h&&(h=v);break}e&&h&&null===g.alternate&&t(a,h),o=i(g,o,m),null===l?c=g:l.sibling=g,l=g,h=v}if(m===s.length)return n(a,h),c;if(null===h){for(;m<s.length;m++)null!==(h=d(a,s[m],u))&&(o=i(h,o,m),null===l?c=h:l.sibling=h,l=h);return c}for(h=r(a,h);m<s.length;m++)null!==(v=p(h,a,m,s[m],u))&&(e&&null!==v.alternate&&h.delete(null===v.key?m:v.key),o=i(v,o,m),null===l?c=v:l.sibling=v,l=v);return e&&h.forEach((function(e){return t(a,e)})),c}function v(a,s,u,c){var l=me(u);if("function"!==typeof l)throw Error(o(150));if(null==(u=l.call(u)))throw Error(o(151));for(var h=l=null,m=s,v=s=0,g=null,b=u.next();null!==m&&!b.done;v++,b=u.next()){m.index>v?(g=m,m=null):g=m.sibling;var y=f(a,m,b.value,c);if(null===y){null===m&&(m=g);break}e&&m&&null===y.alternate&&t(a,m),s=i(y,s,v),null===h?l=y:h.sibling=y,h=y,m=g}if(b.done)return n(a,m),l;if(null===m){for(;!b.done;v++,b=u.next())null!==(b=d(a,b.value,c))&&(s=i(b,s,v),null===h?l=b:h.sibling=b,h=b);return l}for(m=r(a,m);!b.done;v++,b=u.next())null!==(b=p(m,a,v,b.value,c))&&(e&&null!==b.alternate&&m.delete(null===b.key?v:b.key),s=i(b,s,v),null===h?l=b:h.sibling=b,h=b);return e&&m.forEach((function(e){return t(a,e)})),l}return function(e,r,i,u){var c="object"===typeof i&&null!==i&&i.type===ne&&null===i.key;c&&(i=i.props.children);var l="object"===typeof i&&null!==i;if(l)switch(i.$$typeof){case ee:e:{for(l=i.key,c=r;null!==c;){if(c.key===l){switch(c.tag){case 7:if(i.type===ne){n(e,c.sibling),(r=a(c,i.props.children)).return=e,e=r;break e}break;default:if(c.elementType===i.type){n(e,c.sibling),(r=a(c,i.props)).ref=wi(e,c,i),r.return=e,e=r;break e}}n(e,c);break}t(e,c),c=c.sibling}i.type===ne?((r=Tu(i.props.children,e.mode,u,i.key)).return=e,e=r):((u=Eu(i.type,i.key,i.props,null,e.mode,u)).ref=wi(e,r,i),u.return=e,e=u)}return s(e);case te:e:{for(c=i.key;null!==r;){if(r.key===c){if(4===r.tag&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),(r=a(r,i.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Mu(i,e.mode,u)).return=e,e=r}return s(e)}if("string"===typeof i||"number"===typeof i)return i=""+i,null!==r&&6===r.tag?(n(e,r.sibling),(r=a(r,i)).return=e,e=r):(n(e,r),(r=Cu(i,e.mode,u)).return=e,e=r),s(e);if(xi(i))return m(e,r,i,u);if(me(i))return v(e,r,i,u);if(l&&Oi(e,i),"undefined"===typeof i&&!c)switch(e.tag){case 1:case 0:throw e=e.type,Error(o(152,e.displayName||e.name||"Component"))}return n(e,r)}}var Si=ki(!0),_i=ki(!1),ji={},Ei={current:ji},Ti={current:ji},Ci={current:ji};function Mi(e){if(e===ji)throw Error(o(174));return e}function Ai(e,t){switch(ca(Ci,t),ca(Ti,e),ca(Ei,ji),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Pe(null,"");break;default:t=Pe(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}ua(Ei),ca(Ei,t)}function Ni(){ua(Ei),ua(Ti),ua(Ci)}function Ri(e){Mi(Ci.current);var t=Mi(Ei.current),n=Pe(t,e.type);t!==n&&(ca(Ti,e),ca(Ei,n))}function Ii(e){Ti.current===e&&(ua(Ei),ua(Ti))}var Li={current:0};function Di(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Pi(e,t){return{responder:e,props:t}}var zi=Z.ReactCurrentDispatcher,Fi=Z.ReactCurrentBatchConfig,Bi=0,Ui=null,Wi=null,Vi=null,Gi=!1;function Hi(){throw Error(o(321))}function qi(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pr(e[n],t[n]))return!1;return!0}function Xi(e,t,n,r,a,i){if(Bi=i,Ui=t,t.memoizedState=null,t.updateQueue=null,t.expirationTime=0,zi.current=null===e||null===e.memoizedState?go:bo,e=n(r,a),t.expirationTime===Bi){i=0;do{if(t.expirationTime=0,!(25>i))throw Error(o(301));i+=1,Vi=Wi=null,t.updateQueue=null,zi.current=yo,e=n(r,a)}while(t.expirationTime===Bi)}if(zi.current=vo,t=null!==Wi&&null!==Wi.next,Bi=0,Vi=Wi=Ui=null,Gi=!1,t)throw Error(o(300));return e}function Yi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Vi?Ui.memoizedState=Vi=e:Vi=Vi.next=e,Vi}function Ki(){if(null===Wi){var e=Ui.alternate;e=null!==e?e.memoizedState:null}else e=Wi.next;var t=null===Vi?Ui.memoizedState:Vi.next;if(null!==t)Vi=t,Wi=e;else{if(null===e)throw Error(o(310));e={memoizedState:(Wi=e).memoizedState,baseState:Wi.baseState,baseQueue:Wi.baseQueue,queue:Wi.queue,next:null},null===Vi?Ui.memoizedState=Vi=e:Vi=Vi.next=e}return Vi}function Zi(e,t){return"function"===typeof t?t(e):t}function Ji(e){var t=Ki(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=Wi,a=r.baseQueue,i=n.pending;if(null!==i){if(null!==a){var s=a.next;a.next=i.next,i.next=s}r.baseQueue=a=i,n.pending=null}if(null!==a){a=a.next,r=r.baseState;var u=s=i=null,c=a;do{var l=c.expirationTime;if(l<Bi){var h={expirationTime:c.expirationTime,suspenseConfig:c.suspenseConfig,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===u?(s=u=h,i=r):u=u.next=h,l>Ui.expirationTime&&(Ui.expirationTime=l,ou(l))}else null!==u&&(u=u.next={expirationTime:1073741823,suspenseConfig:c.suspenseConfig,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),iu(l,c.suspenseConfig),r=c.eagerReducer===e?c.eagerState:e(r,c.action);c=c.next}while(null!==c&&c!==a);null===u?i=r:u.next=s,Pr(r,t.memoizedState)||(Mo=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=u,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function Qi(e){var t=Ki(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,i=t.memoizedState;if(null!==a){n.pending=null;var s=a=a.next;do{i=e(i,s.action),s=s.next}while(s!==a);Pr(i,t.memoizedState)||(Mo=!0),t.memoizedState=i,null===t.baseQueue&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function $i(e){var t=Yi();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:Zi,lastRenderedState:e}).dispatch=mo.bind(null,Ui,e),[t.memoizedState,e]}function eo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=Ui.updateQueue)?(t={lastEffect:null},Ui.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function to(){return Ki().memoizedState}function no(e,t,n,r){var a=Yi();Ui.effectTag|=e,a.memoizedState=eo(1|t,n,void 0,void 0===r?null:r)}function ro(e,t,n,r){var a=Ki();r=void 0===r?null:r;var i=void 0;if(null!==Wi){var o=Wi.memoizedState;if(i=o.destroy,null!==r&&qi(r,o.deps))return void eo(t,n,i,r)}Ui.effectTag|=e,a.memoizedState=eo(1|t,n,i,r)}function ao(e,t){return no(516,4,e,t)}function io(e,t){return ro(516,4,e,t)}function oo(e,t){return ro(4,2,e,t)}function so(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function uo(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,ro(4,2,so.bind(null,t,e),n)}function co(){}function lo(e,t){return Yi().memoizedState=[e,void 0===t?null:t],e}function ho(e,t){var n=Ki();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&qi(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function fo(e,t){var n=Ki();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&qi(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function po(e,t,n){var r=Ba();Wa(98>r?98:r,(function(){e(!0)})),Wa(97<r?97:r,(function(){var r=Fi.suspense;Fi.suspense=void 0===t?null:t;try{e(!1),n()}finally{Fi.suspense=r}}))}function mo(e,t,n){var r=qs(),a=di.suspense;a={expirationTime:r=Xs(r,e,a),suspenseConfig:a,action:n,eagerReducer:null,eagerState:null,next:null};var i=t.pending;if(null===i?a.next=a:(a.next=i.next,i.next=a),t.pending=a,i=e.alternate,e===Ui||null!==i&&i===Ui)Gi=!0,a.expirationTime=Bi,Ui.expirationTime=Bi;else{if(0===e.expirationTime&&(null===i||0===i.expirationTime)&&null!==(i=t.lastRenderedReducer))try{var o=t.lastRenderedState,s=i(o,n);if(a.eagerReducer=i,a.eagerState=s,Pr(s,o))return}catch(u){}Ys(e,r)}}var vo={readContext:ri,useCallback:Hi,useContext:Hi,useEffect:Hi,useImperativeHandle:Hi,useLayoutEffect:Hi,useMemo:Hi,useReducer:Hi,useRef:Hi,useState:Hi,useDebugValue:Hi,useResponder:Hi,useDeferredValue:Hi,useTransition:Hi},go={readContext:ri,useCallback:lo,useContext:ri,useEffect:ao,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,no(4,2,so.bind(null,t,e),n)},useLayoutEffect:function(e,t){return no(4,2,e,t)},useMemo:function(e,t){var n=Yi();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Yi();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=mo.bind(null,Ui,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Yi().memoizedState=e},useState:$i,useDebugValue:co,useResponder:Pi,useDeferredValue:function(e,t){var n=$i(e),r=n[0],a=n[1];return ao((function(){var n=Fi.suspense;Fi.suspense=void 0===t?null:t;try{a(e)}finally{Fi.suspense=n}}),[e,t]),r},useTransition:function(e){var t=$i(!1),n=t[0];return t=t[1],[lo(po.bind(null,t,e),[t,e]),n]}},bo={readContext:ri,useCallback:ho,useContext:ri,useEffect:io,useImperativeHandle:uo,useLayoutEffect:oo,useMemo:fo,useReducer:Ji,useRef:to,useState:function(){return Ji(Zi)},useDebugValue:co,useResponder:Pi,useDeferredValue:function(e,t){var n=Ji(Zi),r=n[0],a=n[1];return io((function(){var n=Fi.suspense;Fi.suspense=void 0===t?null:t;try{a(e)}finally{Fi.suspense=n}}),[e,t]),r},useTransition:function(e){var t=Ji(Zi),n=t[0];return t=t[1],[ho(po.bind(null,t,e),[t,e]),n]}},yo={readContext:ri,useCallback:ho,useContext:ri,useEffect:io,useImperativeHandle:uo,useLayoutEffect:oo,useMemo:fo,useReducer:Qi,useRef:to,useState:function(){return Qi(Zi)},useDebugValue:co,useResponder:Pi,useDeferredValue:function(e,t){var n=Qi(Zi),r=n[0],a=n[1];return io((function(){var n=Fi.suspense;Fi.suspense=void 0===t?null:t;try{a(e)}finally{Fi.suspense=n}}),[e,t]),r},useTransition:function(e){var t=Qi(Zi),n=t[0];return t=t[1],[ho(po.bind(null,t,e),[t,e]),n]}},xo=null,wo=null,Oo=!1;function ko(e,t){var n=Su(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function So(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);case 13:default:return!1}}function _o(e){if(Oo){var t=wo;if(t){var n=t;if(!So(e,t)){if(!(t=wn(n.nextSibling))||!So(e,t))return e.effectTag=-1025&e.effectTag|2,Oo=!1,void(xo=e);ko(xo,n)}xo=e,wo=wn(t.firstChild)}else e.effectTag=-1025&e.effectTag|2,Oo=!1,xo=e}}function jo(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;xo=e}function Eo(e){if(e!==xo)return!1;if(!Oo)return jo(e),Oo=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!bn(t,e.memoizedProps))for(t=wo;t;)ko(e,t),t=wn(t.nextSibling);if(jo(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){wo=wn(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}wo=null}}else wo=xo?wn(e.stateNode.nextSibling):null;return!0}function To(){wo=xo=null,Oo=!1}var Co=Z.ReactCurrentOwner,Mo=!1;function Ao(e,t,n,r){t.child=null===e?_i(t,null,n,r):Si(t,e.child,n,r)}function No(e,t,n,r,a){n=n.render;var i=t.ref;return ni(t,a),r=Xi(e,t,n,r,i,a),null===e||Mo?(t.effectTag|=1,Ao(e,t,r,a),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=a&&(e.expirationTime=0),Yo(e,t,a))}
2function Ro(e,t,n,r,a,i){if(null===e){var o=n.type;return"function"!==typeof o||_u(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Eu(n.type,null,r,null,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,Io(e,t,o,r,a,i))}return o=e.child,a<i&&(a=o.memoizedProps,(n=null!==(n=n.compare)?n:Fr)(a,r)&&e.ref===t.ref)?Yo(e,t,i):(t.effectTag|=1,(e=ju(o,r)).ref=t.ref,e.return=t,t.child=e)}function Io(e,t,n,r,a,i){return null!==e&&Fr(e.memoizedProps,r)&&e.ref===t.ref&&(Mo=!1,a<i)?(t.expirationTime=e.expirationTime,Yo(e,t,i)):Do(e,t,n,r,i)}function Lo(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function Do(e,t,n,r,a){var i=ma(n)?fa:ha.current;return i=pa(t,i),ni(t,a),n=Xi(e,t,n,r,i,a),null===e||Mo?(t.effectTag|=1,Ao(e,t,n,a),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=a&&(e.expirationTime=0),Yo(e,t,a))}function Po(e,t,n,r,a){if(ma(n)){var i=!0;ya(t)}else i=!1;if(ni(t,a),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),gi(t,n,r),yi(t,n,r,a),r=!0;else if(null===e){var o=t.stateNode,s=t.memoizedProps;o.props=s;var u=o.context,c=n.contextType;"object"===typeof c&&null!==c?c=ri(c):c=pa(t,c=ma(n)?fa:ha.current);var l=n.getDerivedStateFromProps,h="function"===typeof l||"function"===typeof o.getSnapshotBeforeUpdate;h||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(s!==r||u!==c)&&bi(t,o,r,c),ai=!1;var d=t.memoizedState;o.state=d,li(t,r,o,a),u=t.memoizedState,s!==r||d!==u||da.current||ai?("function"===typeof l&&(pi(t,n,l,r),u=t.memoizedState),(s=ai||vi(t,n,s,r,d,u,c))?(h||"function"!==typeof o.UNSAFE_componentWillMount&&"function"!==typeof o.componentWillMount||("function"===typeof o.componentWillMount&&o.componentWillMount(),"function"===typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"===typeof o.componentDidMount&&(t.effectTag|=4)):("function"===typeof o.componentDidMount&&(t.effectTag|=4),t.memoizedProps=r,t.memoizedState=u),o.props=r,o.state=u,o.context=c,r=s):("function"===typeof o.componentDidMount&&(t.effectTag|=4),r=!1)}else o=t.stateNode,oi(e,t),s=t.memoizedProps,o.props=t.type===t.elementType?s:Ya(t.type,s),u=o.context,"object"===typeof(c=n.contextType)&&null!==c?c=ri(c):c=pa(t,c=ma(n)?fa:ha.current),(h="function"===typeof(l=n.getDerivedStateFromProps)||"function"===typeof o.getSnapshotBeforeUpdate)||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(s!==r||u!==c)&&bi(t,o,r,c),ai=!1,u=t.memoizedState,o.state=u,li(t,r,o,a),d=t.memoizedState,s!==r||u!==d||da.current||ai?("function"===typeof l&&(pi(t,n,l,r),d=t.memoizedState),(l=ai||vi(t,n,s,r,u,d,c))?(h||"function"!==typeof o.UNSAFE_componentWillUpdate&&"function"!==typeof o.componentWillUpdate||("function"===typeof o.componentWillUpdate&&o.componentWillUpdate(r,d,c),"function"===typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,d,c)),"function"===typeof o.componentDidUpdate&&(t.effectTag|=4),"function"===typeof o.getSnapshotBeforeUpdate&&(t.effectTag|=256)):("function"!==typeof o.componentDidUpdate||s===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=4),"function"!==typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=256),t.memoizedProps=r,t.memoizedState=d),o.props=r,o.state=d,o.context=c,r=l):("function"!==typeof o.componentDidUpdate||s===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=4),"function"!==typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=256),r=!1);return zo(e,t,n,r,i,a)}function zo(e,t,n,r,a,i){Lo(e,t);var o=0!==(64&t.effectTag);if(!r&&!o)return a&&xa(t,n,!1),Yo(e,t,i);r=t.stateNode,Co.current=t;var s=o&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.effectTag|=1,null!==e&&o?(t.child=Si(t,e.child,null,i),t.child=Si(t,null,s,i)):Ao(e,t,s,i),t.memoizedState=r.state,a&&xa(t,n,!0),t.child}function Fo(e){var t=e.stateNode;t.pendingContext?ga(0,t.pendingContext,t.pendingContext!==t.context):t.context&&ga(0,t.context,!1),Ai(e,t.containerInfo)}var Bo,Uo,Wo,Vo={dehydrated:null,retryTime:0};function Go(e,t,n){var r,a=t.mode,i=t.pendingProps,o=Li.current,s=!1;if((r=0!==(64&t.effectTag))||(r=0!==(2&o)&&(null===e||null!==e.memoizedState)),r?(s=!0,t.effectTag&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(o|=1),ca(Li,1&o),null===e){if(void 0!==i.fallback&&_o(t),s){if
vendor: 4,572 bytes, line 2
2(s=i.fallback,(i=Tu(null,a,0,null)).return=t,0===(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,i.child=e;null!==e;)e.return=i,e=e.sibling;return(n=Tu(s,a,n,null)).return=t,i.sibling=n,t.memoizedState=Vo,t.child=i,n}return a=i.children,t.memoizedState=null,t.child=_i(t,null,a,n)}if(null!==e.memoizedState){if(a=(e=e.child).sibling,s){if(i=i.fallback,(n=ju(e,e.pendingProps)).return=t,0===(2&t.mode)&&(s=null!==t.memoizedState?t.child.child:t.child)!==e.child)for(n.child=s;null!==s;)s.return=n,s=s.sibling;return(a=ju(a,i)).return=t,n.sibling=a,n.childExpirationTime=0,t.memoizedState=Vo,t.child=n,a}return n=Si(t,e.child,i.children,n),t.memoizedState=null,t.child=n}if(e=e.child,s){if(s=i.fallback,(i=Tu(null,a,0,null)).return=t,i.child=e,null!==e&&(e.return=i),0===(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,i.child=e;null!==e;)e.return=i,e=e.sibling;return(n=Tu(s,a,n,null)).return=t,i.sibling=n,n.effectTag|=2,i.childExpirationTime=0,t.memoizedState=Vo,t.child=i,n}return t.memoizedState=null,t.child=Si(t,e,i.children,n)}function Ho(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t),ti(e.return,t)}function qo(e,t,n,r,a,i){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailExpiration:0,tailMode:a,lastEffect:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailExpiration=0,o.tailMode=a,o.lastEffect=i)}function Xo(e,t,n){var r=t.pendingProps,a=r.revealOrder,i=r.tail;if(Ao(e,t,r.children,n),0!==(2&(r=Li.current)))r=1&r|2,t.effectTag|=64;else{if(null!==e&&0!==(64&e.effectTag))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Ho(e,n);else if(19===e.tag)Ho(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ca(Li,r),0===(2&t.mode))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;null!==n;)null!==(e=n.alternate)&&null===Di(e)&&(a=n),n=n.sibling;null===(n=a)?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),qo(t,!1,a,n,i,t.lastEffect);break;case"backwards":for(n=null,a=t.child,t.child=null;null!==a;){if(null!==(e=a.alternate)&&null===Di(e)){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}qo(t,!0,n,null,i,t.lastEffect);break;case"together":qo(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function Yo(e,t,n){null!==e&&(t.dependencies=e.dependencies);var r=t.expirationTime;if(0!==r&&ou(r),t.childExpirationTime<n)return null;if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(n=ju(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=ju(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Ko(e,t){switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Zo(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return ma(t.type)&&va(),null;case 3:return Ni(),ua(da),ua(ha),(n=t.stateNode).pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||!Eo(t)||(t.effectTag|=4),null;case 5:Ii(t),n=Mi(Ci.current);var i=t.type;if(null!==e&&null!=t.stateNode)Uo(e,t,i,r,n),e.ref!==t.ref&&(t.effectTag|=128);else{if(!r){if(null===t.stateNode)throw Error(o(166));return null}if(e=Mi(Ei.current),Eo(t)){r=t.stateNode,i=t.type;var s=t.memoizedProps;switch(r[Sn]=t,r[_n]=s,i){case"iframe":case"object":case"embed":Xt("load",r);break;case"video":case"audio":for(e=0;e<Ze.length;e++)Xt(Ze[e],r);break;case"source":Xt("error",r);break;case"img":case"image":case"link":Xt("error",r),Xt("load",r);break;case"form":Xt("reset",r),Xt("submit",r);break;case"details":Xt("toggle",r);break;case"input":ke(r,s),Xt("invalid",r),un(n,"onChange");break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Xt("invalid",r),un(n,"onChange");break;case"textarea":Ae(r,s),Xt("invalid",r),un(n,"onChange")}for(var u in an(i,s),e=null,s)if(s.hasOwnProperty(u)){var c=s[u];"children"===u?"string"===typeof c?r.textContent!==c&&(e=["children",c]):"number"===typeof c&&r.textContent!==""+c&&(e=["children",""+c
2]):S.hasOwnProperty(u)&&null!=c&&un(n,u)}switch(i){case"input":xe(r),je(r,s,!0);break;case"textarea":xe(r),Re(r);break;case"select":case"option":break;default:"function"===typeof s.onClick&&(r.onclick=cn)}n=e,t.updateQueue=n,null!==n&&(t.effectTag|=4)}else{switch(u=9===n.nodeType?n:n.ownerDocument,e===sn&&(e=De(i)),e===sn?"script"===i?((e=u.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=u.createElement(i,{is:r.is}):(e=u.createElement(i),"select"===i&&(u=e,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):e=u.createElementNS(e,i),e[Sn]=t,e[_n]=r,Bo(e,t),t.stateNode=e,u=on(i,r),i){case"iframe":case"object":case"embed":Xt("load",e),c=r;break;case"video":case"audio":for(c=0;c<Ze.length;c++)Xt(Ze[c],e);c=r;break;case"source":Xt("error",e),c=r;break;case"img":case"image":case"link":Xt("error",e),Xt("load",e),c=r;break;case"form":Xt("reset",e),Xt("submit",e),c=r;break;case"details":Xt("toggle",e),c=r;break;case"input":ke(e,r),c=Oe(e,r),Xt("invalid",e),un(n,"onChange");break;case"option":c=Te(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},c=a({},r,{value:void 0}),Xt("invalid",e),un(n,"onChange");break;case"textarea":Ae(e,r),c=Me(e,r),Xt("invalid",e),un(n,"onChange");break;default:c=r}an(i,c);var l=c;for(s in l)if(l.hasOwnProperty(s)){var h=l[s];"style"===s?nn(e,h):"dangerouslySetInnerHTML"===s?null!=(h=h?h.__html:void 0)&&Fe(e,h):"children"===s?"string"===typeof h?("textarea"!==i||""!==h)&&Be(e,h):"number"===typeof h&&Be(e,""+h):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(S.hasOwnProperty(s)?null!=h&&un(n,s):null!=h&&J(e,s,h,u))}switch(i){case"input":xe(e),je(e,r,!1);break;case"textarea":xe(e),Re(e);break;case"option":null!=r.value&&e.setAttribute("value",""+be(r.value));break;case"select":e.multiple=!!r.multiple,null!=(n=r.value)?Ce(e,!!r.multiple,n,!1):null!=r.defaultValue&&Ce(e,!!r.multiple,r.defaultValue,!0);break;default:"function"===typeof c.onClick&&(e.onclick=cn)}gn(i,r)&&(t.effectTag|=4)}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)Wo(0,t,e.memoizedProps,r);else{if("string"!==typeof r&&null===t.stateNode)throw Error(o(166));n=Mi(Ci.current),Mi(Ei.current),Eo(t)?(n=t.stateNode,r=t.memoizedProps,n[Sn]=t,n.nodeValue!==r&&(t.effectTag|=4)):((n=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Sn]=t,t.stateNode=n)}return null;case 13:return ua(Li),r=t.memoizedState,0!==(64&t.effectTag)?(t.expirationTime=n,t):(n=null!==r,r=!1,null===e?void 0!==t.memoizedProps.fallback&&Eo(t):(r=null!==(i=e.memoizedState),n||null===i||null!==(i=e.child.sibling)&&(null!==(s=t.firstEffect)?(t.firstEffect=i,i.nextEffect=s):(t.firstEffect=t.lastEffect=i,i.nextEffect=null),i.effectTag=8)),n&&!r&&0!==(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!==(1&Li.current)?Es===xs&&(Es=ws):(Es!==xs&&Es!==ws||(Es=Os),0!==Ns&&null!==Ss&&(Ru(Ss,js),Iu(Ss,Ns)))),(n||r)&&(t.effectTag|=4),null);case 4:return Ni(),null;case 10:return ei(t),null;case 17:return ma(t.type)&&va(),null;case 19:if(ua(Li),null===(r=t.memoizedState))return null;if(i=0!==(64&t.effectTag),null===(s=r.rendering)){if(i)Ko(r,!1);else if(Es!==xs||null!==e&&0!==(64&e.effectTag))for(s=t.child;null!==s;){if(null!==(e=Di(s))){for(t.effectTag|=64,Ko(r,!1),null!==(i=e.updateQueue)&&(t.updateQueue=i,t.effectTag|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=t.child;null!==r;)s=n,(i=r).effectTag&=2,i.nextEffect=null,i.firstEffect=null,i.lastEffect=null,null===(e=i.alternate)?(i.childExpirationTime=0,i.expirationTime=s,i.child=null,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null):(i.childExpirationTime=e.childExpirationTime,i.expirationTime=e.expirationTime,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,s=e.dependencies,i.dependencies=null===s?null:{expirationTime:s.expirationTime,firstContext:s.firstContext,responders:s.responders}),r=r.sibling;return ca(Li,1&Li.current|2),t.child}s=s.sibling}}else{if(!i)if(null!==(e=Di(s))){if(t.effectTag|=64,i=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.effectTag|=4),Ko(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*Fa()-r.renderingStartTime>r.tailExpiration&&1<n&&(t.effectTag|=64,i=!0,Ko(r,!1),t.expirationTime=t.childExpirationTime=n-1);r.isBackwards?(s.sibling=t.child,t.child=s):(null!==(n=r.last)?n.sibling=s:t.child=s,r.last=s)}return null!==r.tail?(0===r.tailExpiration&&(r.tailExpiration=Fa()+500),n=r.tail,r.rendering=n,r.tail
vendor: 35,117 bytes, line 2
2=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=Fa(),n.sibling=null,t=Li.current,ca(Li,i?1&t|2:1&t),n):null}throw Error(o(156,t.tag))}function Jo(e){switch(e.tag){case 1:ma(e.type)&&va();var t=e.effectTag;return 4096&t?(e.effectTag=-4097&t|64,e):null;case 3:if(Ni(),ua(da),ua(ha),0!==(64&(t=e.effectTag)))throw Error(o(285));return e.effectTag=-4097&t|64,e;case 5:return Ii(e),null;case 13:return ua(Li),4096&(t=e.effectTag)?(e.effectTag=-4097&t|64,e):null;case 19:return ua(Li),null;case 4:return Ni(),null;case 10:return ei(e),null;default:return null}}function Qo(e,t){return{value:e,source:t,stack:ge(t)}}Bo=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Uo=function(e,t,n,r,i){var o=e.memoizedProps;if(o!==r){var s,u,c=t.stateNode;switch(Mi(Ei.current),e=null,n){case"input":o=Oe(c,o),r=Oe(c,r),e=[];break;case"option":o=Te(c,o),r=Te(c,r),e=[];break;case"select":o=a({},o,{value:void 0}),r=a({},r,{value:void 0}),e=[];break;case"textarea":o=Me(c,o),r=Me(c,r),e=[];break;default:"function"!==typeof o.onClick&&"function"===typeof r.onClick&&(c.onclick=cn)}for(s in an(n,r),n=null,o)if(!r.hasOwnProperty(s)&&o.hasOwnProperty(s)&&null!=o[s])if("style"===s)for(u in c=o[s])c.hasOwnProperty(u)&&(n||(n={}),n[u]="");else"dangerouslySetInnerHTML"!==s&&"children"!==s&&"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(S.hasOwnProperty(s)?e||(e=[]):(e=e||[]).push(s,null));for(s in r){var l=r[s];if(c=null!=o?o[s]:void 0,r.hasOwnProperty(s)&&l!==c&&(null!=l||null!=c))if("style"===s)if(c){for(u in c)!c.hasOwnProperty(u)||l&&l.hasOwnProperty(u)||(n||(n={}),n[u]="");for(u in l)l.hasOwnProperty(u)&&c[u]!==l[u]&&(n||(n={}),n[u]=l[u])}else n||(e||(e=[]),e.push(s,n)),n=l;else"dangerouslySetInnerHTML"===s?(l=l?l.__html:void 0,c=c?c.__html:void 0,null!=l&&c!==l&&(e=e||[]).push(s,l)):"children"===s?c===l||"string"!==typeof l&&"number"!==typeof l||(e=e||[]).push(s,""+l):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&(S.hasOwnProperty(s)?(null!=l&&un(i,s),e||c===l||(e=[])):(e=e||[]).push(s,l))}n&&(e=e||[]).push("style",n),i=e,(t.updateQueue=i)&&(t.effectTag|=4)}},Wo=function(e,t,n,r){n!==r&&(t.effectTag|=4)};var $o="function"===typeof WeakSet?WeakSet:Set;function es(e,t){var n=t.source,r=t.stack;null===r&&null!==n&&(r=ge(n)),null!==n&&ve(n.type),t=t.value,null!==e&&1===e.tag&&ve(e.type);try{console.error(t)}catch(a){setTimeout((function(){throw a}))}}function ts(e){var t=e.ref;if(null!==t)if("function"===typeof t)try{t(null)}catch(n){bu(e,n)}else t.current=null}function ns(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(256&t.effectTag&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Ya(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:case 5:case 6:case 4:case 17:return}throw Error(o(163))}function rs(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.destroy;n.destroy=void 0,void 0!==r&&r()}n=n.next}while(n!==t)}}function as(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function is(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:return void as(3,n);case 1:if(e=n.stateNode,4&n.effectTag)if(null===t)e.componentDidMount();else{var r=n.elementType===n.type?t.memoizedProps:Ya(n.type,t.memoizedProps);e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate)}return void(null!==(t=n.updateQueue)&&hi(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}hi(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.effectTag&&gn(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&Dt(n)))));case 19:case 17:case 20:case 21:return}throw Error(o(163))}function os(e,t,n){switch("function"===typeof Ou&&Ou(t),t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var r=e.next;Wa(97<n?97:n,(function(){var e=r;do{var n=e.destroy;if(void 0!==n){var a=t;try{n()}catch(i){bu(a,i)}}e=e.next}while(e!==r)}))}break;case 1:ts(t),"function"===typeof(n=t.stateNode).componentWillUnmount&&function(e,t){try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(n){bu(e,n)}}(t,n);break;case 5:ts(t);break;case 4:ls(e,t,n)}}function ss(e){var t=e.alternate;e.return=null,e.child=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.alternate=null,e.firstEffect=null,e.lastEffect=null,e.pendingProps=null,e.memoizedProps=null,e.stateNode=null,null!==t&&ss(t)}function us(e){return 5===e.tag||3===e.tag||4===e.tag}function cs(e){e:{for(var t=e.return;null!==t;){if(us(t)){var n=t;break e}t=t.return}throw Error(o(160))}switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(o(161))}16&n.effectTag&&(Be(t,""),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||us(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}r?function e(t,n,r){var a=t.tag,i=5===a||6===a;if(i)t=i?t.stateNode:t.stateNode.instance,n?8===r.nodeType?r.parentNode.insertBefore(t,n):r.insertBefore(t,n):(8===r.nodeType?(n=r.parentNode).insertBefore(t,r):(n=r).appendChild(t),null!==(r=r._reactRootContainer)&&void 0!==r||null!==n.onclick||(n.onclick=cn));else if(4!==a&&null!==(t=t.child))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,n,t):function e(t,n,r){var a=t.tag,i=5===a||6===a;if(i)t=i?t.stateNode:t.stateNode.instance,n?r.insertBefore(t,n):r.appendChild(t);else if(4!==a&&null!==(t=t.child))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,n,t)}function ls(e,t,n){for(var r,a,i=t,s=!1;;){if(!s){s=i.return;e:for(;;){if(null===s)throw Error(o(160));switch(r=s.stateNode,s.tag){case 5:a=!1;break e;case 3:case 4:r=r.containerInfo,a=!0;break e}s=s.return}s=!0}if(5===i.tag||6===i.tag){e:for(var u=e,c=i,l=n,h=c;;)if(os(u,h,l),null!==h.child&&4!==h.tag)h.child.return=h,h=h.child;else{if(h===c)break e;for(;null===h.sibling;){if(null===h.return||h.return===c)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}a?(u=r,c=i.stateNode,8===u.nodeType?u.parentNode.removeChild(c):u.removeChild(c)):r.removeChild(i.stateNode)}else if(4===i.tag){if(null!==i.child){r=i.stateNode.containerInfo,a=!0,i.child.return=i,i=i.child;continue}}else if(os(e,i,n),null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;4===(i=i.return).tag&&(s=!1)}i.sibling.return=i.return,i=i.sibling}}function hs(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:return void rs(3,t);case 1:return;case 5:var n=t.stateNode;if(null!=n){var r=t.memoizedProps,a=null!==e?e.memoizedProps:r;e=t.type;var i=t.updateQueue;if(t.updateQueue=null,null!==i){for(n[_n]=r,"input"===e&&"radio"===r.type&&null!=r.name&&Se(n,r),on(e,a),t=on(e,r),a=0;a<i.length;a+=2){var s=i[a],u=i[a+1];"style"===s?nn(n,u):"dangerouslySetInnerHTML"===s?Fe(n,u):"children"===s?Be(n,u):J(n,s,u,t)}switch(e){case"input":_e(n,r);break;case"textarea":Ne(n,r);break;case"select":t=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(e=r.value)?Ce(n,!!r.multiple,e,!1):t!==!!r.multiple&&(null!=r.defaultValue?Ce(n,!!r.multiple,r.defaultValue,!0):Ce(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(o(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((t=t.stateNode).hydrate&&(t.hydrate=!1,Dt(t.containerInfo)));case 12:return;case 13:if(n=t,null===t.memoizedState?r=!1:(r=!0,n=t.child,Is=Fa()),null!==n)e:for(e=n;;){if(5===e.tag)i=e.stateNode,r?"function"===typeof(i=i.style).setProperty?i.setProperty("display","none","important"):i.display="none":(i=e.stateNode,a=void 0!==(a=e.memoizedProps.style)&&null!==a&&a.hasOwnProperty("display")?a.display:null,i.style.display=tn("display",a));else if(6===e.tag)e.stateNode.nodeValue=r?"":e.memoizedProps;else{if(13===e.tag&&null!==e.memoizedState&&null===e.memoizedState.dehydrated){(i=e.child.sibling).return=e,e=i;continue}if(null!==e.child){e.child.return=e,e=e.child;continue}}if(e===n)break;for(;null===e.sibling;){if(null===e.return||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}return void ds(t);case 19:return void ds(t);case 17:return}throw Error(o(163))}function ds(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new $o),t.forEach((function(t){var r=xu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}var fs="function"===typeof WeakMap?WeakMap:Map;function ps(e,t,n){(n=si(n,null)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ds||(Ds=!0,Ps=r),es(e,t)},n}function ms(e,t,n){(n=si(n,null)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var a=t.value;n.payload=function(){return es(e,t),r(a)}}var i=e.stateNode;return null!==i&&"function"===typeof i.componentDidCatch&&(n.callback=function(){"function"!==typeof r&&(null===zs?zs=new Set([this]):zs.add(this),es(e,t));var n=t.stack;this.componentDidCatch(t.value,{componentStack:null!==n?n:""})}),n}var vs,gs=Math.ceil,bs=Z.ReactCurrentDispatcher,ys=Z.ReactCurrentOwner,xs=0,ws=3,Os=4,ks=0,Ss=null,_s=null,js=0,Es=xs,Ts=null,Cs=1073741823,Ms=1073741823,As=null,Ns=0,Rs=!1,Is=0,Ls=null,Ds=!1,Ps=null,zs=null,Fs=!1,Bs=null,Us=90,Ws=null,Vs=0,Gs=null,Hs=0;function qs(){return 0!==(48&ks)?1073741821-(Fa()/10|0):0!==Hs?Hs:Hs=1073741821-(Fa()/10|0)}function Xs(e,t,n){if(0===(2&(t=t.mode)))return 1073741823;var r=Ba();if(0===(4&t))return 99===r?1073741823:1073741822;if(0!==(16&ks))return js;if(null!==n)e=Xa(e,0|n.timeoutMs||5e3,250);else switch(r){case 99:e=1073741823;break;case 98:e=Xa(e,150,100);break;case 97:case 96:e=Xa(e,5e3,250);break;case 95:e=2;break;default:throw Error(o(326))}return null!==Ss&&e===js&&--e,e}function Ys(e,t){if(50<Vs)throw Vs=0,Gs=null,Error(o(185));if(null!==(e=Ks(e,t))){var n=Ba();1073741823===t?0!==(8&ks)&&0===(48&ks)?$s(e):(Js(e),0===ks&&Ha()):Js(e),0===(4&ks)||98!==n&&99!==n||(null===Ws?Ws=new Map([[e,t]]):(void 0===(n=Ws.get(e))||n>t)&&Ws.set(e,t))}}function Ks(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t);var r=e.return,a=null;if(null===r&&3===e.tag)a=e.stateNode;else for(;null!==r;){if(n=r.alternate,r.childExpirationTime<t&&(r.childExpirationTime=t),null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t),null===r.return&&3===r.tag){a=r.stateNode;break}r=r.return}return null!==a&&(Ss===a&&(ou(t),Es===Os&&Ru(a,js)),Iu(a,t)),a}function Zs(e){var t=e.lastExpiredTime;if(0!==t)return t;if(!Nu(e,t=e.firstPendingTime))return t;var n=e.lastPingedTime;return 2>=(e=n>(e=e.nextKnownPendingLevel)?n:e)&&t!==e?0:e}function Js(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=Ga($s.bind(null,e));else{var t=Zs(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=qs();if(1073741823===t?r=99:1===t||2===t?r=95:r=0>=(r=10*(1073741821-t)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var a=e.callbackPriority;if(e.callbackExpirationTime===t&&a>=r)return;n!==Na&&ka(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?Ga($s.bind(null,e)):Va(r,Qs.bind(null,e),{timeout:10*(1073741821-t)-Fa()}),e.callbackNode=t}}}function Qs(e,t){if(Hs=0,t)return Lu(e,t=qs()),Js(e),null;var n=Zs(e);if(0!==n){if(t=e.callbackNode,0!==(48&ks))throw Error(o(327));if(mu(),e===Ss&&n===js||nu(e,n),null!==_s){var r=ks;ks|=16;for(var a=au();;)try{uu();break}catch(u){ru(e,u)}if($a(),ks=r,bs.current=a,1===Es)throw t=Ts,nu(e,n),Ru(e,n),Js(e),t;if(null===_s)switch(a=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,r=Es,Ss=null,r){case xs:case 1:throw Error(o(345));case 2:Lu(e,2<n?2:n);break;case ws:if(Ru(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=hu(a)),1073741823===Cs&&10<(a=Is+500-Fa())){if(Rs){var i=e.lastPingedTime;if(0===i||i>=n){e.lastPingedTime=n,nu(e,n);break}}if(0!==(i=Zs(e))&&i!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}e.timeoutHandle=yn(du.bind(null,e),a);break}du(e);break;case Os:if(Ru(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=hu(a)),Rs&&(0===(a=e.lastPingedTime)||a>=n)){e.lastPingedTime=n,nu(e,n);break}if(0!==(a=Zs(e))&&a!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}if(1073741823!==Ms?r=10*(1073741821-Ms)-Fa():1073741823===Cs?r=0:(r=10*(1073741821-Cs)-5e3,0>(r=(a=Fa())-r)&&(r=0),(n=10*(1073741821-n)-a)<(r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*gs(r/1960))-r)&&(r=n)),10<r){e.timeoutHandle=yn(du.bind(null,e),r);break}du(e);break;case 5:if(1073741823!==Cs&&null!==As){i=Cs;var s=As;if(0>=(r=0|s.busyMinDurationMs)?r=0:(a=0|s.busyDelayMs,r=(i=Fa()-(10*(1073741821-i)-(0|s.timeoutMs||5e3)))<=a?0:a+r-i),10<r){Ru(e,n),e.timeoutHandle=yn(du.bind(null,e),r);break}}du(e);break;default:throw Error(o(329))}if(Js(e),e.callbackNode===t)return Qs.bind(null,e)}}return null}function $s(e){var t=e.lastExpiredTime;if(t=0!==t?t:1073741823,0!==(48&ks))throw Error(o(327));if(mu(),e===Ss&&t===js||nu(e,t),null!==_s){var n=ks;ks|=16;for(var r=au();;)try{su();break}catch(a){ru(e,a)}if($a(),ks=n,bs.current=r,1===Es)throw n=Ts,nu(e,t),Ru(e,t),Js(e),n;if(null!==_s)throw Error(o(261));e.finishedWork=e.current.alternate,e.finishedExpirationTime=t,Ss=null,du(e),Js(e)}return null}function eu(e,t){var n=ks;ks|=1;try{return e(t)}finally{0===(ks=n)&&Ha()}}function tu(e,t){var n=ks;ks&=-2,ks|=8;try{return e(t)}finally{0===(ks=n)&&Ha()}}function nu(e,t){e.finishedWork=null,e.finishedExpirationTime=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,xn(n)),null!==_s)for(n=_s.return;null!==n;){var r=n;switch(r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&va();break;case 3:Ni(),ua(da),ua(ha);break;case 5:Ii(r);break;case 4:Ni();break;case 13:case 19:ua(Li);break;case 10:ei(r)}n=n.return}Ss=e,_s=ju(e.current,null),js=t,Es=xs,Ts=null,Ms=Cs=1073741823,As=null,Ns=0,Rs=!1}function ru(e,t){for(;;){try{if($a(),zi.current=vo,Gi)for(var n=Ui.memoizedState;null!==n;){var r=n.queue;null!==r&&(r.pending=null),n=n.next}if(Bi=0,Vi=Wi=Ui=null,Gi=!1,null===_s||null===_s.return)return Es=1,Ts=t,_s=null;e:{var a=e,i=_s.return,o=_s,s=t;if(t=js,o.effectTag|=2048,o.firstEffect=o.lastEffect=null,null!==s&&"object"===typeof s&&"function"===typeof s.then){var u=s;if(0===(2&o.mode)){var c=o.alternate;c?(o.updateQueue=c.updateQueue,o.memoizedState=c.memoizedState,o.expirationTime=c.expirationTime):(o.updateQueue=null,o.memoizedState=null)}var l=0!==(1&Li.current),h=i;do{var d;if(d=13===h.tag){var f=h.memoizedState;if(null!==f)d=null!==f.dehydrated;else{var p=h.memoizedProps;d=void 0!==p.fallback&&(!0!==p.unstable_avoidThisFallback||!l)}}if(d){var m=h.updateQueue;if(null===m){var v=new Set;v.add(u),h.updateQueue=v}else m.add(u);if(0===(2&h.mode)){if(h.effectTag|=64,o.effectTag&=-2981,1===o.tag)if(null===o.alternate)o.tag=17;else{var g=si(1073741823,null);g.tag=2,ui(o,g)}o.expirationTime=1073741823;break e}s=void 0,o=t;var b=a.pingCache;if(null===b?(b=a.pingCache=new fs,s=new Set,b.set(u,s)):void 0===(s=b.get(u))&&(s=new Set,b.set(u,s)),!s.has(o)){s.add(o);var y=yu.bind(null,a,u,o);u.then(y,y)}h.effectTag|=4096,h.expirationTime=t;break e}h=h.return}while(null!==h);s=Error((ve(o.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+ge(o))}5!==Es&&(Es=2),s=Qo(s,o),h=i;do{switch(h.tag){case 3:u=s,h.effectTag|=4096,h.expirationTime=t,ci(h,ps(h,u,t));break e;case 1:u=s;var x=h.type,w=h.stateNode;if(0===(64&h.effectTag)&&("function"===typeof x.getDerivedStateFromError||null!==w&&"function"===typeof w.componentDidCatch&&(null===zs||!zs.has(w)))){h.effectTag|=4096,h.expirationTime=t,ci(h,ms(h,u,t));break e}}h=h.return}while(null!==h)}_s=lu(_s)}catch(O){t=O;continue}break}}function au(){var e=bs.current;return bs.current=vo,null===e?vo:e}function iu(e,t){e<Cs&&2<e&&(Cs=e),null!==t&&e<Ms&&2<e&&(Ms=e,As=t)}function ou(e){e>Ns&&(Ns=e)}function su(){for(;null!==_s;)_s=cu(_s)}function uu(){for(;null!==_s&&!Ra();)_s=cu(_s)}function cu(e){var t=vs(e.alternate,e,js);return e.memoizedProps=e.pendingProps,null===t&&(t=lu(e)),ys.current=null,t}function lu(e){_s=e;do{var t=_s.alternate;if(e=_s.return,0===(2048&_s.effectTag)){if(t=Zo(t,_s,js),1===js||1!==_s.childExpirationTime){for(var n=0,r=_s.child;null!==r;){var a=r.expirationTime,i=r.childExpirationTime;a>n&&(n=a),i>n&&(n=i),r=r.sibling}_s.childExpirationTime=n}if(null!==t)return t;null!==e&&0===(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=_s.firstEffect),null!==_s.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=_s.firstEffect),e.lastEffect=_s.lastEffect),1<_s.effectTag&&(null!==e.lastEffect?e.lastEffect.nextEffect=_s:e.firstEffect=_s,e.lastEffect=_s))}else{if(null!==(t=Jo(_s)))return t.effectTag&=2047,t;null!==e&&(e.firstEffect=e.lastEffect=null,e.effectTag|=2048)}if(null!==(t=_s.sibling))return t;_s=e}while(null!==_s);return Es===xs&&(Es=5),null}function hu(e){var t=e.expirationTime;return t>(e=e.childExpirationTime)?t:e}function du(e){var t=Ba();return Wa(99,fu.bind(null,e,t)),null}function fu(e,t){do{mu()}while(null!==Bs);if(0!==(48&ks))throw Error(o(327));var n=e.finishedWork,r=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw Error(o(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var a=hu(n);if(e.firstPendingTime=a,r<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:r<=e.firstSuspendedTime&&(e.firstSuspendedTime=r-1),r<=e.lastPingedTime&&(e.lastPingedTime=0),r<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===Ss&&(_s=Ss=null,js=0),1<n.effectTag?null!==n.lastEffect?(n.lastEffect.nextEffect=n,a=n.firstEffect):a=n:a=n.firstEffect,null!==a){var i=ks;ks|=32,ys.current=null,mn=qt;var s=fn();if(pn(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else e:{var c=(u=(u=s.ownerDocument)&&u.defaultView||window).getSelection&&u.getSelection();if(c&&0!==c.rangeCount){u=c.anchorNode;var l=c.anchorOffset,h=c.focusNode;c=c.focusOffset;try{u.nodeType,h.nodeType}catch(j){u=null;break e}var d=0,f=-1,p=-1,m=0,v=0,g=s,b=null;t:for(;;){for(var y;g!==u||0!==l&&3!==g.nodeType||(f=d+l),g!==h||0!==c&&3!==g.nodeType||(p=d+c),3===g.nodeType&&(d+=g.nodeValue.length),null!==(y=g.firstChild);)b=g,g=y;for(;;){if(g===s)break t;if(b===u&&++m===l&&(f=d),b===h&&++v===c&&(p=d),null!==(y=g.nextSibling))break;b=(g=b).parentNode}g=y}u=-1===f||-1===p?null:{start:f,end:p}}else u=null}u=u||{start:0,end:0}}else u=null;vn={activeElementDetached:null,focusedElem:s,selectionRange:u},qt=!1,Ls=a;do{try{pu()}catch(j){if(null===Ls)throw Error(o(330));bu(Ls,j),Ls=Ls.nextEffect}}while(null!==Ls);Ls=a;do{try{for(s=e,u=t;null!==Ls;){var x=Ls.effectTag;if(16&x&&Be(Ls.stateNode,""),128&x){var w=Ls.alternate;if(null!==w){var O=w.ref;null!==O&&("function"===typeof O?O(null):O.current=null)}}switch(1038&x){case 2:cs(Ls),Ls.effectTag&=-3;break;case 6:cs(Ls),Ls.effectTag&=-3,hs(Ls.alternate,Ls);break;case 1024:Ls.effectTag&=-1025;break;case 1028:Ls.effectTag&=-1025,hs(Ls.alternate,Ls);break;case 4:hs(Ls.alternate,Ls);break;case 8:ls(s,l=Ls,u),ss(l)}Ls=Ls.nextEffect}}catch(j){if(null===Ls)throw Error(o(330));bu(Ls,j),Ls=Ls.nextEffect}}while(null!==Ls);if(O=vn,w=fn(),x=O.focusedElem,u=O.selectionRange,w!==x&&x&&x.ownerDocument&&function e(t,n){return!(!t||!n)&&(t===n||(!t||3!==t.nodeType)&&(n&&3===n.nodeType?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}(x.ownerDocument.documentElement,x)){null!==u&&pn(x)&&(w=u.start,void 0===(O=u.end)&&(O=w),"selectionStart"in x?(x.selectionStart=w,x.selectionEnd=Math.min(O,x.value.length)):(O=(w=x.ownerDocument||document)&&w.defaultView||window).getSelection&&(O=O.getSelection(),l=x.textContent.length,s=Math.min(u.start,l),u=void 0===u.end?s:Math.min(u.end,l),!O.extend&&s>u&&(l=u,u=s,s=l),l=dn(x,s),h=dn(x,u),l&&h&&(1!==O.rangeCount||O.anchorNode!==l.node||O.anchorOffset!==l.offset||O.focusNode!==h.node||O.focusOffset!==h.offset)&&((w=w.createRange()).setStart(l.node,l.offset),O.removeAllRanges(),s>u?(O.addRange(w),O.extend(h.node,h.offset)):(w.setEnd(h.node,h.offset),O.addRange(w))))),w=[];for(O=x;O=O.parentNode;)1===O.nodeType&&w.push({element:O,left:O.scrollLeft,top:O.scrollTop});for("function"===typeof x.focus&&x.focus(),x=0;x<w.length;x++)(O=w[x]).element.scrollLeft=O.left,O.element.scrollTop=O.top}qt=!!mn,vn=mn=null,e.current=n,Ls=a;do{try{for(x=e;null!==Ls;){var k=Ls.effectTag;if(36&k&&is(x,Ls.alternate,Ls),128&k){w=void 0;var S=Ls.ref;if(null!==S){var _=Ls.stateNode;switch(Ls.tag){case 5:w=_;break;default:w=_}"function"===typeof S?S(w):S.current=w}}Ls=Ls.nextEffect}}catch(j){if(null===Ls)throw Error(o(330));bu(Ls,j),Ls=Ls.nextEffect}}while(null!==Ls);Ls=null,Ia(),ks=i}else e.current=n;if(Fs)Fs=!1,Bs=e,Us=t;else for(Ls=a;null!==Ls;)t=Ls.nextEffect,Ls.nextEffect=null,Ls=t;if(0===(t=e.firstPendingTime)&&(zs=null),1073741823===t?e===Gs?Vs++:(Vs=0,Gs=e):Vs=0,"function"===typeof wu&&wu(n.stateNode,r),Js(e),Ds)throw Ds=!1,e=Ps,Ps=null,e;return 0!==(8&ks)||Ha(),null}function pu(){for(;null!==Ls;){var e=Ls.effectTag;0!==(256&e)&&ns(Ls.alternate,Ls),0===(512&e)||Fs||(Fs=!0,Va(97,(function(){return mu(),null}))),Ls=Ls.nextEffect}}function mu(){if(90!==Us){var e=97<Us?97:Us;return Us=90,Wa(e,vu)}}function vu(){if(null===Bs)return!1;var e=Bs;if(Bs=null,0!==(48&ks))throw Error(o(331));var t=ks;for(ks|=32,e=e.current.firstEffect;null!==e;){try{var n=e;if(0!==(512&n.effectTag))switch(n.tag){case 0:case 11:case 15:case 22:rs(5,n),as(5,n)}}catch(r){if(null===e)throw Error(o(330));bu(e,r)}n=e.nextEffect,e.nextEffect=null,e=n}return ks=t,Ha(),!0}function gu(e,t,n){ui(e,t=ps(e,t=Qo(n,t),1073741823)),null!==(e=Ks(e,1073741823))&&Js(e)}function bu(e,t){if(3===e.tag)gu(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){gu(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"===typeof n.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===zs||!zs.has(r))){ui(n,e=ms(n,e=Qo(t,e),1073741823)),null!==(n=Ks(n,1073741823))&&Js(n);break}}n=n.return}}function yu(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),Ss===e&&js===n?Es===Os||Es===ws&&1073741823===Cs&&Fa()-Is<500?nu(e,js):Rs=!0:Nu(e,n)&&(0!==(t=e.lastPingedTime)&&t<n||(e.lastPingedTime=n,Js(e)))}function xu(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(t=Xs(t=qs(),e,null)),null!==(e=Ks(e,t))&&Js(e)}vs=function(e,t,n){var r=t.expirationTime;if(null!==e){var a=t.pendingProps;if(e.memoizedProps!==a||da.current)Mo=!0;else{if(r<n){switch(Mo=!1,t.tag){case 3:Fo(t),To();break;case 5:if(Ri(t),4&t.mode&&1!==n&&a.hidden)return t.expirationTime=t.childExpirationTime=1,null;break;case 1:ma(t.type)&&ya(t);break;case 4:Ai(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value,a=t.type._context,ca(Ka,a._currentValue),a._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!==(r=t.child.childExpirationTime)&&r>=n?Go(e,t,n):(ca(Li,1&Li.current),null!==(t=Yo(e,t,n))?t.sibling:null);ca(Li,1&Li.current);break;case 19:if(r=t.childExpirationTime>=n,0!==(64&e.effectTag)){if(r)return Xo(e,t,n);t.effectTag|=64}if(null!==(a=t.memoizedState)&&(a.rendering=null,a.tail=null),ca(Li,Li.current),!r)return null}return Yo(e,t,n)}Mo=!1}}else Mo=!1;switch(t.expirationTime=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,a=pa(t,ha.current),ni(t,n),a=Xi(null,t,r,e,a,n),t.effectTag|=1,"object"===typeof a&&null!==a&&"function"===typeof a.render&&void 0===a.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,ma(r)){var i=!0;ya(t)}else i=!1;t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,ii(t);var s=r.getDerivedStateFromProps;"function"===typeof s&&pi(t,r,s,e),a.updater=mi,t.stateNode=a,a._reactInternalFiber=t,yi(t,r,e,n),t=zo(null,t,r,!0,i,n)}else t.tag=0,Ao(null,t,a,n),t=t.child;return t;case 16:e:{if(a=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}(a),1!==a._status)throw a._result;switch(a=a._result,t.type=a,i=t.tag=function(e){if("function"===typeof e)return _u(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===ue)return 11;if(e===he)return 14}return 2}(a),e=Ya(a,e),i){case 0:t=Do(null,t,a,e,n);break e;case 1:t=Po(null,t,a,e,n);break e;case 11:t=No(null,t,a,e,n);break e;case 14:t=Ro(null,t,a,Ya(a.type,e),r,n);break e}throw Error(o(306,a,""))}return t;case 0:return r=t.type,a=t.pendingProps,Do(e,t,r,a=t.elementType===r?a:Ya(r,a),n);case 1:return r=t.type,a=t.pendingProps,Po(e,t,r,a=t.elementType===r?a:Ya(r,a),n);case 3:if(Fo(t),r=t.updateQueue,null===e||null===r)throw Error(o(282));if(r=t.pendingProps,a=null!==(a=t.memoizedState)?a.element:null,oi(e,t),li(t,r,null,n),(r=t.memoizedState.element)===a)To(),t=Yo(e,t,n);else{if((a=t.stateNode.hydrate)&&(wo=wn(t.stateNode.containerInfo.firstChild),xo=t,a=Oo=!0),a)for(n=_i(t,null,r,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else Ao(e,t,r,n),To();t=t.child}return t;case 5:return Ri(t),null===e&&_o(t),r=t.type,a=t.pendingProps,i=null!==e?e.memoizedProps:null,s=a.children,bn(r,a)?s=null:null!==i&&bn(r,i)&&(t.effectTag|=16),Lo(e,t),4&t.mode&&1!==n&&a.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(Ao(e,t,s,n),t=t.child),t;case 6:return null===e&&_o(t),null;case 13:return Go(e,t,n);case 4:return Ai(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Si(t,null,r,n):Ao(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,No(e,t,r,a=t.elementType===r?a:Ya(r,a),n);case 7:return Ao(e,t,t.pendingProps,n),t.child;case 8:case 12:return Ao(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,a=t.pendingProps,s=t.memoizedProps,i=a.value;var u=t.type._context;if(ca(Ka,u._currentValue),u._currentValue=i,null!==s)if(u=s.value,0===(i=Pr(u,i)?0:0|("function"===typeof r._calculateChangedBits?r._calculateChangedBits(u,i):1073741823))){if(s.children===a.children&&!da.current){t=Yo(e,t,n);break e}}else for(null!==(u=t.child)&&(u.return=t);null!==u;){var c=u.dependencies;if(null!==c){s=u.child;for(var l=c.firstContext;null!==l;){if(l.context===r&&0!==(l.observedBits&i)){1===u.tag&&((l=si(n,null)).tag=2,ui(u,l)),u.expirationTime<n&&(u.expirationTime=n),null!==(l=u.alternate)&&l.expirationTime<n&&(l.expirationTime=n),ti(u.return,n),c.expirationTime<n&&(c.expirationTime=n);break}l=l.next}}else s=10===u.tag&&u.type===t.type?null:u.child;if(null!==s)s.return=u;else for(s=u;null!==s;){if(s===t){s=null;break}if(null!==(u=s.sibling)){u.return=s.return,s=u;break}s=s.return}u=s}Ao(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=(i=t.pendingProps).children,ni(t,n),r=r(a=ri(a,i.unstable_observedBits)),t.effectTag|=1,Ao(e,t,r,n),t.child;case 14:return i=Ya(a=t.type,t.pendingProps),Ro(e,t,a,i=Ya(a.type,i),r,n);case 15:return Io(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Ya(r,a),null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),t.tag=1,ma(r)?(e=!0,ya(t)):e=!1,ni(t,n),gi(t,r,a),yi(t,r,a,n),zo(null,t,r,!0,e,n);case 19:return Xo(e,t,n)}throw Error(o(156,t.tag))};var wu=null,Ou=null;function ku(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function Su(e,t,n,r){return new ku(e,t,n,r)}function _u(e){return!(!(e=e.prototype)||!e.isReactComponent)}function ju(e,t){var n=e.alternate;return null===n?((n=Su(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.effectTag=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childExpirationTime=e.childExpirationTime,n.expirationTime=e.expirationTime,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{expirationTime:t.expirationTime,firstContext:t.firstContext,responders:t.responders},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Eu(e,t,n,r,a,i){var s=2;if(r=e,"function"===typeof e)_u(e)&&(s=1);else if("string"===typeof e)s=5;else e:switch(e){case ne:return Tu(n.children,a,i,t);case se:s=8,a|=7;break;case re:s=8,a|=1;break;case ae:return(e=Su(12,n,t,8|a)).elementType=ae,e.type=ae,e.expirationTime=i,e;case ce:return(e=Su(13,n,t,a)).type=ce,e.elementType=ce,e.expirationTime=i,e;case le:return(e=Su(19,n,t,a)).elementType=le,e.expirationTime=i,e;default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case ie:s=10;break e;case oe:s=9;break e;case ue:s=11;break e;case he:s=14;break e;case de:s=16,r=null;break e;case fe:s=22;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=Su(s,n,t,a)).elementType=e,t.type=r,t.expirationTime=i,t}function Tu(e,t,n,r){return(e=Su(7,e,r,t)).expirationTime=n,e}function Cu(e,t,n){return(e=Su(6,e,null,t)).expirationTime=n,e}function Mu(e,t,n){return(t=Su(4,null!==e.children?e.children:[],e.key,t)).expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Au(e,t,n){this.tag=t,this.current=null,this.containerInfo=e,this.pingCache=this.pendingChildren=null,this.finishedExpirationTime=0,this.finishedWork=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=90,this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}function Nu(e,t){var n=e.firstSuspendedTime;return e=e.lastSuspendedTime,0!==n&&n>=t&&e<=t}function Ru(e,t){var n=e.firstSuspendedTime,r=e.lastSuspendedTime;n<t&&(e.firstSuspendedTime=t),(r>t||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function Iu(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function Lu(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function Du(e,t,n,r){var a=t.current,i=qs(),s=di.suspense;i=Xs(i,a,s);e:if(n){t:{if($e(n=n._reactInternalFiber)!==n||1!==n.tag)throw Error(o(170));var u=n;do{switch(u.tag){case 3:u=u.stateNode.context;break t;case 1:if(ma(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break t}}u=u.return}while(null!==u);throw Error(o(171))}if(1===n.tag){var c=n.type;if(ma(c)){n=ba(n,c,u);break e}}n=u}else n=la;return null===t.context?t.context=n:t.pendingContext=n,(t=si(i,s)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),ui(a,t),Ys(a,i),i}function Pu(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function zu(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime<t&&(e.retryTime=t)}function Fu(e,t){zu(e,t),(e=e.alternate)&&zu(e,t)}function Bu(e,t,n){var r=new Au(e,t,n=null!=n&&!0===n.hydrate),a=Su(3,null,null,2===t?7:1===t?3:0);r.current=a,a.stateNode=r,ii(a),e[jn]=r.current,n&&0!==t&&function(e,t){var n=Qe(t);jt.forEach((function(e){pt(e,t,n)})),Et.forEach((function(e){pt(e,t,n)}))}(0,9===e.nodeType?e:e.ownerDocument),this._internalRoot=r}function Uu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Wu(e,t,n,r,a){var i=n._reactRootContainer;if(i){var o=i._internalRoot;if("function"===typeof a){var s=a;a=function(){var e=Pu(o);s.call(e)}}Du(t,o,e,a)}else{if(i=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new Bu(e,0,t?{hydrate:!0}:void 0)}(n,r),o=i._internalRoot,"function"===typeof a){var u=a;a=function(){var e=Pu(o);u.call(e)}}tu((function(){Du(t,o,e,a)}))}return Pu(o)}function Vu(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:te,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function Gu(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Uu(t))throw Error(o(200));return Vu(e,t,null,n)}Bu.prototype.render=function(e){Du(e,this._internalRoot,null,null)},Bu.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Du(null,e,null,(function(){t[jn]=null}))},mt=function(e){if(13===e.tag){var t=Xa(qs(),150,100);Ys(e,t),Fu(e,t)}},vt=function(e){13===e.tag&&(Ys(e,3),Fu(e,3))},gt=function(e){if(13===e.tag){var t=qs();Ys(e,t=Xs(t,e,null)),Fu(e,t)}},T=function(e,t,n){switch(t){case"input":if(_e(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=Mn(r);if(!a)throw Error(o(90));we(r),_e(r,a)}}}break;case"textarea":Ne(e,n);break;case"select":null!=(t=n.value)&&Ce(e,!!n.multiple,t,!1)}},I=eu,L=function(e,t,n,r,a){var i=ks;ks|=4;try{return Wa(98,e.bind(null,t,n,r,a))}finally{0===(ks=i)&&Ha()}},D=function(){0===(49&ks)&&(function(){if(null!==Ws){var e=Ws;Ws=null,e.forEach((function(e,t){Lu(t,e),Js(t)})),Ha()}}(),mu())},P=function(e,t){var n=ks;ks|=2;try{return e(t)}finally{0===(ks=n)&&Ha()}};var Hu={Events:[Tn,Cn,Mn,j,k,Pn,function(e){at(e,Dn)},N,R,Jt,st,mu,{current:!1}]};!function(e){var t=e.findFiberByHostInstance;(function(e){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;
2if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);wu=function(e){try{t.onCommitFiberRoot(n,e,void 0,64===(64&e.current.effectTag))}catch(r){}},Ou=function(e){try{t.onCommitFiberUnmount(n,e)}catch(r){}}}catch(r){}})(a({},e,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Z.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=nt(e))?null:e.stateNode},findFiberByHostInstance:function(e){return t?t(e):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}))}({findFiberByHostInstance:En,bundleType:0,version:"16.13.1",rendererPackageName:"react-dom"}),t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Hu,t.createPortal=Gu,t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternalFiber;if(void 0===t){if("function"===typeof e.render)throw Error(o(188));throw Error(o(268,Object.keys(e)))}return e=null===(e=nt(t))?null:e.stateNode},t.flushSync=function(e,t){if(0!==(48&ks))throw Error(o(187));var n=ks;ks|=1;try{return Wa(99,e.bind(null,t))}finally{ks=n,Ha()}},t.hydrate=function(e,t,n){if(!Uu(t))throw Error(o(200));return Wu(null,e,t,!0,n)},t.render=function(e,t,n){if(!Uu(t))throw Error(o(200));return Wu(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!Uu(e))throw Error(o(40));return!!e._reactRootContainer&&(tu((function(){Wu(null,null,e,!1,(function(){e._reactRootContainer=null,e[jn]=null}))})),!0)},t.unstable_batchedUpdates=eu,t.unstable_createPortal=function(e,t){return Gu(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Uu(n))throw Error(o(200));if(null==e||void 0===e._reactInternalFiber)throw Error(o(38));return Wu(e,t,n,!1,r)},t.version="16.13.1"},function(e,t,n){"use strict";e.exports=n(340)},function(e,t,n){"use strict";var r,a,i,o,s;if("undefined"===typeof window||"function"!==typeof MessageChannel){var u=null,c=null,l=function e(){if(null!==u)try{var n=t.unstable_now();u(!0,n),u=null}catch(r){throw setTimeout(e,0),r}},h=Date.now();t.unstable_now=function(){return Date.now()-h},r=function(e){null!==u?setTimeout(r,0,e):(u=e,setTimeout(l,0))},a=function(e,t){c=setTimeout(e,t)},i=function(){clearTimeout(c)},o=function(){return!1},s=t.unstable_forceFrameRate=function(){}}else{var d=window.performance,f=window.Date,p=window.setTimeout,m=window.clearTimeout;if("undefined"!==typeof console){var v=window.cancelAnimationFrame;"function"!==typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!==typeof v&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"===typeof d&&"function"===typeof d.now)t.unstable_now=function(){return d.now()};else{var g=f.now();t.unstable_now=function(){return f.now()-g}}var b=!1,y=null,x=-1,w=5,O=0;o=function(){return t.unstable_now()>=O},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):w=0<e?Math.floor(1e3/e):5};var k=new MessageChannel,S=k.port2;k.port1.onmessage=function(){if(null!==y){var e=t.unstable_now();O=e+w;try{y(!0,e)?S.postMessage(null):(b=!1,y=null)}catch(n){throw S.postMessage(null),n}}else b=!1},r=function(e){y=e,b||(b=!0,S.postMessage(null))},a=function(e,n){x=p((function(){e(t.unstable_now())}),n)},i=function(){m(x),x=-1}}function _(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,a=e[r];if(!(void 0!==a&&0<T(a,t)))break e;e[r]=t,e[n]=a,n=r}}function j(e){return void 0===(e=e[0])?null:e}function E(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length;r<a;){var i=2*(r+1)-1,o=e[i],s=i+1,u=e[s];if(void 0!==o&&0>T(o,n))void 0!==u&&0>T(u,o)?(e[r]=u,e[s]=n,r=s):(e[r]=o,e[i]=n,r=i);else{if(!(void 0!==u&&0>T(u,n)))break e;e[r]=u,e[s]=n,r=s}}}return t}return null}function T(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var C=[],M=[],A=1,N=null,R=3,I=!1,L=!1,D=!1;function P(e){for(var t=j(M);null!==t;){if(null===t.callback)E(M);else{if(!(t.startTime<=e))break;E(M),t.sortIndex=t.expirationTime,_(C,t)}t=j(M)}}function z(e){if(D=!1,P(e),!L)if(null!==j(C))L=!0,r(F);else{var t=j(M);null!==t&&a(z,t.startTime-e)}}function F(e,n){L=!1,D&&(D=!1,i()),I=!0;var r=R;try{for(P(n),N=j(C);null!==N&&(!(N.expirationTime>n)||e&&!o());){var s=N.callback;if(null!==s){N.callback=null,R=N.priorityLevel;var u=s(N.expirationTime<=n);n=t.unstable_now(),"function"===typeof u?N.callback=u:N===j(C)&&E(C),P(n)}else E(C);N=j(C)}if(null!==N)var c=!0;else{var l=j(M);null!==l&&a(z,l.startTime-n),c=!1}return c}finally{N=null,R=r,I=!1}}function B(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var U=s;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){L||I||(L=!0,r(F))},t.unstable_getCurrentPriorityLevel=function(){return R},t.unstable_getFirstCallbackNode=function(){return j(C)},t.unstable_next=function(e){switch(R){case 1:case 2:case 3:var t=3;break;default:t=R}var n=R;R=t;try{return e()}finally{R=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=U,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=R;R=e;try{return t()}finally{R=n}},t.unstable_scheduleCallback=function(e,n,o){var s=t.unstable_now();if("object"===typeof o&&null!==o){var u=o.delay;u="number"===typeof u&&0<u?s+u:s,o="number"===typeof o.timeout?o.timeout:B(e)}else o=B(e),u=s;return e={id:A++,callback:n,priorityLevel:e,startTime:u,expirationTime:o=u+o,sortIndex:-1},u>s?(e.sortIndex=u,_(M,e),null===j(C)&&e===j(M)&&(D?i():D=!0,a(z,u-s))):(e.sortIndex=o,_(C,e),L||I||(L=!0,r(F))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();P(e);var n=j(C);return n!==N&&null!==N&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime<N.expirationTime||o()},t.unstable_wrapCallback=function(e){var t=R;return function(){var n=R;R=t;try{return e.apply(this,arguments)}finally{R=n}}}},function(e,t,n){"use strict";var r=n(342);function a(){}function i(){}i.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,i,o){if(o!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;
2var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:a};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";var r="function"===typeof Symbol&&Symbol.for,a=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,h=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.suspense_list"):60120,v=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,b=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,x=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function O(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case h:case d:case o:case u:case s:case p:return e;default:switch(e=e&&e.$$typeof){case l:case f:case g:case v:case c:return e;default:return t}}case i:return t}}}function k(e){return O(e)===d}t.AsyncMode=h,t.ConcurrentMode=d,t.ContextConsumer=l,t.ContextProvider=c,t.Element=a,t.ForwardRef=f,t.Fragment=o,t.Lazy=g,t.Memo=v,t.Portal=i,t.Profiler=u,t.StrictMode=s,t.Suspense=p,t.isAsyncMode=function(e){return k(e)||O(e)===h},t.isConcurrentMode=k,t.isContextConsumer=function(e){return O(e)===l},t.isContextProvider=function(e){return O(e)===c},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===a},t.isForwardRef=function(e){return O(e)===f},t.isFragment=function(e){return O(e)===o},t.isLazy=function(e){return O(e)===g},t.isMemo=function(e){return O(e)===v},t.isPortal=function(e){return O(e)===i},t.isProfiler=function(e){return O(e)===u},t.isStrictMode=function(e){return O(e)===s},t.isSuspense=function(e){return O(e)===p},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===o||e===d||e===u||e===s||e===p||e===m||"object"===typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===v||e.$$typeof===c||e.$$typeof===l||e.$$typeof===f||e.$$typeof===y||e.$$typeof===x||e.$$typeof===w||e.$$typeof===b)},t.typeOf=O},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},,function(e,t,n){var r=function(e){"use strict";var t=Object.prototype,n=t.hasOwnProperty,r="function"===typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",o=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(j){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof h?t:h,i=Object.create(a.prototype),o=new k(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(a,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw i;return _()}for(n.method=a,n.arg=i;;){var o=n.delegate;if(o){var s=x(o,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,o),i}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(j){return{type:"throw",arg:j}}}e.wrap=u;var l={};function h(){}function d(){}function f(){}var p={};p[a]=function(){return this};var m=Object.getPrototypeOf,v=m&&m(m(S([])));v&&v!==t&&n.call(v,a)&&(p=v);var g=f.prototype=h.prototype=Object.create(p);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}
vendor: 4,371 bytes, line 2
2))}function y(e,t){var r;this._invoke=function(a,i){function o(){return new t((function(r,o){!function r(a,i,o,s){var u=c(e[a],e,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"===typeof h&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){r("next",e,o,s)}),(function(e){r("throw",e,o,s)})):t.resolve(h).then((function(e){l.value=e,o(l)}),(function(e){return r("throw",e,o,s)}))}s(u.arg)}(a,i,r,o)}))}return r=r?r.then(o,o):o()}}function x(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function S(e){if(e){var t=e[a];if(t)return t.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:_}}function _(){return{value:void 0,done:!0}}return d.prototype=g.constructor=f,f.constructor=d,d.displayName=s(f,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"===typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,s(e,o,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(y.prototype),y.prototype[i]=function(){return this},e.AsyncIterator=y,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new y(u(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},b(g),s(g,o,"Generator"),g[a]=function(){return this},g.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=S,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return o.type="throw",o.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];
2if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;O(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},e}(e.exports);try{regeneratorRuntime=r}catch(a){Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=c(e),o=r[0],s=r[1],u=new i(function(e,t,n){return 3*(t+n)/4-n}(0,o,s)),l=0,h=s>0?o-4:o;for(n=0;n<h;n+=4)t=a[e.charCodeAt(n)]<<18|a[e.charCodeAt(n+1)]<<12|a[e.charCodeAt(n+2)]<<6|a[e.charCodeAt(n+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===s&&(t=a[e.charCodeAt(n)]<<2|a[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===s&&(t=a[e.charCodeAt(n)]<<10|a[e.charCodeAt(n+1)]<<4|a[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,a=n%3,i=[],o=0,s=n-a;o<s;o+=16383)i.push(l(e,o,o+16383>s?s:o+16383));1===a?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===a&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],a=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=o.length;s<u;++s)r[s]=o[s],a[o.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var a,i,o=[],s=t;s<n;s+=3)a=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(r[(i=a)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,a){var i,o,s=8*a-r-1,u=(1<<s)-1,c=u>>1,l=-7,h=n?a-1:0,d=n?-1:1,f=e[t+h];for(h+=d,i=f&(1<<-l)-1,f>>=-l,l+=s;l>0;i=256*i+e[t+h],h+=d,l-=8);for(o=i&(1<<-l)-1,i>>=-l,l+=r;l>0;o=256*o+e[t+h],h+=d,l-=8);if(0===i)i=1-c;else{if(i===u)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),i-=c}return(f?-1:1)*o*Math.pow(2,i-r)},t.write=function(e,t,n,r,a,i){var o,s,u,c=8*i-a-1,l=(1<<c)-1,h=l>>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:i-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(o++,u/=2),o+h>=l?(s=0,o=l):o+h>=1?(s=(t*u-1)*Math.pow(2,a),o+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,a),o=0));a>=8;e[n+f]=255&s,f+=p,s/=256,a-=8);for(o=o<<a|s,c+=a;c>0;e[n+f]=255&o,f+=p,o/=256,c-=8);e[n+f-p]|=128*m}},function(e,t,n){"use strict";(function(e){var t,r=n(5),a=n(11),i=n(39),o=function(){return n(350)};var s=function(){function s(){Object(r.a)(this,s),this.util=n(351),this.textEncoder=new this.util.TextEncoder}return Object(a.a)(s,[{key:"fetch",value:function(e,n){return null!=Object(i.c)().global.fetch?Object(i.c)().global.fetch(e,n):(null==t&&(t=o()),t(e,n))}},{key:"now",value:function(){var t=e.hrtime();return 1e3*t[0]+t[1]/1e6}},{key:"encode",value:function(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error("Node built-in encoder only supports utf-8, but got ".concat(t));return this.textEncoder.encode(e)}},{key:"decode",value:function(e,t){return 0===e.length?"":new this.util.TextDecoder(t).decode(e)}}]),s}();Object(i.c)().get("IS_NODE")&&Object(i.c)().setPlatform("node",new s)}).call(this,n(115))},,,function(e,t,n){(function(e){var r;!function(e,a,i){function o(e){var t=this,n=function(){var e=4022871197;return function(t){t=t.toString();for(var n=0;n<t.length;n++){var r=.02519603282416938*(e+=t.charCodeAt(n));r-=e=r>>>0,e=(r*=e)>>>0,e+=4294967296*(r-=e)}return 2.3283064365386963e-10*(e>>>0)}}();t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=n(" "),t.s1=n(" "),t.s2=n(" "),t.s0-=n(e),t.s0<0&&(t.s0+=1),t.s1-=n(e),t.s1<0&&(t.s1+=1),t.s2-=n(e),t.s2<0&&(t.s2+=1),n=null}function s(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function u(e,t){var n=new o(e),r=t&&t.state,a=n.next;return a.int32=function(){return 4294967296*n.next()|0},a.double=function(){return a()+11102230246251565e-32*(2097152*a()|0)},a.quick=a,r&&("object"==typeof r&&s(r,n),a.state=function(){return s(n,{})}),a}a&&a.exports?a.exports=u:n(86)&&n(140)?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.alea=u}
2(0,e,n(86))}).call(this,n(139)(e))},function(e,t,n){(function(e){var r;!function(e,a,i){function o(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var r=0;r<n.length+64;r++)t.x^=0|n.charCodeAt(r),t.next()}function s(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function u(e,t){var n=new o(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&("object"==typeof r&&s(r,n),a.state=function(){return s(n,{})}),a}a&&a.exports?a.exports=u:n(86)&&n(140)?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.xor128=u}(0,e,n(86))}).call(this,n(139)(e))},function(e,t,n){(function(e){var r;!function(e,a,i){function o(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var r=0;r<n.length+64;
2r++)t.x^=0|n.charCodeAt(r),r==n.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function s(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function u(e,t){var n=new o(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&("object"==typeof r&&s(r,n),a.state=function(){return s(n,{})}),a}a&&a.exports?a.exports=u:n(86)&&n(140)?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.xorwow=u}(0,e,n(86))}).call(this,n(139)(e))},function(e,t,n){(function(e){var r;!function(e,a,i){function o(e){var t=this;t.next=function(){var e,n,r=t.x,a=t.i;return e=r[a],n=(e^=e>>>7)^e<<24,n^=(e=r[a+1&7])^e>>>10,n^=(e=r[a+3&7])^e>>>3,n^=(e=r[a+4&7])^e<<7,e=r[a+7&7],n^=(e^=e<<13)^e<<9,r[a]=n,t.i=a+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,n=0;n<t.length;++n)r[7&n]=r[7&n]<<15^t.charCodeAt(n)+r[n+1&7]<<13;for(;r.length<8;)r.push(0);for(n=0;n<8&&0===r[n];++n);for(8==n?r[7]=-1:r[n],e.x=r,e.i=0,n=256;n>0;--n)e.next()}(t,e)}function s(e,t){return t.x=e.x.slice(),t.i=e.i,t}function u(e,t){null==e&&(e=+new Date);var n=new o(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&(r.x&&s(r,n),a.state=function(){return s(n,{})}),a}a&&a.exports?a.exports=u:n(86)&&n(140)?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.xorshift7=u}(0,e,n(86))}).call(this,n(139)(e))},function(e,t,n){(function(e){var r;!function(e,a,i){function o(e){var t=this;t.next=function(){var e,n,r=t.w,a=t.X,i=t.i;return t.w=r=r+1640531527|0,n=a[i+34&127],e=a[i=i+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=a[i]=n^e,t.i=i,n+(r^r>>>16)|0},function(e,t){var n,r,a,i,o,s=[],u=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,u=Math.max(u,t.length)),a=0,i=-32;i<u;++i)t&&(r^=t.charCodeAt((i+32)%t.length)),0===i&&(o=r),r^=r<<10,r^=r>>>15,r^=r<<4,r^=r>>>13,i>=0&&(o=o+1640531527|0,a=0==(n=s[127&i]^=r+o)?a+1:0);for(a>=128&&(s[127&(t&&t.length||0)]=-1),a=127,i=512;i>0;--i)r=s[a+34&127],n=s[a=a+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,s[a]=r^n;e.w=o,e.X=s,e.i=a}(t,e)}function s(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function u(e,t){null==e&&(e=+new Date);var n=new o(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&(r.X&&s(r,n),a.state=function(){return s(n,{})}),a}a&&a.exports?a.exports=u:n(86)&&n(140)?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.xor4096=u}(0,e,n(86))}).call(this,n(139)(e))},function(e,t,n){(function(e){var r;!function(e,a,i){function o(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,r=t.d,a=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^a,a=a-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^a,t.a=a-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var r=0;r<n.length+20;r++)t.b^=0|n.charCodeAt(r),t.next()}function s(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function u(e,t){var n=new o(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&("object"==typeof r&&s(r,n),a.state=function(){return s(n,{})}),a}a&&a.exports?a.exports=u:n(86)&&n(140)?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.tychei=u}(0,e,n(86))}).call(this,n(139)(e))},function(e,t,n){var r;!function(a,i){var o,s=this,u=i.pow(256,6),c=i.pow(2,52),l=2*c;function h(e,t,n){var r=[],h=p(function e(t,n){var r,a=[],i=typeof t;if(n&&"object"==i)for(r in t)try{a.push(e(t[r],n-1))}catch(o){}return a.length?a:"string"==i?t:t+"\0"}((t=1==t?{entropy:!0}:t||{}).entropy?[e,m(a)]:null==e?function(){try{var e;return o&&(e=o.randomBytes)?e=e(256):(e=new Uint8Array(256),(s.crypto||s.msCrypto).getRandomValues(e)),m(e)}catch(r){var t=s.navigator,n=t&&t.plugins;return[+new Date,s,n,s.screen,m(a)]}}():e,3),r),v=new d(r),g=function(){for(var e=v.g(6),t=u,n=0;e<c;)e=256*(e+n),t*=256,n=v.g(1);for(;e>=l;)e/=2,t/=2,n>>>=1;return(e+n)/t};return g.int32=function(){return 0|v.g(4)},g.quick=function(){return v.g(4)/4294967296},g.double=g,p(m(v.S),a),(t.pass||n||function(e,t,n,r){return r&&(r.S&&f(r,v),e.state=function(){return f(v,{})}),n?(i.random=e,t):e})(g,h,"global"in t?t.global:this==i,t.state)}function d(e){var t,n=e.length,r=this,a=0,i=r.i=r.j=0,o=r.S=[];for(n||(e=[n++]);a<256;)o[a]=a++;for(a=0;a<256;a++)o[a]=o[i=255&i+e[a%n]+(t=o[a])],o[i]=t;(r.g=function(e){for(var t,n=0,a=r.i,i=r.j,o=r.S;e--;)t=o[a=255&a+1],n=256*n+o[255&(o[a]=o[i=255&i+t])+(o[i]=t)];return r.i=a,r.j=i,n})(256)}function f(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function p(e,t){for(var n,r=e+"",a=0;a<r.length;)t[255&a]=255&(n^=19*t[255&a])+r.charCodeAt(a++);return m(t)}function m(e){return String.fromCharCode.apply(0,e)}if(i.seedrandom=h,p(i.random(),a),e.exports){e.exports=h;try{o=n(359)}catch(v){}}else void 0===(r=function(){return h}.call(t,n,t,e))||(e.exports=r)}([],Math)},,function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,a=1,i={},o=!1,s=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){l(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?function(){var t="setImmediate$"+Math.random()+"$",n=function(n){n.source===e&&"string"===typeof n.data&&0===n.data.indexOf(t)&&l(+n.data.slice(t.length))};e.addEventListener?e.addEventListener("message",n,!1):e.attachEvent("onmessage",n),r=function(n){e.postMessage(t+n,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){l(e.data)},r=function(t){e.port2.postMessage(t)}}():s&&"onreadystatechange"in s.createElement("script")?function(){var e=s.documentElement;
2r=function(t){var n=s.createElement("script");n.onreadystatechange=function(){l(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():r=function(e){setTimeout(l,0,e)},u.setImmediate=function(e){"function"!==typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return i[a]=o,r(a),a++},u.clearImmediate=c}function c(e){delete i[e]}function l(e){if(o)setTimeout(l,0,e);else{var t=i[e];if(t){o=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{c(e),o=!1}}}}}("undefined"===typeof self?"undefined"===typeof e?this:e:self)}).call(this,n(112),n(115))},,,function(e,t,n){},function(e,t,n){var r;!function(a,i){"use strict";var o="model",s="name",u="type",c="vendor",l="version",h="mobile",d="tablet",f="smarttv",p={extend:function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2===0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n},has:function(e,t){return"string"===typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"===typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},m={rgx:function(e,t){for(var n,r,a,i,o,s,u=0;u<t.length&&!o;){var c=t[u],l=t[u+1];for(n=r=0;n<c.length&&!o;)if(o=c[n++].exec(e))for(a=0;a<l.length;a++)s=o[++r],"object"===typeof(i=l[a])&&i.length>0?2==i.length?"function"==typeof i[1]?this[i[0]]=i[1].call(this,s):this[i[0]]=i[1]:3==i.length?"function"!==typeof i[1]||i[1].exec&&i[1].test?this[i[0]]=s?s.replace(i[1],i[2]):void 0:this[i[0]]=s?i[1].call(this,s,i[2]):void 0:4==i.length&&(this[i[0]]=s?i[3].call(this,s.replace(i[1],i[2])):void 0):this[i]=s||void 0;u+=2}},str:function(e,t){for(var n in t)if("object"===typeof t[n]&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(p.has(t[n][r],e))return"?"===n?void 0:n}else if(p.has(t[n],e))return"?"===n?void 0:n;return e}},v={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},g={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[s,l],[/(opios)[\/\s]+([\w\.]+)/i],[[s,"Opera Mini"],l],[/\s(opr)\/([\w\.]+)/i],[[s,"Opera"],l],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(bidubrowser|baidubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i],[s,l],[/(konqueror)\/([\w\.]+)/i],[[s,"Konqueror"],l],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[s,"IE"],l],[/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i],[[s,"Edge"],l],[/(yabrowser)\/([\w\.]+)/i],[[s,"Yandex"],l],[/(Avast)\/([\w\.]+)/i],[[s,"Avast Secure Browser"],l],[/(AVG)\/([\w\.]+)/i],[[s,"AVG Secure Browser"],l],[/(puffin)\/([\w\.]+)/i],[[s,"Puffin"],l],[/(focus)\/([\w\.]+)/i],[[s,"Firefox Focus"],l],[/(opt)\/([\w\.]+)/i],[[s,"Opera Touch"],l],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[s,"UCBrowser"],l],[/(comodo_dragon)\/([\w\.]+)/i],[[s,/_/g," "],l],[/(windowswechat qbcore)\/([\w\.]+)/i],[[s,"WeChat(Win) Desktop"],l],[/(micromessenger)\/([\w\.]+)/i],[[s,"WeChat"],l],[/(brave)\/([\w\.]+)/i],[[s,"Brave"],l],[/(qqbrowserlite)\/([\w\.]+)/i],[s,l],[/(QQ)\/([\d\.]+)/i],[s,l],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[s,l],[/(baiduboxapp)[\/\s]?([\w\.]+)/i],[s,l],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[s,l],[/(MetaSr)[\/\s]?([\w\.]+)/i],[s],[/(LBBROWSER)/i],[s],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[l,[s,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[l,[s,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/android.+(line)\/([\w\.]+)\/iab/i],[s,l],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[l,[s,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[s,/(.+)/,"$1 WebView"],l],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[s,/(.+(?:g|us))(.+)/,"$1 $2"],l],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[l,[s,"Android Browser"]],[/(sailfishbrowser)\/([\w\.]+)/i],[[s,"Sailfish Browser"],l],[/(chrome|omniweb|arora|[t
2izenoka]{5}\s?browser)\/v?([\w\.]+)/i],[s,l],[/(dolfin)\/([\w\.]+)/i],[[s,"Dolphin"],l],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[s,"360 Browser"]],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[s,"Chrome"],l],[/(coast)\/([\w\.]+)/i],[[s,"Opera Coast"],l],[/fxios\/([\w\.-]+)/i],[l,[s,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[l,[s,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[l,s],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[s,"GSA"],l],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[s,[l,m.str,v.browser.oldsafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[s,l],[/(navigator|netscape)\/([\w\.-]+)/i],[[s,"Netscape"],l],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[s,l]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",p.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/windows\s(ce|mobile);\sppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[["architecture",/ower/,"",p.lowerize]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[["architecture",p.lowerize]]],device:[[/\((ipad|playbook);[\w\s\),;-]+(rim|apple)/i],[o,c,[u,d]],[/applecoremedia\/[\w\.]+ \((ipad)/],[o,[c,"Apple"],[u,d]],[/(apple\s{0,1}tv)/i],[[o,"Apple TV"],[c,"Apple"],[u,f]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[c,o,[u,d]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[o,[c,"Amazon"],[u,d]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[o,m.str,v.device.amazon.model],[c,"Amazon"],[u,h]],[/android.+aft([bms])\sbuild/i],[o,[c,"Amazon"],[u,f]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[o,c,[u,h]],[/\((ip[honed|\s\w*]+);/i],[o,[c,"Apple"],[u,h]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[c,o,[u,h]],[/\(bb10;\s(\w+)/i],[o,[c,"BlackBerry"],[u,h]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i],[o,[c,"Asus"],[u,d]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[c,"Sony"],[o,"Xperia Tablet"],[u,d]],[/android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[o,[c,"Sony"],[u,h]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[c,o,[u,"console"]],[/android.+;\s(shield)\sbuild/i],[o,[c,"Nvidia"],[u,"console"]],[/(playstation\s[34portablevi]+)/i],[o,[c,"Sony"],[u,"console"]],[/(sprint\s(\w+))/i],[[c,m.str,v.device.sprint.vendor],[o,m.str,v.device.sprint.model],[u,h]],[/(htc)[;_\s-]+([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[c,[o,/_/g," "],[u,h]],[/(nexus\s9)/i],[o,[c,"HTC"],[u,d]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p|vog-l29|ane-lx1|eml-l29|ele-l29)/i],[o,[c,"Huawei"],[u,h]],[/android.+(bah2?-a?[lw]\d{2})/i],[o,[c,"Huawei"],[u,d]],[/(microsoft);\s(lumia[\s\w]+)/i],[c,o,[u,h]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[o,[c,"Microsoft"],[u,"console"]],[/(kin\.[onetw]{3})/i],[[o,/\./g," "],[c,"Microsoft"],[u,h]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[o,[c,"Motorola"],[u,h]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[o,[c,"Motorola"],[u,d]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[c,p.trim],[o,p.trim],[u,f]],[/hbbtv.+maple;(\d+)/i],[[o,/^/,"SmartTV"],[c,"Samsung"],[u,f]],[/\(dtv[\);].+(aquos)/i],[o,[c,"Sharp"],[u,f]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[c,"Samsung"],o,[u,d]],[/smart-tv.+(samsung)/i],[c,[u,f],o],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[c,"Samsung"],o,[u,h]],[/sie-(\w*)/i],[o,[c,"Siemens"],[u,h]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[c,"Nokia"],o,[u,h]],[/android[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[o,[c,"Acer"],[u,d]],[/android.+([vl]k\-?\d{3})\s+build/i],[o,[c,"LG"],[u,d]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[c,"LG"],o,[u,d]],[/(lg) netcast\.tv/i],[c,o,[u,f]],[/(nexus\s[45]
2)/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[o,[c,"LG"],[u,h]],[/(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i],[c,o,[u,d]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[o,[c,"Lenovo"],[u,d]],[/(lenovo)[_\s-]?([\w-]+)/i],[c,o,[u,h]],[/linux;.+((jolla));/i],[c,o,[u,h]],[/((pebble))app\/[\d\.]+\s/i],[c,o,[u,"wearable"]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[c,o,[u,h]],[/crkey/i],[[o,"Chromecast"],[c,"Google"],[u,f]],[/android.+;\s(glass)\s\d/i],[o,[c,"Google"],[u,"wearable"]],[/android.+;\s(pixel c)[\s)]/i],[o,[c,"Google"],[u,d]],[/android.+;\s(pixel( [23])?( xl)?)[\s)]/i],[o,[c,"Google"],[u,h]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:a\d|one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]?[\w\s]+))\s+build/i],[[o,/_/g," "],[c,"Xiaomi"],[u,h]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]?[\w\s]+))\s+build/i],[[o,/_/g," "],[c,"Xiaomi"],[u,d]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[o,[c,"Meizu"],[u,h]],[/(mz)-([\w-]{2,})/i],[[c,"Meizu"],o,[u,h]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})[\s)]/i],[o,[c,"OnePlus"],[u,h]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[o,[c,"RCA"],[u,d]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[o,[c,"Dell"],[u,d]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[o,[c,"Verizon"],[u,d]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[c,"Barnes & Noble"],o,[u,d]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[o,[c,"NuVision"],[u,d]],[/android.+;\s(k88)\sbuild/i],[o,[c,"ZTE"],[u,d]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[o,[c,"Swiss"],[u,h]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[o,[c,"Swiss"],[u,d]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[o,[c,"Zeki"],[u,d]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[c,"Dragon Touch"],o,[u,d]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[o,[c,"Insignia"],[u,d]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[o,[c,"NextBook"],[u,d]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[c,"Voice"],o,[u,h]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[c,"LvTel"],o,[u,h]],[/android.+;\s(PH-1)\s/i],[o,[c,"Essential"],[u,h]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[o,[c,"Envizen"],[u,d]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[c,o,[u,d]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[o,[c,"MachSpeed"],[u,d]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[c,o,[u,d]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[o,[c,"Rotor"],[u,d]],[/android.+(KS(.+))\s+build/i],[o,[c,"Amazon"],[u,d]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[c,o,[u,d]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[u,p.lowerize],c,o],[/[\s\/\(](smart-?tv)[;\)]/i],[[u,f]],[/(android[\w\.\s\-]{0,9});.+build/i],[o,[c,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[l,[s,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[l,[s,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[s,l],[/rv\:([\w\.]{1,9}).+(gecko)/i],[l,s]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[s,l],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[s,[l,m.str,v.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[s,"Windows"],[l,m.str,v.os.windows.version]],[/\((bb)(10);
2/i],[[s,"BlackBerry"],l],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i],[s,l],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[s,"Symbian"],l],[/\((series40);/i],[s],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[s,"Firefox OS"],l],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[s,l],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[s,"Chromium OS"],l],[/(sunos)\s?([\w\.\d]*)/i],[[s,"Solaris"],l],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[s,l],[/(haiku)\s(\w+)/i],[s,l],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[l,/_/g,"."],[s,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[s,"Mac OS"],[l,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[s,l]]},b=function e(t,n){if("object"===typeof t&&(n=t,t=void 0),!(this instanceof e))return new e(t,n).getResult();var r=t||(a&&a.navigator&&a.navigator.userAgent?a.navigator.userAgent:""),i=n?p.extend(g,n):g;return this.getBrowser=function(){var e={name:void 0,version:void 0};return m.rgx.call(e,r,i.browser),e.major=p.major(e.version),e},this.getCPU=function(){var e={architecture:void 0};return m.rgx.call(e,r,i.cpu),e},this.getDevice=function(){var e={vendor:void 0,model:void 0,type:void 0};return m.rgx.call(e,r,i.device),e},this.getEngine=function(){var e={name:void 0,version:void 0};return m.rgx.call(e,r,i.engine),e},this.getOS=function(){var e={name:void 0,version:void 0};return m.rgx.call(e,r,i.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=e,this},this};b.VERSION="0.7.22",b.BROWSER={NAME:s,MAJOR:"major",VERSION:l},b.CPU={ARCHITECTURE:"architecture"},b.DEVICE={MODEL:o,VENDOR:c,TYPE:u,CONSOLE:"console",MOBILE:h,SMARTTV:f,TABLET:d,WEARABLE:"wearable",EMBEDDED:"embedded"},b.ENGINE={NAME:s,VERSION:l},b.OS={NAME:s,VERSION:l},"undefined"!==typeof t?("undefined"!==typeof e&&e.exports&&(t=e.exports=b),t.UAParser=b):void 0===(r=function(){return b}.call(t,n,t,e))||(e.exports=r);var y=a&&(a.jQuery||a.Zepto);if(y&&!y.ua){var x=new b;y.ua=x.getResult(),y.ua.get=function(){return x.getUA()},y.ua.set=function(e){x.setUA(e);var t=x.getResult();for(var n in t)y.ua[n]=t[n]}}}("object"===typeof window?window:this)},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}e.exports=n},function(e,t,n){(function(t){var r=n(286),a=n(367),i=n(369),o=n(289),s=n(290),u=n(375),c=n(182),l=n(386),h=n(387),d=n(388),f=d.OctreeQuant,p=d.Color,m=function(){"use strict";function e(){o(this,e),this.data=[]}return s(e,[{key:"getData",value:function(){return t.from(this.data)}},{key:"writeByte",value:function(e){this.data.push(e)}},{key:"writeUTFBytes",value:function(e){for(var t=e.length,n=0;n<t;n++)this.writeByte(e.charCodeAt(n))}},{key:"writeBytes",value:function(e,t,n){for(var r=n||e.length,a=t||0;a<r;a++)this.writeByte(e[a])}}]),e}(),v=function(e){"use strict";a(c,e);var n=i(c);function c(e,t){var r,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"neuquant",i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return o(this,c),(r=n.call(this)).width=~~e,r.height=~~t,r.algorithm=a,r.useOptimizer=i,r.totalFrames=s,r.frames=1,r.threshold=90,r.indexedPixels=null,r.palSizeNeu=7,r.palSizeOct=7,r.sample=10,r.colorTab=null,r.reuseTab=null,r.colorDepth=null,r.usedEntry=new Array,r.firstFrame=!0,r.started=!1,r.image=null,r.prevImage=null,r.dis
2pose=-1,r.repeat=0,r.delay=0,r.transparent=null,r.transIndex=0,r.readStreams=[],r.out=new m,r}return s(c,[{key:"createReadStream",value:function(e){return e||((e=new u.Readable)._read=function(){}),this.readStreams.push(e),e}},{key:"emitData",value:function(){var e=this;0!==this.readStreams.length&&this.out.data.length&&(this.readStreams.forEach((function(n){n.push(t.from(e.out.data))})),this.out.data=[])}},{key:"start",value:function(){this.out.writeUTFBytes("GIF89a"),this.started=!0,this.emitData()}},{key:"end",value:function(){null!==this.readStreams.length&&(this.emitData(),this.readStreams.forEach((function(e){return e.push(null)})),this.readStreams=[])}},{key:"addFrame",value:function(e){e&&e.getImageData?this.image=e.getImageData(0,0,this.width,this.height).data:this.image=e,this.analyzePixels(),this.firstFrame&&(this.writeLSD(),this.writePalette(),this.repeat>=0&&this.writeNetscapeExt()),this.writeGraphicCtrlExt(),this.writeImageDesc(),this.firstFrame||this.writePalette(),this.writePixels(),this.firstFrame=!1,this.emitData(),this.totalFrames&&this.emit("progress",Math.floor(this.frames++/this.totalFrames*100))}},{key:"analyzePixels",value:function(){var e=this.width,t=this.height,n=this.image;if(this.useOptimizer&&this.prevImage){for(var a=0,i=n.length,o=0;o<i;o+=4)n[o]===this.prevImage[o]&&n[o+1]===this.prevImage[o+1]&&n[o+2]===this.prevImage[o+2]||a++;var s=100-Math.ceil(a/(n.length/4)*100);this.reuseTab=s>=this.threshold}if(this.prevImage=n,"neuquant"===this.algorithm){var u=0;this.pixels=new Uint8Array(e*t*3);for(o=0;o<t;o++)for(var c=0;c<e;c++){var l=o*e*4+4*c;this.pixels[u++]=n[l],this.pixels[u++]=n[l+1],this.pixels[u++]=n[l+2]}var d=this.pixels.length/3;this.indexedPixels=new Uint8Array(d),this.reuseTab||(this.quantizer=new h(this.pixels,this.sample),this.quantizer.buildColormap(),this.colorTab=this.quantizer.getColormap());var m=0;for(c=0;c<d;c++){var v=this.quantizer.lookupRGB(255&this.pixels[m++],255&this.pixels[m++],255&this.pixels[m++]);this.usedEntry[v]=!0,this.indexedPixels[c]=v}this.colorDepth=8,this.palSizeNeu=7,this.pixels=null}else if("octree"===this.algorithm){this.colors=[],this.reuseTab||(this.quantizer=new f);for(o=0;o<t;o++)for(c=0;c<e;c++){var g=new p(n[l=o*e*4+4*c],n[l+1],n[l+2]);
2this.colors.push(g),this.reuseTab||this.quantizer.addColor(g)}var b=this.colors.length;if(this.indexedPixels=new Uint8Array(b),!this.reuseTab){this.colorTab=[];var y,x=this.quantizer.makePalette(Math.pow(2,this.palSizeOct+1)),w=r(x);try{for(w.s();!(y=w.n()).done;){var O=y.value;this.colorTab.push(O.red,O.green,O.blue)}}catch(S){w.e(S)}finally{w.f()}}for(o=0;o<b;o++)this.indexedPixels[o]=this.quantizer.getPaletteIndex(this.colors[o]);this.colorDepth=this.palSizeOct+1}if(null!==this.transparent){this.transIndex=this.findClosest(this.transparent);for(var k=0;k<d;k++)0==this.image[4*k+3]&&(this.indexedPixels[k]=this.transIndex)}}},{key:"findClosest",value:function(e){if(null===this.colorTab)return-1;for(var t=(16711680&e)>>16,n=(65280&e)>>8,r=255&e,a=0,i=16777216,o=this.colorTab.length,s=0;s<o;){var u=s/3,c=t-(255&this.colorTab[s++]),l=n-(255&this.colorTab[s++]),h=r-(255&this.colorTab[s++]),d=c*c+l*l+h*h;this.usedEntry[u]&&d<i&&(i=d,a=u)}return a}},{key:"setFrameRate",value:function(e){this.delay=Math.round(100/e)}},{key:"setDelay",value:function(e){this.delay=Math.round(e/10)}},{key:"setDispose",value:function(e){e>=0&&(this.dispose=e)}},{key:"setRepeat",value:function(e){this.repeat=e}},{key:"setTransparent",value:function(e){this.transparent=e}},{key:"setQuality",value:function(e){e<1&&(e=1),this.quality=e}},{key:"setThreshold",value:function(e){e>100?e=100:e<0&&(e=0),this.threshold=e}},{key:"setPaletteSize",value:function(e){e>7?e=7:e<4&&(e=4),this.palSizeOct=e}},{key:"writeLSD",value:function(){this.writeShort(this.width),this.writeShort(this.height),this.out.writeByte(240|this.palSizeNeu),this.out.writeByte(0),this.out.writeByte(0)}},{key:"writeGraphicCtrlExt",value:function(){var e,t;this.out.writeByte(33),this.out.writeByte(249),this.out.writeByte(4),null===this.transparent?(e=0,t=0):(e=1,t=2),this.dispose>=0&&(t=7&this.dispose),t<<=2,this.out.writeByte(0|t|e),this.writeShort(this.delay),this.out.writeByte(this.transIndex),this.out.writeByte(0)}},{key:"writeNetscapeExt",value:function(){this.out.writeByte(33),this.out.writeByte(255),this.out.writeByte(11),this.out.writeUTFBytes("NETSCAPE2.0"),this.out.writeByte(3),this.out.writeByte(1),this.writeShort(this.repeat),this.out.writeByte(0)}},{key:"writeImageDesc",value:function(){this.out.writeByte(44),this.writeShort(0),this.writeShort(0),this.writeShort(this.width),this.writeShort(this.height),this.firstFrame?this.out.writeByte(0):this.out.writeByte(128|this.palSizeNeu)}},{key:"writePalette",value:function(){this.out.writeBytes(this.colorTab);for(var e=768-this.colorTab.length,t=0;t<e;t++)this.out.writeByte(0)}},{key:"writeShort",value:function(e){this.out.writeByte(255&e),this.out.writeByte(e>>8&255)}},{key:"writePixels",value:function(){new l(this.width,this.height,this.indexedPixels,this.colorDepth).encode(this.out)}},{key:"finish",value:function(){this.out.writeByte(59),this.end()}}]),c}(c);e.exports=v}).call(this,n(116).Buffer)},function(e,t,n){var r=n(368);e.exports=function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){var r=n(370),a=n(371),i=n(372);e.exports=function(e){return function(){var t,n=r(e);if(a()){var o=r(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return i(this,t)}}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t){e.exports=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}},function(e,t,n){var r=n(373),a=n(374);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!==typeof t?a(e):t}},function(e,t){function n(t){return"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){e.exports=a;var r=n(182).EventEmitter;function a(){r.call(this)}n(141)(a,r),a.Readable=n(236),a.Writable=n(382),a.Duplex=n(383),a.Transform=n(384),a.PassThrough=n(385),a.Stream=a,a.prototype.pipe=function(e,t){var n=this;function a(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",a),e.on("drain",i),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",u));var o=!1;function s(){o||(o=!0,e.end())}function u(){o||(o=!0,"function"===typeof e.destroy&&e.destroy())}function c(e){if(l(),0===r.listenerCount(this,"error"))throw e}function l(){n.removeListener("data",a),e.removeListener("drain",i),n.removeListener("end",s),n.removeListener("close",u),n.removeListener("error",c),e.removeListener("error",c),n.removeListener("end",l),n.removeListener("close",l),e.removeListener("close",l)}return n.on("error",c),e.on("error",c),n.on("end",l),n.on("close",l),e.on("close",l),e.emit("pipe",n),e}},,function(e,t,n){"use strict";var r=n(237).Buffer,a=n(378);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,a,i=r.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,n=i,a=s,t.copy(n,a),s+=o.data.length,o=o.next;return i},e}(),a&&a.inspect&&a.inspect.custom&&(e.exports.prototype[a.inspect.custom]=function(){var e=a.inspect({length:this.length});return this.constructor.name+" "+e})},,function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(r){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}
2e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,n(112))},function(e,t,n){var r=n(116),a=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return a(e,t,n)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=o),o.prototype=Object.create(a.prototype),i(a,o),o.from=function(e,t,n){if("number"===typeof e)throw new TypeError("Argument must not be a number");return a(e,t,n)},o.alloc=function(e,t,n){if("number"!==typeof e)throw new TypeError("Argument must be a number");var r=a(e);return void 0!==t?"string"===typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return a(e)},o.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){"use strict";e.exports=i;var r=n(295),a=Object.create(n(169));function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}a.inherits=n(141),a.inherits(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){e.exports=n(238)},function(e,t,n){e.exports=n(132)},function(e,t,n){e.exports=n(236).Transform},function(e,t,n){e.exports=n(236).PassThrough},function(e,t){var n=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];e.exports=function(e,t,r,a){var i,o,s,u,c,l,h=Math.max(2,a),d=new Uint8Array(256),f=new Int32Array(5003),p=new Int32Array(5003),m=0,v=0,g=!1;function b(e,t){d[o++]=e,o>=254&&w(t)}function y(e){x(5003),v=c+2,g=!0,S(c,e)}function x(e){for(var t=0;t<e;++t)f[t]=-1}function w(e){o>0&&(e.writeByte(o),e.writeBytes(d,0,o),o=0)}function O(e){return(1<<e)-1}function k(){return 0===remaining?-1:(--remaining,255&r[curPixel++])}function S(e,t){for(i&=n[m],m>0?i|=e<<m:i=e,m+=n_bits;m>=8;)b(255&i,t),i>>=8,m-=8;if((v>s||g)&&(g?(s=O(n_bits=u),g=!1):(++n_bits,s=12==n_bits?4096:O(n_bits))),e==l){for(;m>0;)b(255&i,t),i>>=8,m-=8;w(t)}}this.encode=function(n){n.writeByte(h),remaining=e*t,curPixel=0,function(e,t){var n,r,a,i,h,d;for(u=e,g=!1,n_bits=u,s=O(n_bits),l=(c=1<<e-1)+1,v=c+2,o=0,i=k(),d=0,n=5003;n<65536;n*=2)++d;d=8-d,x(5003),S(c,t);e:for(;-1!=(r=k());)if(n=(r<<12)+i,f[a=r<<d^i]!==n){if(f[a]>=0){h=5003-a,0===a&&(h=1);do{if((a-=h)<0&&(a+=5003),f[a]===n){i=p[a];continue e}}while(f[a]>=0)}S(i,t),i=r,v<4096?(p[a]=v++,f[a]=n):y(t)}else i=p[a];S(i,t),S(l,t)}(h+1,n),n.writeByte(0)}}},function(e,t){e.exports=function(e,t){var n,r,a,i,o;function s(e,t,r,a,i){n[t][0]-=e*(n[t][0]-r)/1024,n[t][1]-=e*(n[t][1]-a)/1024,n[t][2]-=e*(n[t][2]-i)/1024}function u(e,t,r,a,i){for(var s,u,c=Math.abs(t-e),l=Math.min(t+e,256),h=t+1,d=t-1,f=1;h<l||d>c;)u=o[f++],h<l&&((s=n[h++])[0]-=u*(s[0]-r)/(1<<18),s[1]-=u*(s[1]-a)/(1<<18),s[2]-=u*(s[2]-i)/(1<<18)),d>c&&((s=n[d--])[0]-=u*(s[0]-r)/(1<<18),s[1]-=u*(s[1]-a)/(1<<18),s[2]-=u*(s[2]-i)/(1<<18))}function c(e,t,r){var o,s,u,c,l,h=~(1<<31),d=h,f=-1,p=f;for(o=0;o<256;o++)s=n[o],(u=Math.abs(s[0]-e)+Math.abs(s[1]-t)+Math.abs(s[2]-r))<h&&(h=u,f=o),(c=u-(a[o]>>12))<d&&(d=c,p=o),l=i[o]>>10,i[o]-=l,a[o]+=l<<10;return i[f]+=64,a[f]-=65536,p}this.buildColormap=function(){!function(){var e,t;for(n=[],r=new Int32Array(256),a=new Int32Array(256),i=new Int32Array(256),o=new Int32Array(32),e=0;e<256;e++)t=(e<<12)/256,n[e]=new Float64Array([t,t,t,0]),i[e]=256,a[e]=0}(),function(){var n,r,a,i,l,h,d=e.length,f=30+(t-1)/3,p=d/(3*t),m=~~(p/100),v=1024,g=2048,b=g>>6;for(b<=1&&(b=0),n=0;n<b;n++)o[n]=v*(256*(b*b-n*n)/(b*b));d<1509?(t=1,r=3):r=d%499!==0?1497:d%491!==0?1473:d%487!==0?1461:1509;var y=0;for(n=0;n<p;)if(s(v,h=c(a=(255&e[y])<<4,i=(255&e[y+1])<<4,l=(255&e[y+2])<<4),a,i,l),0!==b&&u(b,h,a,i,l),(y+=r)>=d&&(y-=d),0===m&&(m=1),++n%m===0)for(v-=v/f,(b=(g-=g/30)>>6)<=1&&(b=0),h=0;h<b;h++)o[h]=v*(256*(b*b-h*h)/(b*b))}(),function(){for(var e=0;e<256;e++)n[e][0]>>=4,n[e][1]>>=4,n[e][2]>>=4,n[e][3]=e}(),function(){var e,t,a,i,o,s,u=0,c=0;for(e=0;e<256;e++){for(o=e,s=(a=n[e])[1],t=e+1;t<256;t++)(i=n[t])[1]<s&&(o=t,s=i[1]);if(i=n[o],e!=o&&(t=i[0],i[0]=a[0],a[0]=t,t=i[1],i[1]=a[1],a[1]=t,t=i[2],i[2]=a[2],a[2]=t,t=i[3],i[3]=a[3],a[3]=t),s!=u){for(r[u]=c+e>>1,t=u+1;t<s;t++)r[t]=e;u=s,c=e}}for(r[u]=c+255>>1,t=u+1;t<256;t++)r[t]=255}()},this.getColormap=function(){for(var e=[],t=[],r=0;r<256;r++)t[n[r][3]]=r;for(var a=0,i=0;i<256;i++){var o=t[i];e[a++]=n[o][0],e[a++]=n[o][1],e[a++]=n[o][2]}return e},this.lookupRGB=function(e,t,a){for(var i,o,s,u=1e3,c=-1,l=r[t],h=l-1;l<256||h>=0;)l<256&&((s=(o=n[l])[1]-t)>=u?l=256:(l++,s<0&&(s=-s),(i=o[0]-e)<0&&(i=-i),(s+=i)<u&&((i=o[2]-a)<0&&(i=-i),(s+=i)<u&&(u=s,c=o[3])))),h>=0&&((s=t-(o=n[h])[1])>=u?h=-1:(h--,s<0&&(s=-s),(i=o[0]-e)<0&&(i=-i),(s+=i)<u&&((i=o[2]-a)<0&&(i=-i),(s+=i)<u&&(u=s,c=o[3]))));return c}}},function(e,t,n){var r=n(389),a=n(3),i=n(286),o=n(289),s=n(290),u=function(){"use strict";function e(){o(this,e),this.levels=Array.from({length:8},(function(){return[]})),this.root=new c(0,this)}return s(e,[{key:"addColor",value:function(e){this.root.addColor
2(e,0,this)}},{key:"makePalette",value:function(e){for(var t=[],n=0,r=this.leafNodes.length,a=7;a>-1;a-=1)if(this.levels[a]){var o,s=i(this.levels[a]);try{for(s.s();!(o=s.n()).done;){if((r-=o.value.removeLeaves())<=e)break}}catch(h){s.e(h)}finally{s.f()}if(r<=e)break;this.levels[a]=[]}var u,c=i(this.leafNodes);try{for(c.s();!(u=c.n()).done;){var l=u.value;if(n>=e)break;l.isLeaf&&t.push(l.color),l.paletteIndex=n,n++}}catch(h){c.e(h)}finally{c.f()}return t}},{key:"makePaletteIncremental",value:a.mark((function e(t){var n,r,o,s,u,c,l,h,d,f;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=[],r=0,o=this.leafNodes.length,s=7;case 4:if(!(s>-1)){e.next=32;break}if(!this.levels[s]){e.next=27;break}u=i(this.levels[s]),e.prev=7,u.s();case 9:if((c=u.n()).done){e.next=16;break}if(l=c.value,!((o-=l.removeLeaves())<=t)){e.next=14;break}return e.abrupt("break",16);case 14:e.next=9;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(7),u.e(e.t0);case 21:return e.prev=21,u.f(),e.finish(21);case 24:if(!(o<=t)){e.next=26;break}return e.abrupt("break",32);case 26:this.levels[s]=[];case 27:return void(e.next=29);case 29:s-=1,e.next=4;break;case 32:h=i(this.leafNodes),e.prev=33,h.s();case 35:if((d=h.n()).done){e.next=44;break}if(f=d.value,!(r>=t)){e.next=39;break}return e.abrupt("break",44);case 39:f.isLeaf&&n.push(f.color),f.paletteIndex=r,r++;case 42:e.next=35;break;case 44:e.next=49;break;case 46:e.prev=46,e.t1=e.catch(33),h.e(e.t1);case 49:return e.prev=49,h.f(),e.finish(49);case 52:return void(e.next=54);case 54:return e.abrupt("return",n);case 55:case"end":return e.stop()}}),e,this,[[7,18,21,24],[33,46,49,52]])}))},{key:"addLevelNode",value:function(e,t){this.levels[e].push(t)}},{key:"getPaletteIndex",value:function(e){return this.root.getPaletteIndex(e,0)}},{key:"leafNodes",get:function(){return this.root.leafNodes}}]),e}(),c=function(){"use strict";function e(t,n){o(this,e),this._color=new l(0,0,0),this.pixelCount=0,this.paletteIndex=0,this.children=[],this._debugColor,t<7&&n.addLevelNode(t,this)}return s(e,[{key:"addColor",value:function(t,n,r){if(n>=8)return this._color.add(t),void this.pixelCount++;var a=h(t,n);this.children[a]||(this.children[a]=new e(n,r)),this.children[a].addColor(t,n+1,r)}},{key:"getPaletteIndex",value:function(e,t){if(this.isLeaf)return this.paletteIndex;var n=h(e,t);if(this.children[n])return this.children[n].getPaletteIndex(e,t+1);var r,a=i(this.children);try{for(a.s();!(r=a.n()).done;){var o=r.value;if(o)return o.getPaletteIndex(e,t+1)}}catch(s){a.e(s)}finally{a.f()}}},{key:"removeLeaves",value:function(){var e,t=0,n=i(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;r&&(this._color.add(r._color),this.pixelCount+=r.pixelCount,t++)}}catch(a){n.e(a)}finally{n.f()}return this.children=[],t-1}},{key:"isLeaf",get:function(){return this.pixelCount>0}},{key:"leafNodes",get:function(){var e,t=[],n=i(this.children);try{for(n.s();!(e=n.n()).done;){var a=e.value;a&&(a.isLeaf?t.push(a):t.push.apply(t,r(a.leafNodes)))}}catch(o){n.e(o)}finally{n.f()}return t}},{key:"debugColor",get:function(){if(this._debugColor)return this._debugColor;if(this.isLeaf)return this.color;var e=new l,t=0;return function n(r){var a,o=i(r.children);try{for(o.s();!(a=o.n()).done;){var s=a.value;s.isLeaf?(e.add(s._color),t++):n(s)}}catch(u){o.e(u)}finally{o.f()}}(this),e.normalized(t)}},{key:"color",get:function(){return this._color.normalized(this.pixelCount)}}]),e}(),l=function(){"use strict";function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;o(this,e),this.red=t,this.green=n,this.blue=r}return s(e,[{key:"clone",value:function(){return new e(this.red,this.green,this.blue)}},{key:"toString",value:function(){return[this.red,this.green,this.blue].join(",")}},{key:"toCSS",value:function(){return"rgb(".concat([this.red,this.green,this.blue].map((function(e){return Math.floor(e)})).join(","),")")}},{key:"normalized",value:function(t){return new e(this.red/t,this.green/t,this.blue/t)}},{key:"add",value:function(e){this.red+=e.red,this.green+=e.green,this.blue+=e.blue}},{key:"array",get:function(){return[this.red,this.green,this.blue,this.red+this.green+this.blue]}}]),e}();function h(e,t){var n=0,r=128>>t;return e.red&r&&(n|=4),e.green&r&&(n|=2),e.blue&r&&(n|=1),n}e.exports={OctreeQuant:u,Node:c,Color:l}},function(e,t,n){var r=n(390),a=n(391),i=n(287),o=n(392);e.exports=function(e){return r(e)||a(e)||i(e)||o()}},function(e,t,n){var r=n(288);e.exports=function(e){if(Array.isArray(e))return r(e)}},function(e,t){e.exports=function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},,,function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return l}));var r=n(21),a=n(46),i=n(1),o=(n(54),n(44)),s=n(53),u=n(51),c=i.forwardRef((function(e,t){var n=e.children,s=e.classes,c=e.className,l=e.color,h=void 0===l?"inherit":l,d=e.component,f=void 0===d?"svg":d,p=e.fontSize,m=void 0===p?"default":p,v=e.htmlColor,g=e.titleAccess,b=e.viewBox,y=void 0===b?"0 0 24 24":b,x=Object(a.a)(e,["children","classes","className","color","component","fontSize","htmlColor","titleAccess","viewBox"]);return i.createElement(f,Object(r.a)({className:Object(o.a)(s.root,c,"inherit"!==h&&s["color".concat(Object(u.a)(h))],"default"!==m&&s["fontSize".concat(Object(u.a)(m))]),focusable:"false",viewBox:y,color:v,"aria-hidden":!g||void 0,role:g?"img":void 0,ref:t},x),n,g?i.createElement("title",null,g):null)}));c.muiName="SvgIcon";var l=Object(s.a)((function(e){return{root:{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,fontSize:e.typography.pxToRem(24),transition:e.transitions.create("fill",{duration:e.transitions.duration.shorter})},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorAction:{color:e.palette.action.active},colorError:{color:e.palette.error.main},colorDisabled:{color:e.palette.action.disabled},fontSizeInherit:{fontSize:"inherit"},fontSizeSmall:{fontSize:e.typography.pxToRem(20)},fontSizeLarge:{fontSize:e.typography.pxToRem(35)}}}),{name:"MuiSvgIcon"})(c)},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}
2));var r=n(1),a=n.n(r);var i=a.a.createContext(null);function o(){return a.a.useContext(i)}},,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(46),a=n(21),i=n(1),o=(n(54),n(44)),s=n(53),u=n(50),c=n(330),l=n(51),h=i.forwardRef((function(e,t){var n=e.children,s=e.classes,u=e.className,h=e.color,d=void 0===h?"default":h,f=e.component,p=void 0===f?"button":f,m=e.disabled,v=void 0!==m&&m,g=e.disableElevation,b=void 0!==g&&g,y=e.disableFocusRipple,x=void 0!==y&&y,w=e.endIcon,O=e.focusVisibleClassName,k=e.fullWidth,S=void 0!==k&&k,_=e.size,j=void 0===_?"medium":_,E=e.startIcon,T=e.type,C=void 0===T?"button":T,M=e.variant,A=void 0===M?"text":M,N=Object(r.a)(e,["children","classes","className","color","component","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"]),R=E&&i.createElement("span",{className:Object(o.a)(s.startIcon,s["iconSize".concat(Object(l.a)(j))])},E),I=w&&i.createElement("span",{className:Object(o.a)(s.endIcon,s["iconSize".concat(Object(l.a)(j))])},w);return i.createElement(c.a,Object(a.a)({className:Object(o.a)(s.root,s[A],u,"inherit"===d?s.colorInherit:"default"!==d&&s["".concat(A).concat(Object(l.a)(d))],"medium"!==j&&[s["".concat(A,"Size").concat(Object(l.a)(j))],s["size".concat(Object(l.a)(j))]],b&&s.disableElevation,v&&s.disabled,S&&s.fullWidth),component:p,disabled:v,focusRipple:!x,focusVisibleClassName:Object(o.a)(s.focusVisible,O),ref:t,type:C},N),i.createElement("span",{className:s.label},R,n,I))}));t.a=Object(s.a)((function(e){return{root:Object(a.a)({},e.typography.button,{boxSizing:"border-box",minWidth:64,padding:"6px 16px",borderRadius:e.shape.borderRadius,color:e.palette.text.primary,transition:e.transitions.create(["background-color","box-shadow","border"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none",backgroundColor:Object(u.b)(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"},"&$disabled":{backgroundColor:"transparent"}},"&$disabled":{color:e.palette.action.disabled}}),label:{width:"100%",display:"inherit",alignItems:"inherit",justifyContent:"inherit"},text:{padding:"6px 8px"},textPrimary:{color:e.palette.primary.main,"&:hover":{backgroundColor:Object(u.b)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},textSecondary:{color:e.palette.secondary.main,"&:hover":{backgroundColor:Object(u.b)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlined:{padding:"5px 15px",border:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"&$disabled":{border:"1px solid ".concat(e.palette.action.disabledBackground)}},outlinedPrimary:{color:e.palette.primary.main,border:"1px solid ".concat(Object(u.b)(e.palette.primary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.primary.main),backgroundColor:Object(u.b)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlinedSecondary:{color:e.palette.secondary.main,border:"1px solid ".concat(Object(u.b)(e.palette.secondary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.secondary.main),backgroundColor:Object(u.b)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{border:"1px solid ".concat(e.palette.action.disabled)}},contained:{color:e.palette.getContrastText(e.palette.grey[300]),backgroundColor:e.palette.grey[300],boxShadow:e.shadows[2],"&:hover":{backgroundColor:e.palette.grey.A100,boxShadow:e.shadows[4],"@media (hover: none)":{boxShadow:e.shadows[2],backgroundColor:e.palette.grey[300]},"&$disabled":{backgroundColor:e.palette.action.disabledBackground}},"&$focusVisible":{boxShadow:e.shadows[6]},"&:active":{boxShadow:e.shadows[8]},"&$disabled":{color:e.palette.action.disabled,boxShadow:e.shadows[0],backgroundColor:e.palette.action.disabledBackground}},containedPrimary:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,"&:hover":{backgroundColor:e.palette.primary.dark,"@media (hover: none)":{backgroundColor:e.palette.primary.main}}}
2,containedSecondary:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.main,"&:hover":{backgroundColor:e.palette.secondary.dark,"@media (hover: none)":{backgroundColor:e.palette.secondary.main}}},disableElevation:{boxShadow:"none","&:hover":{boxShadow:"none"},"&$focusVisible":{boxShadow:"none"},"&:active":{boxShadow:"none"},"&$disabled":{boxShadow:"none"}},focusVisible:{},disabled:{},colorInherit:{color:"inherit",borderColor:"currentColor"},textSizeSmall:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},textSizeLarge:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},outlinedSizeSmall:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},outlinedSizeLarge:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},containedSizeSmall:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},containedSizeLarge:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},sizeSmall:{},sizeLarge:{},fullWidth:{width:"100%"},startIcon:{display:"inherit",marginRight:8,marginLeft:-4,"&$iconSizeSmall":{marginLeft:-2}},endIcon:{display:"inherit",marginRight:-4,marginLeft:8,"&$iconSizeSmall":{marginRight:-2}},iconSizeSmall:{"& > *:first-child":{fontSize:18}},iconSizeMedium:{"& > *:first-child":{fontSize:20}},iconSizeLarge:{"& > *:first-child":{fontSize:22}}}}),{name:"MuiButton"})(h)},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(21),a=n(173);function i(e){return e&&"object"===Object(a.a)(e)&&e.constructor===Object}function o(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},a=n.clone?Object(r.a)({},e):e;return i(e)&&i(t)&&Object.keys(t).forEach((function(r){"__proto__"!==r&&(i(t[r])&&r in e?a[r]=o(e[r],t[r],n):a[r]=t[r])})),a}},function(e,t,n){"use strict";var r=n(21),a=n(46),i=n(1),o=(n(54),n(44)),s=n(53),u=n(50),c=n(330),l=n(51),h=i.forwardRef((function(e,t){var n=e.edge,s=void 0!==n&&n,u=e.children,h=e.classes,d=e.className,f=e.color,p=void 0===f?"default":f,m=e.disabled,v=void 0!==m&&m,g=e.disableFocusRipple,b=void 0!==g&&g,y=e.size,x=void 0===y?"medium":y,w=Object(a.a)(e,["edge","children","classes","className","color","disabled","disableFocusRipple","size"]);return i.createElement(c.a,Object(r.a)({className:Object(o.a)(h.root,d,"default"!==p&&h["color".concat(Object(l.a)(p))],v&&h.disabled,"small"===x&&h["size".concat(Object(l.a)(x))],{start:h.edgeStart,end:h.edgeEnd}[s]),centerRipple:!0,focusRipple:!b,disabled:v,ref:t},w),i.createElement("span",{className:h.label},u))}));t.a=Object(s.a)((function(e){return{root:{textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:12,borderRadius:"50%",overflow:"visible",color:e.palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{backgroundColor:Object(u.b)(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{backgroundColor:"transparent",color:e.palette.action.disabled}},edgeStart:{marginLeft:-12,"$sizeSmall&":{marginLeft:-3}},edgeEnd:{marginRight:-12,"$sizeSmall&":{marginRight:-3}},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main,"&:hover":{backgroundColor:Object(u.b)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},colorSecondary:{color:e.palette.secondary.main,"&:hover":{backgroundColor:Object(u.b)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},disabled:{},sizeSmall:{padding:3,fontSize:e.typography.pxToRem(18)},label:{width:"100%",display:"flex",alignItems:"inherit",justifyContent:"inherit"}}}),{name:"MuiIconButton"})(h)},function(e,t,n){"use strict";var r=n(21),a=n(46),i=n(1),o=(n(54),n(44)),s=n(53),u=n(51);function c(e){var t,n,r;return t=e,n=0,r=1,e=(Math.min(Math.max(n,t),r)-n)/(r-n),e=(e-=1)*e*e+1}var l=i.forwardRef((function(e,t){var n,s=e.classes,l=e.className,h=e.color,d=void 0===h?"primary":h,f=e.disableShrink,p=void 0!==f&&f,m=e.size,v=void 0===m?40:m,g=e.style,b=e.thickness,y=void 0===b?3.6:b,x=e.value,w=void 0===x?0:x,O=e.variant,k=void 0===O?"indeterminate":O,S=Object(a.a)(e,["classes","className","color","disableShrink","size","style","thickness","value","variant"]),_={},j={},E={};if("determinate"===k||"static"===k){var T=2*Math.PI*((44-y)/2);_.strokeDasharray=T.toFixed(3),E["aria-valuenow"]=Math.round(w),"static"===k?(_.strokeDashoffset="".concat(((100-w)/100*T).toFixed(3),"px"),j.transform="rotate(-90deg)"):(_.strokeDashoffset="".concat((n=(100-w)/100,n*n*T).toFixed(3),"px"),j.transform="rotate(".concat((270*c(w/70)).toFixed(3),"deg)"))}return i.createElement("div",Object(r.a)({className:Object(o.a)(s.root,l,"inherit"!==d&&s["color".concat(Object(u.a)(d))],{indeterminate:s.indeterminate,static:s.static}[k]),style:Object(r.a)({width:v,height:v},j,g),ref:t,role:"progressbar"},E,S),i.createElement("svg",{className:s.svg,viewBox:"".concat(22," ").concat(22," ").concat(44," ").concat(44)},i.createElement("circle",{className:Object(o.a)(s.circle,p&&s.circleDisableShrink,{indeterminate:s.circleIndeterminate,static:s.circleStatic}[k]),style:_,cx:44,cy:44,r:(44-y)/2,fill:"none",strokeWidth:y})))}
2));t.a=Object(s.a)((function(e){return{root:{display:"inline-block"},static:{transition:e.transitions.create("transform")},indeterminate:{animation:"$circular-rotate 1.4s linear infinite"},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},svg:{display:"block"},circle:{stroke:"currentColor"},circleStatic:{transition:e.transitions.create("stroke-dashoffset")},circleIndeterminate:{animation:"$circular-dash 1.4s ease-in-out infinite",strokeDasharray:"80px, 200px",strokeDashoffset:"0px"},"@keyframes circular-rotate":{"0%":{transformOrigin:"50% 50%"},"100%":{transform:"rotate(360deg)"}},"@keyframes circular-dash":{"0%":{strokeDasharray:"1px, 200px",strokeDashoffset:"0px"},"50%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-15px"},"100%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-125px"}},circleDisableShrink:{animation:"none"}}}),{name:"MuiCircularProgress",flip:!1})(l)},function(e,t,n){"use strict";var r=n(21),a=n(46),i=n(1),o=(n(54),n(44)),s=n(53),u=n(50),c=n(51),l=n(166),h=n(230),d=i.createContext();var f=d;var p=n(414),m=i.forwardRef((function(e,t){var n=e.autoFocus,s=e.checked,u=e.checkedIcon,c=e.classes,d=e.className,m=e.defaultChecked,v=e.disabled,g=e.icon,b=e.id,y=e.inputProps,x=e.inputRef,w=e.name,O=e.onBlur,k=e.onChange,S=e.onFocus,_=e.readOnly,j=e.required,E=e.tabIndex,T=e.type,C=e.value,M=Object(a.a)(e,["autoFocus","checked","checkedIcon","classes","className","defaultChecked","disabled","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"]),A=Object(h.a)({controlled:s,default:Boolean(m),name:"SwitchBase",state:"checked"}),N=Object(l.a)(A,2),R=N[0],I=N[1],L=i.useContext(f),D=v;L&&"undefined"===typeof D&&(D=L.disabled);var P="checkbox"===T||"radio"===T;return i.createElement(p.a,Object(r.a)({component:"span",className:Object(o.a)(c.root,d,R&&c.checked,D&&c.disabled),disabled:D,tabIndex:null,role:void 0,onFocus:function(e){S&&S(e),L&&L.onFocus&&L.onFocus(e)},onBlur:function(e){O&&O(e),L&&L.onBlur&&L.onBlur(e)},ref:t},M),i.createElement("input",Object(r.a)({autoFocus:n,checked:s,defaultChecked:m,className:c.input,disabled:D,id:P&&b,name:w,onChange:function(e){var t=e.target.checked;I(t),k&&k(e,t)},readOnly:_,ref:x,required:j,tabIndex:E,type:T,value:C},y)),R?u:g)})),v=Object(s.a)({root:{padding:9},checked:{},disabled:{},input:{cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}},{name:"PrivateSwitchBase"})(m),g=i.forwardRef((function(e,t){var n=e.classes,s=e.className,u=e.color,l=void 0===u?"secondary":u,h=e.edge,d=void 0!==h&&h,f=e.size,p=void 0===f?"medium":f,m=Object(a.a)(e,["classes","className","color","edge","size"]),g=i.createElement("span",{className:n.thumb});return i.createElement("span",{className:Object(o.a)(n.root,s,{start:n.edgeStart,end:n.edgeEnd}[d],"small"===p&&n["size".concat(Object(c.a)(p))])},i.createElement(v,Object(r.a)({type:"checkbox",icon:g,checkedIcon:g,classes:{root:Object(o.a)(n.switchBase,n["color".concat(Object(c.a)(l))]),input:n.input,checked:n.checked,disabled:n.disabled},ref:t},m)),i.createElement("span",{className:n.track}))}));t.a=Object(s.a)((function(e){return{root:{display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"}},edgeStart:{marginLeft:-8},edgeEnd:{marginRight:-8},switchBase:{position:"absolute",top:0,left:0,zIndex:1,color:"light"===e.palette.type?e.palette.grey[50]:e.palette.grey[400],transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),"&$checked":{transform:"translateX(20px)"},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{opacity:.5},"&$disabled + $track":{opacity:"light"===e.palette.type?.12:.1}},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:Object(u.b)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{backgroundColor:e.palette.primary.main},"&$disabled + $track":{backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:Object(u.b)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{backgroundColor:e.palette.secondary.main},"&$disabled + $track":{backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white}},sizeSmall:{width:40,height:24,padding:7,"& $thumb":{width:16,height:16},"& $switchBase":{padding:4,"&$checked":{transform:"translateX(16px)"}}},checked:{},disabled:{},input:{left:"-100%",width:"300%"},thumb:{boxShadow:e.shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}
2,track:{height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white,opacity:"light"===e.palette.type?.38:.3}}}),{name:"MuiSwitch"})(g)},function(e,t,n){"use strict";var r=n(21),a=n(108),i=n(46),o=n(1),s=(n(54),n(44)),u=n(53),c=o.forwardRef((function(e,t){var n=e.classes,a=e.className,u=e.component,c=void 0===u?"div":u,l=e.square,h=void 0!==l&&l,d=e.elevation,f=void 0===d?1:d,p=e.variant,m=void 0===p?"elevation":p,v=Object(i.a)(e,["classes","className","component","square","elevation","variant"]);return o.createElement(c,Object(r.a)({className:Object(s.a)(n.root,a,"outlined"===m?n.outlined:n["elevation".concat(f)],!h&&n.rounded),ref:t},v))})),l=Object(u.a)((function(e){var t={};return e.shadows.forEach((function(e,n){t["elevation".concat(n)]={boxShadow:e}})),Object(r.a)({root:{backgroundColor:e.palette.background.paper,color:e.palette.text.primary,transition:e.transitions.create("box-shadow")},rounded:{borderRadius:e.shape.borderRadius},outlined:{border:"1px solid ".concat(e.palette.divider)}},t)}),{name:"MuiPaper"})(c),h=n(51),d=n(50),f=n(231),p=o.forwardRef((function(e,t){var n=e.classes,a=e.className,u=e.color,c=void 0===u?"primary":u,l=e.value,d=e.valueBuffer,p=e.variant,m=void 0===p?"indeterminate":p,v=Object(i.a)(e,["classes","className","color","value","valueBuffer","variant"]),g=Object(f.a)(),b={},y={bar1:{},bar2:{}};if("determinate"===m||"buffer"===m)if(void 0!==l){b["aria-valuenow"]=Math.round(l),b["aria-valuemin"]=0,b["aria-valuemax"]=100;var x=l-100;"rtl"===g.direction&&(x=-x),y.bar1.transform="translateX(".concat(x,"%)")}else 0;if("buffer"===m)if(void 0!==d){var w=(d||0)-100;"rtl"===g.direction&&(w=-w),y.bar2.transform="translateX(".concat(w,"%)")}else 0;return o.createElement("div",Object(r.a)({className:Object(s.a)(n.root,n["color".concat(Object(h.a)(c))],a,{determinate:n.determinate,indeterminate:n.indeterminate,buffer:n.buffer,query:n.query}[m]),role:"progressbar"},b,{ref:t},v),"buffer"===m?o.createElement("div",{className:Object(s.a)(n.dashed,n["dashedColor".concat(Object(h.a)(c))])}):null,o.createElement("div",{className:Object(s.a)(n.bar,n["barColor".concat(Object(h.a)(c))],("indeterminate"===m||"query"===m)&&n.bar1Indeterminate,{determinate:n.bar1Determinate,buffer:n.bar1Buffer}[m]),style:y.bar1}),"determinate"===m?null:o.createElement("div",{className:Object(s.a)(n.bar,("indeterminate"===m||"query"===m)&&n.bar2Indeterminate,"buffer"===m?[n["color".concat(Object(h.a)(c))],n.bar2Buffer]:n["barColor".concat(Object(h.a)(c))]),style:y.bar2}))})),m=Object(u.a)((function(e){var t=function(t){return"light"===e.palette.type?Object(d.d)(t,.62):Object(d.a)(t,.5)},n=t(e.palette.primary.main),r=t(e.palette.secondary.main);return{root:{position:"relative",overflow:"hidden",height:4,"@media print":{colorAdjust:"exact"}},colorPrimary:{backgroundColor:n},colorSecondary:{backgroundColor:r},determinate:{},indeterminate:{},buffer:{backgroundColor:"transparent"},query:{transform:"rotate(180deg)"},dashed:{position:"absolute",marginTop:0,height:"100%",width:"100%",animation:"$buffer 3s infinite linear"},dashedColorPrimary:{backgroundImage:"radial-gradient(".concat(n," 0%, ").concat(n," 16%, transparent 42%)"),backgroundSize:"10px 10px",backgroundPosition:"0 -23px"},dashedColorSecondary:{backgroundImage:"radial-gradient(".concat(r," 0%, ").concat(r," 16%, transparent 42%)"),backgroundSize:"10px 10px",backgroundPosition:"0 -23px"},bar:{width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left"},barColorPrimary:{backgroundColor:e.palette.primary.main},barColorSecondary:{backgroundColor:e.palette.secondary.main},bar1Indeterminate:{width:"auto",animation:"$indeterminate1 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite"},bar1Determinate:{transition:"transform .".concat(4,"s linear")},bar1Buffer:{zIndex:1,transition:"transform .".concat(4,"s linear")},bar2Indeterminate:{width:"auto",animation:"$indeterminate2 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite"},bar2Buffer:{transition:"transform .".concat(4,"s linear")},"@keyframes indeterminate1":{"0%":{left:"-35%",right:"100%"},"60%":{left:"100%",right:"-90%"},"100%":{left:"100%",right:"-90%"}},"@keyframes indeterminate2":{"0%":{left:"-200%",right:"100%"},"60%":{left:"107%",right:"-8%"},"100%":{left:"107%",right:"-8%"}},"@keyframes buffer":{"0%":{opacity:1,backgroundPosition:"0 -23px"},"50%":{opacity:0,backgroundPosition:"0 -23px"},"100%":{opacity:1,backgroundPosition:"-200px -23px"}}}}),{name:"MuiLinearProgress"})(p),v=o.forwardRef((function(e,t){var n=e.activeStep,u=void 0===n?0:n,c=e.backButton,d=e.classes,f=e.className,p=e.LinearProgressProps,v=e.nextButton,g=e.position,b=void 0===g?"bottom":g,y=e.steps,x=e.variant,w=void 0===x?"dots":x,O=Object(i.a)(e,["activeStep","backButton","classes","className","LinearProgressProps","nextButton","position","steps","variant"]);
2return o.createElement(l,Object(r.a)({square:!0,elevation:0,className:Object(s.a)(d.root,d["position".concat(Object(h.a)(b))],f),ref:t},O),c,"text"===w&&o.createElement(o.Fragment,null,u+1," / ",y),"dots"===w&&o.createElement("div",{className:d.dots},Object(a.a)(new Array(y)).map((function(e,t){return o.createElement("div",{key:t,className:Object(s.a)(d.dot,t===u&&d.dotActive)})}))),"progress"===w&&o.createElement(m,Object(r.a)({className:d.progress,variant:"determinate",value:Math.ceil(u/(y-1)*100)},p)),v)}));t.a=Object(u.a)((function(e){return{root:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",background:e.palette.background.default,padding:8},positionBottom:{position:"fixed",bottom:0,left:0,right:0,zIndex:e.zIndex.mobileStepper},positionTop:{position:"fixed",top:0,left:0,right:0,zIndex:e.zIndex.mobileStepper},positionStatic:{},dots:{display:"flex",flexDirection:"row"},dot:{backgroundColor:e.palette.action.disabled,borderRadius:"50%",width:8,height:8,margin:"0 2px"},dotActive:{backgroundColor:e.palette.primary.main},progress:{width:"50%"}}}),{name:"MuiMobileStepper"})(v)},function(e,t,n){"use strict";var r=n(108),a=n(166),i=n(46),o=n(21),s=n(1),u=(n(54),n(44)),c=n(53),l=n(231),h=n(50),d=n(226);function f(e){return e&&e.ownerDocument||document}var p=n(70),m=n(138),v=n(51),g=n(230);var b=Object(c.a)((function(e){return{thumb:{"&$open":{"& $offset":{transform:"scale(1) translateY(-10px)"}}},open:{},offset:Object(o.a)({zIndex:1},e.typography.body2,{fontSize:e.typography.pxToRem(12),lineHeight:1.2,transition:e.transitions.create(["transform"],{duration:e.transitions.duration.shortest}),top:-34,transformOrigin:"bottom center",transform:"scale(0)",position:"absolute"}),circle:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:"50% 50% 50% 0",backgroundColor:"currentColor",transform:"rotate(-45deg)"},label:{color:e.palette.primary.contrastText,transform:"rotate(45deg)"}}}),{name:"PrivateValueLabel"})((function(e){var t=e.children,n=e.classes,r=e.className,a=e.open,i=e.value,o=e.valueLabelDisplay;return"off"===o?t:s.cloneElement(t,{className:Object(u.a)(t.props.className,(a||"on"===o)&&n.open,n.thumb)},s.createElement("span",{className:Object(u.a)(n.offset,r)},s.createElement("span",{className:n.circle},s.createElement("span",{className:n.label},i))))}
vendor: 5,056 bytes, line 2
2));function y(e,t){return e-t}function x(e,t,n){return Math.min(Math.max(t,e),n)}function w(e,t){return e.reduce((function(e,n,r){var a=Math.abs(t-n);return null===e||a<e.distance||a===e.distance?{distance:a,index:r}:e}),null).index}function O(e,t){if(void 0!==t.current&&e.changedTouches){for(var n=0;n<e.changedTouches.length;n+=1){var r=e.changedTouches[n];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function k(e,t,n){return 100*(e-t)/(n-t)}function S(e,t,n){var r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(function(e){if(Math.abs(e)<1){var t=e.toExponential().split("e-"),n=t[0].split(".")[1];return(n?n.length:0)+parseInt(t[1],10)}var r=e.toString().split(".")[1];return r?r.length:0}(t)))}function _(e){var t=e.values,n=e.source,r=e.newValue,a=e.index;if(t[a]===r)return n;var i=t.slice();return i[a]=r,i}function j(e){var t=e.sliderRef,n=e.activeIndex,r=e.setActive;t.current.contains(document.activeElement)&&Number(document.activeElement.getAttribute("data-index"))===n||t.current.querySelector('[role="slider"][data-index="'.concat(n,'"]')).focus(),r&&r(n)}var E={horizontal:{offset:function(e){return{left:"".concat(e,"%")}},leap:function(e){return{width:"".concat(e,"%")}}},"horizontal-reverse":{offset:function(e){return{right:"".concat(e,"%")}},leap:function(e){return{width:"".concat(e,"%")}}},vertical:{offset:function(e){return{bottom:"".concat(e,"%")}},leap:function(e){return{height:"".concat(e,"%")}}}},T=function(e){return e},C=s.forwardRef((function(e,t){var n=e["aria-label"],c=e["aria-labelledby"],h=e["aria-valuetext"],C=e.classes,M=e.className,A=e.color,N=void 0===A?"primary":A,R=e.component,I=void 0===R?"span":R,L=e.defaultValue,D=e.disabled,P=void 0!==D&&D,z=e.getAriaLabel,F=e.getAriaValueText,B=e.marks,U=void 0!==B&&B,W=e.max,V=void 0===W?100:W,G=e.min,H=void 0===G?0:G,q=e.name,X=e.onChange,Y=e.onChangeCommitted,K=e.onMouseDown,Z=e.orientation,J=void 0===Z?"horizontal":Z,Q=e.scale,$=void 0===Q?T:Q,ee=e.step,te=void 0===ee?1:ee,ne=e.ThumbComponent,re=void 0===ne?"span":ne,ae=e.track,ie=void 0===ae?"normal":ae,oe=e.value,se=e.ValueLabelComponent,ue=void 0===se?b:se,ce=e.valueLabelDisplay,le=void 0===ce?"off":ce,he=e.valueLabelFormat,de=void 0===he?T:he,fe=Object(i.a)(e,["aria-label","aria-labelledby","aria-valuetext","classes","className","color","component","defaultValue","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","onMouseDown","orientation","scale","step","ThumbComponent","track","value","ValueLabelComponent","valueLabelDisplay","valueLabelFormat"]),pe=Object(l.a)(),me=s.useRef(),ve=s.useState(-1),ge=ve[0],be=ve[1],ye=s.useState(-1),xe=ye[0],we=ye[1],Oe=Object(g.a)({controlled:oe,default:L,name:"Slider"}),ke=Object(a.a)(Oe,2),Se=ke[0],_e=ke[1],je=Array.isArray(Se),Ee=je?Se.slice().sort(y):[Se];Ee=Ee.map((function(e){return x(e,H,V)}));var Te=!0===U&&null!==te?Object(r.a)(Array(Math.floor((V-H)/te)+1)).map((function(e,t){return{value:H+te*t}})):U||[],Ce=Object(d.a)(),Me=Ce.isFocusVisible,Ae=Ce.onBlurVisible,Ne=Ce.ref,Re=s.useState(-1),Ie=Re[0],Le=Re[1],De=s.useRef(),Pe=Object(m.a)(Ne,De),ze=Object(m.a)(t,Pe),Fe=Object(p.a)((function(e){var t=Number(e.currentTarget.getAttribute("data-index"));Me(e)&&Le(t),we(t)})),Be=Object(p.a)((function(){-1!==Ie&&(Le(-1),Ae()),we(-1)})),Ue=Object(p.a)((function(e){var t=Number(e.currentTarget.getAttribute("data-index"));we(t)})),We=Object(p.a)((function(){we(-1)})),Ve="rtl"===pe.direction,Ge=Object(p.a)((function(e){var t,n=Number(e.currentTarget.getAttribute("data-index")),r=Ee[n],a=(V-H)/10,i=Te.map((function(e){return e.value})),o=i.indexOf(r),s=Ve?"ArrowLeft":"ArrowRight",u=Ve?"ArrowRight":"ArrowLeft";switch(e.key){case"Home":t=H;break;case"End":t=V;break;case"PageUp":te&&(t=r+a);break;case"PageDown":te&&(t=r-a);break;case s:case"ArrowUp":t=te?r+te:i[o+1]||i[i.length-1];break;case u:case"ArrowDown":t=te?r-te:i[o-1]||i[0];break;default:return}if(e.preventDefault(),te&&(t=S(t,te,H)),t=x(t,H,V),je){var c=t;t=_({values:Ee,source:Se,newValue:t,index:n}).sort(y),j({sliderRef:De,activeIndex:t.indexOf(c)})}_e(t),Le(n),X&&X(e,t),Y&&Y(e,t)})),He=s.useRef(),qe=J;Ve&&"vertical"!==J&&(qe+="-reverse");var Xe=function(e){var t,n,r=e.finger,a=e.move,i=void 0!==a&&a,o=e.values,s=e.source,u=De.current.getBoundingClientRect(),c=u.width,l=u.height,h=u.bottom,d=u.left;if(t=0===qe.indexOf("vertical")?(h-r.y)/l:(r.x-d)/c,-1!==qe.indexOf("-reverse")&&(t=1-t),n=function(e,t,n){return(n-t)*e+t}(t,H,V),te)n=S(n,te,H);else{var f=Te.map((function(e){return e.value}));n=f[w(f,n)]}n=x(n,H,V);var p=0;if(je){var m=n;p=(n=_({values:o,source:s,newValue:n,index:p=i?He.current:w(o,n)}).sort(y)).indexOf(m),He.current=p}return{newValue:n,activeIndex:p}},Ye=Object(p.a)((function(e){var t=O(e,me);if(t){var n=Xe({finger:t,move:!0,values:Ee,source:Se}),r=n.newValue,a=n.activeIndex;j({sliderRef:De,activeIndex:a,setActive:be}),_e(r),X&&X(e,r)}})),Ke=Object(p.a)((function(e){var t=O(e,me);if(t){var n=Xe({finger:t,values:Ee,source:Se}).newValue;
2be(-1),"touchend"===e.type&&we(-1),Y&&Y(e,n),me.current=void 0;var r=f(De.current);r.removeEventListener("mousemove",Ye),r.removeEventListener("mouseup",Ke),r.removeEventListener("touchmove",Ye),r.removeEventListener("touchend",Ke)}})),Ze=Object(p.a)((function(e){e.preventDefault();var t=e.changedTouches[0];null!=t&&(me.current=t.identifier);var n=O(e,me),r=Xe({finger:n,values:Ee,source:Se}),a=r.newValue,i=r.activeIndex;j({sliderRef:De,activeIndex:i,setActive:be}),_e(a),X&&X(e,a);var o=f(De.current);o.addEventListener("touchmove",Ye),o.addEventListener("touchend",Ke)}));s.useEffect((function(){var e=De.current;e.addEventListener("touchstart",Ze);var t=f(e);return function(){e.removeEventListener("touchstart",Ze),t.removeEventListener("mousemove",Ye),t.removeEventListener("mouseup",Ke),t.removeEventListener("touchmove",Ye),t.removeEventListener("touchend",Ke)}}),[Ke,Ye,Ze]);var Je=Object(p.a)((function(e){K&&K(e),e.preventDefault();var t=O(e,me),n=Xe({finger:t,values:Ee,source:Se}),r=n.newValue,a=n.activeIndex;j({sliderRef:De,activeIndex:a,setActive:be}),_e(r),X&&X(e,r);var i=f(De.current);i.addEventListener("mousemove",Ye),i.addEventListener("mouseup",Ke)})),Qe=k(je?Ee[0]:H,H,V),$e=k(Ee[Ee.length-1],H,V)-Qe,et=Object(o.a)({},E[qe].offset(Qe),E[qe].leap($e));return s.createElement(I,Object(o.a)({ref:ze,className:Object(u.a)(C.root,C["color".concat(Object(v.a)(N))],M,P&&C.disabled,Te.length>0&&Te.some((function(e){return e.label}))&&C.marked,!1===ie&&C.trackFalse,"vertical"===J&&C.vertical,"inverted"===ie&&C.trackInverted),onMouseDown:Je},fe),s.createElement("span",{className:C.rail}),s.createElement("span",{className:C.track,style:et}),s.createElement("input",{value:Ee.join(","),name:q,type:"hidden"}),Te.map((function(e,t){var n,r=k(e.value,H,V),a=E[qe].offset(r);return n=!1===ie?-1!==Ee.indexOf(e.value):"normal"===ie&&(je?e.value>=Ee[0]&&e.value<=Ee[Ee.length-1]:e.value<=Ee[0])||"inverted"===ie&&(je?e.value<=Ee[0]||e.value>=Ee[Ee.length-1]:e.value>=Ee[0]),s.createElement(s.Fragment,{key:e.value},s.createElement("span",{style:a,"data-index":t,className:Object(u.a)(C.mark,n&&C.markActive)}),null!=e.label?s.createElement("span",{"aria-hidden":!0,"data-index":t,style:a,className:Object(u.a)(C.markLabel,n&&C.markLabelActive)},e.label):null)})),Ee.map((function(e,t){var r=k(e,H,V),a=E[qe].offset(r);return s.createElement(ue,{key:t,valueLabelFormat:de,valueLabelDisplay:le,className:C.valueLabel,value:"function"===typeof de?de($(e),t):de,index:t,open:xe===t||ge===t||"on"===le,disabled:P},s.createElement(re,{className:Object(u.a)(C.thumb,C["thumbColor".concat(Object(v.a)(N))],ge===t&&C.active,P&&C.disabled,Ie===t&&C.focusVisible),tabIndex:P?null:0,role:"slider",style:a,"data-index":t,"aria-label":z?z(t):n,"aria-labelledby":c,"aria-orientation":J,"aria-valuemax":$(V),"aria-valuemin":$(H),"aria-valuenow":$(e),"aria-valuetext":F?F($(e),t):h,onKeyDown:Ge,onFocus:Fe,onBlur:Be,onMouseOver:Ue,onMouseLeave:We}))})))}));t.a=Object(c.a)((function(e){return{root:{height:2,width:"100%",boxSizing:"content-box",padding:"13px 0",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",color:e.palette.primary.main,WebkitTapHighlightColor:"transparent","&$disabled":{pointerEvents:"none",cursor:"default",color:e.palette.grey[400]},"&$vertical":{width:2,height:"100%",padding:"0 13px"},"@media (pointer: coarse)":{padding:"20px 0","&$vertical":{padding:"0 20px"}},"@media print":{colorAdjust:"exact"}},colorPrimary:{},colorSecondary:{color:e.palette.secondary.main},marked:{marginBottom:20,"&$vertical":{marginBottom:"auto",marginRight:20}},vertical:{},disabled:{},rail:{display:"block",position:"absolute",width:"100%",height:2,borderRadius:1,backgroundColor:"currentColor",opacity:.38,"$vertical &":{height:"100%",width:2}},track:{display:"block",position:"absolute",height:2,borderRadius:1,backgroundColor:"currentColor","$vertical &":{width:2}},trackFalse:{"& $track":{display:"none"}},trackInverted:{"& $track":{backgroundColor:"light"===e.palette.type?Object(h.d)(e.palette.primary.main,.62):Object(h.a)(e.palette.primary.main,.5)},"& $rail":{opacity:1}},thumb:{position:"absolute",width:12,height:12,marginLeft:-6,marginTop:-5,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:e.transitions.create(["box-shadow"],{duration:e.transitions.duration.shortest}),"&::after":{position:"absolute",content:'""',borderRadius:"50%",left:-15,top:-15,right:-15,bottom:-15},"&$focusVisible,&:hover":{boxShadow:"0px 0px 0px 8px ".concat(Object(h.b)(e.palette.primary.main,.16)),"@media (hover: none)":{boxShadow:"none"}},"&$active":{boxShadow:"0px 0px 0px 14px ".concat(Object(h.b)(e.palette.primary.main,.16))},"&$disabled":{width:8,height:8,marginLeft:-4,marginTop:-3,"&:hover":{boxShadow:"none"}},"$vertical &":{marginLeft:-5,marginBottom:-6},"$vertical &$disabled":{marginLeft:-3,marginBottom:-4}},thumbColorPrimary:{},thumbColorSecondary:{"&$focusVisible,&:hover":{boxShadow:"0px 0px 0px 8px ".concat(Object(h.b)(e.palette.secondary.main,.16))},"&$active":{boxShadow:"0px 0px 0px 14px ".concat(Object(h.b)(e.palette.secondary.main,.16))}},active:{},focusVisible:{},valueLabel:{left:"calc(-50% - 4px)"},mark:{position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor"},markActive:{backgroundColor:e.palette.background.paper,opacity:.8},markLabel:Object(o.a)({},e.typography.body2,{color:e.palette.text.secondary,position:"absolute",top:26,transform:"translateX(-50%)",whiteSpace:"nowrap","$vertical &":{top:"auto",left:26,transform:"translateY(50%)"},"@media (pointer: coarse)":{top:40,"$vertical &":{left:31}}}),markLabelActive:{color:e.palette.text.primary}}}),{name:"MuiSlider"})(C)}]]);
3//# sourceMappingURL=2.b8d9e0d3.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.